X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/b04fe171f0375ecd5d8a24747ca1dff85720a0ca..6b200bc335dc93c5516ccb52f14bd896d8c7fad7:/SecurityTests/cspxutils/aesVect/enDecryptRef.c diff --git a/SecurityTests/cspxutils/aesVect/enDecryptRef.c b/SecurityTests/cspxutils/aesVect/enDecryptRef.c deleted file mode 100644 index 5f91b127..00000000 --- a/SecurityTests/cspxutils/aesVect/enDecryptRef.c +++ /dev/null @@ -1,56 +0,0 @@ -#include "enDecrypt.h" -#include "rijndaelApi.h" /* reference */ - -/* - * encrypt/decrypt using reference AES. - */ -CSSM_RETURN encryptDecryptRef( - CSSM_BOOL forEncrypt, - uint32 keySizeInBits, - uint32 blockSizeInBits, - const uint8 *key, // raw key bytes - const uint8 *inText, - uint32 inTextLen, - uint8 *outText) -{ - keyInstance aesKey; - cipherInstance aesCipher; - int artn; - - artn = _makeKey(&aesKey, - forEncrypt ? DIR_ENCRYPT : DIR_DECRYPT, - keySizeInBits, - blockSizeInBits, - (BYTE *)key); - if(artn <= 0) { - printf("***AES makeKey returned %d\n", artn); - return CSSM_ERRCODE_INTERNAL_ERROR; - } - artn = _cipherInit(&aesCipher, - MODE_ECB, - blockSizeInBits, - NULL); - if(artn <= 0) { - printf("***AES cipherInit returned %d\n", artn); - return CSSM_ERRCODE_INTERNAL_ERROR; - } - if(forEncrypt) { - artn = _blockEncrypt(&aesCipher, - &aesKey, - (BYTE *)inText, - inTextLen * 8, - (BYTE *)outText); - } - else { - artn = _blockDecrypt(&aesCipher, - &aesKey, - (BYTE *)inText, - inTextLen * 8, - (BYTE *)outText); - } - if(artn <= 0) { - printf("***AES Reference encrypt/decrypt returned %d\n", artn); - return CSSM_ERRCODE_INTERNAL_ERROR; - } - return CSSM_OK; -}