Documentation ¶
Overview ¶
Package ecc provides bls12-381, bls12-377, bls12-378, bn254, bw6-761, bls24-315, bls24-317, bw6-633, bls12-378 and bw6-756 elliptic curves implementation (+pairing).
Also
- Multi exponentiation
- FFT
- Polynomial commitment schemes
- MiMC
- twisted edwards "companion curves"
- EdDSA (on the "companion" twisted edwards curves)
Index ¶
- func ExpandMsgXmd(msg, dst []byte, lenInBytes int) ([]byte, error)
- func NafDecomposition(a *big.Int, result []int8) int
- func NextPowerOfTwo(n uint64) uint64
- func PrecomputeLattice(r, lambda *big.Int, res *Lattice)
- func SplitScalar(s *big.Int, l *Lattice) [2]big.Int
- type ID
- type Lattice
- type MultiExpConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpandMsgXmd ¶
ExpandMsgXmd expands msg to a slice of lenInBytes bytes. https://tools.ietf.org/html/draft-irtf-cfrg-hash-to-curve-06#section-5 https://tools.ietf.org/html/rfc8017#section-4.1 (I2OSP/O2ISP)
func NafDecomposition ¶
NafDecomposition gets the naf decomposition of a big number
func NextPowerOfTwo ¶
NextPowerOfTwo returns the next power of 2 of n
func PrecomputeLattice ¶
PrecomputeLattice res such that res.V1, res.V2 are short vectors satisfying v11+v12.λ=v21+v22.λ=0[r]. cf https://www.iacr.org/archive/crypto2001/21390189.pdf
func SplitScalar ¶
SplitScalar outputs u,v such that u+vlambda=s[r]. The method is to view s as (s,0) in ZxZ, and find a close vector w of (s,0) in <l>, where l is a sub Z-module of ker((a,b) → a+b.λ[r]): then (u,v)=w-(s,0), and u+v.λ=s[r]. cf https://www.iacr.org/archive/crypto2001/21390189.pdf
Types ¶
type ID ¶
type ID uint16
ID represent a unique ID for a curve
const ( UNKNOWN ID = iota BN254 BLS12_377 BLS12_378 BLS12_381 BLS24_315 BLS24_317 BW6_761 BW6_633 BW6_756 )
do not modify the order of this enum
func Implemented ¶
func Implemented() []ID
Implemented return the list of curves fully implemented in gnark-crypto
func (ID) ScalarField ¶
ScalarField returns the scalar field of the curve
type MultiExpConfig ¶
type MultiExpConfig struct { NbTasks int // go routines to be used in the multiexp. can be larger than num cpus. ScalarsMont bool // indicates if the scalars are in montgommery form. Default to false. }
MultiExpConfig enables to set optional configuration attribute to a call to MultiExp
Directories ¶
Path | Synopsis |
---|---|
Package bls12377 efficient elliptic curve, pairing and hash to curve implementation for bls12-377.
|
Package bls12377 efficient elliptic curve, pairing and hash to curve implementation for bls12-377. |
fp
Package fp contains field arithmetic operations for modulus = 0x1ae3a4...000001.
|
Package fp contains field arithmetic operations for modulus = 0x1ae3a4...000001. |
fr
Package fr contains field arithmetic operations for modulus = 0x12ab65...000001.
|
Package fr contains field arithmetic operations for modulus = 0x12ab65...000001. |
fr/fft
Package fft provides in-place discrete Fourier transform.
|
Package fft provides in-place discrete Fourier transform. |
fr/fri
Package fri provides the FRI (multiplicative) commitment scheme.
|
Package fri provides the FRI (multiplicative) commitment scheme. |
fr/kzg
Package kzg provides a KZG commitment scheme.
|
Package kzg provides a KZG commitment scheme. |
fr/mimc
Package mimc provides MiMC hash function using Miyaguchi–Preneel construction.
|
Package mimc provides MiMC hash function using Miyaguchi–Preneel construction. |
fr/permutation
Package permutation provides an API to build permutation proofs.
|
Package permutation provides an API to build permutation proofs. |
fr/plookup
Package plookup provides an API to build plookup proofs.
|
Package plookup provides an API to build plookup proofs. |
fr/polynomial
Package polynomial provides polynomial methods and commitment schemes.
|
Package polynomial provides polynomial methods and commitment schemes. |
twistededwards
Package twistededwards provides bls12-377's twisted edwards "companion curve" defined on fr.
|
Package twistededwards provides bls12-377's twisted edwards "companion curve" defined on fr. |
twistededwards/eddsa
Package eddsa provides EdDSA signature scheme on bls12-377's twisted edwards curve.
|
Package eddsa provides EdDSA signature scheme on bls12-377's twisted edwards curve. |
Package bls12378 efficient elliptic curve, pairing and hash to curve implementation for bls12-378.
|
Package bls12378 efficient elliptic curve, pairing and hash to curve implementation for bls12-378. |
fp
Package fp contains field arithmetic operations for modulus = 0x3eeb04...000001.
|
Package fp contains field arithmetic operations for modulus = 0x3eeb04...000001. |
fr
Package fr contains field arithmetic operations for modulus = 0x20e7b9...000001.
|
Package fr contains field arithmetic operations for modulus = 0x20e7b9...000001. |
fr/fft
Package fft provides in-place discrete Fourier transform.
|
Package fft provides in-place discrete Fourier transform. |
fr/fri
Package fri provides the FRI (multiplicative) commitment scheme.
|
Package fri provides the FRI (multiplicative) commitment scheme. |
fr/kzg
Package kzg provides a KZG commitment scheme.
|
Package kzg provides a KZG commitment scheme. |
fr/mimc
Package mimc provides MiMC hash function using Miyaguchi–Preneel construction.
|
Package mimc provides MiMC hash function using Miyaguchi–Preneel construction. |
fr/permutation
Package permutation provides an API to build permutation proofs.
|
Package permutation provides an API to build permutation proofs. |
fr/plookup
Package plookup provides an API to build plookup proofs.
|
Package plookup provides an API to build plookup proofs. |
fr/polynomial
Package polynomial provides polynomial methods and commitment schemes.
|
Package polynomial provides polynomial methods and commitment schemes. |
twistededwards
Package twistededwards provides bls12-378's twisted edwards "companion curve" defined on fr.
|
Package twistededwards provides bls12-378's twisted edwards "companion curve" defined on fr. |
twistededwards/eddsa
Package eddsa provides EdDSA signature scheme on bls12-378's twisted edwards curve.
|
Package eddsa provides EdDSA signature scheme on bls12-378's twisted edwards curve. |
Package bls12381 efficient elliptic curve, pairing and hash to curve implementation for bls12-381.
|
Package bls12381 efficient elliptic curve, pairing and hash to curve implementation for bls12-381. |
bandersnatch
Package bandersnatch provides bls12-381's twisted edwards "companion curve" defined on fr.
|
Package bandersnatch provides bls12-381's twisted edwards "companion curve" defined on fr. |
bandersnatch/eddsa
Package eddsa provides EdDSA signature scheme on bls12-381's twisted edwards curve.
|
Package eddsa provides EdDSA signature scheme on bls12-381's twisted edwards curve. |
fp
Package fp contains field arithmetic operations for modulus = 0x1a0111...ffaaab.
|
Package fp contains field arithmetic operations for modulus = 0x1a0111...ffaaab. |
fr
Package fr contains field arithmetic operations for modulus = 0x73eda7...000001.
|
Package fr contains field arithmetic operations for modulus = 0x73eda7...000001. |
fr/fft
Package fft provides in-place discrete Fourier transform.
|
Package fft provides in-place discrete Fourier transform. |
fr/fri
Package fri provides the FRI (multiplicative) commitment scheme.
|
Package fri provides the FRI (multiplicative) commitment scheme. |
fr/kzg
Package kzg provides a KZG commitment scheme.
|
Package kzg provides a KZG commitment scheme. |
fr/mimc
Package mimc provides MiMC hash function using Miyaguchi–Preneel construction.
|
Package mimc provides MiMC hash function using Miyaguchi–Preneel construction. |
fr/permutation
Package permutation provides an API to build permutation proofs.
|
Package permutation provides an API to build permutation proofs. |
fr/plookup
Package plookup provides an API to build plookup proofs.
|
Package plookup provides an API to build plookup proofs. |
fr/polynomial
Package polynomial provides polynomial methods and commitment schemes.
|
Package polynomial provides polynomial methods and commitment schemes. |
twistededwards
Package twistededwards provides bls12-381's twisted edwards "companion curve" defined on fr.
|
Package twistededwards provides bls12-381's twisted edwards "companion curve" defined on fr. |
twistededwards/eddsa
Package eddsa provides EdDSA signature scheme on bls12-381's twisted edwards curve.
|
Package eddsa provides EdDSA signature scheme on bls12-381's twisted edwards curve. |
Package bls24315 efficient elliptic curve, pairing and hash to curve implementation for bls24-315.
|
Package bls24315 efficient elliptic curve, pairing and hash to curve implementation for bls24-315. |
fp
Package fp contains field arithmetic operations for modulus = 0x4c23a0...300001.
|
Package fp contains field arithmetic operations for modulus = 0x4c23a0...300001. |
fr
Package fr contains field arithmetic operations for modulus = 0x196dea...c00001.
|
Package fr contains field arithmetic operations for modulus = 0x196dea...c00001. |
fr/fft
Package fft provides in-place discrete Fourier transform.
|
Package fft provides in-place discrete Fourier transform. |
fr/fri
Package fri provides the FRI (multiplicative) commitment scheme.
|
Package fri provides the FRI (multiplicative) commitment scheme. |
fr/kzg
Package kzg provides a KZG commitment scheme.
|
Package kzg provides a KZG commitment scheme. |
fr/mimc
Package mimc provides MiMC hash function using Miyaguchi–Preneel construction.
|
Package mimc provides MiMC hash function using Miyaguchi–Preneel construction. |
fr/permutation
Package permutation provides an API to build permutation proofs.
|
Package permutation provides an API to build permutation proofs. |
fr/plookup
Package plookup provides an API to build plookup proofs.
|
Package plookup provides an API to build plookup proofs. |
fr/polynomial
Package polynomial provides polynomial methods and commitment schemes.
|
Package polynomial provides polynomial methods and commitment schemes. |
twistededwards
Package twistededwards provides bls24-315's twisted edwards "companion curve" defined on fr.
|
Package twistededwards provides bls24-315's twisted edwards "companion curve" defined on fr. |
twistededwards/eddsa
Package eddsa provides EdDSA signature scheme on bls24-315's twisted edwards curve.
|
Package eddsa provides EdDSA signature scheme on bls24-315's twisted edwards curve. |
Package bls24317 efficient elliptic curve, pairing and hash to curve implementation for bls24-317.
|
Package bls24317 efficient elliptic curve, pairing and hash to curve implementation for bls24-317. |
fp
Package fp contains field arithmetic operations for modulus = 0x1058ca...ab2aab.
|
Package fp contains field arithmetic operations for modulus = 0x1058ca...ab2aab. |
fr
Package fr contains field arithmetic operations for modulus = 0x443f91...000001.
|
Package fr contains field arithmetic operations for modulus = 0x443f91...000001. |
fr/fft
Package fft provides in-place discrete Fourier transform.
|
Package fft provides in-place discrete Fourier transform. |
fr/fri
Package fri provides the FRI (multiplicative) commitment scheme.
|
Package fri provides the FRI (multiplicative) commitment scheme. |
fr/kzg
Package kzg provides a KZG commitment scheme.
|
Package kzg provides a KZG commitment scheme. |
fr/mimc
Package mimc provides MiMC hash function using Miyaguchi–Preneel construction.
|
Package mimc provides MiMC hash function using Miyaguchi–Preneel construction. |
fr/permutation
Package permutation provides an API to build permutation proofs.
|
Package permutation provides an API to build permutation proofs. |
fr/plookup
Package plookup provides an API to build plookup proofs.
|
Package plookup provides an API to build plookup proofs. |
fr/polynomial
Package polynomial provides polynomial methods and commitment schemes.
|
Package polynomial provides polynomial methods and commitment schemes. |
twistededwards
Package twistededwards provides bls24-317's twisted edwards "companion curve" defined on fr.
|
Package twistededwards provides bls24-317's twisted edwards "companion curve" defined on fr. |
twistededwards/eddsa
Package eddsa provides EdDSA signature scheme on bls24-317's twisted edwards curve.
|
Package eddsa provides EdDSA signature scheme on bls24-317's twisted edwards curve. |
Package bn254 efficient elliptic curve, pairing and hash to curve implementation for bn254.
|
Package bn254 efficient elliptic curve, pairing and hash to curve implementation for bn254. |
fp
Package fp contains field arithmetic operations for modulus = 0x30644e...7cfd47.
|
Package fp contains field arithmetic operations for modulus = 0x30644e...7cfd47. |
fr
Package fr contains field arithmetic operations for modulus = 0x30644e...000001.
|
Package fr contains field arithmetic operations for modulus = 0x30644e...000001. |
fr/fft
Package fft provides in-place discrete Fourier transform.
|
Package fft provides in-place discrete Fourier transform. |
fr/fri
Package fri provides the FRI (multiplicative) commitment scheme.
|
Package fri provides the FRI (multiplicative) commitment scheme. |
fr/kzg
Package kzg provides a KZG commitment scheme.
|
Package kzg provides a KZG commitment scheme. |
fr/mimc
Package mimc provides MiMC hash function using Miyaguchi–Preneel construction.
|
Package mimc provides MiMC hash function using Miyaguchi–Preneel construction. |
fr/permutation
Package permutation provides an API to build permutation proofs.
|
Package permutation provides an API to build permutation proofs. |
fr/plookup
Package plookup provides an API to build plookup proofs.
|
Package plookup provides an API to build plookup proofs. |
fr/polynomial
Package polynomial provides polynomial methods and commitment schemes.
|
Package polynomial provides polynomial methods and commitment schemes. |
twistededwards
Package twistededwards provides bn254's twisted edwards "companion curve" defined on fr.
|
Package twistededwards provides bn254's twisted edwards "companion curve" defined on fr. |
twistededwards/eddsa
Package eddsa provides EdDSA signature scheme on bn254's twisted edwards curve.
|
Package eddsa provides EdDSA signature scheme on bn254's twisted edwards curve. |
Package bw6633 efficient elliptic curve, pairing and hash to curve implementation for bw6-633.
|
Package bw6633 efficient elliptic curve, pairing and hash to curve implementation for bw6-633. |
fp
Package fp contains field arithmetic operations for modulus = 0x126633...70000d.
|
Package fp contains field arithmetic operations for modulus = 0x126633...70000d. |
fr
Package fr contains field arithmetic operations for modulus = 0x4c23a0...300001.
|
Package fr contains field arithmetic operations for modulus = 0x4c23a0...300001. |
fr/fft
Package fft provides in-place discrete Fourier transform.
|
Package fft provides in-place discrete Fourier transform. |
fr/fri
Package fri provides the FRI (multiplicative) commitment scheme.
|
Package fri provides the FRI (multiplicative) commitment scheme. |
fr/kzg
Package kzg provides a KZG commitment scheme.
|
Package kzg provides a KZG commitment scheme. |
fr/mimc
Package mimc provides MiMC hash function using Miyaguchi–Preneel construction.
|
Package mimc provides MiMC hash function using Miyaguchi–Preneel construction. |
fr/permutation
Package permutation provides an API to build permutation proofs.
|
Package permutation provides an API to build permutation proofs. |
fr/plookup
Package plookup provides an API to build plookup proofs.
|
Package plookup provides an API to build plookup proofs. |
fr/polynomial
Package polynomial provides polynomial methods and commitment schemes.
|
Package polynomial provides polynomial methods and commitment schemes. |
twistededwards
Package twistededwards provides bw6-633's twisted edwards "companion curve" defined on fr.
|
Package twistededwards provides bw6-633's twisted edwards "companion curve" defined on fr. |
twistededwards/eddsa
Package eddsa provides EdDSA signature scheme on bw6-633's twisted edwards curve.
|
Package eddsa provides EdDSA signature scheme on bw6-633's twisted edwards curve. |
Package bw6756 efficient elliptic curve, pairing and hash to curve implementation for bw6-756.
|
Package bw6756 efficient elliptic curve, pairing and hash to curve implementation for bw6-756. |
fp
Package fp contains field arithmetic operations for modulus = 0xf76adb...000001.
|
Package fp contains field arithmetic operations for modulus = 0xf76adb...000001. |
fr
Package fr contains field arithmetic operations for modulus = 0x3eeb04...000001.
|
Package fr contains field arithmetic operations for modulus = 0x3eeb04...000001. |
fr/fft
Package fft provides in-place discrete Fourier transform.
|
Package fft provides in-place discrete Fourier transform. |
fr/fri
Package fri provides the FRI (multiplicative) commitment scheme.
|
Package fri provides the FRI (multiplicative) commitment scheme. |
fr/kzg
Package kzg provides a KZG commitment scheme.
|
Package kzg provides a KZG commitment scheme. |
fr/mimc
Package mimc provides MiMC hash function using Miyaguchi–Preneel construction.
|
Package mimc provides MiMC hash function using Miyaguchi–Preneel construction. |
fr/permutation
Package permutation provides an API to build permutation proofs.
|
Package permutation provides an API to build permutation proofs. |
fr/plookup
Package plookup provides an API to build plookup proofs.
|
Package plookup provides an API to build plookup proofs. |
fr/polynomial
Package polynomial provides polynomial methods and commitment schemes.
|
Package polynomial provides polynomial methods and commitment schemes. |
twistededwards
Package twistededwards provides bw6-756's twisted edwards "companion curve" defined on fr.
|
Package twistededwards provides bw6-756's twisted edwards "companion curve" defined on fr. |
twistededwards/eddsa
Package eddsa provides EdDSA signature scheme on bw6-756's twisted edwards curve.
|
Package eddsa provides EdDSA signature scheme on bw6-756's twisted edwards curve. |
Package bw6761 efficient elliptic curve, pairing and hash to curve implementation for bw6-761.
|
Package bw6761 efficient elliptic curve, pairing and hash to curve implementation for bw6-761. |
fp
Package fp contains field arithmetic operations for modulus = 0x122e82...00008b.
|
Package fp contains field arithmetic operations for modulus = 0x122e82...00008b. |
fr
Package fr contains field arithmetic operations for modulus = 0x1ae3a4...000001.
|
Package fr contains field arithmetic operations for modulus = 0x1ae3a4...000001. |
fr/fft
Package fft provides in-place discrete Fourier transform.
|
Package fft provides in-place discrete Fourier transform. |
fr/fri
Package fri provides the FRI (multiplicative) commitment scheme.
|
Package fri provides the FRI (multiplicative) commitment scheme. |
fr/kzg
Package kzg provides a KZG commitment scheme.
|
Package kzg provides a KZG commitment scheme. |
fr/mimc
Package mimc provides MiMC hash function using Miyaguchi–Preneel construction.
|
Package mimc provides MiMC hash function using Miyaguchi–Preneel construction. |
fr/permutation
Package permutation provides an API to build permutation proofs.
|
Package permutation provides an API to build permutation proofs. |
fr/plookup
Package plookup provides an API to build plookup proofs.
|
Package plookup provides an API to build plookup proofs. |
fr/polynomial
Package polynomial provides polynomial methods and commitment schemes.
|
Package polynomial provides polynomial methods and commitment schemes. |
twistededwards
Package twistededwards provides bw6-761's twisted edwards "companion curve" defined on fr.
|
Package twistededwards provides bw6-761's twisted edwards "companion curve" defined on fr. |
twistededwards/eddsa
Package eddsa provides EdDSA signature scheme on bw6-761's twisted edwards curve.
|
Package eddsa provides EdDSA signature scheme on bw6-761's twisted edwards curve. |
Package twistededwards define unique identifier for twited edwards curves implemented in gnark-crypto
|
Package twistededwards define unique identifier for twited edwards curves implemented in gnark-crypto |