mirage-crypto-pk

Simple public-key cryptography for the modern age
IN THIS PACKAGE
Module Mirage_crypto_pk . Rsa . PSS

Parameters

Signature

val sign : ?g:Mirage_crypto_rng.g -> ?crt_hardening:bool -> ?mask:mask -> ?slen:int -> key:priv -> Cstruct.t or_digest -> Cstruct.t

sign ~g ~crt_hardening ~mask ~slen ~key message the pPSS-padded digest of message, signed with the key. crt_hardening defaults to false.

slen is the optional seed length and defaults to the size of the underlying hash function.

message is either the actual message, or its digest.

  • raises Insufficient_key

    (see Insufficient_key)

  • raises Invalid_argument

    if message is a `Digest of the wrong size.

val verify : ?slen:int -> key:pub -> signature:Cstruct.t -> Cstruct.t or_digest -> bool

verify ~slen ~key ~signature message checks whether signature is a valid PSS signature of the message under the given key.

message is either the actual message, or its digest.

  • raises Invalid_argument

    if message is a `Digest of the wrong size.