aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>2006-03-13 05:39:23 -0500
committerHerbert Xu <herbert@gondor.apana.org.au>2006-03-21 04:14:09 -0500
commit06b42aa94b65806b4f8c5fc893ef97a2f491fb32 (patch)
treef0d97bffb17bf4539c86bfcf1a38af3a441608bb
parent20ea340489ddee7b3a438ee58f32f2608cc145de (diff)
[CRYPTO] tcrypt: Fix key alignment
Force 32-bit alignment on keys in tcrypt test vectors. Also rearrange the structure to prevent unnecessary padding. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--crypto/tcrypt.h25
1 files changed, 13 insertions, 12 deletions
diff --git a/crypto/tcrypt.h b/crypto/tcrypt.h
index 733d07ed75e9..1f683ba794ee 100644
--- a/crypto/tcrypt.h
+++ b/crypto/tcrypt.h
@@ -26,37 +26,38 @@
26#define MAX_IVLEN 32 26#define MAX_IVLEN 32
27 27
28struct hash_testvec { 28struct hash_testvec {
29 /* only used with keyed hash algorithms */
30 char key[128] __attribute__ ((__aligned__(4)));
29 char plaintext[128]; 31 char plaintext[128];
30 unsigned char psize;
31 char digest[MAX_DIGEST_SIZE]; 32 char digest[MAX_DIGEST_SIZE];
32 unsigned char np;
33 unsigned char tap[MAX_TAP]; 33 unsigned char tap[MAX_TAP];
34 char key[128]; /* only used with keyed hash algorithms */ 34 unsigned char psize;
35 unsigned char np;
35 unsigned char ksize; 36 unsigned char ksize;
36}; 37};
37 38
38struct hmac_testvec { 39struct hmac_testvec {
39 char key[128]; 40 char key[128];
40 unsigned char ksize;
41 char plaintext[128]; 41 char plaintext[128];
42 unsigned char psize;
43 char digest[MAX_DIGEST_SIZE]; 42 char digest[MAX_DIGEST_SIZE];
44 unsigned char np;
45 unsigned char tap[MAX_TAP]; 43 unsigned char tap[MAX_TAP];
44 unsigned char ksize;
45 unsigned char psize;
46 unsigned char np;
46}; 47};
47 48
48struct cipher_testvec { 49struct cipher_testvec {
50 char key[MAX_KEYLEN] __attribute__ ((__aligned__(4)));
51 char iv[MAX_IVLEN];
52 char input[48];
53 char result[48];
54 unsigned char tap[MAX_TAP];
55 int np;
49 unsigned char fail; 56 unsigned char fail;
50 unsigned char wk; /* weak key flag */ 57 unsigned char wk; /* weak key flag */
51 char key[MAX_KEYLEN];
52 unsigned char klen; 58 unsigned char klen;
53 char iv[MAX_IVLEN];
54 char input[48];
55 unsigned char ilen; 59 unsigned char ilen;
56 char result[48];
57 unsigned char rlen; 60 unsigned char rlen;
58 int np;
59 unsigned char tap[MAX_TAP];
60}; 61};
61 62
62struct cipher_speed { 63struct cipher_speed {