Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ int main()
And compile and execute using:

```
gcc main.c -o main build/libzpie.a ../mcl/lib/lishe384_256.a ../mcl/lib/libmcl.a -I ./include -I ../mcl/include -lgmp -lcriterion -lm -lstdc++ -D BN128 && ./main
gcc main.c -o main build/libzpie.a lib/mcl/lib/lishe384_256.a lib/mcl/lib/libmcl.a -I ./include -I lib/mcl/include -lgmp -lcriterion -lm -lstdc++ -D BN128 && ./main
```

More circuit examples can be found in the `/src/tests.c` file.
Expand Down
4 changes: 0 additions & 4 deletions gadgets/twisted_edwards.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ void mul_scalar(element mulOut1, element mulOut2, element A1, element A2, elemen
element doubledP1[size];
element doubledP2[size];

element oneNeg;
init(&oneNeg);
input(&oneNeg, "-1");

init_array(doubledP1, size);
init_array(doubledP2, size);

Expand Down
35 changes: 15 additions & 20 deletions src/gro16/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,6 @@ void addmul(element* oo, element* lo1, element* lo2, element* ro)
}
}

void addmul0(element* oo, element* lo1, element* lo2, element* ro)
{
if (setParams)
N++;
else if (prover)
{
mclBnFr_add(&uw[oo->index], &uw[lo1->index], &uw[lo2->index]);
mclBnFr_mul(&uw[oo->index], &uw[oo->index], &uw[ro->index]);
}
else
{
L[cn][lo1->index] = 1;
L[cn][lo2->index] = 1;
R[cn][ro->index] = 1;

cn++;
}
}

void add3mul(element* oo, element* lo1, element* lo2, element* lo3, element* ro)
{
if (setParams)
Expand Down Expand Up @@ -244,7 +225,21 @@ void assert_equal(element* lo, element* ro)
init(&factor2);

mul(&factor1, ro, &oneNeg);
addmul0(&factor2, lo, &factor1, &one);

if (setParams)
N++;
else if (prover)
{
mclBnFr_add(&uw[factor2.index], &uw[lo->index], &uw[factor1.index]);
}
else
{
L[cn][lo->index] = 1;
L[cn][factor1.index] = 1;
R[cn][one.index] = 1;

cn++;
}
}

void input(element* var, char* val)
Expand Down