Soletta™ Framework
|
The message digest configuration to use when creating a new handle. More...
#include <sol-message-digest.h>
Data Fields | |
const char * | algorithm |
Algorithm name. More... | |
uint16_t | api_version |
api_version must match SOL_MESSAGE_DIGEST_CONFIG_API_VERSION at runtime. More... | |
const void * | data |
The context data to give to all callbacks. More... | |
size_t | feed_size |
The feed buffer max size. More... | |
struct sol_str_slice | key |
If provided (length > 0), then is used by the message digest hash function. More... | |
void(* | on_digest_ready )(void *data, struct sol_message_digest *handle, struct sol_blob *output) |
The mandatory callback function to report digest is ready. More... | |
void(* | on_feed_done )(void *data, struct sol_message_digest *handle, struct sol_blob *input, int status) |
The optional callback function to report digest consumed given data. More... | |
The message digest configuration to use when creating a new handle.
const char* sol_message_digest_config::algorithm |
Algorithm name.
The name should match Linux kernel's names, such as:
This pointer must NOT be NULL
.
uint16_t sol_message_digest_config::api_version |
api_version must match SOL_MESSAGE_DIGEST_CONFIG_API_VERSION at runtime.
Referenced by entry_new(), and startup().
const void* sol_message_digest_config::data |
The context data to give to all callbacks.
Referenced by entry_new(), and startup().
size_t sol_message_digest_config::feed_size |
The feed buffer max size.
The value 0
means unlimited data. Since sol_message_digest_feed() works with blobs, no extra buffers will be allocated in order to store feed_size
bytes. All the blobs that are schedule to be written will be referenced and the sum of all queued blobs must not be equal or exceed feed_size
. If it happens sol_message_digest_feed() will return -ENOSPC
and one must start to control the writing flow until on_feed_done
is called.
struct sol_str_slice sol_message_digest_config::key |
If provided (length > 0), then is used by the message digest hash function.
A slice is used so the key may contain null-bytes inside, the whole slice length will be used.
Referenced by startup().
void(* sol_message_digest_config::on_digest_ready)(void *data, struct sol_message_digest *handle, struct sol_blob *output) |
The mandatory callback function to report digest is ready.
This pointer must NOT be NULL
.
The parameters are:
data
the context data given with this configuration. handle
the handle used to push data. output
the resulting digest (hash). It is binary and can be encoded with tools such as sol_buffer_append_as_base16(). The blob is valid while the callback happens, if one wants it to live further increase its reference with sol_blob_ref().void(* sol_message_digest_config::on_feed_done)(void *data, struct sol_message_digest *handle, struct sol_blob *input, int status) |
The optional callback function to report digest consumed given data.
This pointer may be NULL
.
This function may be used to report progress of the whole process or to control a possibly lengthy and costly feed pipeline, this way the pipeline will only feed data once its needed.
The parameters are:
data
the context data given with this configuration. handle
the handle used to push data. input
the input data originally pushed/fed. There is no need to sol_blob_unref() it is done automatically. status
0 on success -errno on error.