Skip to content

Commit 6e49b2d

Browse files
authored
Merge pull request #4 from namada-net/tomas/replace-memzero
replace memzero and update license
2 parents 2940418 + 8035244 commit 6e49b2d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[package]
22
name = "nam-tiny-hderive"
3-
version = "0.3.1-nam.0"
3+
version = "0.3.1-nam.1"
44
authors = ["Parity Technologies <[email protected]>"]
55
edition = "2018"
6-
license = "GPL-3.0"
6+
license = "GPL-3.0-or-later"
77
description = "(Namada fork) Tiny BIP44/BIP32 derivation for BIP39 seeds"
88
documentation = "https://docs.rs/tiny-hderive"
99
homepage = "https://github.com/maciejhirsz/tiny-hderive"
@@ -15,7 +15,7 @@ k256 = "0.13"
1515
base58 = "0.2"
1616
sha2 = "0.10"
1717
hmac = "0.12"
18-
memzero = "0.1"
18+
zeroize = "1.8"
1919

2020
[dev-dependencies]
2121
ethsign = { version = "0.9", default-features = false, features = ["pure-rust"] }

src/bip32.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
use base58::FromBase58;
22
use hmac::{Hmac, Mac};
33
use k256::SecretKey;
4-
use memzero::Memzero;
54
use sha2::Sha512;
65
use std::fmt;
76
use std::ops::Deref;
87
use std::str::FromStr;
8+
use zeroize::ZeroizeOnDrop;
99

1010
use crate::bip44::{ChildNumber, IntoDerivationPath};
1111
use crate::Error;
1212

13-
#[derive(Clone, PartialEq, Eq)]
14-
pub struct Protected(Memzero<[u8; 32]>);
13+
#[derive(Clone, PartialEq, Eq, ZeroizeOnDrop)]
14+
pub struct Protected([u8; 32]);
1515

1616
impl<Data: AsRef<[u8]>> From<Data> for Protected {
1717
fn from(data: Data) -> Protected {
1818
let mut buf = [0u8; 32];
1919

2020
buf.copy_from_slice(data.as_ref());
2121

22-
Protected(Memzero::from(buf))
22+
Protected(buf)
2323
}
2424
}
2525

0 commit comments

Comments
 (0)