arnaucube
arnaucube/hash-chain-sonobePublic Self-hosted repository
hash-chain-sonobe/circuit/keccak-chain.circom
circuit/keccak-chain.circomRaw
 1pragma circom 2.0.0;
 2
 3include "node_modules/keccak256-circom/circuits/keccak.circom";
 4
 5template KeccakChain () {
 6    signal input ivc_input[32*8];
 7    signal output ivc_output[32*8];   
 8
 9    component keccak = Keccak(32*8, 32*8);
10
11    for (var i=0; i<32*8; i++) {
12        keccak.in[i] <== ivc_input[i];
13    }
14    for (var i=0; i<32*8; i++) {
15    	ivc_output[i] <== keccak.out[i];
16    }
17}
18
19// for a input & output of 32 bytes:
20component main { public [ivc_input] } = KeccakChain();
21