MCPcopy
hub / github.com/gtank/cryptopasta / BenchmarkAESGCM

Function BenchmarkAESGCM

encrypt_test.go:64–80  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

62}
63
64func BenchmarkAESGCM(b *testing.B) {
65 randomKey := &[32]byte{}
66 _, err := io.ReadFull(rand.Reader, randomKey[:])
67 if err != nil {
68 b.Fatal(err)
69 }
70
71 data, err := ioutil.ReadFile("testdata/big")
72 if err != nil {
73 b.Fatal(err)
74 }
75 b.SetBytes(int64(len(data)))
76
77 for i := 0; i < b.N; i++ {
78 Encrypt(data, randomKey)
79 }
80}
81
82func BenchmarkSecretbox(b *testing.B) {
83 randomKey := &[32]byte{}

Callers

nothing calls this directly

Calls 1

EncryptFunction · 0.85

Tested by

no test coverage detected