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

Allow resetting Keccak internal buffer by zeroing out #46

Open
SuperFluffy opened this issue Feb 14, 2020 · 2 comments · May be fixed by #49
Open

Allow resetting Keccak internal buffer by zeroing out #46

SuperFluffy opened this issue Feb 14, 2020 · 2 comments · May be fixed by #49

Comments

@SuperFluffy
Copy link

I would like to be able to reset the internal KeccakState of a Keccak instance so that its buffer and offset are zeroed out. I can see that there is a method reset on KeccakState, which however is only ever called from KangarooTwelve.

It is possible to provide a reset method on Keccak calling KeccakState:reset? Is there maybe a reason why there is no such method? I can otherwise provide a PR, but I wanted to ask first.

@rajivshah3
Copy link

Hi @debris , would you be open to providing a reset method on Keccak so that we can zero out the buffer there?

@rajivshah3 rajivshah3 linked a pull request Dec 5, 2020 that will close this issue
@stackinspector
Copy link

stackinspector commented May 3, 2023

One thing to note: cSHAKE, and all cSHAKE-based functions, cannot straightly expose the reset method, because cSHAKE has a process of initialization based on name and custom_string, in other words the "initial" Buffer state is not all zero. You can refer to RustCrypto's cSHAKE implementation. However, Keccak, SHA3 and SHAKE do not have an initialization process, so you can straightly expose the reset method.

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 a pull request may close this issue.

3 participants