add if statement and declaration
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
#include <fcntl.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include "siphash/siphash.h"
|
||||
#include "hash_data.h"
|
||||
|
||||
uint8_t siphash_key[16];
|
||||
const uint8_t siphash_key_fixed_for_translator[16] = {218, 19, 245, 136, 128, 160, 122, 81, 249, 147, 111, 230, 174, 145, 125 ,218};
|
||||
uint8_t empty_siphash_key[16];
|
||||
|
||||
void generate_siphash_key(uint8_t hash_key[16]) {
|
||||
@@ -15,7 +17,7 @@ void generate_siphash_key(uint8_t hash_key[16]) {
|
||||
close(fd);
|
||||
}
|
||||
|
||||
uint64_t siphash64_bytes(const void *data, size_t len,uint8_t hash_key[16]) {
|
||||
uint64_t siphash64_bytes(const void *data, size_t len,const uint8_t hash_key[16]) {
|
||||
uint8_t out[8];
|
||||
if (siphash(data, len, hash_key, out, sizeof(out)) != 0)
|
||||
return 0;
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
#include <stdint.h>
|
||||
|
||||
extern uint8_t siphash_key[16];
|
||||
extern const uint8_t siphash_key_fixed_for_translator[16];
|
||||
extern uint8_t empty_siphash_key[16];
|
||||
|
||||
void generate_siphash_key(uint8_t siphash_key[16]);
|
||||
uint64_t siphash64_bytes(const void *data, size_t len,uint8_t siphash_key[16]);
|
||||
uint64_t siphash64_bytes(const void *data, size_t len,const uint8_t hash_key[16]);
|
||||
#endif //HASH_DATA_H
|
||||
Reference in New Issue
Block a user