Commit graph

12 commits

Author SHA1 Message Date
Filippo Valsorda dd0c73fa20 all: sync with landed standard library upstream 2021-05-26 18:09:02 +02:00
Adrian Hamelink b73a7c8249
edwards25519: fix ScalarMult when receiver is not the identity (#12)
Calling v.ScalarMult on a receiver v that is not the identity point results in an incorrect operation.
This was fixed by setting v to the identity point in ScalarMult.

A simple test was added to check this behaviour.
2021-02-03 23:49:06 +01:00
Filippo Valsorda 700f4f4a67 edwards25519: panic if an uninitialized Point is used 2020-12-17 19:15:22 +01:00
Filippo Valsorda 1c833da9b1 edwards25519: clarify ScalarBaseMult docs
Fixes #2
2020-11-23 14:21:07 +01:00
Filippo Valsorda 9c7303a0b2 edwards25519: remove (*Point).Identity and (*Point).Generator
I could not decide if they should be called SetIdentity/SetGenerator, so
instead I removed them. Turns out we only needed them in one place,
where Set(NewIdentityPoint()) inlines well enough that it should perform
the same.

Most the Identity calls were redundant as the value was overwritten
before being used next.
2020-11-23 04:58:26 +01:00
Filippo Valsorda daa250742f edwards25519: minor doc and string touch-ups 2020-11-23 03:51:42 +01:00
Filippo Valsorda f28d75ad5d edwards25519: change constructors
We now don't have a NewPoint which maybe helps imply there isn't a zero
value for a Point, and renamed Zero and One to Identity and Generator.
2020-11-23 02:57:28 +01:00
Filippo Valsorda f6ee18761d edwards25519: make Point opaque 2020-09-28 14:18:44 +02:00
Filippo Valsorda 176388b1ad edwards25519: cleanup Scalar API to match ristretto255
Also, replaced Bytes (which appended, unlike big.Int.Bytes) with
FillBytes. ristretto255 has Encode/Decode instead of
FillBytes/FromCanonicalBytes in order to match Element, which is not
relevant here.
2020-09-28 14:18:44 +02:00
Filippo Valsorda c5c2e9e1ac edwards25519: rename ProjP3 to Point and unexport other point types 2020-09-28 14:18:44 +02:00
Filippo Valsorda d3569cbbb3 all: flatten the package and make FieldElement opaque
For the license changes, see gtank/ristretto255-private#28 and
gtank/ristretto255#32, that contribute all code in those repositories to
the Go project under the Google CLA.
2020-09-28 14:18:44 +02:00
Filippo Valsorda 6f5f5828e1 all: expose edwards25519, base, and scalar packages 2020-08-27 00:35:09 -04:00
Renamed from internal/edwards25519/scalarmult.go (Browse further)