Modulehpke-0.0.0Haskell2010
Crypto.HPKE.Internal
- 14 types
- 2 classes
- 4 values
- Packagehpke-0.0.0
- Exports20
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceKeyPair.hs
Extensible map
4 declarationsvalue
setupS :: HPKEMap-> Mode-> 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)
Unified types
3 declarationsConstructors
forall c. (EllipticCurve c, EllipticCurveDH c) => KEMGroup (Proxy c)
Constructors
forall h. (HashAlgorithm h, KDF h) => KDFHash h
Constructors
forall a. Aead a => AEADCipher (Proxy a)
API
2 declarationsInstances3Aead
Aead AES128Defined in hpke-0.0.0 · Crypto.HPKE.AEADFrom RFC 9180 A.1
Example6 expressions let key = "\x45\x31\x68\x5d\x41\xd6\x5f\x03\xdc\x48\xf6\xb8\x30\x2c\x05\xb0" :: ByteStringlet nonce = "\x56\xd8\x90\xe5\xac\xca\xaf\x01\x1c\xff\x4b\x7d" :: ByteStringlet aad = "\x43\x6f\x75\x6e\x74\x2d\x30" :: ByteStringlet plain = "The quick brown fox jumps over the very lazy dog." :: ByteStringlet proxy = Proxy :: Proxy AES128sealA proxy key nonce aad plain >>= openA proxy key nonce aadRight "The quick brown fox jumps over the very lazy dog."
Aead AES256Defined in hpke-0.0.0 · Crypto.HPKE.AEADFrom RFC 9180 A.6
Example6 expressions let key = "\x75\x1e\x34\x6c\xe8\xf0\xdd\xb2\x30\x5c\x8a\x2a\x85\xc7\x0d\x5c\xf5\x59\xc5\x30\x93\x65\x6b\xe6\x36\xb9\x40\x6d\x4d\x7d\x1b\x70" :: ByteStringlet nonce = "\x55\xff\x7a\x7d\x73\x9c\x69\xf4\x4b\x25\x44\x7b" :: ByteStringlet aad = "\x43\x6f\x75\x6e\x74\x2d\x30" :: ByteStringlet plain = "The quick brown fox jumps over the very lazy dog." :: ByteStringlet proxy = Proxy :: Proxy AES256sealA proxy key nonce aad plain >>= openA proxy key nonce aadRight "The quick brown fox jumps over the very lazy dog."
Aead ChaCha20Poly1305Defined in hpke-0.0.0 · Crypto.HPKE.AEADFrom RFC 9180 A.5
Example6 expressions let key = "\xa8\xf4\x54\x90\xa9\x2a\x3b\x04\xd1\xdb\xf6\xcf\x2c\x39\x39\xad\x8b\xfc\x9b\xfc\xb9\x7c\x04\xbf\xfe\x11\x67\x30\xc9\xdf\xe3\xfc" :: ByteStringlet nonce = "\x72\x6b\x43\x90\xed\x22\x09\x80\x9f\x58\xc6\x93" :: ByteStringlet aad = "\x43\x6f\x75\x6e\x74\x2d\x30" :: ByteStringlet plain = "The quick brown fox jumps over the very lazy dog." :: ByteStringlet proxy = Proxy :: Proxy CCP.ChaCha20Poly1305sealA proxy key nonce aad plain >>= openA proxy key nonce aadRight "The quick brown fox jumps over the very lazy dog."
Types
10 declarationsGenerating key pair
1 declarationGenerating a pair of public key and secret key based on KEM_ID.