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:
Filippo Valsorda 2019-05-15 14:27:12 -04:00
parent 2f2f1c0111
commit bd32259391
2 changed files with 10 additions and 10 deletions

View File

@ -338,14 +338,14 @@ func (e *Element) Add(p, q *Element) *Element {
return e return e
} }
// Sub sets e = p - q, and returns e. // Subtract sets e = p - q, and returns e.
func (e *Element) Sub(p, q *Element) *Element { func (e *Element) Subtract(p, q *Element) *Element {
e.r.Sub(&p.r, &q.r) e.r.Sub(&p.r, &q.r)
return e return e
} }
// Neg sets e = -p, and returns e. // Negate sets e = -p, and returns e.
func (e *Element) Neg(p *Element) *Element { func (e *Element) Negate(p *Element) *Element {
e.r.Neg(&p.r) e.r.Neg(&p.r)
return e return e
} }

View File

@ -27,20 +27,20 @@ func (s *Scalar) Add(x, y *Scalar) *Scalar {
return s return s
} }
// Sub sets s = x - y mod l and returns s. // Subtract sets s = x - y mod l and returns s.
func (s *Scalar) Sub(x, y *Scalar) *Scalar { func (s *Scalar) Subtract(x, y *Scalar) *Scalar {
s.s.Sub(&x.s, &y.s) s.s.Sub(&x.s, &y.s)
return s return s
} }
// Neg sets s = -x mod l and returns s. // Negate sets s = -x mod l and returns s.
func (s *Scalar) Neg(x *Scalar) *Scalar { func (s *Scalar) Negate(x *Scalar) *Scalar {
s.s.Neg(&x.s) s.s.Neg(&x.s)
return s return s
} }
// Mul sets s = x * y mod l and returns s. // Multiply sets s = x * y mod l and returns s.
func (s *Scalar) Mul(x, y *Scalar) *Scalar { func (s *Scalar) Multiply(x, y *Scalar) *Scalar {
s.s.Mul(&x.s, &y.s) s.s.Mul(&x.s, &y.s)
return s return s
} }