| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Crypto.HPKE.Internal
Synopsis
- data HPKEMap = HPKEMap {}
- defaultHPKEMap :: HPKEMap
- setupS :: HPKEMap -> Mode -> KEM_ID -> KDF_ID -> AEAD_ID -> Maybe EncodedSecretKey -> Maybe EncodedSecretKey -> EncodedPublicKey -> Info -> PSK -> PSK_ID -> IO (EncodedPublicKey, ContextS)
- setupR :: HPKEMap -> Mode -> KEM_ID -> KDF_ID -> AEAD_ID -> EncodedSecretKey -> Maybe EncodedSecretKey -> EncodedPublicKey -> Info -> PSK -> PSK_ID -> IO ContextR
- data KEMGroup = forall c.(EllipticCurve c, EllipticCurveDH c) => KEMGroup (Proxy c)
- data KDFHash = forall h.(HashAlgorithm h, KDF h) => KDFHash h
- data AEADCipher = forall a.Aead a => AEADCipher (Proxy a)
- class Aead a where
- class KDF h where
- data Mode
- type PublicKey group = Point group
- type SecretKey group = Scalar group
- type Seal = Nonce -> AAD -> PlainText -> Either HPKEError CipherText
- type Open = Nonce -> AAD -> CipherText -> Either HPKEError PlainText
- type Nonce = ByteString
- type Suite = ByteString
- type Salt = ByteString
- type Label = ByteString
- type IKM = ByteString
- genKeyPair :: HPKEMap -> KEM_ID -> IO (EncodedPublicKey, EncodedSecretKey)
Extensible map
Arguments
| :: HPKEMap | |
| -> Mode | |
| -> KEM_ID | |
| -> KDF_ID | |
| -> AEAD_ID | |
| -> Maybe EncodedSecretKey | My ephemeral secret key. Automatically generated if |
| -> Maybe EncodedSecretKey | My secret key for authentication.
|
| -> EncodedPublicKey | Peer's public key. |
| -> Info | |
| -> PSK | |
| -> PSK_ID | |
| -> IO (EncodedPublicKey, ContextS) |
Arguments
| :: HPKEMap | |
| -> Mode | |
| -> KEM_ID | |
| -> KDF_ID | |
| -> AEAD_ID | |
| -> EncodedSecretKey | My secret key |
| -> Maybe EncodedSecretKey | My secret key for authentication.
|
| -> EncodedPublicKey | Peer's public key. |
| -> Info | |
| -> PSK | |
| -> PSK_ID | |
| -> IO ContextR |
Unified types
Constructors
| forall c.(EllipticCurve c, EllipticCurveDH c) => KEMGroup (Proxy c) |
data AEADCipher Source #
Constructors
| forall a.Aead a => AEADCipher (Proxy a) |
API
Instances
| Aead AES128 Source # | From RFC 9180 A.1
|
| Aead AES256 Source # | From RFC 9180 A.6
|
| Aead ChaCha20Poly1305 Source # | From RFC 9180 A.5
|
Methods
labeledExtract :: Suite -> Salt -> Label -> IKM -> PRK h Source #
labeledExpand :: Suite -> PRK h -> Label -> Info -> Int -> Key Source #
Types
Constructors
| ModeBase | |
| ModePsk | |
| ModeAuth | |
| ModeAuthPsk |
type Nonce = ByteString Source #
type Suite = ByteString Source #
type Salt = ByteString Source #
type Label = ByteString Source #
type IKM = ByteString Source #
Generating key pair
genKeyPair :: HPKEMap -> KEM_ID -> IO (EncodedPublicKey, EncodedSecretKey) Source #
Generating a pair of public key and secret key based on
KEM_ID.