commit | e5c512520bd0a51d59b39556795a47db888d69b5 | [log] [tgz] |
---|---|---|
author | Josh Bleecher Snyder <josharian@gmail.com> | Wed Jul 28 11:59:01 2021 -0700 |
committer | Josh Bleecher Snyder <josharian@gmail.com> | Tue Oct 26 23:06:10 2021 +0000 |
tree | eef6038f9a9b7cf1b6079717ef6f89dc0416bf29 | |
parent | 80be4a4f90836a33ab5b3d09c6f529de8ee628ea [diff] |
crypto/elliptic: use a const string for precomputed P256 table Const strings can be marked readonly. This is particularly important for this relatively large table (88kb). This is a follow-up to CL 315189. The generation script is a bit awkward. It needs access to crypto/elliptic internals, but also needs to be package main. Work around this by exporting those internals with the "tablegen" build tag. This requires changing the function signature at the Go-asm bridge. As long as we're here, shrink the point argument type as well; the net result is three fewer words of params. Performance impact is probably noise. name old time/op new time/op delta ScalarBaseMult/P256-8 11.4µs ± 2% 11.3µs ± 1% -1.32% (p=0.000 n=19+16) ScalarBaseMult/P224-8 579µs ± 1% 577µs ± 0% -0.30% (p=0.024 n=19+20) ScalarBaseMult/P384-8 2.31ms ± 4% 2.34ms ± 4% +1.25% (p=0.033 n=20+20) ScalarBaseMult/P521-8 1.33ms ± 0% 1.33ms ± 1% ~ (p=0.173 n=18+17) ScalarMult/P256-8 42.7µs ± 0% 42.7µs ± 2% ~ (p=0.989 n=20+20) ScalarMult/P224-8 579µs ± 0% 579µs ± 0% ~ (p=0.538 n=19+18) ScalarMult/P384-8 2.32ms ± 3% 2.34ms ± 5% ~ (p=0.235 n=19+20) ScalarMult/P521-8 1.33ms ± 1% 1.34ms ± 2% ~ (p=0.141 n=17+20) Change-Id: I3bee56df34ae61ca8829791d2e67e058ecc8ddbe Reviewed-on: https://go-review.googlesource.com/c/go/+/339591 Trust: Josh Bleecher Snyder <josharian@gmail.com> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Official binary distributions are available at https://golang.org/dl/.
After downloading a binary release, visit https://golang.org/doc/install for installation instructions.
If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source for source installation instructions.
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines at https://golang.org/doc/contribute.
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.