Skip to content

Commit 22bc992

Browse files
authored
ed448-goldilocks,hash2curve: replace sha3 with shake (#1764)
Shake has recently been split off from sha3 into a dedicated `shake` crate: RustCrypto/hashes#869 This makes the adjustments in the downstream crates to reflect that change.
1 parent a64c16c commit 22bc992

15 files changed

Lines changed: 36 additions & 19 deletions

File tree

Cargo.lock

Lines changed: 19 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ed448-goldilocks/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ This crate also includes signing and verifying of Ed448 signatures.
1919
elliptic-curve = { version = "0.14.0-rc.32", features = ["arithmetic", "pkcs8"] }
2020
hash2curve = "0.14.0-rc.12"
2121
rand_core = { version = "0.10", default-features = false }
22-
sha3 = { version = "0.11", default-features = false }
22+
shake = { version = "0.1", default-features = false }
2323
subtle = { version = "2.6", default-features = false }
2424

2525
# optional dependencies

ed448-goldilocks/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ It is intended to be portable, fast, and safe.
2020
use ed448_goldilocks::{
2121
Ed448, EdwardsPoint, CompressedEdwardsY, EdwardsScalar,
2222
elliptic_curve::Generate,
23-
sha3::Shake256
23+
shake::Shake256
2424
};
2525
use elliptic_curve::{consts::U84, Field, group::GroupEncoding};
2626
use hash2curve::{ExpandMsgXof, GroupDigest};

ed448-goldilocks/src/decaf/points.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ mod test {
618618
use super::*;
619619
use crate::TWISTED_EDWARDS_BASE_POINT;
620620
use hash2curve::ExpandMsgXof;
621-
use sha3::Shake256;
621+
use shake::Shake256;
622622

623623
#[test]
624624
fn test_edwards_decaf_operations() {

ed448-goldilocks/src/decaf/scalar.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ mod test {
8383
use hash2curve::ExpandMsgXof;
8484
use hex_literal::hex;
8585
use proptest::property_test;
86-
use sha3::Shake256;
86+
use shake::Shake256;
8787

8888
#[test]
8989
fn test_basic_add() {

ed448-goldilocks/src/edwards/extended.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,7 @@ mod tests {
10061006

10071007
for (msg, x, y) in MSGS {
10081008
let p =
1009-
hash2curve::hash_from_bytes::<Ed448, ExpandMsgXof<sha3::Shake256>>(&[msg], &[DST])
1009+
hash2curve::hash_from_bytes::<Ed448, ExpandMsgXof<shake::Shake256>>(&[msg], &[DST])
10101010
.unwrap();
10111011
assert_eq!(p.is_on_curve().unwrap_u8(), 1u8);
10121012
let p = p.to_affine();
@@ -1045,7 +1045,7 @@ mod tests {
10451045
];
10461046

10471047
for (msg, x, y) in MSGS {
1048-
let p = hash2curve::encode_from_bytes::<Ed448, ExpandMsgXof<sha3::Shake256>>(
1048+
let p = hash2curve::encode_from_bytes::<Ed448, ExpandMsgXof<shake::Shake256>>(
10491049
&[msg],
10501050
&[DST],
10511051
)

ed448-goldilocks/src/edwards/scalar.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ mod test {
102102
use hash2curve::ExpandMsgXof;
103103
use hex_literal::hex;
104104
use proptest::property_test;
105-
use sha3::Shake256;
105+
use shake::Shake256;
106106

107107
#[test]
108108
fn test_basic_add() {

ed448-goldilocks/src/field/element.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ mod tests {
511511
use elliptic_curve::consts::U32;
512512
use hash2curve::{ExpandMsg, ExpandMsgXof, Expander};
513513
use hex_literal::hex;
514-
use sha3::Shake256;
514+
use shake::Shake256;
515515

516516
fn assert_from_okm(dst: &[u8], msgs: &[(&[u8], [u8; 56], [u8; 56])]) {
517517
for (msg, expected_u0, expected_u1) in msgs {

ed448-goldilocks/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub(crate) mod macros;
5454
pub use elliptic_curve;
5555
pub use hash2curve;
5656
pub use rand_core;
57-
pub use sha3;
57+
pub use shake;
5858
pub use subtle;
5959

6060
pub(crate) mod curve;
@@ -87,7 +87,7 @@ use elliptic_curve::{
8787
point::PointCompression,
8888
};
8989
use hash2curve::{ExpandMsgXof, GroupDigest};
90-
use sha3::Shake256;
90+
use shake::Shake256;
9191

9292
/// Edwards448 curve.
9393
#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash)]

ed448-goldilocks/src/sign.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
#![cfg_attr(feature = "getrandom", doc = "```")]
5858
#![cfg_attr(not(feature = "getrandom"), doc = "```ignore")]
5959
//! use ed448_goldilocks::{SigningKey, PreHasherXof, elliptic_curve::Generate};
60-
//! use sha3::{Shake256, digest::Update};
60+
//! use shake::{Shake256, digest::Update};
6161
//!
6262
//! let msg = b"Hello World";
6363
//!

0 commit comments

Comments
 (0)