eddsa

package
v0.5.1-hotfixes Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2021 License: Apache-2.0 Imports: 3 Imported by: 8

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
	S 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. Since the base field of the twisted Edwards is Fr, the number of points N on the Edwards is < r+1+2sqrt(r)+2 (since the curve has 2 points of multiplicity 2). The subgroup l used in eddsa is <1/2N, so the reduction mod l ensures S < r, therefore there is no risk of overflow.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL