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: add Cipher.SetCounter #35506

Closed
FiloSottile opened this issue Nov 11, 2019 · 3 comments
Closed

x/crypto/chacha20: add Cipher.SetCounter #35506

FiloSottile opened this issue Nov 11, 2019 · 3 comments
Labels
Milestone

Comments

@FiloSottile
Copy link
Member

@FiloSottile FiloSottile commented Nov 11, 2019

As mentioned in #24485, it would be useful to be able to jump forward in the cipher stream, for example for QUIC. We should add a SetCounter method to the new x/crypto/chacha20 package.

@mundaym

This comment has been minimized.

Copy link
Member

@mundaym mundaym commented Jan 20, 2020

(In the CL above the SetCounter method is renamed to Advance.)

I think if I saw s.Advance(1) in code I don't think it would be immediately obvious to me whether the method call is trying to skip 1 byte of the keystream, increment the counter by 1, or set the value of the counter to 1.

I therefore wonder if we should call this something less ambiguous. AdvanceCounterTo perhaps?

@FiloSottile

This comment has been minimized.

Copy link
Member Author

@FiloSottile FiloSottile commented Feb 7, 2020

Yeah, fair, naming things is hard. Let's just go back to SetCounter. The docs can explain the rollback behavior.

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Feb 7, 2020

Change https://golang.org/cl/206638 mentions this issue: chacha20: add SetCounter method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.