Botan 3.6.1
Crypto and TLS for C&
|
#include <botan/ffi.h>
#include <botan/hash.h>
#include <botan/internal/ffi_util.h>
Go to the source code of this file.
Functions | |
BOTAN_FFI_DECLARE_STRUCT (botan_hash_struct, Botan::HashFunction, 0x1F0A4F84) | |
int | botan_hash_block_size (botan_hash_t hash, size_t *out) |
int | botan_hash_clear (botan_hash_t hash) |
int | botan_hash_copy_state (botan_hash_t *dest, const botan_hash_t source) |
int | botan_hash_destroy (botan_hash_t hash) |
int | botan_hash_final (botan_hash_t hash, uint8_t out[]) |
int | botan_hash_init (botan_hash_t *hash, const char *hash_name, uint32_t flags) |
int | botan_hash_name (botan_hash_t hash, char *name, size_t *name_len) |
int | botan_hash_output_length (botan_hash_t hash, size_t *out) |
int | botan_hash_update (botan_hash_t hash, const uint8_t *buf, size_t len) |
BOTAN_FFI_DECLARE_STRUCT | ( | botan_hash_struct | , |
Botan::HashFunction | , | ||
0x1F0A4F84 | ) |
int botan_hash_block_size | ( | botan_hash_t | hash, |
size_t * | block_size ) |
Writes the block size of the hash function to *block_size
hash | hash object |
block_size | output buffer to hold the hash function output length |
Definition at line 48 of file ffi_hash.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
int botan_hash_clear | ( | botan_hash_t | hash | ) |
Reinitializes the state of the hash computation. A hash can be computed (with update/final) immediately.
hash | hash object |
Definition at line 55 of file ffi_hash.cpp.
References BOTAN_FFI_VISIT.
int botan_hash_copy_state | ( | botan_hash_t * | dest, |
botan_hash_t | source ) |
Copy the state of a hash function object
dest | destination hash object |
source | source hash object |
Definition at line 78 of file ffi_hash.cpp.
References BOTAN_FFI_VISIT.
int botan_hash_destroy | ( | botan_hash_t | hash | ) |
Frees all resources of the hash object
hash | hash object |
Definition at line 37 of file ffi_hash.cpp.
References BOTAN_FFI_CHECKED_DELETE.
int botan_hash_final | ( | botan_hash_t | hash, |
uint8_t | out[] ) |
Finalizes the hash computation and writes the output to out[0:botan_hash_output_length()] then reinitializes for computing another digest as if botan_hash_clear had been called.
hash | hash object |
out | output buffer |
Definition at line 71 of file ffi_hash.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
int botan_hash_init | ( | botan_hash_t * | hash, |
const char * | hash_name, | ||
uint32_t | flags ) |
Initialize a hash function object
hash | hash object |
hash_name | name of the hash function, e.g., "SHA-384" |
flags | should be 0 in current API revision, all other uses are reserved and return BOTAN_FFI_ERROR_BAD_FLAG |
Definition at line 18 of file ffi_hash.cpp.
References BOTAN_FFI_ERROR_BAD_FLAG, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, Botan::HashFunction::create(), and Botan_FFI::ffi_guard_thunk().
int botan_hash_name | ( | botan_hash_t | hash, |
char * | name, | ||
size_t * | name_len ) |
Get the name of this hash function
hash | the object to read |
name | output buffer |
name_len | on input, the length of buffer, on success the number of bytes written |
Definition at line 82 of file ffi_hash.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, name, and Botan_FFI::write_str_output().
int botan_hash_output_length | ( | botan_hash_t | hash, |
size_t * | output_length ) |
Writes the output length of the hash function to *output_length
hash | hash object |
output_length | output buffer to hold the hash function output length |
Definition at line 41 of file ffi_hash.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.
int botan_hash_update | ( | botan_hash_t | hash, |
const uint8_t * | in, | ||
size_t | in_len ) |
Send more input to the hash function
hash | hash object |
in | input buffer |
in_len | number of bytes to read from the input buffer |
Definition at line 59 of file ffi_hash.cpp.
References BOTAN_FFI_ERROR_NULL_POINTER, and BOTAN_FFI_VISIT.