Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/crypto: chacha20 lacks method to set counter, which is needed for QUIC #36862

Closed
marten-seemann opened this issue Jan 29, 2020 · 1 comment
Closed

Comments

@marten-seemann
Copy link
Contributor

@marten-seemann marten-seemann commented Jan 29, 2020

QUIC uses ChaCha20 for its header protection: https://tools.ietf.org/html/draft-ietf-quic-tls-25#section-5.4.4. In order to calculate the header protection mask, a QUIC implementation needs to be able to set the counter based on the ciphertext:

The first 4 bytes of the sampled ciphertext are the block counter.

Unfortunately, x/crypto/chacha20 currently doesn't provide an API to manually set the counter, and I therefore have to maintain a fork for my quic-go.

I already brought this up in #24485 (comment), and @FiloSottile suggested adding a SetCounter method, but it looks like this issue was closed without exposing this method.

@FiloSottile
Copy link
Contributor

@FiloSottile FiloSottile commented Jan 29, 2020

Duplicate of #35506.

@golang golang locked and limited conversation to collaborators Jan 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants