mirror of
https://github.com/rclone/rclone.git
synced 2025-06-30 22:23:52 +02:00
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:
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user