Jordi Baylina 2f28fc7002 | 4 years ago | |
---|---|---|
.. | ||
sha256 | 4 years ago | |
smt | 5 years ago | |
README.md | 5 years ago | |
aliascheck.circom | 6 years ago | |
babyjub.circom | 4 years ago | |
binsub.circom | 5 years ago | |
binsum.circom | 4 years ago | |
bitify.circom | 4 years ago | |
comparators.circom | 5 years ago | |
compconstant.circom | 6 years ago | |
eddsa.circom | 4 years ago | |
eddsamimc.circom | 4 years ago | |
eddsamimcsponge.circom | 4 years ago | |
eddsaposeidon.circom | 4 years ago | |
escalarmul.circom | 4 years ago | |
escalarmulany.circom | 5 years ago | |
escalarmulfix.circom | 5 years ago | |
escalarmulw4table.circom | 4 years ago | |
gates.circom | 5 years ago | |
mimc.circom | 4 years ago | |
mimcsponge.circom | 4 years ago | |
montgomery.circom | 6 years ago | |
multiplexer.circom | 5 years ago | |
mux1.circom | 5 years ago | |
mux2.circom | 5 years ago | |
mux3.circom | 6 years ago | |
mux4.circom | 6 years ago | |
pedersen.circom | 4 years ago | |
pedersen_old.circom | 4 years ago | |
pointbits.circom | 6 years ago | |
poseidon.circom | 4 years ago | |
sign.circom | 6 years ago | |
switcher.circom | 6 years ago |
[TOC]
in
(expanded to binary array) > ct
in
(expanded to binary array) oveflowed its 254 bits (<= -1)xout
,yout
) = (x1
,y1
) + (x2
,y2
)xout
,yout
) = 2*(x
,y
)x
,y
) is on the curveFolder containing the implementation of sha256 hash circuit.
Folder containing the circuit implementation of Sparse Merkle Trees.
AliasCheck()
Arithmetic on Baby Jubjub elliptic curve in twisted Edwards form. (TODO: Expose here the characteristics of the curve?)
BabyAdd()
DESCRIPTION
It adds two points on the Baby Jubjub curve. More specifically, given two points P1 = (x1
, y1
) and P2 = (x2
, y2
) it returns a point P3 = (xout
, yout
) such that
(xout
, yout
) = (x1
,y1
) + (x2
,y2
)
= ((x1y2
+y1x2
)/(1+dx1x2y1y2
)),(y1y2
-ax1x2
)/(1-dx1x2y1y2
))
SCHEMA
var a var d
| |
| |
______v_________v_______
input x1 ----> | |
input y1 ----> | BabyAdd() | ----> output xout
input x2 ----> | | ----> output yout
input y2 ----> |________________________|
INPUTS
Input | Representation | Description | |
---|---|---|---|
x1 |
Bigint | Field element of Fp | First coordinate of a point (x1, y1) on E. |
y1 |
Bigint | Field element of Fp | Second coordinate of a point (x1, y1) on E. |
x2 |
Bigint | Field element of Fp | First coordinate of a point (x2, y2) on E. |
y2 |
Bigint | Field element of Fp | Second coordinate of a point (x2, y2) on E. |
Requirement: at least x1
!=x2
or y1
!=y2
.
OUTPUT
Input | Representation | Description | |
---|---|---|---|
xout |
Bigint | Field element of Fp | First coordinate of the addition point (xout, yout) = (x1, y1) + (x2, y2). |
yout |
Bigint | Field element of Fp | Second coordinate of the addition point (xout, yout) = (x1, y1) + (x2, y2). |
BENCHMARKS (constraints)
EXAMPLE
BabyDbl()
xout
,yout
) = 2*(x
,y
).BabyCheck()
BabyPbk()
BinSub(n)
nbits(a)
BinSum(n, ops)
Num2Bits()
Num2Bits_strict()
Bits2Num()
Bits2Num_strict()
Num2BitsNeg()
IsZero()
IsEqual()
ForceEqualIfEnabled()
LessThan()
GreaterThan()
GreaterEqThan()
CompConstant(ct)
Edwards Digital Signature Algorithm in Baby Jubjbub (link a eddsa)
EdDSAVerifier(n)
EdDSAMiMCVerifier()
EdDSAMiMCSpongeVerifier()
EdDSAPoseidonVerifier()
EscalarMulWindow(base, k)
EscalarMul(n, base)
Multiplexor2()
BitElementMulAny()
SegmentMulAny(n)
EscalarMulAny(n)
WindowMulFix()
SegmentMulFix(nWindows)
EscalarMulFix(n, BASE)
pointAdd
EscalarMulW4Table
XOR
AND
OR
NOT
NAND
NOR
MultiAND
Implementation of MiMC-7 hash in Fp being... (link to description of the hash)
MiMC7(nrounds)
MultiMiMC7(nInputs, nRounds)
MiMCSponge(nInputs, nRounds, nOutputs)
MiMCFeistel(nrounds)
Edwards2Montgomery()
Montgomery2Edwards()
MontgomeryAdd()
MontgomeryDouble()
log2(a)
EscalarProduct(w)
Decoder(w)
Multiplexer(wIn, nIn)
MultiMux1(n)
Mux1()
MultiMux2(n)
Mux2()
MultiMux3(n)
Mux3()
MultiMux4(n)
Mux4()
Old version of the Pedersen hash (do not use any more?).
Window4()
Segment(nWindows)
Pedersen(n)
sqrt(n)
Bits2Point()
Bits2Point_Strict()
Point2Bits
Point2Bits_Strict
Implementation of Poseidon hash function (LINK)
Sigma()
Ark(t, C)
Mix(t, M)
Poseidon(nInputs, t, nRoundsF, nRoundsP)
Sign()
Switcher()