Skip to content

Commit

Permalink
fix remaining asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
dtebbs committed Aug 12, 2019
1 parent 46d2619 commit f7679fa
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/circuits/joinsplit.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class joinsplit_gadget : libsnark::gadget<FieldT> {
// The root is represented on a single field element
// Each nullifier, and each commitment are in {0,1}^256 and thus take 2 field elements to be represented,
// while value_pub_in, and value_pub_out are in {0,1}^64, and thus take a single field element to be represented
int nb_inputs = 1 + (2 * (NumInputs + NumOutputs)) + 1 + 1;
size_t nb_inputs = (2 * (NumInputs + NumOutputs)) + 1 + 1;
pb.set_input_sizes(nb_inputs);
// ------------------------------------------------------------------------------ //

Expand Down Expand Up @@ -153,11 +153,11 @@ class joinsplit_gadget : libsnark::gadget<FieldT> {
// NumInputs + NumOutputs + 1 + 1 since we are packing all the inputs nullifiers
// + all the output commitments + the two public values v_pub_in and v_pub_out
assert(packed_inputs.size() == NumInputs + NumOutputs + 1 + 1);
assert(nb_inputs == [&packed_inputs]() {
assert(nb_inputs == [this]() {
size_t sum = 0;
for (const auto &i : packed_inputs) { sum = sum + i.size(); }
return sum;
});
}());

// [SANITY CHECK] Total size of unpacked inputs
size_t total_size_unpacked_inputs = 0;
Expand Down Expand Up @@ -369,9 +369,6 @@ class joinsplit_gadget : libsnark::gadget<FieldT> {
static size_t get_input_bit_size() {
size_t acc = 0;

// Binary length of the Merkle Root (anchor)
acc += 256;

// Binary length of the NullifierS
for (size_t i = 0; i < NumInputs; i++) {
acc += 256;
Expand Down

0 comments on commit f7679fa

Please sign in to comment.