-- |
-- Module      : Network.TLS.Extra.Cipher
-- License     : BSD-style
-- Maintainer  : Vincent Hanquez <vincent@snarc.org>
-- Stability   : experimental
-- Portability : unknown
--
module Network.TLS.Extra.Cipher
    (
    -- * cipher suite
      ciphersuite_default
    , ciphersuite_default_det
    , ciphersuite_all
    , ciphersuite_all_det
    , ciphersuite_medium
    , ciphersuite_strong
    , ciphersuite_strong_det
    , ciphersuite_unencrypted
    , ciphersuite_dhe_rsa
    , ciphersuite_dhe_dss
    -- * individual ciphers
    , cipher_null_SHA1
    , cipher_AES128_SHA1
    , cipher_AES256_SHA1
    , cipher_AES128_SHA256
    , cipher_AES256_SHA256
    , cipher_AES128CCM_SHA256
    , cipher_AES128CCM8_SHA256
    , cipher_AES128GCM_SHA256
    , cipher_AES256CCM_SHA256
    , cipher_AES256CCM8_SHA256
    , cipher_AES256GCM_SHA384
    , cipher_DHE_RSA_AES128_SHA1
    , cipher_DHE_RSA_AES256_SHA1
    , cipher_DHE_RSA_AES128_SHA256
    , cipher_DHE_RSA_AES256_SHA256
    , cipher_DHE_DSS_AES128_SHA1
    , cipher_DHE_DSS_AES256_SHA1
    , cipher_DHE_RSA_AES128CCM_SHA256
    , cipher_DHE_RSA_AES128CCM8_SHA256
    , cipher_DHE_RSA_AES128GCM_SHA256
    , cipher_DHE_RSA_AES256CCM_SHA256
    , cipher_DHE_RSA_AES256CCM8_SHA256
    , cipher_DHE_RSA_AES256GCM_SHA384
    , cipher_DHE_RSA_CHACHA20POLY1305_SHA256
    , cipher_ECDHE_RSA_AES128GCM_SHA256
    , cipher_ECDHE_RSA_AES256GCM_SHA384
    , cipher_ECDHE_RSA_AES128CBC_SHA256
    , cipher_ECDHE_RSA_AES128CBC_SHA
    , cipher_ECDHE_RSA_AES256CBC_SHA
    , cipher_ECDHE_RSA_AES256CBC_SHA384
    , cipher_ECDHE_RSA_CHACHA20POLY1305_SHA256
    , cipher_ECDHE_ECDSA_AES128CBC_SHA
    , cipher_ECDHE_ECDSA_AES256CBC_SHA
    , cipher_ECDHE_ECDSA_AES128CBC_SHA256
    , cipher_ECDHE_ECDSA_AES256CBC_SHA384
    , cipher_ECDHE_ECDSA_AES128CCM_SHA256
    , cipher_ECDHE_ECDSA_AES128CCM8_SHA256
    , cipher_ECDHE_ECDSA_AES128GCM_SHA256
    , cipher_ECDHE_ECDSA_AES256CCM_SHA256
    , cipher_ECDHE_ECDSA_AES256CCM8_SHA256
    , cipher_ECDHE_ECDSA_AES256GCM_SHA384
    , cipher_ECDHE_ECDSA_CHACHA20POLY1305_SHA256
    -- TLS 1.3
    , cipher_TLS13_AES128GCM_SHA256
    , cipher_TLS13_AES256GCM_SHA384
    , cipher_TLS13_CHACHA20POLY1305_SHA256
    , cipher_TLS13_AES128CCM_SHA256
    , cipher_TLS13_AES128CCM8_SHA256
    -- * obsolete and non-standard ciphers
    , cipher_RSA_3DES_EDE_CBC_SHA1
    , cipher_RC4_128_MD5
    , cipher_RC4_128_SHA1
    , cipher_null_MD5
    , cipher_DHE_DSS_RC4_SHA1
    ) where

import qualified Data.ByteString as B

import Network.TLS.Types (Version(..))
import Network.TLS.Cipher
import Network.TLS.Imports
import Data.Tuple (swap)

import Crypto.Cipher.AES
import qualified Crypto.Cipher.ChaChaPoly1305 as ChaChaPoly1305
import qualified Crypto.Cipher.RC4 as RC4
import Crypto.Cipher.TripleDES
import Crypto.Cipher.Types hiding (Cipher, cipherName)
import Crypto.Error
import qualified Crypto.MAC.Poly1305 as Poly1305
import Crypto.System.CPU

takelast :: Int -> B.ByteString -> B.ByteString
takelast :: Int -> ByteString -> ByteString
takelast Int
i ByteString
b = Int -> ByteString -> ByteString
B.drop (ByteString -> Int
B.length ByteString
b Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
i) ByteString
b

aes128cbc :: BulkDirection -> BulkKey -> BulkBlock
aes128cbc :: BulkDirection -> ByteString -> BulkBlock
aes128cbc BulkDirection
BulkEncrypt ByteString
key =
    let ctx :: AES128
ctx = CryptoFailable AES128 -> AES128
forall a. CryptoFailable a -> a
noFail (ByteString -> CryptoFailable AES128
forall cipher key.
(Cipher cipher, ByteArray key) =>
key -> CryptoFailable cipher
cipherInit ByteString
key) :: AES128
     in (\ByteString
iv ByteString
input -> let output :: ByteString
output = AES128 -> IV AES128 -> ByteString -> ByteString
forall cipher ba.
(BlockCipher cipher, ByteArray ba) =>
cipher -> IV cipher -> ba -> ba
cbcEncrypt AES128
ctx (ByteString -> IV AES128
forall a. BlockCipher a => ByteString -> IV a
makeIV_ ByteString
iv) ByteString
input in (ByteString
output, Int -> ByteString -> ByteString
takelast Int
16 ByteString
output))
aes128cbc BulkDirection
BulkDecrypt ByteString
key =
    let ctx :: AES128
ctx = CryptoFailable AES128 -> AES128
forall a. CryptoFailable a -> a
noFail (ByteString -> CryptoFailable AES128
forall cipher key.
(Cipher cipher, ByteArray key) =>
key -> CryptoFailable cipher
cipherInit ByteString
key) :: AES128
     in (\ByteString
iv ByteString
input -> let output :: ByteString
output = AES128 -> IV AES128 -> ByteString -> ByteString
forall cipher ba.
(BlockCipher cipher, ByteArray ba) =>
cipher -> IV cipher -> ba -> ba
cbcDecrypt AES128
ctx (ByteString -> IV AES128
forall a. BlockCipher a => ByteString -> IV a
makeIV_ ByteString
iv) ByteString
input in (ByteString
output, Int -> ByteString -> ByteString
takelast Int
16 ByteString
input))

aes256cbc :: BulkDirection -> BulkKey -> BulkBlock
aes256cbc :: BulkDirection -> ByteString -> BulkBlock
aes256cbc BulkDirection
BulkEncrypt ByteString
key =
    let ctx :: AES256
ctx = CryptoFailable AES256 -> AES256
forall a. CryptoFailable a -> a
noFail (ByteString -> CryptoFailable AES256
forall cipher key.
(Cipher cipher, ByteArray key) =>
key -> CryptoFailable cipher
cipherInit ByteString
key) :: AES256
     in (\ByteString
iv ByteString
input -> let output :: ByteString
output = AES256 -> IV AES256 -> ByteString -> ByteString
forall cipher ba.
(BlockCipher cipher, ByteArray ba) =>
cipher -> IV cipher -> ba -> ba
cbcEncrypt AES256
ctx (ByteString -> IV AES256
forall a. BlockCipher a => ByteString -> IV a
makeIV_ ByteString
iv) ByteString
input in (ByteString
output, Int -> ByteString -> ByteString
takelast Int
16 ByteString
output))
aes256cbc BulkDirection
BulkDecrypt ByteString
key =
    let ctx :: AES256
ctx = CryptoFailable AES256 -> AES256
forall a. CryptoFailable a -> a
noFail (ByteString -> CryptoFailable AES256
forall cipher key.
(Cipher cipher, ByteArray key) =>
key -> CryptoFailable cipher
cipherInit ByteString
key) :: AES256
     in (\ByteString
iv ByteString
input -> let output :: ByteString
output = AES256 -> IV AES256 -> ByteString -> ByteString
forall cipher ba.
(BlockCipher cipher, ByteArray ba) =>
cipher -> IV cipher -> ba -> ba
cbcDecrypt AES256
ctx (ByteString -> IV AES256
forall a. BlockCipher a => ByteString -> IV a
makeIV_ ByteString
iv) ByteString
input in (ByteString
output, Int -> ByteString -> ByteString
takelast Int
16 ByteString
input))

aes128ccm :: BulkDirection -> BulkKey -> BulkAEAD
aes128ccm :: BulkDirection -> ByteString -> BulkAEAD
aes128ccm BulkDirection
BulkEncrypt ByteString
key =
    let ctx :: AES128
ctx = CryptoFailable AES128 -> AES128
forall a. CryptoFailable a -> a
noFail (ByteString -> CryptoFailable AES128
forall cipher key.
(Cipher cipher, ByteArray key) =>
key -> CryptoFailable cipher
cipherInit ByteString
key) :: AES128
     in (\ByteString
nonce ByteString
d ByteString
ad ->
            let mode :: AEADMode
mode = Int -> CCM_M -> CCM_L -> AEADMode
AEAD_CCM (ByteString -> Int
B.length ByteString
d) CCM_M
CCM_M16 CCM_L
CCM_L3
                aeadIni :: AEAD AES128
aeadIni = CryptoFailable (AEAD AES128) -> AEAD AES128
forall a. CryptoFailable a -> a
noFail (AEADMode -> AES128 -> ByteString -> CryptoFailable (AEAD AES128)
forall cipher iv.
(BlockCipher cipher, ByteArrayAccess iv) =>
AEADMode -> cipher -> iv -> CryptoFailable (AEAD cipher)
aeadInit AEADMode
mode AES128
ctx ByteString
nonce)
             in (AuthTag, ByteString) -> (ByteString, AuthTag)
forall a b. (a, b) -> (b, a)
swap ((AuthTag, ByteString) -> (ByteString, AuthTag))
-> (AuthTag, ByteString) -> (ByteString, AuthTag)
forall a b. (a -> b) -> a -> b
$ AEAD AES128
-> ByteString -> ByteString -> Int -> (AuthTag, ByteString)
forall aad ba a.
(ByteArrayAccess aad, ByteArray ba) =>
AEAD a -> aad -> ba -> Int -> (AuthTag, ba)
aeadSimpleEncrypt AEAD AES128
aeadIni ByteString
ad ByteString
d Int
16)
aes128ccm BulkDirection
BulkDecrypt ByteString
key =
    let ctx :: AES128
ctx = CryptoFailable AES128 -> AES128
forall a. CryptoFailable a -> a
noFail (ByteString -> CryptoFailable AES128
forall cipher key.
(Cipher cipher, ByteArray key) =>
key -> CryptoFailable cipher
cipherInit ByteString
key) :: AES128
     in (\ByteString
nonce ByteString
d ByteString
ad ->
            let mode :: AEADMode
mode = Int -> CCM_M -> CCM_L -> AEADMode
AEAD_CCM (ByteString -> Int
B.length ByteString
d) CCM_M
CCM_M16 CCM_L
CCM_L3
                aeadIni :: AEAD AES128
aeadIni = CryptoFailable (AEAD AES128) -> AEAD AES128
forall a. CryptoFailable a -> a
noFail (AEADMode -> AES128 -> ByteString -> CryptoFailable (AEAD AES128)
forall cipher iv.
(BlockCipher cipher, ByteArrayAccess iv) =>
AEADMode -> cipher -> iv -> CryptoFailable (AEAD cipher)
aeadInit AEADMode
mode AES128
ctx ByteString
nonce)
             in AEAD AES128
-> ByteString -> ByteString -> Int -> (ByteString, AuthTag)
forall cipher.
AEAD cipher
-> ByteString -> ByteString -> Int -> (ByteString, AuthTag)
simpleDecrypt AEAD AES128
aeadIni ByteString
ad ByteString
d Int
16)

aes128ccm8 :: BulkDirection -> BulkKey -> BulkAEAD
aes128ccm8 :: BulkDirection -> ByteString -> BulkAEAD
aes128ccm8 BulkDirection
BulkEncrypt ByteString
key =
    let ctx :: AES128
