aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/tcrypt.h
diff options
context:
space:
mode:
authorMichal Ludvig <michal@logix.cz>2006-05-30 08:04:19 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2006-06-26 03:34:41 -0400
commite805792851bcb0bb42f0c8a352be64564c13e374 (patch)
treeb0668a398fd8398601cd43219a9fb04b31b9dc86 /crypto/tcrypt.h
parent14fdf477a7e3ff54f8e67fe506dd2677a36c56e4 (diff)
[CRYPTO] tcrypt: Speed benchmark support for digest algorithms
This patch adds speed tests (benchmarks) for digest algorithms. Tests are run with different buffer sizes (16 bytes, ... 8 kBytes) and with each buffer multiple tests are run with different update() sizes (e.g. hash 64 bytes buffer in four 16 byte updates). There is no correctness checking of the result and all tests and algorithms use the same input buffer. Signed-off-by: Michal Ludvig <michal@logix.cz> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/tcrypt.h')
-rw-r--r--crypto/tcrypt.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/crypto/tcrypt.h b/crypto/tcrypt.h
index 1f683ba794ee..1fac5602f633 100644
--- a/crypto/tcrypt.h
+++ b/crypto/tcrypt.h
@@ -65,6 +65,11 @@ struct cipher_speed {
65 unsigned int blen; 65 unsigned int blen;
66}; 66};
67 67
68struct digest_speed {
69 unsigned int blen; /* buffer length */
70 unsigned int plen; /* per-update length */
71};
72
68/* 73/*
69 * MD4 test vectors from RFC1320 74 * MD4 test vectors from RFC1320
70 */ 75 */
@@ -2975,4 +2980,35 @@ static struct cipher_speed des_speed_template[] = {
2975 { .klen = 0, .blen = 0, } 2980 { .klen = 0, .blen = 0, }
2976}; 2981};
2977 2982
2983/*
2984 * Digest speed tests
2985 */
2986static struct digest_speed generic_digest_speed_template[] = {
2987 { .blen = 16, .plen = 16, },
2988 { .blen = 64, .plen = 16, },
2989 { .blen = 64, .plen = 64, },
2990 { .blen = 256, .plen = 16, },
2991 { .blen = 256, .plen = 64, },
2992 { .blen = 256, .plen = 256, },
2993 { .blen = 1024, .plen = 16, },
2994 { .blen = 1024, .plen = 256, },
2995 { .blen = 1024, .plen = 1024, },
2996 { .blen = 2048, .plen = 16, },
2997 { .blen = 2048, .plen = 256, },
2998 { .blen = 2048, .plen = 1024, },
2999 { .blen = 2048, .plen = 2048, },
3000 { .blen = 4096, .plen = 16, },
3001 { .blen = 4096, .plen = 256, },
3002 { .blen = 4096, .plen = 1024, },
3003 { .blen = 4096, .plen = 4096, },
3004 { .blen = 8192, .plen = 16, },
3005 { .blen = 8192, .plen = 256, },
3006 { .blen = 8192, .plen = 1024, },
3007 { .blen = 8192, .plen = 4096, },
3008 { .blen = 8192, .plen = 8192, },
3009
3010 /* End marker */
3011 { .blen = 0, .plen = 0, }
3012};
3013
2978#endif /* _CRYPTO_TCRYPT_H */ 3014#endif /* _CRYPTO_TCRYPT_H */