forked from wolfSSL/wolfssl
added aes-gcm to the benchmark tests
This commit is contained in:
@ -54,6 +54,7 @@ void bench_arc4();
|
|||||||
void bench_hc128();
|
void bench_hc128();
|
||||||
void bench_rabbit();
|
void bench_rabbit();
|
||||||
void bench_aes(int);
|
void bench_aes(int);
|
||||||
|
void bench_aesgcm();
|
||||||
|
|
||||||
void bench_md5();
|
void bench_md5();
|
||||||
void bench_sha();
|
void bench_sha();
|
||||||
@ -78,6 +79,9 @@ int main(int argc, char** argv)
|
|||||||
#ifndef NO_AES
|
#ifndef NO_AES
|
||||||
bench_aes(0);
|
bench_aes(0);
|
||||||
bench_aes(1);
|
bench_aes(1);
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_AESGCM
|
||||||
|
bench_aesgcm();
|
||||||
#endif
|
#endif
|
||||||
bench_arc4();
|
bench_arc4();
|
||||||
#ifdef HAVE_HC128
|
#ifdef HAVE_HC128
|
||||||
@ -171,6 +175,33 @@ void bench_aes(int show)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
byte additional[13];
|
||||||
|
byte tag[16];
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef HAVE_AESGCM
|
||||||
|
void bench_aesgcm()
|
||||||
|
{
|
||||||
|
Aes enc;
|
||||||
|
double start, total, persec;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
AesSetKey(&enc, key, 16, iv, AES_ENCRYPTION);
|
||||||
|
start = current_time();
|
||||||
|
|
||||||
|
for(i = 0; i < megs; i++)
|
||||||
|
AesGcmEncrypt(&enc, cipher, plain, sizeof(plain),
|
||||||
|
tag, 16, additional, 13);
|
||||||
|
|
||||||
|
total = current_time() - start;
|
||||||
|
|
||||||
|
persec = 1 / total * megs;
|
||||||
|
printf("AES-GCM %d megs took %5.3f seconds, %6.2f MB/s\n", megs, total,
|
||||||
|
persec);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifndef NO_DES3
|
#ifndef NO_DES3
|
||||||
void bench_des()
|
void bench_des()
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user