ctx = CryptoFailable AES128 -> AES128
forall a. CryptoFailable a -> a
noFail (ByteString -> CryptoFailable AES128
forall cipher key.
(Cipher cipher, ByteArray key) =>
key -> CryptoFailable cipher
cipherInit ByteString
key) :: AES128
     in (\ByteString
nonce ByteString
d ByteString
ad ->
            let mode :: AEADMode
mode = Int -> CCM_M -> CCM_L -> AEADMode
AEAD_CCM (ByteString -> Int
B.length ByteString
d) CCM_M
CCM_M8 CCM_L
CCM_L3
                aeadIni :: AEAD AES128
aeadIni = CryptoFailable (AEAD AES128) -> AEAD AES128
forall a. CryptoFailable a -> a
noFail (AEADMode -> AES128 -> ByteString -> CryptoFailable (AEAD AES128)
forall cipher iv.
(BlockCipher cipher, ByteArrayAccess iv) =>
AEADMode -> cipher -> iv -> CryptoFailable (AEAD cipher)
aeadInit AEADMode
mode AES128
ctx ByteString
nonce)
             in (AuthTag, ByteString) -> (ByteString, AuthTag)
forall a b. (a, b) -> (b, a)
swap ((AuthTag, ByteString) -> (ByteString, AuthTag))
-> (AuthTag, ByteString) -> (ByteString, AuthTag)
forall a b. (a -> b) -> a -> b
$ AEAD AES128
-> ByteString -> ByteString -> Int -> (AuthTag, ByteString)
forall aad ba a.
(ByteArrayAccess aad, ByteArray ba) =>
AEAD a -> aad -> ba -> Int -> (AuthTag, ba)
aeadSimpleEncrypt AEAD AES128
aeadIni ByteString
ad ByteString
d Int
8)
aes128ccm8 BulkDirection
BulkDecrypt ByteString
key =
    let ctx :: AES128
ctx = CryptoFailable AES128 -> AES128
forall a. CryptoFailable a -> a
noFail (ByteString -> CryptoFailable AES128
forall cipher key.
(Cipher cipher, ByteArray key) =>
key -> CryptoFailable cipher
cipherInit ByteString
key) :: AES128
     in (\ByteString
nonce ByteString
d ByteString
ad ->
            let mode :: AEADMode
mode = Int -> CCM_M -> CCM_L -> AEADMode
AEAD_CCM (ByteString -> Int
B.length ByteString
d) CCM_M
CCM_M8 CCM_L
CCM_L3
                aeadIni :: AEAD AES128
aeadIni = CryptoFailable (AEAD AES128) -> AEAD AES128
forall a. CryptoFailable a -> a
noFail (AEADMode -> AES128 -> ByteString -> CryptoFailable (AEAD AES128)
forall cipher iv.
(BlockCipher cipher, ByteArrayAccess iv) =>
AEADMode -> cipher -> iv -> CryptoFailable (AEAD cipher)
aeadInit AEADMode
mode AES128
ctx ByteString
nonce)
             in AEAD AES128
-> ByteString -> ByteString -> Int -> (ByteString, AuthTag)
forall cipher.
AEAD cipher
-> ByteString -> ByteString -> Int -> (ByteString, AuthTag)
simpleDecrypt AEAD AES128
aeadIni ByteString
ad ByteString
d Int
8)

aes128gcm :: BulkDirection -> BulkKey -> BulkAEAD
aes128gcm :: BulkDirection -> ByteString -> BulkAEAD
aes128gcm BulkDirection
BulkEncrypt ByteString
key =
    let ctx :: AES128
ctx = CryptoFailable AES128 -> AES128
forall a. CryptoFailable a -> a
noFail (ByteString -> CryptoFailable AES128
forall cipher key.
(Cipher cipher, ByteArray key) =>
key -> CryptoFailable cipher
cipherInit ByteString
key) :: AES128
     in (\ByteString
nonce ByteString
d ByteString
ad ->
            let aeadIni :: AEAD AES128
aeadIni = CryptoFailable (AEAD AES128) -> AEAD AES128
forall a. CryptoFailable a -> a
noFail (AEADMode -> AES128 -> ByteString -> CryptoFailable (AEAD AES128)
forall cipher iv.
(BlockCipher cipher, ByteArrayAccess iv) =>
AEADMode -> cipher -> iv -> CryptoFailable (AEAD cipher)
aeadInit AEADMode
AEAD_GCM AES128
ctx ByteString
nonce)
             in (AuthTag, ByteString) -> (ByteString, AuthTag)
forall a b. (a, b) -> (b, a)
swap ((AuthTag, ByteString) -> (ByteString, AuthTag))
-> (AuthTag, ByteString) -> (ByteString, AuthTag)
forall a b. (a -> b) -> a -> b
$ AEAD AES128
-> ByteString -> ByteString -> Int -> (AuthTag, ByteString)
forall aad ba a.
(ByteArrayAccess aad, ByteArray ba) =>
AEAD a -> aad -> ba -> Int -> (AuthTag, ba)
aeadSimpleEncrypt AEAD AES128
aeadIni ByteString
ad ByteString
d Int
16)
aes128gcm BulkDirection
BulkDecrypt ByteString
key =
    let ctx :: AES128
ctx = CryptoFailable AES128 -> AES128
forall a. CryptoFailable a -> a
noFail (ByteString -> CryptoFailable AES128
forall cipher key.
(Cipher cipher, ByteArray key) =>
key -> CryptoFailable cipher
cipherInit ByteString
key) :: AES128
     in (\ByteString
nonce ByteString
d ByteString
ad ->
            let aeadIni :: AEAD AES128
aeadIni = CryptoFailable (AEAD AES128) -> AEAD AES128
forall a. CryptoFailable a -> a
noFail (AEADMode -> AES128 -> ByteString -> CryptoFailable (AEAD AES128)
forall cipher iv.
(BlockCipher cipher, ByteArrayAccess iv) =>
AEADMode -> cipher -> iv -> CryptoFailable (AEAD cipher)
aeadInit AEADMode
AEAD_GCM AES128
ctx ByteString
nonce)
             in AEAD AES128
-> ByteString -> ByteString -> Int -> (ByteString, AuthTag)
forall cipher.
AEAD cipher
-> ByteString -> ByteString -> Int -> (ByteString, AuthTag)
simpleDecrypt AEAD AES128
aeadIni ByteString
ad ByteString
d Int
16)

aes256ccm :: BulkDirection -> BulkKey -> BulkAEAD
aes256ccm :: BulkDirection -> ByteString -> BulkAEAD
aes256ccm BulkDirection
BulkEncrypt ByteString
key =
    let ctx :: AES256
ctx = CryptoFailable AES256 -> AES256
forall a. CryptoFailable a -> a
noFail (ByteString -> CryptoFailable AES256
forall cipher key.
(Cipher cipher, ByteArray key) =>
key -> CryptoFailable cipher
cipherInit ByteString
key) :: AES256
     in (\ByteString
nonce ByteString
d ByteString
ad ->
            let mode :: AEADMode
mode = Int -> CCM_M -> CCM_L -> AEADMode
AEAD_CCM (ByteString -> Int
B.length ByteString
d) CCM_M
CCM_M16 CCM_L
CCM_L3
                aeadIni :: AEAD AES256
aeadIni = CryptoFailable (AEAD AES256) -> AEAD AES256
forall a. CryptoFailable a -> a
noFail (AEADMode -> AES256 -> ByteString -> CryptoFailable (AEAD AES256)
forall cipher iv.
(BlockCipher cipher, ByteArrayAccess iv) =>
AEADMode -> cipher -> iv -> CryptoFailable (AEAD cipher)
aeadInit AEADMode
mode AES256
ctx ByteString
nonce)
             in (AuthTag, ByteString) -> (ByteString, AuthTag)
forall a b. (a, b) -> (b, a)
swap ((AuthTag, ByteString) -> (ByteString, AuthTag))
-> (AuthTag, ByteString) -> (ByteString, AuthTag)
forall a b. (a -> b) -> a -> b
$ AEAD AES256
-> ByteString -> ByteString -> Int -> (AuthTag, ByteString)
forall aad ba a.
(ByteArrayAccess aad, ByteArray ba) =>
AEAD a -> aad -> ba -> Int -> (AuthTag, ba)
aeadSimpleEncrypt AEAD AES256
aeadIni ByteString
ad ByteString
d Int
16)
aes256ccm BulkDirection
BulkDecrypt ByteString
key =
    let ctx :: AES256
ctx = CryptoFailable AES256 -> AES256
forall a. CryptoFailable a -> a
noFail (ByteString -> CryptoFailable AES256
forall cipher key.
(Cipher cipher, ByteArray key) =>
key -> CryptoFailable cipher
cipherInit ByteString
key) :: AES256
     in (\ByteString
nonce ByteString
d ByteString
ad ->
            let mode :: AEADMode
mode = Int -> CCM_M -> CCM_L -> AEADMode
AEAD_CCM (ByteString -> Int
B.length ByteString
d) CCM_M
CCM_M16 CCM_L
CCM_L3
                aeadIni :: AEAD AES256
aeadIni = CryptoFailable (AEAD AES256) -> AEAD AES256
forall a. CryptoFailable a -> a
noFail (AEADMode -> AES256 -> ByteString -> CryptoFailable (AEAD AES256)
forall cipher iv.
(BlockCipher cipher, ByteArrayAccess iv) =>
AEADMode -> cipher -> iv -> CryptoFailable (AEAD cipher)
aeadInit AEADMode
mode AES256
ctx ByteString
nonce)
             in AEAD AES256
-> ByteString -> ByteString -> Int -> (ByteString, AuthTag)
forall cipher.
AEAD cipher
-> ByteString -> ByteString -> Int -> (ByteString, AuthTag)
simpleDecrypt AEAD AES256
aeadIni ByteString
ad ByteString
d Int
16)

aes256ccm8 :: BulkDirection -> BulkKey -> BulkAEAD
aes256ccm8 :: BulkDirection -> ByteString -> BulkAEAD
aes256ccm8 BulkDirection
BulkEncrypt ByteString
key =
    let ctx :: AES256
ctx = CryptoFailable AES256 -> AES256
forall a. CryptoFailable a -> a
noFail (ByteString -> CryptoFailable AES256
forall cipher key.
(Cipher cipher, ByteArray key) =>
key -> CryptoFailable cipher
cipherInit ByteString
key) :: AES256
     in (\ByteString
nonce ByteString
d ByteString
ad ->
            let mode :: AEADMode
mode = Int -> CCM_M -> CCM_L -> AEADMode
AEAD_CCM (ByteString -> Int
B.length ByteString
d) CCM_M
CCM_M8 CCM_L
CCM_L3
                aeadIni :: AEAD AES256
aeadIni = CryptoFailable (AEAD AES256) -> AEAD AES256
forall a. CryptoFailable a -> a
noFail (AEADMode -> AES256 -> ByteString -> CryptoFailable (AEAD AES256)
forall cipher iv.
(BlockCipher cipher, ByteArrayAccess iv) =>
AEADMode -> cipher -> iv -> CryptoFailable (AEAD cipher)
aeadInit AEADMode
mode AES256
ctx ByteString
nonce)
             in (AuthTag, ByteString) -> (ByteString, AuthTag)
forall a b. (a, b) -> (b, a)
swap ((AuthTag, ByteString) -> (ByteString, AuthTag))
-> (AuthTag, ByteString) -> (ByteString, AuthTag)
forall a b. (a -> b) -> a -> b
$ AEAD AES256
-> ByteString -> ByteString -> Int -> (AuthTag, ByteString)
forall aad ba a.
(ByteArrayAccess aad, ByteArray ba) =>
AEAD a -> aad -> ba -> Int -> (AuthTag, ba)
aeadSimpleEncrypt AEAD AES256
aeadIni ByteString
ad ByteString
d Int
8)
aes256ccm8 BulkDirection
BulkDecrypt ByteString
key =
    let ctx :: AES256
