Skip to content

Commit

Permalink
chore: minor type issues
Browse files Browse the repository at this point in the history
  • Loading branch information
adiwajshing committed Nov 14, 2024
1 parent 7ad0e8a commit 9cf71f3
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
3 changes: 1 addition & 2 deletions js/src/gnark/toprf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,8 @@ export function makeGnarkOPRFOperator({
fromUint8Array(request.secretElements[1])
]
},
responses: responses.map(({ index, publicKeyShare, evaluated, c, r }) => (
responses: responses.map(({ publicKeyShare, evaluated, c, r }) => (
{
index: index,
publicKeyShare: fromUint8Array(publicKeyShare),
evaluated: fromUint8Array(evaluated),
c: fromUint8Array(c),
Expand Down
3 changes: 1 addition & 2 deletions js/src/gnark/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,9 @@ export function generateGnarkWitness(
}

function mapResponse({
index, publicKeyShare, evaluated, c, r
publicKeyShare, evaluated, c, r
}: ZKTOPRFResponsePublicSignals) {
return {
index,
publicKeyShare: Base64.fromUint8Array(publicKeyShare),
evaluated: Base64.fromUint8Array(evaluated),
c: Base64.fromUint8Array(c),
Expand Down
1 change: 0 additions & 1 deletion js/src/tests/oprf.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ describe('TOPRF circuits Tests', () => {
)

resps.push({
index: i,
publicKeyShare: keys.shares[i].publicKey,
evaluated: evalResult.evaluated,
c: evalResult.c,
Expand Down
4 changes: 2 additions & 2 deletions js/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ export type MakeZKOperatorOpts<T> = {

export type MakeZKOperator<T> = (opts: MakeZKOperatorOpts<T>) => ZKOperator

export type MakeOPRFOperator<T> = (opts: MakeZKOperatorOpts<T>) => OPRFOperator

/**
* provide Uint8array for file data loaded into memory
* or string, that is the path to load said file
Expand Down Expand Up @@ -129,7 +131,6 @@ type ZKProofOutput = {
type ZKInputItem = Uint8Array

export type ZKTOPRFResponsePublicSignals = {
index: number
publicKeyShare: ZKInputItem
evaluated: ZKInputItem
c: ZKInputItem
Expand Down Expand Up @@ -177,7 +178,6 @@ type OPRFResponse = {
}

export type OPRFResponseData = OPRFResponse & {
index: number
publicKeyShare: Uint8Array
}

Expand Down
3 changes: 2 additions & 1 deletion js/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"lib": [ "es2020", "DOM" ]
},
"include": [
"src/**/*.ts"
"src/**/*.ts",
"src/**/*.js"
],
"exclude": [
"node_modules"
Expand Down

0 comments on commit 9cf71f3

Please sign in to comment.