summaryrefslogtreecommitdiffstats
path: root/crypto/tcrypt.h
diff options
context:
space:
mode:
authorSebastian Siewior <sebastian@breakpoint.cc>2008-03-11 21:27:11 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2008-04-21 10:19:21 +0800
commitd5dc392742a9818e2766a63f3533980543e18060 (patch)
tree2dcd8083cba1b1e22c4e01c50d479ca2502a1139 /crypto/tcrypt.h
parent477035c2abdcff7583369e5777cb7be1bb1dbea8 (diff)
downloadop-kernel-dev-d5dc392742a9818e2766a63f3533980543e18060.zip
op-kernel-dev-d5dc392742a9818e2766a63f3533980543e18060.tar.gz
[CRYPTO] tcrypt: Shrink speed templates
The speed templates as it look always the same. The key size is repeated for each block size and we test always the same block size. The addition of one inner loop makes it possible to get rid of the struct and it is possible to use a tiny u8 array :) Signed-off-by: Sebastian Siewior <sebastian@breakpoint.cc> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/tcrypt.h')
-rw-r--r--crypto/tcrypt.h129
1 files changed, 7 insertions, 122 deletions
diff --git a/crypto/tcrypt.h b/crypto/tcrypt.h
index 4180a74..45e79b5 100644
--- a/crypto/tcrypt.h
+++ b/crypto/tcrypt.h
@@ -72,11 +72,6 @@ struct aead_testvec {
unsigned short rlen;
};
-struct cipher_speed {
- unsigned char klen;
- unsigned int blen;
-};
-
struct hash_speed {
unsigned int blen; /* buffer length */
unsigned int plen; /* per-update length */
@@ -8032,123 +8027,13 @@ static struct hash_testvec crc32c_tv_template[] = {
/*
* Cipher speed tests
*/
-static struct cipher_speed speed_template_8[] = {
- { .klen = 8, .blen = 16, },
- { .klen = 8, .blen = 64, },
- { .klen = 8, .blen = 256, },
- { .klen = 8, .blen = 1024, },
- { .klen = 8, .blen = 8192, },
-
- /* End marker */
- { .klen = 0, .blen = 0, }
-};
-
-static struct cipher_speed speed_template_24[] = {
- { .klen = 24, .blen = 16, },
- { .klen = 24, .blen = 64, },
- { .klen = 24, .blen = 256, },
- { .klen = 24, .blen = 1024, },
- { .klen = 24, .blen = 8192, },
-
- /* End marker */
- { .klen = 0, .blen = 0, }
-};
-
-static struct cipher_speed speed_template_8_32[] = {
- /* Don't support blowfish keys > 256 bit in this test */
- { .klen = 8, .blen = 16, },
- { .klen = 8, .blen = 64, },
- { .klen = 8, .blen = 256, },
- { .klen = 8, .blen = 1024, },
- { .klen = 8, .blen = 8192, },
- { .klen = 32, .blen = 16, },
- { .klen = 32, .blen = 64, },
- { .klen = 32, .blen = 256, },
- { .klen = 32, .blen = 1024, },
- { .klen = 32, .blen = 8192, },
-
- /* End marker */
- { .klen = 0, .blen = 0, }
-};
-
-static struct cipher_speed speed_template_16_32[] = {
- { .klen = 16, .blen = 16, },
- { .klen = 16, .blen = 64, },
- { .klen = 16, .blen = 256, },
- { .klen = 16, .blen = 1024, },
- { .klen = 16, .blen = 8192, },
- { .klen = 32, .blen = 16, },
- { .klen = 32, .blen = 64, },
- { .klen = 32, .blen = 256, },
- { .klen = 32, .blen = 1024, },
- { .klen = 32, .blen = 8192, },
-
- /* End marker */
- { .klen = 0, .blen = 0, }
-};
-
-static struct cipher_speed speed_template_16_24_32[] = {
- { .klen = 16, .blen = 16, },
- { .klen = 16, .blen = 64, },
- { .klen = 16, .blen = 256, },
- { .klen = 16, .blen = 1024, },
- { .klen = 16, .blen = 8192, },
- { .klen = 24, .blen = 16, },
- { .klen = 24, .blen = 64, },
- { .klen = 24, .blen = 256, },
- { .klen = 24, .blen = 1024, },
- { .klen = 24, .blen = 8192, },
- { .klen = 32, .blen = 16, },
- { .klen = 32, .blen = 64, },
- { .klen = 32, .blen = 256, },
- { .klen = 32, .blen = 1024, },
- { .klen = 32, .blen = 8192, },
-
- /* End marker */
- { .klen = 0, .blen = 0, }
-};
-
-static struct cipher_speed speed_template_32_40_48[] = {
- { .klen = 32, .blen = 16, },
- { .klen = 32, .blen = 64, },
- { .klen = 32, .blen = 256, },
- { .klen = 32, .blen = 1024, },
- { .klen = 32, .blen = 8192, },
- { .klen = 40, .blen = 16, },
- { .klen = 40, .blen = 64, },
- { .klen = 40, .blen = 256, },
- { .klen = 40, .blen = 1024, },
- { .klen = 40, .blen = 8192, },
- { .klen = 48, .blen = 16, },
- { .klen = 48, .blen = 64, },
- { .klen = 48, .blen = 256, },
- { .klen = 48, .blen = 1024, },
- { .klen = 48, .blen = 8192, },
-
- /* End marker */
- { .klen = 0, .blen = 0, }
-};
-
-static struct cipher_speed speed_template_32_48_64[] = {
- { .klen = 32, .blen = 16, },
- { .klen = 32, .blen = 64, },
- { .klen = 32, .blen = 256, },
- { .klen = 32, .blen = 1024, },
- { .klen = 32, .blen = 8192, },
- { .klen = 48, .blen = 16, },
- { .klen = 48, .blen = 64, },
- { .klen = 48, .blen = 256, },
- { .klen = 48, .blen = 1024, },
- { .klen = 48, .blen = 8192, },
- { .klen = 64, .blen = 16, },
- { .klen = 64, .blen = 64, },
- { .klen = 64, .blen = 256, },
- { .klen = 64, .blen = 1024, },
- { .klen = 64, .blen = 8192, },
-
- /* End marker */
- { .klen = 0, .blen = 0, }
-};
+static u8 speed_template_8[] = {8, 0};
+static u8 speed_template_24[] = {24, 0};
+static u8 speed_template_8_32[] = {8, 32, 0};
+static u8 speed_template_16_32[] = {16, 32, 0};
+static u8 speed_template_16_24_32[] = {16, 24, 32, 0};
+static u8 speed_template_32_40_48[] = {32, 40, 48, 0};
+static u8 speed_template_32_48_64[] = {32, 48, 64, 0};
/*
* Digest speed tests
OpenPOWER on IntegriCloud