|
9 | 9 |
|
10 | 10 | #include "hacl_lib.h" |
11 | 11 |
|
| 12 | +#define Spec_Hash_Definitions_SHA3_256 8 |
| 13 | +#define Spec_Hash_Definitions_SHA3_224 9 |
| 14 | +#define Spec_Hash_Definitions_SHA3_384 10 |
| 15 | +#define Spec_Hash_Definitions_SHA3_512 11 |
| 16 | +#define Spec_Hash_Definitions_Shake128 12 |
| 17 | +#define Spec_Hash_Definitions_Shake256 13 |
| 18 | + |
| 19 | +typedef uint8_t Spec_Hash_Definitions_hash_alg; |
| 20 | + |
12 | 21 | #define Hacl_Streaming_Types_Success 0 |
13 | 22 | #define Hacl_Streaming_Types_InvalidAlgorithm 1 |
14 | 23 | #define Hacl_Streaming_Types_InvalidLength 2 |
@@ -222,4 +231,37 @@ void Hacl_Streaming_SHA2_finish_384(struct Hacl_Streaming_MD_state_64_s *p, |
222 | 231 | void Hacl_Streaming_SHA2_hash_384(uint8_t *input, uint32_t input_len, |
223 | 232 | uint8_t *dst); |
224 | 233 |
|
| 234 | +struct Hacl_Streaming_Keccak_hash_buf_s { |
| 235 | + Spec_Hash_Definitions_hash_alg fst; |
| 236 | + uint64_t *snd; |
| 237 | +}; |
| 238 | + |
| 239 | +struct Hacl_Streaming_Keccak_state_s { |
| 240 | + struct Hacl_Streaming_Keccak_hash_buf_s block_state; |
| 241 | + uint8_t *buf; |
| 242 | + uint64_t total_len; |
| 243 | +}; |
| 244 | + |
| 245 | +Hacl_Streaming_Types_error_code |
| 246 | +Hacl_Streaming_Keccak_update(struct Hacl_Streaming_Keccak_state_s *p, |
| 247 | + uint8_t *data, uint32_t len); |
| 248 | + |
| 249 | +Hacl_Streaming_Types_error_code |
| 250 | +Hacl_Streaming_Keccak_finish(struct Hacl_Streaming_Keccak_state_s *p, |
| 251 | + uint8_t *out); |
| 252 | + |
| 253 | +void Hacl_SHA3_shake128_hacl(uint32_t inputByteLen, uint8_t *input, |
| 254 | + uint32_t outputByteLen, uint8_t *output); |
| 255 | + |
| 256 | +void Hacl_SHA3_shake256_hacl(uint32_t inputByteLen, uint8_t *input, |
| 257 | + uint32_t outputByteLen, uint8_t *output); |
| 258 | + |
| 259 | +void Hacl_SHA3_sha3_224(uint32_t inputByteLen, uint8_t *input, uint8_t *output); |
| 260 | + |
| 261 | +void Hacl_SHA3_sha3_256(uint32_t inputByteLen, uint8_t *input, uint8_t *output); |
| 262 | + |
| 263 | +void Hacl_SHA3_sha3_384(uint32_t inputByteLen, uint8_t *input, uint8_t *output); |
| 264 | + |
| 265 | +void Hacl_SHA3_sha3_512(uint32_t inputByteLen, uint8_t *input, uint8_t *output); |
| 266 | + |
225 | 267 | #endif // CRYPTO_HACL_HASH_H_ |
0 commit comments