Documentation ¶
Overview ¶
Package curves: Field implementation IS NOT constant time as it leverages math/big for big number operations.
Index ¶
- Constants
- func Ed25519Order() *big.Int
- func SP256() elliptic.Curve
- func VerifyEcdsa(pk *EcPoint, hash []byte, sig *EcdsaSignature) bool
- type Bls12381Scalar
- func (k Bls12381Scalar) Add(x, y *big.Int) *big.Int
- func (k Bls12381Scalar) Bytes(x *big.Int) []byte
- func (k Bls12381Scalar) Div(x, y *big.Int) *big.Int
- func (k Bls12381Scalar) Hash(input []byte) *big.Int
- func (k Bls12381Scalar) IsValid(x *big.Int) bool
- func (k Bls12381Scalar) Mul(x, y *big.Int) *big.Int
- func (k Bls12381Scalar) Neg(x *big.Int) *big.Int
- func (k Bls12381Scalar) Random() (*big.Int, error)
- func (k Bls12381Scalar) Sub(x, y *big.Int) *big.Int
- type Curve
- type EcPoint
- func (a *EcPoint) Add(b *EcPoint) (*EcPoint, error)
- func (a EcPoint) Bytes() []byte
- func (a EcPoint) Equals(b *EcPoint) bool
- func (a EcPoint) IsBasePoint() bool
- func (a EcPoint) IsIdentity() bool
- func (a EcPoint) IsOnCurve() bool
- func (a EcPoint) IsValid() bool
- func (a *EcPoint) MarshalBinary() ([]byte, error)
- func (a EcPoint) MarshalJSON() ([]byte, error)
- func (a *EcPoint) Neg() (*EcPoint, error)
- func (a *EcPoint) ScalarMult(k *big.Int) (*EcPoint, error)
- func (a *EcPoint) UnmarshalBinary(data []byte) error
- func (a *EcPoint) UnmarshalJSON(bytes []byte) error
- type EcPointJSON
- type EcScalar
- type EcdsaSignature
- type EcdsaVerify
- type Ed25519Scalar
- func (k Ed25519Scalar) Add(x, y *big.Int) *big.Int
- func (k Ed25519Scalar) Bytes(x *big.Int) []byte
- func (k Ed25519Scalar) Div(x, y *big.Int) *big.Int
- func (k Ed25519Scalar) Hash(input []byte) *big.Int
- func (k Ed25519Scalar) IsValid(x *big.Int) bool
- func (k Ed25519Scalar) Mul(x, y *big.Int) *big.Int
- func (k Ed25519Scalar) Neg(x *big.Int) *big.Int
- func (k Ed25519Scalar) Random() (*big.Int, error)
- func (k Ed25519Scalar) RandomWithReader(r io.Reader) (*big.Int, error)
- func (k Ed25519Scalar) Sub(x, y *big.Int) *big.Int
- type Element
- func (x Element) Add(y *Element) *Element
- func (x Element) BigInt() *big.Int
- func (x Element) Bytes() []byte
- func (x Element) Clone() *Element
- func (x Element) Div(y *Element) *Element
- func (x Element) Field() *Field
- func (x Element) Invert() *Element
- func (x Element) IsEqual(y *Element) bool
- func (x *Element) MarshalJSON() ([]byte, error)
- func (x Element) Mul(y *Element) *Element
- func (x Element) Neg() *Element
- func (x Element) Pow(y *Element) *Element
- func (x Element) Sqrt() *Element
- func (x Element) Sub(y *Element) *Element
- func (x *Element) UnmarshalJSON(bytes []byte) error
- type ElementJSON
- type Ep
- func (p *Ep) Add(lhs *Ep, rhs *Ep) *Ep
- func (p *Ep) CMove(lhs, rhs *Ep, condition int) *Ep
- func (p Ep) CurveName() string
- func (p *Ep) Double(other *Ep) *Ep
- func (p *Ep) Equal(other *Ep) bool
- func (p *Ep) FromAffineCompressed(bytes []byte) (*Ep, error)
- func (p *Ep) FromAffineUncompressed(bytes []byte) (*Ep, error)
- func (p *Ep) Generator() *Ep
- func (p *Ep) Hash(bytes []byte) *Ep
- func (p *Ep) Identity() *Ep
- func (p *Ep) IsIdentity() bool
- func (p *Ep) IsOnCurve() bool
- func (p *Ep) Mul(point *Ep, scalar *fq.Fq) *Ep
- func (p *Ep) Neg(other *Ep) *Ep
- func (p *Ep) Random(reader io.Reader) *Ep
- func (p *Ep) Set(other *Ep) *Ep
- func (p *Ep) Sub(lhs, rhs *Ep) *Ep
- func (p Ep) SumOfProducts(points []*Ep, scalars []Scalar) *Ep
- func (p *Ep) ToAffineCompressed() []byte
- func (p *Ep) ToAffineUncompressed() []byte
- func (p *Ep) X() *fp.Fp
- func (p *Ep) Y() *fp.Fp
- type Field
- func (f Field) ElementFromBytes(bytes []byte) *Element
- func (f Field) IsValid(value *big.Int) bool
- func (f Field) NewElement(value *big.Int) *Element
- func (f Field) One() *Element
- func (f Field) RandomElement(r io.Reader) (*Element, error)
- func (f Field) ReducedElementFromBytes(bytes []byte) *Element
- func (f Field) Zero() *Element
- type K256Scalar
- func (k K256Scalar) Add(x, y *big.Int) *big.Int
- func (k K256Scalar) Bytes(x *big.Int) []byte
- func (k K256Scalar) Div(x, y *big.Int) *big.Int
- func (k K256Scalar) Hash(input []byte) *big.Int
- func (k K256Scalar) IsValid(x *big.Int) bool
- func (k K256Scalar) Mul(x, y *big.Int) *big.Int
- func (k K256Scalar) Neg(x *big.Int) *big.Int
- func (k K256Scalar) Random() (*big.Int, error)
- func (k K256Scalar) Sub(x, y *big.Int) *big.Int
- type Koblitz256
- func (curve *Koblitz256) Add(x1, y1, x2, y2 *big.Int) (*big.Int, *big.Int)
- func (curve *Koblitz256) Double(x1, y1 *big.Int) (*big.Int, *big.Int)
- func (curve *Koblitz256) IsOnCurve(x, y *big.Int) bool
- func (curve *Koblitz256) Params() *elliptic.CurveParams
- func (curve *Koblitz256) ScalarBaseMult(k []byte) (*big.Int, *big.Int)
- func (curve *Koblitz256) ScalarMult(Bx, By *big.Int, k []byte) (*big.Int, *big.Int)
- type NistP256
- func (curve *NistP256) Add(x1, y1, x2, y2 *big.Int) (*big.Int, *big.Int)
- func (curve *NistP256) Double(x1, y1 *big.Int) (*big.Int, *big.Int)
- func (curve *NistP256) IsOnCurve(x, y *big.Int) bool
- func (curve *NistP256) Params() *elliptic.CurveParams
- func (curve *NistP256) ScalarBaseMult(k []byte) (*big.Int, *big.Int)
- func (curve *NistP256) ScalarMul(Bx, By *big.Int, k []byte) (*big.Int, *big.Int)
- type P256Scalar
- func (k P256Scalar) Add(x, y *big.Int) *big.Int
- func (k P256Scalar) Bytes(x *big.Int) []byte
- func (k P256Scalar) Div(x, y *big.Int) *big.Int
- func (k P256Scalar) Hash(input []byte) *big.Int
- func (k P256Scalar) IsValid(x *big.Int) bool
- func (k P256Scalar) Mul(x, y *big.Int) *big.Int
- func (k P256Scalar) Neg(x *big.Int) *big.Int
- func (k P256Scalar) Random() (*big.Int, error)
- func (k P256Scalar) Sub(x, y *big.Int) *big.Int
- type PairingCurve
- func (c PairingCurve) NewG1GeneratorPoint() PairingPoint
- func (c PairingCurve) NewG1IdentityPoint() PairingPoint
- func (c PairingCurve) NewG2GeneratorPoint() PairingPoint
- func (c PairingCurve) NewG2IdentityPoint() PairingPoint
- func (c PairingCurve) NewScalar() PairingScalar
- func (c PairingCurve) ScalarG1BaseMult(sc Scalar) PairingPoint
- func (c PairingCurve) ScalarG2BaseMult(sc Scalar) PairingPoint
- type PairingPoint
- type PairingScalar
- type PallasCurve
- func (curve *PallasCurve) Add(x1, y1, x2, y2 *big.Int) (*big.Int, *big.Int)
- func (curve *PallasCurve) Double(x1, y1 *big.Int) (*big.Int, *big.Int)
- func (curve *PallasCurve) IsOnCurve(x, y *big.Int) bool
- func (curve *PallasCurve) Params() *elliptic.CurveParams
- func (curve *PallasCurve) ScalarBaseMult(k []byte) (*big.Int, *big.Int)
- func (curve *PallasCurve) ScalarMult(Bx, By *big.Int, k []byte) (*big.Int, *big.Int)
- type PallasScalar
- func (k PallasScalar) Add(x, y *big.Int) *big.Int
- func (k PallasScalar) Bytes(x *big.Int) []byte
- func (k PallasScalar) Div(x, y *big.Int) *big.Int
- func (k PallasScalar) Hash(input []byte) *big.Int
- func (k PallasScalar) IsValid(x *big.Int) bool
- func (k PallasScalar) Mul(x, y *big.Int) *big.Int
- func (k PallasScalar) Neg(x *big.Int) *big.Int
- func (k PallasScalar) Random() (*big.Int, error)
- func (k PallasScalar) Sub(x, y *big.Int) *big.Int
- type Point
- type PointBls12377G1
- func (p *PointBls12377G1) Add(rhs Point) Point
- func (p *PointBls12377G1) CurveName() string
- func (p *PointBls12377G1) Double() Point
- func (p *PointBls12377G1) Equal(rhs Point) bool
- func (p *PointBls12377G1) FromAffineCompressed(bytes []byte) (Point, error)
- func (p *PointBls12377G1) FromAffineUncompressed(bytes []byte) (Point, error)
- func (p *PointBls12377G1) Generator() Point
- func (p *PointBls12377G1) Hash(bytes []byte) Point
- func (p *PointBls12377G1) Identity() Point
- func (p *PointBls12377G1) IsIdentity() bool
- func (p *PointBls12377G1) IsNegative() bool
- func (p *PointBls12377G1) IsOnCurve() bool
- func (p *PointBls12377G1) MarshalBinary() ([]byte, error)
- func (p *PointBls12377G1) MarshalJSON() ([]byte, error)
- func (p *PointBls12377G1) MarshalText() ([]byte, error)
- func (p *PointBls12377G1) Modulus() *big.Int
- func (p *PointBls12377G1) Mul(rhs Scalar) Point
- func (p *PointBls12377G1) MultiPairing(points ...PairingPoint) Scalar
- func (p *PointBls12377G1) Neg() Point
- func (p *PointBls12377G1) OtherGroup() PairingPoint
- func (p *PointBls12377G1) Pairing(rhs PairingPoint) Scalar
- func (p *PointBls12377G1) Random(reader io.Reader) Point
- func (p *PointBls12377G1) Scalar() Scalar
- func (p *PointBls12377G1) Set(x, y *big.Int) (Point, error)
- func (p *PointBls12377G1) Sub(rhs Point) Point
- func (p *PointBls12377G1) SumOfProducts(points []Point, scalars []Scalar) Point
- func (p *PointBls12377G1) ToAffineCompressed() []byte
- func (p *PointBls12377G1) ToAffineUncompressed() []byte
- func (p *PointBls12377G1) UnmarshalBinary(input []byte) error
- func (p *PointBls12377G1) UnmarshalJSON(input []byte) error
- func (p *PointBls12377G1) UnmarshalText(input []byte) error
- func (p *PointBls12377G1) X() *big.Int
- func (p *PointBls12377G1) Y() *big.Int
- type PointBls12377G2
- func (p *PointBls12377G2) Add(rhs Point) Point
- func (p *PointBls12377G2) CurveName() string
- func (p *PointBls12377G2) Double() Point
- func (p *PointBls12377G2) Equal(rhs Point) bool
- func (p *PointBls12377G2) FromAffineCompressed(bytes []byte) (Point, error)
- func (p *PointBls12377G2) FromAffineUncompressed(bytes []byte) (Point, error)
- func (p *PointBls12377G2) Generator() Point
- func (p *PointBls12377G2) Hash(bytes []byte) Point
- func (p *PointBls12377G2) Identity() Point
- func (p *PointBls12377G2) IsIdentity() bool
- func (p *PointBls12377G2) IsNegative() bool
- func (p *PointBls12377G2) IsOnCurve() bool
- func (p *PointBls12377G2) MarshalBinary() ([]byte, error)
- func (p *PointBls12377G2) MarshalJSON() ([]byte, error)
- func (p *PointBls12377G2) MarshalText() ([]byte, error)
- func (p *PointBls12377G2) Modulus() *big.Int
- func (p *PointBls12377G2) Mul(rhs Scalar) Point
- func (p *PointBls12377G2) MultiPairing(points ...PairingPoint) Scalar
- func (p *PointBls12377G2) Neg() Point
- func (p *PointBls12377G2) OtherGroup() PairingPoint
- func (p *PointBls12377G2) Pairing(rhs PairingPoint) Scalar
- func (p *PointBls12377G2) Random(reader io.Reader) Point
- func (p *PointBls12377G2) Scalar() Scalar
- func (p *PointBls12377G2) Set(x, y *big.Int) (Point, error)
- func (p *PointBls12377G2) Sub(rhs Point) Point
- func (p *PointBls12377G2) SumOfProducts(points []Point, scalars []Scalar) Point
- func (p *PointBls12377G2) ToAffineCompressed() []byte
- func (p *PointBls12377G2) ToAffineUncompressed() []byte
- func (p *PointBls12377G2) UnmarshalBinary(input []byte) error
- func (p *PointBls12377G2) UnmarshalJSON(input []byte) error
- func (p *PointBls12377G2) UnmarshalText(input []byte) error
- func (p *PointBls12377G2) X() *big.Int
- func (p *PointBls12377G2) Y() *big.Int
- type PointBls12381G1
- func (p *PointBls12381G1) Add(rhs Point) Point
- func (p *PointBls12381G1) CurveName() string
- func (p *PointBls12381G1) Double() Point
- func (p *PointBls12381G1) Equal(rhs Point) bool
- func (p *PointBls12381G1) FromAffineCompressed(bytes []byte) (Point, error)
- func (p *PointBls12381G1) FromAffineUncompressed(bytes []byte) (Point, error)
- func (p *PointBls12381G1) Generator() Point
- func (p *PointBls12381G1) Hash(bytes []byte) Point
- func (p *PointBls12381G1) Identity() Point
- func (p *PointBls12381G1) IsIdentity() bool
- func (p *PointBls12381G1) IsNegative() bool
- func (p *PointBls12381G1) IsOnCurve() bool
- func (p *PointBls12381G1) MarshalBinary() ([]byte, error)
- func (p *PointBls12381G1) MarshalJSON() ([]byte, error)
- func (p *PointBls12381G1) MarshalText() ([]byte, error)
- func (p *PointBls12381G1) Modulus() *big.Int
- func (p *PointBls12381G1) Mul(rhs Scalar) Point
- func (p *PointBls12381G1) MultiPairing(points ...PairingPoint) Scalar
- func (p *PointBls12381G1) Neg() Point
- func (p *PointBls12381G1) OtherGroup() PairingPoint
- func (p *PointBls12381G1) Pairing(rhs PairingPoint) Scalar
- func (p *PointBls12381G1) Random(reader io.Reader) Point
- func (p *PointBls12381G1) Scalar() Scalar
- func (p *PointBls12381G1) Set(x, y *big.Int) (Point, error)
- func (p *PointBls12381G1) Sub(rhs Point) Point
- func (p *PointBls12381G1) SumOfProducts(points []Point, scalars []Scalar) Point
- func (p *PointBls12381G1) ToAffineCompressed() []byte
- func (p *PointBls12381G1) ToAffineUncompressed() []byte
- func (p *PointBls12381G1) UnmarshalBinary(input []byte) error
- func (p *PointBls12381G1) UnmarshalJSON(input []byte) error
- func (p *PointBls12381G1) UnmarshalText(input []byte) error
- func (p *PointBls12381G1) X() *big.Int
- func (p *PointBls12381G1) Y() *big.Int
- type PointBls12381G2
- func (p *PointBls12381G2) Add(rhs Point) Point
- func (p *PointBls12381G2) CurveName() string
- func (p *PointBls12381G2) Double() Point
- func (p *PointBls12381G2) Equal(rhs Point) bool
- func (p *PointBls12381G2) FromAffineCompressed(bytes []byte) (Point, error)
- func (p *PointBls12381G2) FromAffineUncompressed(bytes []byte) (Point, error)
- func (p *PointBls12381G2) Generator() Point
- func (p *PointBls12381G2) Hash(bytes []byte) Point
- func (p *PointBls12381G2) Identity() Point
- func (p *PointBls12381G2) IsIdentity() bool
- func (p *PointBls12381G2) IsNegative() bool
- func (p *PointBls12381G2) IsOnCurve() bool
- func (p *PointBls12381G2) MarshalBinary() ([]byte, error)
- func (p *PointBls12381G2) MarshalJSON() ([]byte, error)
- func (p *PointBls12381G2) MarshalText() ([]byte, error)
- func (p *PointBls12381G2) Modulus() *big.Int
- func (p *PointBls12381G2) Mul(rhs Scalar) Point
- func (p *PointBls12381G2) MultiPairing(points ...PairingPoint) Scalar
- func (p *PointBls12381G2) Neg() Point
- func (p *PointBls12381G2) OtherGroup() PairingPoint
- func (p *PointBls12381G2) Pairing(rhs PairingPoint) Scalar
- func (p *PointBls12381G2) Random(reader io.Reader) Point
- func (p *PointBls12381G2) Scalar() Scalar
- func (p *PointBls12381G2) Set(x, y *big.Int) (Point, error)
- func (p *PointBls12381G2) Sub(rhs Point) Point
- func (p *PointBls12381G2) SumOfProducts(points []Point, scalars []Scalar) Point
- func (p *PointBls12381G2) ToAffineCompressed() []byte
- func (p *PointBls12381G2) ToAffineUncompressed() []byte
- func (p *PointBls12381G2) UnmarshalBinary(input []byte) error
- func (p *PointBls12381G2) UnmarshalJSON(input []byte) error
- func (p *PointBls12381G2) UnmarshalText(input []byte) error
- func (p *PointBls12381G2) X() *big.Int
- func (p *PointBls12381G2) Y() *big.Int
- type PointEd25519
- func (p *PointEd25519) Add(rhs Point) Point
- func (p *PointEd25519) CurveName() string
- func (p *PointEd25519) Double() Point
- func (p *PointEd25519) Equal(rhs Point) bool
- func (p *PointEd25519) FromAffineCompressed(inBytes []byte) (Point, error)
- func (p *PointEd25519) FromAffineUncompressed(inBytes []byte) (Point, error)
- func (p *PointEd25519) Generator() Point
- func (p *PointEd25519) GetEdwardsPoint() *edwards25519.Point
- func (p *PointEd25519) Hash(bytes []byte) Point
- func (p *PointEd25519) Identity() Point
- func (p *PointEd25519) IsIdentity() bool
- func (p *PointEd25519) IsNegative() bool
- func (p *PointEd25519) IsOnCurve() bool
- func (p *PointEd25519) MangleScalarBitsAndMulByBasepointToProducePublicKey(rhs *ScalarEd25519) *PointEd25519
- func (p *PointEd25519) MarshalBinary() ([]byte, error)
- func (p *PointEd25519) MarshalJSON() ([]byte, error)
- func (p *PointEd25519) MarshalText() ([]byte, error)
- func (p *PointEd25519) Mul(rhs Scalar) Point
- func (p *PointEd25519) Neg() Point
- func (p *PointEd25519) Random(reader io.Reader) Point
- func (p *PointEd25519) Scalar() Scalar
- func (p *PointEd25519) Set(x, y *big.Int) (Point, error)
- func (p *PointEd25519) SetEdwardsPoint(pt *edwards25519.Point) *PointEd25519
- func (p *PointEd25519) Sub(rhs Point) Point
- func (p *PointEd25519) SumOfProducts(points []Point, scalars []Scalar) Point
- func (p *PointEd25519) ToAffineCompressed() []byte
- func (p *PointEd25519) ToAffineUncompressed() []byte
- func (p *PointEd25519) UnmarshalBinary(input []byte) error
- func (p *PointEd25519) UnmarshalJSON(input []byte) error
- func (p *PointEd25519) UnmarshalText(input []byte) error
- func (p *PointEd25519) VarTimeDoubleScalarBaseMult(a Scalar, A Point, b Scalar) Point
- type PointK256
- func (p *PointK256) Add(rhs Point) Point
- func (p *PointK256) CurveName() string
- func (p *PointK256) Double() Point
- func (p *PointK256) Equal(rhs Point) bool
- func (p *PointK256) FromAffineCompressed(bytes []byte) (Point, error)
- func (p *PointK256) FromAffineUncompressed(bytes []byte) (Point, error)
- func (p *PointK256) Generator() Point
- func (p *PointK256) Hash(bytes []byte) Point
- func (p *PointK256) Identity() Point
- func (p *PointK256) IsIdentity() bool
- func (p *PointK256) IsNegative() bool
- func (p *PointK256) IsOnCurve() bool
- func (p *PointK256) MarshalBinary() ([]byte, error)
- func (p *PointK256) MarshalJSON() ([]byte, error)
- func (p *PointK256) MarshalText() ([]byte, error)
- func (p *PointK256) Mul(rhs Scalar) Point
- func (p *PointK256) Neg() Point
- func (p *PointK256) Params() *elliptic.CurveParams
- func (p *PointK256) Random(reader io.Reader) Point
- func (p *PointK256) Scalar() Scalar
- func (p *PointK256) Set(x, y *big.Int) (Point, error)
- func (p *PointK256) Sub(rhs Point) Point
- func (p *PointK256) SumOfProducts(points []Point, scalars []Scalar) Point
- func (p *PointK256) ToAffineCompressed() []byte
- func (p *PointK256) ToAffineUncompressed() []byte
- func (p *PointK256) UnmarshalBinary(input []byte) error
- func (p *PointK256) UnmarshalJSON(input []byte) error
- func (p *PointK256) UnmarshalText(input []byte) error
- func (p *PointK256) X() *native.Field
- func (p *PointK256) Y() *native.Field
- type PointP256
- func (p *PointP256) Add(rhs Point) Point
- func (p *PointP256) CurveName() string
- func (p *PointP256) Double() Point
- func (p *PointP256) Equal(rhs Point) bool
- func (p *PointP256) FromAffineCompressed(bytes []byte) (Point, error)
- func (p *PointP256) FromAffineUncompressed(bytes []byte) (Point, error)
- func (p *PointP256) Generator() Point
- func (p *PointP256) Hash(bytes []byte) Point
- func (p *PointP256) Identity() Point
- func (p *PointP256) IsIdentity() bool
- func (p *PointP256) IsNegative() bool
- func (p *PointP256) IsOnCurve() bool
- func (p *PointP256) MarshalBinary() ([]byte, error)
- func (p *PointP256) MarshalJSON() ([]byte, error)
- func (p *PointP256) MarshalText() ([]byte, error)
- func (p *PointP256) Mul(rhs Scalar) Point
- func (p *PointP256) Neg() Point
- func (p *PointP256) Params() *elliptic.CurveParams
- func (p *PointP256) Random(reader io.Reader) Point
- func (p *PointP256) Scalar() Scalar
- func (p *PointP256) Set(x, y *big.Int) (Point, error)
- func (p *PointP256) Sub(rhs Point) Point
- func (p *PointP256) SumOfProducts(points []Point, scalars []Scalar) Point
- func (p *PointP256) ToAffineCompressed() []byte
- func (p *PointP256) ToAffineUncompressed() []byte
- func (p *PointP256) UnmarshalBinary(input []byte) error
- func (p *PointP256) UnmarshalJSON(input []byte) error
- func (p *PointP256) UnmarshalText(input []byte) error
- func (p *PointP256) X() *native.Field
- func (p *PointP256) Y() *native.Field
- type PointPallas
- func (p *PointPallas) Add(rhs Point) Point
- func (p *PointPallas) CurveName() string
- func (p *PointPallas) Double() Point
- func (p *PointPallas) Equal(rhs Point) bool
- func (p *PointPallas) FromAffineCompressed(bytes []byte) (Point, error)
- func (p *PointPallas) FromAffineUncompressed(bytes []byte) (Point, error)
- func (p *PointPallas) Generator() Point
- func (p *PointPallas) GetEp() *Ep
- func (p *PointPallas) Hash(bytes []byte) Point
- func (p *PointPallas) Identity() Point
- func (p *PointPallas) IsIdentity() bool
- func (p *PointPallas) IsNegative() bool
- func (p *PointPallas) IsOnCurve() bool
- func (p *PointPallas) MarshalBinary() ([]byte, error)
- func (p *PointPallas) MarshalJSON() ([]byte, error)
- func (p *PointPallas) MarshalText() ([]byte, error)
- func (p *PointPallas) Mul(rhs Scalar) Point
- func (p *PointPallas) Neg() Point
- func (p *PointPallas) Random(reader io.Reader) Point
- func (p *PointPallas) Scalar() Scalar
- func (p *PointPallas) Set(x, y *big.Int) (Point, error)
- func (p *PointPallas) Sub(rhs Point) Point
- func (p *PointPallas) SumOfProducts(points []Point, scalars []Scalar) Point
- func (p *PointPallas) ToAffineCompressed() []byte
- func (p *PointPallas) ToAffineUncompressed() []byte
- func (p *PointPallas) UnmarshalBinary(input []byte) error
- func (p *PointPallas) UnmarshalJSON(input []byte) error
- func (p *PointPallas) UnmarshalText(input []byte) error
- func (p *PointPallas) X() *fp.Fp
- func (p *PointPallas) Y() *fp.Fp
- type Scalar
- type ScalarBls12377
- func (s *ScalarBls12377) Add(rhs Scalar) Scalar
- func (s *ScalarBls12377) BigInt() *big.Int
- func (s *ScalarBls12377) Bytes() []byte
- func (s *ScalarBls12377) Clone() Scalar
- func (s *ScalarBls12377) Cmp(rhs Scalar) int
- func (s *ScalarBls12377) Cube() Scalar
- func (s *ScalarBls12377) Div(rhs Scalar) Scalar
- func (s *ScalarBls12377) Double() Scalar
- func (s *ScalarBls12377) Hash(bytes []byte) Scalar
- func (s *ScalarBls12377) Invert() (Scalar, error)
- func (s *ScalarBls12377) IsEven() bool
- func (s *ScalarBls12377) IsOdd() bool
- func (s *ScalarBls12377) IsOne() bool
- func (s *ScalarBls12377) IsZero() bool
- func (s *ScalarBls12377) MarshalBinary() ([]byte, error)
- func (s *ScalarBls12377) MarshalJSON() ([]byte, error)
- func (s *ScalarBls12377) MarshalText() ([]byte, error)
- func (s *ScalarBls12377) Mul(rhs Scalar) Scalar
- func (s *ScalarBls12377) MulAdd(y, z Scalar) Scalar
- func (s *ScalarBls12377) Neg() Scalar
- func (s *ScalarBls12377) New(value int) Scalar
- func (s *ScalarBls12377) One() Scalar
- func (s *ScalarBls12377) Order() *big.Int
- func (s *ScalarBls12377) Point() Point
- func (s *ScalarBls12377) Random(reader io.Reader) Scalar
- func (s *ScalarBls12377) SetBigInt(v *big.Int) (Scalar, error)
- func (s *ScalarBls12377) SetBytes(bytes []byte) (Scalar, error)
- func (s *ScalarBls12377) SetBytesWide(bytes []byte) (Scalar, error)
- func (s *ScalarBls12377) SetPoint(p Point) PairingScalar
- func (s *ScalarBls12377) Sqrt() (Scalar, error)
- func (s *ScalarBls12377) Square() Scalar
- func (s *ScalarBls12377) Sub(rhs Scalar) Scalar
- func (s *ScalarBls12377) UnmarshalBinary(input []byte) error
- func (s *ScalarBls12377) UnmarshalJSON(input []byte) error
- func (s *ScalarBls12377) UnmarshalText(input []byte) error
- func (s *ScalarBls12377) Zero() Scalar
- type ScalarBls12377Gt
- func (s *ScalarBls12377Gt) Add(rhs Scalar) Scalar
- func (s *ScalarBls12377Gt) BigInt() *big.Int
- func (s *ScalarBls12377Gt) Bytes() []byte
- func (s *ScalarBls12377Gt) Clone() Scalar
- func (s *ScalarBls12377Gt) Cmp(rhs Scalar) int
- func (s *ScalarBls12377Gt) Cube() Scalar
- func (s *ScalarBls12377Gt) Div(rhs Scalar) Scalar
- func (s *ScalarBls12377Gt) Double() Scalar
- func (s *ScalarBls12377Gt) Hash(bytes []byte) Scalar
- func (s *ScalarBls12377Gt) Invert() (Scalar, error)
- func (s *ScalarBls12377Gt) IsEven() bool
- func (s *ScalarBls12377Gt) IsOdd() bool
- func (s *ScalarBls12377Gt) IsOne() bool
- func (s *ScalarBls12377Gt) IsZero() bool
- func (s *ScalarBls12377Gt) MarshalBinary() ([]byte, error)
- func (s *ScalarBls12377Gt) MarshalJSON() ([]byte, error)
- func (s *ScalarBls12377Gt) MarshalText() ([]byte, error)
- func (s *ScalarBls12377Gt) Mul(rhs Scalar) Scalar
- func (s *ScalarBls12377Gt) MulAdd(y, z Scalar) Scalar
- func (s *ScalarBls12377Gt) Neg() Scalar
- func (s *ScalarBls12377Gt) New(input int) Scalar
- func (s *ScalarBls12377Gt) One() Scalar
- func (s *ScalarBls12377Gt) Point() Point
- func (s *ScalarBls12377Gt) Random(reader io.Reader) Scalar
- func (s *ScalarBls12377Gt) SetBigInt(v *big.Int) (Scalar, error)
- func (s *ScalarBls12377Gt) SetBytes(bytes []byte) (Scalar, error)
- func (s *ScalarBls12377Gt) SetBytesWide(bytes []byte) (Scalar, error)
- func (s *ScalarBls12377Gt) Sqrt() (Scalar, error)
- func (s *ScalarBls12377Gt) Square() Scalar
- func (s *ScalarBls12377Gt) Sub(rhs Scalar) Scalar
- func (s *ScalarBls12377Gt) UnmarshalBinary(input []byte) error
- func (s *ScalarBls12377Gt) UnmarshalJSON(input []byte) error
- func (s *ScalarBls12377Gt) UnmarshalText(input []byte) error
- func (s *ScalarBls12377Gt) Zero() Scalar
- type ScalarBls12381
- func (s *ScalarBls12381) Add(rhs Scalar) Scalar
- func (s *ScalarBls12381) BigInt() *big.Int
- func (s *ScalarBls12381) Bytes() []byte
- func (s *ScalarBls12381) Clone() Scalar
- func (s *ScalarBls12381) Cmp(rhs Scalar) int
- func (s *ScalarBls12381) Cube() Scalar
- func (s *ScalarBls12381) Div(rhs Scalar) Scalar
- func (s *ScalarBls12381) Double() Scalar
- func (s *ScalarBls12381) Hash(bytes []byte) Scalar
- func (s *ScalarBls12381) Invert() (Scalar, error)
- func (s *ScalarBls12381) IsEven() bool
- func (s *ScalarBls12381) IsOdd() bool
- func (s *ScalarBls12381) IsOne() bool
- func (s *ScalarBls12381) IsZero() bool
- func (s *ScalarBls12381) MarshalBinary() ([]byte, error)
- func (s *ScalarBls12381) MarshalJSON() ([]byte, error)
- func (s *ScalarBls12381) MarshalText() ([]byte, error)
- func (s *ScalarBls12381) Mul(rhs Scalar) Scalar
- func (s *ScalarBls12381) MulAdd(y, z Scalar) Scalar
- func (s *ScalarBls12381) Neg() Scalar
- func (s *ScalarBls12381) New(value int) Scalar
- func (s *ScalarBls12381) One() Scalar
- func (s *ScalarBls12381) Order() *big.Int
- func (s *ScalarBls12381) Point() Point
- func (s *ScalarBls12381) Random(reader io.Reader) Scalar
- func (s *ScalarBls12381) SetBigInt(v *big.Int) (Scalar, error)
- func (s *ScalarBls12381) SetBytes(bytes []byte) (Scalar, error)
- func (s *ScalarBls12381) SetBytesWide(bytes []byte) (Scalar, error)
- func (s *ScalarBls12381) SetPoint(p Point) PairingScalar
- func (s *ScalarBls12381) Sqrt() (Scalar, error)
- func (s *ScalarBls12381) Square() Scalar
- func (s *ScalarBls12381) Sub(rhs Scalar) Scalar
- func (s *ScalarBls12381) UnmarshalBinary(input []byte) error
- func (s *ScalarBls12381) UnmarshalJSON(input []byte) error
- func (s *ScalarBls12381) UnmarshalText(input []byte) error
- func (s *ScalarBls12381) Zero() Scalar
- type ScalarBls12381Gt
- func (s *ScalarBls12381Gt) Add(rhs Scalar) Scalar
- func (s *ScalarBls12381Gt) BigInt() *big.Int
- func (s *ScalarBls12381Gt) Bytes() []byte
- func (s *ScalarBls12381Gt) Clone() Scalar
- func (s *ScalarBls12381Gt) Cmp(rhs Scalar) int
- func (s *ScalarBls12381Gt) Cube() Scalar
- func (s *ScalarBls12381Gt) Div(rhs Scalar) Scalar
- func (s *ScalarBls12381Gt) Double() Scalar
- func (s *ScalarBls12381Gt) Hash(bytes []byte) Scalar
- func (s *ScalarBls12381Gt) Invert() (Scalar, error)
- func (s *ScalarBls12381Gt) IsEven() bool
- func (s *ScalarBls12381Gt) IsOdd() bool
- func (s *ScalarBls12381Gt) IsOne() bool
- func (s *ScalarBls12381Gt) IsZero() bool
- func (s *ScalarBls12381Gt) MarshalBinary() ([]byte, error)
- func (s *ScalarBls12381Gt) MarshalJSON() ([]byte, error)
- func (s *ScalarBls12381Gt) MarshalText() ([]byte, error)
- func (s *ScalarBls12381Gt) Mul(rhs Scalar) Scalar
- func (s *ScalarBls12381Gt) MulAdd(y, z Scalar) Scalar
- func (s *ScalarBls12381Gt) Neg() Scalar
- func (s *ScalarBls12381Gt) New(input int) Scalar
- func (s *ScalarBls12381Gt) One() Scalar
- func (s *ScalarBls12381Gt) Point() Point
- func (s *ScalarBls12381Gt) Random(reader io.Reader) Scalar
- func (s *ScalarBls12381Gt) SetBigInt(v *big.Int) (Scalar, error)
- func (s *ScalarBls12381Gt) SetBytes(bytes []byte) (Scalar, error)
- func (s *ScalarBls12381Gt) SetBytesWide(bytes []byte) (Scalar, error)
- func (s *ScalarBls12381Gt) Sqrt() (Scalar, error)
- func (s *ScalarBls12381Gt) Square() Scalar
- func (s *ScalarBls12381Gt) Sub(rhs Scalar) Scalar
- func (s *ScalarBls12381Gt) UnmarshalBinary(input []byte) error
- func (s *ScalarBls12381Gt) UnmarshalJSON(input []byte) error
- func (s *ScalarBls12381Gt) UnmarshalText(input []byte) error
- func (s *ScalarBls12381Gt) Zero() Scalar
- type ScalarEd25519
- func (s *ScalarEd25519) Add(rhs Scalar) Scalar
- func (s *ScalarEd25519) BigInt() *big.Int
- func (s *ScalarEd25519) Bytes() []byte
- func (s *ScalarEd25519) Clone() Scalar
- func (s *ScalarEd25519) Cmp(rhs Scalar) int
- func (s *ScalarEd25519) Cube() Scalar
- func (s *ScalarEd25519) Div(rhs Scalar) Scalar
- func (s *ScalarEd25519) Double() Scalar
- func (s *ScalarEd25519) GetEdwardsScalar() *edwards25519.Scalar
- func (s *ScalarEd25519) Hash(bytes []byte) Scalar
- func (s *ScalarEd25519) Invert() (Scalar, error)
- func (s *ScalarEd25519) IsEven() bool
- func (s *ScalarEd25519) IsOdd() bool
- func (s *ScalarEd25519) IsOne() bool
- func (s *ScalarEd25519) IsZero() bool
- func (s *ScalarEd25519) MarshalBinary() ([]byte, error)
- func (s *ScalarEd25519) MarshalJSON() ([]byte, error)
- func (s *ScalarEd25519) MarshalText() ([]byte, error)
- func (s *ScalarEd25519) Mul(rhs Scalar) Scalar
- func (s *ScalarEd25519) MulAdd(y, z Scalar) Scalar
- func (s *ScalarEd25519) Neg() Scalar
- func (s *ScalarEd25519) New(input int) Scalar
- func (s *ScalarEd25519) One() Scalar
- func (s *ScalarEd25519) Point() Point
- func (s *ScalarEd25519) Random(reader io.Reader) Scalar
- func (s *ScalarEd25519) SetBigInt(x *big.Int) (Scalar, error)
- func (s *ScalarEd25519) SetBytes(input []byte) (Scalar, error)
- func (s *ScalarEd25519) SetBytesCanonical(bytes []byte) (Scalar, error)
- func (s *ScalarEd25519) SetBytesClamping(bytes []byte) (Scalar, error)
- func (s *ScalarEd25519) SetBytesWide(bytes []byte) (Scalar, error)
- func (s *ScalarEd25519) SetEdwardsScalar(sc *edwards25519.Scalar) *ScalarEd25519
- func (s *ScalarEd25519) Sqrt() (Scalar, error)
- func (s *ScalarEd25519) Square() Scalar
- func (s *ScalarEd25519) Sub(rhs Scalar) Scalar
- func (s *ScalarEd25519) UnmarshalBinary(input []byte) error
- func (s *ScalarEd25519) UnmarshalJSON(input []byte) error
- func (s *ScalarEd25519) UnmarshalText(input []byte) error
- func (s *ScalarEd25519) Zero() Scalar
- type ScalarK256
- func (s *ScalarK256) Add(rhs Scalar) Scalar
- func (s *ScalarK256) BigInt() *big.Int
- func (s *ScalarK256) Bytes() []byte
- func (s *ScalarK256) Clone() Scalar
- func (s *ScalarK256) Cmp(rhs Scalar) int
- func (s *ScalarK256) Cube() Scalar
- func (s *ScalarK256) Div(rhs Scalar) Scalar
- func (s *ScalarK256) Double() Scalar
- func (s *ScalarK256) Hash(bytes []byte) Scalar
- func (s *ScalarK256) Invert() (Scalar, error)
- func (s *ScalarK256) IsEven() bool
- func (s *ScalarK256) IsOdd() bool
- func (s *ScalarK256) IsOne() bool
- func (s *ScalarK256) IsZero() bool
- func (s *ScalarK256) MarshalBinary() ([]byte, error)
- func (s *ScalarK256) MarshalJSON() ([]byte, error)
- func (s *ScalarK256) MarshalText() ([]byte, error)
- func (s *ScalarK256) Mul(rhs Scalar) Scalar
- func (s *ScalarK256) MulAdd(y, z Scalar) Scalar
- func (s *ScalarK256) Neg() Scalar
- func (s *ScalarK256) New(value int) Scalar
- func (s *ScalarK256) One() Scalar
- func (s *ScalarK256) Point() Point
- func (s *ScalarK256) Random(reader io.Reader) Scalar
- func (s *ScalarK256) SetBigInt(v *big.Int) (Scalar, error)
- func (s *ScalarK256) SetBytes(bytes []byte) (Scalar, error)
- func (s *ScalarK256) SetBytesWide(bytes []byte) (Scalar, error)
- func (s *ScalarK256) Sqrt() (Scalar, error)
- func (s *ScalarK256) Square() Scalar
- func (s *ScalarK256) Sub(rhs Scalar) Scalar
- func (s *ScalarK256) UnmarshalBinary(input []byte) error
- func (s *ScalarK256) UnmarshalJSON(input []byte) error
- func (s *ScalarK256) UnmarshalText(input []byte) error
- func (s *ScalarK256) Zero() Scalar
- type ScalarP256
- func (s *ScalarP256) Add(rhs Scalar) Scalar
- func (s *ScalarP256) BigInt() *big.Int
- func (s *ScalarP256) Bytes() []byte
- func (s *ScalarP256) Clone() Scalar
- func (s *ScalarP256) Cmp(rhs Scalar) int
- func (s *ScalarP256) Cube() Scalar
- func (s *ScalarP256) Div(rhs Scalar) Scalar
- func (s *ScalarP256) Double() Scalar
- func (s *ScalarP256) Hash(bytes []byte) Scalar
- func (s *ScalarP256) Invert() (Scalar, error)
- func (s *ScalarP256) IsEven() bool
- func (s *ScalarP256) IsOdd() bool
- func (s *ScalarP256) IsOne() bool
- func (s *ScalarP256) IsZero() bool
- func (s *ScalarP256) MarshalBinary() ([]byte, error)
- func (s *ScalarP256) MarshalJSON() ([]byte, error)
- func (s *ScalarP256) MarshalText() ([]byte, error)
- func (s *ScalarP256) Mul(rhs Scalar) Scalar
- func (s *ScalarP256) MulAdd(y, z Scalar) Scalar
- func (s *ScalarP256) Neg() Scalar
- func (s *ScalarP256) New(value int) Scalar
- func (s *ScalarP256) One() Scalar
- func (s *ScalarP256) Point() Point
- func (s *ScalarP256) Random(reader io.Reader) Scalar
- func (s *ScalarP256) SetBigInt(v *big.Int) (Scalar, error)
- func (s *ScalarP256) SetBytes(bytes []byte) (Scalar, error)
- func (s *ScalarP256) SetBytesWide(bytes []byte) (Scalar, error)
- func (s *ScalarP256) Sqrt() (Scalar, error)
- func (s *ScalarP256) Square() Scalar
- func (s *ScalarP256) Sub(rhs Scalar) Scalar
- func (s *ScalarP256) UnmarshalBinary(input []byte) error
- func (s *ScalarP256) UnmarshalJSON(input []byte) error
- func (s *ScalarP256) UnmarshalText(input []byte) error
- func (s *ScalarP256) Zero() Scalar
- type ScalarPallas
- func (s *ScalarPallas) Add(rhs Scalar) Scalar
- func (s *ScalarPallas) BigInt() *big.Int
- func (s *ScalarPallas) Bytes() []byte
- func (s *ScalarPallas) Clone() Scalar
- func (s *ScalarPallas) Cmp(rhs Scalar) int
- func (s *ScalarPallas) Cube() Scalar
- func (s *ScalarPallas) Div(rhs Scalar) Scalar
- func (s *ScalarPallas) Double() Scalar
- func (s *ScalarPallas) GetFq() *fq.Fq
- func (s *ScalarPallas) Hash(bytes []byte) Scalar
- func (s *ScalarPallas) Invert() (Scalar, error)
- func (s *ScalarPallas) IsEven() bool
- func (s *ScalarPallas) IsOdd() bool
- func (s *ScalarPallas) IsOne() bool
- func (s *ScalarPallas) IsZero() bool
- func (s *ScalarPallas) MarshalBinary() ([]byte, error)
- func (s *ScalarPallas) MarshalJSON() ([]byte, error)
- func (s *ScalarPallas) MarshalText() ([]byte, error)
- func (s *ScalarPallas) Mul(rhs Scalar) Scalar
- func (s *ScalarPallas) MulAdd(y, z Scalar) Scalar
- func (s *ScalarPallas) Neg() Scalar
- func (s *ScalarPallas) New(value int) Scalar
- func (s *ScalarPallas) One() Scalar
- func (s *ScalarPallas) Point() Point
- func (s *ScalarPallas) Random(reader io.Reader) Scalar
- func (s *ScalarPallas) SetBigInt(v *big.Int) (Scalar, error)
- func (s *ScalarPallas) SetBytes(bytes []byte) (Scalar, error)
- func (s *ScalarPallas) SetBytesWide(bytes []byte) (Scalar, error)
- func (s *ScalarPallas) SetFq(fq *fq.Fq) *ScalarPallas
- func (s *ScalarPallas) Sqrt() (Scalar, error)
- func (s *ScalarPallas) Square() Scalar
- func (s *ScalarPallas) Sub(rhs Scalar) Scalar
- func (s *ScalarPallas) UnmarshalBinary(input []byte) error
- func (s *ScalarPallas) UnmarshalJSON(input []byte) error
- func (s *ScalarPallas) UnmarshalText(input []byte) error
- func (s *ScalarPallas) Zero() Scalar
Constants ¶
const ( K256Name = "secp256k1" BLS12381G1Name = "BLS12381G1" BLS12381G2Name = "BLS12381G2" BLS12831Name = "BLS12831" P256Name = "P-256" ED25519Name = "ed25519" PallasName = "pallas" BLS12377G1Name = "BLS12377G1" BLS12377G2Name = "BLS12377G2" BLS12377Name = "BLS12377" )
Variables ¶
This section is empty.
Functions ¶
func Ed25519Order ¶
SubgroupOrder returns the order of the Ed25519 base Point.
func VerifyEcdsa ¶
func VerifyEcdsa(pk *EcPoint, hash []byte, sig *EcdsaSignature) bool
Verifies ECDSA signature using core types.
Types ¶
type Bls12381Scalar ¶
type Bls12381Scalar struct{}
func NewBls12381Scalar ¶
func NewBls12381Scalar() *Bls12381Scalar
type Curve ¶
Curve represents a named elliptic curve with a scalar field and point group
func GetCurveByName ¶
GetCurveByName returns the correct `Curve` given the name
func (Curve) NewGeneratorPoint ¶
func (Curve) NewIdentityPoint ¶
func (Curve) ScalarBaseMult ¶
type EcPoint ¶
EcPoint represents an elliptic curve Point
func NewScalarBaseMult ¶
NewScalarBaseMult creates a Point from the base Point multiplied by a field element
func PointFromBytesUncompressed ¶
PointFromBytesUncompressed outputs uncompressed X || Y similar to https://www.secg.org/sec1-v1.99.dif.pdf section 2.2 and 2.3
func (EcPoint) IsBasePoint ¶
IsBasePoint returns true if this Point is curve's base Point
func (EcPoint) IsIdentity ¶
IsIdentity returns true if this Point is the Point at infinity
func (*EcPoint) MarshalBinary ¶
MarshalBinary serializes EcPoint to binary
func (EcPoint) MarshalJSON ¶
MarshalJSON serializes EcPoint to JSON
func (*EcPoint) ScalarMult ¶
ScalarMult multiplies this Point by a Scalar
func (*EcPoint) UnmarshalBinary ¶
UnmarshalBinary deserializes binary to EcPoint
func (*EcPoint) UnmarshalJSON ¶
UnmarshalJSON deserializes JSON to EcPoint
type EcPointJSON ¶
type EcPointJSON struct { X *big.Int `json:"x"` Y *big.Int `json:"y"` CurveName string `json:"curve_name"` }
EcPointJSON encapsulates the data that is serialized to JSON used internally and not for external use. Public so other pieces can use for serialization
type EcdsaSignature ¶
EcdsaSignature represents a (composite) digital signature
type EcdsaVerify ¶
type EcdsaVerify func(pubKey *EcPoint, hash []byte, signature *EcdsaSignature) bool
EcdsaVerify runs a curve- or algorithm-specific ECDSA verification function on input an ECDSA public (verification) key, a message digest, and an ECDSA signature. It must return true if all the parameters are sane and the ECDSA signature is valid, and false otherwise
type Ed25519Scalar ¶
type Ed25519Scalar struct{}
func NewEd25519Scalar ¶
func NewEd25519Scalar() *Ed25519Scalar
func (Ed25519Scalar) RandomWithReader ¶
type Element ¶
Element is a group element within a finite field.
func (*Element) MarshalJSON ¶
Marshal Element to JSON
func (*Element) UnmarshalJSON ¶
type ElementJSON ¶
ElementJSON is used in JSON<>Element conversions. For years, big.Int hasn't properly supported JSON unmarshaling https://github.com/golang/go/issues/28154
type Ep ¶
type Ep struct {
// contains filtered or unexported fields
}
func (*Ep) IsIdentity ¶
func (*Ep) ToAffineCompressed ¶
func (*Ep) ToAffineUncompressed ¶
type Field ¶
Field is a finite field.
func (Field) ElementFromBytes ¶
ElementFromBytes initializes a new field element from big-endian bytes
func (Field) ReducedElementFromBytes ¶
ReducedElementFromBytes initializes a new field element from big-endian bytes and reduces it by the modulus of the field.
WARNING: If this is used with cryptographic constructions which rely on a uniform distribution of values, this may introduce a bias to the value of the returned field element. This happens when the integer range of the provided bytes is not an integer multiple of the field order.
Assume we are working in field which a modulus of 3 and the range of the uniform random bytes we provide as input is 5. Thus, the set of field elements is {0, 1, 2} and the set of integer values for the input bytes is: {0, 1, 2, 3, 4}. What is the distribution of the output values produced by this function?
ReducedElementFromBytes(0) => 0 ReducedElementFromBytes(1) => 1 ReducedElementFromBytes(2) => 2 ReducedElementFromBytes(3) => 0 ReducedElementFromBytes(4) => 1
For a value space V and random value v, a uniform distribution is defined as P[V = v] = 1/|V| where |V| is to the order of the field. Using the results from above, we see that P[v = 0] = 2/5, P[v = 1] = 2/5, and P[v = 2] = 1/5. For a uniform distribution we would expect these to each be equal to 1/3. As they do not, this does not return uniform output for that example.
To see why this is okay if the range is a multiple of the field order, change the input range to 6 and notice that now each output has a probability of 2/6 = 1/3, and the output is uniform.
type Koblitz256 ¶
type Koblitz256 struct {
*elliptic.CurveParams
}
func K256Curve ¶
func K256Curve() *Koblitz256
func (*Koblitz256) Params ¶
func (curve *Koblitz256) Params() *elliptic.CurveParams
func (*Koblitz256) ScalarBaseMult ¶
func (*Koblitz256) ScalarMult ¶
type NistP256 ¶
type NistP256 struct {
*elliptic.CurveParams
}
func NistP256Curve ¶
func NistP256Curve() *NistP256
func (*NistP256) Params ¶
func (curve *NistP256) Params() *elliptic.CurveParams
func (*NistP256) ScalarBaseMult ¶
type PairingCurve ¶
type PairingCurve struct { Scalar PairingScalar PointG1 PairingPoint PointG2 PairingPoint GT Scalar Name string }
PairingCurve represents a named elliptic curve that supports pairings
func BLS12381 ¶
func BLS12381(preferredPoint Point) *PairingCurve
func GetPairingCurveByName ¶
func GetPairingCurveByName(name string) *PairingCurve
func (PairingCurve) NewG1GeneratorPoint ¶
func (c PairingCurve) NewG1GeneratorPoint() PairingPoint
func (PairingCurve) NewG1IdentityPoint ¶
func (c PairingCurve) NewG1IdentityPoint() PairingPoint
func (PairingCurve) NewG2GeneratorPoint ¶
func (c PairingCurve) NewG2GeneratorPoint() PairingPoint
func (PairingCurve) NewG2IdentityPoint ¶
func (c PairingCurve) NewG2IdentityPoint() PairingPoint
func (PairingCurve) NewScalar ¶
func (c PairingCurve) NewScalar() PairingScalar
func (PairingCurve) ScalarG1BaseMult ¶
func (c PairingCurve) ScalarG1BaseMult(sc Scalar) PairingPoint
func (PairingCurve) ScalarG2BaseMult ¶
func (c PairingCurve) ScalarG2BaseMult(sc Scalar) PairingPoint
type PairingPoint ¶
type PairingPoint interface { Point OtherGroup() PairingPoint Pairing(rhs PairingPoint) Scalar MultiPairing(...PairingPoint) Scalar }
type PairingScalar ¶
type PairingScalar interface { Scalar SetPoint(p Point) PairingScalar }
type PallasCurve ¶
type PallasCurve struct {
*elliptic.CurveParams
}
func Pallas ¶
func Pallas() *PallasCurve
func (*PallasCurve) Params ¶
func (curve *PallasCurve) Params() *elliptic.CurveParams
func (*PallasCurve) ScalarBaseMult ¶
func (*PallasCurve) ScalarMult ¶
type PallasScalar ¶
type PallasScalar struct{}
PallasScalar - Old interface
func NewPallasScalar ¶
func NewPallasScalar() *PallasScalar
type Point ¶
type Point interface { Random(reader io.Reader) Point Hash(bytes []byte) Point Identity() Point Generator() Point IsIdentity() bool IsNegative() bool IsOnCurve() bool Double() Point Scalar() Scalar Neg() Point Add(rhs Point) Point Sub(rhs Point) Point Mul(rhs Scalar) Point Equal(rhs Point) bool Set(x, y *big.Int) (Point, error) ToAffineCompressed() []byte ToAffineUncompressed() []byte FromAffineCompressed(bytes []byte) (Point, error) FromAffineUncompressed(bytes []byte) (Point, error) CurveName() string SumOfProducts(points []Point, scalars []Scalar) Point }
Point represents an elliptic curve point
type PointBls12377G1 ¶
type PointBls12377G1 struct {
// contains filtered or unexported fields
}
func (*PointBls12377G1) Add ¶
func (p *PointBls12377G1) Add(rhs Point) Point
func (*PointBls12377G1) CurveName ¶
func (p *PointBls12377G1) CurveName() string
func (*PointBls12377G1) Double ¶
func (p *PointBls12377G1) Double() Point
func (*PointBls12377G1) Equal ¶
func (p *PointBls12377G1) Equal(rhs Point) bool
func (*PointBls12377G1) FromAffineCompressed ¶
func (p *PointBls12377G1) FromAffineCompressed(bytes []byte) (Point, error)
func (*PointBls12377G1) FromAffineUncompressed ¶
func (p *PointBls12377G1) FromAffineUncompressed(bytes []byte) (Point, error)
func (*PointBls12377G1) Generator ¶
func (p *PointBls12377G1) Generator() Point
func (*PointBls12377G1) Hash ¶
func (p *PointBls12377G1) Hash(bytes []byte) Point
func (*PointBls12377G1) Identity ¶
func (p *PointBls12377G1) Identity() Point
func (*PointBls12377G1) IsIdentity ¶
func (p *PointBls12377G1) IsIdentity() bool
func (*PointBls12377G1) IsNegative ¶
func (p *PointBls12377G1) IsNegative() bool
func (*PointBls12377G1) IsOnCurve ¶
func (p *PointBls12377G1) IsOnCurve() bool
func (*PointBls12377G1) MarshalBinary ¶
func (p *PointBls12377G1) MarshalBinary() ([]byte, error)
func (*PointBls12377G1) MarshalJSON ¶
func (p *PointBls12377G1) MarshalJSON() ([]byte, error)
func (*PointBls12377G1) MarshalText ¶
func (p *PointBls12377G1) MarshalText() ([]byte, error)
func (*PointBls12377G1) Modulus ¶
func (p *PointBls12377G1) Modulus() *big.Int
func (*PointBls12377G1) Mul ¶
func (p *PointBls12377G1) Mul(rhs Scalar) Point
func (*PointBls12377G1) MultiPairing ¶
func (p *PointBls12377G1) MultiPairing(points ...PairingPoint) Scalar
func (*PointBls12377G1) Neg ¶
func (p *PointBls12377G1) Neg() Point
func (*PointBls12377G1) OtherGroup ¶
func (p *PointBls12377G1) OtherGroup() PairingPoint
func (*PointBls12377G1) Pairing ¶
func (p *PointBls12377G1) Pairing(rhs PairingPoint) Scalar
func (*PointBls12377G1) Scalar ¶
func (p *PointBls12377G1) Scalar() Scalar
func (*PointBls12377G1) Sub ¶
func (p *PointBls12377G1) Sub(rhs Point) Point
func (*PointBls12377G1) SumOfProducts ¶
func (p *PointBls12377G1) SumOfProducts(points []Point, scalars []Scalar) Point
func (*PointBls12377G1) ToAffineCompressed ¶
func (p *PointBls12377G1) ToAffineCompressed() []byte
func (*PointBls12377G1) ToAffineUncompressed ¶
func (p *PointBls12377G1) ToAffineUncompressed() []byte
func (*PointBls12377G1) UnmarshalBinary ¶
func (p *PointBls12377G1) UnmarshalBinary(input []byte) error
func (*PointBls12377G1) UnmarshalJSON ¶
func (p *PointBls12377G1) UnmarshalJSON(input []byte) error
func (*PointBls12377G1) UnmarshalText ¶
func (p *PointBls12377G1) UnmarshalText(input []byte) error
func (*PointBls12377G1) X ¶
func (p *PointBls12377G1) X() *big.Int
func (*PointBls12377G1) Y ¶
func (p *PointBls12377G1) Y() *big.Int
type PointBls12377G2 ¶
type PointBls12377G2 struct {
// contains filtered or unexported fields
}
func (*PointBls12377G2) Add ¶
func (p *PointBls12377G2) Add(rhs Point) Point
func (*PointBls12377G2) CurveName ¶
func (p *PointBls12377G2) CurveName() string
func (*PointBls12377G2) Double ¶
func (p *PointBls12377G2) Double() Point
func (*PointBls12377G2) Equal ¶
func (p *PointBls12377G2) Equal(rhs Point) bool
func (*PointBls12377G2) FromAffineCompressed ¶
func (p *PointBls12377G2) FromAffineCompressed(bytes []byte) (Point, error)
func (*PointBls12377G2) FromAffineUncompressed ¶
func (p *PointBls12377G2) FromAffineUncompressed(bytes []byte) (Point, error)
func (*PointBls12377G2) Generator ¶
func (p *PointBls12377G2) Generator() Point
func (*PointBls12377G2) Hash ¶
func (p *PointBls12377G2) Hash(bytes []byte) Point
func (*PointBls12377G2) Identity ¶
func (p *PointBls12377G2) Identity() Point
func (*PointBls12377G2) IsIdentity ¶
func (p *PointBls12377G2) IsIdentity() bool
func (*PointBls12377G2) IsNegative ¶
func (p *PointBls12377G2) IsNegative() bool
func (*PointBls12377G2) IsOnCurve ¶
func (p *PointBls12377G2) IsOnCurve() bool
func (*PointBls12377G2) MarshalBinary ¶
func (p *PointBls12377G2) MarshalBinary() ([]byte, error)
func (*PointBls12377G2) MarshalJSON ¶
func (p *PointBls12377G2) MarshalJSON() ([]byte, error)
func (*PointBls12377G2) MarshalText ¶
func (p *PointBls12377G2) MarshalText() ([]byte, error)
func (*PointBls12377G2) Modulus ¶
func (p *PointBls12377G2) Modulus() *big.Int
func (*PointBls12377G2) Mul ¶
func (p *PointBls12377G2) Mul(rhs Scalar) Point
func (*PointBls12377G2) MultiPairing ¶
func (p *PointBls12377G2) MultiPairing(points ...PairingPoint) Scalar
func (*PointBls12377G2) Neg ¶
func (p *PointBls12377G2) Neg() Point
func (*PointBls12377G2) OtherGroup ¶
func (p *PointBls12377G2) OtherGroup() PairingPoint
func (*PointBls12377G2) Pairing ¶
func (p *PointBls12377G2) Pairing(rhs PairingPoint) Scalar
func (*PointBls12377G2) Scalar ¶
func (p *PointBls12377G2) Scalar() Scalar
func (*PointBls12377G2) Sub ¶
func (p *PointBls12377G2) Sub(rhs Point) Point
func (*PointBls12377G2) SumOfProducts ¶
func (p *PointBls12377G2) SumOfProducts(points []Point, scalars []Scalar) Point
func (*PointBls12377G2) ToAffineCompressed ¶
func (p *PointBls12377G2) ToAffineCompressed() []byte
func (*PointBls12377G2) ToAffineUncompressed ¶
func (p *PointBls12377G2) ToAffineUncompressed() []byte
func (*PointBls12377G2) UnmarshalBinary ¶
func (p *PointBls12377G2) UnmarshalBinary(input []byte) error
func (*PointBls12377G2) UnmarshalJSON ¶
func (p *PointBls12377G2) UnmarshalJSON(input []byte) error
func (*PointBls12377G2) UnmarshalText ¶
func (p *PointBls12377G2) UnmarshalText(input []byte) error
func (*PointBls12377G2) X ¶
func (p *PointBls12377G2) X() *big.Int
func (*PointBls12377G2) Y ¶
func (p *PointBls12377G2) Y() *big.Int
type PointBls12381G1 ¶
func (*PointBls12381G1) Add ¶
func (p *PointBls12381G1) Add(rhs Point) Point
func (*PointBls12381G1) CurveName ¶
func (p *PointBls12381G1) CurveName() string
func (*PointBls12381G1) Double ¶
func (p *PointBls12381G1) Double() Point
func (*PointBls12381G1) Equal ¶
func (p *PointBls12381G1) Equal(rhs Point) bool
func (*PointBls12381G1) FromAffineCompressed ¶
func (p *PointBls12381G1) FromAffineCompressed(bytes []byte) (Point, error)
func (*PointBls12381G1) FromAffineUncompressed ¶
func (p *PointBls12381G1) FromAffineUncompressed(bytes []byte) (Point, error)
func (*PointBls12381G1) Generator ¶
func (p *PointBls12381G1) Generator() Point
func (*PointBls12381G1) Hash ¶
func (p *PointBls12381G1) Hash(bytes []byte) Point
func (*PointBls12381G1) Identity ¶
func (p *PointBls12381G1) Identity() Point
func (*PointBls12381G1) IsIdentity ¶
func (p *PointBls12381G1) IsIdentity() bool
func (*PointBls12381G1) IsNegative ¶
func (p *PointBls12381G1) IsNegative() bool
func (*PointBls12381G1) IsOnCurve ¶
func (p *PointBls12381G1) IsOnCurve() bool
func (*PointBls12381G1) MarshalBinary ¶
func (p *PointBls12381G1) MarshalBinary() ([]byte, error)
func (*PointBls12381G1) MarshalJSON ¶
func (p *PointBls12381G1) MarshalJSON() ([]byte, error)
func (*PointBls12381G1) MarshalText ¶
func (p *PointBls12381G1) MarshalText() ([]byte, error)
func (*PointBls12381G1) Modulus ¶
func (p *PointBls12381G1) Modulus() *big.Int
func (*PointBls12381G1) Mul ¶
func (p *PointBls12381G1) Mul(rhs Scalar) Point
func (*PointBls12381G1) MultiPairing ¶
func (p *PointBls12381G1) MultiPairing(points ...PairingPoint) Scalar
func (*PointBls12381G1) Neg ¶
func (p *PointBls12381G1) Neg() Point
func (*PointBls12381G1) OtherGroup ¶
func (p *PointBls12381G1) OtherGroup() PairingPoint
func (*PointBls12381G1) Pairing ¶
func (p *PointBls12381G1) Pairing(rhs PairingPoint) Scalar
func (*PointBls12381G1) Scalar ¶
func (p *PointBls12381G1) Scalar() Scalar
func (*PointBls12381G1) Sub ¶
func (p *PointBls12381G1) Sub(rhs Point) Point
func (*PointBls12381G1) SumOfProducts ¶
func (p *PointBls12381G1) SumOfProducts(points []Point, scalars []Scalar) Point
func (*PointBls12381G1) ToAffineCompressed ¶
func (p *PointBls12381G1) ToAffineCompressed() []byte
func (*PointBls12381G1) ToAffineUncompressed ¶
func (p *PointBls12381G1) ToAffineUncompressed() []byte
func (*PointBls12381G1) UnmarshalBinary ¶
func (p *PointBls12381G1) UnmarshalBinary(input []byte) error
func (*PointBls12381G1) UnmarshalJSON ¶
func (p *PointBls12381G1) UnmarshalJSON(input []byte) error
func (*PointBls12381G1) UnmarshalText ¶
func (p *PointBls12381G1) UnmarshalText(input []byte) error
func (*PointBls12381G1) X ¶
func (p *PointBls12381G1) X() *big.Int
func (*PointBls12381G1) Y ¶
func (p *PointBls12381G1) Y() *big.Int
type PointBls12381G2 ¶
func (*PointBls12381G2) Add ¶
func (p *PointBls12381G2) Add(rhs Point) Point
func (*PointBls12381G2) CurveName ¶
func (p *PointBls12381G2) CurveName() string
func (*PointBls12381G2) Double ¶
func (p *PointBls12381G2) Double() Point
func (*PointBls12381G2) Equal ¶
func (p *PointBls12381G2) Equal(rhs Point) bool
func (*PointBls12381G2) FromAffineCompressed ¶
func (p *PointBls12381G2) FromAffineCompressed(bytes []byte) (Point, error)
func (*PointBls12381G2) FromAffineUncompressed ¶
func (p *PointBls12381G2) FromAffineUncompressed(bytes []byte) (Point, error)
func (*PointBls12381G2) Generator ¶
func (p *PointBls12381G2) Generator() Point
func (*PointBls12381G2) Hash ¶
func (p *PointBls12381G2) Hash(bytes []byte) Point
func (*PointBls12381G2) Identity ¶
func (p *PointBls12381G2) Identity() Point
func (*PointBls12381G2) IsIdentity ¶
func (p *PointBls12381G2) IsIdentity() bool
func (*PointBls12381G2) IsNegative ¶
func (p *PointBls12381G2) IsNegative() bool
func (*PointBls12381G2) IsOnCurve ¶
func (p *PointBls12381G2) IsOnCurve() bool
func (*PointBls12381G2) MarshalBinary ¶
func (p *PointBls12381G2) MarshalBinary() ([]byte, error)
func (*PointBls12381G2) MarshalJSON ¶
func (p *PointBls12381G2) MarshalJSON() ([]byte, error)
func (*PointBls12381G2) MarshalText ¶
func (p *PointBls12381G2) MarshalText() ([]byte, error)
func (*PointBls12381G2) Modulus ¶
func (p *PointBls12381G2) Modulus() *big.Int
func (*PointBls12381G2) Mul ¶
func (p *PointBls12381G2) Mul(rhs Scalar) Point
func (*PointBls12381G2) MultiPairing ¶
func (p *PointBls12381G2) MultiPairing(points ...PairingPoint) Scalar
func (*PointBls12381G2) Neg ¶
func (p *PointBls12381G2) Neg() Point
func (*PointBls12381G2) OtherGroup ¶
func (p *PointBls12381G2) OtherGroup() PairingPoint
func (*PointBls12381G2) Pairing ¶
func (p *PointBls12381G2) Pairing(rhs PairingPoint) Scalar
func (*PointBls12381G2) Scalar ¶
func (p *PointBls12381G2) Scalar() Scalar
func (*PointBls12381G2) Sub ¶
func (p *PointBls12381G2) Sub(rhs Point) Point
func (*PointBls12381G2) SumOfProducts ¶
func (p *PointBls12381G2) SumOfProducts(points []Point, scalars []Scalar) Point
func (*PointBls12381G2) ToAffineCompressed ¶
func (p *PointBls12381G2) ToAffineCompressed() []byte
func (*PointBls12381G2) ToAffineUncompressed ¶
func (p *PointBls12381G2) ToAffineUncompressed() []byte
func (*PointBls12381G2) UnmarshalBinary ¶
func (p *PointBls12381G2) UnmarshalBinary(input []byte) error
func (*PointBls12381G2) UnmarshalJSON ¶
func (p *PointBls12381G2) UnmarshalJSON(input []byte) error
func (*PointBls12381G2) UnmarshalText ¶
func (p *PointBls12381G2) UnmarshalText(input []byte) error
func (*PointBls12381G2) X ¶
func (p *PointBls12381G2) X() *big.Int
func (*PointBls12381G2) Y ¶
func (p *PointBls12381G2) Y() *big.Int
type PointEd25519 ¶
type PointEd25519 struct {
// contains filtered or unexported fields
}
func (*PointEd25519) Add ¶
func (p *PointEd25519) Add(rhs Point) Point
func (*PointEd25519) CurveName ¶
func (p *PointEd25519) CurveName() string
func (*PointEd25519) Double ¶
func (p *PointEd25519) Double() Point
func (*PointEd25519) Equal ¶
func (p *PointEd25519) Equal(rhs Point) bool
func (*PointEd25519) FromAffineCompressed ¶
func (p *PointEd25519) FromAffineCompressed(inBytes []byte) (Point, error)
func (*PointEd25519) FromAffineUncompressed ¶
func (p *PointEd25519) FromAffineUncompressed(inBytes []byte) (Point, error)
func (*PointEd25519) Generator ¶
func (p *PointEd25519) Generator() Point
func (*PointEd25519) GetEdwardsPoint ¶
func (p *PointEd25519) GetEdwardsPoint() *edwards25519.Point
func (*PointEd25519) Hash ¶
func (p *PointEd25519) Hash(bytes []byte) Point
func (*PointEd25519) Identity ¶
func (p *PointEd25519) Identity() Point
func (*PointEd25519) IsIdentity ¶
func (p *PointEd25519) IsIdentity() bool
func (*PointEd25519) IsNegative ¶
func (p *PointEd25519) IsNegative() bool
func (*PointEd25519) IsOnCurve ¶
func (p *PointEd25519) IsOnCurve() bool
func (*PointEd25519) MangleScalarBitsAndMulByBasepointToProducePublicKey ¶
func (p *PointEd25519) MangleScalarBitsAndMulByBasepointToProducePublicKey(rhs *ScalarEd25519) *PointEd25519
MangleScalarBitsAndMulByBasepointToProducePublicKey is a function for mangling the bits of a (formerly mathematically well-defined) "scalar" and multiplying it to produce a public key.
func (*PointEd25519) MarshalBinary ¶
func (p *PointEd25519) MarshalBinary() ([]byte, error)
func (*PointEd25519) MarshalJSON ¶
func (p *PointEd25519) MarshalJSON() ([]byte, error)
func (*PointEd25519) MarshalText ¶
func (p *PointEd25519) MarshalText() ([]byte, error)
func (*PointEd25519) Mul ¶
func (p *PointEd25519) Mul(rhs Scalar) Point
func (*PointEd25519) Neg ¶
func (p *PointEd25519) Neg() Point
func (*PointEd25519) Scalar ¶
func (p *PointEd25519) Scalar() Scalar
func (*PointEd25519) SetEdwardsPoint ¶
func (p *PointEd25519) SetEdwardsPoint(pt *edwards25519.Point) *PointEd25519
func (*PointEd25519) Sub ¶
func (p *PointEd25519) Sub(rhs Point) Point
func (*PointEd25519) SumOfProducts ¶
func (p *PointEd25519) SumOfProducts(points []Point, scalars []Scalar) Point
func (*PointEd25519) ToAffineCompressed ¶
func (p *PointEd25519) ToAffineCompressed() []byte
func (*PointEd25519) ToAffineUncompressed ¶
func (p *PointEd25519) ToAffineUncompressed() []byte
func (*PointEd25519) UnmarshalBinary ¶
func (p *PointEd25519) UnmarshalBinary(input []byte) error
func (*PointEd25519) UnmarshalJSON ¶
func (p *PointEd25519) UnmarshalJSON(input []byte) error
func (*PointEd25519) UnmarshalText ¶
func (p *PointEd25519) UnmarshalText(input []byte) error
func (*PointEd25519) VarTimeDoubleScalarBaseMult ¶
func (p *PointEd25519) VarTimeDoubleScalarBaseMult(a Scalar, A Point, b Scalar) Point
type PointK256 ¶
type PointK256 struct {
// contains filtered or unexported fields
}
func (*PointK256) FromAffineCompressed ¶
func (*PointK256) FromAffineUncompressed ¶
func (*PointK256) IsIdentity ¶
func (*PointK256) IsNegative ¶
func (*PointK256) MarshalBinary ¶
func (*PointK256) MarshalJSON ¶
func (*PointK256) MarshalText ¶
func (*PointK256) Params ¶
func (p *PointK256) Params() *elliptic.CurveParams
func (*PointK256) SumOfProducts ¶
func (*PointK256) ToAffineCompressed ¶
func (*PointK256) ToAffineUncompressed ¶
func (*PointK256) UnmarshalBinary ¶
func (*PointK256) UnmarshalJSON ¶
func (*PointK256) UnmarshalText ¶
type PointP256 ¶
type PointP256 struct {
// contains filtered or unexported fields
}
func (*PointP256) FromAffineCompressed ¶
func (*PointP256) FromAffineUncompressed ¶
func (*PointP256) IsIdentity ¶
func (*PointP256) IsNegative ¶
func (*PointP256) MarshalBinary ¶
func (*PointP256) MarshalJSON ¶
func (*PointP256) MarshalText ¶
func (*PointP256) Params ¶
func (p *PointP256) Params() *elliptic.CurveParams
func (*PointP256) SumOfProducts ¶
func (*PointP256) ToAffineCompressed ¶
func (*PointP256) ToAffineUncompressed ¶
func (*PointP256) UnmarshalBinary ¶
func (*PointP256) UnmarshalJSON ¶
func (*PointP256) UnmarshalText ¶
type PointPallas ¶
type PointPallas struct {
// contains filtered or unexported fields
}
func (*PointPallas) Add ¶
func (p *PointPallas) Add(rhs Point) Point
func (*PointPallas) CurveName ¶
func (p *PointPallas) CurveName() string
func (*PointPallas) Double ¶
func (p *PointPallas) Double() Point
func (*PointPallas) Equal ¶
func (p *PointPallas) Equal(rhs Point) bool
func (*PointPallas) FromAffineCompressed ¶
func (p *PointPallas) FromAffineCompressed(bytes []byte) (Point, error)
func (*PointPallas) FromAffineUncompressed ¶
func (p *PointPallas) FromAffineUncompressed(bytes []byte) (Point, error)
func (*PointPallas) Generator ¶
func (p *PointPallas) Generator() Point
func (*PointPallas) GetEp ¶
func (p *PointPallas) GetEp() *Ep
func (*PointPallas) Hash ¶
func (p *PointPallas) Hash(bytes []byte) Point
func (*PointPallas) Identity ¶
func (p *PointPallas) Identity() Point
func (*PointPallas) IsIdentity ¶
func (p *PointPallas) IsIdentity() bool
func (*PointPallas) IsNegative ¶
func (p *PointPallas) IsNegative() bool
func (*PointPallas) IsOnCurve ¶
func (p *PointPallas) IsOnCurve() bool
func (*PointPallas) MarshalBinary ¶
func (p *PointPallas) MarshalBinary() ([]byte, error)
func (*PointPallas) MarshalJSON ¶
func (p *PointPallas) MarshalJSON() ([]byte, error)
func (*PointPallas) MarshalText ¶
func (p *PointPallas) MarshalText() ([]byte, error)
func (*PointPallas) Mul ¶
func (p *PointPallas) Mul(rhs Scalar) Point
func (*PointPallas) Neg ¶
func (p *PointPallas) Neg() Point
func (*PointPallas) Scalar ¶
func (p *PointPallas) Scalar() Scalar
func (*PointPallas) Sub ¶
func (p *PointPallas) Sub(rhs Point) Point
func (*PointPallas) SumOfProducts ¶
func (p *PointPallas) SumOfProducts(points []Point, scalars []Scalar) Point
func (*PointPallas) ToAffineCompressed ¶
func (p *PointPallas) ToAffineCompressed() []byte
func (*PointPallas) ToAffineUncompressed ¶
func (p *PointPallas) ToAffineUncompressed() []byte
func (*PointPallas) UnmarshalBinary ¶
func (p *PointPallas) UnmarshalBinary(input []byte) error
func (*PointPallas) UnmarshalJSON ¶
func (p *PointPallas) UnmarshalJSON(input []byte) error
func (*PointPallas) UnmarshalText ¶
func (p *PointPallas) UnmarshalText(input []byte) error
func (*PointPallas) X ¶
func (p *PointPallas) X() *fp.Fp
func (*PointPallas) Y ¶
func (p *PointPallas) Y() *fp.Fp
type Scalar ¶
type Scalar interface { // Random returns a random scalar using the provided reader // to retrieve bytes Random(reader io.Reader) Scalar // Hash the specific bytes in a manner to yield a // uniformly distributed scalar Hash(bytes []byte) Scalar // Zero returns the additive identity element Zero() Scalar // One returns the multiplicative identity element One() Scalar // IsZero returns true if this element is the additive identity element IsZero() bool // IsOne returns true if this element is the multiplicative identity element IsOne() bool // IsOdd returns true if this element is odd IsOdd() bool // IsEven returns true if this element is even IsEven() bool // New returns an element with the value equal to `value` New(value int) Scalar // Cmp returns // -2 if this element is in a different field than rhs // -1 if this element is less than rhs // 0 if this element is equal to rhs // 1 if this element is greater than rhs Cmp(rhs Scalar) int // Square returns element*element Square() Scalar // Double returns element+element Double() Scalar // Invert returns element^-1 mod p Invert() (Scalar, error) // Sqrt computes the square root of this element if it exists. Sqrt() (Scalar, error) // Cube returns element*element*element Cube() Scalar // Add returns element+rhs Add(rhs Scalar) Scalar // Sub returns element-rhs Sub(rhs Scalar) Scalar // Mul returns element*rhs Mul(rhs Scalar) Scalar // MulAdd returns element * y + z mod p MulAdd(y, z Scalar) Scalar // Div returns element*rhs^-1 mod p Div(rhs Scalar) Scalar // Neg returns -element mod p Neg() Scalar // SetBigInt returns this element set to the value of v SetBigInt(v *big.Int) (Scalar, error) // BigInt returns this element as a big integer BigInt() *big.Int // Point returns the associated point for this scalar Point() Point // Bytes returns the canonical byte representation of this scalar Bytes() []byte // SetBytes creates a scalar from the canonical representation expecting the exact number of bytes needed to represent the scalar SetBytes(bytes []byte) (Scalar, error) // SetBytesWide creates a scalar expecting double the exact number of bytes needed to represent the scalar which is reduced by the modulus SetBytesWide(bytes []byte) (Scalar, error) // Clone returns a cloned Scalar of this value Clone() Scalar }
Scalar represents an element of the scalar field \mathbb{F}_q of the elliptic curve construction.
type ScalarBls12377 ¶
type ScalarBls12377 struct {
// contains filtered or unexported fields
}
func (*ScalarBls12377) Add ¶
func (s *ScalarBls12377) Add(rhs Scalar) Scalar
func (*ScalarBls12377) BigInt ¶
func (s *ScalarBls12377) BigInt() *big.Int
func (*ScalarBls12377) Bytes ¶
func (s *ScalarBls12377) Bytes() []byte
func (*ScalarBls12377) Clone ¶
func (s *ScalarBls12377) Clone() Scalar
func (*ScalarBls12377) Cmp ¶
func (s *ScalarBls12377) Cmp(rhs Scalar) int
func (*ScalarBls12377) Cube ¶
func (s *ScalarBls12377) Cube() Scalar
func (*ScalarBls12377) Div ¶
func (s *ScalarBls12377) Div(rhs Scalar) Scalar
func (*ScalarBls12377) Double ¶
func (s *ScalarBls12377) Double() Scalar
func (*ScalarBls12377) Hash ¶
func (s *ScalarBls12377) Hash(bytes []byte) Scalar
func (*ScalarBls12377) Invert ¶
func (s *ScalarBls12377) Invert() (Scalar, error)
func (*ScalarBls12377) IsEven ¶
func (s *ScalarBls12377) IsEven() bool
func (*ScalarBls12377) IsOdd ¶
func (s *ScalarBls12377) IsOdd() bool
func (*ScalarBls12377) IsOne ¶
func (s *ScalarBls12377) IsOne() bool
func (*ScalarBls12377) IsZero ¶
func (s *ScalarBls12377) IsZero() bool
func (*ScalarBls12377) MarshalBinary ¶
func (s *ScalarBls12377) MarshalBinary() ([]byte, error)
func (*ScalarBls12377) MarshalJSON ¶
func (s *ScalarBls12377) MarshalJSON() ([]byte, error)
func (*ScalarBls12377) MarshalText ¶
func (s *ScalarBls12377) MarshalText() ([]byte, error)
func (*ScalarBls12377) Mul ¶
func (s *ScalarBls12377) Mul(rhs Scalar) Scalar
func (*ScalarBls12377) MulAdd ¶
func (s *ScalarBls12377) MulAdd(y, z Scalar) Scalar
func (*ScalarBls12377) Neg ¶
func (s *ScalarBls12377) Neg() Scalar
func (*ScalarBls12377) New ¶
func (s *ScalarBls12377) New(value int) Scalar
func (*ScalarBls12377) One ¶
func (s *ScalarBls12377) One() Scalar
func (*ScalarBls12377) Order ¶
func (s *ScalarBls12377) Order() *big.Int
func (*ScalarBls12377) Point ¶
func (s *ScalarBls12377) Point() Point
func (*ScalarBls12377) SetBytesWide ¶
func (s *ScalarBls12377) SetBytesWide(bytes []byte) (Scalar, error)
func (*ScalarBls12377) SetPoint ¶
func (s *ScalarBls12377) SetPoint(p Point) PairingScalar
func (*ScalarBls12377) Sqrt ¶
func (s *ScalarBls12377) Sqrt() (Scalar, error)
func (*ScalarBls12377) Square ¶
func (s *ScalarBls12377) Square() Scalar
func (*ScalarBls12377) Sub ¶
func (s *ScalarBls12377) Sub(rhs Scalar) Scalar
func (*ScalarBls12377) UnmarshalBinary ¶
func (s *ScalarBls12377) UnmarshalBinary(input []byte) error
func (*ScalarBls12377) UnmarshalJSON ¶
func (s *ScalarBls12377) UnmarshalJSON(input []byte) error
func (*ScalarBls12377) UnmarshalText ¶
func (s *ScalarBls12377) UnmarshalText(input []byte) error
func (*ScalarBls12377) Zero ¶
func (s *ScalarBls12377) Zero() Scalar
type ScalarBls12377Gt ¶
type ScalarBls12377Gt struct {
// contains filtered or unexported fields
}
func (*ScalarBls12377Gt) Add ¶
func (s *ScalarBls12377Gt) Add(rhs Scalar) Scalar
func (*ScalarBls12377Gt) BigInt ¶
func (s *ScalarBls12377Gt) BigInt() *big.Int
func (*ScalarBls12377Gt) Bytes ¶
func (s *ScalarBls12377Gt) Bytes() []byte
func (*ScalarBls12377Gt) Clone ¶
func (s *ScalarBls12377Gt) Clone() Scalar
func (*ScalarBls12377Gt) Cmp ¶
func (s *ScalarBls12377Gt) Cmp(rhs Scalar) int
func (*ScalarBls12377Gt) Cube ¶
func (s *ScalarBls12377Gt) Cube() Scalar
func (*ScalarBls12377Gt) Div ¶
func (s *ScalarBls12377Gt) Div(rhs Scalar) Scalar
func (*ScalarBls12377Gt) Double ¶
func (s *ScalarBls12377Gt) Double() Scalar
func (*ScalarBls12377Gt) Hash ¶
func (s *ScalarBls12377Gt) Hash(bytes []byte) Scalar
func (*ScalarBls12377Gt) Invert ¶
func (s *ScalarBls12377Gt) Invert() (Scalar, error)
func (*ScalarBls12377Gt) IsEven ¶
func (s *ScalarBls12377Gt) IsEven() bool
func (*ScalarBls12377Gt) IsOdd ¶
func (s *ScalarBls12377Gt) IsOdd() bool
func (*ScalarBls12377Gt) IsOne ¶
func (s *ScalarBls12377Gt) IsOne() bool
func (*ScalarBls12377Gt) IsZero ¶
func (s *ScalarBls12377Gt) IsZero() bool
func (*ScalarBls12377Gt) MarshalBinary ¶
func (s *ScalarBls12377Gt) MarshalBinary() ([]byte, error)
func (*ScalarBls12377Gt) MarshalJSON ¶
func (s *ScalarBls12377Gt) MarshalJSON() ([]byte, error)
func (*ScalarBls12377Gt) MarshalText ¶
func (s *ScalarBls12377Gt) MarshalText() ([]byte, error)
func (*ScalarBls12377Gt) Mul ¶
func (s *ScalarBls12377Gt) Mul(rhs Scalar) Scalar
func (*ScalarBls12377Gt) MulAdd ¶
func (s *ScalarBls12377Gt) MulAdd(y, z Scalar) Scalar
func (*ScalarBls12377Gt) Neg ¶
func (s *ScalarBls12377Gt) Neg() Scalar
func (*ScalarBls12377Gt) New ¶
func (s *ScalarBls12377Gt) New(input int) Scalar
func (*ScalarBls12377Gt) One ¶
func (s *ScalarBls12377Gt) One() Scalar
func (*ScalarBls12377Gt) Point ¶
func (s *ScalarBls12377Gt) Point() Point
func (*ScalarBls12377Gt) SetBigInt ¶
func (s *ScalarBls12377Gt) SetBigInt(v *big.Int) (Scalar, error)
func (*ScalarBls12377Gt) SetBytes ¶
func (s *ScalarBls12377Gt) SetBytes(bytes []byte) (Scalar, error)
func (*ScalarBls12377Gt) SetBytesWide ¶
func (s *ScalarBls12377Gt) SetBytesWide(bytes []byte) (Scalar, error)
func (*ScalarBls12377Gt) Sqrt ¶
func (s *ScalarBls12377Gt) Sqrt() (Scalar, error)
func (*ScalarBls12377Gt) Square ¶
func (s *ScalarBls12377Gt) Square() Scalar
func (*ScalarBls12377Gt) Sub ¶
func (s *ScalarBls12377Gt) Sub(rhs Scalar) Scalar
func (*ScalarBls12377Gt) UnmarshalBinary ¶
func (s *ScalarBls12377Gt) UnmarshalBinary(input []byte) error
func (*ScalarBls12377Gt) UnmarshalJSON ¶
func (s *ScalarBls12377Gt) UnmarshalJSON(input []byte) error
func (*ScalarBls12377Gt) UnmarshalText ¶
func (s *ScalarBls12377Gt) UnmarshalText(input []byte) error
func (*ScalarBls12377Gt) Zero ¶
func (s *ScalarBls12377Gt) Zero() Scalar
type ScalarBls12381 ¶
func (*ScalarBls12381) Add ¶
func (s *ScalarBls12381) Add(rhs Scalar) Scalar
func (*ScalarBls12381) BigInt ¶
func (s *ScalarBls12381) BigInt() *big.Int
func (*ScalarBls12381) Bytes ¶
func (s *ScalarBls12381) Bytes() []byte
func (*ScalarBls12381) Clone ¶
func (s *ScalarBls12381) Clone() Scalar
func (*ScalarBls12381) Cmp ¶
func (s *ScalarBls12381) Cmp(rhs Scalar) int
func (*ScalarBls12381) Cube ¶
func (s *ScalarBls12381) Cube() Scalar
func (*ScalarBls12381) Div ¶
func (s *ScalarBls12381) Div(rhs Scalar) Scalar
func (*ScalarBls12381) Double ¶
func (s *ScalarBls12381) Double() Scalar
func (*ScalarBls12381) Hash ¶
func (s *ScalarBls12381) Hash(bytes []byte) Scalar
func (*ScalarBls12381) Invert ¶
func (s *ScalarBls12381) Invert() (Scalar, error)
func (*ScalarBls12381) IsEven ¶
func (s *ScalarBls12381) IsEven() bool
func (*ScalarBls12381) IsOdd ¶
func (s *ScalarBls12381) IsOdd() bool
func (*ScalarBls12381) IsOne ¶
func (s *ScalarBls12381) IsOne() bool
func (*ScalarBls12381) IsZero ¶
func (s *ScalarBls12381) IsZero() bool
func (*ScalarBls12381) MarshalBinary ¶
func (s *ScalarBls12381) MarshalBinary() ([]byte, error)
func (*ScalarBls12381) MarshalJSON ¶
func (s *ScalarBls12381) MarshalJSON() ([]byte, error)
func (*ScalarBls12381) MarshalText ¶
func (s *ScalarBls12381) MarshalText() ([]byte, error)
func (*ScalarBls12381) Mul ¶
func (s *ScalarBls12381) Mul(rhs Scalar) Scalar
func (*ScalarBls12381) MulAdd ¶
func (s *ScalarBls12381) MulAdd(y, z Scalar) Scalar
func (*ScalarBls12381) Neg ¶
func (s *ScalarBls12381) Neg() Scalar
func (*ScalarBls12381) New ¶
func (s *ScalarBls12381) New(value int) Scalar
func (*ScalarBls12381) One ¶
func (s *ScalarBls12381) One() Scalar
func (*ScalarBls12381) Order ¶
func (s *ScalarBls12381) Order() *big.Int
func (*ScalarBls12381) Point ¶
func (s *ScalarBls12381) Point() Point
func (*ScalarBls12381) SetBytesWide ¶
func (s *ScalarBls12381) SetBytesWide(bytes []byte) (Scalar, error)
func (*ScalarBls12381) SetPoint ¶
func (s *ScalarBls12381) SetPoint(p Point) PairingScalar
func (*ScalarBls12381) Sqrt ¶
func (s *ScalarBls12381) Sqrt() (Scalar, error)
func (*ScalarBls12381) Square ¶
func (s *ScalarBls12381) Square() Scalar
func (*ScalarBls12381) Sub ¶
func (s *ScalarBls12381) Sub(rhs Scalar) Scalar
func (*ScalarBls12381) UnmarshalBinary ¶
func (s *ScalarBls12381) UnmarshalBinary(input []byte) error
func (*ScalarBls12381) UnmarshalJSON ¶
func (s *ScalarBls12381) UnmarshalJSON(input []byte) error
func (*ScalarBls12381) UnmarshalText ¶
func (s *ScalarBls12381) UnmarshalText(input []byte) error
func (*ScalarBls12381) Zero ¶
func (s *ScalarBls12381) Zero() Scalar
type ScalarBls12381Gt ¶
func (*ScalarBls12381Gt) Add ¶
func (s *ScalarBls12381Gt) Add(rhs Scalar) Scalar
func (*ScalarBls12381Gt) BigInt ¶
func (s *ScalarBls12381Gt) BigInt() *big.Int
func (*ScalarBls12381Gt) Bytes ¶
func (s *ScalarBls12381Gt) Bytes() []byte
func (*ScalarBls12381Gt) Clone ¶
func (s *ScalarBls12381Gt) Clone() Scalar
func (*ScalarBls12381Gt) Cmp ¶
func (s *ScalarBls12381Gt) Cmp(rhs Scalar) int
func (*ScalarBls12381Gt) Cube ¶
func (s *ScalarBls12381Gt) Cube() Scalar
func (*ScalarBls12381Gt) Div ¶
func (s *ScalarBls12381Gt) Div(rhs Scalar) Scalar
func (*ScalarBls12381Gt) Double ¶
func (s *ScalarBls12381Gt) Double() Scalar
func (*ScalarBls12381Gt) Hash ¶
func (s *ScalarBls12381Gt) Hash(bytes []byte) Scalar
func (*ScalarBls12381Gt) Invert ¶
func (s *ScalarBls12381Gt) Invert() (Scalar, error)
func (*ScalarBls12381Gt) IsEven ¶
func (s *ScalarBls12381Gt) IsEven() bool
func (*ScalarBls12381Gt) IsOdd ¶
func (s *ScalarBls12381Gt) IsOdd() bool
func (*ScalarBls12381Gt) IsOne ¶
func (s *ScalarBls12381Gt) IsOne() bool
func (*ScalarBls12381Gt) IsZero ¶
func (s *ScalarBls12381Gt) IsZero() bool
func (*ScalarBls12381Gt) MarshalBinary ¶
func (s *ScalarBls12381Gt) MarshalBinary() ([]byte, error)
func (*ScalarBls12381Gt) MarshalJSON ¶
func (s *ScalarBls12381Gt) MarshalJSON() ([]byte, error)
func (*ScalarBls12381Gt) MarshalText ¶
func (s *ScalarBls12381Gt) MarshalText() ([]byte, error)
func (*ScalarBls12381Gt) Mul ¶
func (s *ScalarBls12381Gt) Mul(rhs Scalar) Scalar
func (*ScalarBls12381Gt) MulAdd ¶
func (s *ScalarBls12381Gt) MulAdd(y, z Scalar) Scalar
func (*ScalarBls12381Gt) Neg ¶
func (s *ScalarBls12381Gt) Neg() Scalar
func (*ScalarBls12381Gt) New ¶
func (s *ScalarBls12381Gt) New(input int) Scalar
func (*ScalarBls12381Gt) One ¶
func (s *ScalarBls12381Gt) One() Scalar
func (*ScalarBls12381Gt) Point ¶
func (s *ScalarBls12381Gt) Point() Point
func (*ScalarBls12381Gt) SetBigInt ¶
func (s *ScalarBls12381Gt) SetBigInt(v *big.Int) (Scalar, error)
func (*ScalarBls12381Gt) SetBytes ¶
func (s *ScalarBls12381Gt) SetBytes(bytes []byte) (Scalar, error)
func (*ScalarBls12381Gt) SetBytesWide ¶
func (s *ScalarBls12381Gt) SetBytesWide(bytes []byte) (Scalar, error)
func (*ScalarBls12381Gt) Sqrt ¶
func (s *ScalarBls12381Gt) Sqrt() (Scalar, error)
func (*ScalarBls12381Gt) Square ¶
func (s *ScalarBls12381Gt) Square() Scalar
func (*ScalarBls12381Gt) Sub ¶
func (s *ScalarBls12381Gt) Sub(rhs Scalar) Scalar
func (*ScalarBls12381Gt) UnmarshalBinary ¶
func (s *ScalarBls12381Gt) UnmarshalBinary(input []byte) error
func (*ScalarBls12381Gt) UnmarshalJSON ¶
func (s *ScalarBls12381Gt) UnmarshalJSON(input []byte) error
func (*ScalarBls12381Gt) UnmarshalText ¶
func (s *ScalarBls12381Gt) UnmarshalText(input []byte) error
func (*ScalarBls12381Gt) Zero ¶
func (s *ScalarBls12381Gt) Zero() Scalar
type ScalarEd25519 ¶
type ScalarEd25519 struct {
// contains filtered or unexported fields
}
func (*ScalarEd25519) Add ¶
func (s *ScalarEd25519) Add(rhs Scalar) Scalar
func (*ScalarEd25519) BigInt ¶
func (s *ScalarEd25519) BigInt() *big.Int
func (*ScalarEd25519) Bytes ¶
func (s *ScalarEd25519) Bytes() []byte
func (*ScalarEd25519) Clone ¶
func (s *ScalarEd25519) Clone() Scalar
func (*ScalarEd25519) Cmp ¶
func (s *ScalarEd25519) Cmp(rhs Scalar) int
func (*ScalarEd25519) Cube ¶
func (s *ScalarEd25519) Cube() Scalar
func (*ScalarEd25519) Div ¶
func (s *ScalarEd25519) Div(rhs Scalar) Scalar
func (*ScalarEd25519) Double ¶
func (s *ScalarEd25519) Double() Scalar
func (*ScalarEd25519) GetEdwardsScalar ¶
func (s *ScalarEd25519) GetEdwardsScalar() *edwards25519.Scalar
func (*ScalarEd25519) Hash ¶
func (s *ScalarEd25519) Hash(bytes []byte) Scalar
func (*ScalarEd25519) Invert ¶
func (s *ScalarEd25519) Invert() (Scalar, error)
func (*ScalarEd25519) IsEven ¶
func (s *ScalarEd25519) IsEven() bool
func (*ScalarEd25519) IsOdd ¶
func (s *ScalarEd25519) IsOdd() bool
func (*ScalarEd25519) IsOne ¶
func (s *ScalarEd25519) IsOne() bool
func (*ScalarEd25519) IsZero ¶
func (s *ScalarEd25519) IsZero() bool
func (*ScalarEd25519) MarshalBinary ¶
func (s *ScalarEd25519) MarshalBinary() ([]byte, error)
func (*ScalarEd25519) MarshalJSON ¶
func (s *ScalarEd25519) MarshalJSON() ([]byte, error)
func (*ScalarEd25519) MarshalText ¶
func (s *ScalarEd25519) MarshalText() ([]byte, error)
func (*ScalarEd25519) Mul ¶
func (s *ScalarEd25519) Mul(rhs Scalar) Scalar
func (*ScalarEd25519) MulAdd ¶
func (s *ScalarEd25519) MulAdd(y, z Scalar) Scalar
func (*ScalarEd25519) Neg ¶
func (s *ScalarEd25519) Neg() Scalar
func (*ScalarEd25519) New ¶
func (s *ScalarEd25519) New(input int) Scalar
func (*ScalarEd25519) One ¶
func (s *ScalarEd25519) One() Scalar
func (*ScalarEd25519) Point ¶
func (s *ScalarEd25519) Point() Point
func (*ScalarEd25519) SetBytes ¶
func (s *ScalarEd25519) SetBytes(input []byte) (Scalar, error)
SetBytes takes input a 32-byte long array and returns a ed25519 scalar. The input must be 32-byte long and must be a reduced bytes.
func (*ScalarEd25519) SetBytesCanonical ¶
func (s *ScalarEd25519) SetBytesCanonical(bytes []byte) (Scalar, error)
SetBytesCanonical uses SetCanonicalBytes of fillipo.io/edwards25519. https://github.com/FiloSottile/edwards25519/blob/v1.0.0-rc.1/scalar.go#L98 This function takes an input x and sets s = x, where x is a 32-byte little-endian encoding of s, then it returns the corresponding ed25519 scalar. If the input is not a canonical encoding of s, it returns nil and an error.
func (*ScalarEd25519) SetBytesClamping ¶
func (s *ScalarEd25519) SetBytesClamping(bytes []byte) (Scalar, error)
SetBytesClamping uses SetBytesWithClamping of fillipo.io/edwards25519- https://github.com/FiloSottile/edwards25519/blob/v1.0.0-rc.1/scalar.go#L135 which applies the buffer pruning described in RFC 8032, Section 5.1.5 (also known as clamping) and sets bytes to the result. The input must be 32-byte long, and it is not modified. If bytes is not of the right length, SetBytesWithClamping returns nil and an error, and the receiver is unchanged.
func (*ScalarEd25519) SetBytesWide ¶
func (s *ScalarEd25519) SetBytesWide(bytes []byte) (Scalar, error)
SetBytesWide takes input a 64-byte long byte array, reduce it and return an ed25519 scalar. It uses SetUniformBytes of fillipo.io/edwards25519 - https://github.com/FiloSottile/edwards25519/blob/v1.0.0-rc.1/scalar.go#L85 If bytes is not of the right length, it returns nil and an error
func (*ScalarEd25519) SetEdwardsScalar ¶
func (s *ScalarEd25519) SetEdwardsScalar(sc *edwards25519.Scalar) *ScalarEd25519
func (*ScalarEd25519) Sqrt ¶
func (s *ScalarEd25519) Sqrt() (Scalar, error)
func (*ScalarEd25519) Square ¶
func (s *ScalarEd25519) Square() Scalar
func (*ScalarEd25519) Sub ¶
func (s *ScalarEd25519) Sub(rhs Scalar) Scalar
func (*ScalarEd25519) UnmarshalBinary ¶
func (s *ScalarEd25519) UnmarshalBinary(input []byte) error
func (*ScalarEd25519) UnmarshalJSON ¶
func (s *ScalarEd25519) UnmarshalJSON(input []byte) error
func (*ScalarEd25519) UnmarshalText ¶
func (s *ScalarEd25519) UnmarshalText(input []byte) error
func (*ScalarEd25519) Zero ¶
func (s *ScalarEd25519) Zero() Scalar
type ScalarK256 ¶
type ScalarK256 struct {
// contains filtered or unexported fields
}
func (*ScalarK256) Add ¶
func (s *ScalarK256) Add(rhs Scalar) Scalar
func (*ScalarK256) BigInt ¶
func (s *ScalarK256) BigInt() *big.Int
func (*ScalarK256) Bytes ¶
func (s *ScalarK256) Bytes() []byte
func (*ScalarK256) Clone ¶
func (s *ScalarK256) Clone() Scalar
func (*ScalarK256) Cmp ¶
func (s *ScalarK256) Cmp(rhs Scalar) int
func (*ScalarK256) Cube ¶
func (s *ScalarK256) Cube() Scalar
func (*ScalarK256) Div ¶
func (s *ScalarK256) Div(rhs Scalar) Scalar
func (*ScalarK256) Double ¶
func (s *ScalarK256) Double() Scalar
func (*ScalarK256) Hash ¶
func (s *ScalarK256) Hash(bytes []byte) Scalar
func (*ScalarK256) Invert ¶
func (s *ScalarK256) Invert() (Scalar, error)
func (*ScalarK256) IsEven ¶
func (s *ScalarK256) IsEven() bool
func (*ScalarK256) IsOdd ¶
func (s *ScalarK256) IsOdd() bool
func (*ScalarK256) IsOne ¶
func (s *ScalarK256) IsOne() bool
func (*ScalarK256) IsZero ¶
func (s *ScalarK256) IsZero() bool
func (*ScalarK256) MarshalBinary ¶
func (s *ScalarK256) MarshalBinary() ([]byte, error)
func (*ScalarK256) MarshalJSON ¶
func (s *ScalarK256) MarshalJSON() ([]byte, error)
func (*ScalarK256) MarshalText ¶
func (s *ScalarK256) MarshalText() ([]byte, error)
func (*ScalarK256) Mul ¶
func (s *ScalarK256) Mul(rhs Scalar) Scalar
func (*ScalarK256) MulAdd ¶
func (s *ScalarK256) MulAdd(y, z Scalar) Scalar
func (*ScalarK256) Neg ¶
func (s *ScalarK256) Neg() Scalar
func (*ScalarK256) New ¶
func (s *ScalarK256) New(value int) Scalar
func (*ScalarK256) One ¶
func (s *ScalarK256) One() Scalar
func (*ScalarK256) Point ¶
func (s *ScalarK256) Point() Point
func (*ScalarK256) SetBytesWide ¶
func (s *ScalarK256) SetBytesWide(bytes []byte) (Scalar, error)
func (*ScalarK256) Sqrt ¶
func (s *ScalarK256) Sqrt() (Scalar, error)
func (*ScalarK256) Square ¶
func (s *ScalarK256) Square() Scalar
func (*ScalarK256) Sub ¶
func (s *ScalarK256) Sub(rhs Scalar) Scalar
func (*ScalarK256) UnmarshalBinary ¶
func (s *ScalarK256) UnmarshalBinary(input []byte) error
func (*ScalarK256) UnmarshalJSON ¶
func (s *ScalarK256) UnmarshalJSON(input []byte) error
func (*ScalarK256) UnmarshalText ¶
func (s *ScalarK256) UnmarshalText(input []byte) error
func (*ScalarK256) Zero ¶
func (s *ScalarK256) Zero() Scalar
type ScalarP256 ¶
type ScalarP256 struct {
// contains filtered or unexported fields
}
func (*ScalarP256) Add ¶
func (s *ScalarP256) Add(rhs Scalar) Scalar
func (*ScalarP256) BigInt ¶
func (s *ScalarP256) BigInt() *big.Int
func (*ScalarP256) Bytes ¶
func (s *ScalarP256) Bytes() []byte
func (*ScalarP256) Clone ¶
func (s *ScalarP256) Clone() Scalar
func (*ScalarP256) Cmp ¶
func (s *ScalarP256) Cmp(rhs Scalar) int
func (*ScalarP256) Cube ¶
func (s *ScalarP256) Cube() Scalar
func (*ScalarP256) Div ¶
func (s *ScalarP256) Div(rhs Scalar) Scalar
func (*ScalarP256) Double ¶
func (s *ScalarP256) Double() Scalar
func (*ScalarP256) Hash ¶
func (s *ScalarP256) Hash(bytes []byte) Scalar
func (*ScalarP256) Invert ¶
func (s *ScalarP256) Invert() (Scalar, error)
func (*ScalarP256) IsEven ¶
func (s *ScalarP256) IsEven() bool
func (*ScalarP256) IsOdd ¶
func (s *ScalarP256) IsOdd() bool
func (*ScalarP256) IsOne ¶
func (s *ScalarP256) IsOne() bool
func (*ScalarP256) IsZero ¶
func (s *ScalarP256) IsZero() bool
func (*ScalarP256) MarshalBinary ¶
func (s *ScalarP256) MarshalBinary() ([]byte, error)
func (*ScalarP256) MarshalJSON ¶
func (s *ScalarP256) MarshalJSON() ([]byte, error)
func (*ScalarP256) MarshalText ¶
func (s *ScalarP256) MarshalText() ([]byte, error)
func (*ScalarP256) Mul ¶
func (s *ScalarP256) Mul(rhs Scalar) Scalar
func (*ScalarP256) MulAdd ¶
func (s *ScalarP256) MulAdd(y, z Scalar) Scalar
func (*ScalarP256) Neg ¶
func (s *ScalarP256) Neg() Scalar
func (*ScalarP256) New ¶
func (s *ScalarP256) New(value int) Scalar
func (*ScalarP256) One ¶
func (s *ScalarP256) One() Scalar
func (*ScalarP256) Point ¶
func (s *ScalarP256) Point() Point
func (*ScalarP256) SetBytesWide ¶
func (s *ScalarP256) SetBytesWide(bytes []byte) (Scalar, error)
func (*ScalarP256) Sqrt ¶
func (s *ScalarP256) Sqrt() (Scalar, error)
func (*ScalarP256) Square ¶
func (s *ScalarP256) Square() Scalar
func (*ScalarP256) Sub ¶
func (s *ScalarP256) Sub(rhs Scalar) Scalar
func (*ScalarP256) UnmarshalBinary ¶
func (s *ScalarP256) UnmarshalBinary(input []byte) error
func (*ScalarP256) UnmarshalJSON ¶
func (s *ScalarP256) UnmarshalJSON(input []byte) error
func (*ScalarP256) UnmarshalText ¶
func (s *ScalarP256) UnmarshalText(input []byte) error
func (*ScalarP256) Zero ¶
func (s *ScalarP256) Zero() Scalar
type ScalarPallas ¶
type ScalarPallas struct {
// contains filtered or unexported fields
}
ScalarPallas - New interface
func (*ScalarPallas) Add ¶
func (s *ScalarPallas) Add(rhs Scalar) Scalar
func (*ScalarPallas) BigInt ¶
func (s *ScalarPallas) BigInt() *big.Int
func (*ScalarPallas) Bytes ¶
func (s *ScalarPallas) Bytes() []byte
func (*ScalarPallas) Clone ¶
func (s *ScalarPallas) Clone() Scalar
func (*ScalarPallas) Cmp ¶
func (s *ScalarPallas) Cmp(rhs Scalar) int
func (*ScalarPallas) Cube ¶
func (s *ScalarPallas) Cube() Scalar
func (*ScalarPallas) Div ¶
func (s *ScalarPallas) Div(rhs Scalar) Scalar
func (*ScalarPallas) Double ¶
func (s *ScalarPallas) Double() Scalar
func (*ScalarPallas) GetFq ¶
func (s *ScalarPallas) GetFq() *fq.Fq
func (*ScalarPallas) Hash ¶
func (s *ScalarPallas) Hash(bytes []byte) Scalar
func (*ScalarPallas) Invert ¶
func (s *ScalarPallas) Invert() (Scalar, error)
func (*ScalarPallas) IsEven ¶
func (s *ScalarPallas) IsEven() bool
func (*ScalarPallas) IsOdd ¶
func (s *ScalarPallas) IsOdd() bool
func (*ScalarPallas) IsOne ¶
func (s *ScalarPallas) IsOne() bool
func (*ScalarPallas) IsZero ¶
func (s *ScalarPallas) IsZero() bool
func (*ScalarPallas) MarshalBinary ¶
func (s *ScalarPallas) MarshalBinary() ([]byte, error)
func (*ScalarPallas) MarshalJSON ¶
func (s *ScalarPallas) MarshalJSON() ([]byte, error)
func (*ScalarPallas) MarshalText ¶
func (s *ScalarPallas) MarshalText() ([]byte, error)
func (*ScalarPallas) Mul ¶
func (s *ScalarPallas) Mul(rhs Scalar) Scalar
func (*ScalarPallas) MulAdd ¶
func (s *ScalarPallas) MulAdd(y, z Scalar) Scalar
func (*ScalarPallas) Neg ¶
func (s *ScalarPallas) Neg() Scalar
func (*ScalarPallas) New ¶
func (s *ScalarPallas) New(value int) Scalar
func (*ScalarPallas) One ¶
func (s *ScalarPallas) One() Scalar
func (*ScalarPallas) Point ¶
func (s *ScalarPallas) Point() Point
func (*ScalarPallas) SetBytesWide ¶
func (s *ScalarPallas) SetBytesWide(bytes []byte) (Scalar, error)
func (*ScalarPallas) SetFq ¶
func (s *ScalarPallas) SetFq(fq *fq.Fq) *ScalarPallas
func (*ScalarPallas) Sqrt ¶
func (s *ScalarPallas) Sqrt() (Scalar, error)
func (*ScalarPallas) Square ¶
func (s *ScalarPallas) Square() Scalar
func (*ScalarPallas) Sub ¶
func (s *ScalarPallas) Sub(rhs Scalar) Scalar
func (*ScalarPallas) UnmarshalBinary ¶
func (s *ScalarPallas) UnmarshalBinary(input []byte) error
func (*ScalarPallas) UnmarshalJSON ¶
func (s *ScalarPallas) UnmarshalJSON(input []byte) error
func (*ScalarPallas) UnmarshalText ¶
func (s *ScalarPallas) UnmarshalText(input []byte) error
func (*ScalarPallas) Zero ¶
func (s *ScalarPallas) Zero() Scalar
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
k256/fp
Autogenerated: 'src/ExtractionOCaml/word_by_word_montgomery' --lang Go --no-wide-int --relax-primitive-carry-to-bitwidth 32,64 --cmovznz-by-mul --internal-static --package-case flatcase --public-function-case UpperCamelCase --private-function-case camelCase --public-type-case UpperCamelCase --private-type-case camelCase --no-prefix-fiat --doc-newline-in-typedef-bounds --doc-prepend-header 'Code generated by Fiat Cryptography.
|
Autogenerated: 'src/ExtractionOCaml/word_by_word_montgomery' --lang Go --no-wide-int --relax-primitive-carry-to-bitwidth 32,64 --cmovznz-by-mul --internal-static --package-case flatcase --public-function-case UpperCamelCase --private-function-case camelCase --public-type-case UpperCamelCase --private-type-case camelCase --no-prefix-fiat --doc-newline-in-typedef-bounds --doc-prepend-header 'Code generated by Fiat Cryptography. |
k256/fq
Autogenerated: 'src/ExtractionOCaml/word_by_word_montgomery' --lang Go --no-wide-int --relax-primitive-carry-to-bitwidth 32,64 --cmovznz-by-mul --internal-static --package-case flatcase --public-function-case UpperCamelCase --private-function-case camelCase --public-type-case UpperCamelCase --private-type-case camelCase --no-prefix-fiat --doc-newline-in-typedef-bounds --doc-prepend-header 'Code generated by Fiat Cryptography.
|
Autogenerated: 'src/ExtractionOCaml/word_by_word_montgomery' --lang Go --no-wide-int --relax-primitive-carry-to-bitwidth 32,64 --cmovznz-by-mul --internal-static --package-case flatcase --public-function-case UpperCamelCase --private-function-case camelCase --public-type-case UpperCamelCase --private-type-case camelCase --no-prefix-fiat --doc-newline-in-typedef-bounds --doc-prepend-header 'Code generated by Fiat Cryptography. |
p256/fp
Code generated by Fiat Cryptography.
|
Code generated by Fiat Cryptography. |
p256/fq
Code generated by Fiat Cryptography.
|
Code generated by Fiat Cryptography. |