rijndael: fix compiler warnings on ARM
authorJussi Kivilinna <jussi.kivilinna@iki.fi>
Tue, 23 Dec 2014 10:13:50 +0000 (12:13 +0200)
committerJussi Kivilinna <jussi.kivilinna@iki.fi>
Thu, 25 Dec 2014 09:16:48 +0000 (11:16 +0200)
commitcc26106dbebeb84d481661813edc3e5aea9a7d99
treeab9514703f8460f8c046d7c1ec711e19a44afb20
parent520070e02e2e6ee7228945015573a6e1f4895ec3
rijndael: fix compiler warnings on ARM

* cipher/rijndael-internal.h (RIJNDAEL_context_s): Add u32 variants of
keyschedule arrays to unions u1 and u2.
(keyschedenc32, keyscheddec32): New.
* cipher/rijndael.c (u32_a_t): Remove.
(do_setkey): Add and use tkk[].data32, k_u32, tk_u32 and W_u32; Remove
casting byte arrays to u32_a_t.
(prepare_decryption, do_encrypt_fn, do_decrypt_fn): Use keyschedenc32
and keyscheddec32; Remove casting byte arrays to u32_a_t.
--

Patch fixes 'cast increases required alignment' compiler warnings that GCC was showing:

rijndael.c: In function 'do_setkey':
rijndael.c:310:13: warning: cast increases required alignment of target type [-Wcast-align]
           *((u32_a_t*)tk[j]) = *((u32_a_t*)k[j]);
             ^
rijndael.c:310:34: warning: cast increases required alignment of target type [-Wcast-align]
           *((u32_a_t*)tk[j]) = *((u32_a_t*)k[j]);
[removed the rest]

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
cipher/rijndael-internal.h
cipher/rijndael.c