Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions SwCrypt/SwCrypt.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Foundation
import CommonCrypto

open class SwKeyStore {

Expand Down Expand Up @@ -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) }
}
Expand All @@ -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) }
Expand Down