Add Zeroize to fields and elliptic curves #106
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR implements Zeroize for the Field, AffineGroup, and ProjectiveGroup traits.
Why Zeroize is helpful:
If you operate in the threat model of an attacker getting user space memory leakage (E.g. Heartbleed, cold boot attacks, DMA attacks), then a method to hopefully lower the probability of a succesful attack is to reduce the amount of time secrets are in memory.
This is pretty hard to do in the ideal sense, as you'd want all associated temporaries to be wiped as soon as possible (including register spills, the thread being switched etc.).
However if you have all temporaries be created in stack, then you can get some level of memory wiping by Zero'ing out your secret itself and everything on heap when you are done with them, and then hoping that everything that was created on stack gets written over relatively soon (or manually doing that with unsafe / some other method)
Adding Zeroize gives end application developers more of an ability to do the above, since they can now zeroize secrets, and use the
secret
trait, to allocate secrets on heap and have them be zero'd out when they're done.cref: arkworks-rs/snark#111
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
Pending
section inCHANGELOG.md
Files changed
in the Github PR explorer