bc-java icon indicating copy to clipboard operation
bc-java copied to clipboard

Feature request: Add support for eXtended-nonce ChaCha (AEAD_XChaCha20_Poly1305)

Open bdemers opened this issue 5 years ago • 3 comments

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.

bdemers avatar Dec 03 '19 22:12 bdemers

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)

bdemers avatar Dec 03 '19 22:12 bdemers

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.

alexdupre avatar Dec 18 '20 15:12 alexdupre

I address this in PR #957. The implementation really wasn't that much work along the lines of XSalsa20Engine

Traderjoe95 avatar May 20 '21 13:05 Traderjoe95