Skip to content

Commit 692953f

Browse files
authored
Update VoprfParameters (#1196)
Companion PR to RustCrypto/traits#1814
1 parent dcd11dc commit 692953f

7 files changed

Lines changed: 32 additions & 11 deletions

File tree

Cargo.lock

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

p256/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pkcs8 = ["ecdsa-core?/pkcs8", "elliptic-curve/pkcs8"]
5656
serde = ["ecdsa-core?/serde", "elliptic-curve/serde", "primeorder?/serde", "serdect"]
5757
sha256 = ["digest", "sha2"]
5858
test-vectors = ["dep:hex-literal"]
59-
voprf = ["elliptic-curve/voprf", "sha2"]
59+
voprf = ["hash2curve", "elliptic-curve/voprf", "sha2"]
6060

6161
[package.metadata.docs.rs]
6262
all-features = true

p256/src/lib.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,16 @@ pub type ScalarBits = elliptic_curve::scalar::ScalarBits<NistP256>;
173173

174174
#[cfg(feature = "voprf")]
175175
impl elliptic_curve::VoprfParameters for NistP256 {
176-
/// See <https://www.ietf.org/archive/id/draft-irtf-cfrg-voprf-19.html#section-4.3>.
176+
/// See <https://www.rfc-editor.org/rfc/rfc9497.html#section-4.3-1>.
177177
const ID: &'static str = "P256-SHA256";
178178

179-
/// See <https://www.ietf.org/archive/id/draft-irtf-cfrg-voprf-08.html#section-4.3-1.2>.
179+
/// See <https://www.rfc-editor.org/rfc/rfc9497.html#section-4.3-2.4>.
180180
type Hash = sha2::Sha256;
181+
182+
/// See <https://www.rfc-editor.org/rfc/rfc9497.html#section-4.3-2.2.2.10>
183+
/// and <https://www.rfc-editor.org/rfc/rfc9497.html#section-4.3-2.2.2.12>.
184+
type ExpandMsg = elliptic_curve::hash2curve::ExpandMsgXmd<
185+
sha2::Sha256,
186+
<Self as elliptic_curve::hash2curve::GroupDigest>::K,
187+
>;
181188
}

p384/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pkcs8 = ["ecdsa-core/pkcs8", "elliptic-curve/pkcs8"]
6060
serde = ["ecdsa-core?/serde", "elliptic-curve/serde", "primeorder?/serde", "serdect"]
6161
sha384 = ["digest", "sha2"]
6262
test-vectors = ["hex-literal"]
63-
voprf = ["elliptic-curve/voprf", "sha2"]
63+
voprf = ["hash2curve", "elliptic-curve/voprf", "sha2"]
6464

6565
[package.metadata.docs.rs]
6666
all-features = true

p384/src/lib.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,16 @@ pub type ScalarBits = elliptic_curve::scalar::ScalarBits<NistP384>;
126126

127127
#[cfg(feature = "voprf")]
128128
impl elliptic_curve::VoprfParameters for NistP384 {
129-
/// See <https://www.ietf.org/archive/id/draft-irtf-cfrg-voprf-19.html#name-oprfp-384-sha-384-2>.
129+
/// See <https://www.rfc-editor.org/rfc/rfc9497.html#section-4.4-1>.
130130
const ID: &'static str = "P384-SHA384";
131131

132-
/// See <https://www.ietf.org/archive/id/draft-irtf-cfrg-voprf-08.html#section-4.4-1.2>.
132+
/// See <https://www.rfc-editor.org/rfc/rfc9497.html#section-4.4-2.4>.
133133
type Hash = sha2::Sha384;
134+
135+
/// See <https://www.rfc-editor.org/rfc/rfc9497.html#section-4.4-2.2.2.10>
136+
/// and <https://www.rfc-editor.org/rfc/rfc9497.html#section-4.4-2.2.2.12>.
137+
type ExpandMsg = elliptic_curve::hash2curve::ExpandMsgXmd<
138+
sha2::Sha384,
139+
<Self as elliptic_curve::hash2curve::GroupDigest>::K,
140+
>;
134141
}

p521/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pkcs8 = ["ecdsa-core?/pkcs8", "elliptic-curve/pkcs8"]
5656
serde = ["ecdsa-core?/serde", "elliptic-curve/serde", "primeorder?/serde", "serdect"]
5757
sha512 = ["digest", "dep:sha2"]
5858
test-vectors = ["dep:hex-literal"]
59-
voprf = ["elliptic-curve/voprf", "dep:sha2"]
59+
voprf = ["hash2curve", "elliptic-curve/voprf", "dep:sha2"]
6060

6161
[package.metadata.docs.rs]
6262
all-features = true

p521/src/lib.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,16 @@ pub type SecretKey = elliptic_curve::SecretKey<NistP521>;
116116

117117
#[cfg(feature = "voprf")]
118118
impl elliptic_curve::VoprfParameters for NistP521 {
119-
/// See <https://www.ietf.org/archive/id/draft-irtf-cfrg-voprf-19.html#section-4.5-1>.
119+
/// See <https://www.rfc-editor.org/rfc/rfc9497.html#section-4.5-1>.
120120
const ID: &'static str = "P521-SHA512";
121121

122-
/// See <https://www.ietf.org/archive/id/draft-irtf-cfrg-voprf-08.html#section-4.5-1.2>.
122+
/// See <https://www.rfc-editor.org/rfc/rfc9497.html#section-4.5-2.4>.
123123
type Hash = sha2::Sha512;
124+
125+
/// See <https://www.rfc-editor.org/rfc/rfc9497.html#section-4.5-2.2.2.10>
126+
/// and <https://www.rfc-editor.org/rfc/rfc9497.html#section-4.5-2.2.2.12>.
127+
type ExpandMsg = elliptic_curve::hash2curve::ExpandMsgXmd<
128+
sha2::Sha512,
129+
<Self as elliptic_curve::hash2curve::GroupDigest>::K,
130+
>;
124131
}

0 commit comments

Comments
 (0)