First iteration sha256

This commit is contained in:
Jordi Baylina
2018-09-12 11:02:50 +02:00
parent c8d80533bc
commit 2f1e74dd38
16 changed files with 2658 additions and 128 deletions

27
circuits/sha256/ch.circom Normal file
View File

@@ -0,0 +1,27 @@
/* Ch
000 0
001 1
010 0
011 1
100 0
101 0
110 1
111 1
out = a&b ^ (!a)&c =>
out = a*(b-c) + c
*/
template Ch(n) {
signal input a[n];
signal input b[n];
signal input c[n];
signal output out[n];
for (var k=0; k<n; k++) {
out[k] <== a[k] * (b[k]-c[k]) + c[k];
}
}