wip
This commit is contained in:
parent
fad7112d69
commit
4399b81ec8
|
@ -39,16 +39,6 @@ final class AESGSMEngine: AES_GCM_Engine {
|
|||
}
|
||||
|
||||
let decryptedData = try AES.GCM.open(sealedBox, using: symmetricKey)
|
||||
// var payload = encoded
|
||||
//
|
||||
// var tag = tag
|
||||
// if tag == nil {
|
||||
// tag = payload.subdata(in: (payload.count - 16) ..< payload.count)
|
||||
// encoded = payload.subdata(in: 0 ..< (payload.count - 16))
|
||||
// }
|
||||
// let sealedBox = try AES.GCM.SealedBox(nonce: AES.GCM.Nonce(data: iv), ciphertext: encoded, tag: tag)
|
||||
// let decryptedData = try AES.GCM.open(sealedBox, using: symmetricKey)
|
||||
//
|
||||
if let output = output {
|
||||
output.pointee = decryptedData
|
||||
}
|
||||
|
|
|
@ -39,21 +39,13 @@ extension String {
|
|||
extension String {
|
||||
var attachmentType: AttachmentType {
|
||||
let ext = (self as NSString).pathExtension.lowercased()
|
||||
|
||||
switch ext {
|
||||
case "mov", "mp4", "avi":
|
||||
return .video
|
||||
|
||||
case "jpg", "png", "gif":
|
||||
if ext.contains("jpeg") || ext.contains("jpg") || ext.contains("png") || ext.contains("gif") {
|
||||
return .image
|
||||
|
||||
case "mp3", "wav", "m4a":
|
||||
} else if ext.contains("mov") || ext.contains("mp4") || ext.contains("avi") {
|
||||
return .video
|
||||
} else if ext.contains("mp3") || ext.contains("wav") || ext.contains("m4a") {
|
||||
return .audio
|
||||
|
||||
case "txt", "doc", "pdf":
|
||||
return .file
|
||||
|
||||
default:
|
||||
} else {
|
||||
return .file
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue