Home GnuPG

rijndael: fix compiler warnings on ARM
cc26106dbebeUnpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

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>

Details

Provenance
jukiviliAuthored on Dec 23 2014, 11:13 AM
Parents
rC520070e02e2e: Poly1305-AEAD: updated implementation to match draft-irtf-cfrg-chacha20…
Branches
Unknown
Tags
Unknown

Event Timeline

Jussi Kivilinna <jussi.kivilinna@iki.fi> committed rCcc26106dbebe: rijndael: fix compiler warnings on ARM (authored by Jussi Kivilinna <jussi.kivilinna@iki.fi>).Dec 25 2014, 10:16 AM