Skip to content

Commit 279adce

Browse files
committed
Fix messages encryption
1 parent fab15b5 commit 279adce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Source/TonSwift/Crypto/AES_CBC.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ public struct AES_CBC {
4141
}
4242

4343
public func encrypt(data: Data) throws -> Data {
44-
var outputBuffer = Array<UInt8>(repeating: 0, count: data.count + kCCBlockSizeAES128)
44+
var outputBuffer = Array<UInt8>(repeating: 0, count: data.count)
4545
var numBytesEncrypted = 0
4646

4747
let status = CCCrypt(CCOperation(kCCEncrypt),
4848
CCAlgorithm(kCCAlgorithmAES),
49-
CCOptions(kCCOptionPKCS7Padding),
49+
CCOptions(0),
5050
Array(key),
5151
kCCKeySizeAES256,
5252
Array(iv),

0 commit comments

Comments
 (0)