From e121555f82fec2c7209658e51d22aadcfa60767c Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Tue, 4 Sep 2018 15:48:57 +0200 Subject: [PATCH] Add Cipher.embedsDigest to signal digest embedding Currently GCM ciphers do. --- TunnelKit/Sources/Core/SessionProxy+Configuration.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/TunnelKit/Sources/Core/SessionProxy+Configuration.swift b/TunnelKit/Sources/Core/SessionProxy+Configuration.swift index 0a0d0bf..d647a8a 100644 --- a/TunnelKit/Sources/Core/SessionProxy+Configuration.swift +++ b/TunnelKit/Sources/Core/SessionProxy+Configuration.swift @@ -55,6 +55,11 @@ extension SessionProxy { /// AES encryption with 256-bit key size and GCM. case aes256gcm = "AES-256-GCM" + + /// Digest should be ignored when this is `true`. + public var embedsDigest: Bool { + return rawValue.hasSuffix("-GCM") + } } /// The available message digest algorithms.