ctx = CryptoFailable AES256 -> AES256
forall a. CryptoFailable a -> a
noFail (ByteString -> CryptoFailable AES256
forall cipher key.
(Cipher cipher, ByteArray key) =>
key -> CryptoFailable cipher
cipherInit ByteString
key) :: AES256
     in (\ByteString
nonce ByteString
d ByteString
ad ->
            let mode :: AEADMode
mode = Int -> CCM_M -> CCM_L -> AEADMode
AEAD_CCM (ByteString -> Int
B.length ByteString
d) CCM_M
CCM_M8 CCM_L
CCM_L3
                aeadIni :: AEAD AES256
aeadIni = CryptoFailable (AEAD AES256) -> AEAD AES256
forall a. CryptoFailable a -> a
noFail (AEADMode -> AES256 -> ByteString -> CryptoFailable (AEAD AES256)
forall cipher iv.
(BlockCipher cipher, ByteArrayAccess iv) =>
AEADMode -> cipher -> iv -> CryptoFailable (AEAD cipher)
aeadInit AEADMode
mode AES256
ctx ByteString
nonce)
             in AEAD AES256
-> ByteString -> ByteString -> Int -> (ByteString, AuthTag)
forall cipher.
AEAD cipher
-> ByteString -> ByteString -> Int -> (ByteString, AuthTag)
simpleDecrypt AEAD AES256
aeadIni ByteString
ad ByteString
d Int
8)

aes256gcm :: BulkDirection -> BulkKey -> BulkAEAD
aes256gcm :: BulkDirection -> ByteString -> BulkAEAD
aes256gcm BulkDirection
BulkEncrypt ByteString
key =
    let ctx :: AES256
ctx = CryptoFailable AES256 -> AES256
forall a. CryptoFailable a -> a
noFail (ByteString -> CryptoFailable AES256
forall cipher key.
(Cipher cipher, ByteArray key) =>
key -> CryptoFailable cipher
cipherInit ByteString
key) :: AES256
     in (\ByteString
nonce ByteString
d ByteString
ad ->
            let aeadIni :: AEAD AES256
aeadIni = CryptoFailable (AEAD AES256) -> AEAD AES256
forall a. CryptoFailable a -> a
noFail (AEADMode -> AES256 -> ByteString -> CryptoFailable (AEAD AES256)
forall cipher iv.
(BlockCipher cipher, ByteArrayAccess iv) =>
AEADMode -> cipher -> iv -> CryptoFailable (AEAD cipher)
aeadInit AEADMode
AEAD_GCM AES256
ctx ByteString
nonce)
             in (AuthTag, ByteString) -> (ByteString, AuthTag)
forall a b. (a, b) -> (b, a)
swap ((AuthTag, ByteString) -> (ByteString, AuthTag))
-> (AuthTag, ByteString) -> (ByteString, AuthTag)
forall a b. (a -> b) -> a -> b
$ AEAD AES256
-> ByteString -> ByteString -> Int -> (AuthTag, ByteString)
forall aad ba a.
(ByteArrayAccess aad, ByteArray ba) =>
AEAD a -> aad -> ba -> Int -> (AuthTag, ba)
aeadSimpleEncrypt AEAD AES256
aeadIni ByteString
ad ByteString
d Int
16)
aes256gcm BulkDirection
BulkDecrypt ByteString
key =
    let ctx :: AES256
ctx = CryptoFailable AES256 -> AES256
forall a. CryptoFailable a -> a
noFail (ByteString -> CryptoFailable AES256
forall cipher key.
(Cipher cipher, ByteArray key) =>
key -> CryptoFailable cipher
cipherInit ByteString
key) :: AES256
     in (\ByteString
nonce ByteString
d ByteString
ad ->
            let aeadIni :: AEAD AES256
aeadIni = CryptoFailable (AEAD AES256) -> AEAD AES256
forall a. CryptoFailable a -> a
noFail (AEADMode -> AES256 -> ByteString -> CryptoFailable (AEAD AES256)
forall cipher iv.
(BlockCipher cipher, ByteArrayAccess iv) =>
AEADMode -> cipher -> iv -> CryptoFailable (AEAD cipher)
aeadInit AEADMode
AEAD_GCM AES256
ctx ByteString
nonce)
             in AEAD AES256
-> ByteString -> ByteString -> Int -> (ByteString, AuthTag)
forall cipher.
AEAD cipher
-> ByteString -> ByteString -> Int -> (ByteString, AuthTag)
simpleDecrypt AEAD AES256
aeadIni ByteString
ad ByteString
d Int
16)

simpleDecrypt :: AEAD cipher -> B.ByteString -> B.ByteString -> Int -> (B.ByteString, AuthTag)
simpleDecrypt :: AEAD cipher
-> ByteString -> ByteString -> Int -> (ByteString, AuthTag)
simpleDecrypt AEAD cipher
aeadIni ByteString
header ByteString
input Int
taglen = (ByteString
output, AuthTag
tag)
  where
        aead :: AEAD cipher
aead                = AEAD cipher -> ByteString -> AEAD cipher
forall aad cipher.
ByteArrayAccess aad =>
AEAD cipher -> aad -> AEAD cipher
aeadAppendHeader AEAD cipher
aeadIni ByteString
header
        (ByteString
output, AEAD cipher
aeadFinal) = AEAD cipher -> ByteString -> (ByteString, AEAD cipher)
forall ba cipher.
ByteArray ba =>
AEAD cipher -> ba -> (ba, AEAD cipher)
aeadDecrypt AEAD cipher
aead ByteString
input
        tag :: AuthTag
tag                 = AEAD cipher -> Int -> AuthTag
forall cipher. AEAD cipher -> Int -> AuthTag
aeadFinalize AEAD cipher
aeadFinal Int
taglen

noFail :: CryptoFailable a -> a
noFail :: CryptoFailable a -> a
noFail = CryptoFailable a -> a
forall a. CryptoFailable a -> a
throwCryptoError

makeIV_ :: BlockCipher a => B.ByteString -> IV a
makeIV_ :: ByteString -> IV a
makeIV_ = IV a -> Maybe (IV a) -> IV a
forall a. a -> Maybe a -> a
fromMaybe ([Char] -> IV a
forall a. HasCallStack => [Char] -> a
error [Char]
"makeIV_") (Maybe (IV a) -> IV a)
-> (ByteString -> Maybe (IV a)) -> ByteString -> IV a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ByteString -> Maybe (IV a)
forall b c. (ByteArrayAccess b, BlockCipher c) => b -> Maybe (IV c)
makeIV

tripledes_ede :: BulkDirection -> BulkKey -> BulkBlock
tripledes_ede :: BulkDirection -> ByteString -> BulkBlock
tripledes_ede BulkDirection
BulkEncrypt ByteString
key =
    let ctx :: DES_EDE3
ctx = CryptoFailable DES_EDE3 -> DES_EDE3
forall a. CryptoFailable a -> a
noFail (CryptoFailable DES_EDE3 -> DES_EDE3)
-> CryptoFailable DES_EDE3 -> DES_EDE3
forall a b. (a -> b) -> a -> b
$ ByteString -> CryptoFailable DES_EDE3
forall cipher key.
(Cipher cipher, ByteArray key) =>
key -> CryptoFailable cipher
cipherInit ByteString
key
     in (\ByteString
iv ByteString
input -> let output :: ByteString
output = DES_EDE3 -> IV DES_EDE3 -> ByteString -> ByteString
forall cipher ba.
(BlockCipher cipher, ByteArray ba) =>
cipher -> IV cipher -> ba -> ba
cbcEncrypt DES_EDE3
ctx (ByteString -> IV DES_EDE3
tripledes_iv ByteString
iv) ByteString
input in (ByteString
output, Int -> ByteString -> ByteString
takelast Int
8 ByteString
output))
tripledes_ede BulkDirection
BulkDecrypt ByteString
key =
    let ctx :: DES_EDE3
ctx = CryptoFailable DES_EDE3 -> DES_EDE3
forall a. CryptoFailable a -> a
noFail (CryptoFailable DES_EDE3 -> DES_EDE3)
-> CryptoFailable DES_EDE3 -> DES_EDE3
forall a b. (a -> b) -> a -> b
$ ByteString -> CryptoFailable DES_EDE3
forall cipher key.
(Cipher cipher, ByteArray key) =>
key -> CryptoFailable cipher
cipherInit ByteString
key
     in (\ByteString
iv ByteString
input -> let output :: ByteString
output = DES_EDE3 -> IV DES_EDE3 -> ByteString -> ByteString
forall cipher ba.
(BlockCipher cipher, ByteArray ba) =>
cipher -> IV cipher -> ba -> ba
cbcDecrypt DES_EDE3
ctx (ByteString -> IV DES_EDE3
tripledes_iv ByteString
iv) ByteString
input in (ByteString
output, Int -> ByteString -> ByteString
takelast Int
8 ByteString
input))

tripledes_iv :: BulkIV -> IV DES_EDE3
tripledes_iv :: ByteString -> IV DES_EDE3
tripledes_iv ByteString
iv = IV DES_EDE3 -> Maybe (IV DES_EDE3) -> IV DES_EDE3
forall a. a -> Maybe a -> a
fromMaybe ([Char] -> IV DES_EDE3
forall a. HasCallStack => [Char] -> a
error [Char]
"tripledes cipher iv internal error") (Maybe (IV DES_EDE3) -> IV DES_EDE3)
-> Maybe (IV DES_EDE3) -> IV DES_EDE3
forall a b. (a -> b) -> a -> b
$ ByteString -> Maybe (IV DES_EDE3)
forall b c. (ByteArrayAccess b, BlockCipher c) => b -> Maybe (IV c)
makeIV ByteString
iv

rc4 :: BulkDirection -> BulkKey -> BulkStream
rc4 :: BulkDirection -> ByteString -> BulkStream
rc4 BulkDirection
_ ByteString
bulkKey = (ByteString -> (ByteString, BulkStream)) -> BulkStream
BulkStream (State -> ByteString -> (ByteString, BulkStream)
combineRC4 (State -> ByteString -> (ByteString, BulkStream))
-> State -> ByteString -> (ByteString, BulkStream)
forall a b. (a -> b) -> a -> b
$ ByteString -> State
forall key. ByteArrayAccess key => key -> State
RC4.initialize ByteString
bulkKey)
  where
    combineRC4 :: State -> ByteString -> (ByteString, BulkStream)
