openssl/crypto/aes
Emilia Kasper be109b9eec Fix undefined behaviour in shifts.
Td4 and Te4 are arrays of u8. A u8 << int promotes the u8 to an int first then shifts.
If the mathematical result of a shift (as modelled by lhs * 2^{rhs}) is not representable
in an integer, behaviour is undefined. In other words, you can't shift into the sign bit
of a signed integer. Fix this by casting to u32 whenever we're shifting left by 24.

(For consistency, cast other shifts, too.)

Caught by -fsanitize=shift

Submitted by Nick Lewycky (Google)

Reviewed-by: Andy Polyakov <appro@openssl.org>
(cherry picked from commit 8b37e5c14f)
2015-03-13 21:14:20 -07:00
..
asm Fix macosx-ppc build (and typos in unwind info). 2015-01-22 12:15:34 +01:00
.cvsignore Ignore more. 2012-12-13 12:43:18 +00:00
aes.h Run util/openssl-format-source -v -c . 2015-01-22 09:31:38 +00:00
aes_cbc.c Run util/openssl-format-source -v -c . 2015-01-22 09:31:38 +00:00
aes_cfb.c Run util/openssl-format-source -v -c . 2015-01-22 09:31:38 +00:00
aes_core.c Fix undefined behaviour in shifts. 2015-03-13 21:14:20 -07:00
aes_ctr.c Run util/openssl-format-source -v -c . 2015-01-22 09:31:38 +00:00
aes_ecb.c Run util/openssl-format-source -v -c . 2015-01-22 09:31:38 +00:00
aes_ige.c Run util/openssl-format-source -v -c . 2015-01-22 09:31:38 +00:00
aes_locl.h Run util/openssl-format-source -v -c . 2015-01-22 09:31:38 +00:00
aes_misc.c Run util/openssl-format-source -v -c . 2015-01-22 09:31:38 +00:00
aes_ofb.c Run util/openssl-format-source -v -c . 2015-01-22 09:31:38 +00:00
aes_wrap.c Run util/openssl-format-source -v -c . 2015-01-22 09:31:38 +00:00
aes_x86core.c Fix undefined behaviour in shifts. 2015-03-13 21:14:20 -07:00
Makefile Fix crash in SPARC T4 XTS. 2015-02-24 10:12:57 +01:00
README

This is an OpenSSL-compatible version of AES (also called Rijndael).
aes_core.c is basically the same as rijndael-alg-fst.c but with an
API that looks like the rest of the OpenSSL symmetric cipher suite.