aboutsummaryrefslogtreecommitdiff
path: root/src/crypto/cipher
diff options
context:
space:
mode:
authorMichael Stapelberg <stapelberg@google.com>2023-10-25 15:04:45 +0000
committerGopher Robot <gobot@golang.org>2023-10-25 15:27:49 +0000
commit067f28ad73e096a7ca1e892ba89280dfa4fa419d (patch)
treec27aa0671a702fb608f8070e7025f7078b5a600f /src/crypto/cipher
parentb5f87b5407916c4049a3158cc944cebfd7a883a9 (diff)
downloadgo-067f28ad73e096a7ca1e892ba89280dfa4fa419d.tar.xz
Revert "crypto/internal/boring: use noescape and nocallback cgo directives"
This reverts CL 525035. Reason for revert: breaks many Google-internal tests (#63739), suspected miscompilation Change-Id: I8cbebca0a187d12e16c405b2373c754e4a397ef4 Reviewed-on: https://go-review.googlesource.com/c/go/+/537598 Reviewed-by: Bryan Mills <bcmills@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Roland Shoemaker <roland@golang.org> Auto-Submit: Bryan Mills <bcmills@google.com>
Diffstat (limited to 'src/crypto/cipher')
-rw-r--r--src/crypto/cipher/gcm_test.go36
1 files changed, 0 insertions, 36 deletions
diff --git a/src/crypto/cipher/gcm_test.go b/src/crypto/cipher/gcm_test.go
index 7b9d1852d7..3556146ea6 100644
--- a/src/crypto/cipher/gcm_test.go
+++ b/src/crypto/cipher/gcm_test.go
@@ -654,39 +654,3 @@ func TestGCMAsm(t *testing.T) {
}
}
}
-
-func BenchmarkGCMSeal(b *testing.B) {
- key, _ := hex.DecodeString("ab72c77b97cb5fe9a382d9fe81ffdbed")
- nonce, _ := hex.DecodeString("54cc7dc2c37ec006bcc6d1db")
- plaintext, _ := hex.DecodeString("f1cc3818e421876bb6b8bbd6c9")
-
- aes, _ := aes.NewCipher(key)
- aesgcm, _ := cipher.NewGCM(aes)
-
- ciphertext := make([]byte, 32)
- b.SetBytes(int64(len(plaintext)))
- b.ResetTimer()
- for i := 0; i < b.N; i++ {
- _ = aesgcm.Seal(ciphertext[:0], nonce, plaintext, nil)
- }
-}
-
-func BenchmarkGCMOpen(b *testing.B) {
- key, _ := hex.DecodeString("ab72c77b97cb5fe9a382d9fe81ffdbed")
- nonce, _ := hex.DecodeString("54cc7dc2c37ec006bcc6d1db")
- plaintext, _ := hex.DecodeString("f1cc3818e421876bb6b8bbd6c9")
-
- aes, _ := aes.NewCipher(key)
- aesgcm, _ := cipher.NewGCM(aes)
-
- ciphertext := aesgcm.Seal(nil, nonce, plaintext, nil)
-
- b.SetBytes(int64(len(ciphertext)))
- b.ResetTimer()
- for i := 0; i < b.N; i++ {
- _, err := aesgcm.Open(plaintext[:0], nonce, ciphertext, nil)
- if err != nil {
- b.Fatal(err)
- }
- }
-}