#include "rijndael.h"
#include "serpent-gladman.h"
#include "serpent.h"
#include "speedtest.h"
void test_my_rijndael_ecb()
{
RijndaelEncryptECB encctx;
encctx.set_key(enckey, 32);
encctx.encrypt(buffer, buffer, bufferlen);
RijndaelDecryptECB decctx;
decctx.set_key(enckey, 32);
decctx.decrypt(buffer, buffer, bufferlen);
}
void test_gladman_serpent_ecb()
{
SerpentGladman::EncryptECB encctx;
encctx.set_key(enckey, 32);
encctx.encrypt(buffer, buffer, bufferlen);
SerpentGladman::DecryptECB decctx;
decctx.set_key(enckey, 32);
decctx.decrypt(buffer, buffer, bufferlen);
}
void test_mybotan_serpent_ecb()
{
SerpentBotan::EncryptECB encctx;
encctx.set_key(enckey, 32);
encctx.encrypt(buffer, buffer, bufferlen);
SerpentBotan::DecryptECB decctx;
decctx.set_key(enckey, 32);
decctx.decrypt(buffer, buffer, bufferlen);
}
int main()
{
srand(time(NULL));
for(unsigned int i = 0; i < sizeof(enckey); ++i)
enckey[i] = rand();
for(unsigned int i = 0; i < sizeof(enciv); ++i)
enciv[i] = rand();
run_test<test_my_rijndael_ecb>("my-rijndael-ecb.txt");
run_test<test_gladman_serpent_ecb>("gladman-serpent-ecb.txt");
run_test<test_mybotan_serpent_ecb>("mybotan-serpent-ecb.txt");
}