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
flagPull Request type
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?
Felt
through thezeroize
crate. Whilezeroize
is not used directly, Felt implements manually theZeroize
trait in the hopes of making this behavior more 'standard'. This has been gated behind thezeroing
feature.Does this introduce a breaking change?
No. While the
zeroing
feature has been added todefault
, zeroing has not been implemented on drop, both because this would interfere with theCopy
trait ofFelt
but also because it seems like it should be up to the end user to determine when they are dealing with sensitive information.