]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/rsa: fix decryption benchmark.
authorAdam Langley <agl@golang.org>
Thu, 11 Oct 2012 22:25:23 +0000 (18:25 -0400)
committerAdam Langley <agl@golang.org>
Thu, 11 Oct 2012 22:25:23 +0000 (18:25 -0400)
I was an idiot and was thinking that a small base didn't matter
because the exponentiation would quickly make the number the same size
as the modulus. But, of course, the small base continues to make
multiplications unrealistically cheap throughout the computation.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6649048

src/pkg/crypto/rsa/rsa_test.go

index 62bbdc4aec3a2113d33ee3c93a7f3ce0c484587a..f9fa56efe72b557d6cb5f11f6bbf348fb57a0a79 100644 (file)
@@ -116,7 +116,7 @@ func BenchmarkRSA2048Decrypt(b *testing.B) {
        }
        priv.Precompute()
 
-       c := fromBase10("1000")
+       c := fromBase10("8472002792838218989464636159316973636630013835787202418124758118372358261975764365740026024610403138425986214991379012696600761514742817632790916315594342398720903716529235119816755589383377471752116975374952783629225022962092351886861518911824745188989071172097120352727368980275252089141512321893536744324822590480751098257559766328893767334861211872318961900897793874075248286439689249972315699410830094164386544311554704755110361048571142336148077772023880664786019636334369759624917224888206329520528064315309519262325023881707530002540634660750469137117568199824615333883758410040459705787022909848740188613313")
 
        b.StartTimer()
 
@@ -141,7 +141,7 @@ func Benchmark3PrimeRSA2048Decrypt(b *testing.B) {
        }
        priv.Precompute()
 
-       c := fromBase10("1000")
+       c := fromBase10("8472002792838218989464636159316973636630013835787202418124758118372358261975764365740026024610403138425986214991379012696600761514742817632790916315594342398720903716529235119816755589383377471752116975374952783629225022962092351886861518911824745188989071172097120352727368980275252089141512321893536744324822590480751098257559766328893767334861211872318961900897793874075248286439689249972315699410830094164386544311554704755110361048571142336148077772023880664786019636334369759624917224888206329520528064315309519262325023881707530002540634660750469137117568199824615333883758410040459705787022909848740188613313")
 
        b.StartTimer()