EDGESEC  0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
Functions
hash.c File Reference

File containing the implementation of the hash functions. More...

#include "hash.h"
#include <string.h>
Include dependency graph for hash.c:

Functions

uint32_t md_hash (const char *msg, size_t length)
 Computes the Merkle–Damgård construction hash for a message. More...
 
uint32_t sdbm_hash (const uint8_t *msg, size_t length)
 Computes the sdbm (a public-domain reimplementation of ndbm) http://www.cse.yorku.ca/~oz/hash.html. More...
 

Detailed Description

File containing the implementation of the hash functions.

Author
Alexandru Mereacre
Date
2021

Function Documentation

◆ md_hash()

uint32_t md_hash ( const char *  msg,
size_t  length 
)

Computes the Merkle–Damgård construction hash for a message.

Parameters
msgThe message pointer
lengthThe message length
Returns
uint32_t The hash value

◆ sdbm_hash()

uint32_t sdbm_hash ( const uint8_t *  msg,
size_t  length 
)

Computes the sdbm (a public-domain reimplementation of ndbm) http://www.cse.yorku.ca/~oz/hash.html.

Parameters
msgThe message pointer
lengthThe message length
Returns
uint32_t The hash value