aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/tcrypt.h
diff options
context:
space:
mode:
authorSebastian Siewior <sebastian@breakpoint.cc>2008-03-11 09:27:11 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2008-04-20 22:19:21 -0400
commitd5dc392742a9818e2766a63f3533980543e18060 (patch)
tree2dcd8083cba1b1e22c4e01c50d479ca2502a1139 /crypto/tcrypt.h
parent477035c2abdcff7583369e5777cb7be1bb1dbea8 (diff)
[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 4180a7463e4e..45e79b56fe96 100644
--- a/crypto/tcrypt.h
+++ b/crypto/tcrypt.h
@@ -72,11 +72,6 @@ struct aead_testvec {
72 unsigned short rlen; 72 unsigned short rlen;
73}; 73};
74 74
75struct cipher_speed {
76 unsigned char klen;
77 unsigned int blen;
78};
79
80struct hash_speed { 75struct hash_speed {
81 unsigned int blen; /* buffer length */ 76 unsigned int blen; /* buffer length */
82 unsigned int plen; /* per-update length */ 77 unsigned int plen; /* per-update length */
@@ -8032,123 +8027,13 @@ static struct hash_testvec crc32c_tv_template[] = {
8032/* 8027/*
8033 * Cipher speed tests 8028 * Cipher speed tests
8034 */ 8029 */
8035static struct cipher_speed speed_template_8[] = { 8030static u8 speed_template_8[] = {8, 0};
8036 { .klen = 8, .blen = 16, }, 8031static u8 speed_template_24[] = {24, 0};
8037 { .klen = 8, .blen = 64, }, 8032static u8 speed_template_8_32[] = {8, 32, 0};
8038 { .klen = 8, .blen = 256, }, 8033static u8 speed_template_16_32[] = {16, 32, 0};
8039 { .klen = 8, .blen = 1024, }, 8034static u8 speed_template_16_24_32[] = {16, 24, 32, 0};
8040 { .klen = 8, .blen = 8192, }, 8035static u8 speed_template_32_40_48[] = {32, 40, 48, 0};
8041 8036static u8 speed_template_32_48_64[] = {32, 48, 64, 0};
8042 /* End marker */
8043 { .klen = 0, .blen = 0, }
8044};
8045
8046static struct cipher_speed speed_template_24[] = {
8047 { .klen = 24, .blen = 16, },
8048 { .klen = 24, .blen = 64, },
8049 { .klen = 24, .blen = 256, },
8050 { .klen = 24, .blen = 1024, },
8051 { .klen = 24, .blen = 8192, },
8052
8053 /* End marker */
8054 { .klen = 0, .blen = 0, }
8055};
8056
8057static struct cipher_speed speed_template_8_32[] = {
8058 /* Don't support blowfish keys > 256 bit in this test */
8059 { .klen = 8, .blen = 16, },
8060 { .klen = 8, .blen = 64, },
8061 { .klen = 8, .blen = 256, },
8062 { .klen = 8, .blen = 1024, },
8063 { .klen = 8, .blen = 8192, },
8064 { .klen = 32, .blen = 16, },
8065 { .klen = 32, .blen = 64, },
8066 { .klen = 32, .blen = 256, },
8067 { .klen = 32, .blen = 1024, },
8068 { .klen = 32, .blen = 8192, },
8069
8070 /* End marker */
8071 { .klen = 0, .blen = 0, }
8072};
8073
8074static struct cipher_speed speed_template_16_32[] = {
8075 { .klen = 16, .blen = 16, },
8076 { .klen = 16, .blen = 64, },
8077 { .klen = 16, .blen = 256, },
8078 { .klen = 16, .blen = 1024, },
8079 { .klen = 16, .blen = 8192, },
8080 { .klen = 32, .blen = 16, },
8081 { .klen = 32, .blen = 64, },
8082 { .klen = 32, .blen = 256, },
8083 { .klen = 32, .blen = 1024, },
8084 { .klen = 32, .blen = 8192, },
8085
8086 /* End marker */
8087 { .klen = 0, .blen = 0, }
8088};
8089
8090static struct cipher_speed speed_template_16_24_32[] = {
8091 { .klen = 16, .blen = 16, },
8092 { .klen = 16, .blen = 64, },
8093 { .klen = 16, .blen = 256, },
8094 { .klen = 16, .blen = 1024, },
8095 { .klen = 16, .blen = 8192, },
8096 { .klen = 24, .blen = 16, },
8097 { .klen = 24, .blen = 64, },
8098 { .klen = 24, .blen = 256, },
8099 { .klen = 24, .blen = 1024, },
8100 { .klen = 24, .blen = 8192, },
8101 { .klen = 32, .blen = 16, },
8102 { .klen = 32, .blen = 64, },
8103 { .klen = 32, .blen = 256, },
8104 { .klen = 32, .blen = 1024, },
8105 { .klen = 32, .blen = 8192, },
8106
8107 /* End marker */
8108 { .klen = 0, .blen = 0, }
8109};
8110
8111static struct cipher_speed speed_template_32_40_48[] = {
8112 { .klen = 32, .blen = 16, },
8113 { .klen = 32, .blen = 64, },
8114 { .klen = 32, .blen = 256, },
8115 { .klen = 32, .blen = 1024, },
8116 { .klen = 32, .blen = 8192, },
8117 { .klen = 40, .blen = 16, },
8118 { .klen = 40, .blen = 64, },
8119 { .klen = 40, .blen = 256, },
8120 { .klen = 40, .blen = 1024, },
8121 { .klen = 40, .blen = 8192, },
8122 { .klen = 48, .blen = 16, },
8123 { .klen = 48, .blen = 64, },
8124 { .klen = 48, .blen = 256, },
8125 { .klen = 48, .blen = 1024, },
8126 { .klen = 48, .blen = 8192, },
8127
8128 /* End marker */
8129 { .klen = 0, .blen = 0, }
8130};
8131
8132static struct cipher_speed speed_template_32_48_64[] = {
8133 { .klen = 32, .blen = 16, },
8134 { .klen = 32, .blen = 64, },
8135 { .klen = 32, .blen = 256, },
8136 { .klen = 32, .blen = 1024, },
8137 { .klen = 32, .blen = 8192, },
8138 { .klen = 48, .blen = 16, },
8139 { .klen = 48, .blen = 64, },
8140 { .klen = 48, .blen = 256, },
8141 { .klen = 48, .blen = 1024, },
8142 { .klen = 48, .blen = 8192, },
8143 { .klen = 64, .blen = 16, },
8144 { .klen = 64, .blen = 64, },
8145 { .klen = 64, .blen = 256, },
8146 { .klen = 64, .blen = 1024, },
8147 { .klen = 64, .blen = 8192, },
8148
8149 /* End marker */
8150 { .klen = 0, .blen = 0, }
8151};
8152 8037
8153/* 8038/*
8154 * Digest speed tests 8039 * Digest speed tests