combineRC4 State
ctx ByteString
input =
        let (State
ctx', ByteString
output) = State -> ByteString -> (State, ByteString)
forall ba. ByteArray ba => State -> ba -> (State, ba)
RC4.combine State
ctx ByteString
input
         in (ByteString
output, (ByteString -> (ByteString, BulkStream)) -> BulkStream
BulkStream (State -> ByteString -> (ByteString, BulkStream)
combineRC4 State
ctx'))

chacha20poly1305 :: BulkDirection -> BulkKey -> BulkAEAD
chacha20poly1305 :: BulkDirection -> ByteString -> BulkAEAD
chacha20poly1305 BulkDirection
BulkEncrypt ByteString
key ByteString
nonce =
    let st :: State
st = CryptoFailable State -> State
forall a. CryptoFailable a -> a
noFail (ByteString -> CryptoFailable Nonce
forall iv. ByteArrayAccess iv => iv -> CryptoFailable Nonce
ChaChaPoly1305.nonce12 ByteString
nonce CryptoFailable Nonce
-> (Nonce -> CryptoFailable State) -> CryptoFailable State
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ByteString -> Nonce -> CryptoFailable State
forall key.
ByteArrayAccess key =>
key -> Nonce -> CryptoFailable State
ChaChaPoly1305.initialize ByteString
key)
     in (\ByteString
input ByteString
ad ->
            let st2 :: State
st2 = State -> State
ChaChaPoly1305.finalizeAAD (ByteString -> State -> State
forall ba. ByteArrayAccess ba => ba -> State -> State
ChaChaPoly1305.appendAAD ByteString
ad State
st)
                (ByteString
output, State
st3) = ByteString -> State -> (ByteString, State)
forall ba. ByteArray ba => ba -> State -> (ba, State)
ChaChaPoly1305.encrypt ByteString
input State
st2
                Poly1305.Auth Bytes
tag = State -> Auth
ChaChaPoly1305.finalize State
st3
            in (ByteString
output, Bytes -> AuthTag
AuthTag Bytes
tag))
chacha20poly1305 BulkDirection
BulkDecrypt ByteString
key ByteString
nonce =
    let st :: State
st = CryptoFailable State -> State
forall a. CryptoFailable a -> a
noFail (ByteString -> CryptoFailable Nonce
forall iv. ByteArrayAccess iv => iv -> CryptoFailable Nonce
ChaChaPoly1305.nonce12 ByteString
nonce CryptoFailable Nonce
-> (Nonce -> CryptoFailable State) -> CryptoFailable State
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ByteString -> Nonce -> CryptoFailable State
forall key.
ByteArrayAccess key =>
key -> Nonce -> CryptoFailable State
ChaChaPoly1305.initialize ByteString
key)
     in (\ByteString
input ByteString
ad ->
            let st2 :: State
st2 = State -> State
ChaChaPoly1305.finalizeAAD (ByteString -> State -> State
forall ba. ByteArrayAccess ba => ba -> State -> State
ChaChaPoly1305.appendAAD ByteString
ad State
st)
                (ByteString
output, State
st3) = ByteString -> State -> (ByteString, State)
forall ba. ByteArray ba => ba -> State -> (ba, State)
ChaChaPoly1305.decrypt ByteString
input State
st2
                Poly1305.Auth Bytes
tag = State -> Auth
ChaChaPoly1305.finalize State
st3
            in (ByteString
output, Bytes -> AuthTag
AuthTag Bytes
tag))

data CipherSet
    = SetAead [Cipher] [Cipher] [Cipher]  -- gcm, chacha, ccm
    | SetOther [Cipher]

-- Preference between AEAD ciphers having equivalent properties is based on
-- hardware-acceleration support in the cryptonite implementation.
sortOptimized :: [CipherSet] -> [Cipher]
sortOptimized :: [CipherSet] -> [Cipher]
sortOptimized = (CipherSet -> [Cipher]) -> [CipherSet] -> [Cipher]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap CipherSet -> [Cipher]
f
  where
    f :: CipherSet -> [Cipher]
f (SetAead [Cipher]
gcm [Cipher]
chacha [Cipher]
ccm)
        | ProcessorOption
AESNI  ProcessorOption -> [ProcessorOption] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`notElem` [ProcessorOption]
processorOptions = [Cipher]
chacha [Cipher] -> [Cipher] -> [Cipher]
forall a. [a] -> [a] -> [a]
++ [Cipher]
gcm [Cipher] -> [Cipher] -> [Cipher]
forall a. [a] -> [a] -> [a]
++ [Cipher]
ccm
        | ProcessorOption
PCLMUL ProcessorOption -> [ProcessorOption] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`notElem` [ProcessorOption]
processorOptions = [Cipher]
ccm [Cipher] -> [Cipher] -> [Cipher]
forall a. [a] -> [a] -> [a]
++ [Cipher]
chacha [Cipher] -> [Cipher] -> [Cipher]
forall a. [a] -> [a] -> [a]
++ [Cipher]
gcm
        | Bool
otherwise                         = [Cipher]
gcm [Cipher] -> [Cipher] -> [Cipher]
forall a. [a] -> [a] -> [a]
++ [Cipher]
ccm [Cipher] -> [Cipher] -> [Cipher]
forall a. [a] -> [a] -> [a]
++ [Cipher]
chacha
    f (SetOther [Cipher]
ciphers) = [Cipher]
ciphers

-- Order which is deterministic but not optimized for the CPU.
sortDeterministic :: [CipherSet] -> [Cipher]
sortDeterministic :: [CipherSet] -> [Cipher]
sortDeterministic = (CipherSet -> [Cipher]) -> [CipherSet] -> [Cipher]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap CipherSet -> [Cipher]
f
  where
    f :: CipherSet -> [Cipher]
f (SetAead [Cipher]
gcm [Cipher]
chacha [Cipher]
ccm) = [Cipher]
gcm [Cipher] -> [Cipher] -> [Cipher]
forall a. [a] -> [a] -> [a]
++ [Cipher]
chacha [Cipher] -> [Cipher] -> [Cipher]
forall a. [a] -> [a] -> [a]
++ [Cipher]
ccm
    f (SetOther [Cipher]
ciphers) = [Cipher]
ciphers

-- | All AES and ChaCha20-Poly1305 ciphers supported ordered from strong to
-- weak.  This choice of ciphersuites should satisfy most normal needs.  For
-- otherwise strong ciphers we make little distinction between AES128 and
-- AES256, and list each but the weakest of the AES128 ciphers ahead of the
-- corresponding AES256 ciphers.
--
-- AEAD ciphers with equivalent security properties are ordered based on CPU
-- hardware-acceleration support.  If this dynamic runtime behavior is not
-- desired, use 'ciphersuite_default_det' instead.
ciphersuite_default :: [Cipher]
ciphersuite_default :: [Cipher]
ciphersuite_default = [CipherSet] -> [Cipher]
sortOptimized [CipherSet]
sets_default

-- | Same as 'ciphersuite_default', but using deterministic preference not
-- influenced by the CPU.
ciphersuite_default_det :: [Cipher]
ciphersuite_default_det :: [Cipher]
ciphersuite_default_det = [CipherSet] -> [Cipher]
sortDeterministic [CipherSet]
sets_default

sets_default :: [CipherSet]
sets_default :: [CipherSet]
sets_default =
    [        -- First the PFS + GCM + SHA2 ciphers
      [Cipher] -> [Cipher] -> [Cipher] -> CipherSet
SetAead
        [ Cipher
cipher_ECDHE_ECDSA_AES128GCM_SHA256, Cipher
cipher_ECDHE_ECDSA_AES256GCM_SHA384 ]
        [ Cipher
cipher_ECDHE_ECDSA_CHACHA20POLY1305_SHA256 ]
        [ Cipher
cipher_ECDHE_ECDSA_AES128CCM_SHA256, Cipher
cipher_ECDHE_ECDSA_AES256CCM_SHA256 ]
    , [Cipher] -> [Cipher] -> [Cipher] -> CipherSet
SetAead
        [ Cipher
cipher_ECDHE_RSA_AES128GCM_SHA256, Cipher
cipher_ECDHE_RSA_AES256GCM_SHA384 ]
        [ Cipher
cipher_ECDHE_RSA_CHACHA20POLY1305_SHA256 ]
        []
    , [Cipher] -> [Cipher] -> [Cipher] -> CipherSet
SetAead
        [ Cipher
cipher_DHE_RSA_AES128GCM_SHA256, Cipher
cipher_DHE_RSA_AES256GCM_SHA384 ]
        [ Cipher
cipher_DHE_RSA_CHACHA20POLY1305_SHA256 ]
        [ Cipher
cipher_DHE_RSA_AES128CCM_SHA256, Cipher
cipher_DHE_RSA_AES256CCM_SHA256 ]
             -- Next the PFS + CBC + SHA2 ciphers
    , [Cipher] -> CipherSet
SetOther
          [ Cipher
cipher_ECDHE_ECDSA_AES128CBC_SHA256, Cipher
cipher_ECDHE_ECDSA_AES256CBC_SHA384
          , Cipher
cipher_ECDHE_RSA_AES128CBC_SHA256, Cipher
cipher_ECDHE_RSA_AES256CBC_SHA384
          , Cipher
cipher_DHE_RSA_AES128_SHA256, Cipher
cipher_DHE_RSA_AES256_SHA256
          ]
             -- Next the PFS + CBC + SHA1 ciphers
    , [Cipher] -> CipherSet
SetOther
          [ Cipher
cipher_ECDHE_ECDSA_AES128CBC_SHA, Cipher
cipher_ECDHE_ECDSA_AES256CBC_SHA
          , Cipher
cipher_ECDHE_RSA_AES128CBC_SHA, Cipher
cipher_ECDHE_RSA_AES256CBC_SHA
          , Cipher
cipher_DHE_RSA_AES128_SHA1, Cipher
cipher_DHE_RSA_AES256_SHA1
          ]
             -- Next the non-PFS + AEAD + SHA2 ciphers
    , [Cipher] -> [Cipher] -> [Cipher] -> CipherSet
SetAead
        [ Cipher
cipher_AES128GCM_SHA256, Cipher
cipher_AES256GCM_SHA384 ]
        []
        [ Cipher
cipher_AES128CCM_SHA256, Cipher
cipher_AES256CCM_SHA256 ]
             -- Next the non-PFS + CBC + SHA2 ciphers
    , [Cipher] -> CipherSet
SetOther [ Cipher
cipher_AES256_SHA256, Cipher
cipher_AES128_SHA256 ]
             -- Next the non-PFS + CBC + SHA1 ciphers
    , [Cipher] -> CipherSet
SetOther [ Cipher
cipher_AES256_SHA1, Cipher
cipher_AES128_SHA1 ]
             -- Nobody uses or should use DSS, RC4,  3DES or MD5
--  , SetOther
--      [ cipher_DHE_DSS_AES256_SHA1, cipher_DHE_DSS_AES128_SHA1
--      , cipher_DHE_DSS_RC4_SHA1, cipher_RC4_128_SHA1, cipher_RC4_128_MD5
--      , cipher_RSA_3DES_EDE_CBC_SHA1
--      ]
             -- TLS13 (listed at the end but version is negotiated first)
    , [Cipher] -> [Cipher] -> [Cipher] -> CipherSet
SetAead
        [ Cipher
cipher_TLS13_AES128GCM_SHA256, Cipher
cipher_TLS13_AES256GCM_SHA384 ]
        [ Cipher
cipher_TLS13_CHACHA20POLY1305_SHA256 ]
        [ Cipher
cipher_TLS13_AES128CCM_SHA256 ]
    ]

{-# WARNING ciphersuite_all "This ciphersuite list contains RC4. Use ciphersuite_strong or ciphersuite_default instead." #-}
-- | The default ciphersuites + some not recommended last resort ciphers.
--
-- AEAD ciphers with equivalent security properties are ordered based on CPU
-- hardware-acceleration support.  If this dynamic runtime behavior is not
-- desired, use 'ciphersuite_all_det' instead.
ciphersuite_all :: [Cipher]
ciphersuite_all :: [Cipher]
ciphersuite_all = [Cipher]
ciphersuite_default [Cipher] -> [Cipher] -> [Cipher]
forall a. [a] -> [a] -> [a]
++ [Cipher]
complement_all

{-# WARNING ciphersuite_all_det "This ciphersuite list contains RC4. Use ciphersuite_strong_det or ciphersuite_default_det instead." #-}
-- | Same as 'ciphersuite_all', but using deterministic preference not
-- influenced by the CPU.
ciphersuite_all_det :: [Cipher]
ciphersuite_all_det :: [Cipher]
ciphersuite_all_det = [Cipher]
ciphersuite_default_det [Cipher] -> [Cipher] -> [Cipher]
forall a. [a] -> [a] -> [a]
++ [Cipher]
complement_all

complement_all :: [Cipher]
complement_all :: [Cipher]
complement_all =
    [ Cipher
cipher_ECDHE_ECDSA_AES128CCM8_SHA256, Cipher
cipher_ECDHE_ECDSA_AES256CCM8_SHA256
    , Cipher
cipher_DHE_RSA_AES128CCM8_SHA256, Cipher
cipher_DHE_RSA_AES256CCM8_SHA256
    , Cipher
cipher_DHE_DSS_AES256_SHA1, Cipher
cipher_DHE_DSS_AES128_SHA1
    , Cipher
cipher_AES128CCM8_SHA256, Cipher
cipher_AES256CCM8_SHA256
    , Cipher
cipher_RSA_3DES_EDE_CBC_SHA1
    , Cipher
cipher_RC4_128_SHA1
    , Cipher
cipher_TLS13_AES128CCM8_SHA256
    ]

{-# DEPRECATED ciphersuite_medium "Use ciphersuite_strong or ciphersuite_default instead." #-}
-- | list of medium ciphers.
ciphersuite_medium :: [Cipher]
ciphersuite_medium :: [Cipher]
ciphersuite_medium = [ Cipher
cipher_RC4_128_SHA1
                     , Cipher
cipher_AES128_SHA1
                     ]

-- | The strongest ciphers supported.  For ciphers with PFS, AEAD and SHA2, we
-- list each AES128 variant after the corresponding AES256 and ChaCha20-Poly1305
-- variants.  For weaker constructs, we use just the AES256 form.
--
-- AEAD ciphers with equivalent security properties are ordered based on CPU
-- hardware-acceleration support.  If this dynamic runtime behavior is not
-- desired, use 'ciphersuite_strong_det' instead.
ciphersuite_strong :: [Cipher]
ciphersuite_strong :: [Cipher]
ciphersuite_strong = [CipherSet] -> [Cipher]
sortOptimized [CipherSet]
sets_strong

-- | Same as 'ciphersuite_strong', but using deterministic preference not
-- influenced by the CPU.
ciphersuite_strong_det :: [Cipher]
ciphersuite_strong_det :: [Cipher]
ciphersuite_strong_det = [CipherSet] -> [Cipher]
sortDeterministic [CipherSet]
sets_strong

sets_strong :: [CipherSet]
sets_strong :: [CipherSet]
sets_strong =
    [        -- If we have PFS + AEAD + SHA2, then allow AES128, else just 256
      [Cipher] -> [Cipher] -> [Cipher] -> CipherSet
SetAead [ Cipher
cipher_ECDHE_ECDSA_AES256GCM_SHA384 ]
              [ Cipher
cipher_ECDHE_ECDSA_CHACHA20POLY1305_SHA256 ]
              [ Cipher
cipher_ECDHE_ECDSA_AES256CCM_SHA256 ]
    , [Cipher] -> [Cipher] -> [Cipher] -> CipherSet
SetAead [ Cipher
cipher_ECDHE_ECDSA_AES128GCM_SHA256 ]
              []
              [ Cipher
cipher_ECDHE_ECDSA_AES128CCM_SHA256 ]
    , [Cipher] -> [Cipher] -> [Cipher] -> CipherSet
SetAead [ Cipher
cipher_ECDHE_RSA_AES256GCM_SHA384 ]
              [ Cipher
cipher_ECDHE_RSA_CHACHA20POLY1305_SHA256 ]
              []
    , [Cipher] -> [Cipher] -> [Cipher] -> CipherSet
SetAead [ Cipher
cipher_ECDHE_RSA_AES128GCM_SHA256 ]
              []
              []
    , [Cipher] -> [Cipher] -> [Cipher] -> CipherSet
SetAead [ Cipher
cipher_DHE_RSA_AES256GCM_SHA384 ]
              [ Cipher
cipher_DHE_RSA_CHACHA20POLY1305_SHA256 ]
              [ Cipher
cipher_DHE_RSA_AES256CCM_SHA256 ]
    , [Cipher] -> [Cipher] -> [Cipher] -> CipherSet
SetAead [ Cipher
cipher_DHE_RSA_AES128GCM_SHA256 ]
              []
              [ Cipher
cipher_DHE_RSA_AES128CCM_SHA256 ]
             -- No AEAD
    , [Cipher] -> CipherSet
SetOther
        [ Cipher
cipher_ECDHE_ECDSA_AES256CBC_SHA384
        , Cipher
cipher_ECDHE_RSA_AES256CBC_SHA384
        , Cipher
cipher_DHE_RSA_AES256_SHA256
        ]
             -- No SHA2
    , [Cipher] -> CipherSet
SetOther
        [ Cipher
cipher_ECDHE_ECDSA_AES256CBC_SHA
        , Cipher
cipher_ECDHE_RSA_AES256CBC_SHA
        , Cipher
cipher_DHE_RSA_AES256_SHA1
        ]
             -- No PFS
    , [Cipher] -> [Cipher] -> [Cipher] -> CipherSet
SetAead [ Cipher
cipher_AES256GCM_SHA384 ]
              []
              [ Cipher
cipher_AES256CCM_SHA256 ]
             -- Neither PFS nor AEAD, just SHA2
    , [Cipher] -> CipherSet
SetOther [ Cipher
cipher_AES256_SHA256 ]
             -- Last resort no PFS, AEAD or SHA2
    , [Cipher] -> CipherSet
SetOther [ Cipher
cipher_AES256_SHA1 ]
             -- TLS13 (listed at the end but version is negotiated first)
    , [Cipher] -> [Cipher] -> [Cipher] -> CipherSet
SetAead [ Cipher
cipher_TLS13_AES256GCM_SHA384 ]
              [ Cipher
cipher_TLS13_CHACHA20POLY1305_SHA256 ]
              []
    , [Cipher] -> [Cipher] -> [Cipher] -> CipherSet
SetAead [ Cipher
cipher_TLS13_AES128GCM_SHA256 ]
              []
              [ Cipher
cipher_TLS13_AES128CCM_SHA256 ]
    ]

-- | DHE-RSA cipher suite.  This only includes ciphers bound specifically to
-- DHE-RSA so TLS 1.3 ciphers must be added separately.
ciphersuite_dhe_rsa :: [Cipher]
ciphersuite_dhe_rsa :: [Cipher]
ciphersuite_dhe_rsa = [ Cipher
cipher_DHE_RSA_AES256GCM_SHA384, Cipher
cipher_DHE_RSA_AES256CCM_SHA256
                      , Cipher
cipher_DHE_RSA_CHACHA20POLY1305_SHA256
                      , Cipher
cipher_DHE_RSA_AES128GCM_SHA256, Cipher
cipher_DHE_RSA_AES128CCM_SHA256
                      , Cipher
cipher_DHE_RSA_AES256_SHA256, Cipher
cipher_DHE_RSA_AES128_SHA256
                      , Cipher
cipher_DHE_RSA_AES256_SHA1, Cipher
cipher_DHE_RSA_AES128_SHA1
                      ]

ciphersuite_dhe_dss :: [Cipher]
ciphersuite_dhe_dss :: [Cipher]
ciphersuite_dhe_dss = [Cipher
cipher_DHE_DSS_AES256_SHA1, Cipher
cipher_DHE_DSS_AES128_SHA1, Cipher
cipher_DHE_DSS_RC4_SHA1]

-- | all unencrypted ciphers, do not use on insecure network.
ciphersuite_unencrypted :: [Cipher]
ciphersuite_unencrypted :: [Cipher]
ciphersuite_unencrypted = [Cipher
cipher_null_MD5, Cipher
cipher_null_SHA1]

bulk_null, bulk_rc4, bulk_aes128, bulk_aes256, bulk_tripledes_ede, bulk_aes128gcm, bulk_aes256gcm :: Bulk
bulk_aes128ccm, bulk_aes128ccm8, bulk_aes256ccm, bulk_aes256ccm8, bulk_chacha20poly1305 :: Bulk
bulk_null :: Bulk
bulk_null = Bulk :: [Char] -> Int -> Int -> Int -> Int -> Int -> BulkFunctions -> Bulk
Bulk
    { bulkName :: [Char]
bulkName         = [Char]
"null"
    , bulkKeySize :: Int
bulkKeySize      = Int
0
    , bulkIVSize :: Int
bulkIVSize       = Int
0
    , bulkExplicitIV :: Int
bulkExplicitIV   = Int
0
    , bulkAuthTagLen :: Int
bulkAuthTagLen   = Int
0
    , bulkBlockSize :: Int
bulkBlockSize    = Int
0
    , bulkF :: BulkFunctions
bulkF            = (BulkDirection -> ByteString -> BulkStream) -> BulkFunctions
BulkStreamF BulkDirection -> ByteString -> BulkStream
forall p p. p -> p -> BulkStream
passThrough
    }
  where
    passThrough :: p -> p -> BulkStream
passThrough p
_ p
_ = (ByteString -> (ByteString, BulkStream)) -> BulkStream
BulkStream ByteString -> (ByteString, BulkStream)
go where go :: ByteString -> (ByteString, BulkStream)
go ByteString
inp = (ByteString
inp, (ByteString -> (ByteString, BulkStream)) -> BulkStream
BulkStream ByteString -> (ByteString, BulkStream)
go)

bulk_rc4 :: Bulk
bulk_rc4 = Bulk :: [Char] -> Int -> Int -> Int -> Int -> Int -> BulkFunctions -> Bulk
Bulk
    { bulkName :: [Char]
bulkName         = [Char]
"RC4-128"
    , bulkKeySize :: Int
bulkKeySize      = Int
16
    , bulkIVSize :: Int
bulkIVSize       = Int
0
    , bulkExplicitIV :: Int
bulkExplicitIV   = Int
0
    , bulkAuthTagLen :: Int
bulkAuthTagLen   = Int
0
    , bulkBlockSize :: Int
bulkBlockSize    = Int
0
    , bulkF :: BulkFunctions
bulkF            = (BulkDirection -> ByteString -> BulkStream) -> BulkFunctions
BulkStreamF BulkDirection -> ByteString -> BulkStream
rc4
    }

bulk_aes128 :: Bulk
bulk_aes128 = Bulk :: [Char] -> Int -> Int -> Int -> Int -> Int -> BulkFunctions -> Bulk
Bulk
    { bulkName :: [Char]
bulkName         = [Char]
"AES128"
    , bulkKeySize :: Int
bulkKeySize      = Int
16
    , bulkIVSize :: Int
bulkIVSize       = Int
16
    , bulkExplicitIV :: Int
bulkExplicitIV   = Int
0
    , bulkAuthTagLen :: Int
bulkAuthTagLen   = Int
0
    , bulkBlockSize :: Int
bulkBlockSize    = Int
16
    , bulkF :: BulkFunctions
bulkF            = (BulkDirection -> ByteString -> BulkBlock) -> BulkFunctions
BulkBlockF BulkDirection -> ByteString -> BulkBlock
aes128cbc
    }

bulk_aes128ccm :: Bulk
bulk_aes128ccm = Bulk :: [Char] -> Int -> Int -> Int -> Int -> Int -> BulkFunctions -> Bulk
Bulk
    { bulkName :: [Char]
bulkName         = [Char]
"AES128CCM"
    , bulkKeySize :: Int
bulkKeySize      = Int
16 -- RFC 5116 Sec 5.1: K_LEN
    , bulkIVSize :: Int
bulkIVSize       = Int
4  -- RFC 6655 CCMNonce.salt, fixed_iv_length
    , bulkExplicitIV :: Int
bulkExplicitIV   = Int
8
    , bulkAuthTagLen :: Int
bulkAuthTagLen   = Int
16
    , bulkBlockSize :: Int
bulkBlockSize    = Int
0  -- dummy, not used
    , bulkF :: BulkFunctions
bulkF            = (BulkDirection -> ByteString -> BulkAEAD) -> BulkFunctions
BulkAeadF BulkDirection -> ByteString -> BulkAEAD
aes128ccm
    }

bulk_aes128ccm8 :: Bulk
bulk_aes128ccm8 = Bulk :: [Char] -> Int -> Int -> Int -> Int -> Int -> BulkFunctions -> Bulk
Bulk
    { bulkName :: [Char]
bulkName         = [Char]
"AES128CCM8"
    , bulkKeySize :: Int
bulkKeySize      = Int
16 -- RFC 5116 Sec 5.1: K_LEN
    , bulkIVSize :: Int
bulkIVSize       = Int
4  -- RFC 6655 CCMNonce.salt, fixed_iv_length
    , bulkExplicitIV :: Int
bulkExplicitIV   = Int
8
    , bulkAuthTagLen :: Int
bulkAuthTagLen   = Int
8
    , bulkBlockSize :: Int
bulkBlockSize    = Int
0  -- dummy, not used
    , bulkF :: BulkFunctions
bulkF            = (BulkDirection -> ByteString -> BulkAEAD) -> BulkFunctions
BulkAeadF BulkDirection -> ByteString -> BulkAEAD
aes128ccm8
    }

bulk_aes128gcm :: Bulk
bulk_aes128gcm = Bulk :: [Char] -> Int -> Int -> Int -> Int -> Int -> BulkFunctions -> Bulk
Bulk
    { bulkName :: [Char]
bulkName         = [Char]
"AES128GCM"
    , bulkKeySize :: Int
bulkKeySize      = Int
16 -- RFC 5116 Sec 5.1: K_LEN
    , bulkIVSize :: Int
bulkIVSize       = Int
4  -- RFC 5288 GCMNonce.salt, fixed_iv_length
    , bulkExplicitIV :: Int
bulkExplicitIV   = Int
8
    , bulkAuthTagLen :: Int
bulkAuthTagLen   = Int
16
    , bulkBlockSize :: Int
bulkBlockSize    = Int
0  -- dummy, not used
    , bulkF :: BulkFunctions
bulkF            = (BulkDirection -> ByteString -> BulkAEAD) -> BulkFunctions
BulkAeadF BulkDirection -> ByteString -> BulkAEAD
aes128gcm
    }

bulk_aes256ccm :: Bulk
bulk_aes256ccm = Bulk :: [Char] -> Int -> Int -> Int -> Int -> Int -> BulkFunctions -> Bulk
Bulk
    { bulkName :: [Char]
bulkName         = [Char]
"AES256CCM"
    , bulkKeySize :: Int
bulkKeySize      = Int
32 -- RFC 5116 Sec 5.1: K_LEN
    , bulkIVSize :: Int
bulkIVSize       = Int
4  -- RFC 6655 CCMNonce.salt, fixed_iv_length
    , bulkExplicitIV :: Int
bulkExplicitIV   = Int
8
    , bulkAuthTagLen :: Int
bulkAuthTagLen   = Int
16
    , bulkBlockSize :: Int
bulkBlockSize    = Int
0  -- dummy, not used
    , bulkF :: BulkFunctions
bulkF            = (BulkDirection -> ByteString -> BulkAEAD) -> BulkFunctions
BulkAeadF BulkDirection -> ByteString -> BulkAEAD
aes256ccm
    }

bulk_aes256ccm8 :: Bulk
bulk_aes256ccm8 = Bulk :: [Char] -> Int -> Int -> Int -> Int -> Int -> BulkFunctions -> Bulk
Bulk
    { bulkName :: [Char]
bulkName         = [Char]
"AES256CCM8"
    , bulkKeySize :: Int
bulkKeySize      = Int
32 -- RFC 5116 Sec 5.1: K_LEN
    , bulkIVSize :: Int
bulkIVSize       = Int
4  -- RFC 6655 CCMNonce.salt, fixed_iv_length
    , bulkExplicitIV :: Int
bulkExplicitIV   = Int
8
    , bulkAuthTagLen :: Int
bulkAuthTagLen   = Int
8
    , bulkBlockSize :: Int
bulkBlockSize    = Int
0  -- dummy, not used
    , bulkF :: BulkFunctions
bulkF            = (BulkDirection -> ByteString -> BulkAEAD) -> BulkFunctions
BulkAeadF BulkDirection -> ByteString -> BulkAEAD
aes256ccm8
    }

bulk_aes256gcm :: Bulk
bulk_aes256gcm = Bulk :: [Char] -> Int -> Int -> Int -> Int -> Int -> BulkFunctions -> Bulk
Bulk
    { bulkName :: [Char]
bulkName         = [Char]
"AES256GCM"
    , bulkKeySize :: Int
bulkKeySize      = Int
32 -- RFC 5116 Sec 5.1: K_LEN
    , bulkIVSize :: Int
bulkIVSize       = Int
4  -- RFC 5288 GCMNonce.salt, fixed_iv_length
    , bulkExplicitIV :: Int
bulkExplicitIV   = Int
8
    , bulkAuthTagLen :: Int
bulkAuthTagLen   = Int
16
    , bulkBlockSize :: Int
bulkBlockSize    = Int
0  -- dummy, not used
    , bulkF :: BulkFunctions
bulkF            = (BulkDirection -> ByteString -> BulkAEAD) -> BulkFunctions
BulkAeadF BulkDirection -> ByteString -> BulkAEAD
aes256gcm
    }

bulk_aes256 :: Bulk
bulk_aes256 = Bulk :: [Char] -> Int -> Int -> Int -> Int -> Int -> BulkFunctions -> Bulk
Bulk
    { bulkName :: [Char]
bulkName         = [Char]
"AES256"
    , bulkKeySize :: Int
bulkKeySize      = Int
32
    , bulkIVSize :: Int
bulkIVSize       = Int
16
    , bulkExplicitIV :: Int
bulkExplicitIV   = Int
0
    , bulkAuthTagLen :: Int
bulkAuthTagLen   = Int
0
    , bulkBlockSize :: Int
bulkBlockSize    = Int
16
    , bulkF :: BulkFunctions
bulkF            = (BulkDirection -> ByteString -> BulkBlock) -> BulkFunctions
BulkBlockF BulkDirection -> ByteString -> BulkBlock
aes256cbc
    }

bulk_tripledes_ede :: Bulk
bulk_tripledes_ede = Bulk :: [Char] -> Int -> Int -> Int -> Int -> Int -> BulkFunctions -> Bulk
Bulk
    { bulkName :: [Char]
bulkName      = [Char]
"3DES-EDE-CBC"
    , bulkKeySize :: Int
bulkKeySize   = Int
24
    , bulkIVSize :: Int
bulkIVSize    = Int
8
    , bulkExplicitIV :: Int
bulkExplicitIV = Int
0
    , bulkAuthTagLen :: Int
bulkAuthTagLen = Int
0
    , bulkBlockSize :: Int
bulkBlockSize = Int
8
    , bulkF :: BulkFunctions
bulkF         = (BulkDirection -> ByteString -> BulkBlock) -> BulkFunctions
BulkBlockF BulkDirection -> ByteString -> BulkBlock
tripledes_ede
    }

bulk_chacha20poly1305 :: Bulk
bulk_chacha20poly1305 = Bulk :: [Char] -> Int -> Int -> Int -> Int -> Int -> BulkFunctions -> Bulk
Bulk
    { bulkName :: [Char]
bulkName         = [Char]
"CHACHA20POLY1305"
    , bulkKeySize :: Int
bulkKeySize      = Int
32
    , bulkIVSize :: Int
bulkIVSize       = Int
12 -- RFC 7905 section 2, fixed_iv_length
    , bulkExplicitIV :: Int
bulkExplicitIV   = Int
0
    , bulkAuthTagLen :: Int
bulkAuthTagLen   = Int
16
    , bulkBlockSize :: Int
bulkBlockSize    = Int
0  -- dummy, not used
    , bulkF :: BulkFunctions
bulkF            = (BulkDirection -> ByteString -> BulkAEAD) -> BulkFunctions
BulkAeadF BulkDirection -> ByteString -> BulkAEAD
chacha20poly1305
    }

-- TLS13 bulks are same as TLS12 except they never have explicit IV
bulk_aes128gcm_13, bulk_aes256gcm_13, bulk_aes128ccm_13, bulk_aes128ccm8_13 :: Bulk
bulk_aes128gcm_13 :: Bulk
bulk_aes128gcm_13  = Bulk
bulk_aes128gcm  { bulkIVSize :: Int
bulkIVSize = Int
12, bulkExplicitIV :: Int
bulkExplicitIV = Int
0 }
bulk_aes256gcm_13 :: Bulk
bulk_aes256gcm_13  = Bulk
bulk_aes256gcm  { bulkIVSize :: Int
bulkIVSize = Int
12, bulkExplicitIV :: Int
bulkExplicitIV = Int
0 }
bulk_aes128ccm_13 :: Bulk
bulk_aes128ccm_13  = Bulk
bulk_aes128ccm  { bulkIVSize :: Int
bulkIVSize = Int
12, bulkExplicitIV :: Int
bulkExplicitIV = Int
0 }
bulk_aes128ccm8_13 :: Bulk
bulk_aes128ccm8_13 = Bulk
bulk_aes128ccm8 { bulkIVSize :: Int
bulkIVSize = Int
12, bulkExplicitIV :: Int
bulkExplicitIV = Int
0 }

-- | unencrypted cipher using RSA for key exchange and MD5 for digest
cipher_null_MD5 :: Cipher
cipher_null_MD5 :: Cipher
cipher_null_MD5 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0x0001
    , cipherName :: [Char]
cipherName         = [Char]
"RSA-null-MD5"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_null
    , cipherHash :: Hash
cipherHash         = Hash
MD5
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Maybe Hash
forall a. Maybe a
Nothing
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_RSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Maybe Version
forall a. Maybe a
Nothing
    }

-- | unencrypted cipher using RSA for key exchange and SHA1 for digest
cipher_null_SHA1 :: Cipher
cipher_null_SHA1 :: Cipher
cipher_null_SHA1 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0x0002
    , cipherName :: [Char]
cipherName         = [Char]
"RSA-null-SHA1"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_null
    , cipherHash :: Hash
cipherHash         = Hash
SHA1
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Maybe Hash
forall a. Maybe a
Nothing
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_RSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Maybe Version
forall a. Maybe a
Nothing
    }

-- | RC4 cipher, RSA key exchange and MD5 for digest
cipher_RC4_128_MD5 :: Cipher
cipher_RC4_128_MD5 :: Cipher
cipher_RC4_128_MD5 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0x0004
    , cipherName :: [Char]
cipherName         = [Char]
"RSA-rc4-128-md5"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_rc4
    , cipherHash :: Hash
cipherHash         = Hash
MD5
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Maybe Hash
forall a. Maybe a
Nothing
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_RSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Maybe Version
forall a. Maybe a
Nothing
    }

-- | RC4 cipher, RSA key exchange and SHA1 for digest
cipher_RC4_128_SHA1 :: Cipher
cipher_RC4_128_SHA1 :: Cipher
cipher_RC4_128_SHA1 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0x0005
    , cipherName :: [Char]
cipherName         = [Char]
"RSA-rc4-128-sha1"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_rc4
    , cipherHash :: Hash
cipherHash         = Hash
SHA1
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Maybe Hash
forall a. Maybe a
Nothing
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_RSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Maybe Version
forall a. Maybe a
Nothing
    }

-- | 3DES cipher (168 bit key), RSA key exchange and SHA1 for digest
cipher_RSA_3DES_EDE_CBC_SHA1 :: Cipher
cipher_RSA_3DES_EDE_CBC_SHA1 :: Cipher
cipher_RSA_3DES_EDE_CBC_SHA1 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0x000A
    , cipherName :: [Char]
cipherName         = [Char]
"RSA-3DES-EDE-CBC-SHA1"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_tripledes_ede
    , cipherHash :: Hash
cipherHash         = Hash
SHA1
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Maybe Hash
forall a. Maybe a
Nothing
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_RSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Maybe Version
forall a. Maybe a
Nothing
    }

