diff --git a/circuits/linked/multiQuery.circom b/circuits/linked/multiQuery.circom index d3c83967..e2024fcb 100644 --- a/circuits/linked/multiQuery.circom +++ b/circuits/linked/multiQuery.circom @@ -11,7 +11,6 @@ include "../lib/utils/spongeHash.circom"; template LinkedMultiQuery(N, claimLevels, valueArraySize) { // linked proof signals - signal input linkID; signal input linkNonce; signal input issuerClaim[8]; @@ -29,6 +28,7 @@ template LinkedMultiQuery(N, claimLevels, valueArraySize) { signal input value[N][valueArraySize]; // Outputs + signal output linkID; signal output merklized; signal output operatorOutput[N]; signal output circuitQueryHash[N]; @@ -38,7 +38,7 @@ template LinkedMultiQuery(N, claimLevels, valueArraySize) { ///////////////////////////////////////////////////////////////// // get safe one values to be used in ForceEqualIfEnabled - signal one <== SafeOne()(linkID); // 7 constraints + signal one <== SafeOne()(linkNonce); // 7 constraints // get claim header component issuerClaimHeader = getClaimHeader(); // 300 constraints @@ -60,6 +60,13 @@ template LinkedMultiQuery(N, claimLevels, valueArraySize) { signal isQueryOp[N]; signal valueHash[N]; + signal issuerClaimHash, issuerClaimHi, issuerClaimHv; + (issuerClaimHash, issuerClaimHi, issuerClaimHv) <== getClaimHash()(issuerClaim); // 834 constraints + //////////////////////////////////////////////////////////////////////// + // calculate linkID + //////////////////////////////////////////////////////////////////////// + linkID <== LinkID()(issuerClaimHash, linkNonce); // 243 constraints + ///////////////////////////////////////////////////////////////// // Query Processing Loop ///////////////////////////////////////////////////////////////// diff --git a/circuits/linked/nullifier.circom b/circuits/linked/nullifier.circom index 0e47b304..17e04741 100644 --- a/circuits/linked/nullifier.circom +++ b/circuits/linked/nullifier.circom @@ -2,7 +2,7 @@ pragma circom 2.1.5; include "../../node_modules/circomlib/circuits/comparators.circom"; include "../lib/linked/linkId.circom"; -include "../lib/query/nullify.circom"; +include "../lib/utils/nullify.circom"; include "../lib/utils/safeOne.circom"; include "../lib/utils/claimUtils.circom"; @@ -10,7 +10,6 @@ include "../lib/utils/claimUtils.circom"; template LinkedNullifier(){ // linked proof signals - signal input linkID; signal input linkNonce; signal input issuerClaim[8]; @@ -19,9 +18,10 @@ template LinkedNullifier(){ signal input claimSubjectProfileNonce; signal input claimSchema; signal input verifierID; - signal input verifierSessionID; + signal input nullifierSessionID; signal output nullifier; + signal output linkID; // get safe one values to be used in ForceEqualIfEnabled signal one <== SafeOne()(userGenesisID); // 7 constraints @@ -49,10 +49,9 @@ template LinkedNullifier(){ (issuerClaimHash, issuerClaimHi, issuerClaimHv) <== getClaimHash()(issuerClaim); // 834 constraints //////////////////////////////////////////////////////////////////////// - // verify linkID + // calculate linkID //////////////////////////////////////////////////////////////////////// - signal calculatedLinkID <== LinkID()(issuerClaimHash, linkNonce); // 243 constraints - ForceEqualIfEnabled()(one, [calculatedLinkID, linkID]); + linkID <== LinkID()(issuerClaimHash, linkNonce); // 243 constraints signal linkIDisNotZero <== NOT()(IsZero()(linkID)); ForceEqualIfEnabled()(one, [linkIDisNotZero, one]); @@ -65,7 +64,7 @@ template LinkedNullifier(){ claimSubjectProfileNonce, claimSchema, verifierID, - verifierSessionID + nullifierSessionID ); // 330 constraints } \ No newline at end of file diff --git a/circuits/linkedMultiQuery10.circom b/circuits/linkedMultiQuery10.circom index a0ffc2e4..2345cf5d 100644 --- a/circuits/linkedMultiQuery10.circom +++ b/circuits/linkedMultiQuery10.circom @@ -2,4 +2,4 @@ pragma circom 2.1.1; include "linked/multiQuery.circom"; -component main {public [linkID]} = LinkedMultiQuery(10, 32, 64); // 163694 constraints +component main = LinkedMultiQuery(10, 32, 64); // 163694 constraints diff --git a/circuits/linkedMultiQuery3.circom b/circuits/linkedMultiQuery3.circom index ac3d3c48..69bc88ec 100644 --- a/circuits/linkedMultiQuery3.circom +++ b/circuits/linkedMultiQuery3.circom @@ -2,4 +2,4 @@ pragma circom 2.1.1; include "linked/multiQuery.circom"; -component main {public [linkID]} = LinkedMultiQuery(3, 32, 64); // 49300 constraints +component main = LinkedMultiQuery(3, 32, 64); // 49300 constraints diff --git a/circuits/linkedNullifier.circom b/circuits/linkedNullifier.circom index bec19d54..72998ad6 100644 --- a/circuits/linkedNullifier.circom +++ b/circuits/linkedNullifier.circom @@ -2,4 +2,4 @@ pragma circom 2.1.1; include "linked/nullifier.circom"; -component main {public [linkID, verifierID, verifierSessionID]} = LinkedNullifier(); +component main {public [verifierID, nullifierSessionID]} = LinkedNullifier();