]> Cypherpunks repositories - gostls13.git/commit
crypto/internal/bigmod: add amd64 assembly core
authorFilippo Valsorda <filippo@golang.org>
Fri, 18 Nov 2022 19:58:12 +0000 (20:58 +0100)
committerGopher Robot <gobot@golang.org>
Mon, 21 Nov 2022 16:19:43 +0000 (16:19 +0000)
commit335e7647f53293eb320c1f069eaf0ff641810d6d
tree5bd3624f418eb6d9183681aebfdde97fe2e8ec48
parent08f2091ce0817346458d2ae984ccea77817cd516
crypto/internal/bigmod: add amd64 assembly core

With this change, we are down to 1.2x the running time of the previous
variable time implementation.

name                    old time/op  new time/op    delta
DecryptPKCS1v15/2048-4  1.37ms ± 0%    1.61ms ± 0%    +17.54%  (p=0.000 n=18+10)
DecryptPKCS1v15/3072-4  3.99ms ± 1%    5.46ms ± 1%    +36.64%  (p=0.000 n=20+10)
DecryptPKCS1v15/4096-4  8.95ms ± 1%   12.04ms ± 0%    +34.53%  (p=0.000 n=20+10)
EncryptPKCS1v15/2048-4  9.24µs ± 7%  223.34µs ± 0%  +2317.67%  (p=0.000 n=20+9)
DecryptOAEP/2048-4      1.38ms ± 1%    1.62ms ± 0%    +17.31%  (p=0.000 n=20+10)
EncryptOAEP/2048-4      11.5µs ± 6%   225.4µs ± 0%  +1851.82%  (p=0.000 n=20+10)
SignPKCS1v15/2048-4     1.38ms ± 0%    1.68ms ± 0%    +21.25%  (p=0.000 n=20+9)
VerifyPKCS1v15/2048-4   8.75µs ±11%  221.94µs ± 0%  +2435.02%  (p=0.000 n=20+9)
SignPSS/2048-4          1.39ms ± 1%    1.68ms ± 0%    +21.18%  (p=0.000 n=20+10)
VerifyPSS/2048-4        11.1µs ± 8%   224.7µs ± 0%  +1917.03%  (p=0.000 n=20+8)

Change-Id: I2a91ba99fcd0f86f2b5191d17170da755d7c4690
Reviewed-on: https://go-review.googlesource.com/c/go/+/452095
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Run-TryBot: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
src/crypto/internal/bigmod/_asm/go.mod [new file with mode: 0644]
src/crypto/internal/bigmod/_asm/go.sum [new file with mode: 0644]
src/crypto/internal/bigmod/_asm/nat_amd64_asm.go [new file with mode: 0644]
src/crypto/internal/bigmod/nat.go
src/crypto/internal/bigmod/nat_amd64.go [new file with mode: 0644]
src/crypto/internal/bigmod/nat_amd64.s [new file with mode: 0644]
src/crypto/internal/bigmod/nat_noasm.go [new file with mode: 0644]