23 lines
628 B
C
23 lines
628 B
C
|
#ifndef HASH_H
|
||
|
#define HASH_H
|
||
|
|
||
|
#include <openssl/sha.h>
|
||
|
#include "node.h"
|
||
|
#include "tlv.h"
|
||
|
|
||
|
// Hash a single data
|
||
|
void hash_data(pub_data *data, unsigned char *buf);
|
||
|
|
||
|
// Hash every data contained in data_list then return a network hash
|
||
|
void hash_network(list *data_list, unsigned char *buf);
|
||
|
|
||
|
// Truncate 32 octet hash to 16 octets
|
||
|
void hash_trunc(unsigned char *hash256bit, unsigned char *buf);
|
||
|
|
||
|
// Concat all fields of data and put them in buf
|
||
|
void concat_data(pub_data *data, unsigned char *buf);
|
||
|
|
||
|
// Concat hash2 to hash1 (hash1 is modified)
|
||
|
void concat_hash(unsigned char *hash1, unsigned char *hash2, size_t size);
|
||
|
|
||
|
#endif
|