summaryrefslogtreecommitdiff
path: root/openssl_benchmark
diff options
context:
space:
mode:
Diffstat (limited to 'openssl_benchmark')
-rw-r--r--openssl_benchmark/openssl_test.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/openssl_benchmark/openssl_test.go b/openssl_benchmark/openssl_test.go
index 76c68a8..35abca7 100644
--- a/openssl_benchmark/openssl_test.go
+++ b/openssl_benchmark/openssl_test.go
@@ -2,6 +2,8 @@ package benchmark
// Benchmark go built-int GCM against spacemonkey openssl bindings
//
+// Note: This is deprecated in favor of the benchmarks integrated in cryptfs.
+//
// Run benchmark:
// go test -bench=.
@@ -33,10 +35,11 @@ func BenchmarkGoEnc4K(b *testing.B) {
aes, _ := aes.NewCipher(key[:])
aesgcm, _ := cipher.NewGCM(aes)
var out []byte
-
+ // This would be fileID + blockNo
+ aData := make([]byte, 24)
b.ResetTimer()
for i := 0; i < b.N; i++ {
- out = aesgcm.Seal(out[:0], nonce[:], buf, nil)
+ out = aesgcm.Seal(out[:0], nonce[:], buf, aData)
}
}
@@ -67,6 +70,9 @@ func BenchmarkOpensslEnc4K(b *testing.B) {
var key [cryptfs.KEY_LEN]byte
var nonce [12]byte
+ // This would be fileID + blockNo
+ aData := make([]byte, 24)
+
var ciphertext bytes.Buffer
var part []byte
@@ -77,6 +83,10 @@ func BenchmarkOpensslEnc4K(b *testing.B) {
if err != nil {
b.FailNow()
}
+ err = ectx.ExtraData(aData)
+ if err != nil {
+ b.FailNow()
+ }
part, err = ectx.EncryptUpdate(buf)
if err != nil {
b.FailNow()