Skip to content

use HChaCha20 KDF for 128-bit key expansion in ChaCha20Poly1305#59

Merged
aead merged 1 commit into
masterfrom
chacha20-128bit
Apr 29, 2026
Merged

use HChaCha20 KDF for 128-bit key expansion in ChaCha20Poly1305#59
aead merged 1 commit into
masterfrom
chacha20-128bit

Conversation

@aead

@aead aead commented Apr 29, 2026

Copy link
Copy Markdown
Member

Replace the naive K128 | K128 key doubling with HChaCha20-based key derivation to avoid any structural relation between the two 128-bit halves of the expanded 256-bit key. The two halves are now derived independently using distinct nonces (1 and 2), ensuring the expanded key is indistinguishable from a uniformly random 256-bit key under the PRF security of HChaCha20.

@aead aead requested a review from klauspost April 29, 2026 18:54
@aead aead force-pushed the chacha20-128bit branch 2 times, most recently from 5d1c3d1 to c86f7da Compare April 29, 2026 19:07
Replace the naive K128 | K128 key doubling with HChaCha20-based key
derivation to avoid any structural relation between the two 128-bit
halves of the expanded 256-bit key. The two halves are now derived
independently using distinct nonces (1 and 2), ensuring the expanded
key is indistinguishable from a uniformly random 256-bit key under the
PRF security of HChaCha20.

Signed-off-by: Andreas Auernhammer <git@aead.dev>
@aead aead force-pushed the chacha20-128bit branch from c86f7da to a2def65 Compare April 29, 2026 19:08

@klauspost klauspost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, my initial through was to "stretch" with sha256, but this is much cleaner and doesn't bring in anything new.

@aead aead merged commit e1fddaa into master Apr 29, 2026
6 checks passed
@aead aead deleted the chacha20-128bit branch April 29, 2026 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants