mirror of
https://github.com/apple/swift-crypto
synced 2026-11-24 04:37:48 +00:00
## Motivation We would like to provide support for the P384-SHA384 Verifiable Oblivious Pseudorandom Function (VOPRF) as defined in [RFC 9497: VOPRF Protocol](https://www.rfc-editor.org/rfc/rfc9497.html#name-voprf-protocol). ## Modifications - Add protocols for some "ECToolbox" abstractions: `Group`, `GroupElement`, `GroupScalar`, `HashToGroup`. - Add implementations backed by BoringSSL. - Duplicate some utilities from Crypto into _CryptoExtras: hexadecimal bytes and I2OSP. - Add VOPRF API, rooted at `enum P384._VOPRF`. ## Results - New internal abstractions that make it easier to bring up new implementations. - New API for `OPRF(P-384, SHA-384)` in VOPRF mode. ## Tests - Test vectors for internal `HashToField` implementation. - Test vectors for internal VOPRF implementation. - Tests of the VOPRF public API.