Home GnuPG

rijndael: fix UBSAN warning on left shift by 24 places with type 'int'

Description

rijndael: fix UBSAN warning on left shift by 24 places with type 'int'

* cipher/rijndael.c (do_encrypt_fn, do_decrypt_fn): Cast final
sbox/inv_sbox look-ups to 'u32' type.

Fixes following type of UBSAN errors seen from generic C-implementation
of rijndael:

runtime error: left shift of <xx> by 24 places cannot be represented\
in type 'int'

where <xx> is greater than 127.

  • Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>

Details

Provenance
jukiviliAuthored on Jun 3 2020, 9:59 PM
Parents
rC3060aadec396: Disable all assembly modules with --disable-asm
Branches
Unknown
Tags
Unknown