Module Olm.Sas
type t={buf : char Ctypes.ptr;sas : C.Types.SAS.t Ctypes_static.ptr;}
val clear : C.Types.SAS.t Ctypes_static.ptr -> (int, [> `OlmError ]) Core.resultclear sasClear memory backing the given
saspointer.
val check_error : t -> Unsigned.size_t -> (int, [> OlmError.t ]) Core.resultcheck_error t retCheck whether return code
retis equal to `olm_error()` ( -1 ), returning the return value as an int if not, and the `last_error` from the sastif so.
val set_their_pubkey : t -> string -> (int, [> OlmError.t ]) Core.resultset_their_pubkey t keySet the public
keyof the other user in the SAS objectt. It needs to be set before bytes can be generated for the authentication string and a MAC can be calculated.
val alloc : unit -> talloc ()Allocate an
C.Types.SAS.tand return the pointers in at.
val create : ?other_users_pubkey:string -> unit -> (t, [> OlmError.t ]) Core.resultcreate ?other_users_pubkey ()Create a new SAS object with
alloc (), additionally setting the other users public key if provided.
val pubkey : t -> (string, [> OlmError.t ]) Core.resultpubkey tGet the public key of the SAS object
tthat can then be shared with another user to perform the authentication process.
val other_key_set : t -> boolother_key_set tCheck if the other user's pubkey has been set.
val generate_bytes : t -> string -> int -> (string, [> OlmError.t | `ValueError of string ]) Core.resultgenerate_bytes t extra_info lengthGenerate bytes to use for the short authentication string with SAS object
t. Suppliedextra_infois mixed in when generating the number of bytes indicated bylength.
val calculate_mac : t -> string -> string -> (string, [> OlmError.t ]) Core.resultcalculate_mac t msg extra_infoGenerate a message authentication code (MAC) based on the shared secret held in the SAS object
t, formsg.extra_infois mixed in with when generating the MAC.
val calculate_mac_long_kdf : t -> string -> string -> (string, [> OlmError.t ]) Core.resultcalculate_mac_long_kdf t msg extra_infoFor compatibility with an old version of Riot. Should not be used unless compatibility with an older non-tagged Olm version is required.