Documentation
¶
Index ¶
- Constants
- func MulByNonResidue(out, in *fp.Element) *fp.Element
- func MulByNonResidueInv(out, in *fp.Element) *fp.Element
- type Curve
- type G1Affine
- type G1Jac
- func (p *G1Jac) Add(curve *Curve, a *G1Jac) *G1Jac
- func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac
- func (p *G1Jac) Clone() *G1Jac
- func (p *G1Jac) Double() *G1Jac
- func (p *G1Jac) Equal(a *G1Jac) bool
- func (p *G1Jac) MultiExp(curve *Curve, points []G1Affine, scalars []fr.Element) chan G1Jac
- func (p *G1Jac) MultiExpFormer(curve *Curve, points []G1Affine, scalars []fr.Element) chan G1Jac
- func (p *G1Jac) Neg(a *G1Jac) *G1Jac
- func (p *G1Jac) ScalarMul(curve *Curve, a *G1Jac, scalar fr.Element) *G1Jac
- func (p *G1Jac) ScalarMulByGen(curve *Curve, scalar fr.Element) *G1Jac
- func (p *G1Jac) Set(a *G1Jac) *G1Jac
- func (p *G1Jac) String(curve *Curve) string
- func (p *G1Jac) Sub(curve *Curve, a G1Jac) *G1Jac
- func (p *G1Jac) ToAffineFromJac(res *G1Affine) *G1Affine
- func (p *G1Jac) ToProjFromJac() *G1Jac
- func (p *G1Jac) WindowedMultiExp(curve *Curve, points []G1Jac, scalars []fr.Element) *G1Jac
- type G2Affine
- type G2Jac
- func (p *G2Jac) Add(curve *Curve, a *G2Jac) *G2Jac
- func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac
- func (p *G2Jac) Clone() *G2Jac
- func (p *G2Jac) Double() *G2Jac
- func (p *G2Jac) Equal(a *G2Jac) bool
- func (p *G2Jac) MultiExp(curve *Curve, points []G2Affine, scalars []fr.Element) chan G2Jac
- func (p *G2Jac) MultiExpFormer(curve *Curve, points []G2Affine, scalars []fr.Element) chan G2Jac
- func (p *G2Jac) Neg(a *G2Jac) *G2Jac
- func (p *G2Jac) ScalarMul(curve *Curve, a *G2Jac, scalar fr.Element) *G2Jac
- func (p *G2Jac) ScalarMulByGen(curve *Curve, scalar fr.Element) *G2Jac
- func (p *G2Jac) Set(a *G2Jac) *G2Jac
- func (p *G2Jac) String(curve *Curve) string
- func (p *G2Jac) Sub(curve *Curve, a G2Jac) *G2Jac
- func (p *G2Jac) ToAffineFromJac(res *G2Affine) *G2Affine
- func (p *G2Jac) ToProjFromJac() *G2Jac
- func (p *G2Jac) WindowedMultiExp(curve *Curve, points []G2Jac, scalars []fr.Element) *G2Jac
- type PairingResult
Constants ¶
const ID = gurvy.BLS377
ID bls377 ID
Variables ¶
This section is empty.
Functions ¶
func MulByNonResidue ¶
MulByNonResidue multiplies a fp.Element by 5 It would be nice to make this a method of fp.Element but fp.Element is outside this package
Types ¶
type Curve ¶
type Curve struct { B fp.Element // A, B coefficients of the curve x^3 = y^2 +AX+b // contains filtered or unexported fields }
Curve represents the BLS377 curve and pre-computed constants
func (*Curve) FinalExponentiation ¶
func (curve *Curve) FinalExponentiation(z *e12, _z ...*e12) e12
FinalExponentiation computes the final expo x**(p**6-1)(p**2+1)(p**4 - p**2 +1)/r
func (*Curve) MillerLoop ¶
MillerLoop Miller loop
type G1Affine ¶
G1Affine point in affine coordinates
func (*G1Affine) IsInfinity ¶
IsInfinity checks if the point is infinity (in affine, it's encoded as (0,0))
func (*G1Affine) ToJacobian ¶
ToJacobian sets Q = p, Q in Jacboian, p in affine
type G1Jac ¶
G1Jac is a point with fp.Element coordinates
func (*G1Jac) Add ¶
Add point addition in montgomery form no assumptions on z Note: calling Add with p.Equal(a) produces [0, 0, 0], call p.Double() instead https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl
func (*G1Jac) AddMixed ¶
AddMixed point addition in montgomery form assumes a is in affine coordinates (i.e a.z == 1) https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-madd-2007-bl
func (*G1Jac) Double ¶
Double doubles a point in Jacobian coordinates https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl
func (*G1Jac) MultiExpFormer ¶
func (*G1Jac) ScalarMul ¶
ScalarMul multiplies a by scalar algorithm: a special case of Pippenger described by Bootle: https://jbootle.github.io/Misc/pippenger.pdf
func (*G1Jac) ScalarMulByGen ¶
ScalarMulByGen multiplies curve.g1Gen by scalar algorithm: a special case of Pippenger described by Bootle: https://jbootle.github.io/Misc/pippenger.pdf
func (*G1Jac) ToAffineFromJac ¶
ToAffineFromJac rescale a point in Jacobian coord in z=1 plane WARNING super slow function (due to the division)
func (*G1Jac) ToProjFromJac ¶
ToProjFromJac converts a point from Jacobian to projective coordinates
func (*G1Jac) WindowedMultiExp ¶
WindowedMultiExp set p = scalars[0]*points[0] + ... + scalars[n]*points[n] assume: scalars in non-Montgomery form! assume: len(points)==len(scalars)>0, len(scalars[i]) equal for all i algorithm: a special case of Pippenger described by Bootle: https://jbootle.github.io/Misc/pippenger.pdf uses all availables runtime.NumCPU()
type G2Affine ¶
type G2Affine struct {
X, Y e2
}
G2Affine point in affine coordinates
func (*G2Affine) IsInfinity ¶
IsInfinity checks if the point is infinity (in affine, it's encoded as (0,0))
func (*G2Affine) ToJacobian ¶
ToJacobian sets Q = p, Q in Jacboian, p in affine
type G2Jac ¶
type G2Jac struct {
X, Y, Z e2
}
G2Jac is a point with e2 coordinates
func (*G2Jac) Add ¶
Add point addition in montgomery form no assumptions on z Note: calling Add with p.Equal(a) produces [0, 0, 0], call p.Double() instead https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl
func (*G2Jac) AddMixed ¶
AddMixed point addition in montgomery form assumes a is in affine coordinates (i.e a.z == 1) https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-madd-2007-bl
func (*G2Jac) Double ¶
Double doubles a point in Jacobian coordinates https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2007-bl
func (*G2Jac) MultiExpFormer ¶
func (*G2Jac) ScalarMul ¶
ScalarMul multiplies a by scalar algorithm: a special case of Pippenger described by Bootle: https://jbootle.github.io/Misc/pippenger.pdf
func (*G2Jac) ScalarMulByGen ¶
ScalarMulByGen multiplies curve.g2Gen by scalar algorithm: a special case of Pippenger described by Bootle: https://jbootle.github.io/Misc/pippenger.pdf
func (*G2Jac) ToAffineFromJac ¶
ToAffineFromJac rescale a point in Jacobian coord in z=1 plane WARNING super slow function (due to the division)
func (*G2Jac) ToProjFromJac ¶
ToProjFromJac converts a point from Jacobian to projective coordinates
func (*G2Jac) WindowedMultiExp ¶
WindowedMultiExp set p = scalars[0]*points[0] + ... + scalars[n]*points[n] assume: scalars in non-Montgomery form! assume: len(points)==len(scalars)>0, len(scalars[i]) equal for all i algorithm: a special case of Pippenger described by Bootle: https://jbootle.github.io/Misc/pippenger.pdf uses all availables runtime.NumCPU()
type PairingResult ¶
type PairingResult = e12
Directories
¶
Path | Synopsis |
---|---|
Package fp contains field arithmetic operations Package fp contains field arithmetic operations Package fp contains field arithmetic operations Package fp contains field arithmetic operations
|
Package fp contains field arithmetic operations Package fp contains field arithmetic operations Package fp contains field arithmetic operations Package fp contains field arithmetic operations |
Package fr contains field arithmetic operations Package fr contains field arithmetic operations Package fr contains field arithmetic operations Package fr contains field arithmetic operations
|
Package fr contains field arithmetic operations Package fr contains field arithmetic operations Package fr contains field arithmetic operations Package fr contains field arithmetic operations |