forked from TrueCloudLab/rclone
cryptdecode: use Cipher instead of NewFs (#2087)
* crypt: extract NewCipher out of NewFs * cryptdecode: make use of crypt.NewCipher Fixes #2075
This commit is contained in:
parent
aeefa34f62
commit
00adf40f9f
3 changed files with 40 additions and 40 deletions
|
@ -91,6 +91,8 @@ type Cipher interface {
|
|||
EncryptedSize(int64) int64
|
||||
// DecryptedSize calculates the size of the data when decrypted
|
||||
DecryptedSize(int64) (int64, error)
|
||||
// NameEncryptionMode returns the used mode for name handling
|
||||
NameEncryptionMode() NameEncryptionMode
|
||||
}
|
||||
|
||||
// NameEncryptionMode is the type of file name encryption in use
|
||||
|
@ -547,6 +549,10 @@ func (c *cipher) DecryptDirName(in string) (string, error) {
|
|||
return c.decryptFileName(in)
|
||||
}
|
||||
|
||||
func (c *cipher) NameEncryptionMode() NameEncryptionMode {
|
||||
return c.mode
|
||||
}
|
||||
|
||||
// nonce is an NACL secretbox nonce
|
||||
type nonce [fileNonceSize]byte
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue