Crate olm_sys[][src]

Structs

OlmAccount
OlmInboundGroupSession
OlmOutboundGroupSession
OlmSession
OlmUtility
max_align_t

Constants

INT16_MAX
INT16_MIN
INT32_MAX
INT32_MIN
INT8_MAX
INT8_MIN
INTPTR_MAX
INTPTR_MIN
INT_FAST16_MAX
INT_FAST16_MIN
INT_FAST32_MAX
INT_FAST32_MIN
INT_FAST8_MAX
INT_FAST8_MIN
INT_LEAST16_MAX
INT_LEAST16_MIN
INT_LEAST32_MAX
INT_LEAST32_MIN
INT_LEAST8_MAX
INT_LEAST8_MIN
OLM_MESSAGE_TYPE_MESSAGE
OLM_MESSAGE_TYPE_PRE_KEY
PTRDIFF_MAX
PTRDIFF_MIN
SIG_ATOMIC_MAX
SIG_ATOMIC_MIN
SIZE_MAX
UINT16_MAX
UINT32_MAX
UINT8_MAX
UINTPTR_MAX
UINT_FAST16_MAX
UINT_FAST32_MAX
UINT_FAST8_MAX
UINT_LEAST16_MAX
UINT_LEAST32_MAX
UINT_LEAST8_MAX
WINT_MAX
WINT_MIN
_ATFILE_SOURCE
_BITS_WCHAR_H
_DEFAULT_SOURCE
_FEATURES_H
_POSIX_C_SOURCE
_POSIX_SOURCE
_STDC_PREDEF_H
_STDINT_H
_SYS_CDEFS_H
__GLIBC_MINOR__
__GLIBC__
__GNU_LIBRARY__
__STDC_IEC_559_COMPLEX__
__STDC_IEC_559__
__STDC_ISO_10646__
__STDC_NO_THREADS__
__SYSCALL_WORDSIZE
__USE_ATFILE
__USE_FORTIFY_LEVEL
__USE_ISOC11
__USE_ISOC95
__USE_ISOC99
__USE_MISC
__USE_POSIX
__USE_POSIX2
__USE_POSIX199309
__USE_POSIX199506
__USE_POSIX_IMPLICITLY
__USE_XOPEN2K
__USE_XOPEN2K8
__WORDSIZE
__WORDSIZE_TIME64_COMPAT32

Functions

olm_account

Initialise an account object using the supplied memory The supplied memory must be at least olm_account_size() bytes

olm_account_generate_one_time_keys

Generates a number of new one time keys. If the total number of keys stored by this account exceeds max_number_of_one_time_keys() then the old keys are discarded. Returns olm_error() on error. If the number of random bytes is too small then olm_account_last_error() will be "NOT_ENOUGH_RANDOM".

olm_account_generate_one_time_keys_random_length

The number of random bytes needed to generate a given number of new one time keys.

olm_account_identity_keys

Writes the public parts of the identity keys for the account into the identity_keys output buffer. Returns olm_error() on failure. If the identity_keys buffer was too small then olm_account_last_error() will be "OUTPUT_BUFFER_TOO_SMALL".

olm_account_identity_keys_length

The size of the output buffer needed to hold the identity keys

olm_account_last_error

A null terminated string describing the most recent error to happen to an account

olm_account_mark_keys_as_published

Marks the current set of one time keys as being published.

olm_account_max_number_of_one_time_keys

The largest number of one time keys this account can store.

olm_account_one_time_keys

Writes the public parts of the unpublished one time keys for the account into the one_time_keys output buffer.

olm_account_one_time_keys_length

The size of the output buffer needed to hold the one time keys

olm_account_sign

Signs a message with the ed25519 key for this account. Returns olm_error() on failure. If the signature buffer was too small then olm_account_last_error() will be "OUTPUT_BUFFER_TOO_SMALL"

olm_account_signature_length

The length of an ed25519 signature encoded as base64.

olm_account_size

The size of an account object in bytes

olm_clear_account

Clears the memory used to back this account

