Compare commits

...
Author SHA1 Message Date
breakingbread eb00b86000 chore: bump to v1.0.0-pre.1 and mostly cleanup stuff (#8)
Rust CI / cargo fmt (push) Successful in 3s
Rust CI / cargo clippy (push) Successful in 29s
Rust CI / test (1.87.0 / no backend / no frontend) (push) Successful in 1m24s
Rust CI / test (stable / no backend / no frontend) (push) Successful in 1m18s
Rust CI / test (1.87.0 / no backend / --features danger) (push) Successful in 1m25s
Rust CI / test (stable / no backend / --features danger) (push) Successful in 1m20s
Rust CI / test (1.87.0 / no backend / --features serde) (push) Successful in 1m25s
Rust CI / test (stable / no backend / --features serde) (push) Successful in 1m20s
Rust CI / test (1.87.0 / --features ristretto255-ciphersuite / no frontend) (push) Successful in 1m35s
Rust CI / test (stable / --features ristretto255-ciphersuite / no frontend) (push) Successful in 1m29s
Rust CI / test (1.87.0 / --features ristretto255-ciphersuite / --features danger) (push) Successful in 1m34s
Rust CI / test (stable / --features ristretto255-ciphersuite / --features danger) (push) Successful in 1m28s
Rust CI / test (1.87.0 / --features ristretto255-ciphersuite / --features serde) (push) Successful in 1m34s
Rust CI / test (stable / --features ristretto255-ciphersuite / --features serde) (push) Successful in 1m29s
Rust CI / cargo audit (push) Successful in 5s
Rust CI / no-std (thumbv6m-none-eabi / --features ristretto255-ciphersuite) (push) Successful in 14s
Rust CI / no-std (thumbv6m-none-eabi / no backend) (push) Successful in 14s
Rust CI / no-std (wasm32-unknown-unknown / no backend) (push) Successful in 14s
Rust CI / no-std (wasm32-unknown-unknown / --features ristretto255-ciphersuite) (push) Successful in 14s
Publish / publish (release) Successful in 18s
Reviewed-on: #8
Co-authored-by: UneBaguette <[email protected]>
Co-committed-by: UneBaguette <[email protected]>
2026-07-01 15:10:11 +02:00
6 changed files with 23 additions and 21 deletions
+5
View File
@@ -1,5 +1,10 @@
# Changelog # Changelog
## 1.0.0-pre.1 (July 2, 2026)
* Simplified ciphersuite trait
* Moved multiplication operator to SecurityLevel type in Group trait
## 1.0.0-pre.0 (June 29, 2026) ## 1.0.0-pre.0 (June 29, 2026)
Forked from [facebook/voprf](https://github.com/facebook/voprf/) at `0.6.0-pre.1`. Forked from [facebook/voprf](https://github.com/facebook/voprf/) at `0.6.0-pre.1`.
+1 -1
View File
@@ -9,7 +9,7 @@ name = "voprf-vx"
readme = "README.md" readme = "README.md"
repository = "https://github.com/vexahub/voprf-vx/" repository = "https://github.com/vexahub/voprf-vx/"
rust-version = "1.87" rust-version = "1.87"
version = "1.0.0-pre.0" version = "1.0.0-pre.1"
[features] [features]
alloc = [] alloc = []
-3
View File
@@ -9,7 +9,6 @@
//! Defines the CipherSuite trait to specify the underlying primitives for VOPRF //! Defines the CipherSuite trait to specify the underlying primitives for VOPRF
use crate::Group; use crate::Group;
use core::ops::Mul;
use digest::block_api::BlockSizeUser; use digest::block_api::BlockSizeUser;
use digest::typenum::{IsLess, IsLessOrEqual, U256}; use digest::typenum::{IsLess, IsLessOrEqual, U256};
use digest::{FixedOutput, HashMarker, OutputSizeUser}; use digest::{FixedOutput, HashMarker, OutputSizeUser};
@@ -20,7 +19,6 @@ use hybrid_array::typenum::{IsGreaterOrEqual, Prod, True, U2};
/// Configures the underlying primitives used in VOPRF /// Configures the underlying primitives used in VOPRF
pub trait CipherSuite pub trait CipherSuite
where where
<Self::Group as Group>::SecurityLevel: Mul<U2>,
<Self::Hash as OutputSizeUser>::OutputSize: ArraySize <Self::Hash as OutputSizeUser>::OutputSize: ArraySize
+ IsLess<U256> + IsLess<U256>
+ IsLessOrEqual<<Self::Hash as BlockSizeUser>::BlockSize, Output = True> + IsLessOrEqual<<Self::Hash as BlockSizeUser>::BlockSize, Output = True>
@@ -46,7 +44,6 @@ type OprfHash<T> =
impl<T: OprfParameters> CipherSuite for T impl<T: OprfParameters> CipherSuite for T
where where
T: Group, T: Group,
<T as Group>::SecurityLevel: Mul<U2>,
OprfHash<T>: BlockSizeUser + Default + FixedOutput + HashMarker, OprfHash<T>: BlockSizeUser + Default + FixedOutput + HashMarker,
<OprfHash<T> as OutputSizeUser>::OutputSize: ArraySize <OprfHash<T> as OutputSizeUser>::OutputSize: ArraySize
+ IsLess<U256> + IsLess<U256>
+3 -3
View File
@@ -67,9 +67,9 @@ where
fn hash_to_scalar<H>(input: &[&[u8]], dst: &[&[u8]]) -> Result<Self::Scalar, InternalError> fn hash_to_scalar<H>(input: &[&[u8]], dst: &[&[u8]]) -> Result<Self::Scalar, InternalError>
where where
H: BlockSizeUser + Default + FixedOutput + HashMarker, H: BlockSizeUser + Default + FixedOutput + HashMarker,
H::OutputSize: IsLess<U256> + IsLessOrEqual<H::BlockSize, Output = True>, H::OutputSize: IsLess<U256>
C::SecurityLevel: Mul<U2>, + IsLessOrEqual<H::BlockSize, Output = True>
H::OutputSize: IsGreaterOrEqual<Prod<C::SecurityLevel, U2>, Output = True>, + IsGreaterOrEqual<Prod<C::SecurityLevel, U2>, Output = True>,
{ {
hash_to_scalar::<C, ExpandMsgXmd<H>, <C as MapToCurve>::Length>(input, dst) hash_to_scalar::<C, ExpandMsgXmd<H>, <C as MapToCurve>::Length>(input, dst)
.map_err(|_| InternalError::Input) .map_err(|_| InternalError::Input)
+7 -7
View File
@@ -64,7 +64,7 @@ where
/// Used to enforce `H::OutputSize >= 2 * SecurityLevel` in /// Used to enforce `H::OutputSize >= 2 * SecurityLevel` in
/// `hash_to_curve` and `hash_to_scalar`, which corresponds to the /// `hash_to_curve` and `hash_to_scalar`, which corresponds to the
/// `expand_message` requirement `len_in_bytes = 2 * k / 8`. /// `expand_message` requirement `len_in_bytes = 2 * k / 8`.
type SecurityLevel: ArraySize; type SecurityLevel: ArraySize + Mul<U2>;
/// Transforms a password and domain separation tag (DST) into a curve point /// Transforms a password and domain separation tag (DST) into a curve point
/// ///
@@ -74,9 +74,9 @@ where
fn hash_to_curve<H>(input: &[&[u8]], dst: &[&[u8]]) -> Result<Self::Elem, InternalError> fn hash_to_curve<H>(input: &[&[u8]], dst: &[&[u8]]) -> Result<Self::Elem, InternalError>
where where
H: BlockSizeUser + Default + FixedOutput + HashMarker, H: BlockSizeUser + Default + FixedOutput + HashMarker,
H::OutputSize: IsLess<U256> + IsLessOrEqual<H::BlockSize, Output = True>, H::OutputSize: IsLess<U256>
Self::SecurityLevel: Mul<U2>, + IsLessOrEqual<H::BlockSize, Output = True>
H::OutputSize: IsGreaterOrEqual<Prod<Self::SecurityLevel, U2>, Output = True>; + IsGreaterOrEqual<Prod<Self::SecurityLevel, U2>, Output = True>;
/// Hashes a slice of pseudo-random bytes to a scalar /// Hashes a slice of pseudo-random bytes to a scalar
/// ///
@@ -86,9 +86,9 @@ where
fn hash_to_scalar<H>(input: &[&[u8]], dst: &[&[u8]]) -> Result<Self::Scalar, InternalError> fn hash_to_scalar<H>(input: &[&[u8]], dst: &[&[u8]]) -> Result<Self::Scalar, InternalError>
where where
H: BlockSizeUser + Default + FixedOutput + HashMarker, H: BlockSizeUser + Default + FixedOutput + HashMarker,
H::OutputSize: IsLess<U256> + IsLessOrEqual<H::BlockSize, Output = True>, H::OutputSize: IsLess<U256>
Self::SecurityLevel: Mul<U2>, + IsLessOrEqual<H::BlockSize, Output = True>
H::OutputSize: IsGreaterOrEqual<Prod<Self::SecurityLevel, U2>, Output = True>; + IsGreaterOrEqual<Prod<Self::SecurityLevel, U2>, Output = True>;
/// Get the base point for the group /// Get the base point for the group
fn base_elem() -> Self::Elem; fn base_elem() -> Self::Elem;
+7 -7
View File
@@ -7,7 +7,7 @@
// licenses. // licenses.
use core::num::NonZeroU16; use core::num::NonZeroU16;
use core::ops::Mul;
use curve25519_dalek::constants::RISTRETTO_BASEPOINT_POINT; use curve25519_dalek::constants::RISTRETTO_BASEPOINT_POINT;
use curve25519_dalek::ristretto::{CompressedRistretto, RistrettoPoint}; use curve25519_dalek::ristretto::{CompressedRistretto, RistrettoPoint};
use curve25519_dalek::scalar::Scalar; use curve25519_dalek::scalar::Scalar;
@@ -54,9 +54,9 @@ impl Group for Ristretto255 {
fn hash_to_curve<H>(input: &[&[u8]], dst: &[&[u8]]) -> Result<Self::Elem, InternalError> fn hash_to_curve<H>(input: &[&[u8]], dst: &[&[u8]]) -> Result<Self::Elem, InternalError>
where where
H: BlockSizeUser + Default + FixedOutput + HashMarker, H: BlockSizeUser + Default + FixedOutput + HashMarker,
H::OutputSize: IsLess<U256> + IsLessOrEqual<H::BlockSize, Output = True>, H::OutputSize: IsLess<U256>
Self::SecurityLevel: Mul<U2>, + IsLessOrEqual<H::BlockSize, Output = True>
H::OutputSize: IsGreaterOrEqual<Prod<Self::SecurityLevel, U2>, Output = True>, + IsGreaterOrEqual<Prod<Self::SecurityLevel, U2>, Output = True>,
{ {
let mut uniform_bytes = [0u8; 64]; let mut uniform_bytes = [0u8; 64];
@@ -77,9 +77,9 @@ impl Group for Ristretto255 {
fn hash_to_scalar<H>(input: &[&[u8]], dst: &[&[u8]]) -> Result<Self::Scalar, InternalError> fn hash_to_scalar<H>(input: &[&[u8]], dst: &[&[u8]]) -> Result<Self::Scalar, InternalError>
where where
H: BlockSizeUser + Default + FixedOutput + HashMarker, H: BlockSizeUser + Default + FixedOutput + HashMarker,
H::OutputSize: IsLess<U256> + IsLessOrEqual<H::BlockSize, Output = True>, H::OutputSize: IsLess<U256>
Self::SecurityLevel: Mul<U2>, + IsLessOrEqual<H::BlockSize, Output = True>
H::OutputSize: IsGreaterOrEqual<Prod<Self::SecurityLevel, U2>, Output = True>, + IsGreaterOrEqual<Prod<Self::SecurityLevel, U2>, Output = True>,
{ {
let mut uniform_bytes = [0u8; 64]; let mut uniform_bytes = [0u8; 64];