Cryptographic hash functions.
More...
|
VTM_API int | vtm_crypto_sha1 (const void *in, size_t len, void *buf, size_t buf_len) |
|
#define VTM_CRYPTO_SHA1_LEN 20 |
length of SHA1 hash in bytes
VTM_API int vtm_crypto_sha1 |
( |
const void * |
in, |
|
|
size_t |
len, |
|
|
void * |
buf, |
|
|
size_t |
buf_len |
|
) |
| |
Builts the SHA1 hash over a given memory region.
- Parameters
-
in | pointer to start of memory region |
len | the size of the memory region |
buf | pointer to buffer where hash will be written to |
buf_len | size of supplied buffer |
- Returns
- VTM_OK if the hash was calculated successfully
-
VTM_E_INVALID_ARG if one of the arguments was not valid, for example if a too small buffer was supplied
-
VTM_ERROR if the hash could not be calculated