Documentation
¶
Overview ¶
Package emparams contains emulation parameters for well known fields.
We define some well-known parameters in this package for compatibility and ease of use. When needing to use parameters not defined in this package it is sufficient to define a new type implementing [FieldParams]. For example, as:
type SmallField struct {} func (SmallField) NbLimbs() uint { return 1 } func (SmallField) BitsPerLimb() uint { return 11 } func (SmallField) IsPrime() bool { return true } func (SmallField) Modulus() *big.Int { return big.NewInt(1032) }
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BLS12377Fp ¶
type BLS12377Fp struct {
// contains filtered or unexported fields
}
BLS12377Fp provides type parametrization for field emulation:
- limbs: 6
- limb width: 64 bits
The prime modulus for type parametrisation is:
0x1ae3a4617c510eac63b05c06ca1493b1a22d9f300f5138f1ef3622fba094800170b5d44300000008508c00000000001 (base 16) 258664426012969094010652733694893533536393512754914660539884262666720468348340822774968888139573360124440321458177 (base 10)
This is the base field of the BLS12-377 curve.
func (BLS12377Fp) BitsPerLimb ¶
func (BLS12377Fp) BitsPerLimb() uint
func (BLS12377Fp) Modulus ¶
func (fp BLS12377Fp) Modulus() *big.Int
type BLS12381Fp ¶
type BLS12381Fp struct {
// contains filtered or unexported fields
}
BLS12381Fp provides type parametrization for field emulation:
- limbs: 6
- limb width: 64 bits
The prime modulus for type parametrisation is:
0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab (base 16) 4002409555221667393417789825735904156556882819939007885332058136124031650490837864442687629129015664037894272559787 (base 10)
This is the base field of the BLS12-381 curve.
func (BLS12381Fp) BitsPerLimb ¶
func (BLS12381Fp) BitsPerLimb() uint
func (BLS12381Fp) Modulus ¶
func (fp BLS12381Fp) Modulus() *big.Int
type BLS12381Fr ¶
type BLS12381Fr struct {
// contains filtered or unexported fields
}
BLS12381Fr provides type parametrization for field emulation:
- limbs: 4
- limb width: 64 bits
The prime modulus for type parametrisation is:
0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001 (base 16) 52435875175126190479447740508185965837690552500527637822603658699938581184513 (base 10)
This is the scalar field of the BLS12-381 curve.
func (BLS12381Fr) BitsPerLimb ¶
func (BLS12381Fr) BitsPerLimb() uint
func (BLS12381Fr) Modulus ¶
func (fp BLS12381Fr) Modulus() *big.Int
type BN254Fp ¶
type BN254Fp struct {
// contains filtered or unexported fields
}
BN254Fp provides type parametrization for field emulation:
- limbs: 4
- limb width: 64 bits
The prime modulus for type parametrisation is:
0x30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47 (base 16) 21888242871839275222246405745257275088696311157297823662689037894645226208583 (base 10)
This is the base field of the BN254 curve.
func (BN254Fp) BitsPerLimb ¶
func (BN254Fp) BitsPerLimb() uint
type BN254Fr ¶
type BN254Fr struct {
// contains filtered or unexported fields
}
BN254Fr provides type parametrization for field emulation:
- limbs: 4
- limb width: 64 bits
The prime modulus for type parametrisation is:
0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001 (base 16) 21888242871839275222246405745257275088548364400416034343698204186575808495617 (base 10)
This is the scalar field of the BN254 curve.
func (BN254Fr) BitsPerLimb ¶
func (BN254Fr) BitsPerLimb() uint
type Goldilocks ¶
type Goldilocks struct{}
Goldilocks provides type parametrization for field emulation:
- limbs: 1
- limb width: 64 bits
The prime modulus for type parametrisation is:
0xffffffff00000001 (base 16) 18446744069414584321 (base 10)
func (Goldilocks) BitsPerLimb ¶
func (fp Goldilocks) BitsPerLimb() uint
func (Goldilocks) IsPrime ¶
func (fp Goldilocks) IsPrime() bool
func (Goldilocks) Modulus ¶
func (fp Goldilocks) Modulus() *big.Int
func (Goldilocks) NbLimbs ¶
func (fp Goldilocks) NbLimbs() uint
type P256Fp ¶
type P256Fp struct {
// contains filtered or unexported fields
}
P256Fp provides type parametrization for field emulation:
- limbs: 4
- limb width: 64 bits
The prime modulus for type parametrisation is:
0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff (base 16) 115792089210356248762697446949407573530086143415290314195533631308867097853951 (base 10)
This is the base field of the P-256 (also SECP256r1) curve.
func (P256Fp) BitsPerLimb ¶
func (P256Fp) BitsPerLimb() uint
type P256Fr ¶
type P256Fr struct {
// contains filtered or unexported fields
}
P256Fr provides type parametrization for field emulation:
- limbs: 4
- limb width: 64 bits
The prime modulus for type parametrisation is:
0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551 (base 16) 115792089210356248762697446949407573529996955224135760342422259061068512044369 (base 10)
This is the base field of the P-256 (also SECP256r1) curve.
func (P256Fr) BitsPerLimb ¶
func (P256Fr) BitsPerLimb() uint
type P384Fp ¶
type P384Fp struct {
// contains filtered or unexported fields
}
P384Fp provides type parametrization for field emulation:
- limbs: 6
- limb width: 64 bits
The prime modulus for type parametrisation is:
0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff (base 16) 39402006196394479212279040100143613805079739270465446667948293404245721771496870329047266088258938001861606973112319 (base 10)
This is the base field of the P-384 (also SECP384r1) curve.
func (P384Fp) BitsPerLimb ¶
func (P384Fp) BitsPerLimb() uint
type P384Fr ¶
type P384Fr struct {
// contains filtered or unexported fields
}
P384Fr provides type parametrization for field emulation:
- limbs: 6
- limb width: 64 bits
The prime modulus for type parametrisation is:
0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973 (base 16) 39402006196394479212279040100143613805079739270465446667946905279627659399113263569398956308152294913554433653942643 (base 10)
This is the scalar field of the P-384 (also SECP384r1) curve.
func (P384Fr) BitsPerLimb ¶
func (P384Fr) BitsPerLimb() uint
type Secp256k1Fp ¶
type Secp256k1Fp struct {
// contains filtered or unexported fields
}
Secp256k1Fp provides type parametrization for field emulation:
- limbs: 4
- limb width: 64 bits
The prime modulus for type parametrisation is:
0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f (base 16) 115792089237316195423570985008687907853269984665640564039457584007908834671663 (base 10)
This is the base field of the SECP256k1 curve.
func (Secp256k1Fp) BitsPerLimb ¶
func (Secp256k1Fp) BitsPerLimb() uint
func (Secp256k1Fp) Modulus ¶
func (fp Secp256k1Fp) Modulus() *big.Int
type Secp256k1Fr ¶
type Secp256k1Fr struct {
// contains filtered or unexported fields
}
Secp256k1Fr provides type parametrization for field emulation:
- limbs: 4
- limb width: 64 bits
The prime modulus for type parametrisation is:
0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141 (base 16) 115792089237316195423570985008687907852837564279074904382605163141518161494337 (base 10)
This is the scalar field of the SECP256k1 curve.
func (Secp256k1Fr) BitsPerLimb ¶
func (Secp256k1Fr) BitsPerLimb() uint
func (Secp256k1Fr) Modulus ¶
func (fp Secp256k1Fr) Modulus() *big.Int