Skip to content

Commit

Permalink
Bumping voprf-ts to v1.0.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
armfazh committed Sep 4, 2024
1 parent 6d14cfd commit bab181f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 21 deletions.
28 changes: 14 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
"dependencies": {
"@cloudflare/blindrsa-ts": "0.4.2",
"@cloudflare/voprf-ts": "0.21.2",
"@cloudflare/voprf-ts": "1.0.0",
"asn1-parser": "1.1.8",
"asn1js": "3.0.5",
"rfc4648": "1.5.3"
Expand Down
11 changes: 5 additions & 6 deletions src/priv_verif_token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export interface VOPRFExtraParams {

const VOPRF_SUITE = Oprf.Suite.P384_SHA384;
const VOPRF_GROUP = Oprf.getGroup(VOPRF_SUITE);
const VOPRF_HASH = Oprf.getHash(VOPRF_SUITE) as HashID;
const VOPRF_HASH = Oprf.getHash(VOPRF_SUITE);
const VOPRF_EXTRA_PARAMS: VOPRFExtraParams = {
suite: VOPRF_SUITE,
group: VOPRF_GROUP,
Expand All @@ -40,10 +40,9 @@ const VOPRF_EXTRA_PARAMS: VOPRFExtraParams = {
Nk: Oprf.getOprfSize(VOPRF_SUITE),
hash: VOPRF_HASH,
dleqParams: {
gg: VOPRF_GROUP,
hashID: VOPRF_HASH,
hash: (hashID, input) => Oprf.Crypto.hash(hashID, input),
dst: '',
group: VOPRF_GROUP.id,
hash: VOPRF_HASH,
dst: new Uint8Array(),
},
} as const;

Expand Down Expand Up @@ -256,7 +255,7 @@ export class Client {
throw new Error('no token request was created yet');
}

const proof = DLEQProof.deserialize(VOPRF.dleqParams, tokRes.evaluateProof);
const proof = DLEQProof.deserialize(VOPRF_GROUP.id, tokRes.evaluateProof);
const evaluateMsg = VOPRF.group.desElt(tokRes.evaluateMsg);
const evaluation = new Evaluation(Oprf.Mode.VOPRF, [evaluateMsg], proof);
const [authenticator] = await this.finData.vClient.finalize(
Expand Down

0 comments on commit bab181f

Please sign in to comment.