OSDN Git Service

libgo: Update to weekly.2011-12-06.
[pf3gnuchains/gcc-fork.git] / libgo / go / crypto / aes / aes_test.go
index 2136d44..3505d33 100644 (file)
@@ -348,3 +348,17 @@ func TestCipherDecrypt(t *testing.T) {
                }
        }
 }
+
+func BenchmarkEncrypt(b *testing.B) {
+       b.StopTimer()
+       tt := encryptTests[0]
+       c, err := NewCipher(tt.key)
+       if err != nil {
+               panic("NewCipher")
+       }
+       out := make([]byte, len(tt.in))
+       b.StartTimer()
+       for i := 0; i < b.N; i++ {
+               c.Encrypt(out, tt.in)
+       }
+}