ID for key encapsulation mechanism.
Modulehpke-0.0.0Haskell2010
Crypto.HPKE
Hybrid Public Key Encryption (RFC9180).
Contents
Synopsis
- newtype KEM_ID
- pattern DHKEM_P256_HKDF_SHA256
- pattern DHKEM_P384_HKDF_SHA384
- pattern DHKEM_P521_HKDF_SHA512
- pattern DHKEM_X25519_HKDF_SHA256
- pattern DHKEM_X448_HKDF_SHA512
- newtype KDF_ID
- pattern HKDF_SHA256
- pattern HKDF_SHA384
- pattern HKDF_SHA512
- newtype AEAD_ID
- pattern AES_128_GCM
- pattern AES_256_GCM
- pattern ChaCha20Poly1305
- value setupBaseS
- value setupBaseR
- value setupPSKS
- value setupPSKR
- value seal
- value open
- value exportS
- value exportR
- data ContextS
- data ContextR
- newtype EncodedSecretKey
- newtype EncodedPublicKey
- newtype SharedSecret
- type Info
- type PSK
- type PSK_ID
- type AAD
- type PlainText
- type CipherText
- type Key
- data HPKEError
- value nEnc
- value nTag
- Packagehpke-0.0.0
- Exports37
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceHPKE.hs
IDs
ID for key derivation function.
Constructors
ID for authenticated encryption with additional data
Constructors
Setup
For mode_base and mode_auth
setupBaseS :: KEM_ID-> KDF_ID-> AEAD_ID-> Maybe EncodedSecretKeyMy ephemeral secret key. Automatically generated if Nothing
-> Maybe EncodedSecretKeyMy secret key for authentication.
mode_baseis used if Nothing.base_authis used, otherwise.-> EncodedPublicKeyPeer's public key.
-> Info-> IO (EncodedPublicKey, ContextS)
Setting up base/auth mode for a sender. This throws HPKEError.
setupBaseR :: KEM_ID-> KDF_ID-> AEAD_ID-> EncodedSecretKeyMy secret key
-> Maybe EncodedSecretKeyMy secret key for authentication.
mode_baseis used if Nothing.base_authis used, otherwise.-> EncodedPublicKeyPeer's public key.
-> Info-> IO ContextR
Setting up base/auth mode for a receiver with its key pair. This throws HPKEError.
For mode_psk and mode_auth_psk
setupPSKS :: KEM_ID-> KDF_ID-> AEAD_ID-> Maybe EncodedSecretKeyMy ephemeral secret key. Automatically generated if Nothing
-> Maybe EncodedSecretKeyMy secret key for authentication.
mode_baseis used if Nothing.base_authis used, otherwise.-> EncodedPublicKeyPeer's public key.
-> Info-> PSK-> PSK_ID-> IO (EncodedPublicKey, ContextS)
Setting up psk/auth_psk mode for a sender. This throws HPKEError.
setupPSKR :: KEM_ID-> KDF_ID-> AEAD_ID-> EncodedSecretKeyMy secret key
-> Maybe EncodedSecretKeyMy secret key for authentication.
mode_baseis used if Nothing.base_authis used, otherwise.-> EncodedPublicKeyPeer's public key.
-> Info-> PSK-> PSK_ID-> IO ContextR
Setting up psk/auth_psk mode for a receiver with its key pair. This throws HPKEError.
Encryption and Decyption
Encryption. This throws HPKEError.
Decryption. This throws HPKEError.
Secret export
Exporting secret.
Exporting secret.
Types
Context for senders.
Context for receivers.
Encoded secret key.
Constructors
Instances3Eq, Show, IsString
Eq EncodedSecretKeyDefined in hpke-0.0.0 · Crypto.HPKE.TypesShow EncodedSecretKeyDefined in hpke-0.0.0 · Crypto.HPKE.TypesIsString EncodedSecretKeyDefined in hpke-0.0.0 · Crypto.HPKE.Types
Encoded public key.
Constructors
Instances3Eq, Show, IsString
Eq EncodedPublicKeyDefined in hpke-0.0.0 · Crypto.HPKE.TypesShow EncodedPublicKeyDefined in hpke-0.0.0 · Crypto.HPKE.TypesIsString EncodedPublicKeyDefined in hpke-0.0.0 · Crypto.HPKE.Types
Information string.
Pre-shared key.
ID for pre-shared key.
Additional authenticated data for AEAD.
Plain text.
Cipher text (including a authentication tag)
Encryption key.
Error
Errors for HPKE
Misc
Length of "enc", aka sender's public key.
Length of AEAD tag.