xcode版本:9.3.1(9E145)
Swift版本:4.1
我刚刚下载了最新的主副本,并使用CocoaPods安装了CryptoSwift。使用自述文件中给出的示例:
do {
// In combined mode, the authentication tag is directly appended to the encrypted message. This is usually what you want.
let gcm = GCM(iv: iv, mode: .combined)
let aes = try AES(key: key, blockMode: gcm, padding: .noPadding)
let encrypted = try aes.encrypt(plaintext)
let tag = gcm.authenticationTag
catch {
// failed
}
我收到“使用未解析的标识符'GCM'”的错误。我尝试过其他功能,如aes.encrypt和aes.decrypt,它们都运行良好
答案 0 :(得分:0)
GCM是Crypto Swift的一部分,因此您应该导入缺少的Crypto swift,我认为因此请先将其导入您的控制器中
导入CryptoSwift