module OAEP:
The same hash function is used for padding and MGF. MGF is MGF1 as defined in PKCS #1 2.1.
Keys must have a minimum of 2 + 2 * hlen + len(message) bytes, where
hlen is the hash length.
| Parameters: |
|
val encrypt : ?g:Nocrypto.Rng.g ->
?label:Cstruct.t -> key:Nocrypto.Rsa.pub -> Cstruct.t -> Cstruct.tencrypt ~g ~label ~key message is OAEP-padded and encrypted
message, using the optional label.Insufficient_key (see Insufficient_key)val decrypt : ?mask:Nocrypto.Rsa.mask ->
?label:Cstruct.t -> key:Nocrypto.Rsa.priv -> Cstruct.t -> Cstruct.t optiondecrypt ~mask ~label ~key ciphertext is Some message if the
ciphertext was produced by the corresponding encrypt
operation, or None otherwise.