Bytesrw_cryptoCryptographic primitives and streams (via conf-mbedtls)
Note. The initialisation code of this module calls Psa.crypto_init and raises a Panic exception if a problem occurs. Your program cannot catch this raise but it should probably not run when that happens.
Primitive availability. The available cryptographic primitives are provided by a PSA Crypto API implementation. Not all algorithms mentioned in the specification are necessarily available. For now this binds the TF-PSA-Crypto implementation of Mbed TLS. However the binding code should be usable with any implementation of the API.
Except for the low-level Psa module, any function from this module may raise this exception. It is not meant to be handled, let it flow at the toplevel to print it and abort your program or server request. Panics occur for two reasons:
Psa.Error.bad_state in the low-level Psa implementation. For example using Hash.value twice on a state. These errors are the moral equivalent of raising Invalid_argument but not converted as such because Psa.Error.bad_state is not one-to-one with such conditions.The type for crypto streams errors.
Readers and writers using cryptographic primitives may raise Bytes.Bytes.Stream.Error with this error.
type bigbytes =
(int, Stdlib.Bigarray.int8_unsigned_elt, Stdlib.Bigarray.c_layout)
Stdlib.Bigarray.Array1.tThe type bigarrays of bytes.
module Bigbytes : sig ... endBigbytes operations.
module Clear : sig ... endZeroing mutable bytes.
module Verify : sig ... endConstant time byte equality checking.
module Hash : sig ... endGeneric and dedicated message digests (hashes).
module Random : sig ... endCryptographically secure pseudorandom byte streams.
This is a low-level interface. If the service can be found in the high-level interface, favour it.
module Psa : sig ... endThin bindings to PSA Crypto API.