Documentation
¶
Index ¶
- func DivHint(mod *big.Int, inputs []*big.Int, outputs []*big.Int) error
- func GetHints() []solver.Hint
- func InverseHint(mod *big.Int, inputs []*big.Int, outputs []*big.Int) error
- func MultiplicationHint(mod *big.Int, inputs []*big.Int, outputs []*big.Int) error
- func QuoHint(_ *big.Int, inputs []*big.Int, outputs []*big.Int) error
- func RemHint(_ *big.Int, inputs []*big.Int, outputs []*big.Int) error
- func RightShift(_ *big.Int, inputs []*big.Int, outputs []*big.Int) error
- type BLS12377Fp
- type BN254Fp
- type BN254Fr
- type FieldParams
- type Goldilocks
- type Secp256k1Fp
- type Secp256k1Fr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InverseHint ¶
InverseHint computes the inverse x^-1 for the input x and stores it in outputs.
func MultiplicationHint ¶
MultiplicationHint unpacks the factors and parameters from inputs, computes the product and stores it in output. See internal method computeMultiplicationHint for the input packing.
func QuoHint ¶
QuoHint sets z to the quotient x/y for y != 0 and returns z. If y == 0, returns an error. Quo implements truncated division (like Go); see QuoRem for more details.
func RemHint ¶
RemHint sets z to the remainder x%y for y != 0 and returns z. If y == 0, returns an error. Rem implements truncated modulus (like Go); see QuoRem for more details.
func RightShift ¶
RightShift shifts input by the given number of bits. Expects two inputs:
- first input is the shift, will be represented as uint64;
- second input is the value to be shifted.
Returns a single output which is the value shifted. Errors if number of inputs is not 2 and number of outputs is not 1.
Types ¶
type BLS12377Fp ¶
type BLS12377Fp struct{}
BLS12377Fp provide type parametrization for emulated field on 6 limb of width 64bits for modulus 0x1ae3a4617c510eac63b05c06ca1493b1a22d9f300f5138f1ef3622fba094800170b5d44300000008508c00000000001. This is the base field of the BLS12-377 curve.
func (BLS12377Fp) BitsPerLimb ¶
func (fp BLS12377Fp) BitsPerLimb() uint
func (BLS12377Fp) IsPrime ¶
func (fp BLS12377Fp) IsPrime() bool
func (BLS12377Fp) Modulus ¶
func (fp BLS12377Fp) Modulus() *big.Int
func (BLS12377Fp) NbLimbs ¶
func (fp BLS12377Fp) NbLimbs() uint
type BN254Fp ¶
type BN254Fp struct{}
BN254Fp provide type parametrization for emulated field on 4 limb of width 64bits for modulus 0x30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47. This is the base field of the BN254 curve.
func (BN254Fp) BitsPerLimb ¶
type BN254Fr ¶
type BN254Fr struct{}
BN254Fr provides type parametrisation for emulated field on 4 limbs of width 64bits for modulus 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001. This is the scalar field of the BN254 curve.
func (BN254Fr) BitsPerLimb ¶
type FieldParams ¶
type FieldParams interface { NbLimbs() uint // number of limbs to represent field element BitsPerLimb() uint // number of bits per limb. Top limb may contain less than limbSize bits. IsPrime() bool // indicates if the modulus is prime Modulus() *big.Int // returns modulus. Do not modify. }
FieldParams describes the emulated field characteristics
type Goldilocks ¶
type Goldilocks struct{}
Goldilocks provide type parametrization for emulated field on 1 limb of width 64bits for modulus 0xffffffff00000001
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 Secp256k1Fp ¶
type Secp256k1Fp struct{}
Secp256k1Fp provide type parametrization for emulated field on 4 limb of width 64bits for modulus 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f. This is the base field of secp256k1 curve
func (Secp256k1Fp) BitsPerLimb ¶
func (fp Secp256k1Fp) BitsPerLimb() uint
func (Secp256k1Fp) IsPrime ¶
func (fp Secp256k1Fp) IsPrime() bool
func (Secp256k1Fp) Modulus ¶
func (fp Secp256k1Fp) Modulus() *big.Int
func (Secp256k1Fp) NbLimbs ¶
func (fp Secp256k1Fp) NbLimbs() uint
type Secp256k1Fr ¶
type Secp256k1Fr struct{}
Secp256k1Fr provides type parametrization for emulated field on 4 limbs of width 64bits for modulus 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141. This is the scalar field of secp256k1 curve.
func (Secp256k1Fr) BitsPerLimb ¶
func (fp Secp256k1Fr) BitsPerLimb() uint
func (Secp256k1Fr) IsPrime ¶
func (fp Secp256k1Fr) IsPrime() bool
func (Secp256k1Fr) Modulus ¶
func (fp Secp256k1Fr) Modulus() *big.Int
func (Secp256k1Fr) NbLimbs ¶
func (fp Secp256k1Fr) NbLimbs() uint