mirror of
https://github.com/arnaucube/hash-chain-sonobe.git
synced 2026-01-19 20:21:32 +01:00
add full flow using keccak256-circom. The constraint generation fails, debugging circom & sonobe & arkworks/circom-compat
This commit is contained in:
21
circuit/keccak-chain.circom
Normal file
21
circuit/keccak-chain.circom
Normal file
@@ -0,0 +1,21 @@
|
||||
pragma circom 2.0.0;
|
||||
|
||||
include "node_modules/keccak256-circom/circuits/keccak.circom";
|
||||
|
||||
template KeccakChain () {
|
||||
signal input ivc_input[32*8];
|
||||
signal output ivc_output[32*8];
|
||||
|
||||
component keccak = Keccak(32*8, 32*8);
|
||||
|
||||
for (var i=0; i<32*8; i++) {
|
||||
keccak.in[i] <== ivc_input[i];
|
||||
}
|
||||
for (var i=0; i<32*8; i++) {
|
||||
ivc_output[i] <== keccak.out[i];
|
||||
}
|
||||
}
|
||||
|
||||
// for a input & output of 32 bytes:
|
||||
component main { public [ivc_input] } = KeccakChain();
|
||||
|
||||
18
circuit/package.json
Normal file
18
circuit/package.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "fakeid-demo",
|
||||
"version": "0.0.1",
|
||||
"description": "iden3 circuits",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"clean": "rm -fR dist",
|
||||
"build": "npm run clean && ./node_modules/.bin/tsc --strictNullChecks",
|
||||
"test": "./node_modules/.bin/mocha --timeout 5000 -p -r ts-node/register '*.test.ts'",
|
||||
"postinstall":"cd node_modules/keccak256-circom && npm install"
|
||||
},
|
||||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
"circomlib": "^2.0.5",
|
||||
"keccak256-circom": "git://github.com/vocdoni/keccak256-circom.git"
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user