Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
crypto/internal/fips140/bigmod: add more //go:norace annotations
//go:norace does not carry over when a function is inlined. Add //go:norace to functions that inline loops over Nat words. Improves race tests, also asan, msan. These are with -race: goos: darwin goarch: arm64 pkg: crypto/internal/fips140/bigmod cpu: Apple M3 Pro │ old │ new │ │ sec/op │ sec/op vs base │ ModAdd-12 172.4n ± 3% 117.9n ± 3% -31.62% (p=0.000 n=20) ModSub-12 147.1n ± 2% 111.4n ± 3% -24.27% (p=0.000 n=20) NewModulus-12 12.966µ ± 1% 9.743µ ± 2% -24.86% (p=0.000 n=20) MontgomeryRepr-12 1305.5n ± 1% 986.3n ± 0% -24.45% (p=0.000 n=20) MontgomeryMul-12 1304.0n ± 1% 976.8n ± 0% -25.10% (p=0.000 n=20) ModMul-12 2.893µ ± 1% 2.055µ ± 3% -28.97% (p=0.000 n=20) ExpBig-12 2.784m ± 0% 2.789m ± 0% +0.17% (p=0.008 n=20) Exp-12 3.468m ± 0% 2.620m ± 0% -24.45% (p=0.000 n=20) geomean 7.930µ 6.073µ -23.41% pkg: crypto/rsa │ old │ new │ │ sec/op │ sec/op vs base │ DecryptPKCS1v15/2048-12 1.795m ± 1% 1.175m ± 1% -34.52% (p=0.000 n=20) DecryptPKCS1v15/3072-12 3.836m ± 2% 2.647m ± 0% -31.01% (p=0.000 n=20) DecryptPKCS1v15/4096-12 7.316m ± 0% 5.437m ± 0% -25.68% (p=0.000 n=20) EncryptPKCS1v15/2048-12 45.85µ ± 1% 34.78µ ± 0% -24.15% (p=0.000 n=20) DecryptOAEP/2048-12 1.793m ± 2% 1.188m ± 1% -33.76% (p=0.000 n=20) EncryptOAEP/2048-12 55.11µ ± 1% 43.91µ ± 1% -20.32% (p=0.000 n=20) SignPKCS1v15/2048-12 1.797m ± 2% 1.193m ± 0% -33.62% (p=0.000 n=20) VerifyPKCS1v15/2048-12 45.16µ ± 1% 34.51µ ± 0% -23.57% (p=0.000 n=20) SignPSS/2048-12 1.826m ± 2% 1.213m ± 0% -33.55% (p=0.000 n=20) VerifyPSS/2048-12 53.25µ ± 1% 42.40µ ± 1% -20.36% (p=0.000 n=20) GenerateKey/2048-12 323.7m ± 33% 209.0m ± 17% -35.43% (p=0.000 n=20) ParsePKCS8PrivateKey/2048-12 105.26µ ± 0% 94.74µ ± 0% -9.99% (p=0.000 n=20) geomean 792.5µ 574.3µ -27.53% Change-Id: I1f1986cf2bac126d7346799b08b17d356b28d956 Reviewed-on: https://go-review.googlesource.com/c/go/+/633995 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Roland Shoemaker <roland@golang.org>
- Loading branch information