From 32af34aebe238b2bd45d731df17b2dc4f13d2624 Mon Sep 17 00:00:00 2001 From: daxpedda Date: Fri, 11 Apr 2025 22:32:03 +0200 Subject: [PATCH] Add `type ExpandMsg` to `VoprfParameters` --- elliptic-curve/Cargo.toml | 2 +- elliptic-curve/src/voprf.rs | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/elliptic-curve/Cargo.toml b/elliptic-curve/Cargo.toml index 36f2a3ca1..02fb91741 100644 --- a/elliptic-curve/Cargo.toml +++ b/elliptic-curve/Cargo.toml @@ -70,7 +70,7 @@ jwk = ["dep:base64ct", "dep:serde_json", "alloc", "serde", "zeroize/alloc"] pkcs8 = ["dep:pkcs8", "sec1"] pem = ["dep:pem-rfc7468", "alloc", "arithmetic", "pkcs8", "sec1/pem"] serde = ["dep:serdect", "alloc", "pkcs8", "sec1/serde"] -voprf = ["digest"] +voprf = ["digest", "hash2curve"] [package.metadata.docs.rs] features = ["bits", "ecdh", "hash2curve", "jwk", "pem", "std", "voprf"] diff --git a/elliptic-curve/src/voprf.rs b/elliptic-curve/src/voprf.rs index 68f2abf18..e882fe1b3 100644 --- a/elliptic-curve/src/voprf.rs +++ b/elliptic-curve/src/voprf.rs @@ -3,6 +3,7 @@ //! use crate::PrimeCurve; +use crate::hash2curve::ExpandMsg; /// Elliptic curve parameters used by VOPRF. pub trait VoprfParameters: PrimeCurve { @@ -17,4 +18,10 @@ pub trait VoprfParameters: PrimeCurve { /// /// [voprf]: https://www.ietf.org/archive/id/draft-irtf-cfrg-voprf-19.html#name-ciphersuites-2 type Hash: digest::Digest; + + /// The `expand_message` parameter which assigns a particular algorithm for `HashToGroup` + /// and `HashToScalar` as defined in [section 4 of `draft-irtf-cfrg-voprf-19`][voprf]. + /// + /// [voprf]: https://www.rfc-editor.org/rfc/rfc9497#name-ciphersuites + type ExpandMsg: for<'a> ExpandMsg<'a>; }