WebAssembly / wasi-crypto

WASI Cryptography API Proposal
162 stars 25 forks source link

OPRF module #90

Open jedisct1 opened 11 months ago

jedisct1 commented 11 months ago

Consider adding optional module for OPRFs.

Ref: https://github.com/cloudflare/voprf-ts/issues/32#issuecomment-1701911526

armfazh commented 11 months ago

How do we start sketching the specification for (V)OPRFs?

jedisct1 commented 11 months ago

Hi Armando!

First, take a look at the existing modules.

There are some constraints that come with WASI modules. They are similar to system calls: the number of functions should be as small as possible, and they should be generic and future-proof rather than specific. Even at the expense of performance. Breaking changes would be complicated and would break all existing applications.

Parameters or return values that are not primitive types should generally be handles. This is especially true for secrets, as the API can also be used in a HSM-like context, where the secrets are only accessible by the runtime, not directly by applications.

The interfaces themselves are described in a language called witx.

The witx files for the current modules can be found here: https://github.com/WebAssembly/wasi-crypto/tree/main/witx/witx-0.10

So, in order to add a new module for {P,V}OPRFs, a new wasi_ephemeral_crypto_oprf.witx file should be added there.

We can set up a meeting to discuss all this if you like.