Macros | Functions
hash.h File Reference

Cryptographic hash functions. More...

Macros

#define VTM_CRYPTO_SHA1_LEN   20
 

Functions

VTM_API int vtm_crypto_sha1 (const void *in, size_t len, void *buf, size_t buf_len)
 

Macro Definition Documentation

#define VTM_CRYPTO_SHA1_LEN   20

length of SHA1 hash in bytes

Function Documentation

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
inpointer to start of memory region
lenthe size of the memory region
bufpointer to buffer where hash will be written to
buf_lensize 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