paritytech / libsecp256k1

Pure Rust Implementation of secp256k1.
Apache License 2.0
176 stars 84 forks source link

Support zeroization / clearing of secrets from memory #130

Open brentstone opened 2 years ago

brentstone commented 2 years ago

The Anoma protocol is supporting the use of secp256k1 keys in namada and is implementing the zeroization / clearing of secret key data from memory upon drop.

We currently have a branch in our fork of this repo to provide this support. In general, our branch rolls back some changes in #56 and adds some extra functionality that we use for tests.

Our branch implements a minimal set of changes in order to accomplish our zeroization goals, notably removing the Copy trait from relevant structs. We also note that it seems that the Scalar::clear method is useless when Copy is derived for Scalar.

Ideally, we would like full zeroization support in this upstream repo, but at minimum we would like to at least have a branch with this support here.