mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-07 20:50:39 +00:00
Update sha2, digest to 0.9
This commit is contained in:
parent
c4824e1384
commit
6afd8ff212
3 changed files with 8 additions and 8 deletions
|
|
@ -30,7 +30,7 @@ features = ["nightly", "simd_backend"]
|
||||||
travis-ci = { repository = "dalek-cryptography/curve25519-dalek", branch = "master"}
|
travis-ci = { repository = "dalek-cryptography/curve25519-dalek", branch = "master"}
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
sha2 = { version = "0.8", default-features = false }
|
sha2 = { version = "0.9", default-features = false }
|
||||||
bincode = "1"
|
bincode = "1"
|
||||||
criterion = "0.3.0"
|
criterion = "0.3.0"
|
||||||
rand = "0.7"
|
rand = "0.7"
|
||||||
|
|
@ -42,7 +42,7 @@ harness = false
|
||||||
[dependencies]
|
[dependencies]
|
||||||
rand_core = { version = "0.5", default-features = false }
|
rand_core = { version = "0.5", default-features = false }
|
||||||
byteorder = { version = "^1.2.3", default-features = false, features = ["i128"] }
|
byteorder = { version = "^1.2.3", default-features = false, features = ["i128"] }
|
||||||
digest = { version = "0.8", default-features = false }
|
digest = { version = "0.9", default-features = false }
|
||||||
subtle = { version = "^2.2.1", default-features = false }
|
subtle = { version = "^2.2.1", default-features = false }
|
||||||
serde = { version = "1.0", default-features = false, optional = true, features = ["derive"] }
|
serde = { version = "1.0", default-features = false, optional = true, features = ["derive"] }
|
||||||
packed_simd = { version = "0.3", features = ["into_bits"], optional = true }
|
packed_simd = { version = "0.3", features = ["into_bits"], optional = true }
|
||||||
|
|
|
||||||
|
|
@ -689,7 +689,7 @@ impl RistrettoPoint {
|
||||||
where D: Digest<OutputSize = U64> + Default
|
where D: Digest<OutputSize = U64> + Default
|
||||||
{
|
{
|
||||||
let mut hash = D::default();
|
let mut hash = D::default();
|
||||||
hash.input(input);
|
hash.update(input);
|
||||||
RistrettoPoint::from_hash(hash)
|
RistrettoPoint::from_hash(hash)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -702,7 +702,7 @@ impl RistrettoPoint {
|
||||||
where D: Digest<OutputSize = U64> + Default
|
where D: Digest<OutputSize = U64> + Default
|
||||||
{
|
{
|
||||||
// dealing with generic arrays is clumsy, until const generics land
|
// dealing with generic arrays is clumsy, until const generics land
|
||||||
let output = hash.result();
|
let output = hash.finalize();
|
||||||
let mut output_bytes = [0u8; 64];
|
let mut output_bytes = [0u8; 64];
|
||||||
output_bytes.copy_from_slice(&output.as_slice());
|
output_bytes.copy_from_slice(&output.as_slice());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -102,8 +102,8 @@
|
||||||
//!
|
//!
|
||||||
//! // Streaming data into a hash object
|
//! // Streaming data into a hash object
|
||||||
//! let mut hasher = Sha512::default();
|
//! let mut hasher = Sha512::default();
|
||||||
//! hasher.input(b"Abolish ");
|
//! hasher.update(b"Abolish ");
|
||||||
//! hasher.input(b"ICE");
|
//! hasher.update(b"ICE");
|
||||||
//! let a2 = Scalar::from_hash(hasher);
|
//! let a2 = Scalar::from_hash(hasher);
|
||||||
//!
|
//!
|
||||||
//! assert_eq!(a, a2);
|
//! assert_eq!(a, a2);
|
||||||
|
|
@ -588,7 +588,7 @@ impl Scalar {
|
||||||
where D: Digest<OutputSize = U64> + Default
|
where D: Digest<OutputSize = U64> + Default
|
||||||
{
|
{
|
||||||
let mut hash = D::default();
|
let mut hash = D::default();
|
||||||
hash.input(input);
|
hash.update(input);
|
||||||
Scalar::from_hash(hash)
|
Scalar::from_hash(hash)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -630,7 +630,7 @@ impl Scalar {
|
||||||
where D: Digest<OutputSize = U64>
|
where D: Digest<OutputSize = U64>
|
||||||
{
|
{
|
||||||
let mut output = [0u8; 64];
|
let mut output = [0u8; 64];
|
||||||
output.copy_from_slice(hash.result().as_slice());
|
output.copy_from_slice(hash.finalize().as_slice());
|
||||||
Scalar::from_bytes_mod_order_wide(&output)
|
Scalar::from_bytes_mod_order_wide(&output)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue