Parameters for OAEP encryption/decryption
Constructors
OAEPParamsoaepHash :: hashHash function to use.
oaepMaskGenAlg :: MaskGenAlgorithm seed outputMask Gen algorithm to use.
oaepLabel :: Maybe ByteStringOptional label prepended to message.
:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27
Modulecryptonite-0.30Haskell2010
Parameters for OAEP encryption/decryption
OAEPParamsoaepHash :: hashHash function to use.
oaepMaskGenAlg :: MaskGenAlgorithm seed outputMask Gen algorithm to use.
oaepLabel :: Maybe ByteStringOptional label prepended to message.
Default Params with a specified hash function
encryptWithSeed :: HashAlgorithm hash=> ByteStringSeed
-> OAEPParams hash ByteString ByteStringOAEP params to use for encryption
-> PublicKeyPublic key.
-> ByteStringMessage to encrypt
-> Either Error ByteStringEncrypt a message using OAEP with a predefined seed.
encrypt :: (HashAlgorithm hash, MonadRandom m)=> OAEPParams hash ByteString ByteStringOAEP params to use for encryption.
-> PublicKeyPublic key.
-> ByteStringMessage to encrypt
-> m (Either Error ByteString)Encrypt a message using OAEP
decrypt :: HashAlgorithm hash=> Maybe BlinderOptional blinder
-> OAEPParams hash ByteString ByteStringOAEP params to use for decryption
-> PrivateKeyPrivate key
-> ByteStringCipher text
-> Either Error ByteStringDecrypt a ciphertext using OAEP
When the signature is not in a context where an attacker could gain information from the timing of the operation, the blinder can be set to None.
If unsure always set a blinder or use decryptSafer
decryptSafer :: (HashAlgorithm hash, MonadRandom m)=> OAEPParams hash ByteString ByteStringOAEP params to use for decryption
-> PrivateKeyPrivate key
-> ByteStringCipher text
-> m (Either Error ByteString)Decrypt a ciphertext using OAEP and by automatically generating a blinder.