Upgrade sha2 to 0.9.3 (#14746)
This commit is contained in:
parent
bf1943e489
commit
191193289f
|
@ -642,6 +642,12 @@ dependencies = [
|
||||||
"winapi 0.2.8",
|
"winapi 0.2.8",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cpuid-bool"
|
||||||
|
version = "0.1.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "crc32fast"
|
name = "crc32fast"
|
||||||
version = "1.2.0"
|
version = "1.2.0"
|
||||||
|
@ -794,6 +800,16 @@ dependencies = [
|
||||||
"subtle 2.2.2",
|
"subtle 2.2.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "crypto-mac"
|
||||||
|
version = "0.10.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4857fd85a0c34b3c3297875b747c1e02e06b6a0ea32dd892d8192b9ce0813ea6"
|
||||||
|
dependencies = [
|
||||||
|
"generic-array 0.14.3",
|
||||||
|
"subtle 2.2.2",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "csv"
|
name = "csv"
|
||||||
version = "1.1.3"
|
version = "1.1.3"
|
||||||
|
@ -1000,7 +1016,7 @@ dependencies = [
|
||||||
"ed25519",
|
"ed25519",
|
||||||
"rand 0.7.3",
|
"rand 0.7.3",
|
||||||
"serde",
|
"serde",
|
||||||
"sha2",
|
"sha2 0.8.2",
|
||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -1538,6 +1554,16 @@ dependencies = [
|
||||||
"digest 0.8.1",
|
"digest 0.8.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "hmac"
|
||||||
|
version = "0.10.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c1441c6b1e930e2817404b5046f1f989899143a12bf92de603b69f4e0aee1e15"
|
||||||
|
dependencies = [
|
||||||
|
"crypto-mac 0.10.0",
|
||||||
|
"digest 0.9.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hmac-drbg"
|
name = "hmac-drbg"
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
|
@ -1546,7 +1572,7 @@ checksum = "c6e570451493f10f6581b48cdd530413b63ea9e780f544bfd3bdcaa0d89d1a7b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"digest 0.8.1",
|
"digest 0.8.1",
|
||||||
"generic-array 0.12.3",
|
"generic-array 0.12.3",
|
||||||
"hmac",
|
"hmac 0.7.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2072,7 +2098,7 @@ dependencies = [
|
||||||
"digest 0.8.1",
|
"digest 0.8.1",
|
||||||
"hmac-drbg",
|
"hmac-drbg",
|
||||||
"rand 0.7.3",
|
"rand 0.7.3",
|
||||||
"sha2",
|
"sha2 0.8.2",
|
||||||
"subtle 2.2.2",
|
"subtle 2.2.2",
|
||||||
"typenum",
|
"typenum",
|
||||||
]
|
]
|
||||||
|
@ -2663,6 +2689,15 @@ dependencies = [
|
||||||
"crypto-mac 0.7.0",
|
"crypto-mac 0.7.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pbkdf2"
|
||||||
|
version = "0.6.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b3b8c0d71734018084da0c0354193a5edfb81b20d2d57a92c5b154aefc554a4a"
|
||||||
|
dependencies = [
|
||||||
|
"crypto-mac 0.10.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "peeking_take_while"
|
name = "peeking_take_while"
|
||||||
version = "0.1.2"
|
version = "0.1.2"
|
||||||
|
@ -3561,6 +3596,19 @@ dependencies = [
|
||||||
"opaque-debug 0.2.3",
|
"opaque-debug 0.2.3",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sha2"
|
||||||
|
version = "0.9.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6e7aab86fe2149bad8c507606bdb3f4ef5e7b2380eb92350f56122cca72a42a8"
|
||||||
|
dependencies = [
|
||||||
|
"block-buffer 0.9.0",
|
||||||
|
"cfg-if 1.0.0",
|
||||||
|
"cpuid-bool",
|
||||||
|
"digest 0.9.0",
|
||||||
|
"opaque-debug 0.3.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sha3"
|
name = "sha3"
|
||||||
version = "0.9.1"
|
version = "0.9.1"
|
||||||
|
@ -4216,7 +4264,7 @@ dependencies = [
|
||||||
"rustc_version",
|
"rustc_version",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
"sha2",
|
"sha2 0.8.2",
|
||||||
"solana-frozen-abi-macro 1.4.17",
|
"solana-frozen-abi-macro 1.4.17",
|
||||||
"solana-logger 1.4.17",
|
"solana-logger 1.4.17",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
|
@ -4234,7 +4282,7 @@ dependencies = [
|
||||||
"rustc_version",
|
"rustc_version",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
"sha2",
|
"sha2 0.9.2",
|
||||||
"solana-frozen-abi-macro 1.6.0",
|
"solana-frozen-abi-macro 1.6.0",
|
||||||
"solana-logger 1.6.0",
|
"solana-logger 1.6.0",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
|
@ -4383,7 +4431,7 @@ dependencies = [
|
||||||
"rustc_version",
|
"rustc_version",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_bytes",
|
"serde_bytes",
|
||||||
"sha2",
|
"sha2 0.9.2",
|
||||||
"solana-bpf-loader-program",
|
"solana-bpf-loader-program",
|
||||||
"solana-budget-program",
|
"solana-budget-program",
|
||||||
"solana-frozen-abi 1.6.0",
|
"solana-frozen-abi 1.6.0",
|
||||||
|
@ -4674,7 +4722,7 @@ dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"serde_bytes",
|
"serde_bytes",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
"sha2",
|
"sha2 0.8.2",
|
||||||
"solana-frozen-abi 1.4.17",
|
"solana-frozen-abi 1.4.17",
|
||||||
"solana-frozen-abi-macro 1.4.17",
|
"solana-frozen-abi-macro 1.4.17",
|
||||||
"solana-logger 1.4.17",
|
"solana-logger 1.4.17",
|
||||||
|
@ -4704,7 +4752,7 @@ dependencies = [
|
||||||
"serde_bytes",
|
"serde_bytes",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"sha2",
|
"sha2 0.9.2",
|
||||||
"solana-frozen-abi 1.6.0",
|
"solana-frozen-abi 1.6.0",
|
||||||
"solana-frozen-abi-macro 1.6.0",
|
"solana-frozen-abi-macro 1.6.0",
|
||||||
"solana-logger 1.6.0",
|
"solana-logger 1.6.0",
|
||||||
|
@ -4854,7 +4902,7 @@ dependencies = [
|
||||||
"ed25519-dalek",
|
"ed25519-dalek",
|
||||||
"generic-array 0.14.3",
|
"generic-array 0.14.3",
|
||||||
"hex",
|
"hex",
|
||||||
"hmac",
|
"hmac 0.10.1",
|
||||||
"itertools 0.9.0",
|
"itertools 0.9.0",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"libsecp256k1",
|
"libsecp256k1",
|
||||||
|
@ -4862,7 +4910,7 @@ dependencies = [
|
||||||
"memmap2",
|
"memmap2",
|
||||||
"num-derive",
|
"num-derive",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
"pbkdf2",
|
"pbkdf2 0.6.0",
|
||||||
"rand 0.7.3",
|
"rand 0.7.3",
|
||||||
"rand_chacha 0.2.2",
|
"rand_chacha 0.2.2",
|
||||||
"rustc_version",
|
"rustc_version",
|
||||||
|
@ -4871,7 +4919,7 @@ dependencies = [
|
||||||
"serde_bytes",
|
"serde_bytes",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"sha2",
|
"sha2 0.9.2",
|
||||||
"sha3",
|
"sha3",
|
||||||
"solana-crate-features",
|
"solana-crate-features",
|
||||||
"solana-frozen-abi 1.6.0",
|
"solana-frozen-abi 1.6.0",
|
||||||
|
@ -5657,12 +5705,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b0165e045cc2ae1660270ca65e1676dbaab60feb0f91b10f7d0665e9b47e31f2"
|
checksum = "b0165e045cc2ae1660270ca65e1676dbaab60feb0f91b10f7d0665e9b47e31f2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"failure",
|
"failure",
|
||||||
"hmac",
|
"hmac 0.7.1",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"pbkdf2",
|
"pbkdf2 0.3.0",
|
||||||
"rand 0.7.3",
|
"rand 0.7.3",
|
||||||
"rustc-hash",
|
"rustc-hash",
|
||||||
"sha2",
|
"sha2 0.8.2",
|
||||||
"unicode-normalization",
|
"unicode-normalization",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ bv = { version = "0.11.1", features = ["serde"] }
|
||||||
log = "0.4.11"
|
log = "0.4.11"
|
||||||
serde = "1.0.112"
|
serde = "1.0.112"
|
||||||
serde_derive = "1.0.103"
|
serde_derive = "1.0.103"
|
||||||
sha2 = "0.8.2"
|
sha2 = "0.9.2"
|
||||||
solana-frozen-abi-macro = { path = "macro", version = "1.6.0" }
|
solana-frozen-abi-macro = { path = "macro", version = "1.6.0" }
|
||||||
thiserror = "1.0"
|
thiserror = "1.0"
|
||||||
|
|
||||||
|
|
|
@ -12,12 +12,12 @@ pub struct Hasher {
|
||||||
|
|
||||||
impl Hasher {
|
impl Hasher {
|
||||||
pub fn hash(&mut self, val: &[u8]) {
|
pub fn hash(&mut self, val: &[u8]) {
|
||||||
self.hasher.input(val);
|
self.hasher.update(val);
|
||||||
}
|
}
|
||||||
pub fn result(self) -> Hash {
|
pub fn result(self) -> Hash {
|
||||||
// At the time of this writing, the sha2 library is stuck on an old version
|
// At the time of this writing, the sha2 library is stuck on an old version
|
||||||
// of generic_array (0.9.0). Decouple ourselves with a clone to our version.
|
// of generic_array (0.9.0). Decouple ourselves with a clone to our version.
|
||||||
Hash(<[u8; HASH_BYTES]>::try_from(self.hasher.result().as_slice()).unwrap())
|
Hash(<[u8; HASH_BYTES]>::try_from(self.hasher.finalize().as_slice()).unwrap())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ rayon = "1.5.0"
|
||||||
reed-solomon-erasure = { version = "4.0.2", features = ["simd-accel"] }
|
reed-solomon-erasure = { version = "4.0.2", features = ["simd-accel"] }
|
||||||
serde = "1.0.112"
|
serde = "1.0.112"
|
||||||
serde_bytes = "0.11.4"
|
serde_bytes = "0.11.4"
|
||||||
sha2 = "0.8.2"
|
sha2 = "0.9.2"
|
||||||
solana-bpf-loader-program = { path = "../programs/bpf_loader", version = "1.6.0" }
|
solana-bpf-loader-program = { path = "../programs/bpf_loader", version = "1.6.0" }
|
||||||
solana-frozen-abi = { path = "../frozen-abi", version = "1.6.0" }
|
solana-frozen-abi = { path = "../frozen-abi", version = "1.6.0" }
|
||||||
solana-frozen-abi-macro = { path = "../frozen-abi/macro", version = "1.6.0" }
|
solana-frozen-abi-macro = { path = "../frozen-abi/macro", version = "1.6.0" }
|
||||||
|
|
|
@ -336,8 +336,8 @@ pub fn sign_shreds_gpu_pinned_keypair(keypair: &Keypair, cache: &RecyclerCache)
|
||||||
let pubkey = keypair.pubkey().to_bytes();
|
let pubkey = keypair.pubkey().to_bytes();
|
||||||
let secret = keypair.secret().to_bytes();
|
let secret = keypair.secret().to_bytes();
|
||||||
let mut hasher = Sha512::default();
|
let mut hasher = Sha512::default();
|
||||||
hasher.input(&secret);
|
hasher.update(&secret);
|
||||||
let mut result = hasher.result();
|
let mut result = hasher.finalize();
|
||||||
result[0] &= 248;
|
result[0] &= 248;
|
||||||
result[31] &= 63;
|
result[31] &= 63;
|
||||||
result[31] |= 64;
|
result[31] |= 64;
|
||||||
|
|
|
@ -408,6 +408,12 @@ version = "0.8.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b"
|
checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cpuid-bool"
|
||||||
|
version = "0.1.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "crc32fast"
|
name = "crc32fast"
|
||||||
version = "1.2.0"
|
version = "1.2.0"
|
||||||
|
@ -547,6 +553,16 @@ dependencies = [
|
||||||
"subtle 2.2.2",
|
"subtle 2.2.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "crypto-mac"
|
||||||
|
version = "0.10.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4857fd85a0c34b3c3297875b747c1e02e06b6a0ea32dd892d8192b9ce0813ea6"
|
||||||
|
dependencies = [
|
||||||
|
"generic-array 0.14.3",
|
||||||
|
"subtle 2.2.2",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "curve25519-dalek"
|
name = "curve25519-dalek"
|
||||||
version = "2.1.0"
|
version = "2.1.0"
|
||||||
|
@ -659,7 +675,7 @@ dependencies = [
|
||||||
"ed25519",
|
"ed25519",
|
||||||
"rand 0.7.3",
|
"rand 0.7.3",
|
||||||
"serde",
|
"serde",
|
||||||
"sha2",
|
"sha2 0.8.2",
|
||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -1018,6 +1034,16 @@ dependencies = [
|
||||||
"digest 0.8.1",
|
"digest 0.8.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "hmac"
|
||||||
|
version = "0.10.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c1441c6b1e930e2817404b5046f1f989899143a12bf92de603b69f4e0aee1e15"
|
||||||
|
dependencies = [
|
||||||
|
"crypto-mac 0.10.0",
|
||||||
|
"digest 0.9.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hmac-drbg"
|
name = "hmac-drbg"
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
|
@ -1026,7 +1052,7 @@ checksum = "c6e570451493f10f6581b48cdd530413b63ea9e780f544bfd3bdcaa0d89d1a7b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"digest 0.8.1",
|
"digest 0.8.1",
|
||||||
"generic-array 0.12.3",
|
"generic-array 0.12.3",
|
||||||
"hmac",
|
"hmac 0.7.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1311,7 +1337,7 @@ dependencies = [
|
||||||
"digest 0.8.1",
|
"digest 0.8.1",
|
||||||
"hmac-drbg",
|
"hmac-drbg",
|
||||||
"rand 0.7.3",
|
"rand 0.7.3",
|
||||||
"sha2",
|
"sha2 0.8.2",
|
||||||
"subtle 2.2.2",
|
"subtle 2.2.2",
|
||||||
"typenum",
|
"typenum",
|
||||||
]
|
]
|
||||||
|
@ -1793,6 +1819,15 @@ dependencies = [
|
||||||
"crypto-mac 0.7.0",
|
"crypto-mac 0.7.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pbkdf2"
|
||||||
|
version = "0.6.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b3b8c0d71734018084da0c0354193a5edfb81b20d2d57a92c5b154aefc554a4a"
|
||||||
|
dependencies = [
|
||||||
|
"crypto-mac 0.10.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "percent-encoding"
|
name = "percent-encoding"
|
||||||
version = "2.1.0"
|
version = "2.1.0"
|
||||||
|
@ -2394,6 +2429,19 @@ dependencies = [
|
||||||
"opaque-debug 0.2.3",
|
"opaque-debug 0.2.3",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sha2"
|
||||||
|
version = "0.9.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6e7aab86fe2149bad8c507606bdb3f4ef5e7b2380eb92350f56122cca72a42a8"
|
||||||
|
dependencies = [
|
||||||
|
"block-buffer 0.9.0",
|
||||||
|
"cfg-if 1.0.0",
|
||||||
|
"cpuid-bool",
|
||||||
|
"digest 0.9.0",
|
||||||
|
"opaque-debug 0.3.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sha3"
|
name = "sha3"
|
||||||
version = "0.9.1"
|
version = "0.9.1"
|
||||||
|
@ -2882,7 +2930,7 @@ dependencies = [
|
||||||
"rustc_version",
|
"rustc_version",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
"sha2",
|
"sha2 0.8.2",
|
||||||
"solana-frozen-abi-macro 1.5.3",
|
"solana-frozen-abi-macro 1.5.3",
|
||||||
"solana-logger 1.5.3",
|
"solana-logger 1.5.3",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
|
@ -2900,7 +2948,7 @@ dependencies = [
|
||||||
"rustc_version",
|
"rustc_version",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
"sha2",
|
"sha2 0.9.2",
|
||||||
"solana-frozen-abi-macro 1.6.0",
|
"solana-frozen-abi-macro 1.6.0",
|
||||||
"solana-logger 1.6.0",
|
"solana-logger 1.6.0",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
|
@ -3014,7 +3062,7 @@ dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"serde_bytes",
|
"serde_bytes",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
"sha2",
|
"sha2 0.8.2",
|
||||||
"solana-frozen-abi 1.5.3",
|
"solana-frozen-abi 1.5.3",
|
||||||
"solana-frozen-abi-macro 1.5.3",
|
"solana-frozen-abi-macro 1.5.3",
|
||||||
"solana-logger 1.5.3",
|
"solana-logger 1.5.3",
|
||||||
|
@ -3042,7 +3090,7 @@ dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"serde_bytes",
|
"serde_bytes",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
"sha2",
|
"sha2 0.9.2",
|
||||||
"solana-frozen-abi 1.6.0",
|
"solana-frozen-abi 1.6.0",
|
||||||
"solana-frozen-abi-macro 1.6.0",
|
"solana-frozen-abi-macro 1.6.0",
|
||||||
"solana-logger 1.6.0",
|
"solana-logger 1.6.0",
|
||||||
|
@ -3139,7 +3187,7 @@ dependencies = [
|
||||||
"ed25519-dalek",
|
"ed25519-dalek",
|
||||||
"generic-array 0.14.3",
|
"generic-array 0.14.3",
|
||||||
"hex",
|
"hex",
|
||||||
"hmac",
|
"hmac 0.10.1",
|
||||||
"itertools 0.9.0",
|
"itertools 0.9.0",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"libsecp256k1",
|
"libsecp256k1",
|
||||||
|
@ -3147,7 +3195,7 @@ dependencies = [
|
||||||
"memmap2",
|
"memmap2",
|
||||||
"num-derive 0.3.0",
|
"num-derive 0.3.0",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
"pbkdf2",
|
"pbkdf2 0.6.0",
|
||||||
"rand 0.7.3",
|
"rand 0.7.3",
|
||||||
"rand_chacha 0.2.2",
|
"rand_chacha 0.2.2",
|
||||||
"rustc_version",
|
"rustc_version",
|
||||||
|
@ -3156,7 +3204,7 @@ dependencies = [
|
||||||
"serde_bytes",
|
"serde_bytes",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"sha2",
|
"sha2 0.9.2",
|
||||||
"sha3",
|
"sha3",
|
||||||
"solana-crate-features",
|
"solana-crate-features",
|
||||||
"solana-frozen-abi 1.6.0",
|
"solana-frozen-abi 1.6.0",
|
||||||
|
@ -3499,12 +3547,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b0165e045cc2ae1660270ca65e1676dbaab60feb0f91b10f7d0665e9b47e31f2"
|
checksum = "b0165e045cc2ae1660270ca65e1676dbaab60feb0f91b10f7d0665e9b47e31f2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"failure",
|
"failure",
|
||||||
"hmac",
|
"hmac 0.7.1",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"pbkdf2",
|
"pbkdf2 0.3.0",
|
||||||
"rand 0.7.3",
|
"rand 0.7.3",
|
||||||
"rustc-hash",
|
"rustc-hash",
|
||||||
"sha2",
|
"sha2 0.8.2",
|
||||||
"unicode-normalization",
|
"unicode-normalization",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -44,21 +44,21 @@ chrono = { version = "0.4", optional = true }
|
||||||
curve25519-dalek = { version = "2.1.0", optional = true }
|
curve25519-dalek = { version = "2.1.0", optional = true }
|
||||||
generic-array = { version = "0.14.3", default-features = false, features = ["serde", "more_lengths"], optional = true }
|
generic-array = { version = "0.14.3", default-features = false, features = ["serde", "more_lengths"], optional = true }
|
||||||
hex = "0.4.2"
|
hex = "0.4.2"
|
||||||
hmac = "0.7.0"
|
hmac = "0.10.1"
|
||||||
itertools = "0.9.0"
|
itertools = "0.9.0"
|
||||||
lazy_static = "1.4.0"
|
lazy_static = "1.4.0"
|
||||||
log = "0.4.11"
|
log = "0.4.11"
|
||||||
memmap2 = { version = "0.1.0", optional = true }
|
memmap2 = { version = "0.1.0", optional = true }
|
||||||
num-derive = "0.3"
|
num-derive = "0.3"
|
||||||
num-traits = "0.2"
|
num-traits = "0.2"
|
||||||
pbkdf2 = { version = "0.3.0", default-features = false }
|
pbkdf2 = { version = "0.6.0", default-features = false }
|
||||||
rand = { version = "0.7.0", optional = true }
|
rand = { version = "0.7.0", optional = true }
|
||||||
rand_chacha = { version = "0.2.2", optional = true }
|
rand_chacha = { version = "0.2.2", optional = true }
|
||||||
serde = "1.0.112"
|
serde = "1.0.112"
|
||||||
serde_bytes = "0.11"
|
serde_bytes = "0.11"
|
||||||
serde_derive = "1.0.103"
|
serde_derive = "1.0.103"
|
||||||
serde_json = { version = "1.0.56", optional = true }
|
serde_json = { version = "1.0.56", optional = true }
|
||||||
sha2 = "0.8.2"
|
sha2 = "0.9.2"
|
||||||
thiserror = "1.0"
|
thiserror = "1.0"
|
||||||
ed25519-dalek = { version = "=1.0.0-pre.4", optional = true }
|
ed25519-dalek = { version = "=1.0.0-pre.4", optional = true }
|
||||||
solana-crate-features = { path = "../crate-features", version = "1.6.0", optional = true }
|
solana-crate-features = { path = "../crate-features", version = "1.6.0", optional = true }
|
||||||
|
|
|
@ -22,7 +22,7 @@ rustversion = "1.0.3"
|
||||||
serde = "1.0.112"
|
serde = "1.0.112"
|
||||||
serde_bytes = "0.11"
|
serde_bytes = "0.11"
|
||||||
serde_derive = "1.0.103"
|
serde_derive = "1.0.103"
|
||||||
sha2 = "0.8.2"
|
sha2 = "0.9.2"
|
||||||
solana-frozen-abi = { path = "../../frozen-abi", version = "1.6.0" }
|
solana-frozen-abi = { path = "../../frozen-abi", version = "1.6.0" }
|
||||||
solana-frozen-abi-macro = { path = "../../frozen-abi/macro", version = "1.6.0" }
|
solana-frozen-abi-macro = { path = "../../frozen-abi/macro", version = "1.6.0" }
|
||||||
solana-sdk-macro = { path = "../macro", version = "1.6.0" }
|
solana-sdk-macro = { path = "../macro", version = "1.6.0" }
|
||||||
|
|
|
@ -19,7 +19,7 @@ pub struct Hasher {
|
||||||
|
|
||||||
impl Hasher {
|
impl Hasher {
|
||||||
pub fn hash(&mut self, val: &[u8]) {
|
pub fn hash(&mut self, val: &[u8]) {
|
||||||
self.hasher.input(val);
|
self.hasher.update(val);
|
||||||
}
|
}
|
||||||
pub fn hashv(&mut self, vals: &[&[u8]]) {
|
pub fn hashv(&mut self, vals: &[&[u8]]) {
|
||||||
for val in vals {
|
for val in vals {
|
||||||
|
@ -29,7 +29,7 @@ impl Hasher {
|
||||||
pub fn result(self) -> Hash {
|
pub fn result(self) -> Hash {
|
||||||
// At the time of this writing, the sha2 library is stuck on an old version
|
// At the time of this writing, the sha2 library is stuck on an old version
|
||||||
// of generic_array (0.9.0). Decouple ourselves with a clone to our version.
|
// of generic_array (0.9.0). Decouple ourselves with a clone to our version.
|
||||||
Hash(<[u8; HASH_BYTES]>::try_from(self.hasher.result().as_slice()).unwrap())
|
Hash(<[u8; HASH_BYTES]>::try_from(self.hasher.finalize().as_slice()).unwrap())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -400,7 +400,7 @@ pub fn keypair_from_seed_phrase_and_passphrase(
|
||||||
seed_phrase: &str,
|
seed_phrase: &str,
|
||||||
passphrase: &str,
|
passphrase: &str,
|
||||||
) -> Result<Keypair, Box<dyn error::Error>> {
|
) -> Result<Keypair, Box<dyn error::Error>> {
|
||||||
const PBKDF2_ROUNDS: usize = 2048;
|
const PBKDF2_ROUNDS: u32 = 2048;
|
||||||
const PBKDF2_BYTES: usize = 64;
|
const PBKDF2_BYTES: usize = 64;
|
||||||
|
|
||||||
let salt = format!("mnemonic{}", passphrase);
|
let salt = format!("mnemonic{}", passphrase);
|
||||||
|
|
Loading…
Reference in New Issue