Home GnuPG

chacha20-ppc: fix 32-bit counter overflow handling

Description

chacha20-ppc: fix 32-bit counter overflow handling

* cipher/chacha20-ppc.c (vec_add_ctr_u64, ADD_U64): New.
(_gcry_chacha20_ppc8_blocks1, _gcry_chacha20_ppc8_blocks4)
(_gcry_chacha20_poly1305_ppc8_blocks4): Use ADD_U64 when incrementing
counter.

Patch fixes 32-bit overflow for PowerPC ChaCha20 implementation.
In typical use case, overflow happens after 256 GiB bytes of output.

Typical use case here means use of 96-bit or 64-bit IV which causes
lower 32-bits of counter to start from zero.

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

Details

Provenance
jukiviliAuthored on Dec 2 2020, 7:44 PM
Parents
rC9769b40b54cf: tests: Put a work around to tests/random for macOS.
Branches
Unknown
Tags
Unknown