-- | AES cipher (128 bit key), RSA key exchange and SHA1 for digest
cipher_AES128_SHA1 :: Cipher
cipher_AES128_SHA1 :: Cipher
cipher_AES128_SHA1 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0x002F
    , cipherName :: [Char]
cipherName         = [Char]
"RSA-AES128-SHA1"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes128
    , cipherHash :: Hash
cipherHash         = Hash
SHA1
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Maybe Hash
forall a. Maybe a
Nothing
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_RSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
SSL3
    }

-- | AES cipher (128 bit key), DHE key exchanged signed by DSA and SHA1 for digest
cipher_DHE_DSS_AES128_SHA1 :: Cipher
cipher_DHE_DSS_AES128_SHA1 :: Cipher
cipher_DHE_DSS_AES128_SHA1 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0x0032
    , cipherName :: [Char]
cipherName         = [Char]
"DHE-DSA-AES128-SHA1"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes128
    , cipherHash :: Hash
cipherHash         = Hash
SHA1
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Maybe Hash
forall a. Maybe a
Nothing
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_DHE_DSS
    , cipherMinVer :: Maybe Version
cipherMinVer       = Maybe Version
forall a. Maybe a
Nothing
    }

-- | AES cipher (128 bit key), DHE key exchanged signed by RSA and SHA1 for digest
cipher_DHE_RSA_AES128_SHA1 :: Cipher
cipher_DHE_RSA_AES128_SHA1 :: Cipher
cipher_DHE_RSA_AES128_SHA1 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0x0033
    , cipherName :: [Char]
