Skip to content

Commit

Permalink
Publishing v0.5.0-pre.7 (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinlewi committed Jan 11, 2024
1 parent 68cc7d3 commit 1b67086
Show file tree
Hide file tree
Showing 11 changed files with 930 additions and 1,039 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 0.5.0-pre.7 (January 11, 2023)
* Updated to be in sync with RFC 9497

## 0.5.0-pre.6 (July 24, 2023)
* Updated curve25519-dalek dependency to 4

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name = "voprf"
readme = "README.md"
repository = "https://github.com/facebook/voprf/"
rust-version = "1.65"
version = "0.5.0-pre.6"
version = "0.5.0-pre.7"

[features]
alloc = []
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ An implementation of a (verifiable) oblivious pseudorandom function (VOPRF)

A VOPRF is a verifiable oblivious pseudorandom function, a protocol between a client and a server. The regular (non-verifiable) OPRF is also supported in this implementation.

This implementation is based on the [Internet Draft for VOPRF](https://github.com/cfrg/draft-irtf-cfrg-voprf).
This implementation is based on [RFC 9497](https://www.rfc-editor.org/rfc/rfc9497).

Documentation
-------------
Expand All @@ -16,7 +16,7 @@ Installation
Add the following line to the dependencies of your `Cargo.toml`:

```
voprf = "0.5.0-pre.6"
voprf = "0.5.0-pre.7"
```

### Minimum Supported Rust Version
Expand Down
2 changes: 1 addition & 1 deletion src/ciphersuite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ where
IsLess<U256> + IsLessOrEqual<<Self::Hash as BlockSizeUser>::BlockSize>,
{
/// The ciphersuite identifier as dictated by
/// <https://datatracker.ietf.org/doc/draft-irtf-cfrg-voprf/>
/// <https://www.rfc-editor.org/rfc/rfc9497>
const ID: &'static str;

/// A finite cyclic group along with a point representation that allows some
Expand Down
8 changes: 4 additions & 4 deletions src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ where
<CS::Hash as OutputSizeUser>::OutputSize:
IsLess<U256> + IsLessOrEqual<<CS::Hash as BlockSizeUser>::BlockSize>,
{
// https://www.ietf.org/archive/id/draft-irtf-cfrg-voprf-11.html#section-2.2.1
// https://www.rfc-editor.org/rfc/rfc9497#section-2.2.1

let (m, z) = compute_composites::<CS, _, _>(Some(k), b, cs, ds, mode)?;

Expand Down Expand Up @@ -218,7 +218,7 @@ where
<CS::Hash as OutputSizeUser>::OutputSize:
IsLess<U256> + IsLessOrEqual<<CS::Hash as BlockSizeUser>::BlockSize>,
{
// https://www.ietf.org/archive/id/draft-irtf-cfrg-voprf-11.html#section-2.2.2
// https://www.rfc-editor.org/rfc/rfc9497#section-2.2.2
let (m, z) = compute_composites::<CS, _, _>(None, b, cs, ds, mode)?;
let t2 = (a * &proof.s_scalar) + &(b * &proof.c_scalar);
let t3 = (m * &proof.s_scalar) + &(z * &proof.c_scalar);
Expand Down Expand Up @@ -287,7 +287,7 @@ where
<CS::Hash as OutputSizeUser>::OutputSize:
IsLess<U256> + IsLessOrEqual<<CS::Hash as BlockSizeUser>::BlockSize>,
{
// https://www.ietf.org/archive/id/draft-irtf-cfrg-voprf-11.html#section-2.2.1
// https://www.rfc-editor.org/rfc/rfc9497#section-2.2.1

let elem_len = <CS::Group as Group>::ElemLen::U16.to_be_bytes();

Expand Down Expand Up @@ -513,7 +513,7 @@ impl<L: ArrayLength<u8>> Dst<L> {
{
let par_1 = par_1.into();
// Generates the contextString parameter as defined in
// <https://datatracker.ietf.org/doc/draft-irtf-cfrg-voprf/>
// <https://www.rfc-editor.org/rfc/rfc9497#section-3.1>
let par_2 = GenericArray::from(STR_OPRF)
.concat([mode.to_u8()].into())
.concat([b'-'].into());
Expand Down
2 changes: 1 addition & 1 deletion src/group/elliptic_curve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ where
type ScalarLen = FieldBytesSize<Self>;

// Implements the `hash_to_curve()` function from
// https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-hash-to-curve-11#section-3
// https://www.rfc-editor.org/rfc/rfc9380.html#section-3
fn hash_to_curve<H>(input: &[&[u8]], dst: &[&[u8]]) -> Result<Self::Elem, InternalError>
where
H: BlockSizeUser + Default + FixedOutput + HashMarker,
Expand Down
2 changes: 1 addition & 1 deletion src/group/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use zeroize::Zeroize;
use crate::{InternalError, Result};

/// A prime-order subgroup of a base field (EC, prime-order field ...). This
/// subgroup is noted additively — as in the draft RFC — in this trait.
/// subgroup is noted additively — as in the RFC — in this trait.
pub trait Group {
/// The type of group elements
type Elem: ConstantTimeEq
Expand Down
4 changes: 2 additions & 2 deletions src/group/ristretto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl Group for Ristretto255 {
type ScalarLen = U32;

// Implements the `hash_to_ristretto255()` function from
// https://www.ietf.org/archive/id/draft-irtf-cfrg-hash-to-curve-10.txt
// https://www.rfc-editor.org/rfc/rfc9380.html#appendix-B
fn hash_to_curve<H>(input: &[&[u8]], dst: &[&[u8]]) -> Result<Self::Elem, InternalError>
where
H: BlockSizeUser + Default + FixedOutput + HashMarker,
Expand All @@ -59,7 +59,7 @@ impl Group for Ristretto255 {
}

// Implements the `HashToScalar()` function from
// https://www.ietf.org/archive/id/draft-irtf-cfrg-voprf-07.html#section-4.1
// https://www.rfc-editor.org/rfc/rfc9497#section-4.1
fn hash_to_scalar<H>(input: &[&[u8]], dst: &[&[u8]]) -> Result<Self::Scalar, InternalError>
where
H: BlockSizeUser + Default + FixedOutput + HashMarker,
Expand Down
6 changes: 2 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
//! An implementation of a verifiable oblivious pseudorandom function (VOPRF)
//!
//! Note: This implementation is in sync with
//! [draft-irtf-cfrg-voprf-19](https://www.ietf.org/archive/id/draft-irtf-cfrg-voprf-19.html),
//! but this specification is subject to change, until the final version
//! published by the IETF.
//! [RFC 9497](https://www.rfc-editor.org/rfc/rfc9497).
//!
//! # Overview
//!
Expand Down Expand Up @@ -512,7 +510,7 @@
//! and [PoprfClient] are used, and that each of the functions accept an
//! additional (and optional) info parameter which represents the public input.
//! See
//! <https://www.ietf.org/archive/id/draft-irtf-cfrg-voprf-11.html#name-poprf-public-input>
//! <https://www.rfc-editor.org/rfc/rfc9497#name-poprf-public-input>
//! for more detailed information on how this public input should be used.
//!
//! # Features
Expand Down
Loading

0 comments on commit 1b67086

Please sign in to comment.