mirror of
https://github.com/arnaucube/circomlib.git
synced 2026-02-07 03:06:44 +01:00
Pedersen2 and BitPoints MulFix and MulAny
This commit is contained in:
32
test/circuits/pedersen2_test.circom
Normal file
32
test/circuits/pedersen2_test.circom
Normal file
@@ -0,0 +1,32 @@
|
||||
include "../../circuit/pedersen2.circom";
|
||||
include "../../node_modules/circom/circuits/bitify.circom";
|
||||
|
||||
|
||||
template Main() {
|
||||
signal input in;
|
||||
signal output out[2];
|
||||
|
||||
component pedersen = Pedersen(256);
|
||||
|
||||
component n2b;
|
||||
n2b = Num2Bits(253);
|
||||
|
||||
var i;
|
||||
|
||||
in ==> n2b.in;
|
||||
|
||||
for (i=0; i<253; i++) {
|
||||
pedersen.in[i] <== n2b.out[i];
|
||||
}
|
||||
|
||||
for (i=253; i<256; i++) {
|
||||
pedersen.in[i] <== 0;
|
||||
}
|
||||
|
||||
pedersen.out[0] ==> out[0];
|
||||
pedersen.out[1] ==> out[1];
|
||||
}
|
||||
|
||||
component main = Main();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user