cipherName         = [Char]
"DHE-RSA-AES128-SHA1"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes128
    , cipherHash :: Hash
cipherHash         = Hash
SHA1
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Maybe Hash
forall a. Maybe a
Nothing
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_DHE_RSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Maybe Version
forall a. Maybe a
Nothing
    }

-- | AES cipher (256 bit key), RSA key exchange and SHA1 for digest
cipher_AES256_SHA1 :: Cipher
cipher_AES256_SHA1 :: Cipher
cipher_AES256_SHA1 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0x0035
    , cipherName :: [Char]
cipherName         = [Char]
"RSA-AES256-SHA1"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes256
    , cipherHash :: Hash
cipherHash         = Hash
SHA1
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Maybe Hash
forall a. Maybe a
Nothing
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_RSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
SSL3
    }

-- | AES cipher (256 bit key), DHE key exchanged signed by DSA and SHA1 for digest
cipher_DHE_DSS_AES256_SHA1 :: Cipher
cipher_DHE_DSS_AES256_SHA1 :: Cipher
cipher_DHE_DSS_AES256_SHA1 = Cipher
cipher_DHE_DSS_AES128_SHA1
    { cipherID :: CipherID
cipherID           = CipherID
0x0038
    , cipherName :: [Char]
cipherName         = [Char]
"DHE-DSA-AES256-SHA1"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes256
    }

-- | AES cipher (256 bit key), DHE key exchanged signed by RSA and SHA1 for digest
cipher_DHE_RSA_AES256_SHA1 :: Cipher
cipher_DHE_RSA_AES256_SHA1 :: Cipher
cipher_DHE_RSA_AES256_SHA1 = Cipher
cipher_DHE_RSA_AES128_SHA1
    { cipherID :: CipherID
cipherID           = CipherID
0x0039
    , cipherName :: [Char]
cipherName         = [Char]
"DHE-RSA-AES256-SHA1"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes256
    }

