HORIZON HASKELLDocslts/ghc-10.0.xaa25b892026-10-10Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · aa25b89 · 2026-10-10

Modulecrypton-2.1.7Haskell2010

Crypto.PubKey.Rabin.OAEP

  • 1 type
  • 3 values
  • Packagecrypton-2.1.7
  • Exports4
  • LanguageHaskell2010
  • LicenceBSD-3-Clause AND MIT AND ISC
  • SourceOAEP.hs
valueunpad
  1. :: HashAlgorithm hash
  2. => OAEPParams hash ByteString ByteString

    OAEP params to use

  3. -> Int

    size of public key in bytes

  4. -> ByteString

    encoded message (not encrypted)

  5. -> Either Error ByteString
#

Un-pad a OAEP encoded message.

The data block is scanned in full rather than up to the 01 octet separating the padding from the message, and the label hash and the leading octet are compared without an early exit, so neither the length of the padding nor where a comparison first differs shows up in how long this takes. This is what Crypto.PubKey.RSA.OAEP does with the same block.

What remains visible is the result itself: whether the block was well formed, and the length of the message when it was. That is the signal Manger's attack needs, so a caller that decrypts attacker-supplied ciphertext must not pass the distinction on.