-
Notifications
You must be signed in to change notification settings - Fork 0
/
hash.h
123 lines (105 loc) · 4.16 KB
/
hash.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/*
* The MIT License (MIT)
*
* Copyright (c) 2019 - 2022 TheVice
*
*/
#ifndef _HASH_ALGORITHM_
#define _HASH_ALGORITHM_
#include <stddef.h>
#include <stdint.h>
uint8_t hash_algorithm_bytes_to_string(
const uint8_t* start, const uint8_t* finish, void* output);
uint8_t hash_algorithm_uint32_t_array_to_uint8_t_array(
const uint32_t* start, const uint32_t* finish, uint8_t* output);
uint8_t hash_algorithm_uint32_t_to_uint8_t_array(
uint32_t input, uint8_t* output);
uint8_t hash_algorithm_uint64_t_array_to_uint8_t_array(
const uint64_t* start, const uint64_t* finish, uint8_t* output);
uint8_t hash_algorithm_uint64_t_to_uint8_t_array(
uint64_t input, uint8_t* output);
uint8_t hash_algorithm_uint8_t_array_to_uint32_t(
const uint8_t* start, const uint8_t* finish, uint32_t* output);
uint8_t hash_algorithm_uint8_t_array_to_uint32_t_array(
const uint8_t* input, ptrdiff_t input_size, uint32_t* output);
uint8_t hash_algorithm_uint8_t_array_to_uint64_t(
const uint8_t* start, const uint8_t* finish, uint64_t* output);
uint8_t hash_algorithm_uint8_t_array_to_uint64_t_array(
const uint8_t* input, ptrdiff_t input_size, uint64_t* output);
uint8_t BLAKE2b_init(
uint8_t hash_length, uint64_t* output);
uint8_t BLAKE2b_core(
const uint8_t* start, const uint8_t* finish,
ptrdiff_t* bytes_compressed, uint64_t* output);
uint8_t BLAKE2b_final(
const uint8_t* start, ptrdiff_t* bytes_compressed,
uint8_t bytes_remaining, uint64_t* output);
uint8_t hash_algorithm_blake2b(
const uint8_t* start, const uint8_t* finish,
uint16_t hash_length, void* output);
uint8_t BLAKE3_init(
uint32_t* h, uint8_t h_length,
uint32_t* m, uint8_t m_length,
uint16_t stack_length);
uint8_t BLAKE3_core(
const uint8_t* input, uint64_t length,
uint32_t* m, uint8_t* l, uint32_t* h,
uint8_t* compressed, uint32_t* t,
uint8_t* stack, uint8_t* stack_length, uint8_t d);
uint8_t BLAKE3_final(
const uint8_t* stack, uint8_t stack_length,
uint8_t compressed, uint32_t* t, uint32_t* h, uint32_t* m,
uint8_t l, uint8_t d, uint8_t hash_length, uint8_t* output);
uint8_t hash_algorithm_blake3(
const uint8_t* start, const uint8_t* finish,
uint16_t hash_length, void* output);
uint8_t hash_algorithm_crc32_init(uint8_t* output);
uint8_t hash_algorithm_crc32_core(
const uint8_t* start, const uint8_t* finish, uint8_t* output);
uint8_t hash_algorithm_crc32_final(uint8_t* output, uint8_t order);
uint8_t hash_algorithm_crc32(
const uint8_t* start, const uint8_t* finish,
uint8_t* output, uint8_t order);
uint8_t hash_algorithm_sha3_init(
uint16_t hash_length, uint8_t* rate_on_w, uint8_t* maximum_delta);
uint8_t hash_algorithm_sha3_core(
const uint8_t* start, const uint8_t* finish,
uint8_t* queue, uint8_t* queue_size, uint8_t maximum_delta,
uint64_t* S, uint8_t rate_on_w);
uint8_t hash_algorithm_sha3_final(
uint8_t is_sha3,
uint8_t* queue, uint8_t queue_size, uint8_t maximum_delta,
uint64_t* S, uint8_t rate_on_w, uint8_t d_max,
uint8_t* output);
uint8_t hash_algorithm_keccak(
const uint8_t* start, const uint8_t* finish,
uint16_t hash_length, void* output);
uint8_t hash_algorithm_sha3(
const uint8_t* start, const uint8_t* finish,
uint16_t hash_length, void* output);
uint8_t hash_algorithm_XXH32_core(
const uint8_t* start, const uint8_t* finish,
uint8_t* queue, uint8_t* queue_size, uint8_t max_queue_size,
uint32_t* accumulators,
uint8_t* is_accumulators_initialized,
uint32_t seed);
uint8_t hash_algorithm_XXH32_final(
const uint8_t* queue_start, const uint8_t* queue_finish,
uint32_t* accumulators, uint8_t is_accumulators_initialized,
uint32_t seed, uint32_t* output);
uint8_t hash_algorithm_XXH32(
const uint8_t* start, const uint8_t* finish,
uint32_t seed, uint32_t* output);
uint8_t hash_algorithm_XXH64_core(
const uint8_t* start, const uint8_t* finish,
uint8_t* queue, uint8_t* queue_size, uint8_t max_queue_size,
uint64_t* accumulators, uint8_t* is_accumulators_initialized,
uint64_t seed);
uint8_t hash_algorithm_XXH64_final(
const uint8_t* queue_start, const uint8_t* queue_finish,
uint64_t* accumulators, uint8_t is_accumulators_initialized,
uint64_t seed, uint64_t* output);
uint8_t hash_algorithm_XXH64(
const uint8_t* start, const uint8_t* finish,
uint64_t seed, uint64_t* output);
#endif