aboutsummaryrefslogtreecommitdiff
path: root/spake2
diff options
context:
space:
mode:
Diffstat (limited to 'spake2')
-rw-r--r--spake2/Cargo.toml9
-rw-r--r--spake2/src/lib.rs28
2 files changed, 16 insertions, 21 deletions
diff --git a/spake2/Cargo.toml b/spake2/Cargo.toml
index 3814c83..4436183 100644
--- a/spake2/Cargo.toml
+++ b/spake2/Cargo.toml
@@ -20,16 +20,11 @@ tag-message = "(cargo-release) spake2-v{{version}}"
pre-release-commit-message = "(cargo-release) spake2-v{{version}}"
pro-release-commit-message = "(cargo-release) start next development iteration spake2-v{{version}}"
-[badges]
-travis-ci = { repository = "RustCrypto/PAKEs" }
-is-it-maintained-issue-resolution = { repository = "RustCrypto/PAKEs" }
-is-it-maintained-open-issues = { repository = "RustCrypto/PAKEs" }
-
[dependencies]
curve25519-dalek = "1.2"
rand = "0.6"
-sha2 = "0.8"
-hkdf = "0.8"
+sha2 = "0.9"
+hkdf = "0.11"
hex = "0.4"
[dev-dependencies]
diff --git a/spake2/src/lib.rs b/spake2/src/lib.rs
index 24ba772..562f389 100644
--- a/spake2/src/lib.rs
+++ b/spake2/src/lib.rs
@@ -507,16 +507,16 @@ fn ed25519_hash_ab(
let mut transcript = [0u8; 6 * 32];
let mut pw_hash = Sha256::new();
- pw_hash.input(password_vec);
- transcript[0..32].copy_from_slice(&pw_hash.result());
+ pw_hash.update(password_vec);
+ transcript[0..32].copy_from_slice(&pw_hash.finalize());
let mut ida_hash = Sha256::new();
- ida_hash.input(id_a);
- transcript[32..64].copy_from_slice(&ida_hash.result());
+ ida_hash.update(id_a);
+ transcript[32..64].copy_from_slice(&ida_hash.finalize());
let mut idb_hash = Sha256::new();
- idb_hash.input(id_b);
- transcript[64..96].copy_from_slice(&idb_hash.result());
+ idb_hash.update(id_b);
+ transcript[64..96].copy_from_slice(&idb_hash.finalize());
transcript[96..128].copy_from_slice(first_msg);
transcript[128..160].copy_from_slice(second_msg);
@@ -526,8 +526,8 @@ fn ed25519_hash_ab(
//let mut hash = G::TranscriptHash::default();
let mut hash = Sha256::new();
- hash.input(transcript.to_vec());
- hash.result().to_vec()
+ hash.update(transcript.to_vec());
+ hash.finalize().to_vec()
}
fn ed25519_hash_symmetric(
@@ -554,12 +554,12 @@ fn ed25519_hash_symmetric(
let mut transcript = [0u8; 5 * 32];
let mut pw_hash = Sha256::new();
- pw_hash.input(password_vec);
- transcript[0..32].copy_from_slice(&pw_hash.result());
+ pw_hash.update(password_vec);
+ transcript[0..32].copy_from_slice(&pw_hash.finalize());
let mut ids_hash = Sha256::new();
- ids_hash.input(id_s);
- transcript[32..64].copy_from_slice(&ids_hash.result());
+ ids_hash.update(id_s);
+ transcript[32..64].copy_from_slice(&ids_hash.finalize());
if msg_u < msg_v {
transcript[64..96].copy_from_slice(msg_u);
@@ -571,8 +571,8 @@ fn ed25519_hash_symmetric(
transcript[128..160].copy_from_slice(key_bytes);
let mut hash = Sha256::new();
- hash.input(transcript.to_vec());
- hash.result().to_vec()
+ hash.update(transcript.to_vec());
+ hash.finalize().to_vec()
}
/* "session type pattern" */