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

feat(zeroize): added zeorizing to Felt #100

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Trantorian1
Copy link

This is feature-gated behind the zeroing flag

Pull Request type

  • Feature

What is the current behavior?

Felt provides no option to zeroize its memory, which can be an issue when dealing with sensitive cryptographic information such as private keys.

Resolves: #99

What is the new behavior?

  • Implemented zeroizing for Felt through the zeroize crate. While zeroize is not used directly, Felt implements manually the Zeroize trait in the hopes of making this behavior more 'standard'. This has been gated behind the zeroing feature.

Note

Contrarily to zeroize, this is done using safe rust by leveraging core::mem::take to replace the in-memory representation of a felt with its default value of Felt::ZERO.

Does this introduce a breaking change?

No. While the zeroing feature has been added to default, zeroing has not been implemented on drop, both because this would interfere with the Copy trait of Felt but also because it seems like it should be up to the end user to determine when they are dealing with sensitive information.

This is feature-gated behind the `zeroing` flag
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.

bug(felt): Felt is not zeroized on drop
1 participant