Hash
include/drip/hash.h
Structures and Types
| Type | Name |
|---|---|
| typedef int(* | drip_hash_cb_t Callback function type for producing hashes. |
| typedef uint8_t | drip_hash_t |
Functions
| Type | Name |
|---|---|
| int | drip_hash (const uint8_t *input, size_t input_length, drip_hash_t *hash, drip_hash_cb_t callback, void *context) |
| int | drip_hash_to_hex (const drip_hash_t *hash, char *hex, size_t hex_size) |
Macros
| Type | Name |
|---|---|
| define | DRIP_HASH_SIZE 8 |
Structures and Types Documentation
typedef drip_hash_cb_t
Callback function type for producing hashes.
typedef int(* drip_hash_cb_t) (void *context, const uint8_t *input, size_t input_length, uint8_t *buffer, size_t buffer_size, size_t *output_length);
Called by drip_hash() to perform the actual hashing of the payload.
Parameters:
contextOpaque context passed to the callback.inputPointer to the payload to hash.input_lengthLength of the payload in bytes.bufferOutput buffer for the hash.buffer_sizeSize of the hash buffer in bytes.output_lengthReceives resulting hash length written.
Return value:
0on success.Non-zeroon hashing failure.
typedef drip_hash_t
typedef uint8_t drip_hash_t[8];
Functions Documentation
function drip_hash
int drip_hash (
const uint8_t *input,
size_t input_length,
drip_hash_t *hash,
drip_hash_cb_t callback,
void *context
)
function drip_hash_to_hex
int drip_hash_to_hex (
const drip_hash_t *hash,
char *hex,
size_t hex_size
)
Macros Documentation
define DRIP_HASH_SIZE
#define DRIP_HASH_SIZE 8