crypto: streebog - fix unaligned memory accesses

Don't cast the data buffer directly to streebog_uint512, as this
violates alignment rules.

Fixes: fe18957e8e ("crypto: streebog - add Streebog hash function")
Cc: Vitaly Chikunov <vt@altlinux.org>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Vitaly Chikunov <vt@altlinux.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Eric Biggers
2019-03-31 13:04:19 -07:00
committed by Herbert Xu
parent 5e27f38f1f
commit c5c46887cf
2 changed files with 17 additions and 13 deletions

View File

@@ -23,7 +23,10 @@ struct streebog_uint512 {
};
struct streebog_state {
u8 buffer[STREEBOG_BLOCK_SIZE];
union {
u8 buffer[STREEBOG_BLOCK_SIZE];
struct streebog_uint512 m;
};
struct streebog_uint512 hash;
struct streebog_uint512 h;
struct streebog_uint512 N;