-- | AES cipher (128 bit key), RSA key exchange and SHA256 for digest
cipher_AES128_SHA256 :: Cipher
cipher_AES128_SHA256 :: Cipher
cipher_AES128_SHA256 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0x003C
    , cipherName :: [Char]
cipherName         = [Char]
"RSA-AES128-SHA256"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes128
    , cipherHash :: Hash
cipherHash         = Hash
SHA256
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Hash -> Maybe Hash
forall a. a -> Maybe a
Just Hash
SHA256
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_RSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS12
    }

-- | AES cipher (256 bit key), RSA key exchange and SHA256 for digest
cipher_AES256_SHA256 :: Cipher
cipher_AES256_SHA256 :: Cipher
cipher_AES256_SHA256 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0x003D
    , cipherName :: [Char]
cipherName         = [Char]
"RSA-AES256-SHA256"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes256
    , cipherHash :: Hash
cipherHash         = Hash
SHA256
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Hash -> Maybe Hash
forall a. a -> Maybe a
Just Hash
SHA256
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_RSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS12
    }

-- This is not registered in IANA.
-- So, this will be removed in the next major release.
cipher_DHE_DSS_RC4_SHA1 :: Cipher
cipher_DHE_DSS_RC4_SHA1 :: Cipher
cipher_DHE_DSS_RC4_SHA1 = Cipher
cipher_DHE_DSS_AES128_SHA1
    { cipherID :: CipherID
cipherID           = CipherID
0x0066
    , cipherName :: [Char]
cipherName         = [Char]
"DHE-DSA-RC4-SHA1"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_rc4
    }

cipher_DHE_RSA_AES128_SHA256 :: Cipher
cipher_DHE_RSA_AES128_SHA256 :: Cipher
cipher_DHE_RSA_AES128_SHA256 = Cipher
cipher_DHE_RSA_AES128_SHA1
    { cipherID :: CipherID
cipherID           = CipherID
0x0067
    , cipherName :: [Char]
cipherName         = [Char]
"DHE-RSA-AES128-SHA256"
    , cipherHash :: Hash
cipherHash         = Hash
SHA256
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Hash -> Maybe Hash
forall a. a -> Maybe a
Just Hash
SHA256
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS12
    }

cipher_DHE_RSA_AES256_SHA256 :: Cipher
cipher_DHE_RSA_AES256_SHA256 :: Cipher
cipher_DHE_RSA_AES256_SHA256 = Cipher
cipher_DHE_RSA_AES128_SHA256
    { cipherID :: CipherID
cipherID           = CipherID
0x006B
    , cipherName :: [Char]
cipherName         = [Char]
"DHE-RSA-AES256-SHA256"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes256
    }

-- | AESCCM cipher (128 bit key), RSA key exchange.
-- The SHA256 digest is used as a PRF, not as a MAC.
cipher_AES128CCM_SHA256 :: Cipher
cipher_AES128CCM_SHA256 :: Cipher
cipher_AES128CCM_SHA256 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0xc09c
    , cipherName :: [Char]
cipherName         = [Char]
"RSA-AES128CCM-SHA256"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes128ccm
    , cipherHash :: Hash
cipherHash         = Hash
SHA256
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Hash -> Maybe Hash
forall a. a -> Maybe a
Just Hash
SHA256
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_RSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS12 -- RFC 6655 Sec 3
    }

-- | AESCCM8 cipher (128 bit key), RSA key exchange.
-- The SHA256 digest is used as a PRF, not as a MAC.
cipher_AES128CCM8_SHA256 :: Cipher
cipher_AES128CCM8_SHA256 :: Cipher
cipher_AES128CCM8_SHA256 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0xc0a0
    , cipherName :: [Char]
cipherName         = [Char]
"RSA-AES128CCM8-SHA256"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes128ccm8
    , cipherHash :: Hash
cipherHash         = Hash
SHA256
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Hash -> Maybe Hash
forall a. a -> Maybe a
Just Hash
SHA256
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_RSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS12 -- RFC 6655 Sec 3
    }

-- | AESGCM cipher (128 bit key), RSA key exchange.
-- The SHA256 digest is used as a PRF, not as a MAC.
cipher_AES128GCM_SHA256 :: Cipher
cipher_AES128GCM_SHA256 :: Cipher
cipher_AES128GCM_SHA256 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0x009C
    , cipherName :: [Char]
cipherName         = [Char]
"RSA-AES128GCM-SHA256"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes128gcm
    , cipherHash :: Hash
cipherHash         = Hash
SHA256
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Hash -> Maybe Hash
forall a. a -> Maybe a
Just Hash
SHA256
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_RSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS12
    }

-- | AESCCM cipher (256 bit key), RSA key exchange.
-- The SHA256 digest is used as a PRF, not as a MAC.
cipher_AES256CCM_SHA256 :: Cipher
cipher_AES256CCM_SHA256 :: Cipher
cipher_AES256CCM_SHA256 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0xc09d
    , cipherName :: [Char]
cipherName         = [Char]
"RSA-AES256CCM-SHA256"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes256ccm
    , cipherHash :: Hash
cipherHash         = Hash
SHA256
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Hash -> Maybe Hash
forall a. a -> Maybe a
Just Hash
SHA256
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_RSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS12 -- RFC 6655 Sec 3
    }

-- | AESCCM8 cipher (256 bit key), RSA key exchange.
-- The SHA256 digest is used as a PRF, not as a MAC.
cipher_AES256CCM8_SHA256 :: Cipher
cipher_AES256CCM8_SHA256 :: Cipher
cipher_AES256CCM8_SHA256 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0xc0a1
    , cipherName :: [Char]
cipherName         = [Char]
"RSA-AES256CCM8-SHA256"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes256ccm8
    , cipherHash :: Hash
cipherHash         = Hash
SHA256
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Hash -> Maybe Hash
forall a. a -> Maybe a
Just Hash
SHA256
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_RSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS12 -- RFC 6655 Sec 3
    }

-- | AESGCM cipher (256 bit key), RSA key exchange.
-- The SHA384 digest is used as a PRF, not as a MAC.
cipher_AES256GCM_SHA384 :: Cipher
cipher_AES256GCM_SHA384 :: Cipher
cipher_AES256GCM_SHA384 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0x009D
    , cipherName :: [Char]
cipherName         = [Char]
"RSA-AES256GCM-SHA384"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes256gcm
    , cipherHash :: Hash
cipherHash         = Hash
SHA384
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Hash -> Maybe Hash
forall a. a -> Maybe a
Just Hash
SHA384
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_RSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS12
    }

cipher_DHE_RSA_AES128CCM_SHA256 :: Cipher
cipher_DHE_RSA_AES128CCM_SHA256 :: Cipher
cipher_DHE_RSA_AES128CCM_SHA256 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0xc09e
    , cipherName :: [Char]
cipherName         = [Char]
"DHE-RSA-AES128CCM-SHA256"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes128ccm
    , cipherHash :: Hash
cipherHash         = Hash
SHA256
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Hash -> Maybe Hash
forall a. a -> Maybe a
Just Hash
SHA256
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_DHE_RSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS12 -- RFC 6655 Sec 3
    }

cipher_DHE_RSA_AES128CCM8_SHA256 :: Cipher
cipher_DHE_RSA_AES128CCM8_SHA256 :: Cipher
cipher_DHE_RSA_AES128CCM8_SHA256 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0xc0a2
    , cipherName :: [Char]
cipherName         = [Char]
"DHE-RSA-AES128CCM8-SHA256"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes128ccm8
    , cipherHash :: Hash
cipherHash         = Hash
SHA256
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Hash -> Maybe Hash
forall a. a -> Maybe a
Just Hash
SHA256
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_DHE_RSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS12 -- RFC 6655 Sec 3
    }

cipher_DHE_RSA_AES128GCM_SHA256 :: Cipher
cipher_DHE_RSA_AES128GCM_SHA256 :: Cipher
cipher_DHE_RSA_AES128GCM_SHA256 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0x009E
    , cipherName :: [Char]
cipherName         = [Char]
"DHE-RSA-AES128GCM-SHA256"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes128gcm
    , cipherHash :: Hash
cipherHash         = Hash
SHA256
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Hash -> Maybe Hash
forall a. a -> Maybe a
Just Hash
SHA256
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_DHE_RSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS12 -- RFC 5288 Sec 4
    }

cipher_DHE_RSA_AES256CCM_SHA256 :: Cipher
cipher_DHE_RSA_AES256CCM_SHA256 :: Cipher
cipher_DHE_RSA_AES256CCM_SHA256 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0xc09f
    , cipherName :: [Char]
cipherName         = [Char]
"DHE-RSA-AES256CCM-SHA256"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes256ccm
    , cipherHash :: Hash
cipherHash         = Hash
SHA256
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Hash -> Maybe Hash
forall a. a -> Maybe a
Just Hash
SHA256
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_DHE_RSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS12 -- RFC 6655 Sec 3
    }

cipher_DHE_RSA_AES256CCM8_SHA256 :: Cipher
cipher_DHE_RSA_AES256CCM8_SHA256 :: Cipher
cipher_DHE_RSA_AES256CCM8_SHA256 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0xc0a3
    , cipherName :: [Char]
cipherName         = [Char]
"DHE-RSA-AES256CCM8-SHA256"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes256ccm8
    , cipherHash :: Hash
cipherHash         = Hash
SHA256
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Hash -> Maybe Hash
forall a. a -> Maybe a
Just Hash
SHA256
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_DHE_RSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS12 -- RFC 6655 Sec 3
    }

cipher_DHE_RSA_AES256GCM_SHA384 :: Cipher
cipher_DHE_RSA_AES256GCM_SHA384 :: Cipher
cipher_DHE_RSA_AES256GCM_SHA384 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0x009F
    , cipherName :: [Char]
cipherName         = [Char]
"DHE-RSA-AES256GCM-SHA384"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes256gcm
    , cipherHash :: Hash
cipherHash         = Hash
SHA384
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Hash -> Maybe Hash
forall a. a -> Maybe a
Just Hash
SHA384
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_DHE_RSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS12
    }

cipher_ECDHE_RSA_CHACHA20POLY1305_SHA256 :: Cipher
cipher_ECDHE_RSA_CHACHA20POLY1305_SHA256 :: Cipher
cipher_ECDHE_RSA_CHACHA20POLY1305_SHA256 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0xCCA8
    , cipherName :: [Char]
cipherName         = [Char]
"ECDHE-RSA-CHACHA20POLY1305-SHA256"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_chacha20poly1305
    , cipherHash :: Hash
cipherHash         = Hash
SHA256
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Hash -> Maybe Hash
forall a. a -> Maybe a
Just Hash
SHA256
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_ECDHE_RSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS12
    }

cipher_ECDHE_ECDSA_CHACHA20POLY1305_SHA256 :: Cipher
cipher_ECDHE_ECDSA_CHACHA20POLY1305_SHA256 :: Cipher
cipher_ECDHE_ECDSA_CHACHA20POLY1305_SHA256 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0xCCA9
    , cipherName :: [Char]
cipherName         = [Char]
"ECDHE-ECDSA-CHACHA20POLY1305-SHA256"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_chacha20poly1305
    , cipherHash :: Hash
cipherHash         = Hash
SHA256
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Hash -> Maybe Hash
forall a. a -> Maybe a
Just Hash
SHA256
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_ECDHE_ECDSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS12
    }

cipher_DHE_RSA_CHACHA20POLY1305_SHA256 :: Cipher
cipher_DHE_RSA_CHACHA20POLY1305_SHA256 :: Cipher
cipher_DHE_RSA_CHACHA20POLY1305_SHA256 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0xCCAA
    , cipherName :: [Char]
cipherName         = [Char]
"DHE-RSA-CHACHA20POLY1305-SHA256"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_chacha20poly1305
    , cipherHash :: Hash
cipherHash         = Hash
SHA256
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Hash -> Maybe Hash
forall a. a -> Maybe a
Just Hash
SHA256
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_DHE_RSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS12
    }

cipher_TLS13_AES128GCM_SHA256 :: Cipher
cipher_TLS13_AES128GCM_SHA256 :: Cipher
cipher_TLS13_AES128GCM_SHA256 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0x1301
    , cipherName :: [Char]
cipherName         = [Char]
"AES128GCM-SHA256"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes128gcm_13
    , cipherHash :: Hash
