Skip to content

Commit

Permalink
Merge branch 'main' into relayer_quick_fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zah committed Jun 29, 2023
2 parents c259d28 + 6c8d8d3 commit 91a7101
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ pragma circom 2.1.5;

include "hash_two.circom";
include "../../../node_modules/circomlib/circuits/comparators.circom";
include "../../../node_modules/circomlib/circuits/bitify.circom";

include "utils/arrays.circom";
include "utils/numerical.circom";

template IsValidMerkleBranchOut(N) {
signal input branch[N][256];
Expand All @@ -14,12 +17,14 @@ template IsValidMerkleBranchOut(N) {

component hashers[N];
component isZero[N];

component idx2Bits;
idx2Bits = Num2Bits(N+1);
idx2Bits.in <== index;
for(var i = 0; i < N; i++) {
hashers[i] = HashTwo();
isZero[i] = IsZero();

isZero[i].in <-- (index \ (2**i)) % 2;
isZero[i].in <== idx2Bits.out[i];

var current[256];

Expand Down
4 changes: 4 additions & 0 deletions beacon-light-client/circom/test/pow/data/case05/input.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"base": "10",
"power": "0"
}
3 changes: 3 additions & 0 deletions beacon-light-client/circom/test/pow/data/case05/output.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"out": "1"
}

0 comments on commit 91a7101

Please sign in to comment.