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 RFC 9497.
The API can be found here along with an example for usage.
Add the following line to the dependencies of your Cargo.toml:
voprf = "0.6.0-pre.2"
Rust 1.88 or higher.
The minimum elliptic-curve version is 0.14.3, requiring crypto-bigint 0.7.8
or newer to address RUSTSEC-2026-0387.
This implementation uses hash2curve 0.14,
digest 0.11 and rand_core 0.10. Primitive and serialized buffers use
hybrid_array::Array; their byte encodings and RFC 9497 suite identifiers remain
unchanged. Custom Group implementations specify their security level in bytes
through Group::SecurityLevel, matching the hash-to-curve parameters.
Random generators implement TryCryptoRng. Randomness failures return
Error::Rng for both Ristretto255 and the NIST curves, without producing a scalar.
Cargo's MSRV-aware resolver selects dependency releases compatible with the
declared Rust version.
The author of this code is Kevin Lewi (@kevinlewi). To learn more about contributing to this project, see this document.
This project is dual-licensed under either the MIT license or the Apache License, Version 2.0. You may select, at your option, one of the above-listed licenses.