2 #include "rijndaelApi.h" /* reference */
5 * encrypt/decrypt using reference AES.
7 CSSM_RETURN
encryptDecryptRef(
10 uint32 blockSizeInBits
,
11 const uint8
*key
, // raw key bytes
17 cipherInstance aesCipher
;
20 artn
= _makeKey(&aesKey
,
21 forEncrypt
? DIR_ENCRYPT
: DIR_DECRYPT
,
26 printf("***AES makeKey returned %d\n", artn
);
27 return CSSM_ERRCODE_INTERNAL_ERROR
;
29 artn
= _cipherInit(&aesCipher
,
34 printf("***AES cipherInit returned %d\n", artn
);
35 return CSSM_ERRCODE_INTERNAL_ERROR
;
38 artn
= _blockEncrypt(&aesCipher
,
45 artn
= _blockDecrypt(&aesCipher
,
52 printf("***AES Reference encrypt/decrypt returned %d\n", artn
);
53 return CSSM_ERRCODE_INTERNAL_ERROR
;