Documentation ¶
Overview ¶
Package eddsa provides a ZKP-circuit function to verify a EdDSA signature.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Verify ¶
func Verify(cs *frontend.ConstraintSystem, sig Signature, msg frontend.Variable, pubKey PublicKey) error
Verify verifies an eddsa signature cf https://en.wikipedia.org/wiki/EdDSA
Types ¶
type PublicKey ¶
type PublicKey struct { A twistededwards.Point Curve twistededwards.EdCurve }
PublicKey stores an eddsa public key (to be used in gnark circuit)
type Signature ¶
type Signature struct { R twistededwards.Point S1, S2 frontend.Variable }
Signature stores a signature (to be used in gnark circuit) An EdDSA signature is a tuple (R,S) where R is a point on the twisted Edwards curve and S a scalar. S can be greater than r, the size of the zk snark field, and must not be reduced modulo r. Therefore it is split in S1 and S2, such that if r is n-bits long, S = 2^(n/2)*S1 + S2. In other words, S is written S1S2 in basis 2^(n/2).
Click to show internal directories.
Click to hide internal directories.