CommonCryptoBlowfish.c [plain text]
#include <stdio.h>
#include "CCCryptorTestFuncs.h"
#include "testbyteBuffer.h"
#include "testmore.h"
#include "capabilities.h"
#if (CCBLOWFISH == 0)
entryPoint(CommonCryptoBlowfish,"CommonCrypto Blowfish Testing")
#else
static int kTestTestCount = 1;
int CommonCryptoBlowfish(int argc, char *const *argv)
{
char *keyStr;
char *iv = NULL;
char *plainText;
char *cipherText;
CCMode mode;
CCAlgorithm alg;
CCPadding padding;
int retval, accum = 0;
keyStr = "FEDCBA9876543210FEDCBA9876543210";
plainText = "31323334353637383132333435363738313233343536373831323334353637383132333435363738313233343536373831323334353637383132333435363738";
cipherText = "695347477477FC1E695347477477FC1E695347477477FC1E695347477477FC1E695347477477FC1E695347477477FC1E695347477477FC1E695347477477FC1E";
mode = kCCModeECB;
alg = kCCAlgorithmBlowfish;
padding = ccNoPadding;
plan_tests(kTestTestCount);
retval = CCModeTestCase(keyStr, iv, mode, alg, padding, cipherText, plainText);
ok(retval == 0, "Blowfish Test 1");
accum += retval;
return accum;
}
#endif