From 5c5e00310a4990be5b01e9fb20691fd80987ee64 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Mon, 23 Sep 2024 05:25:38 -0700 Subject: [PATCH] benchmark new --- src/crypt/crypt_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/crypt/crypt_test.go b/src/crypt/crypt_test.go index f2cc79cb4..7c9a2d34c 100644 --- a/src/crypt/crypt_test.go +++ b/src/crypt/crypt_test.go @@ -24,6 +24,20 @@ func BenchmarkDecrypt(b *testing.B) { } } +func BenchmarkNewPbkdf2(b *testing.B) { + b.ResetTimer() + for i := 0; i < b.N; i++ { + New([]byte("password"), nil) + } +} + +func BenchmarkNewArgon2(b *testing.B) { + b.ResetTimer() + for i := 0; i < b.N; i++ { + NewArgon2([]byte("password"), nil) + } +} + func BenchmarkEncryptChaCha(b *testing.B) { bob, _, _ := NewArgon2([]byte("password"), nil) for i := 0; i < b.N; i++ {