From eb00b86000efaa5debb6a4842014700f5e4c8f7f Mon Sep 17 00:00:00 2001 From: UneBaguette <28904802+UneBaguette@users.noreply.github.com> Date: Wed, 1 Jul 2026 15:10:11 +0200 Subject: [PATCH] chore: bump to v1.0.0-pre.1 and mostly cleanup stuff (#8) Reviewed-on: https://dev.unebaguette.fr/vexahub/voprf-vx/pulls/8 Co-authored-by: UneBaguette <28904802+UneBaguette@users.noreply.github.com> Co-committed-by: UneBaguette <28904802+UneBaguette@users.noreply.github.com> --- CHANGELOG.md | 5 +++++ Cargo.toml | 2 +- src/ciphersuite.rs | 3 --- src/group/elliptic_curve.rs | 6 +++--- src/group/mod.rs | 14 +++++++------- src/group/ristretto.rs | 14 +++++++------- 6 files changed, 23 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36482e3..4e888c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # 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) Forked from [facebook/voprf](https://github.com/facebook/voprf/) at `0.6.0-pre.1`. diff --git a/Cargo.toml b/Cargo.toml index 85a0c83..b5974e5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ name = "voprf-vx" readme = "README.md" repository = "https://github.com/vexahub/voprf-vx/" rust-version = "1.87" -version = "1.0.0-pre.0" +version = "1.0.0-pre.1" [features] alloc = [] diff --git a/src/ciphersuite.rs b/src/ciphersuite.rs index 64e4c1f..969fc7b 100644 --- a/src/ciphersuite.rs +++ b/src/ciphersuite.rs @@ -9,7 +9,6 @@ //! Defines the CipherSuite trait to specify the underlying primitives for VOPRF use crate::Group; -use core::ops::Mul; use digest::block_api::BlockSizeUser; use digest::typenum::{IsLess, IsLessOrEqual, U256}; use digest::{FixedOutput, HashMarker, OutputSizeUser}; @@ -20,7 +19,6 @@ use hybrid_array::typenum::{IsGreaterOrEqual, Prod, True, U2}; /// Configures the underlying primitives used in VOPRF pub trait CipherSuite where - ::SecurityLevel: Mul, ::OutputSize: ArraySize + IsLess + IsLessOrEqual<::BlockSize, Output = True> @@ -46,7 +44,6 @@ type OprfHash = impl CipherSuite for T where T: Group, - ::SecurityLevel: Mul, OprfHash: BlockSizeUser + Default + FixedOutput + HashMarker, as OutputSizeUser>::OutputSize: ArraySize + IsLess diff --git a/src/group/elliptic_curve.rs b/src/group/elliptic_curve.rs index 2fed7c4..4344f9d 100644 --- a/src/group/elliptic_curve.rs +++ b/src/group/elliptic_curve.rs @@ -67,9 +67,9 @@ where fn hash_to_scalar(input: &[&[u8]], dst: &[&[u8]]) -> Result where H: BlockSizeUser + Default + FixedOutput + HashMarker, - H::OutputSize: IsLess + IsLessOrEqual, - C::SecurityLevel: Mul, - H::OutputSize: IsGreaterOrEqual, Output = True>, + H::OutputSize: IsLess + + IsLessOrEqual + + IsGreaterOrEqual, Output = True>, { hash_to_scalar::, ::Length>(input, dst) .map_err(|_| InternalError::Input) diff --git a/src/group/mod.rs b/src/group/mod.rs index 6155f51..75bb9bd 100644 --- a/src/group/mod.rs +++ b/src/group/mod.rs @@ -64,7 +64,7 @@ where /// Used to enforce `H::OutputSize >= 2 * SecurityLevel` in /// `hash_to_curve` and `hash_to_scalar`, which corresponds to the /// `expand_message` requirement `len_in_bytes = 2 * k / 8`. - type SecurityLevel: ArraySize; + type SecurityLevel: ArraySize + Mul; /// Transforms a password and domain separation tag (DST) into a curve point /// @@ -74,9 +74,9 @@ where fn hash_to_curve(input: &[&[u8]], dst: &[&[u8]]) -> Result where H: BlockSizeUser + Default + FixedOutput + HashMarker, - H::OutputSize: IsLess + IsLessOrEqual, - Self::SecurityLevel: Mul, - H::OutputSize: IsGreaterOrEqual, Output = True>; + H::OutputSize: IsLess + + IsLessOrEqual + + IsGreaterOrEqual, Output = True>; /// Hashes a slice of pseudo-random bytes to a scalar /// @@ -86,9 +86,9 @@ where fn hash_to_scalar(input: &[&[u8]], dst: &[&[u8]]) -> Result where H: BlockSizeUser + Default + FixedOutput + HashMarker, - H::OutputSize: IsLess + IsLessOrEqual, - Self::SecurityLevel: Mul, - H::OutputSize: IsGreaterOrEqual, Output = True>; + H::OutputSize: IsLess + + IsLessOrEqual + + IsGreaterOrEqual, Output = True>; /// Get the base point for the group fn base_elem() -> Self::Elem; diff --git a/src/group/ristretto.rs b/src/group/ristretto.rs index 6d8532e..714801c 100644 --- a/src/group/ristretto.rs +++ b/src/group/ristretto.rs @@ -7,7 +7,7 @@ // licenses. use core::num::NonZeroU16; -use core::ops::Mul; + use curve25519_dalek::constants::RISTRETTO_BASEPOINT_POINT; use curve25519_dalek::ristretto::{CompressedRistretto, RistrettoPoint}; use curve25519_dalek::scalar::Scalar; @@ -54,9 +54,9 @@ impl Group for Ristretto255 { fn hash_to_curve(input: &[&[u8]], dst: &[&[u8]]) -> Result where H: BlockSizeUser + Default + FixedOutput + HashMarker, - H::OutputSize: IsLess + IsLessOrEqual, - Self::SecurityLevel: Mul, - H::OutputSize: IsGreaterOrEqual, Output = True>, + H::OutputSize: IsLess + + IsLessOrEqual + + IsGreaterOrEqual, Output = True>, { let mut uniform_bytes = [0u8; 64]; @@ -77,9 +77,9 @@ impl Group for Ristretto255 { fn hash_to_scalar(input: &[&[u8]], dst: &[&[u8]]) -> Result where H: BlockSizeUser + Default + FixedOutput + HashMarker, - H::OutputSize: IsLess + IsLessOrEqual, - Self::SecurityLevel: Mul, - H::OutputSize: IsGreaterOrEqual, Output = True>, + H::OutputSize: IsLess + + IsLessOrEqual + + IsGreaterOrEqual, Output = True>, { let mut uniform_bytes = [0u8; 64];