Skip to content

Commit

Permalink
[refactor] hyperledger-iroha#3237: transplant Ed25519 and Secp256k1 c…
Browse files Browse the repository at this point in the history
…ode from ursa

Signed-off-by: Nikita Strygin <[email protected]>
  • Loading branch information
DCNick3 committed Nov 8, 2023
1 parent 93b8b49 commit 3790483
Show file tree
Hide file tree
Showing 7 changed files with 905 additions and 37 deletions.
197 changes: 196 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 20 additions & 2 deletions crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,30 @@ getset = { workspace = true }

ursa = { workspace = true, optional = true }
blake2 = "0.10.6"
# TODO: update after ursa is ditched
sha2 = "0.10.8"
# TODO: update after ursa is ditched
hkdf = "0.12.3"
amcl_wrapper = "0.4.0"

# TODO: bump these
ed25519-dalek = "1.0.1"
curve25519-dalek = "3.2.1"
x25519-dalek = "1.2.0"

# TODO: bump me
rand = "0.7"
# TODO: bump me
rand_chacha = "0.2"

# TODO: bump me
secp256k1 = { version = "0.19", features = ["rand", "serde"] }

# TODO: bump me
zeroize = "1.1"
arrayref = "0.3.7"


[dev-dependencies]
hex-literal = { workspace = true }
serde_json = { workspace = true }

libsodium-sys-stable = { version = "1.20.3", features = [] }
15 changes: 6 additions & 9 deletions crypto/src/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,14 +329,11 @@ mod tests {
#[cfg(not(feature = "ffi_import"))]
fn blake2_32b() {
let mut hasher = Blake2bVar::new(32).unwrap();
hasher.update(hex_literal::hex!("6920616d2064617461"));
hasher.finalize_variable(|res| {
assert_eq!(
res[..],
hex_literal::hex!(
"BA67336EFD6A3DF3A70EEB757860763036785C182FF4CF587541A0068D09F5B2"
)[..]
);
});
hasher.update(&hex_literal::hex!("6920616d2064617461"));
assert_eq!(
hasher.finalize_boxed().as_ref(),
&hex_literal::hex!("BA67336EFD6A3DF3A70EEB757860763036785C182FF4CF587541A0068D09F5B2")
[..]
);
}
}
Loading

0 comments on commit 3790483

Please sign in to comment.