olm_clear_inbound_group_session

Clears the memory used to back this group session

olm_clear_outbound_group_session

Clears the memory used to back this group session

olm_clear_session

Clears the memory used to back this session

olm_clear_utility

Clears the memory used to back this utility

olm_create_account

Creates a new account. Returns olm_error() on failure. If there weren't enough random bytes then olm_account_last_error() will be "NOT_ENOUGH_RANDOM"

olm_create_account_random_length

The number of random bytes needed to create an account.

olm_create_inbound_session

Create a new in-bound session for sending/receiving messages from an incoming PRE_KEY message. Returns olm_error() on failure. If the base64 couldn't be decoded then olm_session_last_error will be "INVALID_BASE64". If the message was for an unsupported protocol version then olm_session_last_error() will be "BAD_MESSAGE_VERSION". If the message couldn't be decoded then then olm_session_last_error() will be "BAD_MESSAGE_FORMAT". If the message refers to an unknown one time key then olm_session_last_error() will be "BAD_MESSAGE_KEY_ID".

olm_create_inbound_session_from

Create a new in-bound session for sending/receiving messages from an incoming PRE_KEY message. Returns olm_error() on failure. If the base64 couldn't be decoded then olm_session_last_error will be "INVALID_BASE64". If the message was for an unsupported protocol version then olm_session_last_error() will be "BAD_MESSAGE_VERSION". If the message couldn't be decoded then then olm_session_last_error() will be "BAD_MESSAGE_FORMAT". If the message refers to an unknown one time key then olm_session_last_error() will be "BAD_MESSAGE_KEY_ID".

olm_create_outbound_session

Creates a new out-bound session for sending messages to a given identity_key and one_time_key. Returns olm_error() on failure. If the keys couldn't be decoded as base64 then olm_session_last_error() will be "INVALID_BASE64" If there weren't enough random bytes then olm_session_last_error() will be "NOT_ENOUGH_RANDOM".

olm_create_outbound_session_random_length

The number of random bytes needed to create an outbound session

olm_decrypt

Decrypts a message using the session. The input message buffer is destroyed. Returns the length of the plain-text on success. Returns olm_error() on failure. If the plain-text buffer is smaller than olm_decrypt_max_plaintext_length() then olm_session_last_error() will be "OUTPUT_BUFFER_TOO_SMALL". If the base64 couldn't be decoded then olm_session_last_error() will be "INVALID_BASE64". If the message is for an unsupported version of the protocol then olm_session_last_error() will be "BAD_MESSAGE_VERSION". If the message couldn't be decoded then olm_session_last_error() will be BAD_MESSAGE_FORMAT". If the MAC on the message was invalid then olm_session_last_error() will be "BAD_MESSAGE_MAC".

olm_decrypt_max_plaintext_length

The maximum number of bytes of plain-text a given message could decode to. The actual size could be different due to padding. The input message buffer is destroyed. Returns olm_error() on failure. If the message base64 couldn't be decoded then olm_session_last_error() will be "INVALID_BASE64". If the message is for an unsupported version of the protocol then olm_session_last_error() will be "BAD_MESSAGE_VERSION". If the message couldn't be decoded then olm_session_last_error() will be "BAD_MESSAGE_FORMAT".

olm_ed25519_verify

Verify an ed25519 signature. If the key was too small then olm_session_last_error will be "INVALID_BASE64". If the signature was invalid then olm_utility_last_error() will be "BAD_MESSAGE_MAC".

olm_encrypt

Encrypts a message using the session. Returns the length of the message in bytes on success. Writes the message as base64 into the message buffer. Returns olm_error() on failure. If the message buffer is too small then olm_session_last_error() will be "OUTPUT_BUFFER_TOO_SMALL". If there weren't enough random bytes then olm_session_last_error() will be "NOT_ENOUGH_RANDOM".

olm_encrypt_message_length

The size of the next message in bytes for the given number of plain-text bytes.

olm_encrypt_message_type

