Documentation ¶
Index ¶
- Variables
- type Point
- func (z *Point) Add(x, y *Point) *Point
- func (z *Point) ConstTimeEqual(x *Point) bool
- func (z *Point) Decode(e [32]byte) (*Point, bool)
- func (z *Point) Encode() [32]byte
- func (z *Point) ScMul(x *Point, y *Scalar) *Point
- func (z *Point) ScMulAdd(a *Point, x, y *Scalar) *Point
- func (z *Point) ScMulBase(x *Scalar) *Point
- func (z *Point) Sub(x, y *Point) *Point
- type Scalar
Constants ¶
This section is empty.
Variables ¶
var ( // Zero is the number 0. Zero Scalar // One is the number 1. One = Scalar{1} // NegOne is the number -1 mod L NegOne = Scalar{ 0xec, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, } // L is the subgroup order: // 2^252 + 27742317777372353535851937790883648493 L = Scalar{ 0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, } )
Functions ¶
This section is empty.
Types ¶
type Point ¶
type Point edwards25519.ExtendedGroupElement
Point is a point on the ed25519 curve.
var ZeroPoint Point
ZeroPoint is the zero point on the ed25519 curve (not the zero value of Point).
func (*Point) Add ¶
Add adds the points in x and y, storing the result in z and returning that. Any or all of x, y, and z may be the same pointers.
func (*Point) ConstTimeEqual ¶
func (*Point) ScMul ¶
ScMul multiplies the EC point x by the scalar y, placing the result in z and returning that. X and z may be the same pointer.
func (*Point) ScMulAdd ¶
ScMulAdd computes xa+yB, where B is the ed25519 base point, and places the result in z, returning that.
type Scalar ¶
type Scalar [32]byte
Scalar is a 256-bit little-endian scalar.
func (*Scalar) Add ¶
Add computes x+y (mod L) and places the result in z, returning that. Any or all of x, y, and z may be the same pointer.
func (*Scalar) MulAdd ¶
MulAdd computes ab+c (mod L) and places the result in z, returning that. Any or all of the pointers may be the same.
func (*Scalar) Neg ¶
Neg negates x (mod L) and places the result in z, returning that. X and z may be the same pointer.