From: Adam Langley Date: Thu, 11 Oct 2012 22:25:23 +0000 (-0400) Subject: crypto/rsa: fix decryption benchmark. X-Git-Tag: go1.1rc2~2146 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=3acce59b93305eac1348d8ed8034310b6b01d2a3;p=gostls13.git crypto/rsa: fix decryption benchmark. 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 --- diff --git a/src/pkg/crypto/rsa/rsa_test.go b/src/pkg/crypto/rsa/rsa_test.go index 62bbdc4aec..f9fa56efe7 100644 --- a/src/pkg/crypto/rsa/rsa_test.go +++ b/src/pkg/crypto/rsa/rsa_test.go @@ -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()