@solarity/zkit 0.2.4 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -39,7 +39,7 @@ contract <%=verifier_id%> {
|
|
|
39
39
|
uint256 public constant DELTA_Y2 =
|
|
40
40
|
<%=vk_delta_2[1][0] -%>;
|
|
41
41
|
|
|
42
|
-
<% for (let i=0; i<IC.length; i++) { %>uint256 public constant IC<%=i%>_X =
|
|
42
|
+
<% for (let i = 0; i < IC.length; i++) { %>uint256 public constant IC<%=i%>_X =
|
|
43
43
|
<%=IC[i][0]%>;
|
|
44
44
|
uint256 public constant IC<%=i%>_Y =
|
|
45
45
|
<%=IC[i][1]%>;
|
|
@@ -53,7 +53,7 @@ contract <%=verifier_id%> {
|
|
|
53
53
|
uint256[2] memory pointA_,
|
|
54
54
|
uint256[2][2] memory pointB_,
|
|
55
55
|
uint256[2] memory pointC_,
|
|
56
|
-
uint256[<%=IC.length-1%>] memory publicSignals_
|
|
56
|
+
uint256[<%=IC.length - 1%>] memory publicSignals_
|
|
57
57
|
) public view returns (bool verified_) {
|
|
58
58
|
assembly {
|
|
59
59
|
function checkField(signal_) -> res_ {
|
|
@@ -88,7 +88,7 @@ contract <%=verifier_id%> {
|
|
|
88
88
|
mstore(add(pointer_, 32), IC0_Y)
|
|
89
89
|
|
|
90
90
|
/// @dev compute the linear combination of public signals
|
|
91
|
-
<% for (let i = 1; i <= nPublic; i++) { %>if iszero(g1MulAdd(pointer_, IC<%=i%>_X, IC<%=i%>_Y, mload(add(pubSignals_, <%=(i-1)*32%>)))) {
|
|
91
|
+
<% for (let i = 1; i <= nPublic; i++) { %>if iszero(g1MulAdd(pointer_, IC<%=i%>_X, IC<%=i%>_Y, mload(add(pubSignals_, <%=(i - 1) * 32%>)))) {
|
|
92
92
|
leave
|
|
93
93
|
}
|
|
94
94
|
<% } -%>
|
|
@@ -145,7 +145,7 @@ contract <%=verifier_id%> {
|
|
|
145
145
|
|
|
146
146
|
/// @dev check that all public signals are in F
|
|
147
147
|
verified_ := 1
|
|
148
|
-
<% for (let i = 0; i <
|
|
148
|
+
<% for (let i = 0; i < nPublic; i++) { %>verified_ := and(verified_, checkField(mload(add(publicSignals_, <%=i * 32%>))))
|
|
149
149
|
<% } -%>
|
|
150
150
|
|
|
151
151
|
/// @dev check pairings
|
package/package.json
CHANGED
|
@@ -39,7 +39,7 @@ contract <%=verifier_id%> {
|
|
|
39
39
|
uint256 public constant DELTA_Y2 =
|
|
40
40
|
<%=vk_delta_2[1][0] -%>;
|
|
41
41
|
|
|
42
|
-
<% for (let i=0; i<IC.length; i++) { %>uint256 public constant IC<%=i%>_X =
|
|
42
|
+
<% for (let i = 0; i < IC.length; i++) { %>uint256 public constant IC<%=i%>_X =
|
|
43
43
|
<%=IC[i][0]%>;
|
|
44
44
|
uint256 public constant IC<%=i%>_Y =
|
|
45
45
|
<%=IC[i][1]%>;
|
|
@@ -53,7 +53,7 @@ contract <%=verifier_id%> {
|
|
|
53
53
|
uint256[2] memory pointA_,
|
|
54
54
|
uint256[2][2] memory pointB_,
|
|
55
55
|
uint256[2] memory pointC_,
|
|
56
|
-
uint256[<%=IC.length-1%>] memory publicSignals_
|
|
56
|
+
uint256[<%=IC.length - 1%>] memory publicSignals_
|
|
57
57
|
) public view returns (bool verified_) {
|
|
58
58
|
assembly {
|
|
59
59
|
function checkField(signal_) -> res_ {
|
|
@@ -88,7 +88,7 @@ contract <%=verifier_id%> {
|
|
|
88
88
|
mstore(add(pointer_, 32), IC0_Y)
|
|
89
89
|
|
|
90
90
|
/// @dev compute the linear combination of public signals
|
|
91
|
-
<% for (let i = 1; i <= nPublic; i++) { %>if iszero(g1MulAdd(pointer_, IC<%=i%>_X, IC<%=i%>_Y, mload(add(pubSignals_, <%=(i-1)*32%>)))) {
|
|
91
|
+
<% for (let i = 1; i <= nPublic; i++) { %>if iszero(g1MulAdd(pointer_, IC<%=i%>_X, IC<%=i%>_Y, mload(add(pubSignals_, <%=(i - 1) * 32%>)))) {
|
|
92
92
|
leave
|
|
93
93
|
}
|
|
94
94
|
<% } -%>
|
|
@@ -145,7 +145,7 @@ contract <%=verifier_id%> {
|
|
|
145
145
|
|
|
146
146
|
/// @dev check that all public signals are in F
|
|
147
147
|
verified_ := 1
|
|
148
|
-
<% for (let i = 0; i <
|
|
148
|
+
<% for (let i = 0; i < nPublic; i++) { %>verified_ := and(verified_, checkField(mload(add(publicSignals_, <%=i * 32%>))))
|
|
149
149
|
<% } -%>
|
|
150
150
|
|
|
151
151
|
/// @dev check pairings
|