Documentation ¶
Overview ¶
Package edwards25519 implements group logic for the twisted Edwards curve
-x^2 + y^2 = 1 + -(121665/121666)*x^2*y^2
This is better known as the Edwards curve equivalent to curve25519, and is the curve used by the Ed25519 signature scheme.
Index ¶
- Variables
- type AffineCached
- type ProjCached
- type ProjP1xP1
- func (v *ProjP1xP1) Add(p *ProjP3, q *ProjCached) *ProjP1xP1
- func (v *ProjP1xP1) AddAffine(p *ProjP3, q *AffineCached) *ProjP1xP1
- func (v *ProjP1xP1) Double(p *ProjP2) *ProjP1xP1
- func (v *ProjP1xP1) Sub(p *ProjP3, q *ProjCached) *ProjP1xP1
- func (v *ProjP1xP1) SubAffine(p *ProjP3, q *AffineCached) *ProjP1xP1
- func (v *ProjP1xP1) Zero() *ProjP1xP1
- type ProjP2
- type ProjP3
- func (v *ProjP3) Add(p, q *ProjP3) *ProjP3
- func (v *ProjP3) BasepointMul(x *scalar.Scalar) *ProjP3
- func (v *ProjP3) Equal(u *ProjP3) int
- func (v *ProjP3) FromP1xP1(p *ProjP1xP1) *ProjP3
- func (v *ProjP3) FromP2(p *ProjP2) *ProjP3
- func (v *ProjP3) MultiscalarMul(scalars []scalar.Scalar, points []*ProjP3) *ProjP3
- func (v *ProjP3) Neg(p *ProjP3) *ProjP3
- func (v *ProjP3) ScalarMul(x *scalar.Scalar, q *ProjP3) *ProjP3
- func (v *ProjP3) Set(u *ProjP3) *ProjP3
- func (v *ProjP3) Sub(p, q *ProjP3) *ProjP3
- func (v *ProjP3) VartimeDoubleBaseMul(a *scalar.Scalar, A *ProjP3, b *scalar.Scalar) *ProjP3
- func (v *ProjP3) VartimeMultiscalarMul(scalars []scalar.Scalar, points []*ProjP3) *ProjP3
- func (v *ProjP3) Zero() *ProjP3
Constants ¶
This section is empty.
Variables ¶
var B = ProjP3{ X: radix51.FieldElement([5]uint64{1738742601995546, 1146398526822698, 2070867633025821, 562264141797630, 587772402128613}), Y: radix51.FieldElement([5]uint64{1801439850948184, 1351079888211148, 450359962737049, 900719925474099, 1801439850948198}), Z: radix51.FieldElement([5]uint64{1, 0, 0, 0, 0}), T: radix51.FieldElement([5]uint64{1841354044333475, 16398895984059, 755974180946558, 900171276175154, 1821297809914039}), }
B is the Ed25519 basepoint.
var D = &radix51.FieldElement{929955233495203, 466365720129213,
1662059464998953, 2033849074728123, 1442794654840575}
D is a constant in the curve equation.
Functions ¶
This section is empty.
Types ¶
type AffineCached ¶
type AffineCached struct {
YplusX, YminusX, T2d radix51.FieldElement
}
func (*AffineCached) CondNeg ¶
func (v *AffineCached) CondNeg(cond int) *AffineCached
CondNeg negates v if cond == 1 and leaves it unchanged if cond == 0.
func (*AffineCached) FromP3 ¶
func (v *AffineCached) FromP3(p *ProjP3) *AffineCached
func (*AffineCached) Select ¶
func (v *AffineCached) Select(a, b *AffineCached, cond int) *AffineCached
Select sets v to a if cond == 1 and to b if cond == 0.
func (*AffineCached) Zero ¶
func (v *AffineCached) Zero() *AffineCached
type ProjCached ¶
type ProjCached struct {
YplusX, YminusX, Z, T2d radix51.FieldElement
}
func (*ProjCached) CondNeg ¶
func (v *ProjCached) CondNeg(cond int) *ProjCached
CondNeg negates v if cond == 1 and leaves it unchanged if cond == 0.
func (*ProjCached) FromP3 ¶
func (v *ProjCached) FromP3(p *ProjP3) *ProjCached
func (*ProjCached) Select ¶
func (v *ProjCached) Select(a, b *ProjCached, cond int) *ProjCached
Select sets v to a if cond == 1 and to b if cond == 0.
func (*ProjCached) Zero ¶
func (v *ProjCached) Zero() *ProjCached
type ProjP1xP1 ¶
type ProjP1xP1 struct {
X, Y, Z, T radix51.FieldElement
}
type ProjP2 ¶
type ProjP2 struct {
X, Y, Z radix51.FieldElement
}
type ProjP3 ¶
type ProjP3 struct {
X, Y, Z, T radix51.FieldElement
}
func (*ProjP3) BasepointMul ¶
Set v to x*B, where B is the Ed25519 basepoint, and return v.
The scalar multiplication is done in constant time.
func (*ProjP3) Equal ¶
by @ebfull https://github.com/dalek-cryptography/curve25519-dalek/pull/226/files
func (*ProjP3) MultiscalarMul ¶
Set v to the result of a multiscalar multiplication and return v.
The multiscalar multiplication is sum(scalars[i]*points[i]).
The multiscalar multiplication is performed in constant time.
func (*ProjP3) ScalarMul ¶
Set v to x*Q, and return v. v and q may alias.
The scalar multiplication is done in constant time.
func (*ProjP3) VartimeDoubleBaseMul ¶
Set v to a*A + b*B, where B is the Ed25519 basepoint, and return v.
The scalar multiplication is done in variable time.
func (*ProjP3) VartimeMultiscalarMul ¶
Set v to the result of a multiscalar multiplication and return v.
The multiscalar multiplication is sum(scalars[i]*points[i]).
The multiscalar multiplication is performed in variable time.