Skip to content

Commit 32af34a

Browse files
committed
Add type ExpandMsg to VoprfParameters
1 parent 6fbdc17 commit 32af34a

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

elliptic-curve/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jwk = ["dep:base64ct", "dep:serde_json", "alloc", "serde", "zeroize/alloc"]
7070
pkcs8 = ["dep:pkcs8", "sec1"]
7171
pem = ["dep:pem-rfc7468", "alloc", "arithmetic", "pkcs8", "sec1/pem"]
7272
serde = ["dep:serdect", "alloc", "pkcs8", "sec1/serde"]
73-
voprf = ["digest"]
73+
voprf = ["digest", "hash2curve"]
7474

7575
[package.metadata.docs.rs]
7676
features = ["bits", "ecdh", "hash2curve", "jwk", "pem", "std", "voprf"]

elliptic-curve/src/voprf.rs

+7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//! <https://datatracker.ietf.org/doc/draft-irtf-cfrg-voprf/>
44
55
use crate::PrimeCurve;
6+
use crate::hash2curve::ExpandMsg;
67

78
/// Elliptic curve parameters used by VOPRF.
89
pub trait VoprfParameters: PrimeCurve {
@@ -17,4 +18,10 @@ pub trait VoprfParameters: PrimeCurve {
1718
///
1819
/// [voprf]: https://www.ietf.org/archive/id/draft-irtf-cfrg-voprf-19.html#name-ciphersuites-2
1920
type Hash: digest::Digest;
21+
22+
/// The `expand_message` parameter which assigns a particular algorithm for `HashToGroup`
23+
/// and `HashToScalar` as defined in [section 4 of `draft-irtf-cfrg-voprf-19`][voprf].
24+
///
25+
/// [voprf]: https://www.rfc-editor.org/rfc/rfc9497#name-ciphersuites
26+
type ExpandMsg: for<'a> ExpandMsg<'a>;
2027
}

0 commit comments

Comments
 (0)