summaryrefslogtreecommitdiff
path: root/internal/stupidgcm/chacha.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2021-09-04 19:18:42 +0200
committerJakob Unterwurzacher2021-09-07 18:14:05 +0200
commita2eaa5e3d1d9dfd8cf840076c215d253f82abf4b (patch)
tree13a047cadd07a32fce1d80399b3fc68e89fca646 /internal/stupidgcm/chacha.go
parentb8c56ccffc7d2512cb33434a4fb86467fea1e36f (diff)
speed: add BenchmarkStupidChacha
gocryptfs/internal/speed$ go test -bench . goos: linux goarch: amd64 pkg: github.com/rfjakob/gocryptfs/v2/internal/speed cpu: Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz BenchmarkStupidGCM-4 249396 4722 ns/op 867.50 MB/s BenchmarkStupidGCMDecrypt-4 257872 4616 ns/op 887.35 MB/s BenchmarkGoGCM-4 290952 4097 ns/op 999.83 MB/s BenchmarkGoGCMDecrypt-4 294106 4060 ns/op 1008.84 MB/s BenchmarkAESSIV-4 46520 25532 ns/op 160.42 MB/s BenchmarkAESSIVDecrypt-4 46974 25478 ns/op 160.76 MB/s BenchmarkXchacha-4 244108 4881 ns/op 839.14 MB/s BenchmarkXchachaDecrypt-4 249658 4786 ns/op 855.86 MB/s BenchmarkStupidXchacha-4 205339 5768 ns/op 710.11 MB/s BenchmarkStupidXchachaDecrypt-4 204577 5836 ns/op 701.84 MB/s BenchmarkStupidChacha-4 227510 5224 ns/op 784.06 MB/s BenchmarkStupidChachaDecrypt-4 222787 5359 ns/op 764.34 MB/s PASS ok github.com/rfjakob/gocryptfs/v2/internal/speed 15.328s
Diffstat (limited to 'internal/stupidgcm/chacha.go')
-rw-r--r--internal/stupidgcm/chacha.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/stupidgcm/chacha.go b/internal/stupidgcm/chacha.go
index 37f7e1f..2e6e6e6 100644
--- a/internal/stupidgcm/chacha.go
+++ b/internal/stupidgcm/chacha.go
@@ -21,7 +21,7 @@ type stupidChacha20poly1305 struct {
// Verify that we satisfy the cipher.AEAD interface
var _ cipher.AEAD = &stupidChacha20poly1305{}
-func newChacha20poly1305(key []byte) *stupidChacha20poly1305 {
+func NewChacha20poly1305(key []byte) *stupidChacha20poly1305 {
if len(key) != chacha20poly1305.KeySize {
log.Panicf("Only %d-byte keys are supported, you passed %d bytes", chacha20poly1305.KeySize, len(key))
}