mirror of
https://github.com/arnaucube/circomlib.git
synced 2026-02-07 19:26:49 +01:00
Pedersen2 and BitPoints MulFix and MulAny
This commit is contained in:
@@ -5,8 +5,8 @@ template Pedersen(n) {
|
||||
signal input in[n];
|
||||
signal output out[2];
|
||||
|
||||
var nexps = ((n-1) \ 253) + 1;
|
||||
var nlastbits = n - (nexps-1)*253;
|
||||
var nexps = ((n-1) \ 250) + 1;
|
||||
var nlastbits = n - (nexps-1)*250;
|
||||
|
||||
component escalarMuls[nexps];
|
||||
|
||||
@@ -27,11 +27,11 @@ template Pedersen(n) {
|
||||
var j;
|
||||
var nexpbits;
|
||||
for (i=0; i<nexps; i++) {
|
||||
nexpbits = (i == nexps-1) ? nlastbits : 253;
|
||||
nexpbits = (i == nexps-1) ? nlastbits : 250;
|
||||
escalarMuls[i] = EscalarMul(nexpbits, PBASE[i]);
|
||||
|
||||
for (j=0; j<nexpbits; j++) {
|
||||
escalarMuls[i].in[j] <== in[253*i + j];
|
||||
escalarMuls[i].in[j] <== in[250*i + j];
|
||||
}
|
||||
|
||||
if (i==0) {
|
||||
|
||||
Reference in New Issue
Block a user