]> Cypherpunks repositories - gostls13.git/commit
crypto/internal/edwards25519: replace scalar field with fiat-crypto
authorFilippo Valsorda <filippo@golang.org>
Mon, 1 Aug 2022 11:11:55 +0000 (13:11 +0200)
committerGopher Robot <gobot@golang.org>
Thu, 10 Nov 2022 18:45:00 +0000 (18:45 +0000)
commiteca7754148613dfbf542bbfac5392b5f0d85ea6a
treedf4d1005b437cb459c67999f54d0c3476c48540d
parent3fc8ed2543091693eca514b363fcdbbe5c7f2916
crypto/internal/edwards25519: replace scalar field with fiat-crypto

This was the last piece of ref10 code, including the infamous "Christmas
tree" in scMulAdd, that approximately all Ed25519 implementations
inherited. Replace the whole scalar field implementation with a
fiat-crypto generated one, like those in crypto/internal/nistec/fiat.

The only complexity is the wide reduction (both for the 64-byte one and
for the clamped input). For that we do a limbed reduction suggested by
Frank Denis.

Some minor housekeeping and test changes from filippo.io/edwards25519
are included, as part of syncing with downstream.

Ignoring the autogenerated file, the diff is

    268 insertions(+), 893 deletions(-)

George Tankersley signed the Individual CLA and authorized me to submit
this change on his behalf at the time he contributed it to
filippo.io/edwards25519.

Co-authored-by: George Tankersley <george.tankersley@gmail.com>
Change-Id: I4084b4d3813f36e16b3d8839df75da1b4fd7846b
Reviewed-on: https://go-review.googlesource.com/c/go/+/420454
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
src/crypto/internal/edwards25519/edwards25519_test.go
src/crypto/internal/edwards25519/field/_asm/go.mod
src/crypto/internal/edwards25519/field/_asm/go.sum
src/crypto/internal/edwards25519/field/fe_amd64.s
src/crypto/internal/edwards25519/field/fe_bench_test.go
src/crypto/internal/edwards25519/scalar.go
src/crypto/internal/edwards25519/scalar_alias_test.go
src/crypto/internal/edwards25519/scalar_fiat.go [new file with mode: 0644]
src/crypto/internal/edwards25519/scalar_test.go
src/crypto/internal/edwards25519/scalarmult_test.go