1
1
Fork 0
mirror of https://github.com/schollz/croc.git synced 2025-10-11 05:11:06 +02:00

benchmark new

This commit is contained in:
Zack Scholl 2024-09-23 05:25:38 -07:00
parent 9be175f1b0
commit 5c5e00310a

View file

@ -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) { func BenchmarkEncryptChaCha(b *testing.B) {
bob, _, _ := NewArgon2([]byte("password"), nil) bob, _, _ := NewArgon2([]byte("password"), nil)
for i := 0; i < b.N; i++ { for i := 0; i < b.N; i++ {