crypto/curve25519
Andreas Auernhammer cd11541cdf curve25519: improve cswap
Simplify the constant swap function.

On amd64: Replace the CMOVQEQ scheme with SSE2 code similar to the non-amd64 code.
On non-amd64: Avoid unnecessary loop iterations.

The result is less and slightly faster code.

name 			old time/op 	new time/op 	delta
ScalarBaseMult-4   	653µs ± 0%   	636µs ± 0%   	~     (p=0.100 n=3+3)

name 			old time/op 	new time/op 	delta
ConstantSwap-4  	10.4ns ± 1%   	6.2ns ± 0%  	-39.86%  (p=0.029 n=4+4)

On an i7-65000U

Change-Id: Ia5eea92e0b3eabb6c291d25229aa582b51278552
Reviewed-on: https://go-review.googlesource.com/39693
Reviewed-by: Adam Langley <agl@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-04-13 00:59:54 +00:00
..
const_amd64.h curve25519: avoid loss of R15 in -dynlink mode 2017-02-06 19:40:01 +00:00
const_amd64.s curve25519: avoid loss of R15 in -dynlink mode 2017-02-06 19:40:01 +00:00
cswap_amd64.s curve25519: improve cswap 2017-04-13 00:59:54 +00:00
curve25519.go curve25519: improve cswap 2017-04-13 00:59:54 +00:00
curve25519_test.go curve25519: improve cswap 2017-04-13 00:59:54 +00:00
doc.go crypto: add import comments. 2014-12-09 23:26:36 +00:00
freeze_amd64.s curve25519: avoid loss of R15 in -dynlink mode 2017-02-06 19:40:01 +00:00
ladderstep_amd64.s curve25519: avoid loss of R15 in -dynlink mode 2017-02-06 19:40:01 +00:00
mont25519_amd64.go poly1305, curve25519: add build constraints for appengine 2015-03-27 05:11:19 +00:00
mul_amd64.s curve25519: avoid loss of R15 in -dynlink mode 2017-02-06 19:40:01 +00:00
square_amd64.s curve25519: avoid loss of R15 in -dynlink mode 2017-02-06 19:40:01 +00:00