Merge pull request #327 from huitseeker/digests-0.9

Update sha2, digest to 0.9
This commit is contained in:
Henry de Valence 2020-08-17 18:11:32 -07:00 committed by GitHub
commit 2ee61938ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 8 deletions

View file

@ -30,7 +30,7 @@ features = ["nightly", "simd_backend"]
travis-ci = { repository = "dalek-cryptography/curve25519-dalek", branch = "master"}
[dev-dependencies]
sha2 = { version = "0.8", default-features = false }
sha2 = { version = "0.9", default-features = false }
bincode = "1"
criterion = "0.3.0"
rand = "0.7"
@ -42,7 +42,7 @@ harness = false
[dependencies]
rand_core = { version = "0.5", default-features = false }
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 }
serde = { version = "1.0", default-features = false, optional = true, features = ["derive"] }
packed_simd = { version = "0.3", features = ["into_bits"], optional = true }

View file

@ -689,7 +689,7 @@ impl RistrettoPoint {
where D: Digest<OutputSize = U64> + Default
{
let mut hash = D::default();
hash.input(input);
hash.update(input);
RistrettoPoint::from_hash(hash)
}
@ -702,7 +702,7 @@ impl RistrettoPoint {
where D: Digest<OutputSize = U64> + Default
{
// dealing with generic arrays is clumsy, until const generics land
let output = hash.result();
let output = hash.finalize();
let mut output_bytes = [0u8; 64];
output_bytes.copy_from_slice(&output.as_slice());

View file

@ -102,8 +102,8 @@
//!
//! // Streaming data into a hash object
//! let mut hasher = Sha512::default();
//! hasher.input(b"Abolish ");
//! hasher.input(b"ICE");
//! hasher.update(b"Abolish ");
//! hasher.update(b"ICE");
//! let a2 = Scalar::from_hash(hasher);
//!
//! assert_eq!(a, a2);
@ -588,7 +588,7 @@ impl Scalar {
where D: Digest<OutputSize = U64> + Default
{
let mut hash = D::default();
hash.input(input);
hash.update(input);
Scalar::from_hash(hash)
}
@ -630,7 +630,7 @@ impl Scalar {
where D: Digest<OutputSize = U64>
{
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)
}