From dfb7fae52a65872db5b361e3b18f8d2ff80b3bcd Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Mon, 23 Aug 2021 22:13:49 +0200 Subject: [PATCH] speed: use algo names from cryptocore --- internal/speed/speed.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/internal/speed/speed.go b/internal/speed/speed.go index 4844845..613e0f5 100644 --- a/internal/speed/speed.go +++ b/internal/speed/speed.go @@ -14,6 +14,7 @@ import ( "golang.org/x/crypto/chacha20poly1305" + "github.com/rfjakob/gocryptfs/v2/internal/cryptocore" "github.com/rfjakob/gocryptfs/v2/internal/siv_aead" "github.com/rfjakob/gocryptfs/v2/internal/stupidgcm" ) @@ -31,10 +32,10 @@ func Run() { f func(*testing.B) preferred bool }{ - {name: "AES-GCM-256-OpenSSL", f: bStupidGCM, preferred: stupidgcm.PreferOpenSSL()}, - {name: "AES-GCM-256-Go", f: bGoGCM, preferred: !stupidgcm.PreferOpenSSL()}, - {name: "AES-SIV-512-Go", f: bAESSIV, preferred: false}, - {name: "XChaCha20-Poly1305-Go", f: bChacha20poly1305, preferred: false}, + {name: cryptocore.BackendOpenSSL.Name, f: bStupidGCM, preferred: stupidgcm.PreferOpenSSL()}, + {name: cryptocore.BackendGoGCM.Name, f: bGoGCM, preferred: !stupidgcm.PreferOpenSSL()}, + {name: cryptocore.BackendAESSIV.Name, f: bAESSIV, preferred: false}, + {name: cryptocore.BackendXChaCha20Poly1305.Name, f: bChacha20poly1305, preferred: false}, } for _, b := range bTable { fmt.Printf("%-20s\t", b.name) @@ -46,7 +47,7 @@ func Run() { } if b.preferred { fmt.Printf("\t(selected in auto mode)\n") - } else if b.name == "XChaCha20-Poly1305-Go" { + } else if b.name == cryptocore.BackendXChaCha20Poly1305.Name { fmt.Printf("\t(benchmark only, not selectable yet)\n") } else { fmt.Printf("\t\n")