Descriptionmath/big: add 4-bit, fixed window exponentiation.
A 4-bit window is convenient because 4 divides both 32 and 64,
therefore we never have a window spanning words of the exponent.
Additionaly, the benefit of a 5-bit window is only 2.6% at 1024-bits
and 3.3% at 2048-bits.
This code is still not constant time, however.
benchmark old ns/op new ns/op delta
BenchmarkRSA2048Decrypt 17108590 11180370 -34.65%
Benchmark3PrimeRSA2048Decrypt 13003720 7680390 -40.94%
Patch Set 1 #Patch Set 2 : diff -r e64d4ee19fff https://go.googlecode.com/hg/ #Patch Set 3 : diff -r e64d4ee19fff https://go.googlecode.com/hg/ #Patch Set 4 : diff -r e64d4ee19fff https://go.googlecode.com/hg/ #Patch Set 5 : diff -r 24401c14a1a9 https://go.googlecode.com/hg/ #
Total comments: 27
Patch Set 6 : diff -r 24401c14a1a9 https://go.googlecode.com/hg/ #
Total comments: 2
Patch Set 7 : diff -r 32c1ce44286f https://go.googlecode.com/hg/ #MessagesTotal messages: 5
|