From 43efb51e2e34620d8aac959a0437cfadc455f01a Mon Sep 17 00:00:00 2001 From: Nicholas Dudfield Date: Tue, 9 May 2023 08:16:21 +0700 Subject: [PATCH] docs(readme): make it more immediately clear re: batching --- README.md | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index d1382eb..11ef426 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Oprf.Suite.P521_SHA512 #### Step 1 -First setup a client and a server. In this case, we use the VOPRF mode with suite P384-SHA384. +First set up a client and a server. In this case, we use the VOPRF mode with suite P384-SHA384. ```js import { @@ -49,11 +49,12 @@ const client = new VOPRFClient(suite, publicKey); #### Step 2 -The client prepares arbitrary input that will be evaluated by the server, the blinding method produces an evaluation request, and some finalization data to be used later. Then, the client sends the evaluation request to the server. +The client prepares arbitrary input[s] that will be batch evaluated by the server. The blinding method produces an evaluation request, and some finalization data to be used later. Then, the client sends the evaluation request to the server. ```js const input = new TextEncoder().encode("This is the client's input"); -const [finData, evalReq] = await client.blind([input]); +const batch = [input] +const [finData, evalReq] = await client.blind(batch); ``` #### Step 3 @@ -61,28 +62,29 @@ const [finData, evalReq] = await client.blind([input]); Once the server received the evaluation request, it responds to the client with an evaluation. ```js -const evaluation = await server.evaluate(evalReq); +const evaluation = await server.blindEvaluate(evalReq); ``` #### Step 4 -Finally, the client can produce the output of the OPRF protocol using the server's evaluation and the finalization data from the second step. If the mode is verifiable, this step allows the client to check the proof that the server used the expected private key for the evaluation. +Finally, the client can produce the output[s] of the OPRF protocol using the server's evaluation and the finalization data from the second step. If the mode is verifiable, this step allows the client to check the proof that the server used the expected private key for the evaluation. ```js -const output = await client.finalize(finData, evaluation); +// Get output matching first input of batch +const [output] = await client.finalize(finData, evaluation); ``` ### Development -| Task | NPM scripts | -|--|--| -| Installing | `$ npm ci` | -| Building | `$ npm run build` | -| Unit Tests | `$ npm run test` | -| Examples | `$ npm run examples` | -| Benchmarking | `$ npm run bench` | -| Code Linting | `$ npm run lint` | -| Code Formating | `$ npm run format` | +| Task | NPM scripts | +|-----------------|----------------------| +| Installing | `$ npm ci` | +| Building | `$ npm run build` | +| Unit Tests | `$ npm run test` | +| Examples | `$ npm run examples` | +| Benchmarking | `$ npm run bench` | +| Code Linting | `$ npm run lint` | +| Code Formatting | `$ npm run format` | **Dependencies**