{-|
Module      : Botan.KeyEncapsulation
Description : Key Encapsulation
Copyright   : (c) Leo D, 2023
License     : BSD-3-Clause
Maintainer  : leo@apotheca.io
Stability   : experimental
Portability : POSIX
-}

module Botan.PubKey.KeyEncapsulation
(

-- * Thing
-- $introduction

-- * Usage
-- $usage

-- * KEM Encryption

  kemEncrypt
, kemDecrypt

-- ** Associated types

, KEMSharedKey(..)
, KEMEncapsulatedKey(..)

-- ** Accessors

, kemSharedKeyLength
, kemEncapsulatedKeyLength

-- ** Data type
,  KEMEncrypt(..)

-- ** Destructor
, destroyKEMEncrypt

-- ** Initializers
, newKEMEncrypt

-- ** Accessors
, kemEncryptSharedKeyLength
, kemEncryptEncapsulatedKeyLength

-- ** Mutable Algorithm
, kemEncryptCreateSharedKey

-- * KEM Decryption

-- ** Data type
, KEMDecrypt(..)

-- ** Destructor
, destroyKEMDecrypt

-- ** Initializers
, newKEMDecrypt

-- ** Accessors
, kemDecryptSharedKeyLength

-- ** Mutable Algorithm
, kemDecryptSharedKey

) where

import qualified Data.ByteString as ByteString

import qualified Botan.Low.PubKey.KeyEncapsulation as Low

import Botan.Error
import Botan.Prelude
import Botan.KDF
import Botan.RNG
import Botan.PubKey

{- $introduction

-}

{- $usage

-}

--
-- Idiomatic interface
--

kemEncrypt :: a
kemEncrypt = a
forall a. HasCallStack => a
undefined

kemDecrypt :: a
kemDecrypt = a
forall a. HasCallStack => a
undefined

-- Associated types

type KEMSharedKey = Low.KEMSharedKey
type KEMEncapsulatedKey = Low.KEMEncapsulatedKey

-- Accessors

kemSharedKeyLength :: a
kemSharedKeyLength = a
forall a. HasCallStack => a
undefined

kemEncapsulatedKeyLength :: a
kemEncapsulatedKeyLength = a
forall a. HasCallStack => a
undefined


-- Idiomatic algorithm

--
-- Mutable interface
--

-- KEM Encryption

data KEMEncrypt

-- Destructor

destroyKEMEncrypt :: (MonadIO m) => KEMEncrypt -> m ()
destroyKEMEncrypt :: forall (m :: * -> *). MonadIO m => KEMEncrypt -> m ()
destroyKEMEncrypt = KEMEncrypt -> m ()
forall a. HasCallStack => a
undefined

-- Initializers

newKEMEncrypt :: (MonadIO m) => PubKey -> KDF -> m KEMEncrypt
newKEMEncrypt :: forall (m :: * -> *). MonadIO m => PubKey -> KDF -> m KEMEncrypt
newKEMEncrypt = PubKey -> KDF -> m KEMEncrypt
forall a. HasCallStack => a
undefined

-- Accessors

kemEncryptEncapsulatedKeyLength :: (MonadIO m) => KEMEncrypt -> m Int
kemEncryptEncapsulatedKeyLength :: forall (m :: * -> *). MonadIO m => KEMEncrypt -> m Int
kemEncryptEncapsulatedKeyLength = KEMEncrypt -> m Int
forall a. HasCallStack => a
undefined

-- Accessory functions

kemEncryptSharedKeyLength :: (MonadIO m) => KEMEncrypt -> Int -> m Int
kemEncryptSharedKeyLength :: forall (m :: * -> *). MonadIO m => KEMEncrypt -> Int -> m Int
kemEncryptSharedKeyLength = KEMEncrypt -> Int -> m Int
forall a. HasCallStack => a
undefined

-- Mutable algorithm

kemEncryptCreateSharedKey :: (MonadRandomIO m) => KEMEncrypt -> ByteString -> Int -> m (KEMSharedKey,KEMEncapsulatedKey)
kemEncryptCreateSharedKey :: forall (m :: * -> *).
MonadRandomIO m =>
KEMEncrypt -> ByteString -> Int -> m (ByteString, ByteString)
kemEncryptCreateSharedKey = KEMEncrypt -> ByteString -> Int -> m (ByteString, ByteString)
forall a. HasCallStack => a
undefined

-- KEM Decryption

data KEMDecrypt

-- Destructor

destroyKEMDecrypt  :: (MonadIO m) => KEMDecrypt -> m ()
destroyKEMDecrypt :: forall (m :: * -> *). MonadIO m => KEMDecrypt -> m ()
destroyKEMDecrypt = KEMDecrypt -> m ()
forall a. HasCallStack => a
undefined

-- Initializers

newKEMDecrypt :: (MonadIO m) => PrivKey -> KDF -> m KEMDecrypt
newKEMDecrypt :: forall (m :: * -> *). MonadIO m => PrivKey -> KDF -> m KEMDecrypt
newKEMDecrypt = PrivKey -> KDF -> m KEMDecrypt
forall a. HasCallStack => a
undefined

-- Accessory functions

kemDecryptSharedKeyLength :: (MonadIO m) => KEMDecrypt -> Int -> m Int
kemDecryptSharedKeyLength :: forall (m :: * -> *). MonadIO m => KEMDecrypt -> Int -> m Int
kemDecryptSharedKeyLength = KEMDecrypt -> Int -> m Int
forall a. HasCallStack => a
undefined

-- Mutable algorithm

kemDecryptSharedKey :: (MonadIO m) => KEMDecrypt -> ByteString -> KEMEncapsulatedKey -> Int -> m KEMSharedKey
kemDecryptSharedKey :: forall (m :: * -> *).
MonadIO m =>
KEMDecrypt -> ByteString -> ByteString -> Int -> m ByteString
kemDecryptSharedKey  = KEMDecrypt -> ByteString -> ByteString -> Int -> m ByteString
forall a. HasCallStack => a
undefined