Skip to content

Commit 3607156

Browse files
authored
rename linkedMultiQuery10.circom to linkedMultiQuery10 as base (#142)
* rename linkedMultiQuery10.circom to linkedMultiQuery10 as base fix Universal Circuit * fix tests
1 parent 62b65d3 commit 3607156

File tree

6 files changed

+16
-65
lines changed

6 files changed

+16
-65
lines changed

circuits/credentialAtomicQueryV3Universal-16-16-64.circom

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@ circuitQueryHash - hash of the query
1414
component main{public [requestID,
1515
issuerID,
1616
issuerClaimNonRevState,
17-
claimSchema,
18-
slotIndex,
19-
claimPathKey,
20-
operator,
21-
value,
22-
valueArraySize,
2317
timestamp,
24-
isRevocationChecked,
2518
proofType,
26-
verifierID,
27-
nullifierSessionID
2819
]} = credentialAtomicQueryV3Universal(16, 16, 64); // issuerLevels, claimLevels, maxValueArraySize

circuits/credentialAtomicQueryV3Universal.circom

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@ circuitQueryHash - hash of the query
1414
component main{public [requestID,
1515
issuerID,
1616
issuerClaimNonRevState,
17-
claimSchema,
18-
slotIndex,
19-
claimPathKey,
20-
operator,
21-
value,
22-
valueArraySize,
2317
timestamp,
24-
isRevocationChecked,
25-
proofType,
26-
verifierID,
27-
nullifierSessionID
18+
proofType
2819
]} = credentialAtomicQueryV3Universal(40, 32, 64); // issuerLevels, claimLevels, maxValueArraySize

circuits/universal/credentialAtomicQueryV3Universal.circom

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ template credentialAtomicQueryV3Universal(issuerLevels, claimLevels, maxValueArr
122122
// on root stored in the index or value slot
123123
// if it is not set verification is performed on according to the slotIndex. Value selected from the
124124
// provided slot. For example if slotIndex is `1` value gets from `i_1` slot. If `4` from `v_1`.
125-
signal {binary} merklized;
125+
signal {binary} merklized;
126126

127127
/////////////////////////////////////////////////////////////////
128128
// Claim checks

test/linked/linked.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ import {describe} from "mocha";
44
const path = require("path");
55
const wasmTester = require("circom_tester").wasm;
66

7-
describe("Test linkedMultiQuery10.circom", function () {
7+
describe("Test linkedMultiQuery.circom", function () {
88

99
this.timeout(600000);
1010

1111
let circuit;
1212

1313
before(async () => {
1414
circuit = await wasmTester(
15-
path.join(__dirname, "../../circuits", "linkedMultiQuery10.circom"),
15+
path.join(__dirname, "../../circuits", "linkedMultiQuery.circom"),
1616
{
1717
output: path.join(__dirname, "circuits", "build"),
1818
recompile: true,

testvectorgen/credentials/v3-universal/v3_universal_test.go

Lines changed: 12 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"encoding/json"
66
"math/big"
7-
"strconv"
87
"testing"
98

109
"test/utils"
@@ -99,27 +98,17 @@ type Inputs struct {
9998
}
10099

101100
type Outputs struct {
102-
RequestID string `json:"requestID"`
103-
UserID string `json:"userID"`
104-
IssuerID string `json:"issuerID"`
105-
IssuerClaimNonRevState string `json:"issuerClaimNonRevState"`
106-
ClaimSchema string `json:"claimSchema"`
107-
SlotIndex string `json:"slotIndex"`
108-
Operator int `json:"operator"`
109-
ClaimPathKey string `json:"claimPathKey"`
110-
Value []string `json:"value"`
111-
ValueArraySize int `json:"valueArraySize"`
112-
Timestamp string `json:"timestamp"`
113-
Merklized string `json:"merklized"`
114-
ProofType string `json:"proofType"` // 1 for sig, 2 for mtp
115-
IsRevocationChecked string `json:"isRevocationChecked"`
116-
IssuerState string `json:"issuerState"`
117-
LinkID string `json:"linkID"`
118-
VerifierID string `json:"verifierID"`
119-
NullifierSessionID string `json:"nullifierSessionID"`
120-
OperatorOutput string `json:"operatorOutput"`
121-
Nullifier string `json:"nullifier"`
122-
CircuitQueryHash string `json:"circuitQueryHash"`
101+
RequestID string `json:"requestID"`
102+
UserID string `json:"userID"`
103+
IssuerID string `json:"issuerID"`
104+
IssuerClaimNonRevState string `json:"issuerClaimNonRevState"`
105+
Timestamp string `json:"timestamp"`
106+
ProofType string `json:"proofType"` // 1 for sig, 2 for mtp
107+
IssuerState string `json:"issuerState"`
108+
LinkID string `json:"linkID"`
109+
OperatorOutput string `json:"operatorOutput"`
110+
Nullifier string `json:"nullifier"`
111+
CircuitQueryHash string `json:"circuitQueryHash"`
123112
}
124113

125114
type TestData struct {
@@ -564,21 +553,11 @@ func generateTestDataWithOperatorAndRevCheck(t *testing.T, desc string, isUserID
564553
UserID: userProfileID.BigInt().String(),
565554
IssuerID: issuer.ID.BigInt().String(),
566555
IssuerClaimNonRevState: issuer.State(t).String(),
567-
ClaimSchema: "180410020913331409885634153623124536270",
568-
SlotIndex: strconv.Itoa(slotIndex),
569-
ClaimPathKey: claimPathKey,
570-
Operator: operator,
571-
Value: valueInput,
572-
ValueArraySize: valueArrSize,
573556
Timestamp: timestamp,
574-
Merklized: merklized,
575-
IsRevocationChecked: strconv.Itoa(isRevocationChecked),
576557
ProofType: proofType,
577558
IssuerState: issuerState,
578559
LinkID: linkID,
579560
OperatorOutput: operatorOutput,
580-
VerifierID: inputs.VerifierID,
581-
NullifierSessionID: inputs.NullifierSessionID,
582561
Nullifier: nullifier,
583562
CircuitQueryHash: circuitQueryHash,
584563
}
@@ -713,20 +692,10 @@ func generateJSONLD_NON_INCLUSION_TestData(t *testing.T, isUserIDProfile, isSubj
713692
UserID: userProfileID.BigInt().String(),
714693
IssuerID: issuer.ID.BigInt().String(),
715694
IssuerClaimNonRevState: issuerClaimNonRevState.String(),
716-
ClaimSchema: "180410020913331409885634153623124536270",
717-
SlotIndex: "0",
718-
Operator: utils.NOOP,
719-
ClaimPathKey: pathKey.String(),
720-
Value: utils.PrepareStrArray([]string{}, 64),
721-
ValueArraySize: 0,
722695
Timestamp: timestamp,
723-
Merklized: "1",
724696
IssuerState: issuerAuthState.String(),
725-
IsRevocationChecked: "1",
726697
ProofType: "1",
727698
LinkID: "0",
728-
VerifierID: inputs.VerifierID,
729-
NullifierSessionID: inputs.NullifierSessionID,
730699
OperatorOutput: "0",
731700
Nullifier: "0",
732701
CircuitQueryHash: circuitQueryHash,
@@ -740,7 +709,7 @@ func generateJSONLD_NON_INCLUSION_TestData(t *testing.T, isUserIDProfile, isSubj
740709
require.NoError(t, err)
741710

742711
utils.SaveTestVector(t, fileName, string(jsonData))
743-
}
712+
}
744713

745714
func calculateCircuitQueryHash(t *testing.T, inputs Inputs, merklized string, pathKey *big.Int) (string, error) {
746715
merklizedBigInt, ok := big.NewInt(0).SetString(merklized, 10)

0 commit comments

Comments
 (0)