您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

28 行
559 B

  1. // Copyright 2015 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package rc2
  5. import (
  6. "testing"
  7. )
  8. func BenchmarkEncrypt(b *testing.B) {
  9. r, _ := New([]byte{0, 0, 0, 0, 0, 0, 0, 0}, 64)
  10. b.ResetTimer()
  11. var src [8]byte
  12. for i := 0; i < b.N; i++ {
  13. r.Encrypt(src[:], src[:])
  14. }
  15. }
  16. func BenchmarkDecrypt(b *testing.B) {
  17. r, _ := New([]byte{0, 0, 0, 0, 0, 0, 0, 0}, 64)
  18. b.ResetTimer()
  19. var src [8]byte
  20. for i := 0; i < b.N; i++ {
  21. r.Decrypt(src[:], src[:])
  22. }
  23. }