BeRTOS
Functions
hash.h File Reference

Generic interface for hashing algorithms. More...

#include <cfg/compiler.h>
#include <cfg/debug.h>

Go to the source code of this file.

Functions

void hash_begin (Hash *h)
 Initialize a hash computation.
void hash_update (Hash *h, const void *data, size_t len)
 Add some data to the computation.
uint8_t * hash_final (Hash *h)
 Finalize the hash computation and return the digest.
int hash_digest_len (Hash *h)
 Return the digest length in bytes.

Detailed Description

Generic interface for hashing algorithms.

Author:
Giovanni Bajo <rasky@develer.com>

Definition in file hash.h.


Function Documentation

uint8_t* hash_final ( Hash *  h) [inline]

Finalize the hash computation and return the digest.

Note:
This function must be called exactly once per each computation. Calling it twice leads to undefined behaviour.
The pointer returned is within the hash context structure h, so it has the same lifetime as the hash instance. The data will be invalidated as soon as hash_begin is called again on the same instance.

Definition at line 81 of file hash.h.