Skip to main content

hash2curve/
oprf.rs

1use digest::FixedOutput;
2use digest::Update;
3use elliptic_curve::PrimeCurve;
4use elliptic_curve::array::typenum::IsLess;
5use elliptic_curve::consts::{True, U65536};
6
7use crate::{ExpandMsg, GroupDigest};
8
9/// Elliptic curve parameters used by OPRF.
10pub trait OprfParameters:
11    GroupDigest<
12        ExpandMsg: ExpandMsg<
13            Self::SecurityLevel,
14            Hash: Default + FixedOutput<OutputSize: IsLess<U65536, Output = True>> + Update,
15        >,
16    > + PrimeCurve
17{
18    /// The `ID` parameter which identifies a particular elliptic curve
19    /// as defined in [section 4 of RFC9497][oprf].
20    ///
21    /// [oprf]: https://www.rfc-editor.org/rfc/rfc9497.html#name-ciphersuites
22    const ID: &'static [u8];
23}