bc-java
bc-java copied to clipboard
Feature request: Add support for eXtended-nonce ChaCha (AEAD_XChaCha20_Poly1305)
https://tools.ietf.org/html/draft-irtf-cfrg-xchacha-01#section-2
AEAD_XChaCha20_Poly1305
XChaCha20-Poly1305 is a variant of the ChaCha20-Poly1305 AEAD
construction as defined in [RFC7539] that uses a 192-bit nonce
instead of a 96-bit nonce.
It might be possible to extend/tweak org.bouncycastle.crypto.modes.ChaCha20Poly1305
) to take in the NONCE_SIZE
in a constructor (or package private constructor)
Given that there is already the implementation of XSala20 and ChaCha20-Poly1305 in BC, it shouldn't be too complex to add it. I've found some experiments with BC.NET in the following url, but it cannot be imported as is: https://www.scottbrady91.com/C-Sharp/XChaCha20-Poly1305-dotnet It'd be a nice addition.
I address this in PR #957. The implementation really wasn't that much work along the lines of XSalsa20Engine