| 1 |
/* MIT License |
| 2 |
* |
| 3 |
* Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation |
| 4 |
* Copyright (c) 2022-2023 HACL* Contributors |
| 5 |
* |
| 6 |
* Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 |
* of this software and associated documentation files (the "Software"), to deal |
| 8 |
* in the Software without restriction, including without limitation the rights |
| 9 |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 10 |
* copies of the Software, and to permit persons to whom the Software is |
| 11 |
* furnished to do so, subject to the following conditions: |
| 12 |
* |
| 13 |
* The above copyright notice and this permission notice shall be included in all |
| 14 |
* copies or substantial portions of the Software. |
| 15 |
* |
| 16 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 |
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 |
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 |
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 |
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 22 |
* SOFTWARE. |
| 23 |
*/ |
| 24 |
|
| 25 |
|
| 26 |
#ifndef Hacl_Streaming_Types_H |
| 27 |
#define Hacl_Streaming_Types_H |
| 28 |
|
| 29 |
#if defined(__cplusplus) |
| 30 |
extern "C" { |
| 31 |
#endif |
| 32 |
|
| 33 |
#include <string.h> |
| 34 |
#include "krml/internal/types.h" |
| 35 |
#include "krml/lowstar_endianness.h" |
| 36 |
#include "krml/internal/target.h" |
| 37 |
|
| 38 |
#define Spec_Hash_Definitions_SHA2_224 0 |
| 39 |
#define Spec_Hash_Definitions_SHA2_256 1 |
| 40 |
#define Spec_Hash_Definitions_SHA2_384 2 |
| 41 |
#define Spec_Hash_Definitions_SHA2_512 3 |
| 42 |
#define Spec_Hash_Definitions_SHA1 4 |
| 43 |
#define Spec_Hash_Definitions_MD5 5 |
| 44 |
#define Spec_Hash_Definitions_Blake2S 6 |
| 45 |
#define Spec_Hash_Definitions_Blake2B 7 |
| 46 |
#define Spec_Hash_Definitions_SHA3_256 8 |
| 47 |
#define Spec_Hash_Definitions_SHA3_224 9 |
| 48 |
#define Spec_Hash_Definitions_SHA3_384 10 |
| 49 |
#define Spec_Hash_Definitions_SHA3_512 11 |
| 50 |
#define Spec_Hash_Definitions_Shake128 12 |
| 51 |
#define Spec_Hash_Definitions_Shake256 13 |
| 52 |
|
| 53 |
typedef uint8_t Spec_Hash_Definitions_hash_alg; |
| 54 |
|
| 55 |
#define Hacl_Streaming_Types_Success 0 |
| 56 |
#define Hacl_Streaming_Types_InvalidAlgorithm 1 |
| 57 |
#define Hacl_Streaming_Types_InvalidLength 2 |
| 58 |
#define Hacl_Streaming_Types_MaximumLengthExceeded 3 |
| 59 |
#define Hacl_Streaming_Types_OutOfMemory 4 |
| 60 |
|
| 61 |
typedef uint8_t Hacl_Streaming_Types_error_code; |
| 62 |
|
| 63 |
typedef struct Hacl_Streaming_MD_state_32_s Hacl_Streaming_MD_state_32; |
| 64 |
|
| 65 |
typedef struct Hacl_Streaming_MD_state_64_s Hacl_Streaming_MD_state_64; |
| 66 |
|
| 67 |
#if defined(__cplusplus) |
| 68 |
} |
| 69 |
#endif |
| 70 |
|
| 71 |
#define Hacl_Streaming_Types_H_DEFINED |
| 72 |
#endif /* Hacl_Streaming_Types_H */ |