    module Network.TLS.Types.Secret where

    import Network.TLS.Imports

    -- | Phantom type indicating early traffic secret.
    data EarlySecret

    -- | Phantom type indicating handshake traffic secrets.
    data HandshakeSecret

    -- | Phantom type indicating application traffic secrets.
    data ApplicationSecret

    data ResumptionSecret

    newtype BaseSecret a = BaseSecret ByteString deriving (Int -> BaseSecret a -> ShowS
    [BaseSecret a] -> ShowS
    BaseSecret a -> String
    (Int -> BaseSecret a -> ShowS)
    -> (BaseSecret a -> String)
    -> ([BaseSecret a] -> ShowS)
    -> Show (BaseSecret a)
    forall a. Int -> BaseSecret a -> ShowS
    forall a. [BaseSecret a] -> ShowS
    forall a. BaseSecret a -> String
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: forall a. Int -> BaseSecret a -> ShowS
    showsPrec :: Int -> BaseSecret a -> ShowS
    $cshow :: forall a. BaseSecret a -> String
    show :: BaseSecret a -> String
    $cshowList :: forall a. [BaseSecret a] -> ShowS
    showList :: [BaseSecret a] -> ShowS
    Show)
    newtype AnyTrafficSecret a = AnyTrafficSecret ByteString deriving (Int -> AnyTrafficSecret a -> ShowS
    [AnyTrafficSecret a] -> ShowS
    AnyTrafficSecret a -> String
    (Int -> AnyTrafficSecret a -> ShowS)
    -> (AnyTrafficSecret a -> String)
    -> ([AnyTrafficSecret a] -> ShowS)
    -> Show (AnyTrafficSecret a)
    forall a. Int -> AnyTrafficSecret a -> ShowS
    forall a. [AnyTrafficSecret a] -> ShowS
    forall a. AnyTrafficSecret a -> String
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: forall a. Int -> AnyTrafficSecret a -> ShowS
    showsPrec :: Int -> AnyTrafficSecret a -> ShowS
    $cshow :: forall a. AnyTrafficSecret a -> String
    show :: AnyTrafficSecret a -> String
    $cshowList :: forall a. [AnyTrafficSecret a] -> ShowS
    showList :: [AnyTrafficSecret a] -> ShowS
    Show)

    -- | A client traffic secret, typed with a parameter indicating a step in the
    -- TLS key schedule.
    newtype ClientTrafficSecret a = ClientTrafficSecret ByteString deriving (Int -> ClientTrafficSecret a -> ShowS
    [ClientTrafficSecret a] -> ShowS
    ClientTrafficSecret a -> String
    (Int -> ClientTrafficSecret a -> ShowS)
    -> (ClientTrafficSecret a -> String)
    -> ([ClientTrafficSecret a] -> ShowS)
    -> Show (ClientTrafficSecret a)
    forall a. Int -> ClientTrafficSecret a -> ShowS
    forall a. [ClientTrafficSecret a] -> ShowS
    forall a. ClientTrafficSecret a -> String
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: forall a. Int -> ClientTrafficSecret a -> ShowS
    showsPrec :: Int -> ClientTrafficSecret a -> ShowS
    $cshow :: forall a. ClientTrafficSecret a -> String
    show :: ClientTrafficSecret a -> String
    $cshowList :: forall a. [ClientTrafficSecret a] -> ShowS
    showList :: [ClientTrafficSecret a] -> ShowS
    Show)

    -- | A server traffic secret, typed with a parameter indicating a step in the
    -- TLS key schedule.
    newtype ServerTrafficSecret a = ServerTrafficSecret ByteString deriving (Int -> ServerTrafficSecret a -> ShowS
    [ServerTrafficSecret a] -> ShowS
    ServerTrafficSecret a -> String
    (Int -> ServerTrafficSecret a -> ShowS)
    -> (ServerTrafficSecret a -> String)
    -> ([ServerTrafficSecret a] -> ShowS)
    -> Show (ServerTrafficSecret a)
    forall a. Int -> ServerTrafficSecret a -> ShowS
    forall a. [ServerTrafficSecret a] -> ShowS
    forall a. ServerTrafficSecret a -> String
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: forall a. Int -> ServerTrafficSecret a -> ShowS
    showsPrec :: Int -> ServerTrafficSecret a -> ShowS
    $cshow :: forall a. ServerTrafficSecret a -> String
    show :: ServerTrafficSecret a -> String
    $cshowList :: forall a. [ServerTrafficSecret a] -> ShowS
    showList :: [ServerTrafficSecret a] -> ShowS
    Show)

    data SecretTriple a = SecretTriple
        { forall a. SecretTriple a -> BaseSecret a
    triBase :: BaseSecret a
        , forall a. SecretTriple a -> ClientTrafficSecret a
    triClient :: ClientTrafficSecret a
        , forall a. SecretTriple a -> ServerTrafficSecret a
    triServer :: ServerTrafficSecret a
        }
        deriving (Int -> SecretTriple a -> ShowS
    [SecretTriple a] -> ShowS
    SecretTriple a -> String
    (Int -> SecretTriple a -> ShowS)
    -> (SecretTriple a -> String)
    -> ([SecretTriple a] -> ShowS)
    -> Show (SecretTriple a)
    forall a. Int -> SecretTriple a -> ShowS
    forall a. [SecretTriple a] -> ShowS
    forall a. SecretTriple a -> String
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: forall a. Int -> SecretTriple a -> ShowS
    showsPrec :: Int -> SecretTriple a -> ShowS
    $cshow :: forall a. SecretTriple a -> String
    show :: SecretTriple a -> String
    $cshowList :: forall a. [SecretTriple a] -> ShowS
    showList :: [SecretTriple a] -> ShowS
    Show)

    data SecretPair a = SecretPair
        { forall a. SecretPair a -> BaseSecret a
    pairBase :: BaseSecret a
        , forall a. SecretPair a -> ClientTrafficSecret a
    pairClient :: ClientTrafficSecret a
        }

    -- | Hold both client and server traffic secrets at the same step.
    type TrafficSecrets a = (ClientTrafficSecret a, ServerTrafficSecret a)

    -- Main secret for TLS 1.2 or earlier.
    newtype MainSecret = MainSecret ByteString deriving (Int -> MainSecret -> ShowS
    [MainSecret] -> ShowS
    MainSecret -> String
    (Int -> MainSecret -> ShowS)
    -> (MainSecret -> String)
    -> ([MainSecret] -> ShowS)
    -> Show MainSecret
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> MainSecret -> ShowS
    showsPrec :: Int -> MainSecret -> ShowS
    $cshow :: MainSecret -> String
    show :: MainSecret -> String
    $cshowList :: [MainSecret] -> ShowS
    showList :: [MainSecret] -> ShowS
    Show)