mirror of
https://github.com/arnaucube/circomlib.git
synced 2026-02-06 18:56:43 +01:00
feat: makes mimcsponge contract act like the circuit version
This commit is contained in:
@@ -50,7 +50,11 @@ function createCode(seed, n) {
|
||||
C.addmod(); // e=t^5+xR xL k q (for next round: xL xR k q)
|
||||
|
||||
for (let i=0; i<n-1; i++) {
|
||||
ci = Web3Utils.keccak256(ci);
|
||||
if (i < n-2) {
|
||||
ci = Web3Utils.keccak256(ci);
|
||||
} else {
|
||||
ci = "0x00";
|
||||
}
|
||||
C.swap(1); // xR xL k q
|
||||
C.dup(3); // q xR xL k q
|
||||
C.dup(3); // k q xR xL k q
|
||||
@@ -74,9 +78,9 @@ function createCode(seed, n) {
|
||||
C.addmod(); // e=t^5+xR xL k q (for next round: xL xR k q)
|
||||
}
|
||||
|
||||
C.push("0x00");
|
||||
C.mstore(); // Save it to pos 0;
|
||||
C.push("0x20");
|
||||
C.mstore(); // Save it to pos 0;
|
||||
C.push("0x00");
|
||||
C.mstore(); // Save it to pos 1;
|
||||
C.push("0x40");
|
||||
C.push("0x00");
|
||||
|
||||
Reference in New Issue
Block a user