cipherHash         = Hash
SHA256
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Maybe Hash
forall a. Maybe a
Nothing
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_TLS13
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS13
    }

cipher_TLS13_AES256GCM_SHA384 :: Cipher
cipher_TLS13_AES256GCM_SHA384 :: Cipher
cipher_TLS13_AES256GCM_SHA384 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0x1302
    , cipherName :: [Char]
cipherName         = [Char]
"AES256GCM-SHA384"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes256gcm_13
    , cipherHash :: Hash
cipherHash         = Hash
SHA384
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Maybe Hash
forall a. Maybe a
Nothing
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_TLS13
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS13
    }

cipher_TLS13_CHACHA20POLY1305_SHA256 :: Cipher
cipher_TLS13_CHACHA20POLY1305_SHA256 :: Cipher
cipher_TLS13_CHACHA20POLY1305_SHA256 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0x1303
    , cipherName :: [Char]
cipherName         = [Char]
"CHACHA20POLY1305-SHA256"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_chacha20poly1305
    , cipherHash :: Hash
cipherHash         = Hash
SHA256
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Maybe Hash
forall a. Maybe a
Nothing
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_TLS13
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS13
    }

cipher_TLS13_AES128CCM_SHA256 :: Cipher
cipher_TLS13_AES128CCM_SHA256 :: Cipher
cipher_TLS13_AES128CCM_SHA256 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0x1304
    , cipherName :: [Char]
cipherName         = [Char]
"AES128CCM-SHA256"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes128ccm_13
    , cipherHash :: Hash
cipherHash         = Hash
SHA256
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Maybe Hash
forall a. Maybe a
Nothing
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_TLS13
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS13
    }

cipher_TLS13_AES128CCM8_SHA256 :: Cipher
cipher_TLS13_AES128CCM8_SHA256 :: Cipher
cipher_TLS13_AES128CCM8_SHA256 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0x1305
    , cipherName :: [Char]
cipherName         = [Char]
"AES128CCM8-SHA256"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes128ccm8_13
    , cipherHash :: Hash
cipherHash         = Hash
SHA256
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Maybe Hash
forall a. Maybe a
Nothing
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_TLS13
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS13
    }

cipher_ECDHE_ECDSA_AES128CBC_SHA :: Cipher
cipher_ECDHE_ECDSA_AES128CBC_SHA :: Cipher
cipher_ECDHE_ECDSA_AES128CBC_SHA = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0xC009
    , cipherName :: [Char]
cipherName         = [Char]
"ECDHE-ECDSA-AES128CBC-SHA"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes128
    , cipherHash :: Hash
cipherHash         = Hash
SHA1
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Maybe Hash
forall a. Maybe a
Nothing
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_ECDHE_ECDSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS10
    }

cipher_ECDHE_ECDSA_AES256CBC_SHA :: Cipher
cipher_ECDHE_ECDSA_AES256CBC_SHA :: Cipher
cipher_ECDHE_ECDSA_AES256CBC_SHA = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0xC00A
    , cipherName :: [Char]
cipherName         = [Char]
"ECDHE-ECDSA-AES256CBC-SHA"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes256
    , cipherHash :: Hash
cipherHash         = Hash
SHA1
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Maybe Hash
forall a. Maybe a
Nothing
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_ECDHE_ECDSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS10
    }

cipher_ECDHE_RSA_AES128CBC_SHA :: Cipher
cipher_ECDHE_RSA_AES128CBC_SHA :: Cipher
cipher_ECDHE_RSA_AES128CBC_SHA = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0xC013
    , cipherName :: [Char]
cipherName         = [Char]
"ECDHE-RSA-AES128CBC-SHA"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes128
    , cipherHash :: Hash
cipherHash         = Hash
SHA1
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Maybe Hash
forall a. Maybe a
Nothing
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_ECDHE_RSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS10
    }

cipher_ECDHE_RSA_AES256CBC_SHA :: Cipher
cipher_ECDHE_RSA_AES256CBC_SHA :: Cipher
cipher_ECDHE_RSA_AES256CBC_SHA = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0xC014
    , cipherName :: [Char]
cipherName         = [Char]
"ECDHE-RSA-AES256CBC-SHA"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes256
    , cipherHash :: Hash
cipherHash         = Hash
SHA1
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Maybe Hash
forall a. Maybe a
Nothing
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_ECDHE_RSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS10
    }

cipher_ECDHE_RSA_AES128CBC_SHA256 :: Cipher
cipher_ECDHE_RSA_AES128CBC_SHA256 :: Cipher
cipher_ECDHE_RSA_AES128CBC_SHA256 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0xC027
    , cipherName :: [Char]
cipherName         = [Char]
"ECDHE-RSA-AES128CBC-SHA256"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes128
    , cipherHash :: Hash
cipherHash         = Hash
SHA256
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Hash -> Maybe Hash
forall a. a -> Maybe a
Just Hash
SHA256
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_ECDHE_RSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS12 -- RFC 5288 Sec 4
    }

cipher_ECDHE_RSA_AES256CBC_SHA384 :: Cipher
cipher_ECDHE_RSA_AES256CBC_SHA384 :: Cipher
cipher_ECDHE_RSA_AES256CBC_SHA384 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0xC028
    , cipherName :: [Char]
cipherName         = [Char]
"ECDHE-RSA-AES256CBC-SHA384"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes256
    , cipherHash :: Hash
cipherHash         = Hash
SHA384
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Hash -> Maybe Hash
forall a. a -> Maybe a
Just Hash
SHA384
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_ECDHE_RSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS12 -- RFC 5288 Sec 4
    }

cipher_ECDHE_ECDSA_AES128CBC_SHA256 :: Cipher
cipher_ECDHE_ECDSA_AES128CBC_SHA256 :: Cipher
cipher_ECDHE_ECDSA_AES128CBC_SHA256 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0xc023
    , cipherName :: [Char]
cipherName         = [Char]
"ECDHE-ECDSA-AES128CBC-SHA256"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes128
    , cipherHash :: Hash
cipherHash         = Hash
SHA256
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Hash -> Maybe Hash
forall a. a -> Maybe a
Just Hash
SHA256
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_ECDHE_ECDSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS12 -- RFC 5289
    }

cipher_ECDHE_ECDSA_AES256CBC_SHA384 :: Cipher
cipher_ECDHE_ECDSA_AES256CBC_SHA384 :: Cipher
cipher_ECDHE_ECDSA_AES256CBC_SHA384 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0xC024
    , cipherName :: [Char]
cipherName         = [Char]
"ECDHE-ECDSA-AES256CBC-SHA384"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes256
    , cipherHash :: Hash
cipherHash         = Hash
SHA384
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Hash -> Maybe Hash
forall a. a -> Maybe a
Just Hash
SHA384
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_ECDHE_ECDSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS12 -- RFC 5289
    }

cipher_ECDHE_ECDSA_AES128CCM_SHA256 :: Cipher
cipher_ECDHE_ECDSA_AES128CCM_SHA256 :: Cipher
cipher_ECDHE_ECDSA_AES128CCM_SHA256 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0xc0ac
    , cipherName :: [Char]
cipherName         = [Char]
"ECDHE-ECDSA-AES128CCM-SHA256"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes128ccm
    , cipherHash :: Hash
cipherHash         = Hash
SHA256
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Hash -> Maybe Hash
forall a. a -> Maybe a
Just Hash
SHA256
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_ECDHE_ECDSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS12 -- RFC 7251
    }

cipher_ECDHE_ECDSA_AES128CCM8_SHA256 :: Cipher
cipher_ECDHE_ECDSA_AES128CCM8_SHA256 :: Cipher
cipher_ECDHE_ECDSA_AES128CCM8_SHA256 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0xc0ae
    , cipherName :: [Char]
cipherName         = [Char]
"ECDHE-ECDSA-AES128CCM8-SHA256"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes128ccm8
    , cipherHash :: Hash
cipherHash         = Hash
SHA256
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Hash -> Maybe Hash
forall a. a -> Maybe a
Just Hash
SHA256
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_ECDHE_ECDSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS12 -- RFC 7251
    }

cipher_ECDHE_ECDSA_AES128GCM_SHA256 :: Cipher
cipher_ECDHE_ECDSA_AES128GCM_SHA256 :: Cipher
cipher_ECDHE_ECDSA_AES128GCM_SHA256 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0xC02B
    , cipherName :: [Char]
cipherName         = [Char]
"ECDHE-ECDSA-AES128GCM-SHA256"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes128gcm
    , cipherHash :: Hash
cipherHash         = Hash
SHA256
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Hash -> Maybe Hash
forall a. a -> Maybe a
Just Hash
SHA256
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_ECDHE_ECDSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS12 -- RFC 5289
    }

cipher_ECDHE_ECDSA_AES256CCM_SHA256 :: Cipher
cipher_ECDHE_ECDSA_AES256CCM_SHA256 :: Cipher
cipher_ECDHE_ECDSA_AES256CCM_SHA256 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0xc0ad
    , cipherName :: [Char]
cipherName         = [Char]
"ECDHE-ECDSA-AES256CCM-SHA256"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes256ccm
    , cipherHash :: Hash
cipherHash         = Hash
SHA256
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Hash -> Maybe Hash
forall a. a -> Maybe a
Just Hash
SHA256
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_ECDHE_ECDSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS12 -- RFC 7251
    }

cipher_ECDHE_ECDSA_AES256CCM8_SHA256 :: Cipher
cipher_ECDHE_ECDSA_AES256CCM8_SHA256 :: Cipher
cipher_ECDHE_ECDSA_AES256CCM8_SHA256 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0xc0af
    , cipherName :: [Char]
cipherName         = [Char]
"ECDHE-ECDSA-AES256CCM8-SHA256"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes256ccm8
    , cipherHash :: Hash
cipherHash         = Hash
SHA256
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Hash -> Maybe Hash
forall a. a -> Maybe a
Just Hash
SHA256
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_ECDHE_ECDSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS12 -- RFC 7251
    }

cipher_ECDHE_ECDSA_AES256GCM_SHA384 :: Cipher
cipher_ECDHE_ECDSA_AES256GCM_SHA384 :: Cipher
cipher_ECDHE_ECDSA_AES256GCM_SHA384 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0xC02C
    , cipherName :: [Char]
cipherName         = [Char]
"ECDHE-ECDSA-AES256GCM-SHA384"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes256gcm
    , cipherHash :: Hash
cipherHash         = Hash
SHA384
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Hash -> Maybe Hash
forall a. a -> Maybe a
Just Hash
SHA384
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_ECDHE_ECDSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS12 -- RFC 5289
    }

cipher_ECDHE_RSA_AES128GCM_SHA256 :: Cipher
cipher_ECDHE_RSA_AES128GCM_SHA256 :: Cipher
cipher_ECDHE_RSA_AES128GCM_SHA256 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0xC02F
    , cipherName :: [Char]
cipherName         = [Char]
"ECDHE-RSA-AES128GCM-SHA256"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes128gcm
    , cipherHash :: Hash
cipherHash         = Hash
SHA256
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Hash -> Maybe Hash
forall a. a -> Maybe a
Just Hash
SHA256
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_ECDHE_RSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS12 -- RFC 5288 Sec 4
    }

cipher_ECDHE_RSA_AES256GCM_SHA384 :: Cipher
cipher_ECDHE_RSA_AES256GCM_SHA384 :: Cipher
cipher_ECDHE_RSA_AES256GCM_SHA384 = Cipher :: CipherID
-> [Char]
-> Hash
-> Bulk
-> CipherKeyExchangeType
-> Maybe Version
-> Maybe Hash
-> Cipher
Cipher
    { cipherID :: CipherID
cipherID           = CipherID
0xC030
    , cipherName :: [Char]
cipherName         = [Char]
"ECDHE-RSA-AES256GCM-SHA384"
    , cipherBulk :: Bulk
cipherBulk         = Bulk
bulk_aes256gcm
    , cipherHash :: Hash
cipherHash         = Hash
SHA384
    , cipherPRFHash :: Maybe Hash
cipherPRFHash      = Hash -> Maybe Hash
forall a. a -> Maybe a
Just Hash
SHA384
    , cipherKeyExchange :: CipherKeyExchangeType
cipherKeyExchange  = CipherKeyExchangeType
CipherKeyExchange_ECDHE_RSA
    , cipherMinVer :: Maybe Version
cipherMinVer       = Version -> Maybe Version
forall a. a -> Maybe a
Just Version
TLS12 -- RFC 5289
    }

-- A list of cipher suite is found from:
-- https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-4