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

Add Zeroize to private key #1770

Merged
merged 6 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ wasmer = { version = "2.2.1" }
wasmer-compiler-singlepass = { version = "2.2.1" }
wasmparser = { version = "0.107.0", default-features = false }
extend = { version = "1.2.0" }
zeroize = { version = "1.3.0" }

# Both the release and test profiles use `panic = "unwind"` to allow certain parts of the Radix
# Engine to be able to catch panics. As an example, the native-vm has a `catch_unwind` to catch
Expand Down
1 change: 1 addition & 0 deletions examples/everything/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions radix-clis/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions radix-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ ed25519-dalek = { workspace = true, features = ["u64_backend"] }
secp256k1 = { workspace = true, features = ["recovery"], optional = true }
blst = { workspace = true, optional = false }
sha3 = { workspace = true, optional = false }
zeroize = { workspace = true, optional = false }

[dev-dependencies]
serde_json = { workspace = true }
Expand Down
3 changes: 3 additions & 0 deletions radix-common/src/crypto/ed25519/private_key.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
use super::Ed25519Signature;
use crate::internal_prelude::*;
use ed25519_dalek::{Keypair, PublicKey, SecretKey, Signer};
use zeroize::Zeroize;

#[derive(Zeroize)]
#[zeroize(drop)]
pub struct Ed25519PrivateKey(SecretKey);

impl Ed25519PrivateKey {
Expand Down
Loading