Nuitka-winsvc 2.3.3__cp311-cp311-win_amd64.whl → 2.3.11__cp311-cp311-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of Nuitka-winsvc might be problematic. Click here for more details.

Files changed (63) hide show
  1. {Nuitka_winsvc-2.3.3.dist-info → Nuitka_winsvc-2.3.11.dist-info}/METADATA +1 -1
  2. {Nuitka_winsvc-2.3.3.dist-info → Nuitka_winsvc-2.3.11.dist-info}/RECORD +63 -42
  3. {Nuitka_winsvc-2.3.3.dist-info → Nuitka_winsvc-2.3.11.dist-info}/WHEEL +1 -1
  4. nuitka/Options.py +1 -1
  5. nuitka/PythonFlavors.py +15 -0
  6. nuitka/Tracing.py +26 -23
  7. nuitka/Version.py +1 -1
  8. nuitka/build/SconsUtils.py +1 -1
  9. nuitka/build/include/nuitka/compiled_function.h +2 -0
  10. nuitka/build/inline_copy/python_hacl/LICENSE.txt +201 -0
  11. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_MD5.c +1430 -0
  12. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_MD5.h +66 -0
  13. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA1.c +463 -0
  14. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA1.h +66 -0
  15. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA2.c +1273 -0
  16. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA2.h +204 -0
  17. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA3.c +734 -0
  18. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA3.h +131 -0
  19. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Streaming_Types.h +83 -0
  20. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/FStar_UInt128_Verified.h +346 -0
  21. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/FStar_UInt_8_16_32_64.h +107 -0
  22. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/fstar_uint128_struct_endianness.h +68 -0
  23. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/internal/target.h +293 -0
  24. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/lowstar_endianness.h +231 -0
  25. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/types.h +14 -0
  26. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_MD5.h +56 -0
  27. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA1.h +56 -0
  28. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA2.h +164 -0
  29. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA3.h +65 -0
  30. nuitka/build/inline_copy/python_hacl/hacl_312/python_hacl_namespaces.h +89 -0
  31. nuitka/build/static_src/CompiledCodeHelpers.c +2 -0
  32. nuitka/build/static_src/CompiledFrameType.c +2 -5
  33. nuitka/build/static_src/CompiledFunctionType.c +43 -4
  34. nuitka/build/static_src/HelpersAllocator.c +0 -2
  35. nuitka/build/static_src/HelpersBuiltin.c +2 -2
  36. nuitka/build/static_src/HelpersHeapStorage.c +4 -0
  37. nuitka/build/static_src/MainProgram.c +17 -0
  38. nuitka/build/static_src/MetaPathBasedLoader.c +77 -48
  39. nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +29 -0
  40. nuitka/code_generation/templates/CodeTemplatesModules.py +1 -10
  41. nuitka/freezer/DllDependenciesCommon.py +28 -3
  42. nuitka/freezer/DllDependenciesMacOS.py +23 -2
  43. nuitka/freezer/DllDependenciesWin32.py +6 -1
  44. nuitka/importing/Importing.py +5 -1
  45. nuitka/nodes/FunctionNodes.py +4 -1
  46. nuitka/nodes/ModuleNodes.py +3 -4
  47. nuitka/nodes/NodeBases.py +10 -9
  48. nuitka/nodes/shapes/BuiltinTypeShapes.py +21 -1
  49. nuitka/plugins/PluginBase.py +11 -3
  50. nuitka/plugins/standard/KivyPlugin.py +10 -0
  51. nuitka/plugins/standard/standard.nuitka-package.config.yml +240 -25
  52. nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +38 -2
  53. nuitka/tools/testing/Common.py +22 -2
  54. nuitka/tree/InternalModule.py +1 -1
  55. nuitka/tree/ReformulationFunctionStatements.py +1 -0
  56. nuitka/utils/Execution.py +8 -7
  57. nuitka/utils/FileOperations.py +38 -1
  58. nuitka/utils/SharedLibraries.py +38 -34
  59. {Nuitka_winsvc-2.3.3.data → Nuitka_winsvc-2.3.11.data}/scripts/nuitka-run.bat +0 -0
  60. {Nuitka_winsvc-2.3.3.data → Nuitka_winsvc-2.3.11.data}/scripts/nuitka.bat +0 -0
  61. {Nuitka_winsvc-2.3.3.dist-info → Nuitka_winsvc-2.3.11.dist-info}/LICENSE.txt +0 -0
  62. {Nuitka_winsvc-2.3.3.dist-info → Nuitka_winsvc-2.3.11.dist-info}/entry_points.txt +0 -0
  63. {Nuitka_winsvc-2.3.3.dist-info → Nuitka_winsvc-2.3.11.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,68 @@
1
+ /* Copyright (c) INRIA and Microsoft Corporation. All rights reserved.
2
+ Licensed under the Apache 2.0 License. */
3
+
4
+ #ifndef FSTAR_UINT128_STRUCT_ENDIANNESS_H
5
+ #define FSTAR_UINT128_STRUCT_ENDIANNESS_H
6
+
7
+ /* Hand-written implementation of endianness-related uint128 functions
8
+ * for the extracted uint128 implementation */
9
+
10
+ /* Access 64-bit fields within the int128. */
11
+ #define HIGH64_OF(x) ((x)->high)
12
+ #define LOW64_OF(x) ((x)->low)
13
+
14
+ /* A series of definitions written using pointers. */
15
+
16
+ inline static void load128_le_(uint8_t *b, uint128_t *r) {
17
+ LOW64_OF(r) = load64_le(b);
18
+ HIGH64_OF(r) = load64_le(b + 8);
19
+ }
20
+
21
+ inline static void store128_le_(uint8_t *b, uint128_t *n) {
22
+ store64_le(b, LOW64_OF(n));
23
+ store64_le(b + 8, HIGH64_OF(n));
24
+ }
25
+
26
+ inline static void load128_be_(uint8_t *b, uint128_t *r) {
27
+ HIGH64_OF(r) = load64_be(b);
28
+ LOW64_OF(r) = load64_be(b + 8);
29
+ }
30
+
31
+ inline static void store128_be_(uint8_t *b, uint128_t *n) {
32
+ store64_be(b, HIGH64_OF(n));
33
+ store64_be(b + 8, LOW64_OF(n));
34
+ }
35
+
36
+ #ifndef KRML_NOSTRUCT_PASSING
37
+
38
+ inline static uint128_t load128_le(uint8_t *b) {
39
+ uint128_t r;
40
+ load128_le_(b, &r);
41
+ return r;
42
+ }
43
+
44
+ inline static void store128_le(uint8_t *b, uint128_t n) {
45
+ store128_le_(b, &n);
46
+ }
47
+
48
+ inline static uint128_t load128_be(uint8_t *b) {
49
+ uint128_t r;
50
+ load128_be_(b, &r);
51
+ return r;
52
+ }
53
+
54
+ inline static void store128_be(uint8_t *b, uint128_t n) {
55
+ store128_be_(b, &n);
56
+ }
57
+
58
+ #else /* !defined(KRML_STRUCT_PASSING) */
59
+
60
+ # define print128 print128_
61
+ # define load128_le load128_le_
62
+ # define store128_le store128_le_
63
+ # define load128_be load128_be_
64
+ # define store128_be store128_be_
65
+
66
+ #endif /* KRML_STRUCT_PASSING */
67
+
68
+ #endif
@@ -0,0 +1,293 @@
1
+ /* Copyright (c) INRIA and Microsoft Corporation. All rights reserved.
2
+ Licensed under the Apache 2.0 License. */
3
+
4
+ #ifndef __KRML_TARGET_H
5
+ #define __KRML_TARGET_H
6
+
7
+ #include <assert.h>
8
+ #include <inttypes.h>
9
+ #include <limits.h>
10
+ #include <stdbool.h>
11
+ #include <stddef.h>
12
+ #include <stdio.h>
13
+ #include <stdlib.h>
14
+
15
+ /* Since KaRaMeL emits the inline keyword unconditionally, we follow the
16
+ * guidelines at https://gcc.gnu.org/onlinedocs/gcc/Inline.html and make this
17
+ * __inline__ to ensure the code compiles with -std=c90 and earlier. */
18
+ #ifdef __GNUC__
19
+ # define inline __inline__
20
+ #endif
21
+
22
+ /******************************************************************************/
23
+ /* Macros that KaRaMeL will generate. */
24
+ /******************************************************************************/
25
+
26
+ /* For "bare" targets that do not have a C stdlib, the user might want to use
27
+ * [-add-early-include '"mydefinitions.h"'] and override these. */
28
+ #ifndef KRML_HOST_PRINTF
29
+ # define KRML_HOST_PRINTF printf
30
+ #endif
31
+
32
+ #if ( \
33
+ (defined __STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \
34
+ (!(defined KRML_HOST_EPRINTF)))
35
+ # define KRML_HOST_EPRINTF(...) fprintf(stderr, __VA_ARGS__)
36
+ #elif !(defined KRML_HOST_EPRINTF) && defined(_MSC_VER)
37
+ # define KRML_HOST_EPRINTF(...) fprintf(stderr, __VA_ARGS__)
38
+ #endif
39
+
40
+ #ifndef KRML_HOST_EXIT
41
+ # define KRML_HOST_EXIT exit
42
+ #endif
43
+
44
+ #ifndef KRML_HOST_MALLOC
45
+ # define KRML_HOST_MALLOC malloc
46
+ #endif
47
+
48
+ #ifndef KRML_HOST_CALLOC
49
+ # define KRML_HOST_CALLOC calloc
50
+ #endif
51
+
52
+ #ifndef KRML_HOST_FREE
53
+ # define KRML_HOST_FREE free
54
+ #endif
55
+
56
+ #ifndef KRML_HOST_IGNORE
57
+ # define KRML_HOST_IGNORE(x) (void)(x)
58
+ #endif
59
+
60
+ #ifndef KRML_MAYBE_UNUSED_VAR
61
+ # define KRML_MAYBE_UNUSED_VAR(x) KRML_HOST_IGNORE(x)
62
+ #endif
63
+
64
+ #ifndef KRML_MAYBE_UNUSED
65
+ # if defined(__GNUC__)
66
+ # define KRML_MAYBE_UNUSED __attribute__((unused))
67
+ # else
68
+ # define KRML_MAYBE_UNUSED
69
+ # endif
70
+ #endif
71
+
72
+ #ifndef KRML_NOINLINE
73
+ # if defined(_MSC_VER)
74
+ # define KRML_NOINLINE __declspec(noinline)
75
+ # elif defined (__GNUC__)
76
+ # define KRML_NOINLINE __attribute__((noinline,unused))
77
+ # else
78
+ # define KRML_NOINLINE
79
+ # warning "The KRML_NOINLINE macro is not defined for this toolchain!"
80
+ # warning "The compiler may defeat side-channel resistance with optimizations."
81
+ # warning "Please locate target.h and try to fill it out with a suitable definition for this compiler."
82
+ # endif
83
+ #endif
84
+
85
+ /* In FStar.Buffer.fst, the size of arrays is uint32_t, but it's a number of
86
+ * *elements*. Do an ugly, run-time check (some of which KaRaMeL can eliminate).
87
+ */
88
+ #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4))
89
+ # define _KRML_CHECK_SIZE_PRAGMA \
90
+ _Pragma("GCC diagnostic ignored \"-Wtype-limits\"")
91
+ #else
92
+ # define _KRML_CHECK_SIZE_PRAGMA
93
+ #endif
94
+
95
+ #define KRML_CHECK_SIZE(size_elt, sz) \
96
+ do { \
97
+ _KRML_CHECK_SIZE_PRAGMA \
98
+ if (((size_t)(sz)) > ((size_t)(SIZE_MAX / (size_elt)))) { \
99
+ KRML_HOST_PRINTF( \
100
+ "Maximum allocatable size exceeded, aborting before overflow at " \
101
+ "%s:%d\n", \
102
+ __FILE__, __LINE__); \
103
+ KRML_HOST_EXIT(253); \
104
+ } \
105
+ } while (0)
106
+
107
+ /* Macros for prettier unrolling of loops */
108
+ #define KRML_LOOP1(i, n, x) { \
109
+ x \
110
+ i += n; \
111
+ (void) i; \
112
+ }
113
+
114
+ #define KRML_LOOP2(i, n, x) \
115
+ KRML_LOOP1(i, n, x) \
116
+ KRML_LOOP1(i, n, x)
117
+
118
+ #define KRML_LOOP3(i, n, x) \
119
+ KRML_LOOP2(i, n, x) \
120
+ KRML_LOOP1(i, n, x)
121
+
122
+ #define KRML_LOOP4(i, n, x) \
123
+ KRML_LOOP2(i, n, x) \
124
+ KRML_LOOP2(i, n, x)
125
+
126
+ #define KRML_LOOP5(i, n, x) \
127
+ KRML_LOOP4(i, n, x) \
128
+ KRML_LOOP1(i, n, x)
129
+
130
+ #define KRML_LOOP6(i, n, x) \
131
+ KRML_LOOP4(i, n, x) \
132
+ KRML_LOOP2(i, n, x)
133
+
134
+ #define KRML_LOOP7(i, n, x) \
135
+ KRML_LOOP4(i, n, x) \
136
+ KRML_LOOP3(i, n, x)
137
+
138
+ #define KRML_LOOP8(i, n, x) \
139
+ KRML_LOOP4(i, n, x) \
140
+ KRML_LOOP4(i, n, x)
141
+
142
+ #define KRML_LOOP9(i, n, x) \
143
+ KRML_LOOP8(i, n, x) \
144
+ KRML_LOOP1(i, n, x)
145
+
146
+ #define KRML_LOOP10(i, n, x) \
147
+ KRML_LOOP8(i, n, x) \
148
+ KRML_LOOP2(i, n, x)
149
+
150
+ #define KRML_LOOP11(i, n, x) \
151
+ KRML_LOOP8(i, n, x) \
152
+ KRML_LOOP3(i, n, x)
153
+
154
+ #define KRML_LOOP12(i, n, x) \
155
+ KRML_LOOP8(i, n, x) \
156
+ KRML_LOOP4(i, n, x)
157
+
158
+ #define KRML_LOOP13(i, n, x) \
159
+ KRML_LOOP8(i, n, x) \
160
+ KRML_LOOP5(i, n, x)
161
+
162
+ #define KRML_LOOP14(i, n, x) \
163
+ KRML_LOOP8(i, n, x) \
164
+ KRML_LOOP6(i, n, x)
165
+
166
+ #define KRML_LOOP15(i, n, x) \
167
+ KRML_LOOP8(i, n, x) \
168
+ KRML_LOOP7(i, n, x)
169
+
170
+ #define KRML_LOOP16(i, n, x) \
171
+ KRML_LOOP8(i, n, x) \
172
+ KRML_LOOP8(i, n, x)
173
+
174
+ #define KRML_UNROLL_FOR(i, z, n, k, x) \
175
+ do { \
176
+ uint32_t i = z; \
177
+ KRML_LOOP##n(i, k, x) \
178
+ } while (0)
179
+
180
+ #define KRML_ACTUAL_FOR(i, z, n, k, x) \
181
+ do { \
182
+ for (uint32_t i = z; i < n; i += k) { \
183
+ x \
184
+ } \
185
+ } while (0)
186
+
187
+ #ifndef KRML_UNROLL_MAX
188
+ # define KRML_UNROLL_MAX 16
189
+ #endif
190
+
191
+ /* 1 is the number of loop iterations, i.e. (n - z)/k as evaluated by krml */
192
+ #if 0 <= KRML_UNROLL_MAX
193
+ # define KRML_MAYBE_FOR0(i, z, n, k, x)
194
+ #else
195
+ # define KRML_MAYBE_FOR0(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
196
+ #endif
197
+
198
+ #if 1 <= KRML_UNROLL_MAX
199
+ # define KRML_MAYBE_FOR1(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 1, k, x)
200
+ #else
201
+ # define KRML_MAYBE_FOR1(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
202
+ #endif
203
+
204
+ #if 2 <= KRML_UNROLL_MAX
205
+ # define KRML_MAYBE_FOR2(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 2, k, x)
206
+ #else
207
+ # define KRML_MAYBE_FOR2(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
208
+ #endif
209
+
210
+ #if 3 <= KRML_UNROLL_MAX
211
+ # define KRML_MAYBE_FOR3(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 3, k, x)
212
+ #else
213
+ # define KRML_MAYBE_FOR3(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
214
+ #endif
215
+
216
+ #if 4 <= KRML_UNROLL_MAX
217
+ # define KRML_MAYBE_FOR4(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 4, k, x)
218
+ #else
219
+ # define KRML_MAYBE_FOR4(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
220
+ #endif
221
+
222
+ #if 5 <= KRML_UNROLL_MAX
223
+ # define KRML_MAYBE_FOR5(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 5, k, x)
224
+ #else
225
+ # define KRML_MAYBE_FOR5(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
226
+ #endif
227
+
228
+ #if 6 <= KRML_UNROLL_MAX
229
+ # define KRML_MAYBE_FOR6(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 6, k, x)
230
+ #else
231
+ # define KRML_MAYBE_FOR6(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
232
+ #endif
233
+
234
+ #if 7 <= KRML_UNROLL_MAX
235
+ # define KRML_MAYBE_FOR7(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 7, k, x)
236
+ #else
237
+ # define KRML_MAYBE_FOR7(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
238
+ #endif
239
+
240
+ #if 8 <= KRML_UNROLL_MAX
241
+ # define KRML_MAYBE_FOR8(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 8, k, x)
242
+ #else
243
+ # define KRML_MAYBE_FOR8(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
244
+ #endif
245
+
246
+ #if 9 <= KRML_UNROLL_MAX
247
+ # define KRML_MAYBE_FOR9(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 9, k, x)
248
+ #else
249
+ # define KRML_MAYBE_FOR9(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
250
+ #endif
251
+
252
+ #if 10 <= KRML_UNROLL_MAX
253
+ # define KRML_MAYBE_FOR10(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 10, k, x)
254
+ #else
255
+ # define KRML_MAYBE_FOR10(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
256
+ #endif
257
+
258
+ #if 11 <= KRML_UNROLL_MAX
259
+ # define KRML_MAYBE_FOR11(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 11, k, x)
260
+ #else
261
+ # define KRML_MAYBE_FOR11(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
262
+ #endif
263
+
264
+ #if 12 <= KRML_UNROLL_MAX
265
+ # define KRML_MAYBE_FOR12(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 12, k, x)
266
+ #else
267
+ # define KRML_MAYBE_FOR12(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
268
+ #endif
269
+
270
+ #if 13 <= KRML_UNROLL_MAX
271
+ # define KRML_MAYBE_FOR13(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 13, k, x)
272
+ #else
273
+ # define KRML_MAYBE_FOR13(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
274
+ #endif
275
+
276
+ #if 14 <= KRML_UNROLL_MAX
277
+ # define KRML_MAYBE_FOR14(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 14, k, x)
278
+ #else
279
+ # define KRML_MAYBE_FOR14(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
280
+ #endif
281
+
282
+ #if 15 <= KRML_UNROLL_MAX
283
+ # define KRML_MAYBE_FOR15(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 15, k, x)
284
+ #else
285
+ # define KRML_MAYBE_FOR15(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
286
+ #endif
287
+
288
+ #if 16 <= KRML_UNROLL_MAX
289
+ # define KRML_MAYBE_FOR16(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 16, k, x)
290
+ #else
291
+ # define KRML_MAYBE_FOR16(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x)
292
+ #endif
293
+ #endif
@@ -0,0 +1,231 @@
1
+ /* Copyright (c) INRIA and Microsoft Corporation. All rights reserved.
2
+ Licensed under the Apache 2.0 License. */
3
+
4
+ #ifndef __LOWSTAR_ENDIANNESS_H
5
+ #define __LOWSTAR_ENDIANNESS_H
6
+
7
+ #include <string.h>
8
+ #include <inttypes.h>
9
+
10
+ /******************************************************************************/
11
+ /* Implementing C.fst (part 2: endian-ness macros) */
12
+ /******************************************************************************/
13
+
14
+ /* ... for Linux */
15
+ #if defined(__linux__) || defined(__CYGWIN__) || defined (__USE_SYSTEM_ENDIAN_H__) || defined(__GLIBC__)
16
+ # include <endian.h>
17
+
18
+ /* ... for OSX */
19
+ #elif defined(__APPLE__)
20
+ # include <libkern/OSByteOrder.h>
21
+ # define htole64(x) OSSwapHostToLittleInt64(x)
22
+ # define le64toh(x) OSSwapLittleToHostInt64(x)
23
+ # define htobe64(x) OSSwapHostToBigInt64(x)
24
+ # define be64toh(x) OSSwapBigToHostInt64(x)
25
+
26
+ # define htole16(x) OSSwapHostToLittleInt16(x)
27
+ # define le16toh(x) OSSwapLittleToHostInt16(x)
28
+ # define htobe16(x) OSSwapHostToBigInt16(x)
29
+ # define be16toh(x) OSSwapBigToHostInt16(x)
30
+
31
+ # define htole32(x) OSSwapHostToLittleInt32(x)
32
+ # define le32toh(x) OSSwapLittleToHostInt32(x)
33
+ # define htobe32(x) OSSwapHostToBigInt32(x)
34
+ # define be32toh(x) OSSwapBigToHostInt32(x)
35
+
36
+ /* ... for Solaris */
37
+ #elif defined(__sun__)
38
+ # include <sys/byteorder.h>
39
+ # define htole64(x) LE_64(x)
40
+ # define le64toh(x) LE_64(x)
41
+ # define htobe64(x) BE_64(x)
42
+ # define be64toh(x) BE_64(x)
43
+
44
+ # define htole16(x) LE_16(x)
45
+ # define le16toh(x) LE_16(x)
46
+ # define htobe16(x) BE_16(x)
47
+ # define be16toh(x) BE_16(x)
48
+
49
+ # define htole32(x) LE_32(x)
50
+ # define le32toh(x) LE_32(x)
51
+ # define htobe32(x) BE_32(x)
52
+ # define be32toh(x) BE_32(x)
53
+
54
+ /* ... for the BSDs */
55
+ #elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
56
+ # include <sys/endian.h>
57
+ #elif defined(__OpenBSD__)
58
+ # include <endian.h>
59
+
60
+ /* ... for Windows (MSVC)... not targeting XBOX 360! */
61
+ #elif defined(_MSC_VER)
62
+
63
+ # include <stdlib.h>
64
+ # define htobe16(x) _byteswap_ushort(x)
65
+ # define htole16(x) (x)
66
+ # define be16toh(x) _byteswap_ushort(x)
67
+ # define le16toh(x) (x)
68
+
69
+ # define htobe32(x) _byteswap_ulong(x)
70
+ # define htole32(x) (x)
71
+ # define be32toh(x) _byteswap_ulong(x)
72
+ # define le32toh(x) (x)
73
+
74
+ # define htobe64(x) _byteswap_uint64(x)
75
+ # define htole64(x) (x)
76
+ # define be64toh(x) _byteswap_uint64(x)
77
+ # define le64toh(x) (x)
78
+
79
+ /* ... for Windows (GCC-like, e.g. mingw or clang) */
80
+ #elif (defined(_WIN32) || defined(_WIN64) || defined(__EMSCRIPTEN__)) && \
81
+ (defined(__GNUC__) || defined(__clang__))
82
+
83
+ # define htobe16(x) __builtin_bswap16(x)
84
+ # define htole16(x) (x)
85
+ # define be16toh(x) __builtin_bswap16(x)
86
+ # define le16toh(x) (x)
87
+
88
+ # define htobe32(x) __builtin_bswap32(x)
89
+ # define htole32(x) (x)
90
+ # define be32toh(x) __builtin_bswap32(x)
91
+ # define le32toh(x) (x)
92
+
93
+ # define htobe64(x) __builtin_bswap64(x)
94
+ # define htole64(x) (x)
95
+ # define be64toh(x) __builtin_bswap64(x)
96
+ # define le64toh(x) (x)
97
+
98
+ /* ... generic big-endian fallback code */
99
+ /* ... AIX doesn't have __BYTE_ORDER__ (with XLC compiler) & is always big-endian */
100
+ #elif (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) || defined(_AIX)
101
+
102
+ /* byte swapping code inspired by:
103
+ * https://github.com/rweather/arduinolibs/blob/master/libraries/Crypto/utility/EndianUtil.h
104
+ * */
105
+
106
+ # define htobe32(x) (x)
107
+ # define be32toh(x) (x)
108
+ # define htole32(x) \
109
+ (__extension__({ \
110
+ uint32_t _temp = (x); \
111
+ ((_temp >> 24) & 0x000000FF) | ((_temp >> 8) & 0x0000FF00) | \
112
+ ((_temp << 8) & 0x00FF0000) | ((_temp << 24) & 0xFF000000); \
113
+ }))
114
+ # define le32toh(x) (htole32((x)))
115
+
116
+ # define htobe64(x) (x)
117
+ # define be64toh(x) (x)
118
+ # define htole64(x) \
119
+ (__extension__({ \
120
+ uint64_t __temp = (x); \
121
+ uint32_t __low = htobe32((uint32_t)__temp); \
122
+ uint32_t __high = htobe32((uint32_t)(__temp >> 32)); \
123
+ (((uint64_t)__low) << 32) | __high; \
124
+ }))
125
+ # define le64toh(x) (htole64((x)))
126
+
127
+ /* ... generic little-endian fallback code */
128
+ #elif defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
129
+
130
+ # define htole32(x) (x)
131
+ # define le32toh(x) (x)
132
+ # define htobe32(x) \
133
+ (__extension__({ \
134
+ uint32_t _temp = (x); \
135
+ ((_temp >> 24) & 0x000000FF) | ((_temp >> 8) & 0x0000FF00) | \
136
+ ((_temp << 8) & 0x00FF0000) | ((_temp << 24) & 0xFF000000); \
137
+ }))
138
+ # define be32toh(x) (htobe32((x)))
139
+
140
+ # define htole64(x) (x)
141
+ # define le64toh(x) (x)
142
+ # define htobe64(x) \
143
+ (__extension__({ \
144
+ uint64_t __temp = (x); \
145
+ uint32_t __low = htobe32((uint32_t)__temp); \
146
+ uint32_t __high = htobe32((uint32_t)(__temp >> 32)); \
147
+ (((uint64_t)__low) << 32) | __high; \
148
+ }))
149
+ # define be64toh(x) (htobe64((x)))
150
+
151
+ /* ... couldn't determine endian-ness of the target platform */
152
+ #else
153
+ # error "Please define __BYTE_ORDER__!"
154
+
155
+ #endif /* defined(__linux__) || ... */
156
+
157
+ /* Loads and stores. These avoid undefined behavior due to unaligned memory
158
+ * accesses, via memcpy. */
159
+
160
+ inline static uint16_t load16(uint8_t *b) {
161
+ uint16_t x;
162
+ memcpy(&x, b, 2);
163
+ return x;
164
+ }
165
+
166
+ inline static uint32_t load32(uint8_t *b) {
167
+ uint32_t x;
168
+ memcpy(&x, b, 4);
169
+ return x;
170
+ }
171
+
172
+ inline static uint64_t load64(uint8_t *b) {
173
+ uint64_t x;
174
+ memcpy(&x, b, 8);
175
+ return x;
176
+ }
177
+
178
+ inline static void store16(uint8_t *b, uint16_t i) {
179
+ memcpy(b, &i, 2);
180
+ }
181
+
182
+ inline static void store32(uint8_t *b, uint32_t i) {
183
+ memcpy(b, &i, 4);
184
+ }
185
+
186
+ inline static void store64(uint8_t *b, uint64_t i) {
187
+ memcpy(b, &i, 8);
188
+ }
189
+
190
+ /* Legacy accessors so that this header can serve as an implementation of
191
+ * C.Endianness */
192
+ #define load16_le(b) (le16toh(load16(b)))
193
+ #define store16_le(b, i) (store16(b, htole16(i)))
194
+ #define load16_be(b) (be16toh(load16(b)))
195
+ #define store16_be(b, i) (store16(b, htobe16(i)))
196
+
197
+ #define load32_le(b) (le32toh(load32(b)))
198
+ #define store32_le(b, i) (store32(b, htole32(i)))
199
+ #define load32_be(b) (be32toh(load32(b)))
200
+ #define store32_be(b, i) (store32(b, htobe32(i)))
201
+
202
+ #define load64_le(b) (le64toh(load64(b)))
203
+ #define store64_le(b, i) (store64(b, htole64(i)))
204
+ #define load64_be(b) (be64toh(load64(b)))
205
+ #define store64_be(b, i) (store64(b, htobe64(i)))
206
+
207
+ /* Co-existence of LowStar.Endianness and FStar.Endianness generates name
208
+ * conflicts, because of course both insist on having no prefixes. Until a
209
+ * prefix is added, or until we truly retire FStar.Endianness, solve this issue
210
+ * in an elegant way. */
211
+ #define load16_le0 load16_le
212
+ #define store16_le0 store16_le
213
+ #define load16_be0 load16_be
214
+ #define store16_be0 store16_be
215
+
216
+ #define load32_le0 load32_le
217
+ #define store32_le0 store32_le
218
+ #define load32_be0 load32_be
219
+ #define store32_be0 store32_be
220
+
221
+ #define load64_le0 load64_le
222
+ #define store64_le0 store64_le
223
+ #define load64_be0 load64_be
224
+ #define store64_be0 store64_be
225
+
226
+ #define load128_le0 load128_le
227
+ #define store128_le0 store128_le
228
+ #define load128_be0 load128_be
229
+ #define store128_be0 store128_be
230
+
231
+ #endif
@@ -0,0 +1,14 @@
1
+ #pragma once
2
+
3
+ #include <inttypes.h>
4
+
5
+ typedef struct FStar_UInt128_uint128_s {
6
+ uint64_t low;
7
+ uint64_t high;
8
+ } FStar_UInt128_uint128, uint128_t;
9
+
10
+ #define KRML_VERIFIED_UINT128
11
+
12
+ #include "krml/lowstar_endianness.h"
13
+ #include "krml/fstar_uint128_struct_endianness.h"
14
+ #include "krml/FStar_UInt128_Verified.h"
@@ -0,0 +1,56 @@
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 __internal_Hacl_Hash_MD5_H
27
+ #define __internal_Hacl_Hash_MD5_H
28
+
29
+ #if defined(__cplusplus)
30
+ extern "C" {
31
+ #endif
32
+
33
+ #include <string.h>
34
+ #include "krml/types.h"
35
+ #include "krml/lowstar_endianness.h"
36
+ #include "krml/internal/target.h"
37
+
38
+ #include "../Hacl_Hash_MD5.h"
39
+
40
+ void Hacl_Hash_MD5_init(uint32_t *s);
41
+
42
+ void Hacl_Hash_MD5_finish(uint32_t *s, uint8_t *dst);
43
+
44
+ void Hacl_Hash_MD5_update_multi(uint32_t *s, uint8_t *blocks, uint32_t n_blocks);
45
+
46
+ void
47
+ Hacl_Hash_MD5_update_last(uint32_t *s, uint64_t prev_len, uint8_t *input, uint32_t input_len);
48
+
49
+ void Hacl_Hash_MD5_hash_oneshot(uint8_t *output, uint8_t *input, uint32_t input_len);
50
+
51
+ #if defined(__cplusplus)
52
+ }
53
+ #endif
54
+
55
+ #define __internal_Hacl_Hash_MD5_H_DEFINED
56
+ #endif