The type of the next message that olm_encrypt() will return. Returns OLM_MESSAGE_TYPE_PRE_KEY if the message will be a PRE_KEY message. Returns OLM_MESSAGE_TYPE_MESSAGE if the message will be a normal message. Returns olm_error on failure.

olm_encrypt_random_length

The number of random bytes needed to encrypt the next message.

olm_error

The value that olm will return from a function if there was an error

olm_export_inbound_group_session

Export the base64-encoded ratchet key for this session, at the given index, in a format which can be used by olm_import_inbound_group_session

olm_export_inbound_group_session_length

Get the number of bytes returned by olm_export_inbound_group_session()

olm_get_library_version

Get the version number of the library. Arguments will be updated if non-null.

olm_group_decrypt

Decrypt a message.

olm_group_decrypt_max_plaintext_length

Get an upper bound on the number of bytes of plain-text the decrypt method will write for a given input message length. The actual size could be different due to padding.

olm_group_encrypt

Encrypt some plain-text. Returns the length of the encrypted message or olm_error() on failure. On failure last_error will be set with an error code. The last_error will be OUTPUT_BUFFER_TOO_SMALL if the output buffer is too small.

olm_group_encrypt_message_length

The number of bytes that will be created by encrypting a message

olm_import_inbound_group_session

Import an inbound group session, from a previous export.

olm_inbound_group_session

Initialise an inbound group session object using the supplied memory The supplied memory should be at least olm_inbound_group_session_size() bytes.

olm_inbound_group_session_first_known_index

Get the first message index we know how to decrypt.

olm_inbound_group_session_id

Get a base64-encoded identifier for this session.

olm_inbound_group_session_id_length

Get the number of bytes returned by olm_inbound_group_session_id()

olm_inbound_group_session_is_verified

Check if the session has been verified as a valid session.

olm_inbound_group_session_last_error

A null terminated string describing the most recent error to happen to a group session

olm_inbound_group_session_size

get the size of an inbound group session, in bytes.

olm_init_inbound_group_session

Start a new inbound group session, from a key exported from olm_outbound_group_session_key

olm_init_outbound_group_session

Start a new outbound group session. Returns olm_error() on failure. On failure last_error will be set with an error code. The last_error will be NOT_ENOUGH_RANDOM if the number of random bytes was too small.

olm_init_outbound_group_session_random_length

The number of random bytes needed to create an outbound group session

olm_matches_inbound_session

Checks if the PRE_KEY message is for this in-bound session. This can happen if multiple messages are sent to this account before this account sends a message in reply. Returns 1 if the session matches. Returns 0 if the session does not match. Returns olm_error() on failure. If the base64 couldn't be decoded then olm_session_last_error will be "INVALID_BASE64". If the message was for an unsupported protocol version then olm_session_last_error() will be "BAD_MESSAGE_VERSION". If the message couldn't be decoded then then olm_session_last_error() will be "BAD_MESSAGE_FORMAT".

olm_matches_inbound_session_from

Checks if the PRE_KEY message is for this in-bound session. This can happen if multiple messages are sent to this account before this account sends a message in reply. Returns 1 if the session matches. Returns 0 if the session does not match. Returns olm_error() on failure. If the base64 couldn't be decoded then olm_session_last_error will be "INVALID_BASE64". If the message was for an unsupported protocol version then olm_session_last_error() will be "BAD_MESSAGE_VERSION". If the message couldn't be decoded then then olm_session_last_error() will be "BAD_MESSAGE_FORMAT".

olm_outbound_group_session

Initialise an outbound group session object using the supplied memory The supplied memory should be at least olm_outbound_group_session_size() bytes.

olm_outbound_group_session_id

Get a base64-encoded identifier for this session.

olm_outbound_group_session_id_length

Get the number of bytes returned by olm_outbound_group_session_id()

olm_outbound_group_session_key

Get the base64-encoded current ratchet key for this session.

olm_outbound_group_session_key_length

Get the number of bytes returned by olm_outbound_group_session_key()

olm_outbound_group_session_last_error

A null terminated string describing the most recent error to happen to a group session

