diff options
author | Werner Koch <wk@gnupg.org> | 2009-12-10 16:51:25 +0000 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2009-12-10 16:51:25 +0000 |
commit | cadc7d134028b5e00d26a69a7f34a833fbda0690 (patch) | |
tree | f58b43d9cb32bd00ac96b78b5459145e7096248c /tests/benchmark.c | |
parent | 7c7829e4adb1cef10f28227a950a8993d044f429 (diff) | |
download | libgcrypt-cadc7d134028b5e00d26a69a7f34a833fbda0690.tar.gz |
Cleaned up the cipher encrypy/decrypt constraints checks.
Diffstat (limited to 'tests/benchmark.c')
-rw-r--r-- | tests/benchmark.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/tests/benchmark.c b/tests/benchmark.c index 83ddf373..214858df 100644 --- a/tests/benchmark.c +++ b/tests/benchmark.c @@ -460,12 +460,12 @@ cipher_bench ( const char *algoname ) size_t allocated_buflen, buflen; int repetitions; static struct { int mode; const char *name; int blocked; } modes[] = { - { GCRY_CIPHER_MODE_ECB, " ECB", 1 }, + { GCRY_CIPHER_MODE_ECB, " ECB/Stream", 1 }, { GCRY_CIPHER_MODE_CBC, " CBC", 1 }, { GCRY_CIPHER_MODE_CFB, " CFB", 0 }, { GCRY_CIPHER_MODE_OFB, " OFB", 0 }, { GCRY_CIPHER_MODE_CTR, " CTR", 0 }, - { GCRY_CIPHER_MODE_STREAM, " STREAM", 0 }, + { GCRY_CIPHER_MODE_STREAM, "", 0 }, {0} }; int modeidx; @@ -501,11 +501,13 @@ cipher_bench ( const char *algoname ) printf ("Running each test %d times.\n", cipher_repetitions); printf ("%-12s", ""); for (modeidx=0; modes[modeidx].mode; modeidx++) - printf (" %-15s", modes[modeidx].name ); + if (*modes[modeidx].name) + printf (" %-15s", modes[modeidx].name ); putchar ('\n'); printf ("%-12s", ""); for (modeidx=0; modes[modeidx].mode; modeidx++) - printf (" ---------------" ); + if (*modes[modeidx].name) + printf (" ---------------" ); putchar ('\n'); header_printed = 1; } @@ -548,10 +550,7 @@ cipher_bench ( const char *algoname ) { if ((blklen > 1 && modes[modeidx].mode == GCRY_CIPHER_MODE_STREAM) | (blklen == 1 && modes[modeidx].mode != GCRY_CIPHER_MODE_STREAM)) - { - printf (" " ); - continue; - } + continue; for (i=0; i < sizeof buf; i++) buf[i] = i; |