File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Sources/CryptomatorCryptoLib Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -87,15 +87,15 @@ public class Cryptor {
8787 }
8888
8989 public convenience init ( masterkey: Masterkey , scheme: CryptorScheme ) {
90- let cryptoSupport = CryptoSupport ( )
91- let contentCryptor : ContentCryptor
90+ let defaultCryptoSupport = CryptoSupport ( )
91+ let chosenContentCryptor : ContentCryptor
9292 switch scheme {
9393 case . sivCtrMac:
94- contentCryptor = CtrThenHmacContentCryptor ( macKey: masterkey. macMasterKey, cryptoSupport: cryptoSupport )
94+ chosenContentCryptor = CtrThenHmacContentCryptor ( macKey: masterkey. macMasterKey, cryptoSupport: defaultCryptoSupport )
9595 case . sivGcm:
96- contentCryptor = GcmContentCryptor ( )
96+ chosenContentCryptor = GcmContentCryptor ( )
9797 }
98- self . init ( masterkey: masterkey, cryptoSupport: cryptoSupport , contentCryptor: contentCryptor )
98+ self . init ( masterkey: masterkey, cryptoSupport: defaultCryptoSupport , contentCryptor: chosenContentCryptor )
9999 }
100100
101101 // MARK: - Path Encryption and Decryption
@@ -295,7 +295,6 @@ public class Cryptor {
295295 let header = try decryptHeader ( ciphertextHeader)
296296
297297 // decrypt and write cleartext content:
298- let ciphertextChunkSize = contentCryptor. nonceLen + cleartextChunkSize + contentCryptor. tagLen
299298 var chunkNumber : UInt64 = 0
300299 while ciphertextStream. hasBytesAvailable {
301300 try autoreleasepool {
You can’t perform that action at this time.
0 commit comments