@@ -6,28 +6,26 @@ include "presentationFieldsAuth.circom";
6
6
7
7
// Verifies whether all credentials exists in the certree and
8
8
// that each credential's field exists in the correspondent credential tree using merkle multiproof
9
- // @param `tagIdx` is the index of the tag Field in the credential
10
9
// @param `gradeIdx` is the index of the grade Field in the credential
11
- // @param `m ` is the number of leaves/fields to be proved in each credential tree (precise-proof)
10
+ // @param `tagIdx ` is the index of the tag Field in the credential
12
11
// @param `n` is the number of credentials to be verified
13
12
// @param `cdl` is the level of the credential tree
14
13
// @param `ctl` is the level of the certree
15
14
// Note:
16
15
// - each leave of the certree contains a commitment to a credential tree root
17
16
// - currently m must be the same for all credentials in the certree
18
17
// - each leave of a credential tree has 3 fields: key, value and salt
19
- template Score (tagIdx, gradeIdx, m, n, cdl, ctl ) {
20
- assert(m > 1 );
21
-
18
+ template Score (gradeIdx, tagIdx, n, cdl, ctl ) {
22
19
signal input certreeRoot;
23
20
signal input requiredTags[n];
24
21
signal input weights[n];
25
22
signal input result;
26
23
27
- signal input nullifierHashes[n] ;
24
+ var m = 1 << cdl ;
28
25
signal input fields[n][m][3 ];
29
26
signal input pathFieldElements[n][m];
30
27
signal input fieldIndices[n][m];
28
+ signal input nullifierHashes[n];
31
29
signal input credentialRoots[n];
32
30
signal input subjects[n];
33
31
signal input secrets[n];
@@ -44,7 +42,7 @@ template Score(tagIdx, gradeIdx, m, n, cdl, ctl) {
44
42
credAuth[i].certreeRoot <== certreeRoot;
45
43
credAuth[i].nullifierHash <== nullifierHashes[i];
46
44
47
- // ensure tags match
45
+ // ensure tags match
48
46
sameTags[i] = IsEqual();
49
47
sameTags[i].in [0 ] <== requiredTags[i];
50
48
sameTags[i].in [1 ] <== fields[i][tagIdx][1 ];
0 commit comments