mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
[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>
This commit is contained in:
parent
20ea340489
commit
06b42aa94b
1 changed files with 14 additions and 13 deletions
|
@ -26,37 +26,38 @@
|
|||
#define MAX_IVLEN 32
|
||||
|
||||
struct hash_testvec {
|
||||
/* only used with keyed hash algorithms */
|
||||
char key[128] __attribute__ ((__aligned__(4)));
|
||||
char plaintext[128];
|
||||
unsigned char psize;
|
||||
char digest[MAX_DIGEST_SIZE];
|
||||
unsigned char np;
|
||||
unsigned char tap[MAX_TAP];
|
||||
char key[128]; /* only used with keyed hash algorithms */
|
||||
unsigned char psize;
|
||||
unsigned char np;
|
||||
unsigned char ksize;
|
||||
};
|
||||
|
||||
struct hmac_testvec {
|
||||
char key[128];
|
||||
unsigned char ksize;
|
||||
char plaintext[128];
|
||||
unsigned char psize;
|
||||
char digest[MAX_DIGEST_SIZE];
|
||||
unsigned char np;
|
||||
unsigned char tap[MAX_TAP];
|
||||
unsigned char ksize;
|
||||
unsigned char psize;
|
||||
unsigned char np;
|
||||
};
|
||||
|
||||
struct cipher_testvec {
|
||||
unsigned char fail;
|
||||
unsigned char wk; /* weak key flag */
|
||||
char key[MAX_KEYLEN];
|
||||
unsigned char klen;
|
||||
char key[MAX_KEYLEN] __attribute__ ((__aligned__(4)));
|
||||
char iv[MAX_IVLEN];
|
||||
char input[48];
|
||||
unsigned char ilen;
|
||||
char result[48];
|
||||
unsigned char rlen;
|
||||
int np;
|
||||
unsigned char tap[MAX_TAP];
|
||||
int np;
|
||||
unsigned char fail;
|
||||
unsigned char wk; /* weak key flag */
|
||||
unsigned char klen;
|
||||
unsigned char ilen;
|
||||
unsigned char rlen;
|
||||
};
|
||||
|
||||
struct cipher_speed {
|
||||
|
|
Loading…
Reference in a new issue