Module Olm.Utility
type t
=
{
buf : char Ctypes.ptr;
util : C.Types.Utility.t Ctypes_static.ptr;
}
val clear : C.Types.Utility.t Ctypes_static.ptr -> (int, [> `OlmError ]) Core.result
clear util
Clear memory backing the given
util
pointer.
val check_error : t -> Unsigned.size_t -> (int, [> OlmError.t ]) Core.result
check_error t ret
Check whether return code
ret
is equal to `olm_error()` ( -1 ), returning the return value as an int if not, and the `last_error` from the utility objectt
if so.
val alloc : unit -> t
alloc ()
Allocate an
C.Types.Utility.t
and return the pointers in at
.
val create : unit -> t
create ()
Alias to
alloc ()
, as no additional actions that might cause creation to fail are required after allocation and instantiation.
val ed25519_verify : t -> string -> string -> string -> (int, [> OlmError.t ]) Core.result
ed25519_verify t key message signature
Verify that
key
was used to signmessage
to produce the ed25519signature
with the utilityt
.
val sha256 : t -> string -> (string, [> OlmError.t ]) Core.result
sha256 t input
Use
t
to calculate the SHA-256 hash of theinput
and encodes it as base64.