Module Nocrypto.Rsa.PKCS1

module PKCS1: sig .. end
PKCS v1.5-padded operations, as defined by PKCS #1 v1.5.

Keys must have a minimum of 11 + len(message) bytes.


val sig_encode : ?mask:Nocrypto.Rsa.mask -> key:Nocrypto.Rsa.priv -> Cstruct.t -> Cstruct.t
sig_encode mask key message is the PKCS1-padded (type 1) message signed by the key. Note that this operation performs only the padding and RSA transformation steps of the PKCS 1.5 signature.
Raises Insufficient_key (see Insufficient_key)
val sig_decode : key:Nocrypto.Rsa.pub -> Cstruct.t -> Cstruct.t option
sig_decode key signature is either Some message if the signature was produced with the given key as per sign, or None
val encrypt : ?g:Nocrypto.Rng.g -> key:Nocrypto.Rsa.pub -> Cstruct.t -> Cstruct.t
encrypt g key message is a PKCS1-padded (type 2) and encrypted message.
Raises Insufficient_key (see Insufficient_key)
val decrypt : ?mask:Nocrypto.Rsa.mask ->
key:Nocrypto.Rsa.priv -> Cstruct.t -> Cstruct.t option
decrypt mask key ciphertext is Some message if the ciphertext was produced by the corresponding encrypt operation, or None otherwise.