diff --git a/SwCrypt/SwCrypt.swift b/SwCrypt/SwCrypt.swift index 40a7504..6a19078 100644 --- a/SwCrypt/SwCrypt.swift +++ b/SwCrypt/SwCrypt.swift @@ -1,4 +1,5 @@ import Foundation +import CommonCrypto open class SwKeyStore { @@ -724,7 +725,7 @@ open class CC { public static func crypt(_ opMode: OpMode, blockMode: BlockMode, algorithm: Algorithm, padding: Padding, - data: Data, key: Data, iv: Data) throws -> Data { + data: Data, key: Data, iv: Data, options: Int = kCCModeOptionCTR_BE) throws -> Data { if blockMode.needIV { guard iv.count == algorithm.blockSize else { throw CCError(.paramError) } } @@ -736,7 +737,7 @@ open class CC { algorithm.rawValue, padding.rawValue, ivBytes, keyBytes, key.count, nil, 0, 0, - CCModeOptions(), &cryptor) + CCModeOptions(options), &cryptor) }) guard status == noErr else { throw CCError(status) }