]> Cypherpunks repositories - gostls13.git/commit
crypto/internal/nistec: use mixed addition in purego ScalarBaseMult
authorFilippo Valsorda <filippo@golang.org>
Fri, 26 Jul 2024 21:34:12 +0000 (23:34 +0200)
committerGopher Robot <gobot@golang.org>
Tue, 19 Nov 2024 22:30:07 +0000 (22:30 +0000)
commit5610e05936a87744e0ca2b244c92d24f789a8aed
tree95de9858df2c67a660ed32d56cb84296bfbd23ba
parent298defcb54b88c4a5cbdf493b3b66a448fa53f0e
crypto/internal/nistec: use mixed addition in purego ScalarBaseMult

The affine addition formula is significantly faster, and sets us up to
reuse the precomputed table from the assembly implementation.

This is an incremental step towards converging the purego and assembly
implementations, with the goal of eventually merging them.

Very proud of how the conditional AddAffine avoids the whole zero/sel
cmov dance, compared to the same logic in the assembly implementation.

Change-Id: Iab008e81869cf8c1565b938e4dd392dd4d5787fd
Reviewed-on: https://go-review.googlesource.com/c/go/+/627938
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
src/crypto/internal/nistec/p256.go