aboutsummaryrefslogtreecommitdiff
path: root/crypto/crypto_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/crypto_test.go')
-rw-r--r--crypto/crypto_test.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/crypto/crypto_test.go b/crypto/crypto_test.go
index 6f5c8f0..fe5edf1 100644
--- a/crypto/crypto_test.go
+++ b/crypto/crypto_test.go
@@ -368,6 +368,18 @@ func BenchmarkUnwrap(b *testing.B) {
}
}
+func BenchmarkUnwrapNolock(b *testing.B) {
+ UseMlock = false
+ defer func() {
+ UseMlock = true
+ }()
+ data, _ := Wrap(fakeWrappingKey, fakeValidPolicyKey)
+
+ for n := 0; n < b.N; n++ {
+ _, _ = Unwrap(fakeWrappingKey, data)
+ }
+}
+
func BenchmarkRandomWrapUnwrap(b *testing.B) {
for n := 0; n < b.N; n++ {
wk, _ := NewRandomKey(InternalKeyLen)