olm_outbound_group_session_message_index

Get the current message index for this session.

olm_outbound_group_session_size

get the size of an outbound group session, in bytes.

olm_pickle_account

Stores an account as a base64 string. Encrypts the account using the supplied key. Returns the length of the pickled account on success. Returns olm_error() on failure. If the pickle output buffer is smaller than olm_pickle_account_length() then olm_account_last_error() will be "OUTPUT_BUFFER_TOO_SMALL"

olm_pickle_account_length

Returns the number of bytes needed to store an account

olm_pickle_inbound_group_session

Stores a group session as a base64 string. Encrypts the session using the supplied key. Returns the length of the session on success.

olm_pickle_inbound_group_session_length

Returns the number of bytes needed to store an inbound group session

olm_pickle_outbound_group_session

Stores a group session as a base64 string. Encrypts the session using the supplied key. Returns the length of the session on success.

olm_pickle_outbound_group_session_length

Returns the number of bytes needed to store an outbound group session

olm_pickle_session

Stores a session as a base64 string. Encrypts the session using the supplied key. Returns the length of the pickled session on success. Returns olm_error() on failure. If the pickle output buffer is smaller than olm_pickle_session_length() then olm_session_last_error() will be "OUTPUT_BUFFER_TOO_SMALL"

olm_pickle_session_length

Returns the number of bytes needed to store a session

olm_remove_one_time_keys

Removes the one time keys that the session used from the account. Returns olm_error() on failure. If the account doesn't have any matching one time keys then olm_account_last_error() will be "BAD_MESSAGE_KEY_ID".

olm_session

Initialise a session object using the supplied memory The supplied memory must be at least olm_session_size() bytes

olm_session_has_received_message
olm_session_id

An identifier for this session. Will be the same for both ends of the conversation. If the id buffer is too small then olm_session_last_error() will be "OUTPUT_BUFFER_TOO_SMALL".

olm_session_id_length

The length of the buffer needed to return the id for this session.

olm_session_last_error

A null terminated string describing the most recent error to happen to a session

olm_session_size

The size of a session object in bytes

olm_sha256

Calculates the SHA-256 hash of the input and encodes it as base64. If the output buffer is smaller than olm_sha256_length() then olm_utility_last_error() will be "OUTPUT_BUFFER_TOO_SMALL".

olm_sha256_length

The length of the buffer needed to hold the SHA-256 hash.

olm_unpickle_account

Loads an account from a pickled base64 string. Decrypts the account using the supplied key. Returns olm_error() on failure. If the key doesn't match the one used to encrypt the account then olm_account_last_error() will be "BAD_ACCOUNT_KEY". If the base64 couldn't be decoded then olm_account_last_error() will be "INVALID_BASE64". The input pickled buffer is destroyed

olm_unpickle_inbound_group_session

Loads a group session from a pickled base64 string. Decrypts the session using the supplied key.

olm_unpickle_outbound_group_session

Loads a group session from a pickled base64 string. Decrypts the session using the supplied key.

olm_unpickle_session

Loads a session from a pickled base64 string. Decrypts the session using the supplied key. Returns olm_error() on failure. If the key doesn't match the one used to encrypt the account then olm_session_last_error() will be "BAD_ACCOUNT_KEY". If the base64 couldn't be decoded then olm_session_last_error() will be "INVALID_BASE64". The input pickled buffer is destroyed

olm_utility

Initialise a utility object using the supplied memory The supplied memory must be at least olm_utility_size() bytes

olm_utility_last_error

A null terminated string describing the most recent error to happen to a utility

olm_utility_size

The size of a utility object in bytes

Type Definitions

int_fast16_t
int_fast32_t
int_fast64_t
int_fast8_t
int_least16_t
int_least32_t
int_least64_t
int_least8_t
intmax_t
uint_fast16_t
uint_fast32_t
uint_fast64_t
uint_fast8_t
uint_least16_t
uint_least32_t
uint_least64_t
uint_least8_t
uintmax_t
wchar_t