From 1d0a442405e8fc7a0742a8f8db2ea0f874f750a5 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 29 Nov 2015 19:57:48 +0100 Subject: OpenDir performance: Read DirIV once and reuse it for all names Formerly, we called decryptPath for every name. That resulted in a directory walk that reads in all diriv files on the way. Massive improvement for RM and LS (check performance.txt for details) VERSION UNTAR RM LS v0.4 48 5 1.5 v0.5-rc1 56 19 7 v0.5-rc1-1 54 9 4.1 <---- THIS VERSION --- cryptfs/cryptfs_names.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cryptfs/cryptfs_names.go') diff --git a/cryptfs/cryptfs_names.go b/cryptfs/cryptfs_names.go index 2a5f158..8f8486b 100644 --- a/cryptfs/cryptfs_names.go +++ b/cryptfs/cryptfs_names.go @@ -17,7 +17,7 @@ const ( ) // DecryptName - decrypt base64-encoded encrypted filename "cipherName" -func (be *CryptFS) decryptName(cipherName string, iv []byte) (string, error) { +func (be *CryptFS) DecryptName(cipherName string, iv []byte) (string, error) { // Make sure relative symlinks still work after encryption // by passing these through unchanged @@ -91,7 +91,7 @@ func (be *CryptFS) TranslatePathZeroIV(path string, op int) (string, error) { if op == OpEncrypt { newPart = be.encryptName(part, zeroIV) } else { - newPart, err = be.decryptName(part, zeroIV) + newPart, err = be.DecryptName(part, zeroIV) if err != nil { return "", err } -- cgit v1.2.3