Documentation ¶
Overview ¶
Package sw (short weierstrass)
Index ¶
- func MillerLoop(cs *frontend.ConstraintSystem, P G1Affine, Q G2Affine, res *fields.E12, ...) *fields.E12
- type G1Affine
- func (p *G1Affine) AddAssign(cs *frontend.ConstraintSystem, p1 *G1Affine) *G1Affine
- func (p *G1Affine) Assign(p1 *bls12377.G1Affine)
- func (p *G1Affine) AssignToRefactor(cs *frontend.ConstraintSystem, p1 *G1Affine) *G1Affine
- func (p *G1Affine) Double(cs *frontend.ConstraintSystem, p1 *G1Affine) *G1Affine
- func (p *G1Affine) FromJac(cs *frontend.ConstraintSystem, p1 *G1Jac) *G1Affine
- func (p *G1Affine) MustBeEqual(cs *frontend.ConstraintSystem, other G1Affine)
- func (p *G1Affine) Neg(cs *frontend.ConstraintSystem, p1 *G1Affine) *G1Affine
- func (p *G1Affine) ScalarMul(cs *frontend.ConstraintSystem, p1 *G1Affine, s interface{}, n int) *G1Affine
- func (p *G1Affine) Select(cs *frontend.ConstraintSystem, b frontend.Variable, p1, p2 *G1Affine) *G1Affine
- type G1Jac
- func (p *G1Jac) AddAssign(cs *frontend.ConstraintSystem, p1 *G1Jac) *G1Jac
- func (p *G1Jac) Assign(p1 *bls12377.G1Jac)
- func (p *G1Jac) AssignToRefactor(cs *frontend.ConstraintSystem, p1 *G1Jac) *G1Jac
- func (p *G1Jac) DoubleAssign(cs *frontend.ConstraintSystem) *G1Jac
- func (p *G1Jac) MustBeEqual(cs *frontend.ConstraintSystem, other G1Jac)
- func (p *G1Jac) Neg(cs *frontend.ConstraintSystem, p1 *G1Jac) *G1Jac
- type G2Affine
- func (p *G2Affine) AddAssign(cs *frontend.ConstraintSystem, p1 *G2Affine, ext fields.Extension) *G2Affine
- func (p *G2Affine) Assign(p1 *bls12377.G2Affine)
- func (p *G2Affine) Double(cs *frontend.ConstraintSystem, p1 *G2Affine, ext fields.Extension) *G2Affine
- func (p *G2Affine) MustBeEqual(cs *frontend.ConstraintSystem, other G2Affine)
- func (p *G2Affine) Neg(cs *frontend.ConstraintSystem, p1 *G2Affine) *G2Affine
- type G2Jac
- func (p *G2Jac) AddAssign(cs *frontend.ConstraintSystem, p1 *G2Jac, ext fields.Extension) *G2Jac
- func (p *G2Jac) Assign(p1 *bls12377.G2Jac)
- func (p *G2Jac) Double(cs *frontend.ConstraintSystem, p1 *G2Jac, ext fields.Extension) *G2Jac
- func (p *G2Jac) MustBeEqual(cs *frontend.ConstraintSystem, other G2Jac)
- func (p *G2Jac) Neg(cs *frontend.ConstraintSystem, p1 *G2Jac) *G2Jac
- func (p *G2Jac) ToProj(cs *frontend.ConstraintSystem, p1 *G2Jac, ext fields.Extension) *G2Jac
- type G2Proj
- type PairingContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MillerLoop ¶
func MillerLoop(cs *frontend.ConstraintSystem, P G1Affine, Q G2Affine, res *fields.E12, pairingInfo PairingContext) *fields.E12
MillerLoop computes the miller loop
Types ¶
type G1Affine ¶
G1Affine point in affine coords
func (*G1Affine) AddAssign ¶
func (p *G1Affine) AddAssign(cs *frontend.ConstraintSystem, p1 *G1Affine) *G1Affine
AddAssign adds p1 to p using the affine formulas with division, and return p
func (*G1Affine) AssignToRefactor ¶
func (p *G1Affine) AssignToRefactor(cs *frontend.ConstraintSystem, p1 *G1Affine) *G1Affine
AssignToRefactor sets p to p1 and return it
func (*G1Affine) Double ¶
func (p *G1Affine) Double(cs *frontend.ConstraintSystem, p1 *G1Affine) *G1Affine
Double double a point in affine coords
func (*G1Affine) FromJac ¶
func (p *G1Affine) FromJac(cs *frontend.ConstraintSystem, p1 *G1Jac) *G1Affine
FromJac sets p to p1 in affine and returns it
func (*G1Affine) MustBeEqual ¶
func (p *G1Affine) MustBeEqual(cs *frontend.ConstraintSystem, other G1Affine)
MustBeEqual constraint self to be equal to other into the given constraint system
func (*G1Affine) Neg ¶
func (p *G1Affine) Neg(cs *frontend.ConstraintSystem, p1 *G1Affine) *G1Affine
Neg outputs -p
func (*G1Affine) ScalarMul ¶
func (p *G1Affine) ScalarMul(cs *frontend.ConstraintSystem, p1 *G1Affine, s interface{}, n int) *G1Affine
ScalarMul computes scalar*p1, affect the result to p, and returns it. n is the number of bits used for the scalar mul. TODO it doesn't work if the scalar if 1, because it ends up doing P-P at the end, involving division by 0 TODO add a panic if scalar == 1
type G1Jac ¶
G1Jac point in Jacobian coords
func (*G1Jac) AddAssign ¶
func (p *G1Jac) AddAssign(cs *frontend.ConstraintSystem, p1 *G1Jac) *G1Jac
AddAssign adds 2 point in Jacobian coordinates p=p, a=p1
func (*G1Jac) AssignToRefactor ¶
func (p *G1Jac) AssignToRefactor(cs *frontend.ConstraintSystem, p1 *G1Jac) *G1Jac
AssignToRefactor sets p to p1 and return it
func (*G1Jac) DoubleAssign ¶
func (p *G1Jac) DoubleAssign(cs *frontend.ConstraintSystem) *G1Jac
DoubleAssign doubles the receiver point in jacobian coords and returns it
func (*G1Jac) MustBeEqual ¶
func (p *G1Jac) MustBeEqual(cs *frontend.ConstraintSystem, other G1Jac)
MustBeEqual constraint self to be equal to other into the given constraint system
type G2Affine ¶
G2Affine point in affine coords
func (*G2Affine) AddAssign ¶
func (p *G2Affine) AddAssign(cs *frontend.ConstraintSystem, p1 *G2Affine, ext fields.Extension) *G2Affine
AddAssign add p1 to p and return p
func (*G2Affine) Double ¶
func (p *G2Affine) Double(cs *frontend.ConstraintSystem, p1 *G2Affine, ext fields.Extension) *G2Affine
Double compute 2*p1, assign the result to p and return it Only for curve with j invariant 0 (a=0).
func (*G2Affine) MustBeEqual ¶
func (p *G2Affine) MustBeEqual(cs *frontend.ConstraintSystem, other G2Affine)
MustBeEqual constraint self to be equal to other into the given constraint system
type G2Jac ¶
G2Jac point in Jacobian coords
func (*G2Jac) MustBeEqual ¶
func (p *G2Jac) MustBeEqual(cs *frontend.ConstraintSystem, other G2Jac)
MustBeEqual constraint self to be equal to other into the given constraint system
type G2Proj ¶ added in v0.4.0
func (*G2Proj) AddMixedStep ¶ added in v0.4.0
func (p *G2Proj) AddMixedStep(cs *frontend.ConstraintSystem, evaluation *lineEvaluation, a *G2Affine, pairingInfo PairingContext)
AddMixedStep point addition in Mixed Homogenous projective and Affine coordinates https://eprint.iacr.org/2013/722.pdf (Section 4.3)
func (*G2Proj) DoubleStep ¶ added in v0.4.0
func (p *G2Proj) DoubleStep(cs *frontend.ConstraintSystem, evaluation *lineEvaluation, pairingInfo PairingContext)
DoubleStep doubles a point in Homogenous projective coordinates, and evaluates the line in Miller loop https://eprint.iacr.org/2013/722.pdf (Section 4.3)