mirror of https://github.com/gtank/ristretto255
ristretto255: spell out Subtract, Negate and Multiply
The abbreviations don't really feel worth it, and it makes it more natural to abbreviate ScalarMult with a "t".
This commit is contained in:
parent
2f2f1c0111
commit
bd32259391
|
@ -338,14 +338,14 @@ func (e *Element) Add(p, q *Element) *Element {
|
|||
return e
|
||||
}
|
||||
|
||||
// Sub sets e = p - q, and returns e.
|
||||
func (e *Element) Sub(p, q *Element) *Element {
|
||||
// Subtract sets e = p - q, and returns e.
|
||||
func (e *Element) Subtract(p, q *Element) *Element {
|
||||
e.r.Sub(&p.r, &q.r)
|
||||
return e
|
||||
}
|
||||
|
||||
// Neg sets e = -p, and returns e.
|
||||
func (e *Element) Neg(p *Element) *Element {
|
||||
// Negate sets e = -p, and returns e.
|
||||
func (e *Element) Negate(p *Element) *Element {
|
||||
e.r.Neg(&p.r)
|
||||
return e
|
||||
}
|
||||
|
|
12
scalar.go
12
scalar.go
|
@ -27,20 +27,20 @@ func (s *Scalar) Add(x, y *Scalar) *Scalar {
|
|||
return s
|
||||
}
|
||||
|
||||
// Sub sets s = x - y mod l and returns s.
|
||||
func (s *Scalar) Sub(x, y *Scalar) *Scalar {
|
||||
// Subtract sets s = x - y mod l and returns s.
|
||||
func (s *Scalar) Subtract(x, y *Scalar) *Scalar {
|
||||
s.s.Sub(&x.s, &y.s)
|
||||
return s
|
||||
}
|
||||
|
||||
// Neg sets s = -x mod l and returns s.
|
||||
func (s *Scalar) Neg(x *Scalar) *Scalar {
|
||||
// Negate sets s = -x mod l and returns s.
|
||||
func (s *Scalar) Negate(x *Scalar) *Scalar {
|
||||
s.s.Neg(&x.s)
|
||||
return s
|
||||
}
|
||||
|
||||
// Mul sets s = x * y mod l and returns s.
|
||||
func (s *Scalar) Mul(x, y *Scalar) *Scalar {
|
||||
// Multiply sets s = x * y mod l and returns s.
|
||||
func (s *Scalar) Multiply(x, y *Scalar) *Scalar {
|
||||
s.s.Mul(&x.s, &y.s)
|
||||
return s
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue