Commit graph

17 commits

Author SHA1 Message Date
Bryan C. Mills 16197b4051 crypto/internal/edwards25519: shorten quick.Check tests in short mode
The edwards25519 tests can be quite slow on platforms without a
well-optimized implementation, especially if the race detector is also
enabled. Since these tests aren't checking for specific inputs anyway,
the extra coverage of a more aggressive quick.Config does not seem
worth wasting extra time on slow CI builders and TryBots.

For #60109.

Change-Id: I530e75a0b76725585df5a2f5ded6705ab1b9da51
Reviewed-on: https://go-review.googlesource.com/c/go/+/522715
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Joedian Reid <joedian@golang.org>
2023-12-10 20:10:48 +01:00
Filippo Valsorda 467a92bcfd scalar: document and update fiat generation code 2022-07-31 17:08:28 -04:00
Filippo Valsorda 50a0a9e22d scalar: clean up fiat wrapper 2022-07-31 17:08:28 -04:00
George Tankersley 589b96254b scalar: update fiat code to v0.0.12-f4c7f3717364cf39b716170bf39f81b78acf544e 2022-07-31 17:08:28 -04:00
George Tankersley 8b9f5baf25 scalar: fix the loop in notZeroScalar.Generate 2022-07-31 17:08:28 -04:00
George Tankersley 306e451b8b scalar: replace the Christmas tree with a fiat-crypto generated scalar field 2022-07-31 17:08:28 -04:00
Filippo Valsorda c1c1311e51 edwards25519: make Scalar and field.Element setters return errors
Accepting a short value from an attacker and passing it to a setter is
an easy way to end up with a panic. Return errors instead.
2021-06-04 16:57:44 +02:00
Filippo Valsorda dd0c73fa20 all: sync with landed standard library upstream 2021-05-26 18:09:02 +02:00
Filippo Valsorda c6be47d677 edwards25519: update TestScalarSetBytesWithClamping
With jedisct1/libsodium.js#256 fixed, use non-Montgomery representation.
2021-04-05 23:14:53 +02:00
Filippo Valsorda dbe1792d04 edwards25519: add TestScalarSetBytesWithClamping 2020-12-12 14:27:59 +01:00
Filippo Valsorda ec6f8a6a18 edwards25519: make (*Scalar).SetCanonicalBytes return the receiver
Like all other SetBytes methods.
2020-11-28 04:38:15 +01:00
Filippo Valsorda 498fb1e96a edwards25519: replace FillBytes with Bytes, again
Since the sizes are fixed, we can use outlining to make Bytes almost as
efficient as FillBytes: a careful caller can avoid the allocation, and
copying 32 bytes is unlikely to show up on the profiles.
2020-11-23 05:10:24 +01:00
Filippo Valsorda 7c14a36a2a edwards25519: rename FromBytes to SetBytes
It's consistent with math/big, it follows the pattern of using verbs,
and is clearer in what it does.
2020-11-23 04:20:36 +01:00
Filippo Valsorda 36d8598588 edwards25519: test the invariant that Scalars are always reduced 2020-11-23 00:08:28 +01: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 1a86a9cb60 edwards25519: make Scalar opaque 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
Renamed from scalar/scalar_test.go (Browse further)