HChaCha_OperateKeystream

31 views
Skip to first unread message

an Q

unread,
Jul 25, 2023, 9:20:27 AM7/25/23
to Crypto++ Users
Good day!

Could someone please clarify if the XChaCha key derivation function in Crypto++ is consistent with the functionality outlined in “XChaCha: eXtended-nonce ChaCha and AEAD_XChaCha20_Poly1305 draft-irtf-cfrg-xchacha-03”? Implementing just the HChaCha_OperateKeystream function using the test vectors outlined in the document produces results consistent with the document. However, executing HChaCha_OperateKeystream using the ChaCha values from the initial XChaCha20 setup does not produce an XChaCha key consistent with the final result. Could someone please clarify the input to HChaCha_OperateKeystream in the Crypto++ implementation as using the ChaCha key and block counter with 64-bit nonce as the 128-bit input does not produce the same values as the XChaCha20 key? Thank you.

Jeffrey Walton

unread,
Jul 25, 2023, 10:38:22 AM7/25/23
to Crypto++ Users
On Tuesday, July 25, 2023 at 9:20:27 AM UTC-4 6a7...@gmail.com wrote:

Could someone please clarify if the XChaCha key derivation function in Crypto++ is consistent with the functionality outlined in “XChaCha: eXtended-nonce ChaCha and AEAD_XChaCha20_Poly1305 draft-irtf-cfrg-xchacha-03”? Implementing just the HChaCha_OperateKeystream function using the test vectors outlined in the document produces results consistent with the document. However, executing HChaCha_OperateKeystream using the ChaCha values from the initial XChaCha20 setup does not produce an XChaCha key consistent with the final result. Could someone please clarify the input to HChaCha_OperateKeystream in the Crypto++ implementation as using the ChaCha key and block counter with 64-bit nonce as the 128-bit input does not produce the same values as the XChaCha20 key? Thank you.



I also seem to recall Crypto++ had a bug in the ChaCha gear when running on AVX2. See ChaCha and incorrect result when using AVX2, https://github.com/weidai11/cryptopp/issues/1069 .

Jeff
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages