From bb6620ac985d53c72b4f5634e5c3373050f20989 Mon Sep 17 00:00:00 2001 From: Franziskus Kiefer Date: Wed, 27 Sep 2023 09:16:57 +0200 Subject: [PATCH 1/7] update hacl to ad60c9d98c9ce8f6a4fa13090511fa4b3a2c137b (#426) --- .github/workflows/rust.yml | 6 +- config/default_config.cmake | 8 +- include/EverCrypt_AEAD.h | 4 + include/EverCrypt_DRBG.h | 1 - include/Hacl_Frodo1344.h | 1 - include/Hacl_Frodo64.h | 1 - include/Hacl_Frodo640.h | 1 - include/Hacl_Frodo976.h | 1 - include/Hacl_Hash_Blake2.h | 1 - include/Hacl_Hash_Blake2b_256.h | 1 - include/Hacl_Hash_Blake2s_128.h | 1 - include/Hacl_Krmllib.h | 4 +- include/Lib_Memzero0.h | 45 - include/TestLib.h | 3 +- include/internal/Hacl_Bignum_Base.h | 4 + include/internal/Hacl_Krmllib.h | 8 +- include/lib_intrinsics.h | 60 +- include/lib_memzero0.h | 5 + include/msvc/EverCrypt_AEAD.h | 4 + include/msvc/EverCrypt_DRBG.h | 1 - include/msvc/Hacl_Frodo1344.h | 1 - include/msvc/Hacl_Frodo64.h | 1 - include/msvc/Hacl_Frodo640.h | 1 - include/msvc/Hacl_Frodo976.h | 1 - include/msvc/Hacl_Hash_Blake2.h | 1 - include/msvc/Hacl_Hash_Blake2b_256.h | 1 - include/msvc/Hacl_Hash_Blake2s_128.h | 1 - include/msvc/Hacl_Krmllib.h | 4 +- include/msvc/Lib_Memzero0.h | 45 - include/msvc/TestLib.h | 3 +- include/msvc/internal/Hacl_Bignum_Base.h | 4 + include/msvc/internal/Hacl_Krmllib.h | 8 +- include/msvc/lib_intrinsics.h | 60 +- include/msvc/lib_memzero0.h | 5 + info.txt | 6 +- karamel/include/krml/internal/target.h | 186 +++-- .../dist/minimal/FStar_UInt_8_16_32_64.h | 48 +- ocaml/ctypes.depend | 10 +- rust/hacl-sys/Cargo.toml | 2 +- src/EverCrypt_AEAD.c | 452 +++++----- src/EverCrypt_Chacha20Poly1305.c | 12 +- src/EverCrypt_Curve25519.c | 31 +- src/EverCrypt_DRBG.c | 769 +++++++++--------- src/EverCrypt_HMAC.c | 60 +- src/EverCrypt_Hash.c | 40 +- src/EverCrypt_Poly1305.c | 8 + src/Hacl_Bignum.c | 16 + src/Hacl_Bignum256.c | 11 + src/Hacl_Bignum256_32.c | 11 + src/Hacl_Bignum32.c | 3 + src/Hacl_Bignum4096.c | 7 + src/Hacl_Bignum4096_32.c | 7 + src/Hacl_Bignum64.c | 3 + src/Hacl_Ed25519.c | 18 +- src/Hacl_Frodo1344.c | 49 +- src/Hacl_Frodo64.c | 49 +- src/Hacl_Frodo640.c | 49 +- src/Hacl_Frodo976.c | 49 +- src/Hacl_GenericField32.c | 1 + src/Hacl_GenericField64.c | 1 + src/Hacl_HMAC.c | 60 +- src/Hacl_HMAC_Blake2b_256.c | 10 +- src/Hacl_HMAC_Blake2s_128.c | 10 +- src/Hacl_HMAC_DRBG.c | 28 +- src/Hacl_Hash_Blake2.c | 21 +- src/Hacl_Hash_Blake2b_256.c | 11 +- src/Hacl_Hash_Blake2s_128.c | 11 +- src/Hacl_Hash_MD5.c | 1 + src/Hacl_Hash_SHA1.c | 1 + src/Hacl_Hash_SHA2.c | 4 + src/Hacl_Hash_SHA3.c | 2 + src/Hacl_K256_ECDSA.c | 4 + src/Hacl_P256.c | 16 + src/Hacl_Streaming_Blake2.c | 2 + src/Hacl_Streaming_Blake2b_256.c | 1 + src/Hacl_Streaming_Blake2s_128.c | 1 + src/Hacl_Streaming_Poly1305_128.c | 1 + src/Hacl_Streaming_Poly1305_256.c | 1 + src/Hacl_Streaming_Poly1305_32.c | 1 + src/Lib_Memzero0.c | 5 +- src/msvc/EverCrypt_AEAD.c | 452 +++++----- src/msvc/EverCrypt_Chacha20Poly1305.c | 12 +- src/msvc/EverCrypt_Curve25519.c | 31 +- src/msvc/EverCrypt_DRBG.c | 769 +++++++++--------- src/msvc/EverCrypt_HMAC.c | 60 +- src/msvc/EverCrypt_Hash.c | 40 +- src/msvc/EverCrypt_Poly1305.c | 8 + src/msvc/Hacl_Bignum.c | 16 + src/msvc/Hacl_Bignum256.c | 11 + src/msvc/Hacl_Bignum256_32.c | 11 + src/msvc/Hacl_Bignum32.c | 3 + src/msvc/Hacl_Bignum4096.c | 7 + src/msvc/Hacl_Bignum4096_32.c | 7 + src/msvc/Hacl_Bignum64.c | 3 + src/msvc/Hacl_Ed25519.c | 18 +- src/msvc/Hacl_Frodo1344.c | 49 +- src/msvc/Hacl_Frodo64.c | 49 +- src/msvc/Hacl_Frodo640.c | 49 +- src/msvc/Hacl_Frodo976.c | 49 +- src/msvc/Hacl_GenericField32.c | 1 + src/msvc/Hacl_GenericField64.c | 1 + src/msvc/Hacl_HMAC.c | 60 +- src/msvc/Hacl_HMAC_Blake2b_256.c | 10 +- src/msvc/Hacl_HMAC_Blake2s_128.c | 10 +- src/msvc/Hacl_HMAC_DRBG.c | 28 +- src/msvc/Hacl_Hash_Blake2.c | 21 +- src/msvc/Hacl_Hash_Blake2b_256.c | 11 +- src/msvc/Hacl_Hash_Blake2s_128.c | 11 +- src/msvc/Hacl_Hash_MD5.c | 1 + src/msvc/Hacl_Hash_SHA1.c | 1 + src/msvc/Hacl_Hash_SHA2.c | 4 + src/msvc/Hacl_Hash_SHA3.c | 2 + src/msvc/Hacl_K256_ECDSA.c | 4 + src/msvc/Hacl_P256.c | 16 + src/msvc/Hacl_Streaming_Blake2.c | 2 + src/msvc/Hacl_Streaming_Blake2b_256.c | 1 + src/msvc/Hacl_Streaming_Blake2s_128.c | 1 + src/msvc/Hacl_Streaming_Poly1305_128.c | 1 + src/msvc/Hacl_Streaming_Poly1305_256.c | 1 + src/msvc/Hacl_Streaming_Poly1305_32.c | 1 + src/msvc/Lib_Memzero0.c | 5 +- src/wasm/EverCrypt_Hash.wasm | Bin 49324 -> 49374 bytes src/wasm/Hacl_Bignum.wasm | Bin 78410 -> 78522 bytes src/wasm/Hacl_Bignum256.wasm | Bin 100177 -> 100214 bytes src/wasm/Hacl_Bignum256_32.wasm | Bin 40987 -> 41067 bytes src/wasm/Hacl_Bignum32.wasm | Bin 15241 -> 15248 bytes src/wasm/Hacl_Bignum4096.wasm | Bin 63761 -> 63798 bytes src/wasm/Hacl_Bignum4096_32.wasm | Bin 32269 -> 32319 bytes src/wasm/Hacl_Bignum_Base.wasm | Bin 24678 -> 24692 bytes src/wasm/Hacl_Ed25519.wasm | Bin 78353 -> 77696 bytes src/wasm/Hacl_HMAC.wasm | Bin 29748 -> 29842 bytes src/wasm/Hacl_HMAC_Blake2b_256.wasm | Bin 1478 -> 1491 bytes src/wasm/Hacl_HMAC_Blake2s_128.wasm | Bin 1476 -> 1489 bytes src/wasm/Hacl_HMAC_DRBG.wasm | Bin 25433 -> 25403 bytes src/wasm/Hacl_Hash_SHA3.wasm | Bin 17623 -> 17639 bytes src/wasm/Hacl_K256_ECDSA.wasm | Bin 98177 -> 98203 bytes src/wasm/Hacl_Lib.wasm | Bin 0 -> 474 bytes src/wasm/Hacl_P256.wasm | Bin 83224 -> 83233 bytes src/wasm/INFO.txt | 4 +- src/wasm/main.html | 2 +- src/wasm/shell.js | 2 +- tools/configure.py | 17 +- 142 files changed, 2244 insertions(+), 2003 deletions(-) delete mode 100644 include/Lib_Memzero0.h create mode 100644 include/lib_memzero0.h delete mode 100644 include/msvc/Lib_Memzero0.h create mode 100644 include/msvc/lib_memzero0.h create mode 100644 src/wasm/Hacl_Lib.wasm diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 898c6184..fc98c876 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -40,7 +40,7 @@ jobs: matrix: os: - macos-latest - - ubuntu-latest + # - ubuntu-latest Disabling Ubuntu for now as long as bindgen is broken - windows-latest runs-on: ${{ matrix.os }} @@ -95,7 +95,7 @@ jobs: bits: [32, 64] os: - macos-latest - - ubuntu-latest + # - ubuntu-latest disable for now - windows-latest exclude: - bits: 32 @@ -122,7 +122,7 @@ jobs: - if: matrix.os == 'ubuntu-latest' run: | sudo apt-get update - sudo apt-get install ninja-build gcc-multilib g++-multilib + sudo apt-get install ninja-build gcc-multilib g++-multilib clang-15 rustup target add i686-unknown-linux-gnu - name: Setup | Developer Command Prompt (x86) diff --git a/config/default_config.cmake b/config/default_config.cmake index ee7e66ab..a2fe0e07 100644 --- a/config/default_config.cmake +++ b/config/default_config.cmake @@ -7,10 +7,10 @@ set(SOURCES_std ${PROJECT_SOURCE_DIR}/src/Hacl_HMAC.c ${PROJECT_SOURCE_DIR}/src/Hacl_Hash_SHA2.c ${PROJECT_SOURCE_DIR}/src/Hacl_Hash_Blake2.c - ${PROJECT_SOURCE_DIR}/src/Lib_Memzero0.c ${PROJECT_SOURCE_DIR}/src/Hacl_Ed25519.c ${PROJECT_SOURCE_DIR}/src/Hacl_EC_Ed25519.c ${PROJECT_SOURCE_DIR}/src/Hacl_Hash_Base.c + ${PROJECT_SOURCE_DIR}/src/Lib_Memzero0.c ${PROJECT_SOURCE_DIR}/src/Hacl_Streaming_Blake2.c ${PROJECT_SOURCE_DIR}/src/Hacl_Bignum256_32.c ${PROJECT_SOURCE_DIR}/src/Hacl_Bignum.c @@ -42,10 +42,10 @@ set(SOURCES_std ${PROJECT_SOURCE_DIR}/src/Hacl_Frodo64.c ${PROJECT_SOURCE_DIR}/src/EverCrypt_DRBG.c ${PROJECT_SOURCE_DIR}/src/Lib_RandomBuffer_System.c - ${PROJECT_SOURCE_DIR}/src/Lib_Memzero0.c ${PROJECT_SOURCE_DIR}/src/EverCrypt_HMAC.c ${PROJECT_SOURCE_DIR}/src/EverCrypt_Hash.c ${PROJECT_SOURCE_DIR}/src/EverCrypt_AutoConfig2.c + ${PROJECT_SOURCE_DIR}/src/Lib_Memzero0.c ${PROJECT_SOURCE_DIR}/src/EverCrypt_Ed25519.c ${PROJECT_SOURCE_DIR}/src/EverCrypt_Curve25519.c ${PROJECT_SOURCE_DIR}/src/EverCrypt_HKDF.c @@ -124,7 +124,6 @@ set(INCLUDES ${PROJECT_SOURCE_DIR}/include/Hacl_HMAC.h ${PROJECT_SOURCE_DIR}/include/Hacl_Hash_SHA2.h ${PROJECT_SOURCE_DIR}/include/Hacl_Hash_Blake2.h - ${PROJECT_SOURCE_DIR}/include/Lib_Memzero0.h ${PROJECT_SOURCE_DIR}/include/internal/Hacl_Ed25519.h ${PROJECT_SOURCE_DIR}/include/internal/Hacl_Hash_SHA2.h ${PROJECT_SOURCE_DIR}/include/internal/../Hacl_Hash_SHA2.h @@ -143,6 +142,7 @@ set(INCLUDES ${PROJECT_SOURCE_DIR}/include/internal/Hacl_Hash_Blake2.h ${PROJECT_SOURCE_DIR}/include/internal/Hacl_Impl_Blake2_Constants.h ${PROJECT_SOURCE_DIR}/include/internal/../Hacl_Hash_Blake2.h + ${PROJECT_SOURCE_DIR}/include/lib_memzero0.h ${PROJECT_SOURCE_DIR}/include/Hacl_Streaming_Blake2.h ${PROJECT_SOURCE_DIR}/include/Hacl_Hash_Blake2b_256.h ${PROJECT_SOURCE_DIR}/include/libintvector.h @@ -265,7 +265,6 @@ set(PUBLIC_INCLUDES ${PROJECT_SOURCE_DIR}/include/Hacl_HMAC.h ${PROJECT_SOURCE_DIR}/include/Hacl_Hash_SHA2.h ${PROJECT_SOURCE_DIR}/include/Hacl_Hash_Blake2.h - ${PROJECT_SOURCE_DIR}/include/Lib_Memzero0.h ${PROJECT_SOURCE_DIR}/include/internal/../Hacl_Hash_SHA2.h ${PROJECT_SOURCE_DIR}/include/internal/../Hacl_Curve25519_51.h ${PROJECT_SOURCE_DIR}/include/lib_intrinsics.h @@ -276,6 +275,7 @@ set(PUBLIC_INCLUDES ${PROJECT_SOURCE_DIR}/include/Hacl_EC_Ed25519.h ${PROJECT_SOURCE_DIR}/include/Hacl_Hash_Base.h ${PROJECT_SOURCE_DIR}/include/internal/../Hacl_Hash_Blake2.h + ${PROJECT_SOURCE_DIR}/include/lib_memzero0.h ${PROJECT_SOURCE_DIR}/include/Hacl_Streaming_Blake2.h ${PROJECT_SOURCE_DIR}/include/Hacl_Hash_Blake2b_256.h ${PROJECT_SOURCE_DIR}/include/libintvector.h diff --git a/include/EverCrypt_AEAD.h b/include/EverCrypt_AEAD.h index 4797df68..5d52493b 100644 --- a/include/EverCrypt_AEAD.h +++ b/include/EverCrypt_AEAD.h @@ -42,6 +42,10 @@ extern "C" { typedef struct EverCrypt_AEAD_state_s_s EverCrypt_AEAD_state_s; +/** +Both encryption and decryption require a state that holds the key. +The state may be reused as many times as desired. +*/ bool EverCrypt_AEAD_uu___is_Ek(Spec_Agile_AEAD_alg a, EverCrypt_AEAD_state_s projectee); /** diff --git a/include/EverCrypt_DRBG.h b/include/EverCrypt_DRBG.h index aee4e800..b3161bfe 100644 --- a/include/EverCrypt_DRBG.h +++ b/include/EverCrypt_DRBG.h @@ -36,7 +36,6 @@ extern "C" { #include "krml/internal/target.h" #include "Lib_RandomBuffer_System.h" -#include "Lib_Memzero0.h" #include "Hacl_Streaming_Types.h" #include "Hacl_HMAC_DRBG.h" diff --git a/include/Hacl_Frodo1344.h b/include/Hacl_Frodo1344.h index 85d29c9f..9fca4c82 100644 --- a/include/Hacl_Frodo1344.h +++ b/include/Hacl_Frodo1344.h @@ -35,7 +35,6 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -#include "Lib_Memzero0.h" #include "Hacl_Hash_SHA3.h" extern uint32_t Hacl_Frodo1344_crypto_bytes; diff --git a/include/Hacl_Frodo64.h b/include/Hacl_Frodo64.h index eb17defe..05aecb59 100644 --- a/include/Hacl_Frodo64.h +++ b/include/Hacl_Frodo64.h @@ -35,7 +35,6 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -#include "Lib_Memzero0.h" #include "Hacl_Hash_SHA3.h" /* diff --git a/include/Hacl_Frodo640.h b/include/Hacl_Frodo640.h index c4bf30d7..10c9bd47 100644 --- a/include/Hacl_Frodo640.h +++ b/include/Hacl_Frodo640.h @@ -35,7 +35,6 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -#include "Lib_Memzero0.h" #include "Hacl_Hash_SHA3.h" extern uint32_t Hacl_Frodo640_crypto_bytes; diff --git a/include/Hacl_Frodo976.h b/include/Hacl_Frodo976.h index 458ebd2f..c2d5f84f 100644 --- a/include/Hacl_Frodo976.h +++ b/include/Hacl_Frodo976.h @@ -35,7 +35,6 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -#include "Lib_Memzero0.h" #include "Hacl_Hash_SHA3.h" extern uint32_t Hacl_Frodo976_crypto_bytes; diff --git a/include/Hacl_Hash_Blake2.h b/include/Hacl_Hash_Blake2.h index aff1c7a9..3ee29015 100644 --- a/include/Hacl_Hash_Blake2.h +++ b/include/Hacl_Hash_Blake2.h @@ -35,7 +35,6 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -#include "Lib_Memzero0.h" #include "Hacl_Krmllib.h" void Hacl_Blake2b_32_blake2b_init(uint64_t *hash, uint32_t kk, uint32_t nn); diff --git a/include/Hacl_Hash_Blake2b_256.h b/include/Hacl_Hash_Blake2b_256.h index 88bf9ab2..2379fd75 100644 --- a/include/Hacl_Hash_Blake2b_256.h +++ b/include/Hacl_Hash_Blake2b_256.h @@ -35,7 +35,6 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -#include "Lib_Memzero0.h" #include "Hacl_Krmllib.h" #include "libintvector.h" diff --git a/include/Hacl_Hash_Blake2s_128.h b/include/Hacl_Hash_Blake2s_128.h index 0e424152..2af827cd 100644 --- a/include/Hacl_Hash_Blake2s_128.h +++ b/include/Hacl_Hash_Blake2s_128.h @@ -35,7 +35,6 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -#include "Lib_Memzero0.h" #include "libintvector.h" void diff --git a/include/Hacl_Krmllib.h b/include/Hacl_Krmllib.h index 6916db3d..c0ea70bf 100644 --- a/include/Hacl_Krmllib.h +++ b/include/Hacl_Krmllib.h @@ -35,9 +35,9 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -static inline uint64_t FStar_UInt64_eq_mask(uint64_t a, uint64_t b); +static KRML_NOINLINE uint64_t FStar_UInt64_eq_mask(uint64_t a, uint64_t b); -static inline uint64_t FStar_UInt64_gte_mask(uint64_t a, uint64_t b); +static KRML_NOINLINE uint64_t FStar_UInt64_gte_mask(uint64_t a, uint64_t b); static inline FStar_UInt128_uint128 FStar_UInt128_add_mod(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b); diff --git a/include/Lib_Memzero0.h b/include/Lib_Memzero0.h deleted file mode 100644 index 9a7c7ac5..00000000 --- a/include/Lib_Memzero0.h +++ /dev/null @@ -1,45 +0,0 @@ -/* MIT License - * - * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation - * Copyright (c) 2022-2023 HACL* Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - - -#ifndef __Lib_Memzero0_H -#define __Lib_Memzero0_H - -#if defined(__cplusplus) -extern "C" { -#endif - -#include -#include "krml/internal/types.h" -#include "krml/lowstar_endianness.h" -#include "krml/internal/target.h" - -extern void Lib_Memzero0_memzero(void *x0, uint64_t x1); - -#if defined(__cplusplus) -} -#endif - -#define __Lib_Memzero0_H_DEFINED -#endif diff --git a/include/TestLib.h b/include/TestLib.h index 3928a462..62399c0c 100644 --- a/include/TestLib.h +++ b/include/TestLib.h @@ -55,7 +55,8 @@ extern void TestLib_checku32(uint32_t uu___, uint32_t uu___1); extern void TestLib_checku64(uint64_t uu___, uint64_t uu___1); -extern void TestLib_compare_and_print(C_String_t uu___, uint8_t *b1, uint8_t *b2, uint32_t l); +extern void +TestLib_compare_and_print(Prims_string uu___, uint8_t *b1, uint8_t *b2, uint32_t l); extern uint8_t *TestLib_unsafe_malloc(uint32_t l); diff --git a/include/internal/Hacl_Bignum_Base.h b/include/internal/Hacl_Bignum_Base.h index 06e1d373..2cfb0066 100644 --- a/include/internal/Hacl_Bignum_Base.h +++ b/include/internal/Hacl_Bignum_Base.h @@ -401,6 +401,7 @@ Hacl_Bignum_Multiplication_bn_sqr_u32(uint32_t aLen, uint32_t *a, uint32_t *res) res[i0 + i0] = r; } uint32_t c0 = Hacl_Bignum_Addition_bn_add_eq_len_u32(aLen + aLen, res, res, res); + KRML_HOST_IGNORE(c0); KRML_CHECK_SIZE(sizeof (uint32_t), aLen + aLen); uint32_t tmp[aLen + aLen]; memset(tmp, 0U, (aLen + aLen) * sizeof (uint32_t)); @@ -413,6 +414,7 @@ Hacl_Bignum_Multiplication_bn_sqr_u32(uint32_t aLen, uint32_t *a, uint32_t *res) tmp[(uint32_t)2U * i + (uint32_t)1U] = hi; } uint32_t c1 = Hacl_Bignum_Addition_bn_add_eq_len_u32(aLen + aLen, res, tmp, res); + KRML_HOST_IGNORE(c1); } static inline void @@ -450,6 +452,7 @@ Hacl_Bignum_Multiplication_bn_sqr_u64(uint32_t aLen, uint64_t *a, uint64_t *res) res[i0 + i0] = r; } uint64_t c0 = Hacl_Bignum_Addition_bn_add_eq_len_u64(aLen + aLen, res, res, res); + KRML_HOST_IGNORE(c0); KRML_CHECK_SIZE(sizeof (uint64_t), aLen + aLen); uint64_t tmp[aLen + aLen]; memset(tmp, 0U, (aLen + aLen) * sizeof (uint64_t)); @@ -462,6 +465,7 @@ Hacl_Bignum_Multiplication_bn_sqr_u64(uint32_t aLen, uint64_t *a, uint64_t *res) tmp[(uint32_t)2U * i + (uint32_t)1U] = hi; } uint64_t c1 = Hacl_Bignum_Addition_bn_add_eq_len_u64(aLen + aLen, res, tmp, res); + KRML_HOST_IGNORE(c1); } #if defined(__cplusplus) diff --git a/include/internal/Hacl_Krmllib.h b/include/internal/Hacl_Krmllib.h index 278cb15b..70c84916 100644 --- a/include/internal/Hacl_Krmllib.h +++ b/include/internal/Hacl_Krmllib.h @@ -37,13 +37,13 @@ extern "C" { #include "../Hacl_Krmllib.h" -static inline uint32_t FStar_UInt32_eq_mask(uint32_t a, uint32_t b); +static KRML_NOINLINE uint32_t FStar_UInt32_eq_mask(uint32_t a, uint32_t b); -static inline uint32_t FStar_UInt32_gte_mask(uint32_t a, uint32_t b); +static KRML_NOINLINE uint32_t FStar_UInt32_gte_mask(uint32_t a, uint32_t b); -static inline uint8_t FStar_UInt8_eq_mask(uint8_t a, uint8_t b); +static KRML_NOINLINE uint8_t FStar_UInt8_eq_mask(uint8_t a, uint8_t b); -static inline uint16_t FStar_UInt16_eq_mask(uint16_t a, uint16_t b); +static KRML_NOINLINE uint16_t FStar_UInt16_eq_mask(uint16_t a, uint16_t b); static inline FStar_UInt128_uint128 FStar_UInt128_add(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b); diff --git a/include/lib_intrinsics.h b/include/lib_intrinsics.h index 0c35026e..8fa75b37 100644 --- a/include/lib_intrinsics.h +++ b/include/lib_intrinsics.h @@ -8,15 +8,20 @@ #endif #endif -#if defined(HACL_CAN_COMPILE_INTRINSICS) -#if defined(_MSC_VER) -#include -#else -#include -#endif -#endif +/* + GCC versions prior to 5.5 incorrectly optimize certain intrinsics. + + See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81300 + + CLANG versions prior to 5 crash on certain intrinsics. + + See https://bugs.llvm.org/show_bug.cgi?id=24943 +*/ -#if !defined(HACL_CAN_COMPILE_INTRINSICS) +#if !defined(HACL_CAN_COMPILE_INTRINSICS) || \ + (defined(__clang__) && (__clang_major__ < 5)) || \ + (defined(__GNUC__) && !defined(__clang__) && \ + (__GNUC__ < 5 || (__GNUC__ == 5 && (__GNUC_MINOR__ < 5)))) #include "Hacl_IntTypes_Intrinsics.h" @@ -25,35 +30,40 @@ #include "Hacl_IntTypes_Intrinsics_128.h" #define Lib_IntTypes_Intrinsics_add_carry_u64(x1, x2, x3, x4) \ - (Hacl_IntTypes_Intrinsics_128_add_carry_u64(x1, x2, x3, x4)) + (Hacl_IntTypes_Intrinsics_128_add_carry_u64(x1, x2, x3, x4)) #define Lib_IntTypes_Intrinsics_sub_borrow_u64(x1, x2, x3, x4) \ - (Hacl_IntTypes_Intrinsics_128_sub_borrow_u64(x1, x2, x3, x4)) + (Hacl_IntTypes_Intrinsics_128_sub_borrow_u64(x1, x2, x3, x4)) #else #define Lib_IntTypes_Intrinsics_add_carry_u64(x1, x2, x3, x4) \ - (Hacl_IntTypes_Intrinsics_add_carry_u64(x1, x2, x3, x4)) + (Hacl_IntTypes_Intrinsics_add_carry_u64(x1, x2, x3, x4)) #define Lib_IntTypes_Intrinsics_sub_borrow_u64(x1, x2, x3, x4) \ - (Hacl_IntTypes_Intrinsics_sub_borrow_u64(x1, x2, x3, x4)) + (Hacl_IntTypes_Intrinsics_sub_borrow_u64(x1, x2, x3, x4)) #endif // defined(HACL_CAN_COMPILE_UINT128) #define Lib_IntTypes_Intrinsics_add_carry_u32(x1, x2, x3, x4) \ - (Hacl_IntTypes_Intrinsics_add_carry_u32(x1, x2, x3, x4)) + (Hacl_IntTypes_Intrinsics_add_carry_u32(x1, x2, x3, x4)) #define Lib_IntTypes_Intrinsics_sub_borrow_u32(x1, x2, x3, x4) \ - (Hacl_IntTypes_Intrinsics_sub_borrow_u32(x1, x2, x3, x4)) + (Hacl_IntTypes_Intrinsics_sub_borrow_u32(x1, x2, x3, x4)) #else // !defined(HACL_CAN_COMPILE_INTRINSICS) +#if defined(_MSC_VER) +#include +#else +#include +#endif + #define Lib_IntTypes_Intrinsics_add_carry_u32(x1, x2, x3, x4) \ - (_addcarry_u32(x1, x2, x3, (unsigned int *) x4)) + (_addcarry_u32(x1, x2, x3, (unsigned int *)x4)) #define Lib_IntTypes_Intrinsics_add_carry_u64(x1, x2, x3, x4) \ - (_addcarry_u64(x1, x2, x3, (long long unsigned int *) x4)) - + (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4)) /* GCC versions prior to 7.2 pass arguments to _subborrow_u{32,64} @@ -61,22 +71,22 @@ See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81294 */ -#if defined(__GNUC__) && !defined (__clang__) && \ - (__GNUC__ < 7 || (__GNUC__ == 7 && (__GNUC_MINOR__ < 2))) +#if defined(__GNUC__) && !defined(__clang__) && \ + (__GNUC__ < 7 || (__GNUC__ == 7 && (__GNUC_MINOR__ < 2))) #define Lib_IntTypes_Intrinsics_sub_borrow_u32(x1, x2, x3, x4) \ - (_subborrow_u32(x1, x3, x2, (unsigned int *) x4)) + (_subborrow_u32(x1, x3, x2, (unsigned int *)x4)) #define Lib_IntTypes_Intrinsics_sub_borrow_u64(x1, x2, x3, x4) \ - (_subborrow_u64(x1, x3, x2, (long long unsigned int *) x4)) + (_subborrow_u64(x1, x3, x2, (long long unsigned int *)x4)) #else -#define Lib_IntTypes_Intrinsics_sub_borrow_u32(x1, x2, x3, x4) \ - (_subborrow_u32(x1, x2, x3, (unsigned int *) x4)) +#define Lib_IntTypes_Intrinsics_sub_borrow_u32(x1, x2, x3, x4) \ + (_subborrow_u32(x1, x2, x3, (unsigned int *)x4)) -#define Lib_IntTypes_Intrinsics_sub_borrow_u64(x1, x2, x3, x4) \ - (_subborrow_u64(x1, x2, x3, (long long unsigned int *) x4)) +#define Lib_IntTypes_Intrinsics_sub_borrow_u64(x1, x2, x3, x4) \ + (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4)) #endif // GCC < 7.2 diff --git a/include/lib_memzero0.h b/include/lib_memzero0.h new file mode 100644 index 00000000..506dd50f --- /dev/null +++ b/include/lib_memzero0.h @@ -0,0 +1,5 @@ +#include + +void Lib_Memzero0_memzero0(void *dst, uint64_t len); + +#define Lib_Memzero0_memzero(dst, len, t) Lib_Memzero0_memzero0(dst, len * sizeof(t)) diff --git a/include/msvc/EverCrypt_AEAD.h b/include/msvc/EverCrypt_AEAD.h index 4797df68..5d52493b 100644 --- a/include/msvc/EverCrypt_AEAD.h +++ b/include/msvc/EverCrypt_AEAD.h @@ -42,6 +42,10 @@ extern "C" { typedef struct EverCrypt_AEAD_state_s_s EverCrypt_AEAD_state_s; +/** +Both encryption and decryption require a state that holds the key. +The state may be reused as many times as desired. +*/ bool EverCrypt_AEAD_uu___is_Ek(Spec_Agile_AEAD_alg a, EverCrypt_AEAD_state_s projectee); /** diff --git a/include/msvc/EverCrypt_DRBG.h b/include/msvc/EverCrypt_DRBG.h index aee4e800..b3161bfe 100644 --- a/include/msvc/EverCrypt_DRBG.h +++ b/include/msvc/EverCrypt_DRBG.h @@ -36,7 +36,6 @@ extern "C" { #include "krml/internal/target.h" #include "Lib_RandomBuffer_System.h" -#include "Lib_Memzero0.h" #include "Hacl_Streaming_Types.h" #include "Hacl_HMAC_DRBG.h" diff --git a/include/msvc/Hacl_Frodo1344.h b/include/msvc/Hacl_Frodo1344.h index 85d29c9f..9fca4c82 100644 --- a/include/msvc/Hacl_Frodo1344.h +++ b/include/msvc/Hacl_Frodo1344.h @@ -35,7 +35,6 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -#include "Lib_Memzero0.h" #include "Hacl_Hash_SHA3.h" extern uint32_t Hacl_Frodo1344_crypto_bytes; diff --git a/include/msvc/Hacl_Frodo64.h b/include/msvc/Hacl_Frodo64.h index eb17defe..05aecb59 100644 --- a/include/msvc/Hacl_Frodo64.h +++ b/include/msvc/Hacl_Frodo64.h @@ -35,7 +35,6 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -#include "Lib_Memzero0.h" #include "Hacl_Hash_SHA3.h" /* diff --git a/include/msvc/Hacl_Frodo640.h b/include/msvc/Hacl_Frodo640.h index c4bf30d7..10c9bd47 100644 --- a/include/msvc/Hacl_Frodo640.h +++ b/include/msvc/Hacl_Frodo640.h @@ -35,7 +35,6 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -#include "Lib_Memzero0.h" #include "Hacl_Hash_SHA3.h" extern uint32_t Hacl_Frodo640_crypto_bytes; diff --git a/include/msvc/Hacl_Frodo976.h b/include/msvc/Hacl_Frodo976.h index 458ebd2f..c2d5f84f 100644 --- a/include/msvc/Hacl_Frodo976.h +++ b/include/msvc/Hacl_Frodo976.h @@ -35,7 +35,6 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -#include "Lib_Memzero0.h" #include "Hacl_Hash_SHA3.h" extern uint32_t Hacl_Frodo976_crypto_bytes; diff --git a/include/msvc/Hacl_Hash_Blake2.h b/include/msvc/Hacl_Hash_Blake2.h index aff1c7a9..3ee29015 100644 --- a/include/msvc/Hacl_Hash_Blake2.h +++ b/include/msvc/Hacl_Hash_Blake2.h @@ -35,7 +35,6 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -#include "Lib_Memzero0.h" #include "Hacl_Krmllib.h" void Hacl_Blake2b_32_blake2b_init(uint64_t *hash, uint32_t kk, uint32_t nn); diff --git a/include/msvc/Hacl_Hash_Blake2b_256.h b/include/msvc/Hacl_Hash_Blake2b_256.h index 88bf9ab2..2379fd75 100644 --- a/include/msvc/Hacl_Hash_Blake2b_256.h +++ b/include/msvc/Hacl_Hash_Blake2b_256.h @@ -35,7 +35,6 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -#include "Lib_Memzero0.h" #include "Hacl_Krmllib.h" #include "libintvector.h" diff --git a/include/msvc/Hacl_Hash_Blake2s_128.h b/include/msvc/Hacl_Hash_Blake2s_128.h index 0e424152..2af827cd 100644 --- a/include/msvc/Hacl_Hash_Blake2s_128.h +++ b/include/msvc/Hacl_Hash_Blake2s_128.h @@ -35,7 +35,6 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -#include "Lib_Memzero0.h" #include "libintvector.h" void diff --git a/include/msvc/Hacl_Krmllib.h b/include/msvc/Hacl_Krmllib.h index 6916db3d..c0ea70bf 100644 --- a/include/msvc/Hacl_Krmllib.h +++ b/include/msvc/Hacl_Krmllib.h @@ -35,9 +35,9 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -static inline uint64_t FStar_UInt64_eq_mask(uint64_t a, uint64_t b); +static KRML_NOINLINE uint64_t FStar_UInt64_eq_mask(uint64_t a, uint64_t b); -static inline uint64_t FStar_UInt64_gte_mask(uint64_t a, uint64_t b); +static KRML_NOINLINE uint64_t FStar_UInt64_gte_mask(uint64_t a, uint64_t b); static inline FStar_UInt128_uint128 FStar_UInt128_add_mod(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b); diff --git a/include/msvc/Lib_Memzero0.h b/include/msvc/Lib_Memzero0.h deleted file mode 100644 index 9a7c7ac5..00000000 --- a/include/msvc/Lib_Memzero0.h +++ /dev/null @@ -1,45 +0,0 @@ -/* MIT License - * - * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation - * Copyright (c) 2022-2023 HACL* Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - - -#ifndef __Lib_Memzero0_H -#define __Lib_Memzero0_H - -#if defined(__cplusplus) -extern "C" { -#endif - -#include -#include "krml/internal/types.h" -#include "krml/lowstar_endianness.h" -#include "krml/internal/target.h" - -extern void Lib_Memzero0_memzero(void *x0, uint64_t x1); - -#if defined(__cplusplus) -} -#endif - -#define __Lib_Memzero0_H_DEFINED -#endif diff --git a/include/msvc/TestLib.h b/include/msvc/TestLib.h index 3928a462..62399c0c 100644 --- a/include/msvc/TestLib.h +++ b/include/msvc/TestLib.h @@ -55,7 +55,8 @@ extern void TestLib_checku32(uint32_t uu___, uint32_t uu___1); extern void TestLib_checku64(uint64_t uu___, uint64_t uu___1); -extern void TestLib_compare_and_print(C_String_t uu___, uint8_t *b1, uint8_t *b2, uint32_t l); +extern void +TestLib_compare_and_print(Prims_string uu___, uint8_t *b1, uint8_t *b2, uint32_t l); extern uint8_t *TestLib_unsafe_malloc(uint32_t l); diff --git a/include/msvc/internal/Hacl_Bignum_Base.h b/include/msvc/internal/Hacl_Bignum_Base.h index 590fcbd0..e4d35fe9 100644 --- a/include/msvc/internal/Hacl_Bignum_Base.h +++ b/include/msvc/internal/Hacl_Bignum_Base.h @@ -401,6 +401,7 @@ Hacl_Bignum_Multiplication_bn_sqr_u32(uint32_t aLen, uint32_t *a, uint32_t *res) res[i0 + i0] = r; } uint32_t c0 = Hacl_Bignum_Addition_bn_add_eq_len_u32(aLen + aLen, res, res, res); + KRML_HOST_IGNORE(c0); KRML_CHECK_SIZE(sizeof (uint32_t), aLen + aLen); uint32_t *tmp = (uint32_t *)alloca((aLen + aLen) * sizeof (uint32_t)); memset(tmp, 0U, (aLen + aLen) * sizeof (uint32_t)); @@ -413,6 +414,7 @@ Hacl_Bignum_Multiplication_bn_sqr_u32(uint32_t aLen, uint32_t *a, uint32_t *res) tmp[(uint32_t)2U * i + (uint32_t)1U] = hi; } uint32_t c1 = Hacl_Bignum_Addition_bn_add_eq_len_u32(aLen + aLen, res, tmp, res); + KRML_HOST_IGNORE(c1); } static inline void @@ -450,6 +452,7 @@ Hacl_Bignum_Multiplication_bn_sqr_u64(uint32_t aLen, uint64_t *a, uint64_t *res) res[i0 + i0] = r; } uint64_t c0 = Hacl_Bignum_Addition_bn_add_eq_len_u64(aLen + aLen, res, res, res); + KRML_HOST_IGNORE(c0); KRML_CHECK_SIZE(sizeof (uint64_t), aLen + aLen); uint64_t *tmp = (uint64_t *)alloca((aLen + aLen) * sizeof (uint64_t)); memset(tmp, 0U, (aLen + aLen) * sizeof (uint64_t)); @@ -462,6 +465,7 @@ Hacl_Bignum_Multiplication_bn_sqr_u64(uint32_t aLen, uint64_t *a, uint64_t *res) tmp[(uint32_t)2U * i + (uint32_t)1U] = hi; } uint64_t c1 = Hacl_Bignum_Addition_bn_add_eq_len_u64(aLen + aLen, res, tmp, res); + KRML_HOST_IGNORE(c1); } #if defined(__cplusplus) diff --git a/include/msvc/internal/Hacl_Krmllib.h b/include/msvc/internal/Hacl_Krmllib.h index 278cb15b..70c84916 100644 --- a/include/msvc/internal/Hacl_Krmllib.h +++ b/include/msvc/internal/Hacl_Krmllib.h @@ -37,13 +37,13 @@ extern "C" { #include "../Hacl_Krmllib.h" -static inline uint32_t FStar_UInt32_eq_mask(uint32_t a, uint32_t b); +static KRML_NOINLINE uint32_t FStar_UInt32_eq_mask(uint32_t a, uint32_t b); -static inline uint32_t FStar_UInt32_gte_mask(uint32_t a, uint32_t b); +static KRML_NOINLINE uint32_t FStar_UInt32_gte_mask(uint32_t a, uint32_t b); -static inline uint8_t FStar_UInt8_eq_mask(uint8_t a, uint8_t b); +static KRML_NOINLINE uint8_t FStar_UInt8_eq_mask(uint8_t a, uint8_t b); -static inline uint16_t FStar_UInt16_eq_mask(uint16_t a, uint16_t b); +static KRML_NOINLINE uint16_t FStar_UInt16_eq_mask(uint16_t a, uint16_t b); static inline FStar_UInt128_uint128 FStar_UInt128_add(FStar_UInt128_uint128 a, FStar_UInt128_uint128 b); diff --git a/include/msvc/lib_intrinsics.h b/include/msvc/lib_intrinsics.h index 0c35026e..8fa75b37 100644 --- a/include/msvc/lib_intrinsics.h +++ b/include/msvc/lib_intrinsics.h @@ -8,15 +8,20 @@ #endif #endif -#if defined(HACL_CAN_COMPILE_INTRINSICS) -#if defined(_MSC_VER) -#include -#else -#include -#endif -#endif +/* + GCC versions prior to 5.5 incorrectly optimize certain intrinsics. + + See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81300 + + CLANG versions prior to 5 crash on certain intrinsics. + + See https://bugs.llvm.org/show_bug.cgi?id=24943 +*/ -#if !defined(HACL_CAN_COMPILE_INTRINSICS) +#if !defined(HACL_CAN_COMPILE_INTRINSICS) || \ + (defined(__clang__) && (__clang_major__ < 5)) || \ + (defined(__GNUC__) && !defined(__clang__) && \ + (__GNUC__ < 5 || (__GNUC__ == 5 && (__GNUC_MINOR__ < 5)))) #include "Hacl_IntTypes_Intrinsics.h" @@ -25,35 +30,40 @@ #include "Hacl_IntTypes_Intrinsics_128.h" #define Lib_IntTypes_Intrinsics_add_carry_u64(x1, x2, x3, x4) \ - (Hacl_IntTypes_Intrinsics_128_add_carry_u64(x1, x2, x3, x4)) + (Hacl_IntTypes_Intrinsics_128_add_carry_u64(x1, x2, x3, x4)) #define Lib_IntTypes_Intrinsics_sub_borrow_u64(x1, x2, x3, x4) \ - (Hacl_IntTypes_Intrinsics_128_sub_borrow_u64(x1, x2, x3, x4)) + (Hacl_IntTypes_Intrinsics_128_sub_borrow_u64(x1, x2, x3, x4)) #else #define Lib_IntTypes_Intrinsics_add_carry_u64(x1, x2, x3, x4) \ - (Hacl_IntTypes_Intrinsics_add_carry_u64(x1, x2, x3, x4)) + (Hacl_IntTypes_Intrinsics_add_carry_u64(x1, x2, x3, x4)) #define Lib_IntTypes_Intrinsics_sub_borrow_u64(x1, x2, x3, x4) \ - (Hacl_IntTypes_Intrinsics_sub_borrow_u64(x1, x2, x3, x4)) + (Hacl_IntTypes_Intrinsics_sub_borrow_u64(x1, x2, x3, x4)) #endif // defined(HACL_CAN_COMPILE_UINT128) #define Lib_IntTypes_Intrinsics_add_carry_u32(x1, x2, x3, x4) \ - (Hacl_IntTypes_Intrinsics_add_carry_u32(x1, x2, x3, x4)) + (Hacl_IntTypes_Intrinsics_add_carry_u32(x1, x2, x3, x4)) #define Lib_IntTypes_Intrinsics_sub_borrow_u32(x1, x2, x3, x4) \ - (Hacl_IntTypes_Intrinsics_sub_borrow_u32(x1, x2, x3, x4)) + (Hacl_IntTypes_Intrinsics_sub_borrow_u32(x1, x2, x3, x4)) #else // !defined(HACL_CAN_COMPILE_INTRINSICS) +#if defined(_MSC_VER) +#include +#else +#include +#endif + #define Lib_IntTypes_Intrinsics_add_carry_u32(x1, x2, x3, x4) \ - (_addcarry_u32(x1, x2, x3, (unsigned int *) x4)) + (_addcarry_u32(x1, x2, x3, (unsigned int *)x4)) #define Lib_IntTypes_Intrinsics_add_carry_u64(x1, x2, x3, x4) \ - (_addcarry_u64(x1, x2, x3, (long long unsigned int *) x4)) - + (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4)) /* GCC versions prior to 7.2 pass arguments to _subborrow_u{32,64} @@ -61,22 +71,22 @@ See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81294 */ -#if defined(__GNUC__) && !defined (__clang__) && \ - (__GNUC__ < 7 || (__GNUC__ == 7 && (__GNUC_MINOR__ < 2))) +#if defined(__GNUC__) && !defined(__clang__) && \ + (__GNUC__ < 7 || (__GNUC__ == 7 && (__GNUC_MINOR__ < 2))) #define Lib_IntTypes_Intrinsics_sub_borrow_u32(x1, x2, x3, x4) \ - (_subborrow_u32(x1, x3, x2, (unsigned int *) x4)) + (_subborrow_u32(x1, x3, x2, (unsigned int *)x4)) #define Lib_IntTypes_Intrinsics_sub_borrow_u64(x1, x2, x3, x4) \ - (_subborrow_u64(x1, x3, x2, (long long unsigned int *) x4)) + (_subborrow_u64(x1, x3, x2, (long long unsigned int *)x4)) #else -#define Lib_IntTypes_Intrinsics_sub_borrow_u32(x1, x2, x3, x4) \ - (_subborrow_u32(x1, x2, x3, (unsigned int *) x4)) +#define Lib_IntTypes_Intrinsics_sub_borrow_u32(x1, x2, x3, x4) \ + (_subborrow_u32(x1, x2, x3, (unsigned int *)x4)) -#define Lib_IntTypes_Intrinsics_sub_borrow_u64(x1, x2, x3, x4) \ - (_subborrow_u64(x1, x2, x3, (long long unsigned int *) x4)) +#define Lib_IntTypes_Intrinsics_sub_borrow_u64(x1, x2, x3, x4) \ + (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4)) #endif // GCC < 7.2 diff --git a/include/msvc/lib_memzero0.h b/include/msvc/lib_memzero0.h new file mode 100644 index 00000000..506dd50f --- /dev/null +++ b/include/msvc/lib_memzero0.h @@ -0,0 +1,5 @@ +#include + +void Lib_Memzero0_memzero0(void *dst, uint64_t len); + +#define Lib_Memzero0_memzero(dst, len, t) Lib_Memzero0_memzero0(dst, len * sizeof(t)) diff --git a/info.txt b/info.txt index ac05510e..1a29e888 100644 --- a/info.txt +++ b/info.txt @@ -1,5 +1,5 @@ The code was generated with the following toolchain. -F* version: e617752a1b014a16892f7d8772d62e5c234f06c1 -KaRaMeL version: 2cf2974007f4103dba5619e4eb9e3eaeefad533b -HACL* version: 86a0aed822bd80b03e4810e23518181f0edec5f6 +F* version: 155853a14336aa0713dba7db5408f4c8ab512a06 +KaRaMeL version: db63c1de17565be0ec4989f58532717a04e3ff40 +HACL* version: ad60c9d98c9ce8f6a4fa13090511fa4b3a2c137b Vale version: 0.3.19 diff --git a/karamel/include/krml/internal/target.h b/karamel/include/krml/internal/target.h index 9eb260c6..634c20fc 100644 --- a/karamel/include/krml/internal/target.h +++ b/karamel/include/krml/internal/target.h @@ -4,13 +4,13 @@ #ifndef __KRML_TARGET_H #define __KRML_TARGET_H -#include -#include -#include -#include +#include #include #include -#include +#include +#include +#include +#include /* Since KaRaMeL emits the inline keyword unconditionally, we follow the * guidelines at https://gcc.gnu.org/onlinedocs/gcc/Inline.html and make this @@ -57,6 +57,19 @@ # define KRML_HOST_IGNORE(x) (void)(x) #endif +#ifndef KRML_NOINLINE +# if defined(_MSC_VER) +# define KRML_NOINLINE __declspec(noinline) +# elif defined (__GNUC__) +# define KRML_NOINLINE __attribute__((noinline,unused)) +# else +# define KRML_NOINLINE +# warning "The KRML_NOINLINE macro is not defined for this toolchain!" +# warning "The compiler may defeat side-channel resistance with optimizations." +# warning "Please locate target.h and try to fill it out with a suitable definition for this compiler." +# endif +#endif + #ifndef KRML_PRE_ALIGN # ifdef _MSC_VER # define KRML_PRE_ALIGN(X) __declspec(align(X)) @@ -80,7 +93,9 @@ # ifdef __MINGW32__ # include <_mingw.h> # endif -# if (defined(_MSC_VER) || (defined(__MINGW32__) && defined(__MINGW64_VERSION_MAJOR))) +# if ( \ + defined(_MSC_VER) || \ + (defined(__MINGW32__) && defined(__MINGW64_VERSION_MAJOR))) # define KRML_ALIGNED_MALLOC(X, Y) _aligned_malloc(Y, X) # else # define KRML_ALIGNED_MALLOC(X, Y) aligned_alloc(X, Y) @@ -95,7 +110,9 @@ # ifdef __MINGW32__ # include <_mingw.h> # endif -# if (defined(_MSC_VER) || (defined(__MINGW32__) && defined(__MINGW64_VERSION_MAJOR))) +# if ( \ + defined(_MSC_VER) || \ + (defined(__MINGW32__) && defined(__MINGW64_VERSION_MAJOR))) # define KRML_ALIGNED_FREE(X) _aligned_free(X) # else # define KRML_ALIGNED_FREE(X) free(X) @@ -151,14 +168,15 @@ inline static int32_t krml_time(void) { } while (0) #if defined(_MSC_VER) && _MSC_VER < 1900 -# define KRML_HOST_SNPRINTF(buf, sz, fmt, arg) _snprintf_s(buf, sz, _TRUNCATE, fmt, arg) +# define KRML_HOST_SNPRINTF(buf, sz, fmt, arg) \ + _snprintf_s(buf, sz, _TRUNCATE, fmt, arg) #else # define KRML_HOST_SNPRINTF(buf, sz, fmt, arg) snprintf(buf, sz, fmt, arg) #endif #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)) # define KRML_DEPRECATED(x) __attribute__((deprecated(x))) -#elif defined(__GNUC__) +#elif defined(__GNUC__) /* deprecated attribute is not defined in GCC < 4.5. */ # define KRML_DEPRECATED(x) #elif defined(_MSC_VER) @@ -169,184 +187,186 @@ inline static int32_t krml_time(void) { #define KRML_LOOP1(i, n, x) { \ x \ i += n; \ + (void) i; \ } -#define KRML_LOOP2(i, n, x) \ - KRML_LOOP1(i, n, x) \ +#define KRML_LOOP2(i, n, x) \ + KRML_LOOP1(i, n, x) \ KRML_LOOP1(i, n, x) -#define KRML_LOOP3(i, n, x) \ - KRML_LOOP2(i, n, x) \ +#define KRML_LOOP3(i, n, x) \ + KRML_LOOP2(i, n, x) \ KRML_LOOP1(i, n, x) -#define KRML_LOOP4(i, n, x) \ - KRML_LOOP2(i, n, x) \ +#define KRML_LOOP4(i, n, x) \ + KRML_LOOP2(i, n, x) \ KRML_LOOP2(i, n, x) -#define KRML_LOOP5(i, n, x) \ - KRML_LOOP4(i, n, x) \ +#define KRML_LOOP5(i, n, x) \ + KRML_LOOP4(i, n, x) \ KRML_LOOP1(i, n, x) -#define KRML_LOOP6(i, n, x) \ - KRML_LOOP4(i, n, x) \ +#define KRML_LOOP6(i, n, x) \ + KRML_LOOP4(i, n, x) \ KRML_LOOP2(i, n, x) -#define KRML_LOOP7(i, n, x) \ - KRML_LOOP4(i, n, x) \ +#define KRML_LOOP7(i, n, x) \ + KRML_LOOP4(i, n, x) \ KRML_LOOP3(i, n, x) -#define KRML_LOOP8(i, n, x) \ - KRML_LOOP4(i, n, x) \ +#define KRML_LOOP8(i, n, x) \ + KRML_LOOP4(i, n, x) \ KRML_LOOP4(i, n, x) -#define KRML_LOOP9(i, n, x) \ - KRML_LOOP8(i, n, x) \ +#define KRML_LOOP9(i, n, x) \ + KRML_LOOP8(i, n, x) \ KRML_LOOP1(i, n, x) -#define KRML_LOOP10(i, n, x) \ - KRML_LOOP8(i, n, x) \ +#define KRML_LOOP10(i, n, x) \ + KRML_LOOP8(i, n, x) \ KRML_LOOP2(i, n, x) -#define KRML_LOOP11(i, n, x) \ - KRML_LOOP8(i, n, x) \ +#define KRML_LOOP11(i, n, x) \ + KRML_LOOP8(i, n, x) \ KRML_LOOP3(i, n, x) -#define KRML_LOOP12(i, n, x) \ - KRML_LOOP8(i, n, x) \ +#define KRML_LOOP12(i, n, x) \ + KRML_LOOP8(i, n, x) \ KRML_LOOP4(i, n, x) -#define KRML_LOOP13(i, n, x) \ - KRML_LOOP8(i, n, x) \ +#define KRML_LOOP13(i, n, x) \ + KRML_LOOP8(i, n, x) \ KRML_LOOP5(i, n, x) -#define KRML_LOOP14(i, n, x) \ - KRML_LOOP8(i, n, x) \ +#define KRML_LOOP14(i, n, x) \ + KRML_LOOP8(i, n, x) \ KRML_LOOP6(i, n, x) -#define KRML_LOOP15(i, n, x) \ - KRML_LOOP8(i, n, x) \ +#define KRML_LOOP15(i, n, x) \ + KRML_LOOP8(i, n, x) \ KRML_LOOP7(i, n, x) -#define KRML_LOOP16(i, n, x) \ - KRML_LOOP8(i, n, x) \ +#define KRML_LOOP16(i, n, x) \ + KRML_LOOP8(i, n, x) \ KRML_LOOP8(i, n, x) -#define KRML_UNROLL_FOR(i, z, n, k, x) do { \ - uint32_t i = z; \ - KRML_LOOP##n(i, k, x) \ -} while (0) +#define KRML_UNROLL_FOR(i, z, n, k, x) \ + do { \ + uint32_t i = z; \ + KRML_LOOP##n(i, k, x) \ + } while (0) -#define KRML_ACTUAL_FOR(i, z, n, k, x) \ - do { \ - for (uint32_t i = z; i < n; i += k) { \ - x \ - } \ +#define KRML_ACTUAL_FOR(i, z, n, k, x) \ + do { \ + for (uint32_t i = z; i < n; i += k) { \ + x \ + } \ } while (0) #ifndef KRML_UNROLL_MAX -#define KRML_UNROLL_MAX 16 +# define KRML_UNROLL_MAX 16 #endif /* 1 is the number of loop iterations, i.e. (n - z)/k as evaluated by krml */ #if 0 <= KRML_UNROLL_MAX -#define KRML_MAYBE_FOR0(i, z, n, k, x) +# define KRML_MAYBE_FOR0(i, z, n, k, x) #else -#define KRML_MAYBE_FOR0(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) +# define KRML_MAYBE_FOR0(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) #endif #if 1 <= KRML_UNROLL_MAX -#define KRML_MAYBE_FOR1(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 1, k, x) +# define KRML_MAYBE_FOR1(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 1, k, x) #else -#define KRML_MAYBE_FOR1(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) +# define KRML_MAYBE_FOR1(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) #endif #if 2 <= KRML_UNROLL_MAX -#define KRML_MAYBE_FOR2(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 2, k, x) +# define KRML_MAYBE_FOR2(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 2, k, x) #else -#define KRML_MAYBE_FOR2(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) +# define KRML_MAYBE_FOR2(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) #endif #if 3 <= KRML_UNROLL_MAX -#define KRML_MAYBE_FOR3(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 3, k, x) +# define KRML_MAYBE_FOR3(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 3, k, x) #else -#define KRML_MAYBE_FOR3(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) +# define KRML_MAYBE_FOR3(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) #endif #if 4 <= KRML_UNROLL_MAX -#define KRML_MAYBE_FOR4(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 4, k, x) +# define KRML_MAYBE_FOR4(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 4, k, x) #else -#define KRML_MAYBE_FOR4(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) +# define KRML_MAYBE_FOR4(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) #endif #if 5 <= KRML_UNROLL_MAX -#define KRML_MAYBE_FOR5(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 5, k, x) +# define KRML_MAYBE_FOR5(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 5, k, x) #else -#define KRML_MAYBE_FOR5(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) +# define KRML_MAYBE_FOR5(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) #endif #if 6 <= KRML_UNROLL_MAX -#define KRML_MAYBE_FOR6(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 6, k, x) +# define KRML_MAYBE_FOR6(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 6, k, x) #else -#define KRML_MAYBE_FOR6(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) +# define KRML_MAYBE_FOR6(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) #endif #if 7 <= KRML_UNROLL_MAX -#define KRML_MAYBE_FOR7(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 7, k, x) +# define KRML_MAYBE_FOR7(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 7, k, x) #else -#define KRML_MAYBE_FOR7(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) +# define KRML_MAYBE_FOR7(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) #endif #if 8 <= KRML_UNROLL_MAX -#define KRML_MAYBE_FOR8(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 8, k, x) +# define KRML_MAYBE_FOR8(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 8, k, x) #else -#define KRML_MAYBE_FOR8(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) +# define KRML_MAYBE_FOR8(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) #endif #if 9 <= KRML_UNROLL_MAX -#define KRML_MAYBE_FOR9(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 9, k, x) +# define KRML_MAYBE_FOR9(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 9, k, x) #else -#define KRML_MAYBE_FOR9(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) +# define KRML_MAYBE_FOR9(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) #endif #if 10 <= KRML_UNROLL_MAX -#define KRML_MAYBE_FOR10(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 10, k, x) +# define KRML_MAYBE_FOR10(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 10, k, x) #else -#define KRML_MAYBE_FOR10(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) +# define KRML_MAYBE_FOR10(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) #endif #if 11 <= KRML_UNROLL_MAX -#define KRML_MAYBE_FOR11(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 11, k, x) +# define KRML_MAYBE_FOR11(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 11, k, x) #else -#define KRML_MAYBE_FOR11(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) +# define KRML_MAYBE_FOR11(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) #endif #if 12 <= KRML_UNROLL_MAX -#define KRML_MAYBE_FOR12(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 12, k, x) +# define KRML_MAYBE_FOR12(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 12, k, x) #else -#define KRML_MAYBE_FOR12(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) +# define KRML_MAYBE_FOR12(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) #endif #if 13 <= KRML_UNROLL_MAX -#define KRML_MAYBE_FOR13(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 13, k, x) +# define KRML_MAYBE_FOR13(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 13, k, x) #else -#define KRML_MAYBE_FOR13(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) +# define KRML_MAYBE_FOR13(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) #endif #if 14 <= KRML_UNROLL_MAX -#define KRML_MAYBE_FOR14(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 14, k, x) +# define KRML_MAYBE_FOR14(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 14, k, x) #else -#define KRML_MAYBE_FOR14(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) +# define KRML_MAYBE_FOR14(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) #endif #if 15 <= KRML_UNROLL_MAX -#define KRML_MAYBE_FOR15(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 15, k, x) +# define KRML_MAYBE_FOR15(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 15, k, x) #else -#define KRML_MAYBE_FOR15(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) +# define KRML_MAYBE_FOR15(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) #endif #if 16 <= KRML_UNROLL_MAX -#define KRML_MAYBE_FOR16(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 16, k, x) +# define KRML_MAYBE_FOR16(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 16, k, x) #else -#define KRML_MAYBE_FOR16(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) +# define KRML_MAYBE_FOR16(i, z, n, k, x) KRML_ACTUAL_FOR(i, z, n, k, x) #endif #endif diff --git a/karamel/krmllib/dist/minimal/FStar_UInt_8_16_32_64.h b/karamel/krmllib/dist/minimal/FStar_UInt_8_16_32_64.h index b0503a96..84356c61 100644 --- a/karamel/krmllib/dist/minimal/FStar_UInt_8_16_32_64.h +++ b/karamel/krmllib/dist/minimal/FStar_UInt_8_16_32_64.h @@ -14,15 +14,15 @@ #include "krml/internal/types.h" #include "krml/internal/target.h" -extern Prims_int FStar_UInt64_n; +extern krml_checked_int_t FStar_UInt64_n; extern bool FStar_UInt64_uu___is_Mk(uint64_t projectee); -extern Prims_int FStar_UInt64___proj__Mk__item__v(uint64_t projectee); +extern krml_checked_int_t FStar_UInt64___proj__Mk__item__v(uint64_t projectee); -extern Prims_int FStar_UInt64_v(uint64_t x); +extern krml_checked_int_t FStar_UInt64_v(uint64_t x); -extern uint64_t FStar_UInt64_uint_to_t(Prims_int x); +extern uint64_t FStar_UInt64_uint_to_t(krml_checked_int_t x); extern uint64_t FStar_UInt64_zero; @@ -32,7 +32,7 @@ extern uint64_t FStar_UInt64_minus(uint64_t a); extern uint32_t FStar_UInt64_n_minus_one; -static inline uint64_t FStar_UInt64_eq_mask(uint64_t a, uint64_t b) +static KRML_NOINLINE uint64_t FStar_UInt64_eq_mask(uint64_t a, uint64_t b) { uint64_t x = a ^ b; uint64_t minus_x = ~x + (uint64_t)1U; @@ -41,7 +41,7 @@ static inline uint64_t FStar_UInt64_eq_mask(uint64_t a, uint64_t b) return xnx - (uint64_t)1U; } -static inline uint64_t FStar_UInt64_gte_mask(uint64_t a, uint64_t b) +static KRML_NOINLINE uint64_t FStar_UInt64_gte_mask(uint64_t a, uint64_t b) { uint64_t x = a; uint64_t y = b; @@ -62,15 +62,15 @@ extern Prims_string FStar_UInt64_to_string_hex_pad(uint64_t uu___); extern uint64_t FStar_UInt64_of_string(Prims_string uu___); -extern Prims_int FStar_UInt32_n; +extern krml_checked_int_t FStar_UInt32_n; extern bool FStar_UInt32_uu___is_Mk(uint32_t projectee); -extern Prims_int FStar_UInt32___proj__Mk__item__v(uint32_t projectee); +extern krml_checked_int_t FStar_UInt32___proj__Mk__item__v(uint32_t projectee); -extern Prims_int FStar_UInt32_v(uint32_t x); +extern krml_checked_int_t FStar_UInt32_v(uint32_t x); -extern uint32_t FStar_UInt32_uint_to_t(Prims_int x); +extern uint32_t FStar_UInt32_uint_to_t(krml_checked_int_t x); extern uint32_t FStar_UInt32_zero; @@ -80,7 +80,7 @@ extern uint32_t FStar_UInt32_minus(uint32_t a); extern uint32_t FStar_UInt32_n_minus_one; -static inline uint32_t FStar_UInt32_eq_mask(uint32_t a, uint32_t b) +static KRML_NOINLINE uint32_t FStar_UInt32_eq_mask(uint32_t a, uint32_t b) { uint32_t x = a ^ b; uint32_t minus_x = ~x + (uint32_t)1U; @@ -89,7 +89,7 @@ static inline uint32_t FStar_UInt32_eq_mask(uint32_t a, uint32_t b) return xnx - (uint32_t)1U; } -static inline uint32_t FStar_UInt32_gte_mask(uint32_t a, uint32_t b) +static KRML_NOINLINE uint32_t FStar_UInt32_gte_mask(uint32_t a, uint32_t b) { uint32_t x = a; uint32_t y = b; @@ -110,15 +110,15 @@ extern Prims_string FStar_UInt32_to_string_hex_pad(uint32_t uu___); extern uint32_t FStar_UInt32_of_string(Prims_string uu___); -extern Prims_int FStar_UInt16_n; +extern krml_checked_int_t FStar_UInt16_n; extern bool FStar_UInt16_uu___is_Mk(uint16_t projectee); -extern Prims_int FStar_UInt16___proj__Mk__item__v(uint16_t projectee); +extern krml_checked_int_t FStar_UInt16___proj__Mk__item__v(uint16_t projectee); -extern Prims_int FStar_UInt16_v(uint16_t x); +extern krml_checked_int_t FStar_UInt16_v(uint16_t x); -extern uint16_t FStar_UInt16_uint_to_t(Prims_int x); +extern uint16_t FStar_UInt16_uint_to_t(krml_checked_int_t x); extern uint16_t FStar_UInt16_zero; @@ -128,7 +128,7 @@ extern uint16_t FStar_UInt16_minus(uint16_t a); extern uint32_t FStar_UInt16_n_minus_one; -static inline uint16_t FStar_UInt16_eq_mask(uint16_t a, uint16_t b) +static KRML_NOINLINE uint16_t FStar_UInt16_eq_mask(uint16_t a, uint16_t b) { uint16_t x = a ^ b; uint16_t minus_x = ~x + (uint16_t)1U; @@ -137,7 +137,7 @@ static inline uint16_t FStar_UInt16_eq_mask(uint16_t a, uint16_t b) return xnx - (uint16_t)1U; } -static inline uint16_t FStar_UInt16_gte_mask(uint16_t a, uint16_t b) +static KRML_NOINLINE uint16_t FStar_UInt16_gte_mask(uint16_t a, uint16_t b) { uint16_t x = a; uint16_t y = b; @@ -158,15 +158,15 @@ extern Prims_string FStar_UInt16_to_string_hex_pad(uint16_t uu___); extern uint16_t FStar_UInt16_of_string(Prims_string uu___); -extern Prims_int FStar_UInt8_n; +extern krml_checked_int_t FStar_UInt8_n; extern bool FStar_UInt8_uu___is_Mk(uint8_t projectee); -extern Prims_int FStar_UInt8___proj__Mk__item__v(uint8_t projectee); +extern krml_checked_int_t FStar_UInt8___proj__Mk__item__v(uint8_t projectee); -extern Prims_int FStar_UInt8_v(uint8_t x); +extern krml_checked_int_t FStar_UInt8_v(uint8_t x); -extern uint8_t FStar_UInt8_uint_to_t(Prims_int x); +extern uint8_t FStar_UInt8_uint_to_t(krml_checked_int_t x); extern uint8_t FStar_UInt8_zero; @@ -176,7 +176,7 @@ extern uint8_t FStar_UInt8_minus(uint8_t a); extern uint32_t FStar_UInt8_n_minus_one; -static inline uint8_t FStar_UInt8_eq_mask(uint8_t a, uint8_t b) +static KRML_NOINLINE uint8_t FStar_UInt8_eq_mask(uint8_t a, uint8_t b) { uint8_t x = a ^ b; uint8_t minus_x = ~x + (uint8_t)1U; @@ -185,7 +185,7 @@ static inline uint8_t FStar_UInt8_eq_mask(uint8_t a, uint8_t b) return xnx - (uint8_t)1U; } -static inline uint8_t FStar_UInt8_gte_mask(uint8_t a, uint8_t b) +static KRML_NOINLINE uint8_t FStar_UInt8_gte_mask(uint8_t a, uint8_t b) { uint8_t x = a; uint8_t y = b; diff --git a/ocaml/ctypes.depend b/ocaml/ctypes.depend index 31393b5e..86af86df 100644 --- a/ocaml/ctypes.depend +++ b/ocaml/ctypes.depend @@ -1,4 +1,4 @@ -CTYPES_DEPS=lib/Hacl_Streaming_Types_stubs.cmx lib/Hacl_Streaming_Types_bindings.cmx lib/Hacl_Spec_stubs.cmx lib/Hacl_Spec_bindings.cmx lib/Hacl_Hash_Blake2_stubs.cmx lib/Hacl_Hash_Blake2_bindings.cmx lib/Hacl_Hash_Blake2b_256_stubs.cmx lib/Hacl_Hash_Blake2b_256_bindings.cmx lib/Hacl_Hash_Blake2s_128_stubs.cmx lib/Hacl_Hash_Blake2s_128_bindings.cmx lib/Hacl_Hash_SHA3_stubs.cmx lib/Hacl_Hash_SHA3_bindings.cmx lib/Hacl_Hash_Base_stubs.cmx lib/Hacl_Hash_Base_bindings.cmx lib/Hacl_Hash_MD5_stubs.cmx lib/Hacl_Hash_MD5_bindings.cmx lib/Hacl_Hash_SHA1_stubs.cmx lib/Hacl_Hash_SHA1_bindings.cmx lib/Hacl_SHA2_Types_stubs.cmx lib/Hacl_SHA2_Types_bindings.cmx lib/Hacl_Hash_SHA2_stubs.cmx lib/Hacl_Hash_SHA2_bindings.cmx lib/EverCrypt_Error_stubs.cmx lib/EverCrypt_Error_bindings.cmx lib/EverCrypt_AutoConfig2_stubs.cmx lib/EverCrypt_AutoConfig2_bindings.cmx lib/EverCrypt_Hash_stubs.cmx lib/EverCrypt_Hash_bindings.cmx lib/Hacl_Chacha20_stubs.cmx lib/Hacl_Chacha20_bindings.cmx lib/Hacl_Salsa20_stubs.cmx lib/Hacl_Salsa20_bindings.cmx lib/Hacl_Bignum_Base_stubs.cmx lib/Hacl_Bignum_Base_bindings.cmx lib/Hacl_Bignum_stubs.cmx lib/Hacl_Bignum_bindings.cmx lib/Hacl_Curve25519_64_stubs.cmx lib/Hacl_Curve25519_64_bindings.cmx lib/Hacl_Bignum25519_51_stubs.cmx lib/Hacl_Bignum25519_51_bindings.cmx lib/Hacl_Curve25519_51_stubs.cmx lib/Hacl_Curve25519_51_bindings.cmx lib/Hacl_Ed25519_stubs.cmx lib/Hacl_Ed25519_bindings.cmx lib/Hacl_Poly1305_32_stubs.cmx lib/Hacl_Poly1305_32_bindings.cmx lib/Hacl_Poly1305_128_stubs.cmx lib/Hacl_Poly1305_128_bindings.cmx lib/Hacl_Poly1305_256_stubs.cmx lib/Hacl_Poly1305_256_bindings.cmx lib/Hacl_NaCl_stubs.cmx lib/Hacl_NaCl_bindings.cmx lib/Hacl_P256_stubs.cmx lib/Hacl_P256_bindings.cmx lib/Hacl_Bignum_K256_stubs.cmx lib/Hacl_Bignum_K256_bindings.cmx lib/Hacl_K256_ECDSA_stubs.cmx lib/Hacl_K256_ECDSA_bindings.cmx lib/Hacl_Frodo_KEM_stubs.cmx lib/Hacl_Frodo_KEM_bindings.cmx lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_stubs.cmx lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_bindings.cmx lib/Hacl_IntTypes_Intrinsics_stubs.cmx lib/Hacl_IntTypes_Intrinsics_bindings.cmx lib/Hacl_IntTypes_Intrinsics_128_stubs.cmx lib/Hacl_IntTypes_Intrinsics_128_bindings.cmx lib/Hacl_RSAPSS_stubs.cmx lib/Hacl_RSAPSS_bindings.cmx lib/Hacl_FFDHE_stubs.cmx lib/Hacl_FFDHE_bindings.cmx lib/Hacl_Frodo640_stubs.cmx lib/Hacl_Frodo640_bindings.cmx lib/Hacl_Chacha20_Vec128_stubs.cmx lib/Hacl_Chacha20_Vec128_bindings.cmx lib/Hacl_Chacha20Poly1305_128_stubs.cmx lib/Hacl_Chacha20Poly1305_128_bindings.cmx lib/Hacl_HMAC_stubs.cmx lib/Hacl_HMAC_bindings.cmx lib/Hacl_HKDF_stubs.cmx lib/Hacl_HKDF_bindings.cmx lib/Hacl_HPKE_Curve51_CP128_SHA512_stubs.cmx lib/Hacl_HPKE_Curve51_CP128_SHA512_bindings.cmx lib/EverCrypt_Cipher_stubs.cmx lib/EverCrypt_Cipher_bindings.cmx lib/Hacl_GenericField32_stubs.cmx lib/Hacl_GenericField32_bindings.cmx lib/Hacl_SHA2_Vec256_stubs.cmx lib/Hacl_SHA2_Vec256_bindings.cmx lib/Hacl_EC_K256_stubs.cmx lib/Hacl_EC_K256_bindings.cmx lib/Hacl_Bignum4096_stubs.cmx lib/Hacl_Bignum4096_bindings.cmx lib/Hacl_Chacha20_Vec32_stubs.cmx lib/Hacl_Chacha20_Vec32_bindings.cmx lib/EverCrypt_Ed25519_stubs.cmx lib/EverCrypt_Ed25519_bindings.cmx lib/Hacl_Bignum4096_32_stubs.cmx lib/Hacl_Bignum4096_32_bindings.cmx lib/EverCrypt_HMAC_stubs.cmx lib/EverCrypt_HMAC_bindings.cmx lib/Hacl_HMAC_DRBG_stubs.cmx lib/Hacl_HMAC_DRBG_bindings.cmx lib/EverCrypt_DRBG_stubs.cmx lib/EverCrypt_DRBG_bindings.cmx lib/Hacl_HPKE_Curve64_CP128_SHA512_stubs.cmx lib/Hacl_HPKE_Curve64_CP128_SHA512_bindings.cmx lib/Hacl_HPKE_P256_CP128_SHA256_stubs.cmx lib/Hacl_HPKE_P256_CP128_SHA256_bindings.cmx lib/EverCrypt_Curve25519_stubs.cmx lib/EverCrypt_Curve25519_bindings.cmx lib/Hacl_Chacha20_Vec256_stubs.cmx lib/Hacl_Chacha20_Vec256_bindings.cmx lib/Hacl_Chacha20Poly1305_256_stubs.cmx lib/Hacl_Chacha20Poly1305_256_bindings.cmx lib/Hacl_HPKE_Curve51_CP256_SHA512_stubs.cmx lib/Hacl_HPKE_Curve51_CP256_SHA512_bindings.cmx lib/Hacl_Frodo976_stubs.cmx lib/Hacl_Frodo976_bindings.cmx lib/Hacl_HMAC_Blake2s_128_stubs.cmx lib/Hacl_HMAC_Blake2s_128_bindings.cmx lib/Hacl_HKDF_Blake2s_128_stubs.cmx lib/Hacl_HKDF_Blake2s_128_bindings.cmx lib/Hacl_GenericField64_stubs.cmx lib/Hacl_GenericField64_bindings.cmx lib/Hacl_Frodo1344_stubs.cmx lib/Hacl_Frodo1344_bindings.cmx lib/Hacl_HPKE_Curve64_CP256_SHA512_stubs.cmx lib/Hacl_HPKE_Curve64_CP256_SHA512_bindings.cmx lib/Hacl_Bignum32_stubs.cmx lib/Hacl_Bignum32_bindings.cmx lib/Hacl_HPKE_Curve51_CP128_SHA256_stubs.cmx lib/Hacl_HPKE_Curve51_CP128_SHA256_bindings.cmx lib/Hacl_HPKE_Curve64_CP128_SHA256_stubs.cmx lib/Hacl_HPKE_Curve64_CP128_SHA256_bindings.cmx lib/Hacl_Bignum256_32_stubs.cmx lib/Hacl_Bignum256_32_bindings.cmx lib/Hacl_SHA2_Vec128_stubs.cmx lib/Hacl_SHA2_Vec128_bindings.cmx lib/Hacl_Chacha20Poly1305_32_stubs.cmx lib/Hacl_Chacha20Poly1305_32_bindings.cmx lib/Hacl_HPKE_Curve51_CP32_SHA256_stubs.cmx lib/Hacl_HPKE_Curve51_CP32_SHA256_bindings.cmx lib/Hacl_HPKE_Curve64_CP256_SHA256_stubs.cmx lib/Hacl_HPKE_Curve64_CP256_SHA256_bindings.cmx lib/EverCrypt_Poly1305_stubs.cmx lib/EverCrypt_Poly1305_bindings.cmx lib/Hacl_Streaming_Poly1305_32_stubs.cmx lib/Hacl_Streaming_Poly1305_32_bindings.cmx lib/Hacl_HPKE_Curve51_CP32_SHA512_stubs.cmx lib/Hacl_HPKE_Curve51_CP32_SHA512_bindings.cmx lib/Hacl_Streaming_Blake2_stubs.cmx lib/Hacl_Streaming_Blake2_bindings.cmx lib/Hacl_HPKE_P256_CP256_SHA256_stubs.cmx lib/Hacl_HPKE_P256_CP256_SHA256_bindings.cmx lib/Hacl_HPKE_P256_CP32_SHA256_stubs.cmx lib/Hacl_HPKE_P256_CP32_SHA256_bindings.cmx lib/Hacl_Bignum64_stubs.cmx lib/Hacl_Bignum64_bindings.cmx lib/Hacl_Frodo64_stubs.cmx lib/Hacl_Frodo64_bindings.cmx lib/Hacl_HMAC_Blake2b_256_stubs.cmx lib/Hacl_HMAC_Blake2b_256_bindings.cmx lib/Hacl_HKDF_Blake2b_256_stubs.cmx lib/Hacl_HKDF_Blake2b_256_bindings.cmx lib/Hacl_HPKE_Curve64_CP32_SHA256_stubs.cmx lib/Hacl_HPKE_Curve64_CP32_SHA256_bindings.cmx lib/Hacl_HPKE_Curve64_CP32_SHA512_stubs.cmx lib/Hacl_HPKE_Curve64_CP32_SHA512_bindings.cmx lib/EverCrypt_HKDF_stubs.cmx lib/EverCrypt_HKDF_bindings.cmx lib/Hacl_EC_Ed25519_stubs.cmx lib/Hacl_EC_Ed25519_bindings.cmx lib/Hacl_HPKE_Curve51_CP256_SHA256_stubs.cmx lib/Hacl_HPKE_Curve51_CP256_SHA256_bindings.cmx lib/EverCrypt_Chacha20Poly1305_stubs.cmx lib/EverCrypt_Chacha20Poly1305_bindings.cmx lib/EverCrypt_AEAD_stubs.cmx lib/EverCrypt_AEAD_bindings.cmx lib/Hacl_Bignum256_stubs.cmx lib/Hacl_Bignum256_bindings.cmx +CTYPES_DEPS=lib/Hacl_Streaming_Types_stubs.cmx lib/Hacl_Streaming_Types_bindings.cmx lib/Hacl_Spec_stubs.cmx lib/Hacl_Spec_bindings.cmx lib/Hacl_Hash_Blake2_stubs.cmx lib/Hacl_Hash_Blake2_bindings.cmx lib/Hacl_Hash_Blake2b_256_stubs.cmx lib/Hacl_Hash_Blake2b_256_bindings.cmx lib/Hacl_Hash_Blake2s_128_stubs.cmx lib/Hacl_Hash_Blake2s_128_bindings.cmx lib/Hacl_Hash_SHA3_stubs.cmx lib/Hacl_Hash_SHA3_bindings.cmx lib/Hacl_Hash_Base_stubs.cmx lib/Hacl_Hash_Base_bindings.cmx lib/Hacl_Hash_MD5_stubs.cmx lib/Hacl_Hash_MD5_bindings.cmx lib/Hacl_Hash_SHA1_stubs.cmx lib/Hacl_Hash_SHA1_bindings.cmx lib/Hacl_SHA2_Types_stubs.cmx lib/Hacl_SHA2_Types_bindings.cmx lib/Hacl_Hash_SHA2_stubs.cmx lib/Hacl_Hash_SHA2_bindings.cmx lib/EverCrypt_Error_stubs.cmx lib/EverCrypt_Error_bindings.cmx lib/EverCrypt_AutoConfig2_stubs.cmx lib/EverCrypt_AutoConfig2_bindings.cmx lib/EverCrypt_Hash_stubs.cmx lib/EverCrypt_Hash_bindings.cmx lib/Hacl_Chacha20_stubs.cmx lib/Hacl_Chacha20_bindings.cmx lib/Hacl_Salsa20_stubs.cmx lib/Hacl_Salsa20_bindings.cmx lib/Hacl_Bignum_Base_stubs.cmx lib/Hacl_Bignum_Base_bindings.cmx lib/Hacl_Bignum_stubs.cmx lib/Hacl_Bignum_bindings.cmx lib/Hacl_Curve25519_64_stubs.cmx lib/Hacl_Curve25519_64_bindings.cmx lib/Hacl_Bignum25519_51_stubs.cmx lib/Hacl_Bignum25519_51_bindings.cmx lib/Hacl_Curve25519_51_stubs.cmx lib/Hacl_Curve25519_51_bindings.cmx lib/Hacl_Ed25519_stubs.cmx lib/Hacl_Ed25519_bindings.cmx lib/Hacl_Poly1305_32_stubs.cmx lib/Hacl_Poly1305_32_bindings.cmx lib/Hacl_Poly1305_128_stubs.cmx lib/Hacl_Poly1305_128_bindings.cmx lib/Hacl_Poly1305_256_stubs.cmx lib/Hacl_Poly1305_256_bindings.cmx lib/Hacl_NaCl_stubs.cmx lib/Hacl_NaCl_bindings.cmx lib/Hacl_P256_stubs.cmx lib/Hacl_P256_bindings.cmx lib/Hacl_Bignum_K256_stubs.cmx lib/Hacl_Bignum_K256_bindings.cmx lib/Hacl_K256_ECDSA_stubs.cmx lib/Hacl_K256_ECDSA_bindings.cmx lib/Hacl_Frodo_KEM_stubs.cmx lib/Hacl_Frodo_KEM_bindings.cmx lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_stubs.cmx lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_bindings.cmx lib/Hacl_IntTypes_Intrinsics_stubs.cmx lib/Hacl_IntTypes_Intrinsics_bindings.cmx lib/Hacl_IntTypes_Intrinsics_128_stubs.cmx lib/Hacl_IntTypes_Intrinsics_128_bindings.cmx lib/Hacl_RSAPSS_stubs.cmx lib/Hacl_RSAPSS_bindings.cmx lib/Hacl_FFDHE_stubs.cmx lib/Hacl_FFDHE_bindings.cmx lib/Hacl_Frodo640_stubs.cmx lib/Hacl_Frodo640_bindings.cmx lib/Hacl_Chacha20_Vec128_stubs.cmx lib/Hacl_Chacha20_Vec128_bindings.cmx lib/Hacl_Chacha20Poly1305_128_stubs.cmx lib/Hacl_Chacha20Poly1305_128_bindings.cmx lib/Hacl_HMAC_stubs.cmx lib/Hacl_HMAC_bindings.cmx lib/Hacl_HKDF_stubs.cmx lib/Hacl_HKDF_bindings.cmx lib/Hacl_HPKE_Curve51_CP128_SHA512_stubs.cmx lib/Hacl_HPKE_Curve51_CP128_SHA512_bindings.cmx lib/EverCrypt_Cipher_stubs.cmx lib/EverCrypt_Cipher_bindings.cmx lib/Hacl_GenericField32_stubs.cmx lib/Hacl_GenericField32_bindings.cmx lib/Hacl_SHA2_Vec256_stubs.cmx lib/Hacl_SHA2_Vec256_bindings.cmx lib/Hacl_EC_K256_stubs.cmx lib/Hacl_EC_K256_bindings.cmx lib/Hacl_Bignum4096_stubs.cmx lib/Hacl_Bignum4096_bindings.cmx lib/Hacl_Chacha20_Vec32_stubs.cmx lib/Hacl_Chacha20_Vec32_bindings.cmx lib/EverCrypt_Ed25519_stubs.cmx lib/EverCrypt_Ed25519_bindings.cmx lib/Hacl_Bignum4096_32_stubs.cmx lib/Hacl_Bignum4096_32_bindings.cmx lib/EverCrypt_HMAC_stubs.cmx lib/EverCrypt_HMAC_bindings.cmx lib/Hacl_HMAC_DRBG_stubs.cmx lib/Hacl_HMAC_DRBG_bindings.cmx lib/EverCrypt_DRBG_stubs.cmx lib/EverCrypt_DRBG_bindings.cmx lib/Hacl_HPKE_Curve64_CP128_SHA512_stubs.cmx lib/Hacl_HPKE_Curve64_CP128_SHA512_bindings.cmx lib/Hacl_HPKE_P256_CP128_SHA256_stubs.cmx lib/Hacl_HPKE_P256_CP128_SHA256_bindings.cmx lib/EverCrypt_Curve25519_stubs.cmx lib/EverCrypt_Curve25519_bindings.cmx lib/Hacl_Chacha20_Vec256_stubs.cmx lib/Hacl_Chacha20_Vec256_bindings.cmx lib/Hacl_Chacha20Poly1305_256_stubs.cmx lib/Hacl_Chacha20Poly1305_256_bindings.cmx lib/Hacl_HPKE_Curve51_CP256_SHA512_stubs.cmx lib/Hacl_HPKE_Curve51_CP256_SHA512_bindings.cmx lib/Hacl_Frodo976_stubs.cmx lib/Hacl_Frodo976_bindings.cmx lib/Hacl_HMAC_Blake2s_128_stubs.cmx lib/Hacl_HMAC_Blake2s_128_bindings.cmx lib/Hacl_HKDF_Blake2s_128_stubs.cmx lib/Hacl_HKDF_Blake2s_128_bindings.cmx lib/Hacl_GenericField64_stubs.cmx lib/Hacl_GenericField64_bindings.cmx lib/Hacl_Frodo1344_stubs.cmx lib/Hacl_Frodo1344_bindings.cmx lib/Hacl_HPKE_Curve64_CP256_SHA512_stubs.cmx lib/Hacl_HPKE_Curve64_CP256_SHA512_bindings.cmx lib/Hacl_Bignum32_stubs.cmx lib/Hacl_Bignum32_bindings.cmx lib/Hacl_HPKE_Curve51_CP128_SHA256_stubs.cmx lib/Hacl_HPKE_Curve51_CP128_SHA256_bindings.cmx lib/Hacl_HPKE_Curve64_CP128_SHA256_stubs.cmx lib/Hacl_HPKE_Curve64_CP128_SHA256_bindings.cmx lib/Hacl_Bignum256_32_stubs.cmx lib/Hacl_Bignum256_32_bindings.cmx lib/Hacl_SHA2_Vec128_stubs.cmx lib/Hacl_SHA2_Vec128_bindings.cmx lib/Hacl_Chacha20Poly1305_32_stubs.cmx lib/Hacl_Chacha20Poly1305_32_bindings.cmx lib/Hacl_HPKE_Curve51_CP32_SHA256_stubs.cmx lib/Hacl_HPKE_Curve51_CP32_SHA256_bindings.cmx lib/EverCrypt_Poly1305_stubs.cmx lib/EverCrypt_Poly1305_bindings.cmx lib/Hacl_HPKE_Curve64_CP256_SHA256_stubs.cmx lib/Hacl_HPKE_Curve64_CP256_SHA256_bindings.cmx lib/Hacl_Streaming_Poly1305_32_stubs.cmx lib/Hacl_Streaming_Poly1305_32_bindings.cmx lib/Hacl_HPKE_Curve51_CP32_SHA512_stubs.cmx lib/Hacl_HPKE_Curve51_CP32_SHA512_bindings.cmx lib/Hacl_Streaming_Blake2_stubs.cmx lib/Hacl_Streaming_Blake2_bindings.cmx lib/Hacl_HPKE_P256_CP256_SHA256_stubs.cmx lib/Hacl_HPKE_P256_CP256_SHA256_bindings.cmx lib/Hacl_HPKE_P256_CP32_SHA256_stubs.cmx lib/Hacl_HPKE_P256_CP32_SHA256_bindings.cmx lib/Hacl_Bignum64_stubs.cmx lib/Hacl_Bignum64_bindings.cmx lib/Hacl_Frodo64_stubs.cmx lib/Hacl_Frodo64_bindings.cmx lib/Hacl_HMAC_Blake2b_256_stubs.cmx lib/Hacl_HMAC_Blake2b_256_bindings.cmx lib/Hacl_HKDF_Blake2b_256_stubs.cmx lib/Hacl_HKDF_Blake2b_256_bindings.cmx lib/Hacl_HPKE_Curve64_CP32_SHA256_stubs.cmx lib/Hacl_HPKE_Curve64_CP32_SHA256_bindings.cmx lib/Hacl_HPKE_Curve64_CP32_SHA512_stubs.cmx lib/Hacl_HPKE_Curve64_CP32_SHA512_bindings.cmx lib/EverCrypt_HKDF_stubs.cmx lib/EverCrypt_HKDF_bindings.cmx lib/Hacl_EC_Ed25519_stubs.cmx lib/Hacl_EC_Ed25519_bindings.cmx lib/Hacl_HPKE_Curve51_CP256_SHA256_stubs.cmx lib/Hacl_HPKE_Curve51_CP256_SHA256_bindings.cmx lib/EverCrypt_Chacha20Poly1305_stubs.cmx lib/EverCrypt_Chacha20Poly1305_bindings.cmx lib/EverCrypt_AEAD_stubs.cmx lib/EverCrypt_AEAD_bindings.cmx lib/Hacl_Bignum256_stubs.cmx lib/Hacl_Bignum256_bindings.cmx lib/Hacl_Streaming_Types_bindings.cmx: lib/Hacl_Streaming_Types_bindings.cmo: lib_gen/Hacl_Streaming_Types_gen.cmx: lib/Hacl_Streaming_Types_bindings.cmx @@ -283,14 +283,14 @@ lib/Hacl_HPKE_Curve51_CP32_SHA256_bindings.cmx: lib/Hacl_HPKE_Interface_Hacl_Imp lib/Hacl_HPKE_Curve51_CP32_SHA256_bindings.cmo: lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_bindings.cmo lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_stubs.cmo lib_gen/Hacl_HPKE_Curve51_CP32_SHA256_gen.cmx: lib/Hacl_HPKE_Curve51_CP32_SHA256_bindings.cmx lib_gen/Hacl_HPKE_Curve51_CP32_SHA256_gen.exe: lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_bindings.cmx lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_stubs.cmx lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_c_stubs.o lib/Hacl_HPKE_Curve51_CP32_SHA256_bindings.cmx lib_gen/Hacl_HPKE_Curve51_CP32_SHA256_gen.cmx -lib/Hacl_HPKE_Curve64_CP256_SHA256_bindings.cmx: lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_bindings.cmx lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_stubs.cmx -lib/Hacl_HPKE_Curve64_CP256_SHA256_bindings.cmo: lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_bindings.cmo lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_stubs.cmo -lib_gen/Hacl_HPKE_Curve64_CP256_SHA256_gen.cmx: lib/Hacl_HPKE_Curve64_CP256_SHA256_bindings.cmx -lib_gen/Hacl_HPKE_Curve64_CP256_SHA256_gen.exe: lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_bindings.cmx lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_stubs.cmx lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_c_stubs.o lib/Hacl_HPKE_Curve64_CP256_SHA256_bindings.cmx lib_gen/Hacl_HPKE_Curve64_CP256_SHA256_gen.cmx lib/EverCrypt_Poly1305_bindings.cmx: lib/EverCrypt_Poly1305_bindings.cmo: lib_gen/EverCrypt_Poly1305_gen.cmx: lib/EverCrypt_Poly1305_bindings.cmx lib_gen/EverCrypt_Poly1305_gen.exe: lib/EverCrypt_Poly1305_bindings.cmx lib_gen/EverCrypt_Poly1305_gen.cmx +lib/Hacl_HPKE_Curve64_CP256_SHA256_bindings.cmx: lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_bindings.cmx lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_stubs.cmx +lib/Hacl_HPKE_Curve64_CP256_SHA256_bindings.cmo: lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_bindings.cmo lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_stubs.cmo +lib_gen/Hacl_HPKE_Curve64_CP256_SHA256_gen.cmx: lib/Hacl_HPKE_Curve64_CP256_SHA256_bindings.cmx +lib_gen/Hacl_HPKE_Curve64_CP256_SHA256_gen.exe: lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_bindings.cmx lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_stubs.cmx lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_c_stubs.o lib/Hacl_HPKE_Curve64_CP256_SHA256_bindings.cmx lib_gen/Hacl_HPKE_Curve64_CP256_SHA256_gen.cmx lib/Hacl_Streaming_Poly1305_32_bindings.cmx: lib/Hacl_Streaming_Types_bindings.cmx lib/Hacl_Streaming_Types_stubs.cmx lib/Hacl_Streaming_Poly1305_32_bindings.cmo: lib/Hacl_Streaming_Types_bindings.cmo lib/Hacl_Streaming_Types_stubs.cmo lib_gen/Hacl_Streaming_Poly1305_32_gen.cmx: lib/Hacl_Streaming_Poly1305_32_bindings.cmx diff --git a/rust/hacl-sys/Cargo.toml b/rust/hacl-sys/Cargo.toml index 82da020e..ae909191 100644 --- a/rust/hacl-sys/Cargo.toml +++ b/rust/hacl-sys/Cargo.toml @@ -39,7 +39,7 @@ rust-version = "1.60" libc = "0.2.147" [target.'cfg(all(not(windows), not(nobindgen)))'.build-dependencies] -bindgen = "0.65" +bindgen = "0.68" [build-dependencies] fs_extra = "1.3.0" diff --git a/src/EverCrypt_AEAD.c b/src/EverCrypt_AEAD.c index a4b306b7..564dbc2e 100644 --- a/src/EverCrypt_AEAD.c +++ b/src/EverCrypt_AEAD.c @@ -40,6 +40,10 @@ typedef struct EverCrypt_AEAD_state_s_s } EverCrypt_AEAD_state_s; +/** +Both encryption and decryption require a state that holds the key. +The state may be reused as many times as desired. +*/ bool EverCrypt_AEAD_uu___is_Ek(Spec_Agile_AEAD_alg a, EverCrypt_AEAD_state_s projectee) { return true; @@ -93,12 +97,12 @@ create_in_chacha20_poly1305(EverCrypt_AEAD_state_s **dst, uint8_t *k) static EverCrypt_Error_error_code create_in_aes128_gcm(EverCrypt_AEAD_state_s **dst, uint8_t *k) { + #if HACL_CAN_COMPILE_VALE bool has_aesni = EverCrypt_AutoConfig2_has_aesni(); bool has_pclmulqdq = EverCrypt_AutoConfig2_has_pclmulqdq(); bool has_avx = EverCrypt_AutoConfig2_has_avx(); bool has_sse = EverCrypt_AutoConfig2_has_sse(); bool has_movbe = EverCrypt_AutoConfig2_has_movbe(); - #if HACL_CAN_COMPILE_VALE if (has_aesni && has_pclmulqdq && has_avx && has_sse && has_movbe) { uint8_t *ek = (uint8_t *)KRML_HOST_CALLOC((uint32_t)480U, sizeof (uint8_t)); @@ -112,19 +116,21 @@ create_in_aes128_gcm(EverCrypt_AEAD_state_s **dst, uint8_t *k) *dst = p; return EverCrypt_Error_Success; } - #endif return EverCrypt_Error_UnsupportedAlgorithm; + #else + return EverCrypt_Error_UnsupportedAlgorithm; + #endif } static EverCrypt_Error_error_code create_in_aes256_gcm(EverCrypt_AEAD_state_s **dst, uint8_t *k) { + #if HACL_CAN_COMPILE_VALE bool has_aesni = EverCrypt_AutoConfig2_has_aesni(); bool has_pclmulqdq = EverCrypt_AutoConfig2_has_pclmulqdq(); bool has_avx = EverCrypt_AutoConfig2_has_avx(); bool has_sse = EverCrypt_AutoConfig2_has_sse(); bool has_movbe = EverCrypt_AutoConfig2_has_movbe(); - #if HACL_CAN_COMPILE_VALE if (has_aesni && has_pclmulqdq && has_avx && has_sse && has_movbe) { uint8_t *ek = (uint8_t *)KRML_HOST_CALLOC((uint32_t)544U, sizeof (uint8_t)); @@ -138,8 +144,10 @@ create_in_aes256_gcm(EverCrypt_AEAD_state_s **dst, uint8_t *k) *dst = p; return EverCrypt_Error_Success; } - #endif return EverCrypt_Error_UnsupportedAlgorithm; + #else + return EverCrypt_Error_UnsupportedAlgorithm; + #endif } /** @@ -797,12 +805,12 @@ EverCrypt_AEAD_encrypt_expand_aes128_gcm( uint8_t *tag ) { + #if HACL_CAN_COMPILE_VALE bool has_pclmulqdq = EverCrypt_AutoConfig2_has_pclmulqdq(); bool has_avx = EverCrypt_AutoConfig2_has_avx(); bool has_sse = EverCrypt_AutoConfig2_has_sse(); bool has_movbe = EverCrypt_AutoConfig2_has_movbe(); bool has_aesni = EverCrypt_AutoConfig2_has_aesni(); - #if HACL_CAN_COMPILE_VALE if (has_aesni && has_pclmulqdq && has_avx && has_sse && has_movbe) { uint8_t ek[480U] = { 0U }; @@ -919,8 +927,10 @@ EverCrypt_AEAD_encrypt_expand_aes128_gcm( } return EverCrypt_Error_Success; } - #endif return EverCrypt_Error_UnsupportedAlgorithm; + #else + return EverCrypt_Error_UnsupportedAlgorithm; + #endif } EverCrypt_Error_error_code @@ -936,12 +946,12 @@ EverCrypt_AEAD_encrypt_expand_aes256_gcm( uint8_t *tag ) { + #if HACL_CAN_COMPILE_VALE bool has_pclmulqdq = EverCrypt_AutoConfig2_has_pclmulqdq(); bool has_avx = EverCrypt_AutoConfig2_has_avx(); bool has_sse = EverCrypt_AutoConfig2_has_sse(); bool has_movbe = EverCrypt_AutoConfig2_has_movbe(); bool has_aesni = EverCrypt_AutoConfig2_has_aesni(); - #if HACL_CAN_COMPILE_VALE if (has_aesni && has_pclmulqdq && has_avx && has_sse && has_movbe) { uint8_t ek[544U] = { 0U }; @@ -1058,8 +1068,10 @@ EverCrypt_AEAD_encrypt_expand_aes256_gcm( } return EverCrypt_Error_Success; } - #endif return EverCrypt_Error_UnsupportedAlgorithm; + #else + return EverCrypt_Error_UnsupportedAlgorithm; + #endif } EverCrypt_Error_error_code @@ -1831,12 +1843,12 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm( uint8_t *dst ) { + #if HACL_CAN_COMPILE_VALE bool has_pclmulqdq = EverCrypt_AutoConfig2_has_pclmulqdq(); bool has_avx = EverCrypt_AutoConfig2_has_avx(); bool has_sse = EverCrypt_AutoConfig2_has_sse(); bool has_movbe = EverCrypt_AutoConfig2_has_movbe(); bool has_aesni = EverCrypt_AutoConfig2_has_aesni(); - #if HACL_CAN_COMPILE_VALE if (has_aesni && has_pclmulqdq && has_avx && has_sse && has_movbe) { uint8_t ek[480U] = { 0U }; @@ -1850,122 +1862,118 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm( { return EverCrypt_Error_InvalidKey; } - else if (iv_len == (uint32_t)0U) + if (iv_len == (uint32_t)0U) { return EverCrypt_Error_InvalidIVLength; } + EverCrypt_AEAD_state_s scrut1 = *s; + uint8_t *ek0 = scrut1.ek; + uint8_t *scratch_b = ek0 + (uint32_t)304U; + uint8_t *ek1 = ek0; + uint8_t *keys_b = ek1; + uint8_t *hkeys_b = ek1 + (uint32_t)176U; + uint8_t tmp_iv[16U] = { 0U }; + uint32_t len = iv_len / (uint32_t)16U; + uint32_t bytes_len = len * (uint32_t)16U; + uint8_t *iv_b = iv; + memcpy(tmp_iv, iv + bytes_len, iv_len % (uint32_t)16U * sizeof (uint8_t)); + uint64_t + uu____0 = compute_iv_stdcall(iv_b, (uint64_t)iv_len, (uint64_t)len, tmp_iv, tmp_iv, hkeys_b); + uint8_t *inout_b = scratch_b; + uint8_t *abytes_b = scratch_b + (uint32_t)16U; + uint8_t *scratch_b1 = scratch_b + (uint32_t)32U; + uint32_t cipher_len_ = (uint32_t)(uint64_t)cipher_len / (uint32_t)16U * (uint32_t)16U; + uint32_t auth_len_ = (uint32_t)(uint64_t)ad_len / (uint32_t)16U * (uint32_t)16U; + uint8_t *cipher_b_ = cipher; + uint8_t *out_b_ = dst; + uint8_t *auth_b_ = ad; + memcpy(inout_b, + cipher + cipher_len_, + (uint32_t)(uint64_t)cipher_len % (uint32_t)16U * sizeof (uint8_t)); + memcpy(abytes_b, + ad + auth_len_, + (uint32_t)(uint64_t)ad_len % (uint32_t)16U * sizeof (uint8_t)); + uint64_t len128x6 = (uint64_t)cipher_len / (uint64_t)96U * (uint64_t)96U; + uint64_t c; + if (len128x6 / (uint64_t)16U >= (uint64_t)6U) + { + uint64_t len128_num = (uint64_t)cipher_len / (uint64_t)16U * (uint64_t)16U - len128x6; + uint8_t *in128x6_b = cipher_b_; + uint8_t *out128x6_b = out_b_; + uint8_t *in128_b = cipher_b_ + (uint32_t)len128x6; + uint8_t *out128_b = out_b_ + (uint32_t)len128x6; + uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; + uint64_t len128x6_ = len128x6 / (uint64_t)16U; + uint64_t len128_num_ = len128_num / (uint64_t)16U; + uint64_t + scrut2 = + gcm128_decrypt_opt(auth_b_, + (uint64_t)ad_len, + auth_num, + keys_b, + tmp_iv, + hkeys_b, + abytes_b, + in128x6_b, + out128x6_b, + len128x6_, + in128_b, + out128_b, + len128_num_, + inout_b, + (uint64_t)cipher_len, + scratch_b1, + tag); + uint64_t c0 = scrut2; + c = c0; + } else { - EverCrypt_AEAD_state_s scrut1 = *s; - uint8_t *ek0 = scrut1.ek; - uint8_t *scratch_b = ek0 + (uint32_t)304U; - uint8_t *ek1 = ek0; - uint8_t *keys_b = ek1; - uint8_t *hkeys_b = ek1 + (uint32_t)176U; - uint8_t tmp_iv[16U] = { 0U }; - uint32_t len = iv_len / (uint32_t)16U; - uint32_t bytes_len = len * (uint32_t)16U; - uint8_t *iv_b = iv; - memcpy(tmp_iv, iv + bytes_len, iv_len % (uint32_t)16U * sizeof (uint8_t)); + uint32_t len128x61 = (uint32_t)0U; + uint64_t len128_num = (uint64_t)cipher_len / (uint64_t)16U * (uint64_t)16U; + uint8_t *in128x6_b = cipher_b_; + uint8_t *out128x6_b = out_b_; + uint8_t *in128_b = cipher_b_ + len128x61; + uint8_t *out128_b = out_b_ + len128x61; + uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; + uint64_t len128_num_ = len128_num / (uint64_t)16U; + uint64_t len128x6_ = (uint64_t)0U; uint64_t - uu____0 = compute_iv_stdcall(iv_b, (uint64_t)iv_len, (uint64_t)len, tmp_iv, tmp_iv, hkeys_b); - uint8_t *inout_b = scratch_b; - uint8_t *abytes_b = scratch_b + (uint32_t)16U; - uint8_t *scratch_b1 = scratch_b + (uint32_t)32U; - uint32_t cipher_len_ = (uint32_t)(uint64_t)cipher_len / (uint32_t)16U * (uint32_t)16U; - uint32_t auth_len_ = (uint32_t)(uint64_t)ad_len / (uint32_t)16U * (uint32_t)16U; - uint8_t *cipher_b_ = cipher; - uint8_t *out_b_ = dst; - uint8_t *auth_b_ = ad; - memcpy(inout_b, - cipher + cipher_len_, - (uint32_t)(uint64_t)cipher_len % (uint32_t)16U * sizeof (uint8_t)); - memcpy(abytes_b, - ad + auth_len_, - (uint32_t)(uint64_t)ad_len % (uint32_t)16U * sizeof (uint8_t)); - uint64_t len128x6 = (uint64_t)cipher_len / (uint64_t)96U * (uint64_t)96U; - uint64_t c; - if (len128x6 / (uint64_t)16U >= (uint64_t)6U) - { - uint64_t len128_num = (uint64_t)cipher_len / (uint64_t)16U * (uint64_t)16U - len128x6; - uint8_t *in128x6_b = cipher_b_; - uint8_t *out128x6_b = out_b_; - uint8_t *in128_b = cipher_b_ + (uint32_t)len128x6; - uint8_t *out128_b = out_b_ + (uint32_t)len128x6; - uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; - uint64_t len128x6_ = len128x6 / (uint64_t)16U; - uint64_t len128_num_ = len128_num / (uint64_t)16U; - uint64_t - scrut2 = - gcm128_decrypt_opt(auth_b_, - (uint64_t)ad_len, - auth_num, - keys_b, - tmp_iv, - hkeys_b, - abytes_b, - in128x6_b, - out128x6_b, - len128x6_, - in128_b, - out128_b, - len128_num_, - inout_b, - (uint64_t)cipher_len, - scratch_b1, - tag); - uint64_t c0 = scrut2; - c = c0; - } - else - { - uint32_t len128x61 = (uint32_t)0U; - uint64_t len128_num = (uint64_t)cipher_len / (uint64_t)16U * (uint64_t)16U; - uint8_t *in128x6_b = cipher_b_; - uint8_t *out128x6_b = out_b_; - uint8_t *in128_b = cipher_b_ + len128x61; - uint8_t *out128_b = out_b_ + len128x61; - uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; - uint64_t len128_num_ = len128_num / (uint64_t)16U; - uint64_t len128x6_ = (uint64_t)0U; - uint64_t - scrut2 = - gcm128_decrypt_opt(auth_b_, - (uint64_t)ad_len, - auth_num, - keys_b, - tmp_iv, - hkeys_b, - abytes_b, - in128x6_b, - out128x6_b, - len128x6_, - in128_b, - out128_b, - len128_num_, - inout_b, - (uint64_t)cipher_len, - scratch_b1, - tag); - uint64_t c0 = scrut2; - c = c0; - } - memcpy(dst + (uint32_t)(uint64_t)cipher_len / (uint32_t)16U * (uint32_t)16U, - inout_b, - (uint32_t)(uint64_t)cipher_len % (uint32_t)16U * sizeof (uint8_t)); - uint64_t r = c; - if (r == (uint64_t)0U) - { - return EverCrypt_Error_Success; - } - else - { - return EverCrypt_Error_AuthenticationFailure; - } + scrut2 = + gcm128_decrypt_opt(auth_b_, + (uint64_t)ad_len, + auth_num, + keys_b, + tmp_iv, + hkeys_b, + abytes_b, + in128x6_b, + out128x6_b, + len128x6_, + in128_b, + out128_b, + len128_num_, + inout_b, + (uint64_t)cipher_len, + scratch_b1, + tag); + uint64_t c0 = scrut2; + c = c0; } + memcpy(dst + (uint32_t)(uint64_t)cipher_len / (uint32_t)16U * (uint32_t)16U, + inout_b, + (uint32_t)(uint64_t)cipher_len % (uint32_t)16U * sizeof (uint8_t)); + uint64_t r = c; + if (r == (uint64_t)0U) + { + return EverCrypt_Error_Success; + } + return EverCrypt_Error_AuthenticationFailure; } - #endif return EverCrypt_Error_UnsupportedAlgorithm; + #else + return EverCrypt_Error_UnsupportedAlgorithm; + #endif } EverCrypt_Error_error_code @@ -1981,12 +1989,12 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm( uint8_t *dst ) { + #if HACL_CAN_COMPILE_VALE bool has_pclmulqdq = EverCrypt_AutoConfig2_has_pclmulqdq(); bool has_avx = EverCrypt_AutoConfig2_has_avx(); bool has_sse = EverCrypt_AutoConfig2_has_sse(); bool has_movbe = EverCrypt_AutoConfig2_has_movbe(); bool has_aesni = EverCrypt_AutoConfig2_has_aesni(); - #if HACL_CAN_COMPILE_VALE if (has_aesni && has_pclmulqdq && has_avx && has_sse && has_movbe) { uint8_t ek[544U] = { 0U }; @@ -2000,122 +2008,118 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm( { return EverCrypt_Error_InvalidKey; } - else if (iv_len == (uint32_t)0U) + if (iv_len == (uint32_t)0U) { return EverCrypt_Error_InvalidIVLength; } + EverCrypt_AEAD_state_s scrut1 = *s; + uint8_t *ek0 = scrut1.ek; + uint8_t *scratch_b = ek0 + (uint32_t)368U; + uint8_t *ek1 = ek0; + uint8_t *keys_b = ek1; + uint8_t *hkeys_b = ek1 + (uint32_t)240U; + uint8_t tmp_iv[16U] = { 0U }; + uint32_t len = iv_len / (uint32_t)16U; + uint32_t bytes_len = len * (uint32_t)16U; + uint8_t *iv_b = iv; + memcpy(tmp_iv, iv + bytes_len, iv_len % (uint32_t)16U * sizeof (uint8_t)); + uint64_t + uu____0 = compute_iv_stdcall(iv_b, (uint64_t)iv_len, (uint64_t)len, tmp_iv, tmp_iv, hkeys_b); + uint8_t *inout_b = scratch_b; + uint8_t *abytes_b = scratch_b + (uint32_t)16U; + uint8_t *scratch_b1 = scratch_b + (uint32_t)32U; + uint32_t cipher_len_ = (uint32_t)(uint64_t)cipher_len / (uint32_t)16U * (uint32_t)16U; + uint32_t auth_len_ = (uint32_t)(uint64_t)ad_len / (uint32_t)16U * (uint32_t)16U; + uint8_t *cipher_b_ = cipher; + uint8_t *out_b_ = dst; + uint8_t *auth_b_ = ad; + memcpy(inout_b, + cipher + cipher_len_, + (uint32_t)(uint64_t)cipher_len % (uint32_t)16U * sizeof (uint8_t)); + memcpy(abytes_b, + ad + auth_len_, + (uint32_t)(uint64_t)ad_len % (uint32_t)16U * sizeof (uint8_t)); + uint64_t len128x6 = (uint64_t)cipher_len / (uint64_t)96U * (uint64_t)96U; + uint64_t c; + if (len128x6 / (uint64_t)16U >= (uint64_t)6U) + { + uint64_t len128_num = (uint64_t)cipher_len / (uint64_t)16U * (uint64_t)16U - len128x6; + uint8_t *in128x6_b = cipher_b_; + uint8_t *out128x6_b = out_b_; + uint8_t *in128_b = cipher_b_ + (uint32_t)len128x6; + uint8_t *out128_b = out_b_ + (uint32_t)len128x6; + uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; + uint64_t len128x6_ = len128x6 / (uint64_t)16U; + uint64_t len128_num_ = len128_num / (uint64_t)16U; + uint64_t + scrut2 = + gcm256_decrypt_opt(auth_b_, + (uint64_t)ad_len, + auth_num, + keys_b, + tmp_iv, + hkeys_b, + abytes_b, + in128x6_b, + out128x6_b, + len128x6_, + in128_b, + out128_b, + len128_num_, + inout_b, + (uint64_t)cipher_len, + scratch_b1, + tag); + uint64_t c0 = scrut2; + c = c0; + } else { - EverCrypt_AEAD_state_s scrut1 = *s; - uint8_t *ek0 = scrut1.ek; - uint8_t *scratch_b = ek0 + (uint32_t)368U; - uint8_t *ek1 = ek0; - uint8_t *keys_b = ek1; - uint8_t *hkeys_b = ek1 + (uint32_t)240U; - uint8_t tmp_iv[16U] = { 0U }; - uint32_t len = iv_len / (uint32_t)16U; - uint32_t bytes_len = len * (uint32_t)16U; - uint8_t *iv_b = iv; - memcpy(tmp_iv, iv + bytes_len, iv_len % (uint32_t)16U * sizeof (uint8_t)); + uint32_t len128x61 = (uint32_t)0U; + uint64_t len128_num = (uint64_t)cipher_len / (uint64_t)16U * (uint64_t)16U; + uint8_t *in128x6_b = cipher_b_; + uint8_t *out128x6_b = out_b_; + uint8_t *in128_b = cipher_b_ + len128x61; + uint8_t *out128_b = out_b_ + len128x61; + uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; + uint64_t len128_num_ = len128_num / (uint64_t)16U; + uint64_t len128x6_ = (uint64_t)0U; uint64_t - uu____0 = compute_iv_stdcall(iv_b, (uint64_t)iv_len, (uint64_t)len, tmp_iv, tmp_iv, hkeys_b); - uint8_t *inout_b = scratch_b; - uint8_t *abytes_b = scratch_b + (uint32_t)16U; - uint8_t *scratch_b1 = scratch_b + (uint32_t)32U; - uint32_t cipher_len_ = (uint32_t)(uint64_t)cipher_len / (uint32_t)16U * (uint32_t)16U; - uint32_t auth_len_ = (uint32_t)(uint64_t)ad_len / (uint32_t)16U * (uint32_t)16U; - uint8_t *cipher_b_ = cipher; - uint8_t *out_b_ = dst; - uint8_t *auth_b_ = ad; - memcpy(inout_b, - cipher + cipher_len_, - (uint32_t)(uint64_t)cipher_len % (uint32_t)16U * sizeof (uint8_t)); - memcpy(abytes_b, - ad + auth_len_, - (uint32_t)(uint64_t)ad_len % (uint32_t)16U * sizeof (uint8_t)); - uint64_t len128x6 = (uint64_t)cipher_len / (uint64_t)96U * (uint64_t)96U; - uint64_t c; - if (len128x6 / (uint64_t)16U >= (uint64_t)6U) - { - uint64_t len128_num = (uint64_t)cipher_len / (uint64_t)16U * (uint64_t)16U - len128x6; - uint8_t *in128x6_b = cipher_b_; - uint8_t *out128x6_b = out_b_; - uint8_t *in128_b = cipher_b_ + (uint32_t)len128x6; - uint8_t *out128_b = out_b_ + (uint32_t)len128x6; - uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; - uint64_t len128x6_ = len128x6 / (uint64_t)16U; - uint64_t len128_num_ = len128_num / (uint64_t)16U; - uint64_t - scrut2 = - gcm256_decrypt_opt(auth_b_, - (uint64_t)ad_len, - auth_num, - keys_b, - tmp_iv, - hkeys_b, - abytes_b, - in128x6_b, - out128x6_b, - len128x6_, - in128_b, - out128_b, - len128_num_, - inout_b, - (uint64_t)cipher_len, - scratch_b1, - tag); - uint64_t c0 = scrut2; - c = c0; - } - else - { - uint32_t len128x61 = (uint32_t)0U; - uint64_t len128_num = (uint64_t)cipher_len / (uint64_t)16U * (uint64_t)16U; - uint8_t *in128x6_b = cipher_b_; - uint8_t *out128x6_b = out_b_; - uint8_t *in128_b = cipher_b_ + len128x61; - uint8_t *out128_b = out_b_ + len128x61; - uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; - uint64_t len128_num_ = len128_num / (uint64_t)16U; - uint64_t len128x6_ = (uint64_t)0U; - uint64_t - scrut2 = - gcm256_decrypt_opt(auth_b_, - (uint64_t)ad_len, - auth_num, - keys_b, - tmp_iv, - hkeys_b, - abytes_b, - in128x6_b, - out128x6_b, - len128x6_, - in128_b, - out128_b, - len128_num_, - inout_b, - (uint64_t)cipher_len, - scratch_b1, - tag); - uint64_t c0 = scrut2; - c = c0; - } - memcpy(dst + (uint32_t)(uint64_t)cipher_len / (uint32_t)16U * (uint32_t)16U, - inout_b, - (uint32_t)(uint64_t)cipher_len % (uint32_t)16U * sizeof (uint8_t)); - uint64_t r = c; - if (r == (uint64_t)0U) - { - return EverCrypt_Error_Success; - } - else - { - return EverCrypt_Error_AuthenticationFailure; - } + scrut2 = + gcm256_decrypt_opt(auth_b_, + (uint64_t)ad_len, + auth_num, + keys_b, + tmp_iv, + hkeys_b, + abytes_b, + in128x6_b, + out128x6_b, + len128x6_, + in128_b, + out128_b, + len128_num_, + inout_b, + (uint64_t)cipher_len, + scratch_b1, + tag); + uint64_t c0 = scrut2; + c = c0; + } + memcpy(dst + (uint32_t)(uint64_t)cipher_len / (uint32_t)16U * (uint32_t)16U, + inout_b, + (uint32_t)(uint64_t)cipher_len % (uint32_t)16U * sizeof (uint8_t)); + uint64_t r = c; + if (r == (uint64_t)0U) + { + return EverCrypt_Error_Success; } + return EverCrypt_Error_AuthenticationFailure; } - #endif return EverCrypt_Error_UnsupportedAlgorithm; + #else + return EverCrypt_Error_UnsupportedAlgorithm; + #endif } EverCrypt_Error_error_code diff --git a/src/EverCrypt_Chacha20Poly1305.c b/src/EverCrypt_Chacha20Poly1305.c index b1ad5a74..9a110bbf 100644 --- a/src/EverCrypt_Chacha20Poly1305.c +++ b/src/EverCrypt_Chacha20Poly1305.c @@ -39,13 +39,12 @@ EverCrypt_Chacha20Poly1305_aead_encrypt( uint8_t *tag ) { - bool avx2 = EverCrypt_AutoConfig2_has_avx2(); - bool avx = EverCrypt_AutoConfig2_has_avx(); bool vec256 = EverCrypt_AutoConfig2_has_vec256(); bool vec128 = EverCrypt_AutoConfig2_has_vec128(); #if HACL_CAN_COMPILE_VEC256 if (vec256) { + KRML_HOST_IGNORE(vec128); Hacl_Chacha20Poly1305_256_aead_encrypt(k, n, aadlen, aad, mlen, m, cipher, tag); return; } @@ -53,10 +52,13 @@ EverCrypt_Chacha20Poly1305_aead_encrypt( #if HACL_CAN_COMPILE_VEC128 if (vec128) { + KRML_HOST_IGNORE(vec256); Hacl_Chacha20Poly1305_128_aead_encrypt(k, n, aadlen, aad, mlen, m, cipher, tag); return; } #endif + KRML_HOST_IGNORE(vec128); + KRML_HOST_IGNORE(vec256); Hacl_Chacha20Poly1305_32_aead_encrypt(k, n, aadlen, aad, mlen, m, cipher, tag); } @@ -72,22 +74,24 @@ EverCrypt_Chacha20Poly1305_aead_decrypt( uint8_t *tag ) { - bool avx2 = EverCrypt_AutoConfig2_has_avx2(); - bool avx = EverCrypt_AutoConfig2_has_avx(); bool vec256 = EverCrypt_AutoConfig2_has_vec256(); bool vec128 = EverCrypt_AutoConfig2_has_vec128(); #if HACL_CAN_COMPILE_VEC256 if (vec256) { + KRML_HOST_IGNORE(vec128); return Hacl_Chacha20Poly1305_256_aead_decrypt(k, n, aadlen, aad, mlen, m, cipher, tag); } #endif #if HACL_CAN_COMPILE_VEC128 if (vec128) { + KRML_HOST_IGNORE(vec256); return Hacl_Chacha20Poly1305_128_aead_decrypt(k, n, aadlen, aad, mlen, m, cipher, tag); } #endif + KRML_HOST_IGNORE(vec128); + KRML_HOST_IGNORE(vec256); return Hacl_Chacha20Poly1305_32_aead_decrypt(k, n, aadlen, aad, mlen, m, cipher, tag); } diff --git a/src/EverCrypt_Curve25519.c b/src/EverCrypt_Curve25519.c index b97637b8..202f58c1 100644 --- a/src/EverCrypt_Curve25519.c +++ b/src/EverCrypt_Curve25519.c @@ -27,13 +27,6 @@ #include "config.h" -static inline bool has_adx_bmi2(void) -{ - bool has_bmi2 = EverCrypt_AutoConfig2_has_bmi2(); - bool has_adx = EverCrypt_AutoConfig2_has_adx(); - return has_bmi2 && has_adx; -} - /** Calculate a public point from a secret/private key. @@ -45,13 +38,17 @@ This computes a scalar multiplication of the secret/private key with the curve's void EverCrypt_Curve25519_secret_to_public(uint8_t *pub, uint8_t *priv) { #if HACL_CAN_COMPILE_VALE - if (has_adx_bmi2()) + bool has_bmi2 = EverCrypt_AutoConfig2_has_bmi2(); + bool has_adx = EverCrypt_AutoConfig2_has_adx(); + if (has_bmi2 && has_adx) { Hacl_Curve25519_64_secret_to_public(pub, priv); return; } - #endif Hacl_Curve25519_51_secret_to_public(pub, priv); + #else + Hacl_Curve25519_51_secret_to_public(pub, priv); + #endif } /** @@ -64,13 +61,17 @@ Compute the scalar multiple of a point. void EverCrypt_Curve25519_scalarmult(uint8_t *shared, uint8_t *my_priv, uint8_t *their_pub) { #if HACL_CAN_COMPILE_VALE - if (has_adx_bmi2()) + bool has_bmi2 = EverCrypt_AutoConfig2_has_bmi2(); + bool has_adx = EverCrypt_AutoConfig2_has_adx(); + if (has_bmi2 && has_adx) { Hacl_Curve25519_64_scalarmult(shared, my_priv, their_pub); return; } - #endif Hacl_Curve25519_51_scalarmult(shared, my_priv, their_pub); + #else + Hacl_Curve25519_51_scalarmult(shared, my_priv, their_pub); + #endif } /** @@ -83,11 +84,15 @@ Execute the diffie-hellmann key exchange. bool EverCrypt_Curve25519_ecdh(uint8_t *shared, uint8_t *my_priv, uint8_t *their_pub) { #if HACL_CAN_COMPILE_VALE - if (has_adx_bmi2()) + bool has_bmi2 = EverCrypt_AutoConfig2_has_bmi2(); + bool has_adx = EverCrypt_AutoConfig2_has_adx(); + if (has_bmi2 && has_adx) { return Hacl_Curve25519_64_ecdh(shared, my_priv, their_pub); } - #endif return Hacl_Curve25519_51_ecdh(shared, my_priv, their_pub); + #else + return Hacl_Curve25519_51_ecdh(shared, my_priv, their_pub); + #endif } diff --git a/src/EverCrypt_DRBG.c b/src/EverCrypt_DRBG.c index ac521460..f21313e9 100644 --- a/src/EverCrypt_DRBG.c +++ b/src/EverCrypt_DRBG.c @@ -26,6 +26,7 @@ #include "EverCrypt_DRBG.h" #include "internal/EverCrypt_HMAC.h" +#include "lib_memzero0.h" uint32_t EverCrypt_DRBG_reseed_interval = (uint32_t)1024U; @@ -618,20 +619,18 @@ reseed_sha1( memcpy(seed_material + entropy_input_len, additional_input, additional_input_len * sizeof (uint8_t)); - Hacl_HMAC_DRBG_state uu____0; + Hacl_HMAC_DRBG_state scrut; if (st_s.tag == SHA1_s) { - uu____0 = st_s.case_SHA1_s; + scrut = st_s.case_SHA1_s; } else { - uu____0 = - KRML_EABORT(Hacl_HMAC_DRBG_state, - "unreachable (pattern matches are exhaustive in F*)"); + scrut = KRML_EABORT(Hacl_HMAC_DRBG_state, "unreachable (pattern matches are exhaustive in F*)"); } - uint8_t *k = uu____0.k; - uint8_t *v = uu____0.v; - uint32_t *ctr = uu____0.reseed_counter; + uint8_t *k = scrut.k; + uint8_t *v = scrut.v; + uint32_t *ctr = scrut.reseed_counter; uint32_t input_len = (uint32_t)21U + entropy_input_len + additional_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len); uint8_t input0[input_len]; @@ -699,20 +698,18 @@ reseed_sha2_256( memcpy(seed_material + entropy_input_len, additional_input, additional_input_len * sizeof (uint8_t)); - Hacl_HMAC_DRBG_state uu____0; + Hacl_HMAC_DRBG_state scrut; if (st_s.tag == SHA2_256_s) { - uu____0 = st_s.case_SHA2_256_s; + scrut = st_s.case_SHA2_256_s; } else { - uu____0 = - KRML_EABORT(Hacl_HMAC_DRBG_state, - "unreachable (pattern matches are exhaustive in F*)"); + scrut = KRML_EABORT(Hacl_HMAC_DRBG_state, "unreachable (pattern matches are exhaustive in F*)"); } - uint8_t *k = uu____0.k; - uint8_t *v = uu____0.v; - uint32_t *ctr = uu____0.reseed_counter; + uint8_t *k = scrut.k; + uint8_t *v = scrut.v; + uint32_t *ctr = scrut.reseed_counter; uint32_t input_len = (uint32_t)33U + entropy_input_len + additional_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len); uint8_t input0[input_len]; @@ -780,20 +777,18 @@ reseed_sha2_384( memcpy(seed_material + entropy_input_len, additional_input, additional_input_len * sizeof (uint8_t)); - Hacl_HMAC_DRBG_state uu____0; + Hacl_HMAC_DRBG_state scrut; if (st_s.tag == SHA2_384_s) { - uu____0 = st_s.case_SHA2_384_s; + scrut = st_s.case_SHA2_384_s; } else { - uu____0 = - KRML_EABORT(Hacl_HMAC_DRBG_state, - "unreachable (pattern matches are exhaustive in F*)"); + scrut = KRML_EABORT(Hacl_HMAC_DRBG_state, "unreachable (pattern matches are exhaustive in F*)"); } - uint8_t *k = uu____0.k; - uint8_t *v = uu____0.v; - uint32_t *ctr = uu____0.reseed_counter; + uint8_t *k = scrut.k; + uint8_t *v = scrut.v; + uint32_t *ctr = scrut.reseed_counter; uint32_t input_len = (uint32_t)49U + entropy_input_len + additional_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len); uint8_t input0[input_len]; @@ -861,20 +856,18 @@ reseed_sha2_512( memcpy(seed_material + entropy_input_len, additional_input, additional_input_len * sizeof (uint8_t)); - Hacl_HMAC_DRBG_state uu____0; + Hacl_HMAC_DRBG_state scrut; if (st_s.tag == SHA2_512_s) { - uu____0 = st_s.case_SHA2_512_s; + scrut = st_s.case_SHA2_512_s; } else { - uu____0 = - KRML_EABORT(Hacl_HMAC_DRBG_state, - "unreachable (pattern matches are exhaustive in F*)"); + scrut = KRML_EABORT(Hacl_HMAC_DRBG_state, "unreachable (pattern matches are exhaustive in F*)"); } - uint8_t *k = uu____0.k; - uint8_t *v = uu____0.v; - uint32_t *ctr = uu____0.reseed_counter; + uint8_t *k = scrut.k; + uint8_t *v = scrut.v; + uint32_t *ctr = scrut.reseed_counter; uint32_t input_len = (uint32_t)65U + entropy_input_len + additional_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len); uint8_t input0[input_len]; @@ -932,7 +925,6 @@ generate_sha1( { return false; } - uint32_t entropy_input_len = Hacl_HMAC_DRBG_min_length(Spec_Hash_Definitions_SHA1); bool ok0; if (additional_input_len > Hacl_HMAC_DRBG_max_additional_input_length) { @@ -940,11 +932,11 @@ generate_sha1( } else { - uint32_t entropy_input_len1 = Hacl_HMAC_DRBG_min_length(Spec_Hash_Definitions_SHA1); - KRML_CHECK_SIZE(sizeof (uint8_t), entropy_input_len1); - uint8_t entropy_input[entropy_input_len1]; - memset(entropy_input, 0U, entropy_input_len1 * sizeof (uint8_t)); - bool ok = Lib_RandomBuffer_System_randombytes(entropy_input, entropy_input_len1); + uint32_t entropy_input_len = Hacl_HMAC_DRBG_min_length(Spec_Hash_Definitions_SHA1); + KRML_CHECK_SIZE(sizeof (uint8_t), entropy_input_len); + uint8_t entropy_input[entropy_input_len]; + memset(entropy_input, 0U, entropy_input_len * sizeof (uint8_t)); + bool ok = Lib_RandomBuffer_System_randombytes(entropy_input, entropy_input_len); bool result; if (!ok) { @@ -953,56 +945,56 @@ generate_sha1( else { EverCrypt_DRBG_state_s st_s = *st; - KRML_CHECK_SIZE(sizeof (uint8_t), entropy_input_len1 + additional_input_len); - uint8_t seed_material[entropy_input_len1 + additional_input_len]; - memset(seed_material, 0U, (entropy_input_len1 + additional_input_len) * sizeof (uint8_t)); - memcpy(seed_material, entropy_input, entropy_input_len1 * sizeof (uint8_t)); - memcpy(seed_material + entropy_input_len1, + KRML_CHECK_SIZE(sizeof (uint8_t), entropy_input_len + additional_input_len); + uint8_t seed_material[entropy_input_len + additional_input_len]; + memset(seed_material, 0U, (entropy_input_len + additional_input_len) * sizeof (uint8_t)); + memcpy(seed_material, entropy_input, entropy_input_len * sizeof (uint8_t)); + memcpy(seed_material + entropy_input_len, additional_input, additional_input_len * sizeof (uint8_t)); - Hacl_HMAC_DRBG_state uu____0; + Hacl_HMAC_DRBG_state scrut; if (st_s.tag == SHA1_s) { - uu____0 = st_s.case_SHA1_s; + scrut = st_s.case_SHA1_s; } else { - uu____0 = + scrut = KRML_EABORT(Hacl_HMAC_DRBG_state, "unreachable (pattern matches are exhaustive in F*)"); } - uint8_t *k = uu____0.k; - uint8_t *v = uu____0.v; - uint32_t *ctr = uu____0.reseed_counter; - uint32_t input_len = (uint32_t)21U + entropy_input_len1 + additional_input_len; + uint8_t *k = scrut.k; + uint8_t *v = scrut.v; + uint32_t *ctr = scrut.reseed_counter; + uint32_t input_len = (uint32_t)21U + entropy_input_len + additional_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len); uint8_t input0[input_len]; memset(input0, 0U, input_len * sizeof (uint8_t)); uint8_t *k_ = input0; memcpy(k_, v, (uint32_t)20U * sizeof (uint8_t)); - if (entropy_input_len1 + additional_input_len != (uint32_t)0U) + if (entropy_input_len + additional_input_len != (uint32_t)0U) { memcpy(input0 + (uint32_t)21U, seed_material, - (entropy_input_len1 + additional_input_len) * sizeof (uint8_t)); + (entropy_input_len + additional_input_len) * sizeof (uint8_t)); } input0[20U] = (uint8_t)0U; EverCrypt_HMAC_compute_sha1(k_, k, (uint32_t)20U, input0, input_len); EverCrypt_HMAC_compute_sha1(v, k_, (uint32_t)20U, v, (uint32_t)20U); memcpy(k, k_, (uint32_t)20U * sizeof (uint8_t)); - if (entropy_input_len1 + additional_input_len != (uint32_t)0U) + if (entropy_input_len + additional_input_len != (uint32_t)0U) { - uint32_t input_len0 = (uint32_t)21U + entropy_input_len1 + additional_input_len; + uint32_t input_len0 = (uint32_t)21U + entropy_input_len + additional_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len0); uint8_t input[input_len0]; memset(input, 0U, input_len0 * sizeof (uint8_t)); uint8_t *k_0 = input; memcpy(k_0, v, (uint32_t)20U * sizeof (uint8_t)); - if (entropy_input_len1 + additional_input_len != (uint32_t)0U) + if (entropy_input_len + additional_input_len != (uint32_t)0U) { memcpy(input + (uint32_t)21U, seed_material, - (entropy_input_len1 + additional_input_len) * sizeof (uint8_t)); + (entropy_input_len + additional_input_len) * sizeof (uint8_t)); } input[20U] = (uint8_t)1U; EverCrypt_HMAC_compute_sha1(k_0, k, (uint32_t)20U, input, input_len0); @@ -1028,75 +1020,24 @@ generate_sha1( { x1 = KRML_EABORT(Hacl_HMAC_DRBG_state, "unreachable (pattern matches are exhaustive in F*)"); } - bool b; if (x1.reseed_counter[0U] > Hacl_HMAC_DRBG_reseed_interval) { - b = false; + return false; + } + Hacl_HMAC_DRBG_state scrut; + if (st_s.tag == SHA1_s) + { + scrut = st_s.case_SHA1_s; } else { - Hacl_HMAC_DRBG_state scrut; - if (st_s.tag == SHA1_s) - { - scrut = st_s.case_SHA1_s; - } - else - { - scrut = - KRML_EABORT(Hacl_HMAC_DRBG_state, - "unreachable (pattern matches are exhaustive in F*)"); - } - uint8_t *k = scrut.k; - uint8_t *v = scrut.v; - uint32_t *ctr = scrut.reseed_counter; - if (additional_input_len > (uint32_t)0U) - { - uint32_t input_len = (uint32_t)21U + additional_input_len; - KRML_CHECK_SIZE(sizeof (uint8_t), input_len); - uint8_t input0[input_len]; - memset(input0, 0U, input_len * sizeof (uint8_t)); - uint8_t *k_ = input0; - memcpy(k_, v, (uint32_t)20U * sizeof (uint8_t)); - if (additional_input_len != (uint32_t)0U) - { - memcpy(input0 + (uint32_t)21U, additional_input, additional_input_len * sizeof (uint8_t)); - } - input0[20U] = (uint8_t)0U; - EverCrypt_HMAC_compute_sha1(k_, k, (uint32_t)20U, input0, input_len); - EverCrypt_HMAC_compute_sha1(v, k_, (uint32_t)20U, v, (uint32_t)20U); - memcpy(k, k_, (uint32_t)20U * sizeof (uint8_t)); - if (additional_input_len != (uint32_t)0U) - { - uint32_t input_len0 = (uint32_t)21U + additional_input_len; - KRML_CHECK_SIZE(sizeof (uint8_t), input_len0); - uint8_t input[input_len0]; - memset(input, 0U, input_len0 * sizeof (uint8_t)); - uint8_t *k_0 = input; - memcpy(k_0, v, (uint32_t)20U * sizeof (uint8_t)); - if (additional_input_len != (uint32_t)0U) - { - memcpy(input + (uint32_t)21U, additional_input, additional_input_len * sizeof (uint8_t)); - } - input[20U] = (uint8_t)1U; - EverCrypt_HMAC_compute_sha1(k_0, k, (uint32_t)20U, input, input_len0); - EverCrypt_HMAC_compute_sha1(v, k_0, (uint32_t)20U, v, (uint32_t)20U); - memcpy(k, k_0, (uint32_t)20U * sizeof (uint8_t)); - } - } - uint8_t *output1 = output; - uint32_t max = n / (uint32_t)20U; - uint8_t *out = output1; - for (uint32_t i = (uint32_t)0U; i < max; i++) - { - EverCrypt_HMAC_compute_sha1(v, k, (uint32_t)20U, v, (uint32_t)20U); - memcpy(out + i * (uint32_t)20U, v, (uint32_t)20U * sizeof (uint8_t)); - } - if (max * (uint32_t)20U < n) - { - uint8_t *block = output1 + max * (uint32_t)20U; - EverCrypt_HMAC_compute_sha1(v, k, (uint32_t)20U, v, (uint32_t)20U); - memcpy(block, v, (n - max * (uint32_t)20U) * sizeof (uint8_t)); - } + scrut = KRML_EABORT(Hacl_HMAC_DRBG_state, "unreachable (pattern matches are exhaustive in F*)"); + } + uint8_t *k = scrut.k; + uint8_t *v = scrut.v; + uint32_t *ctr = scrut.reseed_counter; + if (additional_input_len > (uint32_t)0U) + { uint32_t input_len = (uint32_t)21U + additional_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len); uint8_t input0[input_len]; @@ -1128,10 +1069,54 @@ generate_sha1( EverCrypt_HMAC_compute_sha1(v, k_0, (uint32_t)20U, v, (uint32_t)20U); memcpy(k, k_0, (uint32_t)20U * sizeof (uint8_t)); } - uint32_t old_ctr = ctr[0U]; - ctr[0U] = old_ctr + (uint32_t)1U; - b = true; } + uint8_t *output1 = output; + uint32_t max = n / (uint32_t)20U; + uint8_t *out = output1; + for (uint32_t i = (uint32_t)0U; i < max; i++) + { + EverCrypt_HMAC_compute_sha1(v, k, (uint32_t)20U, v, (uint32_t)20U); + memcpy(out + i * (uint32_t)20U, v, (uint32_t)20U * sizeof (uint8_t)); + } + if (max * (uint32_t)20U < n) + { + uint8_t *block = output1 + max * (uint32_t)20U; + EverCrypt_HMAC_compute_sha1(v, k, (uint32_t)20U, v, (uint32_t)20U); + memcpy(block, v, (n - max * (uint32_t)20U) * sizeof (uint8_t)); + } + uint32_t input_len = (uint32_t)21U + additional_input_len; + KRML_CHECK_SIZE(sizeof (uint8_t), input_len); + uint8_t input0[input_len]; + memset(input0, 0U, input_len * sizeof (uint8_t)); + uint8_t *k_ = input0; + memcpy(k_, v, (uint32_t)20U * sizeof (uint8_t)); + if (additional_input_len != (uint32_t)0U) + { + memcpy(input0 + (uint32_t)21U, additional_input, additional_input_len * sizeof (uint8_t)); + } + input0[20U] = (uint8_t)0U; + EverCrypt_HMAC_compute_sha1(k_, k, (uint32_t)20U, input0, input_len); + EverCrypt_HMAC_compute_sha1(v, k_, (uint32_t)20U, v, (uint32_t)20U); + memcpy(k, k_, (uint32_t)20U * sizeof (uint8_t)); + if (additional_input_len != (uint32_t)0U) + { + uint32_t input_len0 = (uint32_t)21U + additional_input_len; + KRML_CHECK_SIZE(sizeof (uint8_t), input_len0); + uint8_t input[input_len0]; + memset(input, 0U, input_len0 * sizeof (uint8_t)); + uint8_t *k_0 = input; + memcpy(k_0, v, (uint32_t)20U * sizeof (uint8_t)); + if (additional_input_len != (uint32_t)0U) + { + memcpy(input + (uint32_t)21U, additional_input, additional_input_len * sizeof (uint8_t)); + } + input[20U] = (uint8_t)1U; + EverCrypt_HMAC_compute_sha1(k_0, k, (uint32_t)20U, input, input_len0); + EverCrypt_HMAC_compute_sha1(v, k_0, (uint32_t)20U, v, (uint32_t)20U); + memcpy(k, k_0, (uint32_t)20U * sizeof (uint8_t)); + } + uint32_t old_ctr = ctr[0U]; + ctr[0U] = old_ctr + (uint32_t)1U; return true; } @@ -1153,7 +1138,6 @@ generate_sha2_256( { return false; } - uint32_t entropy_input_len = Hacl_HMAC_DRBG_min_length(Spec_Hash_Definitions_SHA2_256); bool ok0; if (additional_input_len > Hacl_HMAC_DRBG_max_additional_input_length) { @@ -1161,11 +1145,11 @@ generate_sha2_256( } else { - uint32_t entropy_input_len1 = Hacl_HMAC_DRBG_min_length(Spec_Hash_Definitions_SHA2_256); - KRML_CHECK_SIZE(sizeof (uint8_t), entropy_input_len1); - uint8_t entropy_input[entropy_input_len1]; - memset(entropy_input, 0U, entropy_input_len1 * sizeof (uint8_t)); - bool ok = Lib_RandomBuffer_System_randombytes(entropy_input, entropy_input_len1); + uint32_t entropy_input_len = Hacl_HMAC_DRBG_min_length(Spec_Hash_Definitions_SHA2_256); + KRML_CHECK_SIZE(sizeof (uint8_t), entropy_input_len); + uint8_t entropy_input[entropy_input_len]; + memset(entropy_input, 0U, entropy_input_len * sizeof (uint8_t)); + bool ok = Lib_RandomBuffer_System_randombytes(entropy_input, entropy_input_len); bool result; if (!ok) { @@ -1174,56 +1158,56 @@ generate_sha2_256( else { EverCrypt_DRBG_state_s st_s = *st; - KRML_CHECK_SIZE(sizeof (uint8_t), entropy_input_len1 + additional_input_len); - uint8_t seed_material[entropy_input_len1 + additional_input_len]; - memset(seed_material, 0U, (entropy_input_len1 + additional_input_len) * sizeof (uint8_t)); - memcpy(seed_material, entropy_input, entropy_input_len1 * sizeof (uint8_t)); - memcpy(seed_material + entropy_input_len1, + KRML_CHECK_SIZE(sizeof (uint8_t), entropy_input_len + additional_input_len); + uint8_t seed_material[entropy_input_len + additional_input_len]; + memset(seed_material, 0U, (entropy_input_len + additional_input_len) * sizeof (uint8_t)); + memcpy(seed_material, entropy_input, entropy_input_len * sizeof (uint8_t)); + memcpy(seed_material + entropy_input_len, additional_input, additional_input_len * sizeof (uint8_t)); - Hacl_HMAC_DRBG_state uu____0; + Hacl_HMAC_DRBG_state scrut; if (st_s.tag == SHA2_256_s) { - uu____0 = st_s.case_SHA2_256_s; + scrut = st_s.case_SHA2_256_s; } else { - uu____0 = + scrut = KRML_EABORT(Hacl_HMAC_DRBG_state, "unreachable (pattern matches are exhaustive in F*)"); } - uint8_t *k = uu____0.k; - uint8_t *v = uu____0.v; - uint32_t *ctr = uu____0.reseed_counter; - uint32_t input_len = (uint32_t)33U + entropy_input_len1 + additional_input_len; + uint8_t *k = scrut.k; + uint8_t *v = scrut.v; + uint32_t *ctr = scrut.reseed_counter; + uint32_t input_len = (uint32_t)33U + entropy_input_len + additional_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len); uint8_t input0[input_len]; memset(input0, 0U, input_len * sizeof (uint8_t)); uint8_t *k_ = input0; memcpy(k_, v, (uint32_t)32U * sizeof (uint8_t)); - if (entropy_input_len1 + additional_input_len != (uint32_t)0U) + if (entropy_input_len + additional_input_len != (uint32_t)0U) { memcpy(input0 + (uint32_t)33U, seed_material, - (entropy_input_len1 + additional_input_len) * sizeof (uint8_t)); + (entropy_input_len + additional_input_len) * sizeof (uint8_t)); } input0[32U] = (uint8_t)0U; EverCrypt_HMAC_compute_sha2_256(k_, k, (uint32_t)32U, input0, input_len); EverCrypt_HMAC_compute_sha2_256(v, k_, (uint32_t)32U, v, (uint32_t)32U); memcpy(k, k_, (uint32_t)32U * sizeof (uint8_t)); - if (entropy_input_len1 + additional_input_len != (uint32_t)0U) + if (entropy_input_len + additional_input_len != (uint32_t)0U) { - uint32_t input_len0 = (uint32_t)33U + entropy_input_len1 + additional_input_len; + uint32_t input_len0 = (uint32_t)33U + entropy_input_len + additional_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len0); uint8_t input[input_len0]; memset(input, 0U, input_len0 * sizeof (uint8_t)); uint8_t *k_0 = input; memcpy(k_0, v, (uint32_t)32U * sizeof (uint8_t)); - if (entropy_input_len1 + additional_input_len != (uint32_t)0U) + if (entropy_input_len + additional_input_len != (uint32_t)0U) { memcpy(input + (uint32_t)33U, seed_material, - (entropy_input_len1 + additional_input_len) * sizeof (uint8_t)); + (entropy_input_len + additional_input_len) * sizeof (uint8_t)); } input[32U] = (uint8_t)1U; EverCrypt_HMAC_compute_sha2_256(k_0, k, (uint32_t)32U, input, input_len0); @@ -1249,75 +1233,24 @@ generate_sha2_256( { x1 = KRML_EABORT(Hacl_HMAC_DRBG_state, "unreachable (pattern matches are exhaustive in F*)"); } - bool b; if (x1.reseed_counter[0U] > Hacl_HMAC_DRBG_reseed_interval) { - b = false; + return false; + } + Hacl_HMAC_DRBG_state scrut; + if (st_s.tag == SHA2_256_s) + { + scrut = st_s.case_SHA2_256_s; } else { - Hacl_HMAC_DRBG_state scrut; - if (st_s.tag == SHA2_256_s) - { - scrut = st_s.case_SHA2_256_s; - } - else - { - scrut = - KRML_EABORT(Hacl_HMAC_DRBG_state, - "unreachable (pattern matches are exhaustive in F*)"); - } - uint8_t *k = scrut.k; - uint8_t *v = scrut.v; - uint32_t *ctr = scrut.reseed_counter; - if (additional_input_len > (uint32_t)0U) - { - uint32_t input_len = (uint32_t)33U + additional_input_len; - KRML_CHECK_SIZE(sizeof (uint8_t), input_len); - uint8_t input0[input_len]; - memset(input0, 0U, input_len * sizeof (uint8_t)); - uint8_t *k_ = input0; - memcpy(k_, v, (uint32_t)32U * sizeof (uint8_t)); - if (additional_input_len != (uint32_t)0U) - { - memcpy(input0 + (uint32_t)33U, additional_input, additional_input_len * sizeof (uint8_t)); - } - input0[32U] = (uint8_t)0U; - EverCrypt_HMAC_compute_sha2_256(k_, k, (uint32_t)32U, input0, input_len); - EverCrypt_HMAC_compute_sha2_256(v, k_, (uint32_t)32U, v, (uint32_t)32U); - memcpy(k, k_, (uint32_t)32U * sizeof (uint8_t)); - if (additional_input_len != (uint32_t)0U) - { - uint32_t input_len0 = (uint32_t)33U + additional_input_len; - KRML_CHECK_SIZE(sizeof (uint8_t), input_len0); - uint8_t input[input_len0]; - memset(input, 0U, input_len0 * sizeof (uint8_t)); - uint8_t *k_0 = input; - memcpy(k_0, v, (uint32_t)32U * sizeof (uint8_t)); - if (additional_input_len != (uint32_t)0U) - { - memcpy(input + (uint32_t)33U, additional_input, additional_input_len * sizeof (uint8_t)); - } - input[32U] = (uint8_t)1U; - EverCrypt_HMAC_compute_sha2_256(k_0, k, (uint32_t)32U, input, input_len0); - EverCrypt_HMAC_compute_sha2_256(v, k_0, (uint32_t)32U, v, (uint32_t)32U); - memcpy(k, k_0, (uint32_t)32U * sizeof (uint8_t)); - } - } - uint8_t *output1 = output; - uint32_t max = n / (uint32_t)32U; - uint8_t *out = output1; - for (uint32_t i = (uint32_t)0U; i < max; i++) - { - EverCrypt_HMAC_compute_sha2_256(v, k, (uint32_t)32U, v, (uint32_t)32U); - memcpy(out + i * (uint32_t)32U, v, (uint32_t)32U * sizeof (uint8_t)); - } - if (max * (uint32_t)32U < n) - { - uint8_t *block = output1 + max * (uint32_t)32U; - EverCrypt_HMAC_compute_sha2_256(v, k, (uint32_t)32U, v, (uint32_t)32U); - memcpy(block, v, (n - max * (uint32_t)32U) * sizeof (uint8_t)); - } + scrut = KRML_EABORT(Hacl_HMAC_DRBG_state, "unreachable (pattern matches are exhaustive in F*)"); + } + uint8_t *k = scrut.k; + uint8_t *v = scrut.v; + uint32_t *ctr = scrut.reseed_counter; + if (additional_input_len > (uint32_t)0U) + { uint32_t input_len = (uint32_t)33U + additional_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len); uint8_t input0[input_len]; @@ -1349,10 +1282,54 @@ generate_sha2_256( EverCrypt_HMAC_compute_sha2_256(v, k_0, (uint32_t)32U, v, (uint32_t)32U); memcpy(k, k_0, (uint32_t)32U * sizeof (uint8_t)); } - uint32_t old_ctr = ctr[0U]; - ctr[0U] = old_ctr + (uint32_t)1U; - b = true; } + uint8_t *output1 = output; + uint32_t max = n / (uint32_t)32U; + uint8_t *out = output1; + for (uint32_t i = (uint32_t)0U; i < max; i++) + { + EverCrypt_HMAC_compute_sha2_256(v, k, (uint32_t)32U, v, (uint32_t)32U); + memcpy(out + i * (uint32_t)32U, v, (uint32_t)32U * sizeof (uint8_t)); + } + if (max * (uint32_t)32U < n) + { + uint8_t *block = output1 + max * (uint32_t)32U; + EverCrypt_HMAC_compute_sha2_256(v, k, (uint32_t)32U, v, (uint32_t)32U); + memcpy(block, v, (n - max * (uint32_t)32U) * sizeof (uint8_t)); + } + uint32_t input_len = (uint32_t)33U + additional_input_len; + KRML_CHECK_SIZE(sizeof (uint8_t), input_len); + uint8_t input0[input_len]; + memset(input0, 0U, input_len * sizeof (uint8_t)); + uint8_t *k_ = input0; + memcpy(k_, v, (uint32_t)32U * sizeof (uint8_t)); + if (additional_input_len != (uint32_t)0U) + { + memcpy(input0 + (uint32_t)33U, additional_input, additional_input_len * sizeof (uint8_t)); + } + input0[32U] = (uint8_t)0U; + EverCrypt_HMAC_compute_sha2_256(k_, k, (uint32_t)32U, input0, input_len); + EverCrypt_HMAC_compute_sha2_256(v, k_, (uint32_t)32U, v, (uint32_t)32U); + memcpy(k, k_, (uint32_t)32U * sizeof (uint8_t)); + if (additional_input_len != (uint32_t)0U) + { + uint32_t input_len0 = (uint32_t)33U + additional_input_len; + KRML_CHECK_SIZE(sizeof (uint8_t), input_len0); + uint8_t input[input_len0]; + memset(input, 0U, input_len0 * sizeof (uint8_t)); + uint8_t *k_0 = input; + memcpy(k_0, v, (uint32_t)32U * sizeof (uint8_t)); + if (additional_input_len != (uint32_t)0U) + { + memcpy(input + (uint32_t)33U, additional_input, additional_input_len * sizeof (uint8_t)); + } + input[32U] = (uint8_t)1U; + EverCrypt_HMAC_compute_sha2_256(k_0, k, (uint32_t)32U, input, input_len0); + EverCrypt_HMAC_compute_sha2_256(v, k_0, (uint32_t)32U, v, (uint32_t)32U); + memcpy(k, k_0, (uint32_t)32U * sizeof (uint8_t)); + } + uint32_t old_ctr = ctr[0U]; + ctr[0U] = old_ctr + (uint32_t)1U; return true; } @@ -1374,7 +1351,6 @@ generate_sha2_384( { return false; } - uint32_t entropy_input_len = Hacl_HMAC_DRBG_min_length(Spec_Hash_Definitions_SHA2_384); bool ok0; if (additional_input_len > Hacl_HMAC_DRBG_max_additional_input_length) { @@ -1382,11 +1358,11 @@ generate_sha2_384( } else { - uint32_t entropy_input_len1 = Hacl_HMAC_DRBG_min_length(Spec_Hash_Definitions_SHA2_384); - KRML_CHECK_SIZE(sizeof (uint8_t), entropy_input_len1); - uint8_t entropy_input[entropy_input_len1]; - memset(entropy_input, 0U, entropy_input_len1 * sizeof (uint8_t)); - bool ok = Lib_RandomBuffer_System_randombytes(entropy_input, entropy_input_len1); + uint32_t entropy_input_len = Hacl_HMAC_DRBG_min_length(Spec_Hash_Definitions_SHA2_384); + KRML_CHECK_SIZE(sizeof (uint8_t), entropy_input_len); + uint8_t entropy_input[entropy_input_len]; + memset(entropy_input, 0U, entropy_input_len * sizeof (uint8_t)); + bool ok = Lib_RandomBuffer_System_randombytes(entropy_input, entropy_input_len); bool result; if (!ok) { @@ -1395,56 +1371,56 @@ generate_sha2_384( else { EverCrypt_DRBG_state_s st_s = *st; - KRML_CHECK_SIZE(sizeof (uint8_t), entropy_input_len1 + additional_input_len); - uint8_t seed_material[entropy_input_len1 + additional_input_len]; - memset(seed_material, 0U, (entropy_input_len1 + additional_input_len) * sizeof (uint8_t)); - memcpy(seed_material, entropy_input, entropy_input_len1 * sizeof (uint8_t)); - memcpy(seed_material + entropy_input_len1, + KRML_CHECK_SIZE(sizeof (uint8_t), entropy_input_len + additional_input_len); + uint8_t seed_material[entropy_input_len + additional_input_len]; + memset(seed_material, 0U, (entropy_input_len + additional_input_len) * sizeof (uint8_t)); + memcpy(seed_material, entropy_input, entropy_input_len * sizeof (uint8_t)); + memcpy(seed_material + entropy_input_len, additional_input, additional_input_len * sizeof (uint8_t)); - Hacl_HMAC_DRBG_state uu____0; + Hacl_HMAC_DRBG_state scrut; if (st_s.tag == SHA2_384_s) { - uu____0 = st_s.case_SHA2_384_s; + scrut = st_s.case_SHA2_384_s; } else { - uu____0 = + scrut = KRML_EABORT(Hacl_HMAC_DRBG_state, "unreachable (pattern matches are exhaustive in F*)"); } - uint8_t *k = uu____0.k; - uint8_t *v = uu____0.v; - uint32_t *ctr = uu____0.reseed_counter; - uint32_t input_len = (uint32_t)49U + entropy_input_len1 + additional_input_len; + uint8_t *k = scrut.k; + uint8_t *v = scrut.v; + uint32_t *ctr = scrut.reseed_counter; + uint32_t input_len = (uint32_t)49U + entropy_input_len + additional_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len); uint8_t input0[input_len]; memset(input0, 0U, input_len * sizeof (uint8_t)); uint8_t *k_ = input0; memcpy(k_, v, (uint32_t)48U * sizeof (uint8_t)); - if (entropy_input_len1 + additional_input_len != (uint32_t)0U) + if (entropy_input_len + additional_input_len != (uint32_t)0U) { memcpy(input0 + (uint32_t)49U, seed_material, - (entropy_input_len1 + additional_input_len) * sizeof (uint8_t)); + (entropy_input_len + additional_input_len) * sizeof (uint8_t)); } input0[48U] = (uint8_t)0U; EverCrypt_HMAC_compute_sha2_384(k_, k, (uint32_t)48U, input0, input_len); EverCrypt_HMAC_compute_sha2_384(v, k_, (uint32_t)48U, v, (uint32_t)48U); memcpy(k, k_, (uint32_t)48U * sizeof (uint8_t)); - if (entropy_input_len1 + additional_input_len != (uint32_t)0U) + if (entropy_input_len + additional_input_len != (uint32_t)0U) { - uint32_t input_len0 = (uint32_t)49U + entropy_input_len1 + additional_input_len; + uint32_t input_len0 = (uint32_t)49U + entropy_input_len + additional_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len0); uint8_t input[input_len0]; memset(input, 0U, input_len0 * sizeof (uint8_t)); uint8_t *k_0 = input; memcpy(k_0, v, (uint32_t)48U * sizeof (uint8_t)); - if (entropy_input_len1 + additional_input_len != (uint32_t)0U) + if (entropy_input_len + additional_input_len != (uint32_t)0U) { memcpy(input + (uint32_t)49U, seed_material, - (entropy_input_len1 + additional_input_len) * sizeof (uint8_t)); + (entropy_input_len + additional_input_len) * sizeof (uint8_t)); } input[48U] = (uint8_t)1U; EverCrypt_HMAC_compute_sha2_384(k_0, k, (uint32_t)48U, input, input_len0); @@ -1470,75 +1446,24 @@ generate_sha2_384( { x1 = KRML_EABORT(Hacl_HMAC_DRBG_state, "unreachable (pattern matches are exhaustive in F*)"); } - bool b; if (x1.reseed_counter[0U] > Hacl_HMAC_DRBG_reseed_interval) { - b = false; + return false; + } + Hacl_HMAC_DRBG_state scrut; + if (st_s.tag == SHA2_384_s) + { + scrut = st_s.case_SHA2_384_s; } else { - Hacl_HMAC_DRBG_state scrut; - if (st_s.tag == SHA2_384_s) - { - scrut = st_s.case_SHA2_384_s; - } - else - { - scrut = - KRML_EABORT(Hacl_HMAC_DRBG_state, - "unreachable (pattern matches are exhaustive in F*)"); - } - uint8_t *k = scrut.k; - uint8_t *v = scrut.v; - uint32_t *ctr = scrut.reseed_counter; - if (additional_input_len > (uint32_t)0U) - { - uint32_t input_len = (uint32_t)49U + additional_input_len; - KRML_CHECK_SIZE(sizeof (uint8_t), input_len); - uint8_t input0[input_len]; - memset(input0, 0U, input_len * sizeof (uint8_t)); - uint8_t *k_ = input0; - memcpy(k_, v, (uint32_t)48U * sizeof (uint8_t)); - if (additional_input_len != (uint32_t)0U) - { - memcpy(input0 + (uint32_t)49U, additional_input, additional_input_len * sizeof (uint8_t)); - } - input0[48U] = (uint8_t)0U; - EverCrypt_HMAC_compute_sha2_384(k_, k, (uint32_t)48U, input0, input_len); - EverCrypt_HMAC_compute_sha2_384(v, k_, (uint32_t)48U, v, (uint32_t)48U); - memcpy(k, k_, (uint32_t)48U * sizeof (uint8_t)); - if (additional_input_len != (uint32_t)0U) - { - uint32_t input_len0 = (uint32_t)49U + additional_input_len; - KRML_CHECK_SIZE(sizeof (uint8_t), input_len0); - uint8_t input[input_len0]; - memset(input, 0U, input_len0 * sizeof (uint8_t)); - uint8_t *k_0 = input; - memcpy(k_0, v, (uint32_t)48U * sizeof (uint8_t)); - if (additional_input_len != (uint32_t)0U) - { - memcpy(input + (uint32_t)49U, additional_input, additional_input_len * sizeof (uint8_t)); - } - input[48U] = (uint8_t)1U; - EverCrypt_HMAC_compute_sha2_384(k_0, k, (uint32_t)48U, input, input_len0); - EverCrypt_HMAC_compute_sha2_384(v, k_0, (uint32_t)48U, v, (uint32_t)48U); - memcpy(k, k_0, (uint32_t)48U * sizeof (uint8_t)); - } - } - uint8_t *output1 = output; - uint32_t max = n / (uint32_t)48U; - uint8_t *out = output1; - for (uint32_t i = (uint32_t)0U; i < max; i++) - { - EverCrypt_HMAC_compute_sha2_384(v, k, (uint32_t)48U, v, (uint32_t)48U); - memcpy(out + i * (uint32_t)48U, v, (uint32_t)48U * sizeof (uint8_t)); - } - if (max * (uint32_t)48U < n) - { - uint8_t *block = output1 + max * (uint32_t)48U; - EverCrypt_HMAC_compute_sha2_384(v, k, (uint32_t)48U, v, (uint32_t)48U); - memcpy(block, v, (n - max * (uint32_t)48U) * sizeof (uint8_t)); - } + scrut = KRML_EABORT(Hacl_HMAC_DRBG_state, "unreachable (pattern matches are exhaustive in F*)"); + } + uint8_t *k = scrut.k; + uint8_t *v = scrut.v; + uint32_t *ctr = scrut.reseed_counter; + if (additional_input_len > (uint32_t)0U) + { uint32_t input_len = (uint32_t)49U + additional_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len); uint8_t input0[input_len]; @@ -1570,10 +1495,54 @@ generate_sha2_384( EverCrypt_HMAC_compute_sha2_384(v, k_0, (uint32_t)48U, v, (uint32_t)48U); memcpy(k, k_0, (uint32_t)48U * sizeof (uint8_t)); } - uint32_t old_ctr = ctr[0U]; - ctr[0U] = old_ctr + (uint32_t)1U; - b = true; } + uint8_t *output1 = output; + uint32_t max = n / (uint32_t)48U; + uint8_t *out = output1; + for (uint32_t i = (uint32_t)0U; i < max; i++) + { + EverCrypt_HMAC_compute_sha2_384(v, k, (uint32_t)48U, v, (uint32_t)48U); + memcpy(out + i * (uint32_t)48U, v, (uint32_t)48U * sizeof (uint8_t)); + } + if (max * (uint32_t)48U < n) + { + uint8_t *block = output1 + max * (uint32_t)48U; + EverCrypt_HMAC_compute_sha2_384(v, k, (uint32_t)48U, v, (uint32_t)48U); + memcpy(block, v, (n - max * (uint32_t)48U) * sizeof (uint8_t)); + } + uint32_t input_len = (uint32_t)49U + additional_input_len; + KRML_CHECK_SIZE(sizeof (uint8_t), input_len); + uint8_t input0[input_len]; + memset(input0, 0U, input_len * sizeof (uint8_t)); + uint8_t *k_ = input0; + memcpy(k_, v, (uint32_t)48U * sizeof (uint8_t)); + if (additional_input_len != (uint32_t)0U) + { + memcpy(input0 + (uint32_t)49U, additional_input, additional_input_len * sizeof (uint8_t)); + } + input0[48U] = (uint8_t)0U; + EverCrypt_HMAC_compute_sha2_384(k_, k, (uint32_t)48U, input0, input_len); + EverCrypt_HMAC_compute_sha2_384(v, k_, (uint32_t)48U, v, (uint32_t)48U); + memcpy(k, k_, (uint32_t)48U * sizeof (uint8_t)); + if (additional_input_len != (uint32_t)0U) + { + uint32_t input_len0 = (uint32_t)49U + additional_input_len; + KRML_CHECK_SIZE(sizeof (uint8_t), input_len0); + uint8_t input[input_len0]; + memset(input, 0U, input_len0 * sizeof (uint8_t)); + uint8_t *k_0 = input; + memcpy(k_0, v, (uint32_t)48U * sizeof (uint8_t)); + if (additional_input_len != (uint32_t)0U) + { + memcpy(input + (uint32_t)49U, additional_input, additional_input_len * sizeof (uint8_t)); + } + input[48U] = (uint8_t)1U; + EverCrypt_HMAC_compute_sha2_384(k_0, k, (uint32_t)48U, input, input_len0); + EverCrypt_HMAC_compute_sha2_384(v, k_0, (uint32_t)48U, v, (uint32_t)48U); + memcpy(k, k_0, (uint32_t)48U * sizeof (uint8_t)); + } + uint32_t old_ctr = ctr[0U]; + ctr[0U] = old_ctr + (uint32_t)1U; return true; } @@ -1595,7 +1564,6 @@ generate_sha2_512( { return false; } - uint32_t entropy_input_len = Hacl_HMAC_DRBG_min_length(Spec_Hash_Definitions_SHA2_512); bool ok0; if (additional_input_len > Hacl_HMAC_DRBG_max_additional_input_length) { @@ -1603,11 +1571,11 @@ generate_sha2_512( } else { - uint32_t entropy_input_len1 = Hacl_HMAC_DRBG_min_length(Spec_Hash_Definitions_SHA2_512); - KRML_CHECK_SIZE(sizeof (uint8_t), entropy_input_len1); - uint8_t entropy_input[entropy_input_len1]; - memset(entropy_input, 0U, entropy_input_len1 * sizeof (uint8_t)); - bool ok = Lib_RandomBuffer_System_randombytes(entropy_input, entropy_input_len1); + uint32_t entropy_input_len = Hacl_HMAC_DRBG_min_length(Spec_Hash_Definitions_SHA2_512); + KRML_CHECK_SIZE(sizeof (uint8_t), entropy_input_len); + uint8_t entropy_input[entropy_input_len]; + memset(entropy_input, 0U, entropy_input_len * sizeof (uint8_t)); + bool ok = Lib_RandomBuffer_System_randombytes(entropy_input, entropy_input_len); bool result; if (!ok) { @@ -1616,56 +1584,56 @@ generate_sha2_512( else { EverCrypt_DRBG_state_s st_s = *st; - KRML_CHECK_SIZE(sizeof (uint8_t), entropy_input_len1 + additional_input_len); - uint8_t seed_material[entropy_input_len1 + additional_input_len]; - memset(seed_material, 0U, (entropy_input_len1 + additional_input_len) * sizeof (uint8_t)); - memcpy(seed_material, entropy_input, entropy_input_len1 * sizeof (uint8_t)); - memcpy(seed_material + entropy_input_len1, + KRML_CHECK_SIZE(sizeof (uint8_t), entropy_input_len + additional_input_len); + uint8_t seed_material[entropy_input_len + additional_input_len]; + memset(seed_material, 0U, (entropy_input_len + additional_input_len) * sizeof (uint8_t)); + memcpy(seed_material, entropy_input, entropy_input_len * sizeof (uint8_t)); + memcpy(seed_material + entropy_input_len, additional_input, additional_input_len * sizeof (uint8_t)); - Hacl_HMAC_DRBG_state uu____0; + Hacl_HMAC_DRBG_state scrut; if (st_s.tag == SHA2_512_s) { - uu____0 = st_s.case_SHA2_512_s; + scrut = st_s.case_SHA2_512_s; } else { - uu____0 = + scrut = KRML_EABORT(Hacl_HMAC_DRBG_state, "unreachable (pattern matches are exhaustive in F*)"); } - uint8_t *k = uu____0.k; - uint8_t *v = uu____0.v; - uint32_t *ctr = uu____0.reseed_counter; - uint32_t input_len = (uint32_t)65U + entropy_input_len1 + additional_input_len; + uint8_t *k = scrut.k; + uint8_t *v = scrut.v; + uint32_t *ctr = scrut.reseed_counter; + uint32_t input_len = (uint32_t)65U + entropy_input_len + additional_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len); uint8_t input0[input_len]; memset(input0, 0U, input_len * sizeof (uint8_t)); uint8_t *k_ = input0; memcpy(k_, v, (uint32_t)64U * sizeof (uint8_t)); - if (entropy_input_len1 + additional_input_len != (uint32_t)0U) + if (entropy_input_len + additional_input_len != (uint32_t)0U) { memcpy(input0 + (uint32_t)65U, seed_material, - (entropy_input_len1 + additional_input_len) * sizeof (uint8_t)); + (entropy_input_len + additional_input_len) * sizeof (uint8_t)); } input0[64U] = (uint8_t)0U; EverCrypt_HMAC_compute_sha2_512(k_, k, (uint32_t)64U, input0, input_len); EverCrypt_HMAC_compute_sha2_512(v, k_, (uint32_t)64U, v, (uint32_t)64U); memcpy(k, k_, (uint32_t)64U * sizeof (uint8_t)); - if (entropy_input_len1 + additional_input_len != (uint32_t)0U) + if (entropy_input_len + additional_input_len != (uint32_t)0U) { - uint32_t input_len0 = (uint32_t)65U + entropy_input_len1 + additional_input_len; + uint32_t input_len0 = (uint32_t)65U + entropy_input_len + additional_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len0); uint8_t input[input_len0]; memset(input, 0U, input_len0 * sizeof (uint8_t)); uint8_t *k_0 = input; memcpy(k_0, v, (uint32_t)64U * sizeof (uint8_t)); - if (entropy_input_len1 + additional_input_len != (uint32_t)0U) + if (entropy_input_len + additional_input_len != (uint32_t)0U) { memcpy(input + (uint32_t)65U, seed_material, - (entropy_input_len1 + additional_input_len) * sizeof (uint8_t)); + (entropy_input_len + additional_input_len) * sizeof (uint8_t)); } input[64U] = (uint8_t)1U; EverCrypt_HMAC_compute_sha2_512(k_0, k, (uint32_t)64U, input, input_len0); @@ -1691,75 +1659,24 @@ generate_sha2_512( { x1 = KRML_EABORT(Hacl_HMAC_DRBG_state, "unreachable (pattern matches are exhaustive in F*)"); } - bool b; if (x1.reseed_counter[0U] > Hacl_HMAC_DRBG_reseed_interval) { - b = false; + return false; + } + Hacl_HMAC_DRBG_state scrut; + if (st_s.tag == SHA2_512_s) + { + scrut = st_s.case_SHA2_512_s; } else { - Hacl_HMAC_DRBG_state scrut; - if (st_s.tag == SHA2_512_s) - { - scrut = st_s.case_SHA2_512_s; - } - else - { - scrut = - KRML_EABORT(Hacl_HMAC_DRBG_state, - "unreachable (pattern matches are exhaustive in F*)"); - } - uint8_t *k = scrut.k; - uint8_t *v = scrut.v; - uint32_t *ctr = scrut.reseed_counter; - if (additional_input_len > (uint32_t)0U) - { - uint32_t input_len = (uint32_t)65U + additional_input_len; - KRML_CHECK_SIZE(sizeof (uint8_t), input_len); - uint8_t input0[input_len]; - memset(input0, 0U, input_len * sizeof (uint8_t)); - uint8_t *k_ = input0; - memcpy(k_, v, (uint32_t)64U * sizeof (uint8_t)); - if (additional_input_len != (uint32_t)0U) - { - memcpy(input0 + (uint32_t)65U, additional_input, additional_input_len * sizeof (uint8_t)); - } - input0[64U] = (uint8_t)0U; - EverCrypt_HMAC_compute_sha2_512(k_, k, (uint32_t)64U, input0, input_len); - EverCrypt_HMAC_compute_sha2_512(v, k_, (uint32_t)64U, v, (uint32_t)64U); - memcpy(k, k_, (uint32_t)64U * sizeof (uint8_t)); - if (additional_input_len != (uint32_t)0U) - { - uint32_t input_len0 = (uint32_t)65U + additional_input_len; - KRML_CHECK_SIZE(sizeof (uint8_t), input_len0); - uint8_t input[input_len0]; - memset(input, 0U, input_len0 * sizeof (uint8_t)); - uint8_t *k_0 = input; - memcpy(k_0, v, (uint32_t)64U * sizeof (uint8_t)); - if (additional_input_len != (uint32_t)0U) - { - memcpy(input + (uint32_t)65U, additional_input, additional_input_len * sizeof (uint8_t)); - } - input[64U] = (uint8_t)1U; - EverCrypt_HMAC_compute_sha2_512(k_0, k, (uint32_t)64U, input, input_len0); - EverCrypt_HMAC_compute_sha2_512(v, k_0, (uint32_t)64U, v, (uint32_t)64U); - memcpy(k, k_0, (uint32_t)64U * sizeof (uint8_t)); - } - } - uint8_t *output1 = output; - uint32_t max = n / (uint32_t)64U; - uint8_t *out = output1; - for (uint32_t i = (uint32_t)0U; i < max; i++) - { - EverCrypt_HMAC_compute_sha2_512(v, k, (uint32_t)64U, v, (uint32_t)64U); - memcpy(out + i * (uint32_t)64U, v, (uint32_t)64U * sizeof (uint8_t)); - } - if (max * (uint32_t)64U < n) - { - uint8_t *block = output1 + max * (uint32_t)64U; - EverCrypt_HMAC_compute_sha2_512(v, k, (uint32_t)64U, v, (uint32_t)64U); - memcpy(block, v, (n - max * (uint32_t)64U) * sizeof (uint8_t)); - } + scrut = KRML_EABORT(Hacl_HMAC_DRBG_state, "unreachable (pattern matches are exhaustive in F*)"); + } + uint8_t *k = scrut.k; + uint8_t *v = scrut.v; + uint32_t *ctr = scrut.reseed_counter; + if (additional_input_len > (uint32_t)0U) + { uint32_t input_len = (uint32_t)65U + additional_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len); uint8_t input0[input_len]; @@ -1791,10 +1708,54 @@ generate_sha2_512( EverCrypt_HMAC_compute_sha2_512(v, k_0, (uint32_t)64U, v, (uint32_t)64U); memcpy(k, k_0, (uint32_t)64U * sizeof (uint8_t)); } - uint32_t old_ctr = ctr[0U]; - ctr[0U] = old_ctr + (uint32_t)1U; - b = true; } + uint8_t *output1 = output; + uint32_t max = n / (uint32_t)64U; + uint8_t *out = output1; + for (uint32_t i = (uint32_t)0U; i < max; i++) + { + EverCrypt_HMAC_compute_sha2_512(v, k, (uint32_t)64U, v, (uint32_t)64U); + memcpy(out + i * (uint32_t)64U, v, (uint32_t)64U * sizeof (uint8_t)); + } + if (max * (uint32_t)64U < n) + { + uint8_t *block = output1 + max * (uint32_t)64U; + EverCrypt_HMAC_compute_sha2_512(v, k, (uint32_t)64U, v, (uint32_t)64U); + memcpy(block, v, (n - max * (uint32_t)64U) * sizeof (uint8_t)); + } + uint32_t input_len = (uint32_t)65U + additional_input_len; + KRML_CHECK_SIZE(sizeof (uint8_t), input_len); + uint8_t input0[input_len]; + memset(input0, 0U, input_len * sizeof (uint8_t)); + uint8_t *k_ = input0; + memcpy(k_, v, (uint32_t)64U * sizeof (uint8_t)); + if (additional_input_len != (uint32_t)0U) + { + memcpy(input0 + (uint32_t)65U, additional_input, additional_input_len * sizeof (uint8_t)); + } + input0[64U] = (uint8_t)0U; + EverCrypt_HMAC_compute_sha2_512(k_, k, (uint32_t)64U, input0, input_len); + EverCrypt_HMAC_compute_sha2_512(v, k_, (uint32_t)64U, v, (uint32_t)64U); + memcpy(k, k_, (uint32_t)64U * sizeof (uint8_t)); + if (additional_input_len != (uint32_t)0U) + { + uint32_t input_len0 = (uint32_t)65U + additional_input_len; + KRML_CHECK_SIZE(sizeof (uint8_t), input_len0); + uint8_t input[input_len0]; + memset(input, 0U, input_len0 * sizeof (uint8_t)); + uint8_t *k_0 = input; + memcpy(k_0, v, (uint32_t)64U * sizeof (uint8_t)); + if (additional_input_len != (uint32_t)0U) + { + memcpy(input + (uint32_t)65U, additional_input, additional_input_len * sizeof (uint8_t)); + } + input[64U] = (uint8_t)1U; + EverCrypt_HMAC_compute_sha2_512(k_0, k, (uint32_t)64U, input, input_len0); + EverCrypt_HMAC_compute_sha2_512(v, k_0, (uint32_t)64U, v, (uint32_t)64U); + memcpy(k, k_0, (uint32_t)64U * sizeof (uint8_t)); + } + uint32_t old_ctr = ctr[0U]; + ctr[0U] = old_ctr + (uint32_t)1U; return true; } @@ -1813,8 +1774,8 @@ static void uninstantiate_sha1(EverCrypt_DRBG_state_s *st) uint8_t *k = s.k; uint8_t *v = s.v; uint32_t *ctr = s.reseed_counter; - Lib_Memzero0_memzero(k, (uint32_t)20U * sizeof (k[0U])); - Lib_Memzero0_memzero(v, (uint32_t)20U * sizeof (v[0U])); + Lib_Memzero0_memzero(k, (uint32_t)20U, uint8_t); + Lib_Memzero0_memzero(v, (uint32_t)20U, uint8_t); ctr[0U] = (uint32_t)0U; KRML_HOST_FREE(k); KRML_HOST_FREE(v); @@ -1837,8 +1798,8 @@ static void uninstantiate_sha2_256(EverCrypt_DRBG_state_s *st) uint8_t *k = s.k; uint8_t *v = s.v; uint32_t *ctr = s.reseed_counter; - Lib_Memzero0_memzero(k, (uint32_t)32U * sizeof (k[0U])); - Lib_Memzero0_memzero(v, (uint32_t)32U * sizeof (v[0U])); + Lib_Memzero0_memzero(k, (uint32_t)32U, uint8_t); + Lib_Memzero0_memzero(v, (uint32_t)32U, uint8_t); ctr[0U] = (uint32_t)0U; KRML_HOST_FREE(k); KRML_HOST_FREE(v); @@ -1861,8 +1822,8 @@ static void uninstantiate_sha2_384(EverCrypt_DRBG_state_s *st) uint8_t *k = s.k; uint8_t *v = s.v; uint32_t *ctr = s.reseed_counter; - Lib_Memzero0_memzero(k, (uint32_t)48U * sizeof (k[0U])); - Lib_Memzero0_memzero(v, (uint32_t)48U * sizeof (v[0U])); + Lib_Memzero0_memzero(k, (uint32_t)48U, uint8_t); + Lib_Memzero0_memzero(v, (uint32_t)48U, uint8_t); ctr[0U] = (uint32_t)0U; KRML_HOST_FREE(k); KRML_HOST_FREE(v); @@ -1885,8 +1846,8 @@ static void uninstantiate_sha2_512(EverCrypt_DRBG_state_s *st) uint8_t *k = s.k; uint8_t *v = s.v; uint32_t *ctr = s.reseed_counter; - Lib_Memzero0_memzero(k, (uint32_t)64U * sizeof (k[0U])); - Lib_Memzero0_memzero(v, (uint32_t)64U * sizeof (v[0U])); + Lib_Memzero0_memzero(k, (uint32_t)64U, uint8_t); + Lib_Memzero0_memzero(v, (uint32_t)64U, uint8_t); ctr[0U] = (uint32_t)0U; KRML_HOST_FREE(k); KRML_HOST_FREE(v); diff --git a/src/EverCrypt_HMAC.c b/src/EverCrypt_HMAC.c index 38407793..91440e61 100644 --- a/src/EverCrypt_HMAC.c +++ b/src/EverCrypt_HMAC.c @@ -83,16 +83,18 @@ EverCrypt_HMAC_compute_sha1( KRML_CHECK_SIZE(sizeof (uint8_t), l); uint8_t key_block[l]; memset(key_block, 0U, l * sizeof (uint8_t)); - uint32_t i0; + uint8_t *nkey = key_block; + uint32_t ite; if (key_len <= (uint32_t)64U) { - i0 = key_len; + ite = key_len; } else { - i0 = (uint32_t)20U; + ite = (uint32_t)20U; } - uint8_t *nkey = key_block; + uint8_t *zeroes = key_block + ite; + KRML_HOST_IGNORE(zeroes); if (key_len <= (uint32_t)64U) { memcpy(nkey, key, key_len * sizeof (uint8_t)); @@ -201,16 +203,18 @@ EverCrypt_HMAC_compute_sha2_256( KRML_CHECK_SIZE(sizeof (uint8_t), l); uint8_t key_block[l]; memset(key_block, 0U, l * sizeof (uint8_t)); - uint32_t i0; + uint8_t *nkey = key_block; + uint32_t ite; if (key_len <= (uint32_t)64U) { - i0 = key_len; + ite = key_len; } else { - i0 = (uint32_t)32U; + ite = (uint32_t)32U; } - uint8_t *nkey = key_block; + uint8_t *zeroes = key_block + ite; + KRML_HOST_IGNORE(zeroes); if (key_len <= (uint32_t)64U) { memcpy(nkey, key, key_len * sizeof (uint8_t)); @@ -329,16 +333,18 @@ EverCrypt_HMAC_compute_sha2_384( KRML_CHECK_SIZE(sizeof (uint8_t), l); uint8_t key_block[l]; memset(key_block, 0U, l * sizeof (uint8_t)); - uint32_t i0; + uint8_t *nkey = key_block; + uint32_t ite; if (key_len <= (uint32_t)128U) { - i0 = key_len; + ite = key_len; } else { - i0 = (uint32_t)48U; + ite = (uint32_t)48U; } - uint8_t *nkey = key_block; + uint8_t *zeroes = key_block + ite; + KRML_HOST_IGNORE(zeroes); if (key_len <= (uint32_t)128U) { memcpy(nkey, key, key_len * sizeof (uint8_t)); @@ -458,16 +464,18 @@ EverCrypt_HMAC_compute_sha2_512( KRML_CHECK_SIZE(sizeof (uint8_t), l); uint8_t key_block[l]; memset(key_block, 0U, l * sizeof (uint8_t)); - uint32_t i0; + uint8_t *nkey = key_block; + uint32_t ite; if (key_len <= (uint32_t)128U) { - i0 = key_len; + ite = key_len; } else { - i0 = (uint32_t)64U; + ite = (uint32_t)64U; } - uint8_t *nkey = key_block; + uint8_t *zeroes = key_block + ite; + KRML_HOST_IGNORE(zeroes); if (key_len <= (uint32_t)128U) { memcpy(nkey, key, key_len * sizeof (uint8_t)); @@ -587,16 +595,18 @@ EverCrypt_HMAC_compute_blake2s( KRML_CHECK_SIZE(sizeof (uint8_t), l); uint8_t key_block[l]; memset(key_block, 0U, l * sizeof (uint8_t)); - uint32_t i0; + uint8_t *nkey = key_block; + uint32_t ite; if (key_len <= (uint32_t)64U) { - i0 = key_len; + ite = key_len; } else { - i0 = (uint32_t)32U; + ite = (uint32_t)32U; } - uint8_t *nkey = key_block; + uint8_t *zeroes = key_block + ite; + KRML_HOST_IGNORE(zeroes); if (key_len <= (uint32_t)64U) { memcpy(nkey, key, key_len * sizeof (uint8_t)); @@ -723,16 +733,18 @@ EverCrypt_HMAC_compute_blake2b( KRML_CHECK_SIZE(sizeof (uint8_t), l); uint8_t key_block[l]; memset(key_block, 0U, l * sizeof (uint8_t)); - uint32_t i0; + uint8_t *nkey = key_block; + uint32_t ite; if (key_len <= (uint32_t)128U) { - i0 = key_len; + ite = key_len; } else { - i0 = (uint32_t)64U; + ite = (uint32_t)64U; } - uint8_t *nkey = key_block; + uint8_t *zeroes = key_block + ite; + KRML_HOST_IGNORE(zeroes); if (key_len <= (uint32_t)128U) { memcpy(nkey, key, key_len * sizeof (uint8_t)); diff --git a/src/EverCrypt_Hash.c b/src/EverCrypt_Hash.c index b1004449..914a105f 100644 --- a/src/EverCrypt_Hash.c +++ b/src/EverCrypt_Hash.c @@ -206,8 +206,8 @@ static EverCrypt_Hash_state_s *create_in(Spec_Hash_Definitions_hash_alg a) } case Spec_Hash_Definitions_Blake2S: { - bool vec128 = EverCrypt_AutoConfig2_has_vec128(); #if HACL_CAN_COMPILE_VEC128 + bool vec128 = EverCrypt_AutoConfig2_has_vec128(); if (vec128) { s = @@ -231,8 +231,8 @@ static EverCrypt_Hash_state_s *create_in(Spec_Hash_Definitions_hash_alg a) } case Spec_Hash_Definitions_Blake2B: { - bool vec256 = EverCrypt_AutoConfig2_has_vec256(); #if HACL_CAN_COMPILE_VEC256 + bool vec256 = EverCrypt_AutoConfig2_has_vec256(); if (vec256) { s = @@ -342,6 +342,7 @@ static void init(EverCrypt_Hash_state_s *s) Hacl_Blake2s_128_blake2s_init(p1, (uint32_t)0U, (uint32_t)32U); return; #else + KRML_HOST_IGNORE(p1); return; #endif } @@ -358,6 +359,7 @@ static void init(EverCrypt_Hash_state_s *s) Hacl_Blake2b_256_blake2b_init(p1, (uint32_t)0U, (uint32_t)64U); return; #else + KRML_HOST_IGNORE(p1); return; #endif } @@ -391,17 +393,20 @@ k224_256[64U] = void EverCrypt_Hash_update_multi_256(uint32_t *s, uint8_t *blocks, uint32_t n) { + #if HACL_CAN_COMPILE_VALE bool has_shaext = EverCrypt_AutoConfig2_has_shaext(); bool has_sse = EverCrypt_AutoConfig2_has_sse(); - #if HACL_CAN_COMPILE_VALE if (has_shaext && has_sse) { uint64_t n1 = (uint64_t)n; uint64_t scrut = sha256_update(s, blocks, n1, k224_256); return; } - #endif Hacl_SHA2_Scalar32_sha256_update_nblocks(n * (uint32_t)64U, blocks, s); + #else + KRML_HOST_IGNORE(k224_256); + Hacl_SHA2_Scalar32_sha256_update_nblocks(n * (uint32_t)64U, blocks, s); + #endif } static void @@ -495,6 +500,7 @@ update_multi(EverCrypt_Hash_state_s *s, uint64_t prevlen, uint8_t *blocks, uint3 Hacl_Blake2s_128_blake2s_update_multi(n * (uint32_t)64U, wv, p1, prevlen, blocks, n); return; #else + KRML_HOST_IGNORE(p1); return; #endif } @@ -525,6 +531,7 @@ update_multi(EverCrypt_Hash_state_s *s, uint64_t prevlen, uint8_t *blocks, uint3 n); return; #else + KRML_HOST_IGNORE(p1); return; #endif } @@ -622,6 +629,7 @@ update_last(EverCrypt_Hash_state_s *s, uint64_t prev_len, uint8_t *last, uint32_ Hacl_Blake2s_128_blake2s_update_last(last_len, wv, p1, prev_len, last_len, last); return; #else + KRML_HOST_IGNORE(p1); return; #endif } @@ -650,6 +658,7 @@ update_last(EverCrypt_Hash_state_s *s, uint64_t prev_len, uint8_t *last, uint32_ last); return; #else + KRML_HOST_IGNORE(p1); return; #endif } @@ -736,6 +745,7 @@ static void finish(EverCrypt_Hash_state_s *s, uint8_t *dst) Hacl_Blake2s_128_blake2s_finish((uint32_t)32U, dst, p1); return; #else + KRML_HOST_IGNORE(p1); return; #endif } @@ -752,6 +762,7 @@ static void finish(EverCrypt_Hash_state_s *s, uint8_t *dst) Hacl_Blake2b_256_blake2b_finish((uint32_t)64U, dst, p1); return; #else + KRML_HOST_IGNORE(p1); return; #endif } @@ -1026,6 +1037,7 @@ static void copy(EverCrypt_Hash_state_s *s_src, EverCrypt_Hash_state_s *s_dst) Hacl_Blake2s_128_load_state128s_from_state32(p_dst, p_src); return; #else + KRML_HOST_IGNORE(p_dst); return; #endif } @@ -1052,6 +1064,7 @@ static void copy(EverCrypt_Hash_state_s *s_src, EverCrypt_Hash_state_s *s_dst) Hacl_Blake2b_256_load_state256b_from_state32(p_dst, p_src); return; #else + KRML_HOST_IGNORE(p_dst); return; #endif } @@ -1078,6 +1091,7 @@ static void copy(EverCrypt_Hash_state_s *s_src, EverCrypt_Hash_state_s *s_dst) Hacl_Blake2s_128_store_state128s_to_state32(p_dst, p_src); return; #else + KRML_HOST_IGNORE(p_dst); return; #endif } @@ -1104,6 +1118,7 @@ static void copy(EverCrypt_Hash_state_s *s_src, EverCrypt_Hash_state_s *s_dst) Hacl_Blake2b_256_store_state256b_to_state32(p_dst, p_src); return; #else + KRML_HOST_IGNORE(p_dst); return; #endif } @@ -1281,6 +1296,7 @@ void EverCrypt_Hash_Incremental_init(EverCrypt_Hash_Incremental_hash_state *s) uint8_t *buf = scrut.buf; EverCrypt_Hash_state_s *block_state = scrut.block_state; Spec_Hash_Definitions_hash_alg i = alg_of_state(block_state); + KRML_HOST_IGNORE(i); init(block_state); EverCrypt_Hash_Incremental_hash_state tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; @@ -2038,9 +2054,9 @@ static void finish_blake2s(EverCrypt_Hash_Incremental_hash_state *p, uint8_t *ds r = (uint32_t)(total_len % (uint64_t)block_len(Spec_Hash_Definitions_Blake2S)); } uint8_t *buf_1 = buf_; - bool vec128 = EverCrypt_AutoConfig2_has_vec128(); EverCrypt_Hash_state_s s; #if HACL_CAN_COMPILE_VEC128 + bool vec128 = EverCrypt_AutoConfig2_has_vec128(); KRML_PRE_ALIGN(16) Lib_IntVector_Intrinsics_vec128 buf0[4U] KRML_POST_ALIGN(16) = { 0U }; uint32_t buf[16U] = { 0U }; if (vec128) @@ -2097,9 +2113,9 @@ static void finish_blake2b(EverCrypt_Hash_Incremental_hash_state *p, uint8_t *ds r = (uint32_t)(total_len % (uint64_t)block_len(Spec_Hash_Definitions_Blake2B)); } uint8_t *buf_1 = buf_; - bool vec256 = EverCrypt_AutoConfig2_has_vec256(); EverCrypt_Hash_state_s s; #if HACL_CAN_COMPILE_VEC256 + bool vec256 = EverCrypt_AutoConfig2_has_vec256(); KRML_PRE_ALIGN(32) Lib_IntVector_Intrinsics_vec256 buf0[4U] KRML_POST_ALIGN(32) = { 0U }; uint64_t buf[16U] = { 0U }; if (vec256) @@ -2384,28 +2400,32 @@ EverCrypt_Hash_Incremental_hash( } case Spec_Hash_Definitions_Blake2S: { - bool vec128 = EverCrypt_AutoConfig2_has_vec128(); #if HACL_CAN_COMPILE_VEC128 + bool vec128 = EverCrypt_AutoConfig2_has_vec128(); if (vec128) { Hacl_Blake2s_128_blake2s((uint32_t)32U, dst, len, input, (uint32_t)0U, NULL); return; } - #endif Hacl_Blake2s_32_blake2s((uint32_t)32U, dst, len, input, (uint32_t)0U, NULL); + #else + Hacl_Blake2s_32_blake2s((uint32_t)32U, dst, len, input, (uint32_t)0U, NULL); + #endif break; } case Spec_Hash_Definitions_Blake2B: { - bool vec256 = EverCrypt_AutoConfig2_has_vec256(); #if HACL_CAN_COMPILE_VEC256 + bool vec256 = EverCrypt_AutoConfig2_has_vec256(); if (vec256) { Hacl_Blake2b_256_blake2b((uint32_t)64U, dst, len, input, (uint32_t)0U, NULL); return; } - #endif Hacl_Blake2b_32_blake2b((uint32_t)64U, dst, len, input, (uint32_t)0U, NULL); + #else + Hacl_Blake2b_32_blake2b((uint32_t)64U, dst, len, input, (uint32_t)0U, NULL); + #endif break; } default: diff --git a/src/EverCrypt_Poly1305.c b/src/EverCrypt_Poly1305.c index f05f8e85..717b9527 100644 --- a/src/EverCrypt_Poly1305.c +++ b/src/EverCrypt_Poly1305.c @@ -39,6 +39,7 @@ static void poly1305_vale(uint8_t *dst, uint8_t *src, uint32_t len, uint8_t *key if (n_extra == (uint32_t)0U) { uint64_t scrut = x64_poly1305(ctx, src, (uint64_t)len, (uint64_t)1U); + KRML_HOST_IGNORE((void *)(uint8_t)0U); } else { @@ -46,8 +47,10 @@ static void poly1305_vale(uint8_t *dst, uint8_t *src, uint32_t len, uint8_t *key uint8_t *src16 = src; memcpy(tmp, src + len16, n_extra * sizeof (uint8_t)); uint64_t scrut = x64_poly1305(ctx, src16, (uint64_t)len16, (uint64_t)0U); + KRML_HOST_IGNORE((void *)(uint8_t)0U); memcpy(ctx + (uint32_t)24U, key, (uint32_t)32U * sizeof (uint8_t)); uint64_t scrut0 = x64_poly1305(ctx, tmp, (uint64_t)n_extra, (uint64_t)1U); + KRML_HOST_IGNORE((void *)(uint8_t)0U); } memcpy(dst, ctx, (uint32_t)16U * sizeof (uint8_t)); #endif @@ -60,6 +63,7 @@ void EverCrypt_Poly1305_poly1305(uint8_t *dst, uint8_t *src, uint32_t len, uint8 #if HACL_CAN_COMPILE_VEC256 if (vec256) { + KRML_HOST_IGNORE(vec128); Hacl_Poly1305_256_poly1305_mac(dst, len, src, key); return; } @@ -67,13 +71,17 @@ void EverCrypt_Poly1305_poly1305(uint8_t *dst, uint8_t *src, uint32_t len, uint8 #if HACL_CAN_COMPILE_VEC128 if (vec128) { + KRML_HOST_IGNORE(vec256); Hacl_Poly1305_128_poly1305_mac(dst, len, src, key); return; } #endif + KRML_HOST_IGNORE(vec256); + KRML_HOST_IGNORE(vec128); #if HACL_CAN_COMPILE_VALE poly1305_vale(dst, src, len, key); #else + KRML_HOST_IGNORE(poly1305_vale); Hacl_Poly1305_32_poly1305_mac(dst, len, src, key); #endif } diff --git a/src/Hacl_Bignum.c b/src/Hacl_Bignum.c index 6ad30a2e..fe73faa6 100644 --- a/src/Hacl_Bignum.c +++ b/src/Hacl_Bignum.c @@ -58,6 +58,7 @@ Hacl_Bignum_Karatsuba_bn_karatsuba_mul_uint32( uint32_t x = (((uint32_t)0U - c0) & t0[i]) | (~((uint32_t)0U - c0) & tmp_[i]); os[i] = x; } + KRML_HOST_IGNORE(c10); uint32_t c00 = c0; uint32_t c010 = Hacl_Bignum_Addition_bn_sub_eq_len_u32(len2, b0, b1, tmp_); uint32_t c1 = Hacl_Bignum_Addition_bn_sub_eq_len_u32(len2, b1, b0, t1); @@ -67,6 +68,7 @@ Hacl_Bignum_Karatsuba_bn_karatsuba_mul_uint32( uint32_t x = (((uint32_t)0U - c010) & t1[i]) | (~((uint32_t)0U - c010) & tmp_[i]); os[i] = x; } + KRML_HOST_IGNORE(c1); uint32_t c11 = c010; uint32_t *t23 = tmp + aLen; uint32_t *tmp1 = tmp + aLen + aLen; @@ -150,6 +152,7 @@ Hacl_Bignum_Karatsuba_bn_karatsuba_mul_uint32( uint32_t c8 = r1; uint32_t c = c8; uint32_t c9 = c; + KRML_HOST_IGNORE(c9); } void @@ -182,6 +185,7 @@ Hacl_Bignum_Karatsuba_bn_karatsuba_mul_uint64( uint64_t x = (((uint64_t)0U - c0) & t0[i]) | (~((uint64_t)0U - c0) & tmp_[i]); os[i] = x; } + KRML_HOST_IGNORE(c10); uint64_t c00 = c0; uint64_t c010 = Hacl_Bignum_Addition_bn_sub_eq_len_u64(len2, b0, b1, tmp_); uint64_t c1 = Hacl_Bignum_Addition_bn_sub_eq_len_u64(len2, b1, b0, t1); @@ -191,6 +195,7 @@ Hacl_Bignum_Karatsuba_bn_karatsuba_mul_uint64( uint64_t x = (((uint64_t)0U - c010) & t1[i]) | (~((uint64_t)0U - c010) & tmp_[i]); os[i] = x; } + KRML_HOST_IGNORE(c1); uint64_t c11 = c010; uint64_t *t23 = tmp + aLen; uint64_t *tmp1 = tmp + aLen + aLen; @@ -274,6 +279,7 @@ Hacl_Bignum_Karatsuba_bn_karatsuba_mul_uint64( uint64_t c8 = r1; uint64_t c = c8; uint64_t c9 = c; + KRML_HOST_IGNORE(c9); } void @@ -302,7 +308,9 @@ Hacl_Bignum_Karatsuba_bn_karatsuba_sqr_uint32( uint32_t x = (((uint32_t)0U - c0) & t0[i]) | (~((uint32_t)0U - c0) & tmp_[i]); os[i] = x; } + KRML_HOST_IGNORE(c1); uint32_t c00 = c0; + KRML_HOST_IGNORE(c00); uint32_t *t23 = tmp + aLen; uint32_t *tmp1 = tmp + aLen + aLen; Hacl_Bignum_Karatsuba_bn_karatsuba_sqr_uint32(len2, t0, tmp1, t23); @@ -373,6 +381,7 @@ Hacl_Bignum_Karatsuba_bn_karatsuba_sqr_uint32( uint32_t c8 = r1; uint32_t c = c8; uint32_t c9 = c; + KRML_HOST_IGNORE(c9); } void @@ -401,7 +410,9 @@ Hacl_Bignum_Karatsuba_bn_karatsuba_sqr_uint64( uint64_t x = (((uint64_t)0U - c0) & t0[i]) | (~((uint64_t)0U - c0) & tmp_[i]); os[i] = x; } + KRML_HOST_IGNORE(c1); uint64_t c00 = c0; + KRML_HOST_IGNORE(c00); uint64_t *t23 = tmp + aLen; uint64_t *tmp1 = tmp + aLen + aLen; Hacl_Bignum_Karatsuba_bn_karatsuba_sqr_uint64(len2, t0, tmp1, t23); @@ -472,6 +483,7 @@ Hacl_Bignum_Karatsuba_bn_karatsuba_sqr_uint64( uint64_t c8 = r1; uint64_t c = c8; uint64_t c9 = c; + KRML_HOST_IGNORE(c9); } void @@ -696,6 +708,7 @@ Hacl_Bignum_bn_sub_mod_n_u32( c = Lib_IntTypes_Intrinsics_add_carry_u32(c, t1, t2, res_i); } uint32_t c1 = c; + KRML_HOST_IGNORE(c1); uint32_t c2 = (uint32_t)0U - c00; for (uint32_t i = (uint32_t)0U; i < len1; i++) { @@ -773,6 +786,7 @@ Hacl_Bignum_bn_sub_mod_n_u64( c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t1, t2, res_i); } uint64_t c1 = c; + KRML_HOST_IGNORE(c1); uint64_t c2 = (uint64_t)0U - c00; for (uint32_t i = (uint32_t)0U; i < len1; i++) { @@ -1266,6 +1280,7 @@ bn_almost_mont_reduction_u32( uint32_t tmp[len]; memset(tmp, 0U, len * sizeof (uint32_t)); uint32_t c1 = Hacl_Bignum_Addition_bn_sub_eq_len_u32(len, res, n, tmp); + KRML_HOST_IGNORE(c1); uint32_t m = (uint32_t)0U - c00; for (uint32_t i = (uint32_t)0U; i < len; i++) { @@ -1362,6 +1377,7 @@ bn_almost_mont_reduction_u64( uint64_t tmp[len]; memset(tmp, 0U, len * sizeof (uint64_t)); uint64_t c1 = Hacl_Bignum_Addition_bn_sub_eq_len_u64(len, res, n, tmp); + KRML_HOST_IGNORE(c1); uint64_t m = (uint64_t)0U - c00; for (uint32_t i = (uint32_t)0U; i < len; i++) { diff --git a/src/Hacl_Bignum256.c b/src/Hacl_Bignum256.c index 7318984e..41aaadeb 100644 --- a/src/Hacl_Bignum256.c +++ b/src/Hacl_Bignum256.c @@ -229,6 +229,7 @@ void Hacl_Bignum256_sub_mod(uint64_t *n, uint64_t *a, uint64_t *b, uint64_t *res c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t12, t2, res_i); } uint64_t c1 = c; + KRML_HOST_IGNORE(c1); uint64_t c2 = (uint64_t)0U - c00; KRML_MAYBE_FOR4(i, (uint32_t)0U, @@ -314,6 +315,7 @@ void Hacl_Bignum256_sqr(uint64_t *a, uint64_t *res) uint64_t r = c; res[i0 + i0] = r;); uint64_t c0 = Hacl_Bignum_Addition_bn_add_eq_len_u64((uint32_t)8U, res, res, res); + KRML_HOST_IGNORE(c0); uint64_t tmp[8U] = { 0U }; KRML_MAYBE_FOR4(i, (uint32_t)0U, @@ -325,6 +327,7 @@ void Hacl_Bignum256_sqr(uint64_t *a, uint64_t *res) tmp[(uint32_t)2U * i] = lo; tmp[(uint32_t)2U * i + (uint32_t)1U] = hi;); uint64_t c1 = Hacl_Bignum_Addition_bn_add_eq_len_u64((uint32_t)8U, res, tmp, res); + KRML_HOST_IGNORE(c1); } static inline void precompr2(uint32_t nBits, uint64_t *n, uint64_t *res) @@ -441,6 +444,7 @@ static inline void areduction(uint64_t *n, uint64_t nInv, uint64_t *c, uint64_t uint64_t c00 = c0; uint64_t tmp[4U] = { 0U }; uint64_t c1 = Hacl_Bignum256_sub(res, n, tmp); + KRML_HOST_IGNORE(c1); uint64_t m = (uint64_t)0U - c00; KRML_MAYBE_FOR4(i, (uint32_t)0U, @@ -518,6 +522,7 @@ static inline void amont_sqr(uint64_t *n, uint64_t nInv_u64, uint64_t *aM, uint6 uint64_t r = c1; c[i0 + i0] = r;); uint64_t c0 = Hacl_Bignum_Addition_bn_add_eq_len_u64((uint32_t)8U, c, c, c); + KRML_HOST_IGNORE(c0); uint64_t tmp[8U] = { 0U }; KRML_MAYBE_FOR4(i, (uint32_t)0U, @@ -529,6 +534,7 @@ static inline void amont_sqr(uint64_t *n, uint64_t nInv_u64, uint64_t *aM, uint6 tmp[(uint32_t)2U * i] = lo; tmp[(uint32_t)2U * i + (uint32_t)1U] = hi;); uint64_t c1 = Hacl_Bignum_Addition_bn_add_eq_len_u64((uint32_t)8U, c, tmp, c); + KRML_HOST_IGNORE(c1); areduction(n, nInv_u64, c, resM); } @@ -569,6 +575,7 @@ bn_slow_precomp(uint64_t *n, uint64_t mu, uint64_t *r2, uint64_t *a, uint64_t *r uint64_t c00 = c0; uint64_t tmp[4U] = { 0U }; uint64_t c1 = Hacl_Bignum256_sub(a_mod, n, tmp); + KRML_HOST_IGNORE(c1); uint64_t m = (uint64_t)0U - c00; KRML_MAYBE_FOR4(i, (uint32_t)0U, @@ -1154,6 +1161,7 @@ bool Hacl_Bignum256_mod_inv_prime_vartime(uint64_t *n, uint64_t *a, uint64_t *re c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t1, (uint64_t)0U, res_i);); uint64_t c1 = c; uint64_t c2 = c1; + KRML_HOST_IGNORE(c2); exp_vartime(nBits, n, a, (uint32_t)256U, n2, res); } else @@ -1335,6 +1343,7 @@ Hacl_Bignum256_mod_inv_prime_vartime_precomp( c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t1, (uint64_t)0U, res_i);); uint64_t c1 = c; uint64_t c2 = c1; + KRML_HOST_IGNORE(c2); exp_vartime_precomp(k1.n, k1.mu, k1.r2, a, (uint32_t)256U, n2, res); } @@ -1453,6 +1462,7 @@ Serialize a bignum into big-endian memory. void Hacl_Bignum256_bn_to_bytes_be(uint64_t *b, uint8_t *res) { uint8_t tmp[32U] = { 0U }; + KRML_HOST_IGNORE(tmp); KRML_MAYBE_FOR4(i, (uint32_t)0U, (uint32_t)4U, @@ -1469,6 +1479,7 @@ Serialize a bignum into little-endian memory. void Hacl_Bignum256_bn_to_bytes_le(uint64_t *b, uint8_t *res) { uint8_t tmp[32U] = { 0U }; + KRML_HOST_IGNORE(tmp); KRML_MAYBE_FOR4(i, (uint32_t)0U, (uint32_t)4U, diff --git a/src/Hacl_Bignum256_32.c b/src/Hacl_Bignum256_32.c index a4f80671..ada15309 100644 --- a/src/Hacl_Bignum256_32.c +++ b/src/Hacl_Bignum256_32.c @@ -241,6 +241,7 @@ void Hacl_Bignum256_32_sub_mod(uint32_t *n, uint32_t *a, uint32_t *b, uint32_t * uint32_t *res_i = tmp + (uint32_t)4U * i + (uint32_t)3U; c = Lib_IntTypes_Intrinsics_add_carry_u32(c, t12, t2, res_i);); uint32_t c1 = c; + KRML_HOST_IGNORE(c1); uint32_t c2 = (uint32_t)0U - c00; KRML_MAYBE_FOR8(i, (uint32_t)0U, @@ -328,6 +329,7 @@ void Hacl_Bignum256_32_sqr(uint32_t *a, uint32_t *res) uint32_t r = c; res[i0 + i0] = r;); uint32_t c0 = Hacl_Bignum_Addition_bn_add_eq_len_u32((uint32_t)16U, res, res, res); + KRML_HOST_IGNORE(c0); uint32_t tmp[16U] = { 0U }; KRML_MAYBE_FOR8(i, (uint32_t)0U, @@ -339,6 +341,7 @@ void Hacl_Bignum256_32_sqr(uint32_t *a, uint32_t *res) tmp[(uint32_t)2U * i] = lo; tmp[(uint32_t)2U * i + (uint32_t)1U] = hi;); uint32_t c1 = Hacl_Bignum_Addition_bn_add_eq_len_u32((uint32_t)16U, res, tmp, res); + KRML_HOST_IGNORE(c1); } static inline void precompr2(uint32_t nBits, uint32_t *n, uint32_t *res) @@ -461,6 +464,7 @@ static inline void areduction(uint32_t *n, uint32_t nInv, uint32_t *c, uint32_t uint32_t c00 = c0; uint32_t tmp[8U] = { 0U }; uint32_t c1 = Hacl_Bignum256_32_sub(res, n, tmp); + KRML_HOST_IGNORE(c1); uint32_t m = (uint32_t)0U - c00; KRML_MAYBE_FOR8(i, (uint32_t)0U, @@ -540,6 +544,7 @@ static inline void amont_sqr(uint32_t *n, uint32_t nInv_u64, uint32_t *aM, uint3 uint32_t r = c1; c[i0 + i0] = r;); uint32_t c0 = Hacl_Bignum_Addition_bn_add_eq_len_u32((uint32_t)16U, c, c, c); + KRML_HOST_IGNORE(c0); uint32_t tmp[16U] = { 0U }; KRML_MAYBE_FOR8(i, (uint32_t)0U, @@ -551,6 +556,7 @@ static inline void amont_sqr(uint32_t *n, uint32_t nInv_u64, uint32_t *aM, uint3 tmp[(uint32_t)2U * i] = lo; tmp[(uint32_t)2U * i + (uint32_t)1U] = hi;); uint32_t c1 = Hacl_Bignum_Addition_bn_add_eq_len_u32((uint32_t)16U, c, tmp, c); + KRML_HOST_IGNORE(c1); areduction(n, nInv_u64, c, resM); } @@ -593,6 +599,7 @@ bn_slow_precomp(uint32_t *n, uint32_t mu, uint32_t *r2, uint32_t *a, uint32_t *r uint32_t c00 = c0; uint32_t tmp[8U] = { 0U }; uint32_t c1 = Hacl_Bignum256_32_sub(a_mod, n, tmp); + KRML_HOST_IGNORE(c1); uint32_t m = (uint32_t)0U - c00; KRML_MAYBE_FOR8(i, (uint32_t)0U, @@ -1188,6 +1195,7 @@ bool Hacl_Bignum256_32_mod_inv_prime_vartime(uint32_t *n, uint32_t *a, uint32_t c = Lib_IntTypes_Intrinsics_sub_borrow_u32(c, t1, (uint32_t)0U, res_i);); uint32_t c1 = c; uint32_t c2 = c1; + KRML_HOST_IGNORE(c2); exp_vartime(nBits, n, a, (uint32_t)256U, n2, res); } else @@ -1382,6 +1390,7 @@ Hacl_Bignum256_32_mod_inv_prime_vartime_precomp( c = Lib_IntTypes_Intrinsics_sub_borrow_u32(c, t1, (uint32_t)0U, res_i);); uint32_t c1 = c; uint32_t c2 = c1; + KRML_HOST_IGNORE(c2); exp_vartime_precomp(k1.n, k1.mu, k1.r2, a, (uint32_t)256U, n2, res); } @@ -1500,6 +1509,7 @@ Serialize a bignum into big-endian memory. void Hacl_Bignum256_32_bn_to_bytes_be(uint32_t *b, uint8_t *res) { uint8_t tmp[32U] = { 0U }; + KRML_HOST_IGNORE(tmp); KRML_MAYBE_FOR8(i, (uint32_t)0U, (uint32_t)8U, @@ -1516,6 +1526,7 @@ Serialize a bignum into little-endian memory. void Hacl_Bignum256_32_bn_to_bytes_le(uint32_t *b, uint8_t *res) { uint8_t tmp[32U] = { 0U }; + KRML_HOST_IGNORE(tmp); KRML_MAYBE_FOR8(i, (uint32_t)0U, (uint32_t)8U, diff --git a/src/Hacl_Bignum32.c b/src/Hacl_Bignum32.c index 2bb4d126..a9bb4986 100644 --- a/src/Hacl_Bignum32.c +++ b/src/Hacl_Bignum32.c @@ -181,6 +181,7 @@ bn_slow_precomp( uint32_t tmp0[len]; memset(tmp0, 0U, len * sizeof (uint32_t)); uint32_t c1 = Hacl_Bignum_Addition_bn_sub_eq_len_u32(len, a_mod, n, tmp0); + KRML_HOST_IGNORE(c1); uint32_t m = (uint32_t)0U - c00; for (uint32_t i = (uint32_t)0U; i < len; i++) { @@ -431,6 +432,7 @@ bool Hacl_Bignum32_mod_inv_prime_vartime(uint32_t len, uint32_t *n, uint32_t *a, { c1 = c0; } + KRML_HOST_IGNORE(c1); Hacl_Bignum_Exponentiation_bn_mod_exp_vartime_u32(len, nBits, n, @@ -670,6 +672,7 @@ Hacl_Bignum32_mod_inv_prime_vartime_precomp( { c1 = c0; } + KRML_HOST_IGNORE(c1); Hacl_Bignum_Exponentiation_bn_mod_exp_vartime_precomp_u32(len1, k1.n, k1.mu, diff --git a/src/Hacl_Bignum4096.c b/src/Hacl_Bignum4096.c index 80c62046..bf8fd6d2 100644 --- a/src/Hacl_Bignum4096.c +++ b/src/Hacl_Bignum4096.c @@ -243,6 +243,7 @@ void Hacl_Bignum4096_sub_mod(uint64_t *n, uint64_t *a, uint64_t *b, uint64_t *re uint64_t *res_i = tmp + (uint32_t)4U * i + (uint32_t)3U; c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t12, t2, res_i);); uint64_t c1 = c; + KRML_HOST_IGNORE(c1); uint64_t c2 = (uint64_t)0U - c00; for (uint32_t i = (uint32_t)0U; i < (uint32_t)64U; i++) { @@ -393,6 +394,7 @@ static inline void areduction(uint64_t *n, uint64_t nInv, uint64_t *c, uint64_t uint64_t c00 = c0; uint64_t tmp[64U] = { 0U }; uint64_t c1 = Hacl_Bignum4096_sub(res, n, tmp); + KRML_HOST_IGNORE(c1); uint64_t m = (uint64_t)0U - c00; for (uint32_t i = (uint32_t)0U; i < (uint32_t)64U; i++) { @@ -457,6 +459,7 @@ bn_slow_precomp(uint64_t *n, uint64_t mu, uint64_t *r2, uint64_t *a, uint64_t *r uint64_t c00 = c0; uint64_t tmp[64U] = { 0U }; uint64_t c1 = Hacl_Bignum4096_sub(a_mod, n, tmp); + KRML_HOST_IGNORE(c1); uint64_t m = (uint64_t)0U - c00; for (uint32_t i = (uint32_t)0U; i < (uint32_t)64U; i++) { @@ -1047,6 +1050,7 @@ bool Hacl_Bignum4096_mod_inv_prime_vartime(uint64_t *n, uint64_t *a, uint64_t *r c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t1, (uint64_t)0U, res_i);); uint64_t c1 = c; uint64_t c2 = c1; + KRML_HOST_IGNORE(c2); exp_vartime(nBits, n, a, (uint32_t)4096U, n2, res); } else @@ -1244,6 +1248,7 @@ Hacl_Bignum4096_mod_inv_prime_vartime_precomp( c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t1, (uint64_t)0U, res_i);); uint64_t c1 = c; uint64_t c2 = c1; + KRML_HOST_IGNORE(c2); exp_vartime_precomp(k1.n, k1.mu, k1.r2, a, (uint32_t)4096U, n2, res); } @@ -1362,6 +1367,7 @@ Serialize a bignum into big-endian memory. void Hacl_Bignum4096_bn_to_bytes_be(uint64_t *b, uint8_t *res) { uint8_t tmp[512U] = { 0U }; + KRML_HOST_IGNORE(tmp); for (uint32_t i = (uint32_t)0U; i < (uint32_t)64U; i++) { store64_be(res + i * (uint32_t)8U, b[(uint32_t)64U - i - (uint32_t)1U]); @@ -1377,6 +1383,7 @@ Serialize a bignum into little-endian memory. void Hacl_Bignum4096_bn_to_bytes_le(uint64_t *b, uint8_t *res) { uint8_t tmp[512U] = { 0U }; + KRML_HOST_IGNORE(tmp); for (uint32_t i = (uint32_t)0U; i < (uint32_t)64U; i++) { store64_le(res + i * (uint32_t)8U, b[i]); diff --git a/src/Hacl_Bignum4096_32.c b/src/Hacl_Bignum4096_32.c index 16ba485f..2f8d70f1 100644 --- a/src/Hacl_Bignum4096_32.c +++ b/src/Hacl_Bignum4096_32.c @@ -238,6 +238,7 @@ void Hacl_Bignum4096_32_sub_mod(uint32_t *n, uint32_t *a, uint32_t *b, uint32_t c = Lib_IntTypes_Intrinsics_add_carry_u32(c, t12, t2, res_i); } uint32_t c1 = c; + KRML_HOST_IGNORE(c1); uint32_t c2 = (uint32_t)0U - c00; for (uint32_t i = (uint32_t)0U; i < (uint32_t)128U; i++) { @@ -385,6 +386,7 @@ static inline void areduction(uint32_t *n, uint32_t nInv, uint32_t *c, uint32_t uint32_t c00 = c0; uint32_t tmp[128U] = { 0U }; uint32_t c1 = Hacl_Bignum4096_32_sub(res, n, tmp); + KRML_HOST_IGNORE(c1); uint32_t m = (uint32_t)0U - c00; for (uint32_t i = (uint32_t)0U; i < (uint32_t)128U; i++) { @@ -448,6 +450,7 @@ bn_slow_precomp(uint32_t *n, uint32_t mu, uint32_t *r2, uint32_t *a, uint32_t *r uint32_t c00 = c0; uint32_t tmp[128U] = { 0U }; uint32_t c1 = Hacl_Bignum4096_32_sub(a_mod, n, tmp); + KRML_HOST_IGNORE(c1); uint32_t m = (uint32_t)0U - c00; for (uint32_t i = (uint32_t)0U; i < (uint32_t)128U; i++) { @@ -1033,6 +1036,7 @@ bool Hacl_Bignum4096_32_mod_inv_prime_vartime(uint32_t *n, uint32_t *a, uint32_t c = Lib_IntTypes_Intrinsics_sub_borrow_u32(c, t1, (uint32_t)0U, res_i);); uint32_t c1 = c; uint32_t c2 = c1; + KRML_HOST_IGNORE(c2); exp_vartime(nBits, n, a, (uint32_t)4096U, n2, res); } else @@ -1228,6 +1232,7 @@ Hacl_Bignum4096_32_mod_inv_prime_vartime_precomp( c = Lib_IntTypes_Intrinsics_sub_borrow_u32(c, t1, (uint32_t)0U, res_i);); uint32_t c1 = c; uint32_t c2 = c1; + KRML_HOST_IGNORE(c2); exp_vartime_precomp(k1.n, k1.mu, k1.r2, a, (uint32_t)4096U, n2, res); } @@ -1346,6 +1351,7 @@ Serialize a bignum into big-endian memory. void Hacl_Bignum4096_32_bn_to_bytes_be(uint32_t *b, uint8_t *res) { uint8_t tmp[512U] = { 0U }; + KRML_HOST_IGNORE(tmp); for (uint32_t i = (uint32_t)0U; i < (uint32_t)128U; i++) { store32_be(res + i * (uint32_t)4U, b[(uint32_t)128U - i - (uint32_t)1U]); @@ -1361,6 +1367,7 @@ Serialize a bignum into little-endian memory. void Hacl_Bignum4096_32_bn_to_bytes_le(uint32_t *b, uint8_t *res) { uint8_t tmp[512U] = { 0U }; + KRML_HOST_IGNORE(tmp); for (uint32_t i = (uint32_t)0U; i < (uint32_t)128U; i++) { store32_le(res + i * (uint32_t)4U, b[i]); diff --git a/src/Hacl_Bignum64.c b/src/Hacl_Bignum64.c index 9fd8c4c6..7300a993 100644 --- a/src/Hacl_Bignum64.c +++ b/src/Hacl_Bignum64.c @@ -180,6 +180,7 @@ bn_slow_precomp( uint64_t tmp0[len]; memset(tmp0, 0U, len * sizeof (uint64_t)); uint64_t c1 = Hacl_Bignum_Addition_bn_sub_eq_len_u64(len, a_mod, n, tmp0); + KRML_HOST_IGNORE(c1); uint64_t m = (uint64_t)0U - c00; for (uint32_t i = (uint32_t)0U; i < len; i++) { @@ -430,6 +431,7 @@ bool Hacl_Bignum64_mod_inv_prime_vartime(uint32_t len, uint64_t *n, uint64_t *a, { c1 = c0; } + KRML_HOST_IGNORE(c1); Hacl_Bignum_Exponentiation_bn_mod_exp_vartime_u64(len, nBits, n, @@ -669,6 +671,7 @@ Hacl_Bignum64_mod_inv_prime_vartime_precomp( { c1 = c0; } + KRML_HOST_IGNORE(c1); Hacl_Bignum_Exponentiation_bn_mod_exp_vartime_precomp_u64(len1, k1.n, k1.mu, diff --git a/src/Hacl_Ed25519.c b/src/Hacl_Ed25519.c index 39d25998..9d7c3bd4 100644 --- a/src/Hacl_Ed25519.c +++ b/src/Hacl_Ed25519.c @@ -1483,6 +1483,9 @@ static inline void point_mul_g(uint64_t *out, uint8_t *scalar) uint64_t bits_l2 = Hacl_Bignum_Lib_bn_get_bits_u64((uint32_t)1U, r1, k2, (uint32_t)4U); precomp_get_consttime(Hacl_Ed25519_PrecompTable_precomp_basepoint_table_w4, bits_l2, tmp); Hacl_Impl_Ed25519_PointAdd_point_add(out, out, tmp);); + KRML_HOST_IGNORE(q2); + KRML_HOST_IGNORE(q3); + KRML_HOST_IGNORE(q4); } static inline void @@ -1717,8 +1720,10 @@ static inline void sha512_pre_msg(uint8_t *hash, uint8_t *prefix, uint32_t len, Hacl_SHA2_Scalar32_sha512_init(block_state); Hacl_Streaming_MD_state_64 *st = &p; Hacl_Streaming_Types_error_code - uu____0 = Hacl_Streaming_SHA2_update_512(st, prefix, (uint32_t)32U); - Hacl_Streaming_Types_error_code uu____1 = Hacl_Streaming_SHA2_update_512(st, input, len); + err0 = Hacl_Streaming_SHA2_update_512(st, prefix, (uint32_t)32U); + Hacl_Streaming_Types_error_code err1 = Hacl_Streaming_SHA2_update_512(st, input, len); + KRML_HOST_IGNORE(err0); + KRML_HOST_IGNORE(err1); Hacl_Streaming_SHA2_finish_512(st, hash); } @@ -1739,10 +1744,13 @@ sha512_pre_pre2_msg( Hacl_SHA2_Scalar32_sha512_init(block_state); Hacl_Streaming_MD_state_64 *st = &p; Hacl_Streaming_Types_error_code - uu____0 = Hacl_Streaming_SHA2_update_512(st, prefix, (uint32_t)32U); + err0 = Hacl_Streaming_SHA2_update_512(st, prefix, (uint32_t)32U); Hacl_Streaming_Types_error_code - uu____1 = Hacl_Streaming_SHA2_update_512(st, prefix2, (uint32_t)32U); - Hacl_Streaming_Types_error_code uu____2 = Hacl_Streaming_SHA2_update_512(st, input, len); + err1 = Hacl_Streaming_SHA2_update_512(st, prefix2, (uint32_t)32U); + Hacl_Streaming_Types_error_code err2 = Hacl_Streaming_SHA2_update_512(st, input, len); + KRML_HOST_IGNORE(err0); + KRML_HOST_IGNORE(err1); + KRML_HOST_IGNORE(err2); Hacl_Streaming_SHA2_finish_512(st, hash); } diff --git a/src/Hacl_Frodo1344.c b/src/Hacl_Frodo1344.c index 81bddfd9..0696f34c 100644 --- a/src/Hacl_Frodo1344.c +++ b/src/Hacl_Frodo1344.c @@ -27,6 +27,7 @@ #include "internal/Hacl_Spec.h" #include "internal/Hacl_Frodo_KEM.h" +#include "lib_memzero0.h" uint32_t Hacl_Frodo1344_crypto_bytes = (uint32_t)32U; @@ -54,7 +55,7 @@ uint32_t Hacl_Frodo1344_crypto_kem_keypair(uint8_t *pk, uint8_t *sk) shake_input_seed_se[0U] = (uint8_t)0x5fU; memcpy(shake_input_seed_se + (uint32_t)1U, seed_se, (uint32_t)32U * sizeof (uint8_t)); Hacl_SHA3_shake256_hacl((uint32_t)33U, shake_input_seed_se, (uint32_t)43008U, r); - Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)33U * sizeof (shake_input_seed_se[0U])); + Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)33U, uint8_t); Hacl_Impl_Frodo_Sample_frodo_sample_matrix1344((uint32_t)1344U, (uint32_t)8U, r, s_matrix); Hacl_Impl_Frodo_Sample_frodo_sample_matrix1344((uint32_t)1344U, (uint32_t)8U, @@ -80,14 +81,14 @@ uint32_t Hacl_Frodo1344_crypto_kem_keypair(uint8_t *pk, uint8_t *sk) b_matrix, b_bytes); Hacl_Impl_Matrix_matrix_to_lbytes((uint32_t)1344U, (uint32_t)8U, s_matrix, s_bytes); - Lib_Memzero0_memzero(s_matrix, (uint32_t)10752U * sizeof (s_matrix[0U])); - Lib_Memzero0_memzero(e_matrix, (uint32_t)10752U * sizeof (e_matrix[0U])); + Lib_Memzero0_memzero(s_matrix, (uint32_t)10752U, uint16_t); + Lib_Memzero0_memzero(e_matrix, (uint32_t)10752U, uint16_t); uint32_t slen1 = (uint32_t)43056U; uint8_t *sk_p = sk; memcpy(sk_p, s, (uint32_t)32U * sizeof (uint8_t)); memcpy(sk_p + (uint32_t)32U, pk, (uint32_t)21520U * sizeof (uint8_t)); Hacl_SHA3_shake256_hacl((uint32_t)21520U, pk, (uint32_t)32U, sk + slen1); - Lib_Memzero0_memzero(coins, (uint32_t)80U * sizeof (coins[0U])); + Lib_Memzero0_memzero(coins, (uint32_t)80U, uint8_t); return (uint32_t)0U; } @@ -112,7 +113,7 @@ uint32_t Hacl_Frodo1344_crypto_kem_enc(uint8_t *ct, uint8_t *ss, uint8_t *pk) shake_input_seed_se[0U] = (uint8_t)0x96U; memcpy(shake_input_seed_se + (uint32_t)1U, seed_se, (uint32_t)32U * sizeof (uint8_t)); Hacl_SHA3_shake256_hacl((uint32_t)33U, shake_input_seed_se, (uint32_t)43136U, r); - Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)33U * sizeof (shake_input_seed_se[0U])); + Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)33U, uint8_t); Hacl_Impl_Frodo_Sample_frodo_sample_matrix1344((uint32_t)8U, (uint32_t)1344U, r, sp_matrix); Hacl_Impl_Frodo_Sample_frodo_sample_matrix1344((uint32_t)8U, (uint32_t)1344U, @@ -156,12 +157,12 @@ uint32_t Hacl_Frodo1344_crypto_kem_enc(uint8_t *ct, uint8_t *ss, uint8_t *pk) coins, mu_encode); Hacl_Impl_Matrix_matrix_add((uint32_t)8U, (uint32_t)8U, v_matrix, mu_encode); - Lib_Memzero0_memzero(mu_encode, (uint32_t)64U * sizeof (mu_encode[0U])); + Lib_Memzero0_memzero(mu_encode, (uint32_t)64U, uint16_t); Hacl_Impl_Frodo_Pack_frodo_pack((uint32_t)8U, (uint32_t)8U, (uint32_t)16U, v_matrix, c2); - Lib_Memzero0_memzero(v_matrix, (uint32_t)64U * sizeof (v_matrix[0U])); - Lib_Memzero0_memzero(sp_matrix, (uint32_t)10752U * sizeof (sp_matrix[0U])); - Lib_Memzero0_memzero(ep_matrix, (uint32_t)10752U * sizeof (ep_matrix[0U])); - Lib_Memzero0_memzero(epp_matrix, (uint32_t)64U * sizeof (epp_matrix[0U])); + Lib_Memzero0_memzero(v_matrix, (uint32_t)64U, uint16_t); + Lib_Memzero0_memzero(sp_matrix, (uint32_t)10752U, uint16_t); + Lib_Memzero0_memzero(ep_matrix, (uint32_t)10752U, uint16_t); + Lib_Memzero0_memzero(epp_matrix, (uint32_t)64U, uint16_t); uint32_t ss_init_len = (uint32_t)21664U; KRML_CHECK_SIZE(sizeof (uint8_t), ss_init_len); uint8_t shake_input_ss[ss_init_len]; @@ -169,9 +170,9 @@ uint32_t Hacl_Frodo1344_crypto_kem_enc(uint8_t *ct, uint8_t *ss, uint8_t *pk) memcpy(shake_input_ss, ct, (uint32_t)21632U * sizeof (uint8_t)); memcpy(shake_input_ss + (uint32_t)21632U, k, (uint32_t)32U * sizeof (uint8_t)); Hacl_SHA3_shake256_hacl(ss_init_len, shake_input_ss, (uint32_t)32U, ss); - Lib_Memzero0_memzero(shake_input_ss, ss_init_len * sizeof (shake_input_ss[0U])); - Lib_Memzero0_memzero(seed_se_k, (uint32_t)64U * sizeof (seed_se_k[0U])); - Lib_Memzero0_memzero(coins, (uint32_t)32U * sizeof (coins[0U])); + Lib_Memzero0_memzero(shake_input_ss, ss_init_len, uint8_t); + Lib_Memzero0_memzero(seed_se_k, (uint32_t)64U, uint8_t); + Lib_Memzero0_memzero(coins, (uint32_t)32U, uint8_t); return (uint32_t)0U; } @@ -200,8 +201,8 @@ uint32_t Hacl_Frodo1344_crypto_kem_dec(uint8_t *ss, uint8_t *ct, uint8_t *sk) (uint32_t)8U, m_matrix, mu_decode); - Lib_Memzero0_memzero(s_matrix, (uint32_t)10752U * sizeof (s_matrix[0U])); - Lib_Memzero0_memzero(m_matrix, (uint32_t)64U * sizeof (m_matrix[0U])); + Lib_Memzero0_memzero(s_matrix, (uint32_t)10752U, uint16_t); + Lib_Memzero0_memzero(m_matrix, (uint32_t)64U, uint16_t); uint8_t seed_se_k[64U] = { 0U }; uint32_t pkh_mu_decode_len = (uint32_t)64U; KRML_CHECK_SIZE(sizeof (uint8_t), pkh_mu_decode_len); @@ -224,7 +225,7 @@ uint32_t Hacl_Frodo1344_crypto_kem_dec(uint8_t *ss, uint8_t *ct, uint8_t *sk) shake_input_seed_se[0U] = (uint8_t)0x96U; memcpy(shake_input_seed_se + (uint32_t)1U, seed_se, (uint32_t)32U * sizeof (uint8_t)); Hacl_SHA3_shake256_hacl((uint32_t)33U, shake_input_seed_se, (uint32_t)43136U, r); - Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)33U * sizeof (shake_input_seed_se[0U])); + Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)33U, uint8_t); Hacl_Impl_Frodo_Sample_frodo_sample_matrix1344((uint32_t)8U, (uint32_t)1344U, r, sp_matrix); Hacl_Impl_Frodo_Sample_frodo_sample_matrix1344((uint32_t)8U, (uint32_t)1344U, @@ -266,12 +267,12 @@ uint32_t Hacl_Frodo1344_crypto_kem_dec(uint8_t *ss, uint8_t *ct, uint8_t *sk) mu_decode, mu_encode); Hacl_Impl_Matrix_matrix_add((uint32_t)8U, (uint32_t)8U, cp_matrix, mu_encode); - Lib_Memzero0_memzero(mu_encode, (uint32_t)64U * sizeof (mu_encode[0U])); + Lib_Memzero0_memzero(mu_encode, (uint32_t)64U, uint16_t); Hacl_Impl_Matrix_mod_pow2((uint32_t)8U, (uint32_t)1344U, (uint32_t)16U, bpp_matrix); Hacl_Impl_Matrix_mod_pow2((uint32_t)8U, (uint32_t)8U, (uint32_t)16U, cp_matrix); - Lib_Memzero0_memzero(sp_matrix, (uint32_t)10752U * sizeof (sp_matrix[0U])); - Lib_Memzero0_memzero(ep_matrix, (uint32_t)10752U * sizeof (ep_matrix[0U])); - Lib_Memzero0_memzero(epp_matrix, (uint32_t)64U * sizeof (epp_matrix[0U])); + Lib_Memzero0_memzero(sp_matrix, (uint32_t)10752U, uint16_t); + Lib_Memzero0_memzero(ep_matrix, (uint32_t)10752U, uint16_t); + Lib_Memzero0_memzero(epp_matrix, (uint32_t)64U, uint16_t); uint16_t b1 = Hacl_Impl_Matrix_matrix_eq((uint32_t)8U, (uint32_t)1344U, bp_matrix, bpp_matrix); uint16_t b2 = Hacl_Impl_Matrix_matrix_eq((uint32_t)8U, (uint32_t)8U, c_matrix, cp_matrix); uint16_t mask = b1 & b2; @@ -291,10 +292,10 @@ uint32_t Hacl_Frodo1344_crypto_kem_dec(uint8_t *ss, uint8_t *ct, uint8_t *sk) memcpy(ss_init, ct, (uint32_t)21632U * sizeof (uint8_t)); memcpy(ss_init + (uint32_t)21632U, kp_s, (uint32_t)32U * sizeof (uint8_t)); Hacl_SHA3_shake256_hacl(ss_init_len, ss_init, (uint32_t)32U, ss); - Lib_Memzero0_memzero(ss_init, ss_init_len * sizeof (ss_init[0U])); - Lib_Memzero0_memzero(kp_s, (uint32_t)32U * sizeof (kp_s[0U])); - Lib_Memzero0_memzero(seed_se_k, (uint32_t)64U * sizeof (seed_se_k[0U])); - Lib_Memzero0_memzero(mu_decode, (uint32_t)32U * sizeof (mu_decode[0U])); + Lib_Memzero0_memzero(ss_init, ss_init_len, uint8_t); + Lib_Memzero0_memzero(kp_s, (uint32_t)32U, uint8_t); + Lib_Memzero0_memzero(seed_se_k, (uint32_t)64U, uint8_t); + Lib_Memzero0_memzero(mu_decode, (uint32_t)32U, uint8_t); return (uint32_t)0U; } diff --git a/src/Hacl_Frodo64.c b/src/Hacl_Frodo64.c index 6c652c9b..575390e3 100644 --- a/src/Hacl_Frodo64.c +++ b/src/Hacl_Frodo64.c @@ -27,6 +27,7 @@ #include "internal/Hacl_Spec.h" #include "internal/Hacl_Frodo_KEM.h" +#include "lib_memzero0.h" /* this variant is used only for testing purposes! @@ -59,7 +60,7 @@ uint32_t Hacl_Frodo64_crypto_kem_keypair(uint8_t *pk, uint8_t *sk) shake_input_seed_se[0U] = (uint8_t)0x5fU; memcpy(shake_input_seed_se + (uint32_t)1U, seed_se, (uint32_t)16U * sizeof (uint8_t)); Hacl_SHA3_shake128_hacl((uint32_t)17U, shake_input_seed_se, (uint32_t)2048U, r); - Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)17U * sizeof (shake_input_seed_se[0U])); + Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)17U, uint8_t); Hacl_Impl_Frodo_Sample_frodo_sample_matrix64((uint32_t)64U, (uint32_t)8U, r, s_matrix); Hacl_Impl_Frodo_Sample_frodo_sample_matrix64((uint32_t)64U, (uint32_t)8U, @@ -80,14 +81,14 @@ uint32_t Hacl_Frodo64_crypto_kem_keypair(uint8_t *pk, uint8_t *sk) Hacl_Impl_Matrix_matrix_add((uint32_t)64U, (uint32_t)8U, b_matrix, e_matrix); Hacl_Impl_Frodo_Pack_frodo_pack((uint32_t)64U, (uint32_t)8U, (uint32_t)15U, b_matrix, b_bytes); Hacl_Impl_Matrix_matrix_to_lbytes((uint32_t)64U, (uint32_t)8U, s_matrix, s_bytes); - Lib_Memzero0_memzero(s_matrix, (uint32_t)512U * sizeof (s_matrix[0U])); - Lib_Memzero0_memzero(e_matrix, (uint32_t)512U * sizeof (e_matrix[0U])); + Lib_Memzero0_memzero(s_matrix, (uint32_t)512U, uint16_t); + Lib_Memzero0_memzero(e_matrix, (uint32_t)512U, uint16_t); uint32_t slen1 = (uint32_t)2016U; uint8_t *sk_p = sk; memcpy(sk_p, s, (uint32_t)16U * sizeof (uint8_t)); memcpy(sk_p + (uint32_t)16U, pk, (uint32_t)976U * sizeof (uint8_t)); Hacl_SHA3_shake128_hacl((uint32_t)976U, pk, (uint32_t)16U, sk + slen1); - Lib_Memzero0_memzero(coins, (uint32_t)48U * sizeof (coins[0U])); + Lib_Memzero0_memzero(coins, (uint32_t)48U, uint8_t); return (uint32_t)0U; } @@ -112,7 +113,7 @@ uint32_t Hacl_Frodo64_crypto_kem_enc(uint8_t *ct, uint8_t *ss, uint8_t *pk) shake_input_seed_se[0U] = (uint8_t)0x96U; memcpy(shake_input_seed_se + (uint32_t)1U, seed_se, (uint32_t)16U * sizeof (uint8_t)); Hacl_SHA3_shake128_hacl((uint32_t)17U, shake_input_seed_se, (uint32_t)2176U, r); - Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)17U * sizeof (shake_input_seed_se[0U])); + Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)17U, uint8_t); Hacl_Impl_Frodo_Sample_frodo_sample_matrix64((uint32_t)8U, (uint32_t)64U, r, sp_matrix); Hacl_Impl_Frodo_Sample_frodo_sample_matrix64((uint32_t)8U, (uint32_t)64U, @@ -155,12 +156,12 @@ uint32_t Hacl_Frodo64_crypto_kem_enc(uint8_t *ct, uint8_t *ss, uint8_t *pk) coins, mu_encode); Hacl_Impl_Matrix_matrix_add((uint32_t)8U, (uint32_t)8U, v_matrix, mu_encode); - Lib_Memzero0_memzero(mu_encode, (uint32_t)64U * sizeof (mu_encode[0U])); + Lib_Memzero0_memzero(mu_encode, (uint32_t)64U, uint16_t); Hacl_Impl_Frodo_Pack_frodo_pack((uint32_t)8U, (uint32_t)8U, (uint32_t)15U, v_matrix, c2); - Lib_Memzero0_memzero(v_matrix, (uint32_t)64U * sizeof (v_matrix[0U])); - Lib_Memzero0_memzero(sp_matrix, (uint32_t)512U * sizeof (sp_matrix[0U])); - Lib_Memzero0_memzero(ep_matrix, (uint32_t)512U * sizeof (ep_matrix[0U])); - Lib_Memzero0_memzero(epp_matrix, (uint32_t)64U * sizeof (epp_matrix[0U])); + Lib_Memzero0_memzero(v_matrix, (uint32_t)64U, uint16_t); + Lib_Memzero0_memzero(sp_matrix, (uint32_t)512U, uint16_t); + Lib_Memzero0_memzero(ep_matrix, (uint32_t)512U, uint16_t); + Lib_Memzero0_memzero(epp_matrix, (uint32_t)64U, uint16_t); uint32_t ss_init_len = (uint32_t)1096U; KRML_CHECK_SIZE(sizeof (uint8_t), ss_init_len); uint8_t shake_input_ss[ss_init_len]; @@ -168,9 +169,9 @@ uint32_t Hacl_Frodo64_crypto_kem_enc(uint8_t *ct, uint8_t *ss, uint8_t *pk) memcpy(shake_input_ss, ct, (uint32_t)1080U * sizeof (uint8_t)); memcpy(shake_input_ss + (uint32_t)1080U, k, (uint32_t)16U * sizeof (uint8_t)); Hacl_SHA3_shake128_hacl(ss_init_len, shake_input_ss, (uint32_t)16U, ss); - Lib_Memzero0_memzero(shake_input_ss, ss_init_len * sizeof (shake_input_ss[0U])); - Lib_Memzero0_memzero(seed_se_k, (uint32_t)32U * sizeof (seed_se_k[0U])); - Lib_Memzero0_memzero(coins, (uint32_t)16U * sizeof (coins[0U])); + Lib_Memzero0_memzero(shake_input_ss, ss_init_len, uint8_t); + Lib_Memzero0_memzero(seed_se_k, (uint32_t)32U, uint8_t); + Lib_Memzero0_memzero(coins, (uint32_t)16U, uint8_t); return (uint32_t)0U; } @@ -199,8 +200,8 @@ uint32_t Hacl_Frodo64_crypto_kem_dec(uint8_t *ss, uint8_t *ct, uint8_t *sk) (uint32_t)8U, m_matrix, mu_decode); - Lib_Memzero0_memzero(s_matrix, (uint32_t)512U * sizeof (s_matrix[0U])); - Lib_Memzero0_memzero(m_matrix, (uint32_t)64U * sizeof (m_matrix[0U])); + Lib_Memzero0_memzero(s_matrix, (uint32_t)512U, uint16_t); + Lib_Memzero0_memzero(m_matrix, (uint32_t)64U, uint16_t); uint8_t seed_se_k[32U] = { 0U }; uint32_t pkh_mu_decode_len = (uint32_t)32U; KRML_CHECK_SIZE(sizeof (uint8_t), pkh_mu_decode_len); @@ -223,7 +224,7 @@ uint32_t Hacl_Frodo64_crypto_kem_dec(uint8_t *ss, uint8_t *ct, uint8_t *sk) shake_input_seed_se[0U] = (uint8_t)0x96U; memcpy(shake_input_seed_se + (uint32_t)1U, seed_se, (uint32_t)16U * sizeof (uint8_t)); Hacl_SHA3_shake128_hacl((uint32_t)17U, shake_input_seed_se, (uint32_t)2176U, r); - Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)17U * sizeof (shake_input_seed_se[0U])); + Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)17U, uint8_t); Hacl_Impl_Frodo_Sample_frodo_sample_matrix64((uint32_t)8U, (uint32_t)64U, r, sp_matrix); Hacl_Impl_Frodo_Sample_frodo_sample_matrix64((uint32_t)8U, (uint32_t)64U, @@ -264,12 +265,12 @@ uint32_t Hacl_Frodo64_crypto_kem_dec(uint8_t *ss, uint8_t *ct, uint8_t *sk) mu_decode, mu_encode); Hacl_Impl_Matrix_matrix_add((uint32_t)8U, (uint32_t)8U, cp_matrix, mu_encode); - Lib_Memzero0_memzero(mu_encode, (uint32_t)64U * sizeof (mu_encode[0U])); + Lib_Memzero0_memzero(mu_encode, (uint32_t)64U, uint16_t); Hacl_Impl_Matrix_mod_pow2((uint32_t)8U, (uint32_t)64U, (uint32_t)15U, bpp_matrix); Hacl_Impl_Matrix_mod_pow2((uint32_t)8U, (uint32_t)8U, (uint32_t)15U, cp_matrix); - Lib_Memzero0_memzero(sp_matrix, (uint32_t)512U * sizeof (sp_matrix[0U])); - Lib_Memzero0_memzero(ep_matrix, (uint32_t)512U * sizeof (ep_matrix[0U])); - Lib_Memzero0_memzero(epp_matrix, (uint32_t)64U * sizeof (epp_matrix[0U])); + Lib_Memzero0_memzero(sp_matrix, (uint32_t)512U, uint16_t); + Lib_Memzero0_memzero(ep_matrix, (uint32_t)512U, uint16_t); + Lib_Memzero0_memzero(epp_matrix, (uint32_t)64U, uint16_t); uint16_t b1 = Hacl_Impl_Matrix_matrix_eq((uint32_t)8U, (uint32_t)64U, bp_matrix, bpp_matrix); uint16_t b2 = Hacl_Impl_Matrix_matrix_eq((uint32_t)8U, (uint32_t)8U, c_matrix, cp_matrix); uint16_t mask = b1 & b2; @@ -290,10 +291,10 @@ uint32_t Hacl_Frodo64_crypto_kem_dec(uint8_t *ss, uint8_t *ct, uint8_t *sk) memcpy(ss_init, ct, (uint32_t)1080U * sizeof (uint8_t)); memcpy(ss_init + (uint32_t)1080U, kp_s, (uint32_t)16U * sizeof (uint8_t)); Hacl_SHA3_shake128_hacl(ss_init_len, ss_init, (uint32_t)16U, ss); - Lib_Memzero0_memzero(ss_init, ss_init_len * sizeof (ss_init[0U])); - Lib_Memzero0_memzero(kp_s, (uint32_t)16U * sizeof (kp_s[0U])); - Lib_Memzero0_memzero(seed_se_k, (uint32_t)32U * sizeof (seed_se_k[0U])); - Lib_Memzero0_memzero(mu_decode, (uint32_t)16U * sizeof (mu_decode[0U])); + Lib_Memzero0_memzero(ss_init, ss_init_len, uint8_t); + Lib_Memzero0_memzero(kp_s, (uint32_t)16U, uint8_t); + Lib_Memzero0_memzero(seed_se_k, (uint32_t)32U, uint8_t); + Lib_Memzero0_memzero(mu_decode, (uint32_t)16U, uint8_t); return (uint32_t)0U; } diff --git a/src/Hacl_Frodo640.c b/src/Hacl_Frodo640.c index 904865c2..54af36d8 100644 --- a/src/Hacl_Frodo640.c +++ b/src/Hacl_Frodo640.c @@ -27,6 +27,7 @@ #include "internal/Hacl_Spec.h" #include "internal/Hacl_Frodo_KEM.h" +#include "lib_memzero0.h" uint32_t Hacl_Frodo640_crypto_bytes = (uint32_t)16U; @@ -54,7 +55,7 @@ uint32_t Hacl_Frodo640_crypto_kem_keypair(uint8_t *pk, uint8_t *sk) shake_input_seed_se[0U] = (uint8_t)0x5fU; memcpy(shake_input_seed_se + (uint32_t)1U, seed_se, (uint32_t)16U * sizeof (uint8_t)); Hacl_SHA3_shake128_hacl((uint32_t)17U, shake_input_seed_se, (uint32_t)20480U, r); - Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)17U * sizeof (shake_input_seed_se[0U])); + Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)17U, uint8_t); Hacl_Impl_Frodo_Sample_frodo_sample_matrix640((uint32_t)640U, (uint32_t)8U, r, s_matrix); Hacl_Impl_Frodo_Sample_frodo_sample_matrix640((uint32_t)640U, (uint32_t)8U, @@ -80,14 +81,14 @@ uint32_t Hacl_Frodo640_crypto_kem_keypair(uint8_t *pk, uint8_t *sk) b_matrix, b_bytes); Hacl_Impl_Matrix_matrix_to_lbytes((uint32_t)640U, (uint32_t)8U, s_matrix, s_bytes); - Lib_Memzero0_memzero(s_matrix, (uint32_t)5120U * sizeof (s_matrix[0U])); - Lib_Memzero0_memzero(e_matrix, (uint32_t)5120U * sizeof (e_matrix[0U])); + Lib_Memzero0_memzero(s_matrix, (uint32_t)5120U, uint16_t); + Lib_Memzero0_memzero(e_matrix, (uint32_t)5120U, uint16_t); uint32_t slen1 = (uint32_t)19872U; uint8_t *sk_p = sk; memcpy(sk_p, s, (uint32_t)16U * sizeof (uint8_t)); memcpy(sk_p + (uint32_t)16U, pk, (uint32_t)9616U * sizeof (uint8_t)); Hacl_SHA3_shake128_hacl((uint32_t)9616U, pk, (uint32_t)16U, sk + slen1); - Lib_Memzero0_memzero(coins, (uint32_t)48U * sizeof (coins[0U])); + Lib_Memzero0_memzero(coins, (uint32_t)48U, uint8_t); return (uint32_t)0U; } @@ -112,7 +113,7 @@ uint32_t Hacl_Frodo640_crypto_kem_enc(uint8_t *ct, uint8_t *ss, uint8_t *pk) shake_input_seed_se[0U] = (uint8_t)0x96U; memcpy(shake_input_seed_se + (uint32_t)1U, seed_se, (uint32_t)16U * sizeof (uint8_t)); Hacl_SHA3_shake128_hacl((uint32_t)17U, shake_input_seed_se, (uint32_t)20608U, r); - Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)17U * sizeof (shake_input_seed_se[0U])); + Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)17U, uint8_t); Hacl_Impl_Frodo_Sample_frodo_sample_matrix640((uint32_t)8U, (uint32_t)640U, r, sp_matrix); Hacl_Impl_Frodo_Sample_frodo_sample_matrix640((uint32_t)8U, (uint32_t)640U, @@ -156,12 +157,12 @@ uint32_t Hacl_Frodo640_crypto_kem_enc(uint8_t *ct, uint8_t *ss, uint8_t *pk) coins, mu_encode); Hacl_Impl_Matrix_matrix_add((uint32_t)8U, (uint32_t)8U, v_matrix, mu_encode); - Lib_Memzero0_memzero(mu_encode, (uint32_t)64U * sizeof (mu_encode[0U])); + Lib_Memzero0_memzero(mu_encode, (uint32_t)64U, uint16_t); Hacl_Impl_Frodo_Pack_frodo_pack((uint32_t)8U, (uint32_t)8U, (uint32_t)15U, v_matrix, c2); - Lib_Memzero0_memzero(v_matrix, (uint32_t)64U * sizeof (v_matrix[0U])); - Lib_Memzero0_memzero(sp_matrix, (uint32_t)5120U * sizeof (sp_matrix[0U])); - Lib_Memzero0_memzero(ep_matrix, (uint32_t)5120U * sizeof (ep_matrix[0U])); - Lib_Memzero0_memzero(epp_matrix, (uint32_t)64U * sizeof (epp_matrix[0U])); + Lib_Memzero0_memzero(v_matrix, (uint32_t)64U, uint16_t); + Lib_Memzero0_memzero(sp_matrix, (uint32_t)5120U, uint16_t); + Lib_Memzero0_memzero(ep_matrix, (uint32_t)5120U, uint16_t); + Lib_Memzero0_memzero(epp_matrix, (uint32_t)64U, uint16_t); uint32_t ss_init_len = (uint32_t)9736U; KRML_CHECK_SIZE(sizeof (uint8_t), ss_init_len); uint8_t shake_input_ss[ss_init_len]; @@ -169,9 +170,9 @@ uint32_t Hacl_Frodo640_crypto_kem_enc(uint8_t *ct, uint8_t *ss, uint8_t *pk) memcpy(shake_input_ss, ct, (uint32_t)9720U * sizeof (uint8_t)); memcpy(shake_input_ss + (uint32_t)9720U, k, (uint32_t)16U * sizeof (uint8_t)); Hacl_SHA3_shake128_hacl(ss_init_len, shake_input_ss, (uint32_t)16U, ss); - Lib_Memzero0_memzero(shake_input_ss, ss_init_len * sizeof (shake_input_ss[0U])); - Lib_Memzero0_memzero(seed_se_k, (uint32_t)32U * sizeof (seed_se_k[0U])); - Lib_Memzero0_memzero(coins, (uint32_t)16U * sizeof (coins[0U])); + Lib_Memzero0_memzero(shake_input_ss, ss_init_len, uint8_t); + Lib_Memzero0_memzero(seed_se_k, (uint32_t)32U, uint8_t); + Lib_Memzero0_memzero(coins, (uint32_t)16U, uint8_t); return (uint32_t)0U; } @@ -200,8 +201,8 @@ uint32_t Hacl_Frodo640_crypto_kem_dec(uint8_t *ss, uint8_t *ct, uint8_t *sk) (uint32_t)8U, m_matrix, mu_decode); - Lib_Memzero0_memzero(s_matrix, (uint32_t)5120U * sizeof (s_matrix[0U])); - Lib_Memzero0_memzero(m_matrix, (uint32_t)64U * sizeof (m_matrix[0U])); + Lib_Memzero0_memzero(s_matrix, (uint32_t)5120U, uint16_t); + Lib_Memzero0_memzero(m_matrix, (uint32_t)64U, uint16_t); uint8_t seed_se_k[32U] = { 0U }; uint32_t pkh_mu_decode_len = (uint32_t)32U; KRML_CHECK_SIZE(sizeof (uint8_t), pkh_mu_decode_len); @@ -224,7 +225,7 @@ uint32_t Hacl_Frodo640_crypto_kem_dec(uint8_t *ss, uint8_t *ct, uint8_t *sk) shake_input_seed_se[0U] = (uint8_t)0x96U; memcpy(shake_input_seed_se + (uint32_t)1U, seed_se, (uint32_t)16U * sizeof (uint8_t)); Hacl_SHA3_shake128_hacl((uint32_t)17U, shake_input_seed_se, (uint32_t)20608U, r); - Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)17U * sizeof (shake_input_seed_se[0U])); + Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)17U, uint8_t); Hacl_Impl_Frodo_Sample_frodo_sample_matrix640((uint32_t)8U, (uint32_t)640U, r, sp_matrix); Hacl_Impl_Frodo_Sample_frodo_sample_matrix640((uint32_t)8U, (uint32_t)640U, @@ -266,12 +267,12 @@ uint32_t Hacl_Frodo640_crypto_kem_dec(uint8_t *ss, uint8_t *ct, uint8_t *sk) mu_decode, mu_encode); Hacl_Impl_Matrix_matrix_add((uint32_t)8U, (uint32_t)8U, cp_matrix, mu_encode); - Lib_Memzero0_memzero(mu_encode, (uint32_t)64U * sizeof (mu_encode[0U])); + Lib_Memzero0_memzero(mu_encode, (uint32_t)64U, uint16_t); Hacl_Impl_Matrix_mod_pow2((uint32_t)8U, (uint32_t)640U, (uint32_t)15U, bpp_matrix); Hacl_Impl_Matrix_mod_pow2((uint32_t)8U, (uint32_t)8U, (uint32_t)15U, cp_matrix); - Lib_Memzero0_memzero(sp_matrix, (uint32_t)5120U * sizeof (sp_matrix[0U])); - Lib_Memzero0_memzero(ep_matrix, (uint32_t)5120U * sizeof (ep_matrix[0U])); - Lib_Memzero0_memzero(epp_matrix, (uint32_t)64U * sizeof (epp_matrix[0U])); + Lib_Memzero0_memzero(sp_matrix, (uint32_t)5120U, uint16_t); + Lib_Memzero0_memzero(ep_matrix, (uint32_t)5120U, uint16_t); + Lib_Memzero0_memzero(epp_matrix, (uint32_t)64U, uint16_t); uint16_t b1 = Hacl_Impl_Matrix_matrix_eq((uint32_t)8U, (uint32_t)640U, bp_matrix, bpp_matrix); uint16_t b2 = Hacl_Impl_Matrix_matrix_eq((uint32_t)8U, (uint32_t)8U, c_matrix, cp_matrix); uint16_t mask = b1 & b2; @@ -292,10 +293,10 @@ uint32_t Hacl_Frodo640_crypto_kem_dec(uint8_t *ss, uint8_t *ct, uint8_t *sk) memcpy(ss_init, ct, (uint32_t)9720U * sizeof (uint8_t)); memcpy(ss_init + (uint32_t)9720U, kp_s, (uint32_t)16U * sizeof (uint8_t)); Hacl_SHA3_shake128_hacl(ss_init_len, ss_init, (uint32_t)16U, ss); - Lib_Memzero0_memzero(ss_init, ss_init_len * sizeof (ss_init[0U])); - Lib_Memzero0_memzero(kp_s, (uint32_t)16U * sizeof (kp_s[0U])); - Lib_Memzero0_memzero(seed_se_k, (uint32_t)32U * sizeof (seed_se_k[0U])); - Lib_Memzero0_memzero(mu_decode, (uint32_t)16U * sizeof (mu_decode[0U])); + Lib_Memzero0_memzero(ss_init, ss_init_len, uint8_t); + Lib_Memzero0_memzero(kp_s, (uint32_t)16U, uint8_t); + Lib_Memzero0_memzero(seed_se_k, (uint32_t)32U, uint8_t); + Lib_Memzero0_memzero(mu_decode, (uint32_t)16U, uint8_t); return (uint32_t)0U; } diff --git a/src/Hacl_Frodo976.c b/src/Hacl_Frodo976.c index 2f796b32..2e6aa6f0 100644 --- a/src/Hacl_Frodo976.c +++ b/src/Hacl_Frodo976.c @@ -27,6 +27,7 @@ #include "internal/Hacl_Spec.h" #include "internal/Hacl_Frodo_KEM.h" +#include "lib_memzero0.h" uint32_t Hacl_Frodo976_crypto_bytes = (uint32_t)24U; @@ -54,7 +55,7 @@ uint32_t Hacl_Frodo976_crypto_kem_keypair(uint8_t *pk, uint8_t *sk) shake_input_seed_se[0U] = (uint8_t)0x5fU; memcpy(shake_input_seed_se + (uint32_t)1U, seed_se, (uint32_t)24U * sizeof (uint8_t)); Hacl_SHA3_shake256_hacl((uint32_t)25U, shake_input_seed_se, (uint32_t)31232U, r); - Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)25U * sizeof (shake_input_seed_se[0U])); + Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)25U, uint8_t); Hacl_Impl_Frodo_Sample_frodo_sample_matrix976((uint32_t)976U, (uint32_t)8U, r, s_matrix); Hacl_Impl_Frodo_Sample_frodo_sample_matrix976((uint32_t)976U, (uint32_t)8U, @@ -80,14 +81,14 @@ uint32_t Hacl_Frodo976_crypto_kem_keypair(uint8_t *pk, uint8_t *sk) b_matrix, b_bytes); Hacl_Impl_Matrix_matrix_to_lbytes((uint32_t)976U, (uint32_t)8U, s_matrix, s_bytes); - Lib_Memzero0_memzero(s_matrix, (uint32_t)7808U * sizeof (s_matrix[0U])); - Lib_Memzero0_memzero(e_matrix, (uint32_t)7808U * sizeof (e_matrix[0U])); + Lib_Memzero0_memzero(s_matrix, (uint32_t)7808U, uint16_t); + Lib_Memzero0_memzero(e_matrix, (uint32_t)7808U, uint16_t); uint32_t slen1 = (uint32_t)31272U; uint8_t *sk_p = sk; memcpy(sk_p, s, (uint32_t)24U * sizeof (uint8_t)); memcpy(sk_p + (uint32_t)24U, pk, (uint32_t)15632U * sizeof (uint8_t)); Hacl_SHA3_shake256_hacl((uint32_t)15632U, pk, (uint32_t)24U, sk + slen1); - Lib_Memzero0_memzero(coins, (uint32_t)64U * sizeof (coins[0U])); + Lib_Memzero0_memzero(coins, (uint32_t)64U, uint8_t); return (uint32_t)0U; } @@ -112,7 +113,7 @@ uint32_t Hacl_Frodo976_crypto_kem_enc(uint8_t *ct, uint8_t *ss, uint8_t *pk) shake_input_seed_se[0U] = (uint8_t)0x96U; memcpy(shake_input_seed_se + (uint32_t)1U, seed_se, (uint32_t)24U * sizeof (uint8_t)); Hacl_SHA3_shake256_hacl((uint32_t)25U, shake_input_seed_se, (uint32_t)31360U, r); - Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)25U * sizeof (shake_input_seed_se[0U])); + Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)25U, uint8_t); Hacl_Impl_Frodo_Sample_frodo_sample_matrix976((uint32_t)8U, (uint32_t)976U, r, sp_matrix); Hacl_Impl_Frodo_Sample_frodo_sample_matrix976((uint32_t)8U, (uint32_t)976U, @@ -156,12 +157,12 @@ uint32_t Hacl_Frodo976_crypto_kem_enc(uint8_t *ct, uint8_t *ss, uint8_t *pk) coins, mu_encode); Hacl_Impl_Matrix_matrix_add((uint32_t)8U, (uint32_t)8U, v_matrix, mu_encode); - Lib_Memzero0_memzero(mu_encode, (uint32_t)64U * sizeof (mu_encode[0U])); + Lib_Memzero0_memzero(mu_encode, (uint32_t)64U, uint16_t); Hacl_Impl_Frodo_Pack_frodo_pack((uint32_t)8U, (uint32_t)8U, (uint32_t)16U, v_matrix, c2); - Lib_Memzero0_memzero(v_matrix, (uint32_t)64U * sizeof (v_matrix[0U])); - Lib_Memzero0_memzero(sp_matrix, (uint32_t)7808U * sizeof (sp_matrix[0U])); - Lib_Memzero0_memzero(ep_matrix, (uint32_t)7808U * sizeof (ep_matrix[0U])); - Lib_Memzero0_memzero(epp_matrix, (uint32_t)64U * sizeof (epp_matrix[0U])); + Lib_Memzero0_memzero(v_matrix, (uint32_t)64U, uint16_t); + Lib_Memzero0_memzero(sp_matrix, (uint32_t)7808U, uint16_t); + Lib_Memzero0_memzero(ep_matrix, (uint32_t)7808U, uint16_t); + Lib_Memzero0_memzero(epp_matrix, (uint32_t)64U, uint16_t); uint32_t ss_init_len = (uint32_t)15768U; KRML_CHECK_SIZE(sizeof (uint8_t), ss_init_len); uint8_t shake_input_ss[ss_init_len]; @@ -169,9 +170,9 @@ uint32_t Hacl_Frodo976_crypto_kem_enc(uint8_t *ct, uint8_t *ss, uint8_t *pk) memcpy(shake_input_ss, ct, (uint32_t)15744U * sizeof (uint8_t)); memcpy(shake_input_ss + (uint32_t)15744U, k, (uint32_t)24U * sizeof (uint8_t)); Hacl_SHA3_shake256_hacl(ss_init_len, shake_input_ss, (uint32_t)24U, ss); - Lib_Memzero0_memzero(shake_input_ss, ss_init_len * sizeof (shake_input_ss[0U])); - Lib_Memzero0_memzero(seed_se_k, (uint32_t)48U * sizeof (seed_se_k[0U])); - Lib_Memzero0_memzero(coins, (uint32_t)24U * sizeof (coins[0U])); + Lib_Memzero0_memzero(shake_input_ss, ss_init_len, uint8_t); + Lib_Memzero0_memzero(seed_se_k, (uint32_t)48U, uint8_t); + Lib_Memzero0_memzero(coins, (uint32_t)24U, uint8_t); return (uint32_t)0U; } @@ -200,8 +201,8 @@ uint32_t Hacl_Frodo976_crypto_kem_dec(uint8_t *ss, uint8_t *ct, uint8_t *sk) (uint32_t)8U, m_matrix, mu_decode); - Lib_Memzero0_memzero(s_matrix, (uint32_t)7808U * sizeof (s_matrix[0U])); - Lib_Memzero0_memzero(m_matrix, (uint32_t)64U * sizeof (m_matrix[0U])); + Lib_Memzero0_memzero(s_matrix, (uint32_t)7808U, uint16_t); + Lib_Memzero0_memzero(m_matrix, (uint32_t)64U, uint16_t); uint8_t seed_se_k[48U] = { 0U }; uint32_t pkh_mu_decode_len = (uint32_t)48U; KRML_CHECK_SIZE(sizeof (uint8_t), pkh_mu_decode_len); @@ -224,7 +225,7 @@ uint32_t Hacl_Frodo976_crypto_kem_dec(uint8_t *ss, uint8_t *ct, uint8_t *sk) shake_input_seed_se[0U] = (uint8_t)0x96U; memcpy(shake_input_seed_se + (uint32_t)1U, seed_se, (uint32_t)24U * sizeof (uint8_t)); Hacl_SHA3_shake256_hacl((uint32_t)25U, shake_input_seed_se, (uint32_t)31360U, r); - Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)25U * sizeof (shake_input_seed_se[0U])); + Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)25U, uint8_t); Hacl_Impl_Frodo_Sample_frodo_sample_matrix976((uint32_t)8U, (uint32_t)976U, r, sp_matrix); Hacl_Impl_Frodo_Sample_frodo_sample_matrix976((uint32_t)8U, (uint32_t)976U, @@ -266,12 +267,12 @@ uint32_t Hacl_Frodo976_crypto_kem_dec(uint8_t *ss, uint8_t *ct, uint8_t *sk) mu_decode, mu_encode); Hacl_Impl_Matrix_matrix_add((uint32_t)8U, (uint32_t)8U, cp_matrix, mu_encode); - Lib_Memzero0_memzero(mu_encode, (uint32_t)64U * sizeof (mu_encode[0U])); + Lib_Memzero0_memzero(mu_encode, (uint32_t)64U, uint16_t); Hacl_Impl_Matrix_mod_pow2((uint32_t)8U, (uint32_t)976U, (uint32_t)16U, bpp_matrix); Hacl_Impl_Matrix_mod_pow2((uint32_t)8U, (uint32_t)8U, (uint32_t)16U, cp_matrix); - Lib_Memzero0_memzero(sp_matrix, (uint32_t)7808U * sizeof (sp_matrix[0U])); - Lib_Memzero0_memzero(ep_matrix, (uint32_t)7808U * sizeof (ep_matrix[0U])); - Lib_Memzero0_memzero(epp_matrix, (uint32_t)64U * sizeof (epp_matrix[0U])); + Lib_Memzero0_memzero(sp_matrix, (uint32_t)7808U, uint16_t); + Lib_Memzero0_memzero(ep_matrix, (uint32_t)7808U, uint16_t); + Lib_Memzero0_memzero(epp_matrix, (uint32_t)64U, uint16_t); uint16_t b1 = Hacl_Impl_Matrix_matrix_eq((uint32_t)8U, (uint32_t)976U, bp_matrix, bpp_matrix); uint16_t b2 = Hacl_Impl_Matrix_matrix_eq((uint32_t)8U, (uint32_t)8U, c_matrix, cp_matrix); uint16_t mask = b1 & b2; @@ -291,10 +292,10 @@ uint32_t Hacl_Frodo976_crypto_kem_dec(uint8_t *ss, uint8_t *ct, uint8_t *sk) memcpy(ss_init, ct, (uint32_t)15744U * sizeof (uint8_t)); memcpy(ss_init + (uint32_t)15744U, kp_s, (uint32_t)24U * sizeof (uint8_t)); Hacl_SHA3_shake256_hacl(ss_init_len, ss_init, (uint32_t)24U, ss); - Lib_Memzero0_memzero(ss_init, ss_init_len * sizeof (ss_init[0U])); - Lib_Memzero0_memzero(kp_s, (uint32_t)24U * sizeof (kp_s[0U])); - Lib_Memzero0_memzero(seed_se_k, (uint32_t)48U * sizeof (seed_se_k[0U])); - Lib_Memzero0_memzero(mu_decode, (uint32_t)24U * sizeof (mu_decode[0U])); + Lib_Memzero0_memzero(ss_init, ss_init_len, uint8_t); + Lib_Memzero0_memzero(kp_s, (uint32_t)24U, uint8_t); + Lib_Memzero0_memzero(seed_se_k, (uint32_t)48U, uint8_t); + Lib_Memzero0_memzero(mu_decode, (uint32_t)24U, uint8_t); return (uint32_t)0U; } diff --git a/src/Hacl_GenericField32.c b/src/Hacl_GenericField32.c index e3802bc2..8bd08a00 100644 --- a/src/Hacl_GenericField32.c +++ b/src/Hacl_GenericField32.c @@ -614,6 +614,7 @@ Hacl_GenericField32_inverse( { c1 = c0; } + KRML_HOST_IGNORE(c1); Hacl_GenericField32_exp_vartime(k, aM, k1.len * (uint32_t)32U, n2, aInvM); } diff --git a/src/Hacl_GenericField64.c b/src/Hacl_GenericField64.c index 8ff2148e..7c11d3b7 100644 --- a/src/Hacl_GenericField64.c +++ b/src/Hacl_GenericField64.c @@ -613,6 +613,7 @@ Hacl_GenericField64_inverse( { c1 = c0; } + KRML_HOST_IGNORE(c1); Hacl_GenericField64_exp_vartime(k, aM, k1.len * (uint32_t)64U, n2, aInvM); } diff --git a/src/Hacl_HMAC.c b/src/Hacl_HMAC.c index 16c528c8..7b4b36f0 100644 --- a/src/Hacl_HMAC.c +++ b/src/Hacl_HMAC.c @@ -49,16 +49,18 @@ Hacl_HMAC_legacy_compute_sha1( KRML_CHECK_SIZE(sizeof (uint8_t), l); uint8_t key_block[l]; memset(key_block, 0U, l * sizeof (uint8_t)); - uint32_t i0; + uint8_t *nkey = key_block; + uint32_t ite; if (key_len <= (uint32_t)64U) { - i0 = key_len; + ite = key_len; } else { - i0 = (uint32_t)20U; + ite = (uint32_t)20U; } - uint8_t *nkey = key_block; + uint8_t *zeroes = key_block + ite; + KRML_HOST_IGNORE(zeroes); if (key_len <= (uint32_t)64U) { memcpy(nkey, key, key_len * sizeof (uint8_t)); @@ -173,16 +175,18 @@ Hacl_HMAC_compute_sha2_256( KRML_CHECK_SIZE(sizeof (uint8_t), l); uint8_t key_block[l]; memset(key_block, 0U, l * sizeof (uint8_t)); - uint32_t i0; + uint8_t *nkey = key_block; + uint32_t ite; if (key_len <= (uint32_t)64U) { - i0 = key_len; + ite = key_len; } else { - i0 = (uint32_t)32U; + ite = (uint32_t)32U; } - uint8_t *nkey = key_block; + uint8_t *zeroes = key_block + ite; + KRML_HOST_IGNORE(zeroes); if (key_len <= (uint32_t)64U) { memcpy(nkey, key, key_len * sizeof (uint8_t)); @@ -307,16 +311,18 @@ Hacl_HMAC_compute_sha2_384( KRML_CHECK_SIZE(sizeof (uint8_t), l); uint8_t key_block[l]; memset(key_block, 0U, l * sizeof (uint8_t)); - uint32_t i0; + uint8_t *nkey = key_block; + uint32_t ite; if (key_len <= (uint32_t)128U) { - i0 = key_len; + ite = key_len; } else { - i0 = (uint32_t)48U; + ite = (uint32_t)48U; } - uint8_t *nkey = key_block; + uint8_t *zeroes = key_block + ite; + KRML_HOST_IGNORE(zeroes); if (key_len <= (uint32_t)128U) { memcpy(nkey, key, key_len * sizeof (uint8_t)); @@ -442,16 +448,18 @@ Hacl_HMAC_compute_sha2_512( KRML_CHECK_SIZE(sizeof (uint8_t), l); uint8_t key_block[l]; memset(key_block, 0U, l * sizeof (uint8_t)); - uint32_t i0; + uint8_t *nkey = key_block; + uint32_t ite; if (key_len <= (uint32_t)128U) { - i0 = key_len; + ite = key_len; } else { - i0 = (uint32_t)64U; + ite = (uint32_t)64U; } - uint8_t *nkey = key_block; + uint8_t *zeroes = key_block + ite; + KRML_HOST_IGNORE(zeroes); if (key_len <= (uint32_t)128U) { memcpy(nkey, key, key_len * sizeof (uint8_t)); @@ -577,16 +585,18 @@ Hacl_HMAC_compute_blake2s_32( KRML_CHECK_SIZE(sizeof (uint8_t), l); uint8_t key_block[l]; memset(key_block, 0U, l * sizeof (uint8_t)); - uint32_t i0; + uint8_t *nkey = key_block; + uint32_t ite; if (key_len <= (uint32_t)64U) { - i0 = key_len; + ite = key_len; } else { - i0 = (uint32_t)32U; + ite = (uint32_t)32U; } - uint8_t *nkey = key_block; + uint8_t *zeroes = key_block + ite; + KRML_HOST_IGNORE(zeroes); if (key_len <= (uint32_t)64U) { memcpy(nkey, key, key_len * sizeof (uint8_t)); @@ -719,16 +729,18 @@ Hacl_HMAC_compute_blake2b_32( KRML_CHECK_SIZE(sizeof (uint8_t), l); uint8_t key_block[l]; memset(key_block, 0U, l * sizeof (uint8_t)); - uint32_t i0; + uint8_t *nkey = key_block; + uint32_t ite; if (key_len <= (uint32_t)128U) { - i0 = key_len; + ite = key_len; } else { - i0 = (uint32_t)64U; + ite = (uint32_t)64U; } - uint8_t *nkey = key_block; + uint8_t *zeroes = key_block + ite; + KRML_HOST_IGNORE(zeroes); if (key_len <= (uint32_t)128U) { memcpy(nkey, key, key_len * sizeof (uint8_t)); diff --git a/src/Hacl_HMAC_Blake2b_256.c b/src/Hacl_HMAC_Blake2b_256.c index 7a34ac2c..71f75415 100644 --- a/src/Hacl_HMAC_Blake2b_256.c +++ b/src/Hacl_HMAC_Blake2b_256.c @@ -47,16 +47,18 @@ Hacl_HMAC_Blake2b_256_compute_blake2b_256( KRML_CHECK_SIZE(sizeof (uint8_t), l); uint8_t key_block[l]; memset(key_block, 0U, l * sizeof (uint8_t)); - uint32_t i0; + uint8_t *nkey = key_block; + uint32_t ite; if (key_len <= (uint32_t)128U) { - i0 = key_len; + ite = key_len; } else { - i0 = (uint32_t)64U; + ite = (uint32_t)64U; } - uint8_t *nkey = key_block; + uint8_t *zeroes = key_block + ite; + KRML_HOST_IGNORE(zeroes); if (key_len <= (uint32_t)128U) { memcpy(nkey, key, key_len * sizeof (uint8_t)); diff --git a/src/Hacl_HMAC_Blake2s_128.c b/src/Hacl_HMAC_Blake2s_128.c index 86a8c2eb..bce00309 100644 --- a/src/Hacl_HMAC_Blake2s_128.c +++ b/src/Hacl_HMAC_Blake2s_128.c @@ -46,16 +46,18 @@ Hacl_HMAC_Blake2s_128_compute_blake2s_128( KRML_CHECK_SIZE(sizeof (uint8_t), l); uint8_t key_block[l]; memset(key_block, 0U, l * sizeof (uint8_t)); - uint32_t i0; + uint8_t *nkey = key_block; + uint32_t ite; if (key_len <= (uint32_t)64U) { - i0 = key_len; + ite = key_len; } else { - i0 = (uint32_t)32U; + ite = (uint32_t)32U; } - uint8_t *nkey = key_block; + uint8_t *zeroes = key_block + ite; + KRML_HOST_IGNORE(zeroes); if (key_len <= (uint32_t)64U) { memcpy(nkey, key, key_len * sizeof (uint8_t)); diff --git a/src/Hacl_HMAC_DRBG.c b/src/Hacl_HMAC_DRBG.c index f0e01bd8..181a8ef4 100644 --- a/src/Hacl_HMAC_DRBG.c +++ b/src/Hacl_HMAC_DRBG.c @@ -455,10 +455,9 @@ Hacl_HMAC_DRBG_reseed( memcpy(seed_material + entropy_input_len, additional_input_input, additional_input_input_len * sizeof (uint8_t)); - Hacl_HMAC_DRBG_state uu____0 = st; - uint8_t *k = uu____0.k; - uint8_t *v = uu____0.v; - uint32_t *ctr = uu____0.reseed_counter; + uint8_t *k = st.k; + uint8_t *v = st.v; + uint32_t *ctr = st.reseed_counter; uint32_t input_len = (uint32_t)21U + entropy_input_len + additional_input_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len); uint8_t input0[input_len]; @@ -508,10 +507,9 @@ Hacl_HMAC_DRBG_reseed( memcpy(seed_material + entropy_input_len, additional_input_input, additional_input_input_len * sizeof (uint8_t)); - Hacl_HMAC_DRBG_state uu____1 = st; - uint8_t *k = uu____1.k; - uint8_t *v = uu____1.v; - uint32_t *ctr = uu____1.reseed_counter; + uint8_t *k = st.k; + uint8_t *v = st.v; + uint32_t *ctr = st.reseed_counter; uint32_t input_len = (uint32_t)33U + entropy_input_len + additional_input_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len); uint8_t input0[input_len]; @@ -561,10 +559,9 @@ Hacl_HMAC_DRBG_reseed( memcpy(seed_material + entropy_input_len, additional_input_input, additional_input_input_len * sizeof (uint8_t)); - Hacl_HMAC_DRBG_state uu____2 = st; - uint8_t *k = uu____2.k; - uint8_t *v = uu____2.v; - uint32_t *ctr = uu____2.reseed_counter; + uint8_t *k = st.k; + uint8_t *v = st.v; + uint32_t *ctr = st.reseed_counter; uint32_t input_len = (uint32_t)49U + entropy_input_len + additional_input_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len); uint8_t input0[input_len]; @@ -614,10 +611,9 @@ Hacl_HMAC_DRBG_reseed( memcpy(seed_material + entropy_input_len, additional_input_input, additional_input_input_len * sizeof (uint8_t)); - Hacl_HMAC_DRBG_state uu____3 = st; - uint8_t *k = uu____3.k; - uint8_t *v = uu____3.v; - uint32_t *ctr = uu____3.reseed_counter; + uint8_t *k = st.k; + uint8_t *v = st.v; + uint32_t *ctr = st.reseed_counter; uint32_t input_len = (uint32_t)65U + entropy_input_len + additional_input_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len); uint8_t input0[input_len]; diff --git a/src/Hacl_Hash_Blake2.c b/src/Hacl_Hash_Blake2.c index 6080585c..194e7157 100644 --- a/src/Hacl_Hash_Blake2.c +++ b/src/Hacl_Hash_Blake2.c @@ -26,6 +26,7 @@ #include "internal/Hacl_Hash_Blake2.h" #include "internal/Hacl_Impl_Blake2_Constants.h" +#include "lib_memzero0.h" static void blake2b_update_block( @@ -531,7 +532,7 @@ Hacl_Blake2b_32_blake2b_update_key( { blake2b_update_block(wv, hash, false, lb, b); } - Lib_Memzero0_memzero(b, (uint32_t)128U * sizeof (b[0U])); + Lib_Memzero0_memzero(b, (uint32_t)128U, uint8_t); } void @@ -571,7 +572,7 @@ Hacl_Blake2b_32_blake2b_update_last( FStar_UInt128_uint128 totlen = FStar_UInt128_add_mod(prev, FStar_UInt128_uint64_to_uint128((uint64_t)len)); blake2b_update_block(wv, hash, true, totlen, b); - Lib_Memzero0_memzero(b, (uint32_t)128U * sizeof (b[0U])); + Lib_Memzero0_memzero(b, (uint32_t)128U, uint8_t); } static void @@ -642,7 +643,7 @@ void Hacl_Blake2b_32_blake2b_finish(uint32_t nn, uint8_t *output, uint64_t *hash store64_le(second + i * (uint32_t)8U, row1[i]);); uint8_t *final = b; memcpy(output, final, nn * sizeof (uint8_t)); - Lib_Memzero0_memzero(b, (uint32_t)64U * sizeof (b[0U])); + Lib_Memzero0_memzero(b, (uint32_t)64U, uint8_t); } /** @@ -670,8 +671,8 @@ Hacl_Blake2b_32_blake2b( Hacl_Blake2b_32_blake2b_init(b, kk, nn); blake2b_update(b1, b, kk, k, ll, d); Hacl_Blake2b_32_blake2b_finish(nn, output, b); - Lib_Memzero0_memzero(b1, (uint32_t)16U * sizeof (b1[0U])); - Lib_Memzero0_memzero(b, (uint32_t)16U * sizeof (b[0U])); + Lib_Memzero0_memzero(b1, (uint32_t)16U, uint64_t); + Lib_Memzero0_memzero(b, (uint32_t)16U, uint64_t); } uint64_t *Hacl_Blake2b_32_blake2b_malloc(void) @@ -1178,7 +1179,7 @@ Hacl_Blake2s_32_blake2s_update_key( { blake2s_update_block(wv, hash, false, lb, b); } - Lib_Memzero0_memzero(b, (uint32_t)64U * sizeof (b[0U])); + Lib_Memzero0_memzero(b, (uint32_t)64U, uint8_t); } void @@ -1214,7 +1215,7 @@ Hacl_Blake2s_32_blake2s_update_last( memcpy(b, last, rem * sizeof (uint8_t)); uint64_t totlen = prev + (uint64_t)len; blake2s_update_block(wv, hash, true, totlen, b); - Lib_Memzero0_memzero(b, (uint32_t)64U * sizeof (b[0U])); + Lib_Memzero0_memzero(b, (uint32_t)64U, uint8_t); } static void @@ -1281,7 +1282,7 @@ void Hacl_Blake2s_32_blake2s_finish(uint32_t nn, uint8_t *output, uint32_t *hash store32_le(second + i * (uint32_t)4U, row1[i]);); uint8_t *final = b; memcpy(output, final, nn * sizeof (uint8_t)); - Lib_Memzero0_memzero(b, (uint32_t)32U * sizeof (b[0U])); + Lib_Memzero0_memzero(b, (uint32_t)32U, uint8_t); } /** @@ -1309,8 +1310,8 @@ Hacl_Blake2s_32_blake2s( Hacl_Blake2s_32_blake2s_init(b, kk, nn); blake2s_update(b1, b, kk, k, ll, d); Hacl_Blake2s_32_blake2s_finish(nn, output, b); - Lib_Memzero0_memzero(b1, (uint32_t)16U * sizeof (b1[0U])); - Lib_Memzero0_memzero(b, (uint32_t)16U * sizeof (b[0U])); + Lib_Memzero0_memzero(b1, (uint32_t)16U, uint32_t); + Lib_Memzero0_memzero(b, (uint32_t)16U, uint32_t); } uint32_t *Hacl_Blake2s_32_blake2s_malloc(void) diff --git a/src/Hacl_Hash_Blake2b_256.c b/src/Hacl_Hash_Blake2b_256.c index 2761aeb1..d0df7cd8 100644 --- a/src/Hacl_Hash_Blake2b_256.c +++ b/src/Hacl_Hash_Blake2b_256.c @@ -27,6 +27,7 @@ #include "internal/Hacl_Impl_Blake2_Constants.h" #include "internal/Hacl_Hash_Blake2.h" +#include "lib_memzero0.h" static inline void blake2b_update_block( @@ -254,7 +255,7 @@ Hacl_Blake2b_256_blake2b_update_key( { blake2b_update_block(wv, hash, false, lb, b); } - Lib_Memzero0_memzero(b, (uint32_t)128U * sizeof (b[0U])); + Lib_Memzero0_memzero(b, (uint32_t)128U, uint8_t); } void @@ -294,7 +295,7 @@ Hacl_Blake2b_256_blake2b_update_last( FStar_UInt128_uint128 totlen = FStar_UInt128_add_mod(prev, FStar_UInt128_uint64_to_uint128((uint64_t)len)); blake2b_update_block(wv, hash, true, totlen, b); - Lib_Memzero0_memzero(b, (uint32_t)128U * sizeof (b[0U])); + Lib_Memzero0_memzero(b, (uint32_t)128U, uint8_t); } static inline void @@ -369,7 +370,7 @@ Hacl_Blake2b_256_blake2b_finish( Lib_IntVector_Intrinsics_vec256_store64_le(second, row1[0U]); uint8_t *final = b; memcpy(output, final, nn * sizeof (uint8_t)); - Lib_Memzero0_memzero(b, (uint32_t)64U * sizeof (b[0U])); + Lib_Memzero0_memzero(b, (uint32_t)64U, uint8_t); } /** @@ -397,8 +398,8 @@ Hacl_Blake2b_256_blake2b( Hacl_Blake2b_256_blake2b_init(b, kk, nn); blake2b_update(b1, b, kk, k, ll, d); Hacl_Blake2b_256_blake2b_finish(nn, output, b); - Lib_Memzero0_memzero(b1, (uint32_t)4U * sizeof (b1[0U])); - Lib_Memzero0_memzero(b, (uint32_t)4U * sizeof (b[0U])); + Lib_Memzero0_memzero(b1, (uint32_t)4U, Lib_IntVector_Intrinsics_vec256); + Lib_Memzero0_memzero(b, (uint32_t)4U, Lib_IntVector_Intrinsics_vec256); } void diff --git a/src/Hacl_Hash_Blake2s_128.c b/src/Hacl_Hash_Blake2s_128.c index ce5252cc..5bf06711 100644 --- a/src/Hacl_Hash_Blake2s_128.c +++ b/src/Hacl_Hash_Blake2s_128.c @@ -27,6 +27,7 @@ #include "internal/Hacl_Impl_Blake2_Constants.h" #include "internal/Hacl_Hash_Blake2.h" +#include "lib_memzero0.h" static inline void blake2s_update_block( @@ -254,7 +255,7 @@ Hacl_Blake2s_128_blake2s_update_key( { blake2s_update_block(wv, hash, false, lb, b); } - Lib_Memzero0_memzero(b, (uint32_t)64U * sizeof (b[0U])); + Lib_Memzero0_memzero(b, (uint32_t)64U, uint8_t); } void @@ -290,7 +291,7 @@ Hacl_Blake2s_128_blake2s_update_last( memcpy(b, last, rem * sizeof (uint8_t)); uint64_t totlen = prev + (uint64_t)len; blake2s_update_block(wv, hash, true, totlen, b); - Lib_Memzero0_memzero(b, (uint32_t)64U * sizeof (b[0U])); + Lib_Memzero0_memzero(b, (uint32_t)64U, uint8_t); } static inline void @@ -361,7 +362,7 @@ Hacl_Blake2s_128_blake2s_finish( Lib_IntVector_Intrinsics_vec128_store32_le(second, row1[0U]); uint8_t *final = b; memcpy(output, final, nn * sizeof (uint8_t)); - Lib_Memzero0_memzero(b, (uint32_t)32U * sizeof (b[0U])); + Lib_Memzero0_memzero(b, (uint32_t)32U, uint8_t); } /** @@ -389,8 +390,8 @@ Hacl_Blake2s_128_blake2s( Hacl_Blake2s_128_blake2s_init(b, kk, nn); blake2s_update(b1, b, kk, k, ll, d); Hacl_Blake2s_128_blake2s_finish(nn, output, b); - Lib_Memzero0_memzero(b1, (uint32_t)4U * sizeof (b1[0U])); - Lib_Memzero0_memzero(b, (uint32_t)4U * sizeof (b[0U])); + Lib_Memzero0_memzero(b1, (uint32_t)4U, Lib_IntVector_Intrinsics_vec128); + Lib_Memzero0_memzero(b, (uint32_t)4U, Lib_IntVector_Intrinsics_vec128); } void diff --git a/src/Hacl_Hash_MD5.c b/src/Hacl_Hash_MD5.c index 222ac824..1b376960 100644 --- a/src/Hacl_Hash_MD5.c +++ b/src/Hacl_Hash_MD5.c @@ -1218,6 +1218,7 @@ void Hacl_Streaming_MD5_legacy_init(Hacl_Streaming_MD_state_32 *s) Hacl_Streaming_MD_state_32 scrut = *s; uint8_t *buf = scrut.buf; uint32_t *block_state = scrut.block_state; + KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Hash_Core_MD5_legacy_init(block_state); Hacl_Streaming_MD_state_32 tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; diff --git a/src/Hacl_Hash_SHA1.c b/src/Hacl_Hash_SHA1.c index 5ecb3c0b..80edc004 100644 --- a/src/Hacl_Hash_SHA1.c +++ b/src/Hacl_Hash_SHA1.c @@ -254,6 +254,7 @@ void Hacl_Streaming_SHA1_legacy_init(Hacl_Streaming_MD_state_32 *s) Hacl_Streaming_MD_state_32 scrut = *s; uint8_t *buf = scrut.buf; uint32_t *block_state = scrut.block_state; + KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Hash_Core_SHA1_legacy_init(block_state); Hacl_Streaming_MD_state_32 tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; diff --git a/src/Hacl_Hash_SHA2.c b/src/Hacl_Hash_SHA2.c index c93c3616..46fde83f 100644 --- a/src/Hacl_Hash_SHA2.c +++ b/src/Hacl_Hash_SHA2.c @@ -537,6 +537,7 @@ void Hacl_Streaming_SHA2_init_256(Hacl_Streaming_MD_state_32 *s) Hacl_Streaming_MD_state_32 scrut = *s; uint8_t *buf = scrut.buf; uint32_t *block_state = scrut.block_state; + KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_SHA2_Scalar32_sha256_init(block_state); Hacl_Streaming_MD_state_32 tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; @@ -835,6 +836,7 @@ void Hacl_Streaming_SHA2_init_224(Hacl_Streaming_MD_state_32 *s) Hacl_Streaming_MD_state_32 scrut = *s; uint8_t *buf = scrut.buf; uint32_t *block_state = scrut.block_state; + KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_SHA2_Scalar32_sha224_init(block_state); Hacl_Streaming_MD_state_32 tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; @@ -960,6 +962,7 @@ void Hacl_Streaming_SHA2_init_512(Hacl_Streaming_MD_state_64 *s) Hacl_Streaming_MD_state_64 scrut = *s; uint8_t *buf = scrut.buf; uint64_t *block_state = scrut.block_state; + KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_SHA2_Scalar32_sha512_init(block_state); Hacl_Streaming_MD_state_64 tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; @@ -1259,6 +1262,7 @@ void Hacl_Streaming_SHA2_init_384(Hacl_Streaming_MD_state_64 *s) Hacl_Streaming_MD_state_64 scrut = *s; uint8_t *buf = scrut.buf; uint64_t *block_state = scrut.block_state; + KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_SHA2_Scalar32_sha384_init(block_state); Hacl_Streaming_MD_state_64 tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; diff --git a/src/Hacl_Hash_SHA3.c b/src/Hacl_Hash_SHA3.c index 42c24434..5f4707f4 100644 --- a/src/Hacl_Hash_SHA3.c +++ b/src/Hacl_Hash_SHA3.c @@ -228,6 +228,8 @@ void Hacl_Streaming_Keccak_reset(Hacl_Streaming_Keccak_state *s) Hacl_Streaming_Keccak_state scrut = *s; uint8_t *buf = scrut.buf; Hacl_Streaming_Keccak_hash_buf block_state = scrut.block_state; + Spec_Hash_Definitions_hash_alg i = block_state.fst; + KRML_HOST_IGNORE(i); uint64_t *s1 = block_state.snd; memset(s1, 0U, (uint32_t)25U * sizeof (uint64_t)); Hacl_Streaming_Keccak_state diff --git a/src/Hacl_K256_ECDSA.c b/src/Hacl_K256_ECDSA.c index d75eac5a..fb53f3fd 100644 --- a/src/Hacl_K256_ECDSA.c +++ b/src/Hacl_K256_ECDSA.c @@ -215,6 +215,7 @@ static void sub_mod4(uint64_t *n, uint64_t *a, uint64_t *b, uint64_t *res) c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t12, t2, res_i); } uint64_t c1 = c; + KRML_HOST_IGNORE(c1); uint64_t c2 = (uint64_t)0U - c00; KRML_MAYBE_FOR4(i, (uint32_t)0U, @@ -288,6 +289,7 @@ static void sqr4(uint64_t *a, uint64_t *res) uint64_t r = c; res[i0 + i0] = r;); uint64_t c0 = Hacl_Bignum_Addition_bn_add_eq_len_u64((uint32_t)8U, res, res, res); + KRML_HOST_IGNORE(c0); uint64_t tmp[8U] = { 0U }; KRML_MAYBE_FOR4(i, (uint32_t)0U, @@ -299,6 +301,7 @@ static void sqr4(uint64_t *a, uint64_t *res) tmp[(uint32_t)2U * i] = lo; tmp[(uint32_t)2U * i + (uint32_t)1U] = hi;); uint64_t c1 = Hacl_Bignum_Addition_bn_add_eq_len_u64((uint32_t)8U, res, tmp, res); + KRML_HOST_IGNORE(c1); } static inline uint64_t is_qelem_zero(uint64_t *f) @@ -432,6 +435,7 @@ static inline void load_qelem_modq(uint64_t *f, uint8_t *b) static inline void store_qelem(uint8_t *b, uint64_t *f) { uint8_t tmp[32U] = { 0U }; + KRML_HOST_IGNORE(tmp); KRML_MAYBE_FOR4(i, (uint32_t)0U, (uint32_t)4U, diff --git a/src/Hacl_P256.c b/src/Hacl_P256.c index 2b6cb11b..7e586e54 100644 --- a/src/Hacl_P256.c +++ b/src/Hacl_P256.c @@ -204,6 +204,7 @@ static inline void bn_sub_mod4(uint64_t *res, uint64_t *n, uint64_t *x, uint64_t c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t12, t2, res_i); } uint64_t c1 = c; + KRML_HOST_IGNORE(c1); uint64_t c2 = (uint64_t)0U - c00; KRML_MAYBE_FOR4(i, (uint32_t)0U, @@ -277,6 +278,7 @@ static inline void bn_sqr4(uint64_t *res, uint64_t *x) uint64_t r = c; res[i0 + i0] = r;); uint64_t c0 = Hacl_Bignum_Addition_bn_add_eq_len_u64((uint32_t)8U, res, res, res); + KRML_HOST_IGNORE(c0); uint64_t tmp[8U] = { 0U }; KRML_MAYBE_FOR4(i, (uint32_t)0U, @@ -288,11 +290,13 @@ static inline void bn_sqr4(uint64_t *res, uint64_t *x) tmp[(uint32_t)2U * i] = lo; tmp[(uint32_t)2U * i + (uint32_t)1U] = hi;); uint64_t c1 = Hacl_Bignum_Addition_bn_add_eq_len_u64((uint32_t)8U, res, tmp, res); + KRML_HOST_IGNORE(c1); } static inline void bn_to_bytes_be4(uint8_t *res, uint64_t *f) { uint8_t tmp[32U] = { 0U }; + KRML_HOST_IGNORE(tmp); KRML_MAYBE_FOR4(i, (uint32_t)0U, (uint32_t)4U, @@ -1057,6 +1061,10 @@ static inline void point_mul_g(uint64_t *res, uint64_t *scalar) uint64_t bits_l2 = Hacl_Bignum_Lib_bn_get_bits_u64((uint32_t)1U, r1, k2, (uint32_t)4U); precomp_get_consttime(Hacl_P256_PrecompTable_precomp_basepoint_table_w4, bits_l2, tmp); point_add(res, res, tmp);); + KRML_HOST_IGNORE(q1); + KRML_HOST_IGNORE(q2); + KRML_HOST_IGNORE(q3); + KRML_HOST_IGNORE(q4); } static inline void @@ -1564,6 +1572,7 @@ Hacl_P256_ecdsa_sign_p256_sha2( uint64_t m_q[4U] = { 0U }; uint8_t mHash[32U] = { 0U }; Hacl_Streaming_SHA2_hash_256(msg, msg_len, mHash); + KRML_HOST_IGNORE(msg_len); uint8_t *mHash32 = mHash; bn_from_bytes_be4(m_q, mHash32); qmod_short(m_q, m_q); @@ -1596,6 +1605,7 @@ Hacl_P256_ecdsa_sign_p256_sha384( uint64_t m_q[4U] = { 0U }; uint8_t mHash[48U] = { 0U }; Hacl_Streaming_SHA2_hash_384(msg, msg_len, mHash); + KRML_HOST_IGNORE(msg_len); uint8_t *mHash32 = mHash; bn_from_bytes_be4(m_q, mHash32); qmod_short(m_q, m_q); @@ -1628,6 +1638,7 @@ Hacl_P256_ecdsa_sign_p256_sha512( uint64_t m_q[4U] = { 0U }; uint8_t mHash[64U] = { 0U }; Hacl_Streaming_SHA2_hash_512(msg, msg_len, mHash); + KRML_HOST_IGNORE(msg_len); uint8_t *mHash32 = mHash; bn_from_bytes_be4(m_q, mHash32); qmod_short(m_q, m_q); @@ -1670,6 +1681,7 @@ Hacl_P256_ecdsa_sign_p256_without_hash( uint64_t m_q[4U] = { 0U }; uint8_t mHash[32U] = { 0U }; memcpy(mHash, msg, (uint32_t)32U * sizeof (uint8_t)); + KRML_HOST_IGNORE(msg_len); uint8_t *mHash32 = mHash; bn_from_bytes_be4(m_q, mHash32); qmod_short(m_q, m_q); @@ -1705,6 +1717,7 @@ Hacl_P256_ecdsa_verif_p256_sha2( uint64_t m_q[4U] = { 0U }; uint8_t mHash[32U] = { 0U }; Hacl_Streaming_SHA2_hash_256(msg, msg_len, mHash); + KRML_HOST_IGNORE(msg_len); uint8_t *mHash32 = mHash; bn_from_bytes_be4(m_q, mHash32); qmod_short(m_q, m_q); @@ -1735,6 +1748,7 @@ Hacl_P256_ecdsa_verif_p256_sha384( uint64_t m_q[4U] = { 0U }; uint8_t mHash[48U] = { 0U }; Hacl_Streaming_SHA2_hash_384(msg, msg_len, mHash); + KRML_HOST_IGNORE(msg_len); uint8_t *mHash32 = mHash; bn_from_bytes_be4(m_q, mHash32); qmod_short(m_q, m_q); @@ -1765,6 +1779,7 @@ Hacl_P256_ecdsa_verif_p256_sha512( uint64_t m_q[4U] = { 0U }; uint8_t mHash[64U] = { 0U }; Hacl_Streaming_SHA2_hash_512(msg, msg_len, mHash); + KRML_HOST_IGNORE(msg_len); uint8_t *mHash32 = mHash; bn_from_bytes_be4(m_q, mHash32); qmod_short(m_q, m_q); @@ -1800,6 +1815,7 @@ Hacl_P256_ecdsa_verif_without_hash( uint64_t m_q[4U] = { 0U }; uint8_t mHash[32U] = { 0U }; memcpy(mHash, msg, (uint32_t)32U * sizeof (uint8_t)); + KRML_HOST_IGNORE(msg_len); uint8_t *mHash32 = mHash; bn_from_bytes_be4(m_q, mHash32); qmod_short(m_q, m_q); diff --git a/src/Hacl_Streaming_Blake2.c b/src/Hacl_Streaming_Blake2.c index 948d56c2..4faa859e 100644 --- a/src/Hacl_Streaming_Blake2.c +++ b/src/Hacl_Streaming_Blake2.c @@ -54,6 +54,7 @@ void Hacl_Streaming_Blake2_blake2s_32_no_key_init(Hacl_Streaming_Blake2_blake2s_ Hacl_Streaming_Blake2_blake2s_32_state scrut = *s1; uint8_t *buf = scrut.buf; Hacl_Streaming_Blake2_blake2s_32_block_state block_state = scrut.block_state; + KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Blake2s_32_blake2s_init(block_state.snd, (uint32_t)0U, (uint32_t)32U); Hacl_Streaming_Blake2_blake2s_32_state tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; @@ -353,6 +354,7 @@ void Hacl_Streaming_Blake2_blake2b_32_no_key_init(Hacl_Streaming_Blake2_blake2b_ Hacl_Streaming_Blake2_blake2b_32_state scrut = *s1; uint8_t *buf = scrut.buf; Hacl_Streaming_Blake2_blake2b_32_block_state block_state = scrut.block_state; + KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Blake2b_32_blake2b_init(block_state.snd, (uint32_t)0U, (uint32_t)64U); Hacl_Streaming_Blake2_blake2b_32_state tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; diff --git a/src/Hacl_Streaming_Blake2b_256.c b/src/Hacl_Streaming_Blake2b_256.c index bdb5433f..d2df234a 100644 --- a/src/Hacl_Streaming_Blake2b_256.c +++ b/src/Hacl_Streaming_Blake2b_256.c @@ -66,6 +66,7 @@ Hacl_Streaming_Blake2b_256_blake2b_256_no_key_init( Hacl_Streaming_Blake2b_256_blake2b_256_state scrut = *s; uint8_t *buf = scrut.buf; Hacl_Streaming_Blake2b_256_blake2b_256_block_state block_state = scrut.block_state; + KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Blake2b_256_blake2b_init(block_state.snd, (uint32_t)0U, (uint32_t)64U); Hacl_Streaming_Blake2b_256_blake2b_256_state tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; diff --git a/src/Hacl_Streaming_Blake2s_128.c b/src/Hacl_Streaming_Blake2s_128.c index f97bf5d0..eaace7ce 100644 --- a/src/Hacl_Streaming_Blake2s_128.c +++ b/src/Hacl_Streaming_Blake2s_128.c @@ -66,6 +66,7 @@ Hacl_Streaming_Blake2s_128_blake2s_128_no_key_init( Hacl_Streaming_Blake2s_128_blake2s_128_state scrut = *s; uint8_t *buf = scrut.buf; Hacl_Streaming_Blake2s_128_blake2s_128_block_state block_state = scrut.block_state; + KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Blake2s_128_blake2s_init(block_state.snd, (uint32_t)0U, (uint32_t)32U); Hacl_Streaming_Blake2s_128_blake2s_128_state tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; diff --git a/src/Hacl_Streaming_Poly1305_128.c b/src/Hacl_Streaming_Poly1305_128.c index ff60cde2..c752cfb0 100644 --- a/src/Hacl_Streaming_Poly1305_128.c +++ b/src/Hacl_Streaming_Poly1305_128.c @@ -58,6 +58,7 @@ Hacl_Streaming_Poly1305_128_init(uint8_t *k, Hacl_Streaming_Poly1305_128_poly130 uint8_t *k_ = scrut.p_key; uint8_t *buf = scrut.buf; Lib_IntVector_Intrinsics_vec128 *block_state = scrut.block_state; + KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Poly1305_128_poly1305_init(block_state, k); memcpy(k_, k, (uint32_t)32U * sizeof (uint8_t)); uint8_t *k_1 = k_; diff --git a/src/Hacl_Streaming_Poly1305_256.c b/src/Hacl_Streaming_Poly1305_256.c index 63685f99..c1915ed9 100644 --- a/src/Hacl_Streaming_Poly1305_256.c +++ b/src/Hacl_Streaming_Poly1305_256.c @@ -58,6 +58,7 @@ Hacl_Streaming_Poly1305_256_init(uint8_t *k, Hacl_Streaming_Poly1305_256_poly130 uint8_t *k_ = scrut.p_key; uint8_t *buf = scrut.buf; Lib_IntVector_Intrinsics_vec256 *block_state = scrut.block_state; + KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Poly1305_256_poly1305_init(block_state, k); memcpy(k_, k, (uint32_t)32U * sizeof (uint8_t)); uint8_t *k_1 = k_; diff --git a/src/Hacl_Streaming_Poly1305_32.c b/src/Hacl_Streaming_Poly1305_32.c index 249a622f..89852727 100644 --- a/src/Hacl_Streaming_Poly1305_32.c +++ b/src/Hacl_Streaming_Poly1305_32.c @@ -53,6 +53,7 @@ Hacl_Streaming_Poly1305_32_init(uint8_t *k, Hacl_Streaming_Poly1305_32_poly1305_ uint8_t *k_ = scrut.p_key; uint8_t *buf = scrut.buf; uint64_t *block_state = scrut.block_state; + KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Poly1305_32_poly1305_init(block_state, k); memcpy(k_, k, (uint32_t)32U * sizeof (uint8_t)); uint8_t *k_1 = k_; diff --git a/src/Lib_Memzero0.c b/src/Lib_Memzero0.c index 8e225318..3d8a1e5f 100644 --- a/src/Lib_Memzero0.c +++ b/src/Lib_Memzero0.c @@ -22,13 +22,14 @@ #include #include -#include "Lib_Memzero0.h" +/* This is now a hand-written header */ +#include "lib_memzero0.h" #include "krml/internal/target.h" /* The F* formalization talks about the number of elements in the array. The C implementation wants a number of bytes in the array. KaRaMeL is aware of this and inserts a sizeof multiplication. */ -void Lib_Memzero0_memzero(void *dst, uint64_t len) { +void Lib_Memzero0_memzero0(void *dst, uint64_t len) { /* This is safe: karamel checks at run-time (if needed) that all object sizes fit within a size_t, so the size we receive has been checked at allocation-time, possibly via KRML_CHECK_SIZE, to fit in a size_t. */ diff --git a/src/msvc/EverCrypt_AEAD.c b/src/msvc/EverCrypt_AEAD.c index a4b306b7..564dbc2e 100644 --- a/src/msvc/EverCrypt_AEAD.c +++ b/src/msvc/EverCrypt_AEAD.c @@ -40,6 +40,10 @@ typedef struct EverCrypt_AEAD_state_s_s } EverCrypt_AEAD_state_s; +/** +Both encryption and decryption require a state that holds the key. +The state may be reused as many times as desired. +*/ bool EverCrypt_AEAD_uu___is_Ek(Spec_Agile_AEAD_alg a, EverCrypt_AEAD_state_s projectee) { return true; @@ -93,12 +97,12 @@ create_in_chacha20_poly1305(EverCrypt_AEAD_state_s **dst, uint8_t *k) static EverCrypt_Error_error_code create_in_aes128_gcm(EverCrypt_AEAD_state_s **dst, uint8_t *k) { + #if HACL_CAN_COMPILE_VALE bool has_aesni = EverCrypt_AutoConfig2_has_aesni(); bool has_pclmulqdq = EverCrypt_AutoConfig2_has_pclmulqdq(); bool has_avx = EverCrypt_AutoConfig2_has_avx(); bool has_sse = EverCrypt_AutoConfig2_has_sse(); bool has_movbe = EverCrypt_AutoConfig2_has_movbe(); - #if HACL_CAN_COMPILE_VALE if (has_aesni && has_pclmulqdq && has_avx && has_sse && has_movbe) { uint8_t *ek = (uint8_t *)KRML_HOST_CALLOC((uint32_t)480U, sizeof (uint8_t)); @@ -112,19 +116,21 @@ create_in_aes128_gcm(EverCrypt_AEAD_state_s **dst, uint8_t *k) *dst = p; return EverCrypt_Error_Success; } - #endif return EverCrypt_Error_UnsupportedAlgorithm; + #else + return EverCrypt_Error_UnsupportedAlgorithm; + #endif } static EverCrypt_Error_error_code create_in_aes256_gcm(EverCrypt_AEAD_state_s **dst, uint8_t *k) { + #if HACL_CAN_COMPILE_VALE bool has_aesni = EverCrypt_AutoConfig2_has_aesni(); bool has_pclmulqdq = EverCrypt_AutoConfig2_has_pclmulqdq(); bool has_avx = EverCrypt_AutoConfig2_has_avx(); bool has_sse = EverCrypt_AutoConfig2_has_sse(); bool has_movbe = EverCrypt_AutoConfig2_has_movbe(); - #if HACL_CAN_COMPILE_VALE if (has_aesni && has_pclmulqdq && has_avx && has_sse && has_movbe) { uint8_t *ek = (uint8_t *)KRML_HOST_CALLOC((uint32_t)544U, sizeof (uint8_t)); @@ -138,8 +144,10 @@ create_in_aes256_gcm(EverCrypt_AEAD_state_s **dst, uint8_t *k) *dst = p; return EverCrypt_Error_Success; } - #endif return EverCrypt_Error_UnsupportedAlgorithm; + #else + return EverCrypt_Error_UnsupportedAlgorithm; + #endif } /** @@ -797,12 +805,12 @@ EverCrypt_AEAD_encrypt_expand_aes128_gcm( uint8_t *tag ) { + #if HACL_CAN_COMPILE_VALE bool has_pclmulqdq = EverCrypt_AutoConfig2_has_pclmulqdq(); bool has_avx = EverCrypt_AutoConfig2_has_avx(); bool has_sse = EverCrypt_AutoConfig2_has_sse(); bool has_movbe = EverCrypt_AutoConfig2_has_movbe(); bool has_aesni = EverCrypt_AutoConfig2_has_aesni(); - #if HACL_CAN_COMPILE_VALE if (has_aesni && has_pclmulqdq && has_avx && has_sse && has_movbe) { uint8_t ek[480U] = { 0U }; @@ -919,8 +927,10 @@ EverCrypt_AEAD_encrypt_expand_aes128_gcm( } return EverCrypt_Error_Success; } - #endif return EverCrypt_Error_UnsupportedAlgorithm; + #else + return EverCrypt_Error_UnsupportedAlgorithm; + #endif } EverCrypt_Error_error_code @@ -936,12 +946,12 @@ EverCrypt_AEAD_encrypt_expand_aes256_gcm( uint8_t *tag ) { + #if HACL_CAN_COMPILE_VALE bool has_pclmulqdq = EverCrypt_AutoConfig2_has_pclmulqdq(); bool has_avx = EverCrypt_AutoConfig2_has_avx(); bool has_sse = EverCrypt_AutoConfig2_has_sse(); bool has_movbe = EverCrypt_AutoConfig2_has_movbe(); bool has_aesni = EverCrypt_AutoConfig2_has_aesni(); - #if HACL_CAN_COMPILE_VALE if (has_aesni && has_pclmulqdq && has_avx && has_sse && has_movbe) { uint8_t ek[544U] = { 0U }; @@ -1058,8 +1068,10 @@ EverCrypt_AEAD_encrypt_expand_aes256_gcm( } return EverCrypt_Error_Success; } - #endif return EverCrypt_Error_UnsupportedAlgorithm; + #else + return EverCrypt_Error_UnsupportedAlgorithm; + #endif } EverCrypt_Error_error_code @@ -1831,12 +1843,12 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm( uint8_t *dst ) { + #if HACL_CAN_COMPILE_VALE bool has_pclmulqdq = EverCrypt_AutoConfig2_has_pclmulqdq(); bool has_avx = EverCrypt_AutoConfig2_has_avx(); bool has_sse = EverCrypt_AutoConfig2_has_sse(); bool has_movbe = EverCrypt_AutoConfig2_has_movbe(); bool has_aesni = EverCrypt_AutoConfig2_has_aesni(); - #if HACL_CAN_COMPILE_VALE if (has_aesni && has_pclmulqdq && has_avx && has_sse && has_movbe) { uint8_t ek[480U] = { 0U }; @@ -1850,122 +1862,118 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm( { return EverCrypt_Error_InvalidKey; } - else if (iv_len == (uint32_t)0U) + if (iv_len == (uint32_t)0U) { return EverCrypt_Error_InvalidIVLength; } + EverCrypt_AEAD_state_s scrut1 = *s; + uint8_t *ek0 = scrut1.ek; + uint8_t *scratch_b = ek0 + (uint32_t)304U; + uint8_t *ek1 = ek0; + uint8_t *keys_b = ek1; + uint8_t *hkeys_b = ek1 + (uint32_t)176U; + uint8_t tmp_iv[16U] = { 0U }; + uint32_t len = iv_len / (uint32_t)16U; + uint32_t bytes_len = len * (uint32_t)16U; + uint8_t *iv_b = iv; + memcpy(tmp_iv, iv + bytes_len, iv_len % (uint32_t)16U * sizeof (uint8_t)); + uint64_t + uu____0 = compute_iv_stdcall(iv_b, (uint64_t)iv_len, (uint64_t)len, tmp_iv, tmp_iv, hkeys_b); + uint8_t *inout_b = scratch_b; + uint8_t *abytes_b = scratch_b + (uint32_t)16U; + uint8_t *scratch_b1 = scratch_b + (uint32_t)32U; + uint32_t cipher_len_ = (uint32_t)(uint64_t)cipher_len / (uint32_t)16U * (uint32_t)16U; + uint32_t auth_len_ = (uint32_t)(uint64_t)ad_len / (uint32_t)16U * (uint32_t)16U; + uint8_t *cipher_b_ = cipher; + uint8_t *out_b_ = dst; + uint8_t *auth_b_ = ad; + memcpy(inout_b, + cipher + cipher_len_, + (uint32_t)(uint64_t)cipher_len % (uint32_t)16U * sizeof (uint8_t)); + memcpy(abytes_b, + ad + auth_len_, + (uint32_t)(uint64_t)ad_len % (uint32_t)16U * sizeof (uint8_t)); + uint64_t len128x6 = (uint64_t)cipher_len / (uint64_t)96U * (uint64_t)96U; + uint64_t c; + if (len128x6 / (uint64_t)16U >= (uint64_t)6U) + { + uint64_t len128_num = (uint64_t)cipher_len / (uint64_t)16U * (uint64_t)16U - len128x6; + uint8_t *in128x6_b = cipher_b_; + uint8_t *out128x6_b = out_b_; + uint8_t *in128_b = cipher_b_ + (uint32_t)len128x6; + uint8_t *out128_b = out_b_ + (uint32_t)len128x6; + uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; + uint64_t len128x6_ = len128x6 / (uint64_t)16U; + uint64_t len128_num_ = len128_num / (uint64_t)16U; + uint64_t + scrut2 = + gcm128_decrypt_opt(auth_b_, + (uint64_t)ad_len, + auth_num, + keys_b, + tmp_iv, + hkeys_b, + abytes_b, + in128x6_b, + out128x6_b, + len128x6_, + in128_b, + out128_b, + len128_num_, + inout_b, + (uint64_t)cipher_len, + scratch_b1, + tag); + uint64_t c0 = scrut2; + c = c0; + } else { - EverCrypt_AEAD_state_s scrut1 = *s; - uint8_t *ek0 = scrut1.ek; - uint8_t *scratch_b = ek0 + (uint32_t)304U; - uint8_t *ek1 = ek0; - uint8_t *keys_b = ek1; - uint8_t *hkeys_b = ek1 + (uint32_t)176U; - uint8_t tmp_iv[16U] = { 0U }; - uint32_t len = iv_len / (uint32_t)16U; - uint32_t bytes_len = len * (uint32_t)16U; - uint8_t *iv_b = iv; - memcpy(tmp_iv, iv + bytes_len, iv_len % (uint32_t)16U * sizeof (uint8_t)); + uint32_t len128x61 = (uint32_t)0U; + uint64_t len128_num = (uint64_t)cipher_len / (uint64_t)16U * (uint64_t)16U; + uint8_t *in128x6_b = cipher_b_; + uint8_t *out128x6_b = out_b_; + uint8_t *in128_b = cipher_b_ + len128x61; + uint8_t *out128_b = out_b_ + len128x61; + uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; + uint64_t len128_num_ = len128_num / (uint64_t)16U; + uint64_t len128x6_ = (uint64_t)0U; uint64_t - uu____0 = compute_iv_stdcall(iv_b, (uint64_t)iv_len, (uint64_t)len, tmp_iv, tmp_iv, hkeys_b); - uint8_t *inout_b = scratch_b; - uint8_t *abytes_b = scratch_b + (uint32_t)16U; - uint8_t *scratch_b1 = scratch_b + (uint32_t)32U; - uint32_t cipher_len_ = (uint32_t)(uint64_t)cipher_len / (uint32_t)16U * (uint32_t)16U; - uint32_t auth_len_ = (uint32_t)(uint64_t)ad_len / (uint32_t)16U * (uint32_t)16U; - uint8_t *cipher_b_ = cipher; - uint8_t *out_b_ = dst; - uint8_t *auth_b_ = ad; - memcpy(inout_b, - cipher + cipher_len_, - (uint32_t)(uint64_t)cipher_len % (uint32_t)16U * sizeof (uint8_t)); - memcpy(abytes_b, - ad + auth_len_, - (uint32_t)(uint64_t)ad_len % (uint32_t)16U * sizeof (uint8_t)); - uint64_t len128x6 = (uint64_t)cipher_len / (uint64_t)96U * (uint64_t)96U; - uint64_t c; - if (len128x6 / (uint64_t)16U >= (uint64_t)6U) - { - uint64_t len128_num = (uint64_t)cipher_len / (uint64_t)16U * (uint64_t)16U - len128x6; - uint8_t *in128x6_b = cipher_b_; - uint8_t *out128x6_b = out_b_; - uint8_t *in128_b = cipher_b_ + (uint32_t)len128x6; - uint8_t *out128_b = out_b_ + (uint32_t)len128x6; - uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; - uint64_t len128x6_ = len128x6 / (uint64_t)16U; - uint64_t len128_num_ = len128_num / (uint64_t)16U; - uint64_t - scrut2 = - gcm128_decrypt_opt(auth_b_, - (uint64_t)ad_len, - auth_num, - keys_b, - tmp_iv, - hkeys_b, - abytes_b, - in128x6_b, - out128x6_b, - len128x6_, - in128_b, - out128_b, - len128_num_, - inout_b, - (uint64_t)cipher_len, - scratch_b1, - tag); - uint64_t c0 = scrut2; - c = c0; - } - else - { - uint32_t len128x61 = (uint32_t)0U; - uint64_t len128_num = (uint64_t)cipher_len / (uint64_t)16U * (uint64_t)16U; - uint8_t *in128x6_b = cipher_b_; - uint8_t *out128x6_b = out_b_; - uint8_t *in128_b = cipher_b_ + len128x61; - uint8_t *out128_b = out_b_ + len128x61; - uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; - uint64_t len128_num_ = len128_num / (uint64_t)16U; - uint64_t len128x6_ = (uint64_t)0U; - uint64_t - scrut2 = - gcm128_decrypt_opt(auth_b_, - (uint64_t)ad_len, - auth_num, - keys_b, - tmp_iv, - hkeys_b, - abytes_b, - in128x6_b, - out128x6_b, - len128x6_, - in128_b, - out128_b, - len128_num_, - inout_b, - (uint64_t)cipher_len, - scratch_b1, - tag); - uint64_t c0 = scrut2; - c = c0; - } - memcpy(dst + (uint32_t)(uint64_t)cipher_len / (uint32_t)16U * (uint32_t)16U, - inout_b, - (uint32_t)(uint64_t)cipher_len % (uint32_t)16U * sizeof (uint8_t)); - uint64_t r = c; - if (r == (uint64_t)0U) - { - return EverCrypt_Error_Success; - } - else - { - return EverCrypt_Error_AuthenticationFailure; - } + scrut2 = + gcm128_decrypt_opt(auth_b_, + (uint64_t)ad_len, + auth_num, + keys_b, + tmp_iv, + hkeys_b, + abytes_b, + in128x6_b, + out128x6_b, + len128x6_, + in128_b, + out128_b, + len128_num_, + inout_b, + (uint64_t)cipher_len, + scratch_b1, + tag); + uint64_t c0 = scrut2; + c = c0; } + memcpy(dst + (uint32_t)(uint64_t)cipher_len / (uint32_t)16U * (uint32_t)16U, + inout_b, + (uint32_t)(uint64_t)cipher_len % (uint32_t)16U * sizeof (uint8_t)); + uint64_t r = c; + if (r == (uint64_t)0U) + { + return EverCrypt_Error_Success; + } + return EverCrypt_Error_AuthenticationFailure; } - #endif return EverCrypt_Error_UnsupportedAlgorithm; + #else + return EverCrypt_Error_UnsupportedAlgorithm; + #endif } EverCrypt_Error_error_code @@ -1981,12 +1989,12 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm( uint8_t *dst ) { + #if HACL_CAN_COMPILE_VALE bool has_pclmulqdq = EverCrypt_AutoConfig2_has_pclmulqdq(); bool has_avx = EverCrypt_AutoConfig2_has_avx(); bool has_sse = EverCrypt_AutoConfig2_has_sse(); bool has_movbe = EverCrypt_AutoConfig2_has_movbe(); bool has_aesni = EverCrypt_AutoConfig2_has_aesni(); - #if HACL_CAN_COMPILE_VALE if (has_aesni && has_pclmulqdq && has_avx && has_sse && has_movbe) { uint8_t ek[544U] = { 0U }; @@ -2000,122 +2008,118 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm( { return EverCrypt_Error_InvalidKey; } - else if (iv_len == (uint32_t)0U) + if (iv_len == (uint32_t)0U) { return EverCrypt_Error_InvalidIVLength; } + EverCrypt_AEAD_state_s scrut1 = *s; + uint8_t *ek0 = scrut1.ek; + uint8_t *scratch_b = ek0 + (uint32_t)368U; + uint8_t *ek1 = ek0; + uint8_t *keys_b = ek1; + uint8_t *hkeys_b = ek1 + (uint32_t)240U; + uint8_t tmp_iv[16U] = { 0U }; + uint32_t len = iv_len / (uint32_t)16U; + uint32_t bytes_len = len * (uint32_t)16U; + uint8_t *iv_b = iv; + memcpy(tmp_iv, iv + bytes_len, iv_len % (uint32_t)16U * sizeof (uint8_t)); + uint64_t + uu____0 = compute_iv_stdcall(iv_b, (uint64_t)iv_len, (uint64_t)len, tmp_iv, tmp_iv, hkeys_b); + uint8_t *inout_b = scratch_b; + uint8_t *abytes_b = scratch_b + (uint32_t)16U; + uint8_t *scratch_b1 = scratch_b + (uint32_t)32U; + uint32_t cipher_len_ = (uint32_t)(uint64_t)cipher_len / (uint32_t)16U * (uint32_t)16U; + uint32_t auth_len_ = (uint32_t)(uint64_t)ad_len / (uint32_t)16U * (uint32_t)16U; + uint8_t *cipher_b_ = cipher; + uint8_t *out_b_ = dst; + uint8_t *auth_b_ = ad; + memcpy(inout_b, + cipher + cipher_len_, + (uint32_t)(uint64_t)cipher_len % (uint32_t)16U * sizeof (uint8_t)); + memcpy(abytes_b, + ad + auth_len_, + (uint32_t)(uint64_t)ad_len % (uint32_t)16U * sizeof (uint8_t)); + uint64_t len128x6 = (uint64_t)cipher_len / (uint64_t)96U * (uint64_t)96U; + uint64_t c; + if (len128x6 / (uint64_t)16U >= (uint64_t)6U) + { + uint64_t len128_num = (uint64_t)cipher_len / (uint64_t)16U * (uint64_t)16U - len128x6; + uint8_t *in128x6_b = cipher_b_; + uint8_t *out128x6_b = out_b_; + uint8_t *in128_b = cipher_b_ + (uint32_t)len128x6; + uint8_t *out128_b = out_b_ + (uint32_t)len128x6; + uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; + uint64_t len128x6_ = len128x6 / (uint64_t)16U; + uint64_t len128_num_ = len128_num / (uint64_t)16U; + uint64_t + scrut2 = + gcm256_decrypt_opt(auth_b_, + (uint64_t)ad_len, + auth_num, + keys_b, + tmp_iv, + hkeys_b, + abytes_b, + in128x6_b, + out128x6_b, + len128x6_, + in128_b, + out128_b, + len128_num_, + inout_b, + (uint64_t)cipher_len, + scratch_b1, + tag); + uint64_t c0 = scrut2; + c = c0; + } else { - EverCrypt_AEAD_state_s scrut1 = *s; - uint8_t *ek0 = scrut1.ek; - uint8_t *scratch_b = ek0 + (uint32_t)368U; - uint8_t *ek1 = ek0; - uint8_t *keys_b = ek1; - uint8_t *hkeys_b = ek1 + (uint32_t)240U; - uint8_t tmp_iv[16U] = { 0U }; - uint32_t len = iv_len / (uint32_t)16U; - uint32_t bytes_len = len * (uint32_t)16U; - uint8_t *iv_b = iv; - memcpy(tmp_iv, iv + bytes_len, iv_len % (uint32_t)16U * sizeof (uint8_t)); + uint32_t len128x61 = (uint32_t)0U; + uint64_t len128_num = (uint64_t)cipher_len / (uint64_t)16U * (uint64_t)16U; + uint8_t *in128x6_b = cipher_b_; + uint8_t *out128x6_b = out_b_; + uint8_t *in128_b = cipher_b_ + len128x61; + uint8_t *out128_b = out_b_ + len128x61; + uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; + uint64_t len128_num_ = len128_num / (uint64_t)16U; + uint64_t len128x6_ = (uint64_t)0U; uint64_t - uu____0 = compute_iv_stdcall(iv_b, (uint64_t)iv_len, (uint64_t)len, tmp_iv, tmp_iv, hkeys_b); - uint8_t *inout_b = scratch_b; - uint8_t *abytes_b = scratch_b + (uint32_t)16U; - uint8_t *scratch_b1 = scratch_b + (uint32_t)32U; - uint32_t cipher_len_ = (uint32_t)(uint64_t)cipher_len / (uint32_t)16U * (uint32_t)16U; - uint32_t auth_len_ = (uint32_t)(uint64_t)ad_len / (uint32_t)16U * (uint32_t)16U; - uint8_t *cipher_b_ = cipher; - uint8_t *out_b_ = dst; - uint8_t *auth_b_ = ad; - memcpy(inout_b, - cipher + cipher_len_, - (uint32_t)(uint64_t)cipher_len % (uint32_t)16U * sizeof (uint8_t)); - memcpy(abytes_b, - ad + auth_len_, - (uint32_t)(uint64_t)ad_len % (uint32_t)16U * sizeof (uint8_t)); - uint64_t len128x6 = (uint64_t)cipher_len / (uint64_t)96U * (uint64_t)96U; - uint64_t c; - if (len128x6 / (uint64_t)16U >= (uint64_t)6U) - { - uint64_t len128_num = (uint64_t)cipher_len / (uint64_t)16U * (uint64_t)16U - len128x6; - uint8_t *in128x6_b = cipher_b_; - uint8_t *out128x6_b = out_b_; - uint8_t *in128_b = cipher_b_ + (uint32_t)len128x6; - uint8_t *out128_b = out_b_ + (uint32_t)len128x6; - uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; - uint64_t len128x6_ = len128x6 / (uint64_t)16U; - uint64_t len128_num_ = len128_num / (uint64_t)16U; - uint64_t - scrut2 = - gcm256_decrypt_opt(auth_b_, - (uint64_t)ad_len, - auth_num, - keys_b, - tmp_iv, - hkeys_b, - abytes_b, - in128x6_b, - out128x6_b, - len128x6_, - in128_b, - out128_b, - len128_num_, - inout_b, - (uint64_t)cipher_len, - scratch_b1, - tag); - uint64_t c0 = scrut2; - c = c0; - } - else - { - uint32_t len128x61 = (uint32_t)0U; - uint64_t len128_num = (uint64_t)cipher_len / (uint64_t)16U * (uint64_t)16U; - uint8_t *in128x6_b = cipher_b_; - uint8_t *out128x6_b = out_b_; - uint8_t *in128_b = cipher_b_ + len128x61; - uint8_t *out128_b = out_b_ + len128x61; - uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; - uint64_t len128_num_ = len128_num / (uint64_t)16U; - uint64_t len128x6_ = (uint64_t)0U; - uint64_t - scrut2 = - gcm256_decrypt_opt(auth_b_, - (uint64_t)ad_len, - auth_num, - keys_b, - tmp_iv, - hkeys_b, - abytes_b, - in128x6_b, - out128x6_b, - len128x6_, - in128_b, - out128_b, - len128_num_, - inout_b, - (uint64_t)cipher_len, - scratch_b1, - tag); - uint64_t c0 = scrut2; - c = c0; - } - memcpy(dst + (uint32_t)(uint64_t)cipher_len / (uint32_t)16U * (uint32_t)16U, - inout_b, - (uint32_t)(uint64_t)cipher_len % (uint32_t)16U * sizeof (uint8_t)); - uint64_t r = c; - if (r == (uint64_t)0U) - { - return EverCrypt_Error_Success; - } - else - { - return EverCrypt_Error_AuthenticationFailure; - } + scrut2 = + gcm256_decrypt_opt(auth_b_, + (uint64_t)ad_len, + auth_num, + keys_b, + tmp_iv, + hkeys_b, + abytes_b, + in128x6_b, + out128x6_b, + len128x6_, + in128_b, + out128_b, + len128_num_, + inout_b, + (uint64_t)cipher_len, + scratch_b1, + tag); + uint64_t c0 = scrut2; + c = c0; + } + memcpy(dst + (uint32_t)(uint64_t)cipher_len / (uint32_t)16U * (uint32_t)16U, + inout_b, + (uint32_t)(uint64_t)cipher_len % (uint32_t)16U * sizeof (uint8_t)); + uint64_t r = c; + if (r == (uint64_t)0U) + { + return EverCrypt_Error_Success; } + return EverCrypt_Error_AuthenticationFailure; } - #endif return EverCrypt_Error_UnsupportedAlgorithm; + #else + return EverCrypt_Error_UnsupportedAlgorithm; + #endif } EverCrypt_Error_error_code diff --git a/src/msvc/EverCrypt_Chacha20Poly1305.c b/src/msvc/EverCrypt_Chacha20Poly1305.c index b1ad5a74..9a110bbf 100644 --- a/src/msvc/EverCrypt_Chacha20Poly1305.c +++ b/src/msvc/EverCrypt_Chacha20Poly1305.c @@ -39,13 +39,12 @@ EverCrypt_Chacha20Poly1305_aead_encrypt( uint8_t *tag ) { - bool avx2 = EverCrypt_AutoConfig2_has_avx2(); - bool avx = EverCrypt_AutoConfig2_has_avx(); bool vec256 = EverCrypt_AutoConfig2_has_vec256(); bool vec128 = EverCrypt_AutoConfig2_has_vec128(); #if HACL_CAN_COMPILE_VEC256 if (vec256) { + KRML_HOST_IGNORE(vec128); Hacl_Chacha20Poly1305_256_aead_encrypt(k, n, aadlen, aad, mlen, m, cipher, tag); return; } @@ -53,10 +52,13 @@ EverCrypt_Chacha20Poly1305_aead_encrypt( #if HACL_CAN_COMPILE_VEC128 if (vec128) { + KRML_HOST_IGNORE(vec256); Hacl_Chacha20Poly1305_128_aead_encrypt(k, n, aadlen, aad, mlen, m, cipher, tag); return; } #endif + KRML_HOST_IGNORE(vec128); + KRML_HOST_IGNORE(vec256); Hacl_Chacha20Poly1305_32_aead_encrypt(k, n, aadlen, aad, mlen, m, cipher, tag); } @@ -72,22 +74,24 @@ EverCrypt_Chacha20Poly1305_aead_decrypt( uint8_t *tag ) { - bool avx2 = EverCrypt_AutoConfig2_has_avx2(); - bool avx = EverCrypt_AutoConfig2_has_avx(); bool vec256 = EverCrypt_AutoConfig2_has_vec256(); bool vec128 = EverCrypt_AutoConfig2_has_vec128(); #if HACL_CAN_COMPILE_VEC256 if (vec256) { + KRML_HOST_IGNORE(vec128); return Hacl_Chacha20Poly1305_256_aead_decrypt(k, n, aadlen, aad, mlen, m, cipher, tag); } #endif #if HACL_CAN_COMPILE_VEC128 if (vec128) { + KRML_HOST_IGNORE(vec256); return Hacl_Chacha20Poly1305_128_aead_decrypt(k, n, aadlen, aad, mlen, m, cipher, tag); } #endif + KRML_HOST_IGNORE(vec128); + KRML_HOST_IGNORE(vec256); return Hacl_Chacha20Poly1305_32_aead_decrypt(k, n, aadlen, aad, mlen, m, cipher, tag); } diff --git a/src/msvc/EverCrypt_Curve25519.c b/src/msvc/EverCrypt_Curve25519.c index b97637b8..202f58c1 100644 --- a/src/msvc/EverCrypt_Curve25519.c +++ b/src/msvc/EverCrypt_Curve25519.c @@ -27,13 +27,6 @@ #include "config.h" -static inline bool has_adx_bmi2(void) -{ - bool has_bmi2 = EverCrypt_AutoConfig2_has_bmi2(); - bool has_adx = EverCrypt_AutoConfig2_has_adx(); - return has_bmi2 && has_adx; -} - /** Calculate a public point from a secret/private key. @@ -45,13 +38,17 @@ This computes a scalar multiplication of the secret/private key with the curve's void EverCrypt_Curve25519_secret_to_public(uint8_t *pub, uint8_t *priv) { #if HACL_CAN_COMPILE_VALE - if (has_adx_bmi2()) + bool has_bmi2 = EverCrypt_AutoConfig2_has_bmi2(); + bool has_adx = EverCrypt_AutoConfig2_has_adx(); + if (has_bmi2 && has_adx) { Hacl_Curve25519_64_secret_to_public(pub, priv); return; } - #endif Hacl_Curve25519_51_secret_to_public(pub, priv); + #else + Hacl_Curve25519_51_secret_to_public(pub, priv); + #endif } /** @@ -64,13 +61,17 @@ Compute the scalar multiple of a point. void EverCrypt_Curve25519_scalarmult(uint8_t *shared, uint8_t *my_priv, uint8_t *their_pub) { #if HACL_CAN_COMPILE_VALE - if (has_adx_bmi2()) + bool has_bmi2 = EverCrypt_AutoConfig2_has_bmi2(); + bool has_adx = EverCrypt_AutoConfig2_has_adx(); + if (has_bmi2 && has_adx) { Hacl_Curve25519_64_scalarmult(shared, my_priv, their_pub); return; } - #endif Hacl_Curve25519_51_scalarmult(shared, my_priv, their_pub); + #else + Hacl_Curve25519_51_scalarmult(shared, my_priv, their_pub); + #endif } /** @@ -83,11 +84,15 @@ Execute the diffie-hellmann key exchange. bool EverCrypt_Curve25519_ecdh(uint8_t *shared, uint8_t *my_priv, uint8_t *their_pub) { #if HACL_CAN_COMPILE_VALE - if (has_adx_bmi2()) + bool has_bmi2 = EverCrypt_AutoConfig2_has_bmi2(); + bool has_adx = EverCrypt_AutoConfig2_has_adx(); + if (has_bmi2 && has_adx) { return Hacl_Curve25519_64_ecdh(shared, my_priv, their_pub); } - #endif return Hacl_Curve25519_51_ecdh(shared, my_priv, their_pub); + #else + return Hacl_Curve25519_51_ecdh(shared, my_priv, their_pub); + #endif } diff --git a/src/msvc/EverCrypt_DRBG.c b/src/msvc/EverCrypt_DRBG.c index dfd7cc64..243d8eb4 100644 --- a/src/msvc/EverCrypt_DRBG.c +++ b/src/msvc/EverCrypt_DRBG.c @@ -26,6 +26,7 @@ #include "EverCrypt_DRBG.h" #include "internal/EverCrypt_HMAC.h" +#include "lib_memzero0.h" uint32_t EverCrypt_DRBG_reseed_interval = (uint32_t)1024U; @@ -632,20 +633,18 @@ reseed_sha1( memcpy(seed_material + entropy_input_len, additional_input, additional_input_len * sizeof (uint8_t)); - Hacl_HMAC_DRBG_state uu____0; + Hacl_HMAC_DRBG_state scrut; if (st_s.tag == SHA1_s) { - uu____0 = st_s.case_SHA1_s; + scrut = st_s.case_SHA1_s; } else { - uu____0 = - KRML_EABORT(Hacl_HMAC_DRBG_state, - "unreachable (pattern matches are exhaustive in F*)"); + scrut = KRML_EABORT(Hacl_HMAC_DRBG_state, "unreachable (pattern matches are exhaustive in F*)"); } - uint8_t *k = uu____0.k; - uint8_t *v = uu____0.v; - uint32_t *ctr = uu____0.reseed_counter; + uint8_t *k = scrut.k; + uint8_t *v = scrut.v; + uint32_t *ctr = scrut.reseed_counter; uint32_t input_len = (uint32_t)21U + entropy_input_len + additional_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len); uint8_t *input0 = (uint8_t *)alloca(input_len * sizeof (uint8_t)); @@ -715,20 +714,18 @@ reseed_sha2_256( memcpy(seed_material + entropy_input_len, additional_input, additional_input_len * sizeof (uint8_t)); - Hacl_HMAC_DRBG_state uu____0; + Hacl_HMAC_DRBG_state scrut; if (st_s.tag == SHA2_256_s) { - uu____0 = st_s.case_SHA2_256_s; + scrut = st_s.case_SHA2_256_s; } else { - uu____0 = - KRML_EABORT(Hacl_HMAC_DRBG_state, - "unreachable (pattern matches are exhaustive in F*)"); + scrut = KRML_EABORT(Hacl_HMAC_DRBG_state, "unreachable (pattern matches are exhaustive in F*)"); } - uint8_t *k = uu____0.k; - uint8_t *v = uu____0.v; - uint32_t *ctr = uu____0.reseed_counter; + uint8_t *k = scrut.k; + uint8_t *v = scrut.v; + uint32_t *ctr = scrut.reseed_counter; uint32_t input_len = (uint32_t)33U + entropy_input_len + additional_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len); uint8_t *input0 = (uint8_t *)alloca(input_len * sizeof (uint8_t)); @@ -798,20 +795,18 @@ reseed_sha2_384( memcpy(seed_material + entropy_input_len, additional_input, additional_input_len * sizeof (uint8_t)); - Hacl_HMAC_DRBG_state uu____0; + Hacl_HMAC_DRBG_state scrut; if (st_s.tag == SHA2_384_s) { - uu____0 = st_s.case_SHA2_384_s; + scrut = st_s.case_SHA2_384_s; } else { - uu____0 = - KRML_EABORT(Hacl_HMAC_DRBG_state, - "unreachable (pattern matches are exhaustive in F*)"); + scrut = KRML_EABORT(Hacl_HMAC_DRBG_state, "unreachable (pattern matches are exhaustive in F*)"); } - uint8_t *k = uu____0.k; - uint8_t *v = uu____0.v; - uint32_t *ctr = uu____0.reseed_counter; + uint8_t *k = scrut.k; + uint8_t *v = scrut.v; + uint32_t *ctr = scrut.reseed_counter; uint32_t input_len = (uint32_t)49U + entropy_input_len + additional_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len); uint8_t *input0 = (uint8_t *)alloca(input_len * sizeof (uint8_t)); @@ -881,20 +876,18 @@ reseed_sha2_512( memcpy(seed_material + entropy_input_len, additional_input, additional_input_len * sizeof (uint8_t)); - Hacl_HMAC_DRBG_state uu____0; + Hacl_HMAC_DRBG_state scrut; if (st_s.tag == SHA2_512_s) { - uu____0 = st_s.case_SHA2_512_s; + scrut = st_s.case_SHA2_512_s; } else { - uu____0 = - KRML_EABORT(Hacl_HMAC_DRBG_state, - "unreachable (pattern matches are exhaustive in F*)"); + scrut = KRML_EABORT(Hacl_HMAC_DRBG_state, "unreachable (pattern matches are exhaustive in F*)"); } - uint8_t *k = uu____0.k; - uint8_t *v = uu____0.v; - uint32_t *ctr = uu____0.reseed_counter; + uint8_t *k = scrut.k; + uint8_t *v = scrut.v; + uint32_t *ctr = scrut.reseed_counter; uint32_t input_len = (uint32_t)65U + entropy_input_len + additional_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len); uint8_t *input0 = (uint8_t *)alloca(input_len * sizeof (uint8_t)); @@ -952,7 +945,6 @@ generate_sha1( { return false; } - uint32_t entropy_input_len = Hacl_HMAC_DRBG_min_length(Spec_Hash_Definitions_SHA1); bool ok0; if (additional_input_len > Hacl_HMAC_DRBG_max_additional_input_length) { @@ -960,11 +952,11 @@ generate_sha1( } else { - uint32_t entropy_input_len1 = Hacl_HMAC_DRBG_min_length(Spec_Hash_Definitions_SHA1); - KRML_CHECK_SIZE(sizeof (uint8_t), entropy_input_len1); - uint8_t *entropy_input = (uint8_t *)alloca(entropy_input_len1 * sizeof (uint8_t)); - memset(entropy_input, 0U, entropy_input_len1 * sizeof (uint8_t)); - bool ok = Lib_RandomBuffer_System_randombytes(entropy_input, entropy_input_len1); + uint32_t entropy_input_len = Hacl_HMAC_DRBG_min_length(Spec_Hash_Definitions_SHA1); + KRML_CHECK_SIZE(sizeof (uint8_t), entropy_input_len); + uint8_t *entropy_input = (uint8_t *)alloca(entropy_input_len * sizeof (uint8_t)); + memset(entropy_input, 0U, entropy_input_len * sizeof (uint8_t)); + bool ok = Lib_RandomBuffer_System_randombytes(entropy_input, entropy_input_len); bool result; if (!ok) { @@ -973,58 +965,58 @@ generate_sha1( else { EverCrypt_DRBG_state_s st_s = *st; - KRML_CHECK_SIZE(sizeof (uint8_t), entropy_input_len1 + additional_input_len); + KRML_CHECK_SIZE(sizeof (uint8_t), entropy_input_len + additional_input_len); uint8_t *seed_material = - (uint8_t *)alloca((entropy_input_len1 + additional_input_len) * sizeof (uint8_t)); - memset(seed_material, 0U, (entropy_input_len1 + additional_input_len) * sizeof (uint8_t)); - memcpy(seed_material, entropy_input, entropy_input_len1 * sizeof (uint8_t)); - memcpy(seed_material + entropy_input_len1, + (uint8_t *)alloca((entropy_input_len + additional_input_len) * sizeof (uint8_t)); + memset(seed_material, 0U, (entropy_input_len + additional_input_len) * sizeof (uint8_t)); + memcpy(seed_material, entropy_input, entropy_input_len * sizeof (uint8_t)); + memcpy(seed_material + entropy_input_len, additional_input, additional_input_len * sizeof (uint8_t)); - Hacl_HMAC_DRBG_state uu____0; + Hacl_HMAC_DRBG_state scrut; if (st_s.tag == SHA1_s) { - uu____0 = st_s.case_SHA1_s; + scrut = st_s.case_SHA1_s; } else { - uu____0 = + scrut = KRML_EABORT(Hacl_HMAC_DRBG_state, "unreachable (pattern matches are exhaustive in F*)"); } - uint8_t *k = uu____0.k; - uint8_t *v = uu____0.v; - uint32_t *ctr = uu____0.reseed_counter; - uint32_t input_len = (uint32_t)21U + entropy_input_len1 + additional_input_len; + uint8_t *k = scrut.k; + uint8_t *v = scrut.v; + uint32_t *ctr = scrut.reseed_counter; + uint32_t input_len = (uint32_t)21U + entropy_input_len + additional_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len); uint8_t *input0 = (uint8_t *)alloca(input_len * sizeof (uint8_t)); memset(input0, 0U, input_len * sizeof (uint8_t)); uint8_t *k_ = input0; memcpy(k_, v, (uint32_t)20U * sizeof (uint8_t)); - if (entropy_input_len1 + additional_input_len != (uint32_t)0U) + if (entropy_input_len + additional_input_len != (uint32_t)0U) { memcpy(input0 + (uint32_t)21U, seed_material, - (entropy_input_len1 + additional_input_len) * sizeof (uint8_t)); + (entropy_input_len + additional_input_len) * sizeof (uint8_t)); } input0[20U] = (uint8_t)0U; EverCrypt_HMAC_compute_sha1(k_, k, (uint32_t)20U, input0, input_len); EverCrypt_HMAC_compute_sha1(v, k_, (uint32_t)20U, v, (uint32_t)20U); memcpy(k, k_, (uint32_t)20U * sizeof (uint8_t)); - if (entropy_input_len1 + additional_input_len != (uint32_t)0U) + if (entropy_input_len + additional_input_len != (uint32_t)0U) { - uint32_t input_len0 = (uint32_t)21U + entropy_input_len1 + additional_input_len; + uint32_t input_len0 = (uint32_t)21U + entropy_input_len + additional_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len0); uint8_t *input = (uint8_t *)alloca(input_len0 * sizeof (uint8_t)); memset(input, 0U, input_len0 * sizeof (uint8_t)); uint8_t *k_0 = input; memcpy(k_0, v, (uint32_t)20U * sizeof (uint8_t)); - if (entropy_input_len1 + additional_input_len != (uint32_t)0U) + if (entropy_input_len + additional_input_len != (uint32_t)0U) { memcpy(input + (uint32_t)21U, seed_material, - (entropy_input_len1 + additional_input_len) * sizeof (uint8_t)); + (entropy_input_len + additional_input_len) * sizeof (uint8_t)); } input[20U] = (uint8_t)1U; EverCrypt_HMAC_compute_sha1(k_0, k, (uint32_t)20U, input, input_len0); @@ -1050,75 +1042,24 @@ generate_sha1( { x1 = KRML_EABORT(Hacl_HMAC_DRBG_state, "unreachable (pattern matches are exhaustive in F*)"); } - bool b; if (x1.reseed_counter[0U] > Hacl_HMAC_DRBG_reseed_interval) { - b = false; + return false; + } + Hacl_HMAC_DRBG_state scrut; + if (st_s.tag == SHA1_s) + { + scrut = st_s.case_SHA1_s; } else { - Hacl_HMAC_DRBG_state scrut; - if (st_s.tag == SHA1_s) - { - scrut = st_s.case_SHA1_s; - } - else - { - scrut = - KRML_EABORT(Hacl_HMAC_DRBG_state, - "unreachable (pattern matches are exhaustive in F*)"); - } - uint8_t *k = scrut.k; - uint8_t *v = scrut.v; - uint32_t *ctr = scrut.reseed_counter; - if (additional_input_len > (uint32_t)0U) - { - uint32_t input_len = (uint32_t)21U + additional_input_len; - KRML_CHECK_SIZE(sizeof (uint8_t), input_len); - uint8_t *input0 = (uint8_t *)alloca(input_len * sizeof (uint8_t)); - memset(input0, 0U, input_len * sizeof (uint8_t)); - uint8_t *k_ = input0; - memcpy(k_, v, (uint32_t)20U * sizeof (uint8_t)); - if (additional_input_len != (uint32_t)0U) - { - memcpy(input0 + (uint32_t)21U, additional_input, additional_input_len * sizeof (uint8_t)); - } - input0[20U] = (uint8_t)0U; - EverCrypt_HMAC_compute_sha1(k_, k, (uint32_t)20U, input0, input_len); - EverCrypt_HMAC_compute_sha1(v, k_, (uint32_t)20U, v, (uint32_t)20U); - memcpy(k, k_, (uint32_t)20U * sizeof (uint8_t)); - if (additional_input_len != (uint32_t)0U) - { - uint32_t input_len0 = (uint32_t)21U + additional_input_len; - KRML_CHECK_SIZE(sizeof (uint8_t), input_len0); - uint8_t *input = (uint8_t *)alloca(input_len0 * sizeof (uint8_t)); - memset(input, 0U, input_len0 * sizeof (uint8_t)); - uint8_t *k_0 = input; - memcpy(k_0, v, (uint32_t)20U * sizeof (uint8_t)); - if (additional_input_len != (uint32_t)0U) - { - memcpy(input + (uint32_t)21U, additional_input, additional_input_len * sizeof (uint8_t)); - } - input[20U] = (uint8_t)1U; - EverCrypt_HMAC_compute_sha1(k_0, k, (uint32_t)20U, input, input_len0); - EverCrypt_HMAC_compute_sha1(v, k_0, (uint32_t)20U, v, (uint32_t)20U); - memcpy(k, k_0, (uint32_t)20U * sizeof (uint8_t)); - } - } - uint8_t *output1 = output; - uint32_t max = n / (uint32_t)20U; - uint8_t *out = output1; - for (uint32_t i = (uint32_t)0U; i < max; i++) - { - EverCrypt_HMAC_compute_sha1(v, k, (uint32_t)20U, v, (uint32_t)20U); - memcpy(out + i * (uint32_t)20U, v, (uint32_t)20U * sizeof (uint8_t)); - } - if (max * (uint32_t)20U < n) - { - uint8_t *block = output1 + max * (uint32_t)20U; - EverCrypt_HMAC_compute_sha1(v, k, (uint32_t)20U, v, (uint32_t)20U); - memcpy(block, v, (n - max * (uint32_t)20U) * sizeof (uint8_t)); - } + scrut = KRML_EABORT(Hacl_HMAC_DRBG_state, "unreachable (pattern matches are exhaustive in F*)"); + } + uint8_t *k = scrut.k; + uint8_t *v = scrut.v; + uint32_t *ctr = scrut.reseed_counter; + if (additional_input_len > (uint32_t)0U) + { uint32_t input_len = (uint32_t)21U + additional_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len); uint8_t *input0 = (uint8_t *)alloca(input_len * sizeof (uint8_t)); @@ -1150,10 +1091,54 @@ generate_sha1( EverCrypt_HMAC_compute_sha1(v, k_0, (uint32_t)20U, v, (uint32_t)20U); memcpy(k, k_0, (uint32_t)20U * sizeof (uint8_t)); } - uint32_t old_ctr = ctr[0U]; - ctr[0U] = old_ctr + (uint32_t)1U; - b = true; } + uint8_t *output1 = output; + uint32_t max = n / (uint32_t)20U; + uint8_t *out = output1; + for (uint32_t i = (uint32_t)0U; i < max; i++) + { + EverCrypt_HMAC_compute_sha1(v, k, (uint32_t)20U, v, (uint32_t)20U); + memcpy(out + i * (uint32_t)20U, v, (uint32_t)20U * sizeof (uint8_t)); + } + if (max * (uint32_t)20U < n) + { + uint8_t *block = output1 + max * (uint32_t)20U; + EverCrypt_HMAC_compute_sha1(v, k, (uint32_t)20U, v, (uint32_t)20U); + memcpy(block, v, (n - max * (uint32_t)20U) * sizeof (uint8_t)); + } + uint32_t input_len = (uint32_t)21U + additional_input_len; + KRML_CHECK_SIZE(sizeof (uint8_t), input_len); + uint8_t *input0 = (uint8_t *)alloca(input_len * sizeof (uint8_t)); + memset(input0, 0U, input_len * sizeof (uint8_t)); + uint8_t *k_ = input0; + memcpy(k_, v, (uint32_t)20U * sizeof (uint8_t)); + if (additional_input_len != (uint32_t)0U) + { + memcpy(input0 + (uint32_t)21U, additional_input, additional_input_len * sizeof (uint8_t)); + } + input0[20U] = (uint8_t)0U; + EverCrypt_HMAC_compute_sha1(k_, k, (uint32_t)20U, input0, input_len); + EverCrypt_HMAC_compute_sha1(v, k_, (uint32_t)20U, v, (uint32_t)20U); + memcpy(k, k_, (uint32_t)20U * sizeof (uint8_t)); + if (additional_input_len != (uint32_t)0U) + { + uint32_t input_len0 = (uint32_t)21U + additional_input_len; + KRML_CHECK_SIZE(sizeof (uint8_t), input_len0); + uint8_t *input = (uint8_t *)alloca(input_len0 * sizeof (uint8_t)); + memset(input, 0U, input_len0 * sizeof (uint8_t)); + uint8_t *k_0 = input; + memcpy(k_0, v, (uint32_t)20U * sizeof (uint8_t)); + if (additional_input_len != (uint32_t)0U) + { + memcpy(input + (uint32_t)21U, additional_input, additional_input_len * sizeof (uint8_t)); + } + input[20U] = (uint8_t)1U; + EverCrypt_HMAC_compute_sha1(k_0, k, (uint32_t)20U, input, input_len0); + EverCrypt_HMAC_compute_sha1(v, k_0, (uint32_t)20U, v, (uint32_t)20U); + memcpy(k, k_0, (uint32_t)20U * sizeof (uint8_t)); + } + uint32_t old_ctr = ctr[0U]; + ctr[0U] = old_ctr + (uint32_t)1U; return true; } @@ -1175,7 +1160,6 @@ generate_sha2_256( { return false; } - uint32_t entropy_input_len = Hacl_HMAC_DRBG_min_length(Spec_Hash_Definitions_SHA2_256); bool ok0; if (additional_input_len > Hacl_HMAC_DRBG_max_additional_input_length) { @@ -1183,11 +1167,11 @@ generate_sha2_256( } else { - uint32_t entropy_input_len1 = Hacl_HMAC_DRBG_min_length(Spec_Hash_Definitions_SHA2_256); - KRML_CHECK_SIZE(sizeof (uint8_t), entropy_input_len1); - uint8_t *entropy_input = (uint8_t *)alloca(entropy_input_len1 * sizeof (uint8_t)); - memset(entropy_input, 0U, entropy_input_len1 * sizeof (uint8_t)); - bool ok = Lib_RandomBuffer_System_randombytes(entropy_input, entropy_input_len1); + uint32_t entropy_input_len = Hacl_HMAC_DRBG_min_length(Spec_Hash_Definitions_SHA2_256); + KRML_CHECK_SIZE(sizeof (uint8_t), entropy_input_len); + uint8_t *entropy_input = (uint8_t *)alloca(entropy_input_len * sizeof (uint8_t)); + memset(entropy_input, 0U, entropy_input_len * sizeof (uint8_t)); + bool ok = Lib_RandomBuffer_System_randombytes(entropy_input, entropy_input_len); bool result; if (!ok) { @@ -1196,58 +1180,58 @@ generate_sha2_256( else { EverCrypt_DRBG_state_s st_s = *st; - KRML_CHECK_SIZE(sizeof (uint8_t), entropy_input_len1 + additional_input_len); + KRML_CHECK_SIZE(sizeof (uint8_t), entropy_input_len + additional_input_len); uint8_t *seed_material = - (uint8_t *)alloca((entropy_input_len1 + additional_input_len) * sizeof (uint8_t)); - memset(seed_material, 0U, (entropy_input_len1 + additional_input_len) * sizeof (uint8_t)); - memcpy(seed_material, entropy_input, entropy_input_len1 * sizeof (uint8_t)); - memcpy(seed_material + entropy_input_len1, + (uint8_t *)alloca((entropy_input_len + additional_input_len) * sizeof (uint8_t)); + memset(seed_material, 0U, (entropy_input_len + additional_input_len) * sizeof (uint8_t)); + memcpy(seed_material, entropy_input, entropy_input_len * sizeof (uint8_t)); + memcpy(seed_material + entropy_input_len, additional_input, additional_input_len * sizeof (uint8_t)); - Hacl_HMAC_DRBG_state uu____0; + Hacl_HMAC_DRBG_state scrut; if (st_s.tag == SHA2_256_s) { - uu____0 = st_s.case_SHA2_256_s; + scrut = st_s.case_SHA2_256_s; } else { - uu____0 = + scrut = KRML_EABORT(Hacl_HMAC_DRBG_state, "unreachable (pattern matches are exhaustive in F*)"); } - uint8_t *k = uu____0.k; - uint8_t *v = uu____0.v; - uint32_t *ctr = uu____0.reseed_counter; - uint32_t input_len = (uint32_t)33U + entropy_input_len1 + additional_input_len; + uint8_t *k = scrut.k; + uint8_t *v = scrut.v; + uint32_t *ctr = scrut.reseed_counter; + uint32_t input_len = (uint32_t)33U + entropy_input_len + additional_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len); uint8_t *input0 = (uint8_t *)alloca(input_len * sizeof (uint8_t)); memset(input0, 0U, input_len * sizeof (uint8_t)); uint8_t *k_ = input0; memcpy(k_, v, (uint32_t)32U * sizeof (uint8_t)); - if (entropy_input_len1 + additional_input_len != (uint32_t)0U) + if (entropy_input_len + additional_input_len != (uint32_t)0U) { memcpy(input0 + (uint32_t)33U, seed_material, - (entropy_input_len1 + additional_input_len) * sizeof (uint8_t)); + (entropy_input_len + additional_input_len) * sizeof (uint8_t)); } input0[32U] = (uint8_t)0U; EverCrypt_HMAC_compute_sha2_256(k_, k, (uint32_t)32U, input0, input_len); EverCrypt_HMAC_compute_sha2_256(v, k_, (uint32_t)32U, v, (uint32_t)32U); memcpy(k, k_, (uint32_t)32U * sizeof (uint8_t)); - if (entropy_input_len1 + additional_input_len != (uint32_t)0U) + if (entropy_input_len + additional_input_len != (uint32_t)0U) { - uint32_t input_len0 = (uint32_t)33U + entropy_input_len1 + additional_input_len; + uint32_t input_len0 = (uint32_t)33U + entropy_input_len + additional_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len0); uint8_t *input = (uint8_t *)alloca(input_len0 * sizeof (uint8_t)); memset(input, 0U, input_len0 * sizeof (uint8_t)); uint8_t *k_0 = input; memcpy(k_0, v, (uint32_t)32U * sizeof (uint8_t)); - if (entropy_input_len1 + additional_input_len != (uint32_t)0U) + if (entropy_input_len + additional_input_len != (uint32_t)0U) { memcpy(input + (uint32_t)33U, seed_material, - (entropy_input_len1 + additional_input_len) * sizeof (uint8_t)); + (entropy_input_len + additional_input_len) * sizeof (uint8_t)); } input[32U] = (uint8_t)1U; EverCrypt_HMAC_compute_sha2_256(k_0, k, (uint32_t)32U, input, input_len0); @@ -1273,75 +1257,24 @@ generate_sha2_256( { x1 = KRML_EABORT(Hacl_HMAC_DRBG_state, "unreachable (pattern matches are exhaustive in F*)"); } - bool b; if (x1.reseed_counter[0U] > Hacl_HMAC_DRBG_reseed_interval) { - b = false; + return false; + } + Hacl_HMAC_DRBG_state scrut; + if (st_s.tag == SHA2_256_s) + { + scrut = st_s.case_SHA2_256_s; } else { - Hacl_HMAC_DRBG_state scrut; - if (st_s.tag == SHA2_256_s) - { - scrut = st_s.case_SHA2_256_s; - } - else - { - scrut = - KRML_EABORT(Hacl_HMAC_DRBG_state, - "unreachable (pattern matches are exhaustive in F*)"); - } - uint8_t *k = scrut.k; - uint8_t *v = scrut.v; - uint32_t *ctr = scrut.reseed_counter; - if (additional_input_len > (uint32_t)0U) - { - uint32_t input_len = (uint32_t)33U + additional_input_len; - KRML_CHECK_SIZE(sizeof (uint8_t), input_len); - uint8_t *input0 = (uint8_t *)alloca(input_len * sizeof (uint8_t)); - memset(input0, 0U, input_len * sizeof (uint8_t)); - uint8_t *k_ = input0; - memcpy(k_, v, (uint32_t)32U * sizeof (uint8_t)); - if (additional_input_len != (uint32_t)0U) - { - memcpy(input0 + (uint32_t)33U, additional_input, additional_input_len * sizeof (uint8_t)); - } - input0[32U] = (uint8_t)0U; - EverCrypt_HMAC_compute_sha2_256(k_, k, (uint32_t)32U, input0, input_len); - EverCrypt_HMAC_compute_sha2_256(v, k_, (uint32_t)32U, v, (uint32_t)32U); - memcpy(k, k_, (uint32_t)32U * sizeof (uint8_t)); - if (additional_input_len != (uint32_t)0U) - { - uint32_t input_len0 = (uint32_t)33U + additional_input_len; - KRML_CHECK_SIZE(sizeof (uint8_t), input_len0); - uint8_t *input = (uint8_t *)alloca(input_len0 * sizeof (uint8_t)); - memset(input, 0U, input_len0 * sizeof (uint8_t)); - uint8_t *k_0 = input; - memcpy(k_0, v, (uint32_t)32U * sizeof (uint8_t)); - if (additional_input_len != (uint32_t)0U) - { - memcpy(input + (uint32_t)33U, additional_input, additional_input_len * sizeof (uint8_t)); - } - input[32U] = (uint8_t)1U; - EverCrypt_HMAC_compute_sha2_256(k_0, k, (uint32_t)32U, input, input_len0); - EverCrypt_HMAC_compute_sha2_256(v, k_0, (uint32_t)32U, v, (uint32_t)32U); - memcpy(k, k_0, (uint32_t)32U * sizeof (uint8_t)); - } - } - uint8_t *output1 = output; - uint32_t max = n / (uint32_t)32U; - uint8_t *out = output1; - for (uint32_t i = (uint32_t)0U; i < max; i++) - { - EverCrypt_HMAC_compute_sha2_256(v, k, (uint32_t)32U, v, (uint32_t)32U); - memcpy(out + i * (uint32_t)32U, v, (uint32_t)32U * sizeof (uint8_t)); - } - if (max * (uint32_t)32U < n) - { - uint8_t *block = output1 + max * (uint32_t)32U; - EverCrypt_HMAC_compute_sha2_256(v, k, (uint32_t)32U, v, (uint32_t)32U); - memcpy(block, v, (n - max * (uint32_t)32U) * sizeof (uint8_t)); - } + scrut = KRML_EABORT(Hacl_HMAC_DRBG_state, "unreachable (pattern matches are exhaustive in F*)"); + } + uint8_t *k = scrut.k; + uint8_t *v = scrut.v; + uint32_t *ctr = scrut.reseed_counter; + if (additional_input_len > (uint32_t)0U) + { uint32_t input_len = (uint32_t)33U + additional_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len); uint8_t *input0 = (uint8_t *)alloca(input_len * sizeof (uint8_t)); @@ -1373,10 +1306,54 @@ generate_sha2_256( EverCrypt_HMAC_compute_sha2_256(v, k_0, (uint32_t)32U, v, (uint32_t)32U); memcpy(k, k_0, (uint32_t)32U * sizeof (uint8_t)); } - uint32_t old_ctr = ctr[0U]; - ctr[0U] = old_ctr + (uint32_t)1U; - b = true; } + uint8_t *output1 = output; + uint32_t max = n / (uint32_t)32U; + uint8_t *out = output1; + for (uint32_t i = (uint32_t)0U; i < max; i++) + { + EverCrypt_HMAC_compute_sha2_256(v, k, (uint32_t)32U, v, (uint32_t)32U); + memcpy(out + i * (uint32_t)32U, v, (uint32_t)32U * sizeof (uint8_t)); + } + if (max * (uint32_t)32U < n) + { + uint8_t *block = output1 + max * (uint32_t)32U; + EverCrypt_HMAC_compute_sha2_256(v, k, (uint32_t)32U, v, (uint32_t)32U); + memcpy(block, v, (n - max * (uint32_t)32U) * sizeof (uint8_t)); + } + uint32_t input_len = (uint32_t)33U + additional_input_len; + KRML_CHECK_SIZE(sizeof (uint8_t), input_len); + uint8_t *input0 = (uint8_t *)alloca(input_len * sizeof (uint8_t)); + memset(input0, 0U, input_len * sizeof (uint8_t)); + uint8_t *k_ = input0; + memcpy(k_, v, (uint32_t)32U * sizeof (uint8_t)); + if (additional_input_len != (uint32_t)0U) + { + memcpy(input0 + (uint32_t)33U, additional_input, additional_input_len * sizeof (uint8_t)); + } + input0[32U] = (uint8_t)0U; + EverCrypt_HMAC_compute_sha2_256(k_, k, (uint32_t)32U, input0, input_len); + EverCrypt_HMAC_compute_sha2_256(v, k_, (uint32_t)32U, v, (uint32_t)32U); + memcpy(k, k_, (uint32_t)32U * sizeof (uint8_t)); + if (additional_input_len != (uint32_t)0U) + { + uint32_t input_len0 = (uint32_t)33U + additional_input_len; + KRML_CHECK_SIZE(sizeof (uint8_t), input_len0); + uint8_t *input = (uint8_t *)alloca(input_len0 * sizeof (uint8_t)); + memset(input, 0U, input_len0 * sizeof (uint8_t)); + uint8_t *k_0 = input; + memcpy(k_0, v, (uint32_t)32U * sizeof (uint8_t)); + if (additional_input_len != (uint32_t)0U) + { + memcpy(input + (uint32_t)33U, additional_input, additional_input_len * sizeof (uint8_t)); + } + input[32U] = (uint8_t)1U; + EverCrypt_HMAC_compute_sha2_256(k_0, k, (uint32_t)32U, input, input_len0); + EverCrypt_HMAC_compute_sha2_256(v, k_0, (uint32_t)32U, v, (uint32_t)32U); + memcpy(k, k_0, (uint32_t)32U * sizeof (uint8_t)); + } + uint32_t old_ctr = ctr[0U]; + ctr[0U] = old_ctr + (uint32_t)1U; return true; } @@ -1398,7 +1375,6 @@ generate_sha2_384( { return false; } - uint32_t entropy_input_len = Hacl_HMAC_DRBG_min_length(Spec_Hash_Definitions_SHA2_384); bool ok0; if (additional_input_len > Hacl_HMAC_DRBG_max_additional_input_length) { @@ -1406,11 +1382,11 @@ generate_sha2_384( } else { - uint32_t entropy_input_len1 = Hacl_HMAC_DRBG_min_length(Spec_Hash_Definitions_SHA2_384); - KRML_CHECK_SIZE(sizeof (uint8_t), entropy_input_len1); - uint8_t *entropy_input = (uint8_t *)alloca(entropy_input_len1 * sizeof (uint8_t)); - memset(entropy_input, 0U, entropy_input_len1 * sizeof (uint8_t)); - bool ok = Lib_RandomBuffer_System_randombytes(entropy_input, entropy_input_len1); + uint32_t entropy_input_len = Hacl_HMAC_DRBG_min_length(Spec_Hash_Definitions_SHA2_384); + KRML_CHECK_SIZE(sizeof (uint8_t), entropy_input_len); + uint8_t *entropy_input = (uint8_t *)alloca(entropy_input_len * sizeof (uint8_t)); + memset(entropy_input, 0U, entropy_input_len * sizeof (uint8_t)); + bool ok = Lib_RandomBuffer_System_randombytes(entropy_input, entropy_input_len); bool result; if (!ok) { @@ -1419,58 +1395,58 @@ generate_sha2_384( else { EverCrypt_DRBG_state_s st_s = *st; - KRML_CHECK_SIZE(sizeof (uint8_t), entropy_input_len1 + additional_input_len); + KRML_CHECK_SIZE(sizeof (uint8_t), entropy_input_len + additional_input_len); uint8_t *seed_material = - (uint8_t *)alloca((entropy_input_len1 + additional_input_len) * sizeof (uint8_t)); - memset(seed_material, 0U, (entropy_input_len1 + additional_input_len) * sizeof (uint8_t)); - memcpy(seed_material, entropy_input, entropy_input_len1 * sizeof (uint8_t)); - memcpy(seed_material + entropy_input_len1, + (uint8_t *)alloca((entropy_input_len + additional_input_len) * sizeof (uint8_t)); + memset(seed_material, 0U, (entropy_input_len + additional_input_len) * sizeof (uint8_t)); + memcpy(seed_material, entropy_input, entropy_input_len * sizeof (uint8_t)); + memcpy(seed_material + entropy_input_len, additional_input, additional_input_len * sizeof (uint8_t)); - Hacl_HMAC_DRBG_state uu____0; + Hacl_HMAC_DRBG_state scrut; if (st_s.tag == SHA2_384_s) { - uu____0 = st_s.case_SHA2_384_s; + scrut = st_s.case_SHA2_384_s; } else { - uu____0 = + scrut = KRML_EABORT(Hacl_HMAC_DRBG_state, "unreachable (pattern matches are exhaustive in F*)"); } - uint8_t *k = uu____0.k; - uint8_t *v = uu____0.v; - uint32_t *ctr = uu____0.reseed_counter; - uint32_t input_len = (uint32_t)49U + entropy_input_len1 + additional_input_len; + uint8_t *k = scrut.k; + uint8_t *v = scrut.v; + uint32_t *ctr = scrut.reseed_counter; + uint32_t input_len = (uint32_t)49U + entropy_input_len + additional_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len); uint8_t *input0 = (uint8_t *)alloca(input_len * sizeof (uint8_t)); memset(input0, 0U, input_len * sizeof (uint8_t)); uint8_t *k_ = input0; memcpy(k_, v, (uint32_t)48U * sizeof (uint8_t)); - if (entropy_input_len1 + additional_input_len != (uint32_t)0U) + if (entropy_input_len + additional_input_len != (uint32_t)0U) { memcpy(input0 + (uint32_t)49U, seed_material, - (entropy_input_len1 + additional_input_len) * sizeof (uint8_t)); + (entropy_input_len + additional_input_len) * sizeof (uint8_t)); } input0[48U] = (uint8_t)0U; EverCrypt_HMAC_compute_sha2_384(k_, k, (uint32_t)48U, input0, input_len); EverCrypt_HMAC_compute_sha2_384(v, k_, (uint32_t)48U, v, (uint32_t)48U); memcpy(k, k_, (uint32_t)48U * sizeof (uint8_t)); - if (entropy_input_len1 + additional_input_len != (uint32_t)0U) + if (entropy_input_len + additional_input_len != (uint32_t)0U) { - uint32_t input_len0 = (uint32_t)49U + entropy_input_len1 + additional_input_len; + uint32_t input_len0 = (uint32_t)49U + entropy_input_len + additional_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len0); uint8_t *input = (uint8_t *)alloca(input_len0 * sizeof (uint8_t)); memset(input, 0U, input_len0 * sizeof (uint8_t)); uint8_t *k_0 = input; memcpy(k_0, v, (uint32_t)48U * sizeof (uint8_t)); - if (entropy_input_len1 + additional_input_len != (uint32_t)0U) + if (entropy_input_len + additional_input_len != (uint32_t)0U) { memcpy(input + (uint32_t)49U, seed_material, - (entropy_input_len1 + additional_input_len) * sizeof (uint8_t)); + (entropy_input_len + additional_input_len) * sizeof (uint8_t)); } input[48U] = (uint8_t)1U; EverCrypt_HMAC_compute_sha2_384(k_0, k, (uint32_t)48U, input, input_len0); @@ -1496,75 +1472,24 @@ generate_sha2_384( { x1 = KRML_EABORT(Hacl_HMAC_DRBG_state, "unreachable (pattern matches are exhaustive in F*)"); } - bool b; if (x1.reseed_counter[0U] > Hacl_HMAC_DRBG_reseed_interval) { - b = false; + return false; + } + Hacl_HMAC_DRBG_state scrut; + if (st_s.tag == SHA2_384_s) + { + scrut = st_s.case_SHA2_384_s; } else { - Hacl_HMAC_DRBG_state scrut; - if (st_s.tag == SHA2_384_s) - { - scrut = st_s.case_SHA2_384_s; - } - else - { - scrut = - KRML_EABORT(Hacl_HMAC_DRBG_state, - "unreachable (pattern matches are exhaustive in F*)"); - } - uint8_t *k = scrut.k; - uint8_t *v = scrut.v; - uint32_t *ctr = scrut.reseed_counter; - if (additional_input_len > (uint32_t)0U) - { - uint32_t input_len = (uint32_t)49U + additional_input_len; - KRML_CHECK_SIZE(sizeof (uint8_t), input_len); - uint8_t *input0 = (uint8_t *)alloca(input_len * sizeof (uint8_t)); - memset(input0, 0U, input_len * sizeof (uint8_t)); - uint8_t *k_ = input0; - memcpy(k_, v, (uint32_t)48U * sizeof (uint8_t)); - if (additional_input_len != (uint32_t)0U) - { - memcpy(input0 + (uint32_t)49U, additional_input, additional_input_len * sizeof (uint8_t)); - } - input0[48U] = (uint8_t)0U; - EverCrypt_HMAC_compute_sha2_384(k_, k, (uint32_t)48U, input0, input_len); - EverCrypt_HMAC_compute_sha2_384(v, k_, (uint32_t)48U, v, (uint32_t)48U); - memcpy(k, k_, (uint32_t)48U * sizeof (uint8_t)); - if (additional_input_len != (uint32_t)0U) - { - uint32_t input_len0 = (uint32_t)49U + additional_input_len; - KRML_CHECK_SIZE(sizeof (uint8_t), input_len0); - uint8_t *input = (uint8_t *)alloca(input_len0 * sizeof (uint8_t)); - memset(input, 0U, input_len0 * sizeof (uint8_t)); - uint8_t *k_0 = input; - memcpy(k_0, v, (uint32_t)48U * sizeof (uint8_t)); - if (additional_input_len != (uint32_t)0U) - { - memcpy(input + (uint32_t)49U, additional_input, additional_input_len * sizeof (uint8_t)); - } - input[48U] = (uint8_t)1U; - EverCrypt_HMAC_compute_sha2_384(k_0, k, (uint32_t)48U, input, input_len0); - EverCrypt_HMAC_compute_sha2_384(v, k_0, (uint32_t)48U, v, (uint32_t)48U); - memcpy(k, k_0, (uint32_t)48U * sizeof (uint8_t)); - } - } - uint8_t *output1 = output; - uint32_t max = n / (uint32_t)48U; - uint8_t *out = output1; - for (uint32_t i = (uint32_t)0U; i < max; i++) - { - EverCrypt_HMAC_compute_sha2_384(v, k, (uint32_t)48U, v, (uint32_t)48U); - memcpy(out + i * (uint32_t)48U, v, (uint32_t)48U * sizeof (uint8_t)); - } - if (max * (uint32_t)48U < n) - { - uint8_t *block = output1 + max * (uint32_t)48U; - EverCrypt_HMAC_compute_sha2_384(v, k, (uint32_t)48U, v, (uint32_t)48U); - memcpy(block, v, (n - max * (uint32_t)48U) * sizeof (uint8_t)); - } + scrut = KRML_EABORT(Hacl_HMAC_DRBG_state, "unreachable (pattern matches are exhaustive in F*)"); + } + uint8_t *k = scrut.k; + uint8_t *v = scrut.v; + uint32_t *ctr = scrut.reseed_counter; + if (additional_input_len > (uint32_t)0U) + { uint32_t input_len = (uint32_t)49U + additional_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len); uint8_t *input0 = (uint8_t *)alloca(input_len * sizeof (uint8_t)); @@ -1596,10 +1521,54 @@ generate_sha2_384( EverCrypt_HMAC_compute_sha2_384(v, k_0, (uint32_t)48U, v, (uint32_t)48U); memcpy(k, k_0, (uint32_t)48U * sizeof (uint8_t)); } - uint32_t old_ctr = ctr[0U]; - ctr[0U] = old_ctr + (uint32_t)1U; - b = true; } + uint8_t *output1 = output; + uint32_t max = n / (uint32_t)48U; + uint8_t *out = output1; + for (uint32_t i = (uint32_t)0U; i < max; i++) + { + EverCrypt_HMAC_compute_sha2_384(v, k, (uint32_t)48U, v, (uint32_t)48U); + memcpy(out + i * (uint32_t)48U, v, (uint32_t)48U * sizeof (uint8_t)); + } + if (max * (uint32_t)48U < n) + { + uint8_t *block = output1 + max * (uint32_t)48U; + EverCrypt_HMAC_compute_sha2_384(v, k, (uint32_t)48U, v, (uint32_t)48U); + memcpy(block, v, (n - max * (uint32_t)48U) * sizeof (uint8_t)); + } + uint32_t input_len = (uint32_t)49U + additional_input_len; + KRML_CHECK_SIZE(sizeof (uint8_t), input_len); + uint8_t *input0 = (uint8_t *)alloca(input_len * sizeof (uint8_t)); + memset(input0, 0U, input_len * sizeof (uint8_t)); + uint8_t *k_ = input0; + memcpy(k_, v, (uint32_t)48U * sizeof (uint8_t)); + if (additional_input_len != (uint32_t)0U) + { + memcpy(input0 + (uint32_t)49U, additional_input, additional_input_len * sizeof (uint8_t)); + } + input0[48U] = (uint8_t)0U; + EverCrypt_HMAC_compute_sha2_384(k_, k, (uint32_t)48U, input0, input_len); + EverCrypt_HMAC_compute_sha2_384(v, k_, (uint32_t)48U, v, (uint32_t)48U); + memcpy(k, k_, (uint32_t)48U * sizeof (uint8_t)); + if (additional_input_len != (uint32_t)0U) + { + uint32_t input_len0 = (uint32_t)49U + additional_input_len; + KRML_CHECK_SIZE(sizeof (uint8_t), input_len0); + uint8_t *input = (uint8_t *)alloca(input_len0 * sizeof (uint8_t)); + memset(input, 0U, input_len0 * sizeof (uint8_t)); + uint8_t *k_0 = input; + memcpy(k_0, v, (uint32_t)48U * sizeof (uint8_t)); + if (additional_input_len != (uint32_t)0U) + { + memcpy(input + (uint32_t)49U, additional_input, additional_input_len * sizeof (uint8_t)); + } + input[48U] = (uint8_t)1U; + EverCrypt_HMAC_compute_sha2_384(k_0, k, (uint32_t)48U, input, input_len0); + EverCrypt_HMAC_compute_sha2_384(v, k_0, (uint32_t)48U, v, (uint32_t)48U); + memcpy(k, k_0, (uint32_t)48U * sizeof (uint8_t)); + } + uint32_t old_ctr = ctr[0U]; + ctr[0U] = old_ctr + (uint32_t)1U; return true; } @@ -1621,7 +1590,6 @@ generate_sha2_512( { return false; } - uint32_t entropy_input_len = Hacl_HMAC_DRBG_min_length(Spec_Hash_Definitions_SHA2_512); bool ok0; if (additional_input_len > Hacl_HMAC_DRBG_max_additional_input_length) { @@ -1629,11 +1597,11 @@ generate_sha2_512( } else { - uint32_t entropy_input_len1 = Hacl_HMAC_DRBG_min_length(Spec_Hash_Definitions_SHA2_512); - KRML_CHECK_SIZE(sizeof (uint8_t), entropy_input_len1); - uint8_t *entropy_input = (uint8_t *)alloca(entropy_input_len1 * sizeof (uint8_t)); - memset(entropy_input, 0U, entropy_input_len1 * sizeof (uint8_t)); - bool ok = Lib_RandomBuffer_System_randombytes(entropy_input, entropy_input_len1); + uint32_t entropy_input_len = Hacl_HMAC_DRBG_min_length(Spec_Hash_Definitions_SHA2_512); + KRML_CHECK_SIZE(sizeof (uint8_t), entropy_input_len); + uint8_t *entropy_input = (uint8_t *)alloca(entropy_input_len * sizeof (uint8_t)); + memset(entropy_input, 0U, entropy_input_len * sizeof (uint8_t)); + bool ok = Lib_RandomBuffer_System_randombytes(entropy_input, entropy_input_len); bool result; if (!ok) { @@ -1642,58 +1610,58 @@ generate_sha2_512( else { EverCrypt_DRBG_state_s st_s = *st; - KRML_CHECK_SIZE(sizeof (uint8_t), entropy_input_len1 + additional_input_len); + KRML_CHECK_SIZE(sizeof (uint8_t), entropy_input_len + additional_input_len); uint8_t *seed_material = - (uint8_t *)alloca((entropy_input_len1 + additional_input_len) * sizeof (uint8_t)); - memset(seed_material, 0U, (entropy_input_len1 + additional_input_len) * sizeof (uint8_t)); - memcpy(seed_material, entropy_input, entropy_input_len1 * sizeof (uint8_t)); - memcpy(seed_material + entropy_input_len1, + (uint8_t *)alloca((entropy_input_len + additional_input_len) * sizeof (uint8_t)); + memset(seed_material, 0U, (entropy_input_len + additional_input_len) * sizeof (uint8_t)); + memcpy(seed_material, entropy_input, entropy_input_len * sizeof (uint8_t)); + memcpy(seed_material + entropy_input_len, additional_input, additional_input_len * sizeof (uint8_t)); - Hacl_HMAC_DRBG_state uu____0; + Hacl_HMAC_DRBG_state scrut; if (st_s.tag == SHA2_512_s) { - uu____0 = st_s.case_SHA2_512_s; + scrut = st_s.case_SHA2_512_s; } else { - uu____0 = + scrut = KRML_EABORT(Hacl_HMAC_DRBG_state, "unreachable (pattern matches are exhaustive in F*)"); } - uint8_t *k = uu____0.k; - uint8_t *v = uu____0.v; - uint32_t *ctr = uu____0.reseed_counter; - uint32_t input_len = (uint32_t)65U + entropy_input_len1 + additional_input_len; + uint8_t *k = scrut.k; + uint8_t *v = scrut.v; + uint32_t *ctr = scrut.reseed_counter; + uint32_t input_len = (uint32_t)65U + entropy_input_len + additional_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len); uint8_t *input0 = (uint8_t *)alloca(input_len * sizeof (uint8_t)); memset(input0, 0U, input_len * sizeof (uint8_t)); uint8_t *k_ = input0; memcpy(k_, v, (uint32_t)64U * sizeof (uint8_t)); - if (entropy_input_len1 + additional_input_len != (uint32_t)0U) + if (entropy_input_len + additional_input_len != (uint32_t)0U) { memcpy(input0 + (uint32_t)65U, seed_material, - (entropy_input_len1 + additional_input_len) * sizeof (uint8_t)); + (entropy_input_len + additional_input_len) * sizeof (uint8_t)); } input0[64U] = (uint8_t)0U; EverCrypt_HMAC_compute_sha2_512(k_, k, (uint32_t)64U, input0, input_len); EverCrypt_HMAC_compute_sha2_512(v, k_, (uint32_t)64U, v, (uint32_t)64U); memcpy(k, k_, (uint32_t)64U * sizeof (uint8_t)); - if (entropy_input_len1 + additional_input_len != (uint32_t)0U) + if (entropy_input_len + additional_input_len != (uint32_t)0U) { - uint32_t input_len0 = (uint32_t)65U + entropy_input_len1 + additional_input_len; + uint32_t input_len0 = (uint32_t)65U + entropy_input_len + additional_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len0); uint8_t *input = (uint8_t *)alloca(input_len0 * sizeof (uint8_t)); memset(input, 0U, input_len0 * sizeof (uint8_t)); uint8_t *k_0 = input; memcpy(k_0, v, (uint32_t)64U * sizeof (uint8_t)); - if (entropy_input_len1 + additional_input_len != (uint32_t)0U) + if (entropy_input_len + additional_input_len != (uint32_t)0U) { memcpy(input + (uint32_t)65U, seed_material, - (entropy_input_len1 + additional_input_len) * sizeof (uint8_t)); + (entropy_input_len + additional_input_len) * sizeof (uint8_t)); } input[64U] = (uint8_t)1U; EverCrypt_HMAC_compute_sha2_512(k_0, k, (uint32_t)64U, input, input_len0); @@ -1719,75 +1687,24 @@ generate_sha2_512( { x1 = KRML_EABORT(Hacl_HMAC_DRBG_state, "unreachable (pattern matches are exhaustive in F*)"); } - bool b; if (x1.reseed_counter[0U] > Hacl_HMAC_DRBG_reseed_interval) { - b = false; + return false; + } + Hacl_HMAC_DRBG_state scrut; + if (st_s.tag == SHA2_512_s) + { + scrut = st_s.case_SHA2_512_s; } else { - Hacl_HMAC_DRBG_state scrut; - if (st_s.tag == SHA2_512_s) - { - scrut = st_s.case_SHA2_512_s; - } - else - { - scrut = - KRML_EABORT(Hacl_HMAC_DRBG_state, - "unreachable (pattern matches are exhaustive in F*)"); - } - uint8_t *k = scrut.k; - uint8_t *v = scrut.v; - uint32_t *ctr = scrut.reseed_counter; - if (additional_input_len > (uint32_t)0U) - { - uint32_t input_len = (uint32_t)65U + additional_input_len; - KRML_CHECK_SIZE(sizeof (uint8_t), input_len); - uint8_t *input0 = (uint8_t *)alloca(input_len * sizeof (uint8_t)); - memset(input0, 0U, input_len * sizeof (uint8_t)); - uint8_t *k_ = input0; - memcpy(k_, v, (uint32_t)64U * sizeof (uint8_t)); - if (additional_input_len != (uint32_t)0U) - { - memcpy(input0 + (uint32_t)65U, additional_input, additional_input_len * sizeof (uint8_t)); - } - input0[64U] = (uint8_t)0U; - EverCrypt_HMAC_compute_sha2_512(k_, k, (uint32_t)64U, input0, input_len); - EverCrypt_HMAC_compute_sha2_512(v, k_, (uint32_t)64U, v, (uint32_t)64U); - memcpy(k, k_, (uint32_t)64U * sizeof (uint8_t)); - if (additional_input_len != (uint32_t)0U) - { - uint32_t input_len0 = (uint32_t)65U + additional_input_len; - KRML_CHECK_SIZE(sizeof (uint8_t), input_len0); - uint8_t *input = (uint8_t *)alloca(input_len0 * sizeof (uint8_t)); - memset(input, 0U, input_len0 * sizeof (uint8_t)); - uint8_t *k_0 = input; - memcpy(k_0, v, (uint32_t)64U * sizeof (uint8_t)); - if (additional_input_len != (uint32_t)0U) - { - memcpy(input + (uint32_t)65U, additional_input, additional_input_len * sizeof (uint8_t)); - } - input[64U] = (uint8_t)1U; - EverCrypt_HMAC_compute_sha2_512(k_0, k, (uint32_t)64U, input, input_len0); - EverCrypt_HMAC_compute_sha2_512(v, k_0, (uint32_t)64U, v, (uint32_t)64U); - memcpy(k, k_0, (uint32_t)64U * sizeof (uint8_t)); - } - } - uint8_t *output1 = output; - uint32_t max = n / (uint32_t)64U; - uint8_t *out = output1; - for (uint32_t i = (uint32_t)0U; i < max; i++) - { - EverCrypt_HMAC_compute_sha2_512(v, k, (uint32_t)64U, v, (uint32_t)64U); - memcpy(out + i * (uint32_t)64U, v, (uint32_t)64U * sizeof (uint8_t)); - } - if (max * (uint32_t)64U < n) - { - uint8_t *block = output1 + max * (uint32_t)64U; - EverCrypt_HMAC_compute_sha2_512(v, k, (uint32_t)64U, v, (uint32_t)64U); - memcpy(block, v, (n - max * (uint32_t)64U) * sizeof (uint8_t)); - } + scrut = KRML_EABORT(Hacl_HMAC_DRBG_state, "unreachable (pattern matches are exhaustive in F*)"); + } + uint8_t *k = scrut.k; + uint8_t *v = scrut.v; + uint32_t *ctr = scrut.reseed_counter; + if (additional_input_len > (uint32_t)0U) + { uint32_t input_len = (uint32_t)65U + additional_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len); uint8_t *input0 = (uint8_t *)alloca(input_len * sizeof (uint8_t)); @@ -1819,10 +1736,54 @@ generate_sha2_512( EverCrypt_HMAC_compute_sha2_512(v, k_0, (uint32_t)64U, v, (uint32_t)64U); memcpy(k, k_0, (uint32_t)64U * sizeof (uint8_t)); } - uint32_t old_ctr = ctr[0U]; - ctr[0U] = old_ctr + (uint32_t)1U; - b = true; } + uint8_t *output1 = output; + uint32_t max = n / (uint32_t)64U; + uint8_t *out = output1; + for (uint32_t i = (uint32_t)0U; i < max; i++) + { + EverCrypt_HMAC_compute_sha2_512(v, k, (uint32_t)64U, v, (uint32_t)64U); + memcpy(out + i * (uint32_t)64U, v, (uint32_t)64U * sizeof (uint8_t)); + } + if (max * (uint32_t)64U < n) + { + uint8_t *block = output1 + max * (uint32_t)64U; + EverCrypt_HMAC_compute_sha2_512(v, k, (uint32_t)64U, v, (uint32_t)64U); + memcpy(block, v, (n - max * (uint32_t)64U) * sizeof (uint8_t)); + } + uint32_t input_len = (uint32_t)65U + additional_input_len; + KRML_CHECK_SIZE(sizeof (uint8_t), input_len); + uint8_t *input0 = (uint8_t *)alloca(input_len * sizeof (uint8_t)); + memset(input0, 0U, input_len * sizeof (uint8_t)); + uint8_t *k_ = input0; + memcpy(k_, v, (uint32_t)64U * sizeof (uint8_t)); + if (additional_input_len != (uint32_t)0U) + { + memcpy(input0 + (uint32_t)65U, additional_input, additional_input_len * sizeof (uint8_t)); + } + input0[64U] = (uint8_t)0U; + EverCrypt_HMAC_compute_sha2_512(k_, k, (uint32_t)64U, input0, input_len); + EverCrypt_HMAC_compute_sha2_512(v, k_, (uint32_t)64U, v, (uint32_t)64U); + memcpy(k, k_, (uint32_t)64U * sizeof (uint8_t)); + if (additional_input_len != (uint32_t)0U) + { + uint32_t input_len0 = (uint32_t)65U + additional_input_len; + KRML_CHECK_SIZE(sizeof (uint8_t), input_len0); + uint8_t *input = (uint8_t *)alloca(input_len0 * sizeof (uint8_t)); + memset(input, 0U, input_len0 * sizeof (uint8_t)); + uint8_t *k_0 = input; + memcpy(k_0, v, (uint32_t)64U * sizeof (uint8_t)); + if (additional_input_len != (uint32_t)0U) + { + memcpy(input + (uint32_t)65U, additional_input, additional_input_len * sizeof (uint8_t)); + } + input[64U] = (uint8_t)1U; + EverCrypt_HMAC_compute_sha2_512(k_0, k, (uint32_t)64U, input, input_len0); + EverCrypt_HMAC_compute_sha2_512(v, k_0, (uint32_t)64U, v, (uint32_t)64U); + memcpy(k, k_0, (uint32_t)64U * sizeof (uint8_t)); + } + uint32_t old_ctr = ctr[0U]; + ctr[0U] = old_ctr + (uint32_t)1U; return true; } @@ -1841,8 +1802,8 @@ static void uninstantiate_sha1(EverCrypt_DRBG_state_s *st) uint8_t *k = s.k; uint8_t *v = s.v; uint32_t *ctr = s.reseed_counter; - Lib_Memzero0_memzero(k, (uint32_t)20U * sizeof (k[0U])); - Lib_Memzero0_memzero(v, (uint32_t)20U * sizeof (v[0U])); + Lib_Memzero0_memzero(k, (uint32_t)20U, uint8_t); + Lib_Memzero0_memzero(v, (uint32_t)20U, uint8_t); ctr[0U] = (uint32_t)0U; KRML_HOST_FREE(k); KRML_HOST_FREE(v); @@ -1865,8 +1826,8 @@ static void uninstantiate_sha2_256(EverCrypt_DRBG_state_s *st) uint8_t *k = s.k; uint8_t *v = s.v; uint32_t *ctr = s.reseed_counter; - Lib_Memzero0_memzero(k, (uint32_t)32U * sizeof (k[0U])); - Lib_Memzero0_memzero(v, (uint32_t)32U * sizeof (v[0U])); + Lib_Memzero0_memzero(k, (uint32_t)32U, uint8_t); + Lib_Memzero0_memzero(v, (uint32_t)32U, uint8_t); ctr[0U] = (uint32_t)0U; KRML_HOST_FREE(k); KRML_HOST_FREE(v); @@ -1889,8 +1850,8 @@ static void uninstantiate_sha2_384(EverCrypt_DRBG_state_s *st) uint8_t *k = s.k; uint8_t *v = s.v; uint32_t *ctr = s.reseed_counter; - Lib_Memzero0_memzero(k, (uint32_t)48U * sizeof (k[0U])); - Lib_Memzero0_memzero(v, (uint32_t)48U * sizeof (v[0U])); + Lib_Memzero0_memzero(k, (uint32_t)48U, uint8_t); + Lib_Memzero0_memzero(v, (uint32_t)48U, uint8_t); ctr[0U] = (uint32_t)0U; KRML_HOST_FREE(k); KRML_HOST_FREE(v); @@ -1913,8 +1874,8 @@ static void uninstantiate_sha2_512(EverCrypt_DRBG_state_s *st) uint8_t *k = s.k; uint8_t *v = s.v; uint32_t *ctr = s.reseed_counter; - Lib_Memzero0_memzero(k, (uint32_t)64U * sizeof (k[0U])); - Lib_Memzero0_memzero(v, (uint32_t)64U * sizeof (v[0U])); + Lib_Memzero0_memzero(k, (uint32_t)64U, uint8_t); + Lib_Memzero0_memzero(v, (uint32_t)64U, uint8_t); ctr[0U] = (uint32_t)0U; KRML_HOST_FREE(k); KRML_HOST_FREE(v); diff --git a/src/msvc/EverCrypt_HMAC.c b/src/msvc/EverCrypt_HMAC.c index 5691b343..f279dfb8 100644 --- a/src/msvc/EverCrypt_HMAC.c +++ b/src/msvc/EverCrypt_HMAC.c @@ -83,16 +83,18 @@ EverCrypt_HMAC_compute_sha1( KRML_CHECK_SIZE(sizeof (uint8_t), l); uint8_t *key_block = (uint8_t *)alloca(l * sizeof (uint8_t)); memset(key_block, 0U, l * sizeof (uint8_t)); - uint32_t i0; + uint8_t *nkey = key_block; + uint32_t ite; if (key_len <= (uint32_t)64U) { - i0 = key_len; + ite = key_len; } else { - i0 = (uint32_t)20U; + ite = (uint32_t)20U; } - uint8_t *nkey = key_block; + uint8_t *zeroes = key_block + ite; + KRML_HOST_IGNORE(zeroes); if (key_len <= (uint32_t)64U) { memcpy(nkey, key, key_len * sizeof (uint8_t)); @@ -201,16 +203,18 @@ EverCrypt_HMAC_compute_sha2_256( KRML_CHECK_SIZE(sizeof (uint8_t), l); uint8_t *key_block = (uint8_t *)alloca(l * sizeof (uint8_t)); memset(key_block, 0U, l * sizeof (uint8_t)); - uint32_t i0; + uint8_t *nkey = key_block; + uint32_t ite; if (key_len <= (uint32_t)64U) { - i0 = key_len; + ite = key_len; } else { - i0 = (uint32_t)32U; + ite = (uint32_t)32U; } - uint8_t *nkey = key_block; + uint8_t *zeroes = key_block + ite; + KRML_HOST_IGNORE(zeroes); if (key_len <= (uint32_t)64U) { memcpy(nkey, key, key_len * sizeof (uint8_t)); @@ -329,16 +333,18 @@ EverCrypt_HMAC_compute_sha2_384( KRML_CHECK_SIZE(sizeof (uint8_t), l); uint8_t *key_block = (uint8_t *)alloca(l * sizeof (uint8_t)); memset(key_block, 0U, l * sizeof (uint8_t)); - uint32_t i0; + uint8_t *nkey = key_block; + uint32_t ite; if (key_len <= (uint32_t)128U) { - i0 = key_len; + ite = key_len; } else { - i0 = (uint32_t)48U; + ite = (uint32_t)48U; } - uint8_t *nkey = key_block; + uint8_t *zeroes = key_block + ite; + KRML_HOST_IGNORE(zeroes); if (key_len <= (uint32_t)128U) { memcpy(nkey, key, key_len * sizeof (uint8_t)); @@ -458,16 +464,18 @@ EverCrypt_HMAC_compute_sha2_512( KRML_CHECK_SIZE(sizeof (uint8_t), l); uint8_t *key_block = (uint8_t *)alloca(l * sizeof (uint8_t)); memset(key_block, 0U, l * sizeof (uint8_t)); - uint32_t i0; + uint8_t *nkey = key_block; + uint32_t ite; if (key_len <= (uint32_t)128U) { - i0 = key_len; + ite = key_len; } else { - i0 = (uint32_t)64U; + ite = (uint32_t)64U; } - uint8_t *nkey = key_block; + uint8_t *zeroes = key_block + ite; + KRML_HOST_IGNORE(zeroes); if (key_len <= (uint32_t)128U) { memcpy(nkey, key, key_len * sizeof (uint8_t)); @@ -587,16 +595,18 @@ EverCrypt_HMAC_compute_blake2s( KRML_CHECK_SIZE(sizeof (uint8_t), l); uint8_t *key_block = (uint8_t *)alloca(l * sizeof (uint8_t)); memset(key_block, 0U, l * sizeof (uint8_t)); - uint32_t i0; + uint8_t *nkey = key_block; + uint32_t ite; if (key_len <= (uint32_t)64U) { - i0 = key_len; + ite = key_len; } else { - i0 = (uint32_t)32U; + ite = (uint32_t)32U; } - uint8_t *nkey = key_block; + uint8_t *zeroes = key_block + ite; + KRML_HOST_IGNORE(zeroes); if (key_len <= (uint32_t)64U) { memcpy(nkey, key, key_len * sizeof (uint8_t)); @@ -723,16 +733,18 @@ EverCrypt_HMAC_compute_blake2b( KRML_CHECK_SIZE(sizeof (uint8_t), l); uint8_t *key_block = (uint8_t *)alloca(l * sizeof (uint8_t)); memset(key_block, 0U, l * sizeof (uint8_t)); - uint32_t i0; + uint8_t *nkey = key_block; + uint32_t ite; if (key_len <= (uint32_t)128U) { - i0 = key_len; + ite = key_len; } else { - i0 = (uint32_t)64U; + ite = (uint32_t)64U; } - uint8_t *nkey = key_block; + uint8_t *zeroes = key_block + ite; + KRML_HOST_IGNORE(zeroes); if (key_len <= (uint32_t)128U) { memcpy(nkey, key, key_len * sizeof (uint8_t)); diff --git a/src/msvc/EverCrypt_Hash.c b/src/msvc/EverCrypt_Hash.c index b1004449..914a105f 100644 --- a/src/msvc/EverCrypt_Hash.c +++ b/src/msvc/EverCrypt_Hash.c @@ -206,8 +206,8 @@ static EverCrypt_Hash_state_s *create_in(Spec_Hash_Definitions_hash_alg a) } case Spec_Hash_Definitions_Blake2S: { - bool vec128 = EverCrypt_AutoConfig2_has_vec128(); #if HACL_CAN_COMPILE_VEC128 + bool vec128 = EverCrypt_AutoConfig2_has_vec128(); if (vec128) { s = @@ -231,8 +231,8 @@ static EverCrypt_Hash_state_s *create_in(Spec_Hash_Definitions_hash_alg a) } case Spec_Hash_Definitions_Blake2B: { - bool vec256 = EverCrypt_AutoConfig2_has_vec256(); #if HACL_CAN_COMPILE_VEC256 + bool vec256 = EverCrypt_AutoConfig2_has_vec256(); if (vec256) { s = @@ -342,6 +342,7 @@ static void init(EverCrypt_Hash_state_s *s) Hacl_Blake2s_128_blake2s_init(p1, (uint32_t)0U, (uint32_t)32U); return; #else + KRML_HOST_IGNORE(p1); return; #endif } @@ -358,6 +359,7 @@ static void init(EverCrypt_Hash_state_s *s) Hacl_Blake2b_256_blake2b_init(p1, (uint32_t)0U, (uint32_t)64U); return; #else + KRML_HOST_IGNORE(p1); return; #endif } @@ -391,17 +393,20 @@ k224_256[64U] = void EverCrypt_Hash_update_multi_256(uint32_t *s, uint8_t *blocks, uint32_t n) { + #if HACL_CAN_COMPILE_VALE bool has_shaext = EverCrypt_AutoConfig2_has_shaext(); bool has_sse = EverCrypt_AutoConfig2_has_sse(); - #if HACL_CAN_COMPILE_VALE if (has_shaext && has_sse) { uint64_t n1 = (uint64_t)n; uint64_t scrut = sha256_update(s, blocks, n1, k224_256); return; } - #endif Hacl_SHA2_Scalar32_sha256_update_nblocks(n * (uint32_t)64U, blocks, s); + #else + KRML_HOST_IGNORE(k224_256); + Hacl_SHA2_Scalar32_sha256_update_nblocks(n * (uint32_t)64U, blocks, s); + #endif } static void @@ -495,6 +500,7 @@ update_multi(EverCrypt_Hash_state_s *s, uint64_t prevlen, uint8_t *blocks, uint3 Hacl_Blake2s_128_blake2s_update_multi(n * (uint32_t)64U, wv, p1, prevlen, blocks, n); return; #else + KRML_HOST_IGNORE(p1); return; #endif } @@ -525,6 +531,7 @@ update_multi(EverCrypt_Hash_state_s *s, uint64_t prevlen, uint8_t *blocks, uint3 n); return; #else + KRML_HOST_IGNORE(p1); return; #endif } @@ -622,6 +629,7 @@ update_last(EverCrypt_Hash_state_s *s, uint64_t prev_len, uint8_t *last, uint32_ Hacl_Blake2s_128_blake2s_update_last(last_len, wv, p1, prev_len, last_len, last); return; #else + KRML_HOST_IGNORE(p1); return; #endif } @@ -650,6 +658,7 @@ update_last(EverCrypt_Hash_state_s *s, uint64_t prev_len, uint8_t *last, uint32_ last); return; #else + KRML_HOST_IGNORE(p1); return; #endif } @@ -736,6 +745,7 @@ static void finish(EverCrypt_Hash_state_s *s, uint8_t *dst) Hacl_Blake2s_128_blake2s_finish((uint32_t)32U, dst, p1); return; #else + KRML_HOST_IGNORE(p1); return; #endif } @@ -752,6 +762,7 @@ static void finish(EverCrypt_Hash_state_s *s, uint8_t *dst) Hacl_Blake2b_256_blake2b_finish((uint32_t)64U, dst, p1); return; #else + KRML_HOST_IGNORE(p1); return; #endif } @@ -1026,6 +1037,7 @@ static void copy(EverCrypt_Hash_state_s *s_src, EverCrypt_Hash_state_s *s_dst) Hacl_Blake2s_128_load_state128s_from_state32(p_dst, p_src); return; #else + KRML_HOST_IGNORE(p_dst); return; #endif } @@ -1052,6 +1064,7 @@ static void copy(EverCrypt_Hash_state_s *s_src, EverCrypt_Hash_state_s *s_dst) Hacl_Blake2b_256_load_state256b_from_state32(p_dst, p_src); return; #else + KRML_HOST_IGNORE(p_dst); return; #endif } @@ -1078,6 +1091,7 @@ static void copy(EverCrypt_Hash_state_s *s_src, EverCrypt_Hash_state_s *s_dst) Hacl_Blake2s_128_store_state128s_to_state32(p_dst, p_src); return; #else + KRML_HOST_IGNORE(p_dst); return; #endif } @@ -1104,6 +1118,7 @@ static void copy(EverCrypt_Hash_state_s *s_src, EverCrypt_Hash_state_s *s_dst) Hacl_Blake2b_256_store_state256b_to_state32(p_dst, p_src); return; #else + KRML_HOST_IGNORE(p_dst); return; #endif } @@ -1281,6 +1296,7 @@ void EverCrypt_Hash_Incremental_init(EverCrypt_Hash_Incremental_hash_state *s) uint8_t *buf = scrut.buf; EverCrypt_Hash_state_s *block_state = scrut.block_state; Spec_Hash_Definitions_hash_alg i = alg_of_state(block_state); + KRML_HOST_IGNORE(i); init(block_state); EverCrypt_Hash_Incremental_hash_state tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; @@ -2038,9 +2054,9 @@ static void finish_blake2s(EverCrypt_Hash_Incremental_hash_state *p, uint8_t *ds r = (uint32_t)(total_len % (uint64_t)block_len(Spec_Hash_Definitions_Blake2S)); } uint8_t *buf_1 = buf_; - bool vec128 = EverCrypt_AutoConfig2_has_vec128(); EverCrypt_Hash_state_s s; #if HACL_CAN_COMPILE_VEC128 + bool vec128 = EverCrypt_AutoConfig2_has_vec128(); KRML_PRE_ALIGN(16) Lib_IntVector_Intrinsics_vec128 buf0[4U] KRML_POST_ALIGN(16) = { 0U }; uint32_t buf[16U] = { 0U }; if (vec128) @@ -2097,9 +2113,9 @@ static void finish_blake2b(EverCrypt_Hash_Incremental_hash_state *p, uint8_t *ds r = (uint32_t)(total_len % (uint64_t)block_len(Spec_Hash_Definitions_Blake2B)); } uint8_t *buf_1 = buf_; - bool vec256 = EverCrypt_AutoConfig2_has_vec256(); EverCrypt_Hash_state_s s; #if HACL_CAN_COMPILE_VEC256 + bool vec256 = EverCrypt_AutoConfig2_has_vec256(); KRML_PRE_ALIGN(32) Lib_IntVector_Intrinsics_vec256 buf0[4U] KRML_POST_ALIGN(32) = { 0U }; uint64_t buf[16U] = { 0U }; if (vec256) @@ -2384,28 +2400,32 @@ EverCrypt_Hash_Incremental_hash( } case Spec_Hash_Definitions_Blake2S: { - bool vec128 = EverCrypt_AutoConfig2_has_vec128(); #if HACL_CAN_COMPILE_VEC128 + bool vec128 = EverCrypt_AutoConfig2_has_vec128(); if (vec128) { Hacl_Blake2s_128_blake2s((uint32_t)32U, dst, len, input, (uint32_t)0U, NULL); return; } - #endif Hacl_Blake2s_32_blake2s((uint32_t)32U, dst, len, input, (uint32_t)0U, NULL); + #else + Hacl_Blake2s_32_blake2s((uint32_t)32U, dst, len, input, (uint32_t)0U, NULL); + #endif break; } case Spec_Hash_Definitions_Blake2B: { - bool vec256 = EverCrypt_AutoConfig2_has_vec256(); #if HACL_CAN_COMPILE_VEC256 + bool vec256 = EverCrypt_AutoConfig2_has_vec256(); if (vec256) { Hacl_Blake2b_256_blake2b((uint32_t)64U, dst, len, input, (uint32_t)0U, NULL); return; } - #endif Hacl_Blake2b_32_blake2b((uint32_t)64U, dst, len, input, (uint32_t)0U, NULL); + #else + Hacl_Blake2b_32_blake2b((uint32_t)64U, dst, len, input, (uint32_t)0U, NULL); + #endif break; } default: diff --git a/src/msvc/EverCrypt_Poly1305.c b/src/msvc/EverCrypt_Poly1305.c index f05f8e85..717b9527 100644 --- a/src/msvc/EverCrypt_Poly1305.c +++ b/src/msvc/EverCrypt_Poly1305.c @@ -39,6 +39,7 @@ static void poly1305_vale(uint8_t *dst, uint8_t *src, uint32_t len, uint8_t *key if (n_extra == (uint32_t)0U) { uint64_t scrut = x64_poly1305(ctx, src, (uint64_t)len, (uint64_t)1U); + KRML_HOST_IGNORE((void *)(uint8_t)0U); } else { @@ -46,8 +47,10 @@ static void poly1305_vale(uint8_t *dst, uint8_t *src, uint32_t len, uint8_t *key uint8_t *src16 = src; memcpy(tmp, src + len16, n_extra * sizeof (uint8_t)); uint64_t scrut = x64_poly1305(ctx, src16, (uint64_t)len16, (uint64_t)0U); + KRML_HOST_IGNORE((void *)(uint8_t)0U); memcpy(ctx + (uint32_t)24U, key, (uint32_t)32U * sizeof (uint8_t)); uint64_t scrut0 = x64_poly1305(ctx, tmp, (uint64_t)n_extra, (uint64_t)1U); + KRML_HOST_IGNORE((void *)(uint8_t)0U); } memcpy(dst, ctx, (uint32_t)16U * sizeof (uint8_t)); #endif @@ -60,6 +63,7 @@ void EverCrypt_Poly1305_poly1305(uint8_t *dst, uint8_t *src, uint32_t len, uint8 #if HACL_CAN_COMPILE_VEC256 if (vec256) { + KRML_HOST_IGNORE(vec128); Hacl_Poly1305_256_poly1305_mac(dst, len, src, key); return; } @@ -67,13 +71,17 @@ void EverCrypt_Poly1305_poly1305(uint8_t *dst, uint8_t *src, uint32_t len, uint8 #if HACL_CAN_COMPILE_VEC128 if (vec128) { + KRML_HOST_IGNORE(vec256); Hacl_Poly1305_128_poly1305_mac(dst, len, src, key); return; } #endif + KRML_HOST_IGNORE(vec256); + KRML_HOST_IGNORE(vec128); #if HACL_CAN_COMPILE_VALE poly1305_vale(dst, src, len, key); #else + KRML_HOST_IGNORE(poly1305_vale); Hacl_Poly1305_32_poly1305_mac(dst, len, src, key); #endif } diff --git a/src/msvc/Hacl_Bignum.c b/src/msvc/Hacl_Bignum.c index 886d7731..ca093c6d 100644 --- a/src/msvc/Hacl_Bignum.c +++ b/src/msvc/Hacl_Bignum.c @@ -58,6 +58,7 @@ Hacl_Bignum_Karatsuba_bn_karatsuba_mul_uint32( uint32_t x = (((uint32_t)0U - c0) & t0[i]) | (~((uint32_t)0U - c0) & tmp_[i]); os[i] = x; } + KRML_HOST_IGNORE(c10); uint32_t c00 = c0; uint32_t c010 = Hacl_Bignum_Addition_bn_sub_eq_len_u32(len2, b0, b1, tmp_); uint32_t c1 = Hacl_Bignum_Addition_bn_sub_eq_len_u32(len2, b1, b0, t1); @@ -67,6 +68,7 @@ Hacl_Bignum_Karatsuba_bn_karatsuba_mul_uint32( uint32_t x = (((uint32_t)0U - c010) & t1[i]) | (~((uint32_t)0U - c010) & tmp_[i]); os[i] = x; } + KRML_HOST_IGNORE(c1); uint32_t c11 = c010; uint32_t *t23 = tmp + aLen; uint32_t *tmp1 = tmp + aLen + aLen; @@ -150,6 +152,7 @@ Hacl_Bignum_Karatsuba_bn_karatsuba_mul_uint32( uint32_t c8 = r1; uint32_t c = c8; uint32_t c9 = c; + KRML_HOST_IGNORE(c9); } void @@ -182,6 +185,7 @@ Hacl_Bignum_Karatsuba_bn_karatsuba_mul_uint64( uint64_t x = (((uint64_t)0U - c0) & t0[i]) | (~((uint64_t)0U - c0) & tmp_[i]); os[i] = x; } + KRML_HOST_IGNORE(c10); uint64_t c00 = c0; uint64_t c010 = Hacl_Bignum_Addition_bn_sub_eq_len_u64(len2, b0, b1, tmp_); uint64_t c1 = Hacl_Bignum_Addition_bn_sub_eq_len_u64(len2, b1, b0, t1); @@ -191,6 +195,7 @@ Hacl_Bignum_Karatsuba_bn_karatsuba_mul_uint64( uint64_t x = (((uint64_t)0U - c010) & t1[i]) | (~((uint64_t)0U - c010) & tmp_[i]); os[i] = x; } + KRML_HOST_IGNORE(c1); uint64_t c11 = c010; uint64_t *t23 = tmp + aLen; uint64_t *tmp1 = tmp + aLen + aLen; @@ -274,6 +279,7 @@ Hacl_Bignum_Karatsuba_bn_karatsuba_mul_uint64( uint64_t c8 = r1; uint64_t c = c8; uint64_t c9 = c; + KRML_HOST_IGNORE(c9); } void @@ -302,7 +308,9 @@ Hacl_Bignum_Karatsuba_bn_karatsuba_sqr_uint32( uint32_t x = (((uint32_t)0U - c0) & t0[i]) | (~((uint32_t)0U - c0) & tmp_[i]); os[i] = x; } + KRML_HOST_IGNORE(c1); uint32_t c00 = c0; + KRML_HOST_IGNORE(c00); uint32_t *t23 = tmp + aLen; uint32_t *tmp1 = tmp + aLen + aLen; Hacl_Bignum_Karatsuba_bn_karatsuba_sqr_uint32(len2, t0, tmp1, t23); @@ -373,6 +381,7 @@ Hacl_Bignum_Karatsuba_bn_karatsuba_sqr_uint32( uint32_t c8 = r1; uint32_t c = c8; uint32_t c9 = c; + KRML_HOST_IGNORE(c9); } void @@ -401,7 +410,9 @@ Hacl_Bignum_Karatsuba_bn_karatsuba_sqr_uint64( uint64_t x = (((uint64_t)0U - c0) & t0[i]) | (~((uint64_t)0U - c0) & tmp_[i]); os[i] = x; } + KRML_HOST_IGNORE(c1); uint64_t c00 = c0; + KRML_HOST_IGNORE(c00); uint64_t *t23 = tmp + aLen; uint64_t *tmp1 = tmp + aLen + aLen; Hacl_Bignum_Karatsuba_bn_karatsuba_sqr_uint64(len2, t0, tmp1, t23); @@ -472,6 +483,7 @@ Hacl_Bignum_Karatsuba_bn_karatsuba_sqr_uint64( uint64_t c8 = r1; uint64_t c = c8; uint64_t c9 = c; + KRML_HOST_IGNORE(c9); } void @@ -696,6 +708,7 @@ Hacl_Bignum_bn_sub_mod_n_u32( c = Lib_IntTypes_Intrinsics_add_carry_u32(c, t1, t2, res_i); } uint32_t c1 = c; + KRML_HOST_IGNORE(c1); uint32_t c2 = (uint32_t)0U - c00; for (uint32_t i = (uint32_t)0U; i < len1; i++) { @@ -773,6 +786,7 @@ Hacl_Bignum_bn_sub_mod_n_u64( c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t1, t2, res_i); } uint64_t c1 = c; + KRML_HOST_IGNORE(c1); uint64_t c2 = (uint64_t)0U - c00; for (uint32_t i = (uint32_t)0U; i < len1; i++) { @@ -1266,6 +1280,7 @@ bn_almost_mont_reduction_u32( uint32_t *tmp = (uint32_t *)alloca(len * sizeof (uint32_t)); memset(tmp, 0U, len * sizeof (uint32_t)); uint32_t c1 = Hacl_Bignum_Addition_bn_sub_eq_len_u32(len, res, n, tmp); + KRML_HOST_IGNORE(c1); uint32_t m = (uint32_t)0U - c00; for (uint32_t i = (uint32_t)0U; i < len; i++) { @@ -1362,6 +1377,7 @@ bn_almost_mont_reduction_u64( uint64_t *tmp = (uint64_t *)alloca(len * sizeof (uint64_t)); memset(tmp, 0U, len * sizeof (uint64_t)); uint64_t c1 = Hacl_Bignum_Addition_bn_sub_eq_len_u64(len, res, n, tmp); + KRML_HOST_IGNORE(c1); uint64_t m = (uint64_t)0U - c00; for (uint32_t i = (uint32_t)0U; i < len; i++) { diff --git a/src/msvc/Hacl_Bignum256.c b/src/msvc/Hacl_Bignum256.c index 619c34b8..b516e70d 100644 --- a/src/msvc/Hacl_Bignum256.c +++ b/src/msvc/Hacl_Bignum256.c @@ -229,6 +229,7 @@ void Hacl_Bignum256_sub_mod(uint64_t *n, uint64_t *a, uint64_t *b, uint64_t *res c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t12, t2, res_i); } uint64_t c1 = c; + KRML_HOST_IGNORE(c1); uint64_t c2 = (uint64_t)0U - c00; KRML_MAYBE_FOR4(i, (uint32_t)0U, @@ -314,6 +315,7 @@ void Hacl_Bignum256_sqr(uint64_t *a, uint64_t *res) uint64_t r = c; res[i0 + i0] = r;); uint64_t c0 = Hacl_Bignum_Addition_bn_add_eq_len_u64((uint32_t)8U, res, res, res); + KRML_HOST_IGNORE(c0); uint64_t tmp[8U] = { 0U }; KRML_MAYBE_FOR4(i, (uint32_t)0U, @@ -325,6 +327,7 @@ void Hacl_Bignum256_sqr(uint64_t *a, uint64_t *res) tmp[(uint32_t)2U * i] = lo; tmp[(uint32_t)2U * i + (uint32_t)1U] = hi;); uint64_t c1 = Hacl_Bignum_Addition_bn_add_eq_len_u64((uint32_t)8U, res, tmp, res); + KRML_HOST_IGNORE(c1); } static inline void precompr2(uint32_t nBits, uint64_t *n, uint64_t *res) @@ -441,6 +444,7 @@ static inline void areduction(uint64_t *n, uint64_t nInv, uint64_t *c, uint64_t uint64_t c00 = c0; uint64_t tmp[4U] = { 0U }; uint64_t c1 = Hacl_Bignum256_sub(res, n, tmp); + KRML_HOST_IGNORE(c1); uint64_t m = (uint64_t)0U - c00; KRML_MAYBE_FOR4(i, (uint32_t)0U, @@ -518,6 +522,7 @@ static inline void amont_sqr(uint64_t *n, uint64_t nInv_u64, uint64_t *aM, uint6 uint64_t r = c1; c[i0 + i0] = r;); uint64_t c0 = Hacl_Bignum_Addition_bn_add_eq_len_u64((uint32_t)8U, c, c, c); + KRML_HOST_IGNORE(c0); uint64_t tmp[8U] = { 0U }; KRML_MAYBE_FOR4(i, (uint32_t)0U, @@ -529,6 +534,7 @@ static inline void amont_sqr(uint64_t *n, uint64_t nInv_u64, uint64_t *aM, uint6 tmp[(uint32_t)2U * i] = lo; tmp[(uint32_t)2U * i + (uint32_t)1U] = hi;); uint64_t c1 = Hacl_Bignum_Addition_bn_add_eq_len_u64((uint32_t)8U, c, tmp, c); + KRML_HOST_IGNORE(c1); areduction(n, nInv_u64, c, resM); } @@ -569,6 +575,7 @@ bn_slow_precomp(uint64_t *n, uint64_t mu, uint64_t *r2, uint64_t *a, uint64_t *r uint64_t c00 = c0; uint64_t tmp[4U] = { 0U }; uint64_t c1 = Hacl_Bignum256_sub(a_mod, n, tmp); + KRML_HOST_IGNORE(c1); uint64_t m = (uint64_t)0U - c00; KRML_MAYBE_FOR4(i, (uint32_t)0U, @@ -1154,6 +1161,7 @@ bool Hacl_Bignum256_mod_inv_prime_vartime(uint64_t *n, uint64_t *a, uint64_t *re c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t1, (uint64_t)0U, res_i);); uint64_t c1 = c; uint64_t c2 = c1; + KRML_HOST_IGNORE(c2); exp_vartime(nBits, n, a, (uint32_t)256U, n2, res); } else @@ -1335,6 +1343,7 @@ Hacl_Bignum256_mod_inv_prime_vartime_precomp( c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t1, (uint64_t)0U, res_i);); uint64_t c1 = c; uint64_t c2 = c1; + KRML_HOST_IGNORE(c2); exp_vartime_precomp(k1.n, k1.mu, k1.r2, a, (uint32_t)256U, n2, res); } @@ -1453,6 +1462,7 @@ Serialize a bignum into big-endian memory. void Hacl_Bignum256_bn_to_bytes_be(uint64_t *b, uint8_t *res) { uint8_t tmp[32U] = { 0U }; + KRML_HOST_IGNORE(tmp); KRML_MAYBE_FOR4(i, (uint32_t)0U, (uint32_t)4U, @@ -1469,6 +1479,7 @@ Serialize a bignum into little-endian memory. void Hacl_Bignum256_bn_to_bytes_le(uint64_t *b, uint8_t *res) { uint8_t tmp[32U] = { 0U }; + KRML_HOST_IGNORE(tmp); KRML_MAYBE_FOR4(i, (uint32_t)0U, (uint32_t)4U, diff --git a/src/msvc/Hacl_Bignum256_32.c b/src/msvc/Hacl_Bignum256_32.c index 4db59251..1c8ce59b 100644 --- a/src/msvc/Hacl_Bignum256_32.c +++ b/src/msvc/Hacl_Bignum256_32.c @@ -241,6 +241,7 @@ void Hacl_Bignum256_32_sub_mod(uint32_t *n, uint32_t *a, uint32_t *b, uint32_t * uint32_t *res_i = tmp + (uint32_t)4U * i + (uint32_t)3U; c = Lib_IntTypes_Intrinsics_add_carry_u32(c, t12, t2, res_i);); uint32_t c1 = c; + KRML_HOST_IGNORE(c1); uint32_t c2 = (uint32_t)0U - c00; KRML_MAYBE_FOR8(i, (uint32_t)0U, @@ -328,6 +329,7 @@ void Hacl_Bignum256_32_sqr(uint32_t *a, uint32_t *res) uint32_t r = c; res[i0 + i0] = r;); uint32_t c0 = Hacl_Bignum_Addition_bn_add_eq_len_u32((uint32_t)16U, res, res, res); + KRML_HOST_IGNORE(c0); uint32_t tmp[16U] = { 0U }; KRML_MAYBE_FOR8(i, (uint32_t)0U, @@ -339,6 +341,7 @@ void Hacl_Bignum256_32_sqr(uint32_t *a, uint32_t *res) tmp[(uint32_t)2U * i] = lo; tmp[(uint32_t)2U * i + (uint32_t)1U] = hi;); uint32_t c1 = Hacl_Bignum_Addition_bn_add_eq_len_u32((uint32_t)16U, res, tmp, res); + KRML_HOST_IGNORE(c1); } static inline void precompr2(uint32_t nBits, uint32_t *n, uint32_t *res) @@ -461,6 +464,7 @@ static inline void areduction(uint32_t *n, uint32_t nInv, uint32_t *c, uint32_t uint32_t c00 = c0; uint32_t tmp[8U] = { 0U }; uint32_t c1 = Hacl_Bignum256_32_sub(res, n, tmp); + KRML_HOST_IGNORE(c1); uint32_t m = (uint32_t)0U - c00; KRML_MAYBE_FOR8(i, (uint32_t)0U, @@ -540,6 +544,7 @@ static inline void amont_sqr(uint32_t *n, uint32_t nInv_u64, uint32_t *aM, uint3 uint32_t r = c1; c[i0 + i0] = r;); uint32_t c0 = Hacl_Bignum_Addition_bn_add_eq_len_u32((uint32_t)16U, c, c, c); + KRML_HOST_IGNORE(c0); uint32_t tmp[16U] = { 0U }; KRML_MAYBE_FOR8(i, (uint32_t)0U, @@ -551,6 +556,7 @@ static inline void amont_sqr(uint32_t *n, uint32_t nInv_u64, uint32_t *aM, uint3 tmp[(uint32_t)2U * i] = lo; tmp[(uint32_t)2U * i + (uint32_t)1U] = hi;); uint32_t c1 = Hacl_Bignum_Addition_bn_add_eq_len_u32((uint32_t)16U, c, tmp, c); + KRML_HOST_IGNORE(c1); areduction(n, nInv_u64, c, resM); } @@ -593,6 +599,7 @@ bn_slow_precomp(uint32_t *n, uint32_t mu, uint32_t *r2, uint32_t *a, uint32_t *r uint32_t c00 = c0; uint32_t tmp[8U] = { 0U }; uint32_t c1 = Hacl_Bignum256_32_sub(a_mod, n, tmp); + KRML_HOST_IGNORE(c1); uint32_t m = (uint32_t)0U - c00; KRML_MAYBE_FOR8(i, (uint32_t)0U, @@ -1188,6 +1195,7 @@ bool Hacl_Bignum256_32_mod_inv_prime_vartime(uint32_t *n, uint32_t *a, uint32_t c = Lib_IntTypes_Intrinsics_sub_borrow_u32(c, t1, (uint32_t)0U, res_i);); uint32_t c1 = c; uint32_t c2 = c1; + KRML_HOST_IGNORE(c2); exp_vartime(nBits, n, a, (uint32_t)256U, n2, res); } else @@ -1382,6 +1390,7 @@ Hacl_Bignum256_32_mod_inv_prime_vartime_precomp( c = Lib_IntTypes_Intrinsics_sub_borrow_u32(c, t1, (uint32_t)0U, res_i);); uint32_t c1 = c; uint32_t c2 = c1; + KRML_HOST_IGNORE(c2); exp_vartime_precomp(k1.n, k1.mu, k1.r2, a, (uint32_t)256U, n2, res); } @@ -1500,6 +1509,7 @@ Serialize a bignum into big-endian memory. void Hacl_Bignum256_32_bn_to_bytes_be(uint32_t *b, uint8_t *res) { uint8_t tmp[32U] = { 0U }; + KRML_HOST_IGNORE(tmp); KRML_MAYBE_FOR8(i, (uint32_t)0U, (uint32_t)8U, @@ -1516,6 +1526,7 @@ Serialize a bignum into little-endian memory. void Hacl_Bignum256_32_bn_to_bytes_le(uint32_t *b, uint8_t *res) { uint8_t tmp[32U] = { 0U }; + KRML_HOST_IGNORE(tmp); KRML_MAYBE_FOR8(i, (uint32_t)0U, (uint32_t)8U, diff --git a/src/msvc/Hacl_Bignum32.c b/src/msvc/Hacl_Bignum32.c index 4784502a..f719a08e 100644 --- a/src/msvc/Hacl_Bignum32.c +++ b/src/msvc/Hacl_Bignum32.c @@ -181,6 +181,7 @@ bn_slow_precomp( uint32_t *tmp0 = (uint32_t *)alloca(len * sizeof (uint32_t)); memset(tmp0, 0U, len * sizeof (uint32_t)); uint32_t c1 = Hacl_Bignum_Addition_bn_sub_eq_len_u32(len, a_mod, n, tmp0); + KRML_HOST_IGNORE(c1); uint32_t m = (uint32_t)0U - c00; for (uint32_t i = (uint32_t)0U; i < len; i++) { @@ -431,6 +432,7 @@ bool Hacl_Bignum32_mod_inv_prime_vartime(uint32_t len, uint32_t *n, uint32_t *a, { c1 = c0; } + KRML_HOST_IGNORE(c1); Hacl_Bignum_Exponentiation_bn_mod_exp_vartime_u32(len, nBits, n, @@ -670,6 +672,7 @@ Hacl_Bignum32_mod_inv_prime_vartime_precomp( { c1 = c0; } + KRML_HOST_IGNORE(c1); Hacl_Bignum_Exponentiation_bn_mod_exp_vartime_precomp_u32(len1, k1.n, k1.mu, diff --git a/src/msvc/Hacl_Bignum4096.c b/src/msvc/Hacl_Bignum4096.c index 5aa2af33..ee51cc5e 100644 --- a/src/msvc/Hacl_Bignum4096.c +++ b/src/msvc/Hacl_Bignum4096.c @@ -243,6 +243,7 @@ void Hacl_Bignum4096_sub_mod(uint64_t *n, uint64_t *a, uint64_t *b, uint64_t *re uint64_t *res_i = tmp + (uint32_t)4U * i + (uint32_t)3U; c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t12, t2, res_i);); uint64_t c1 = c; + KRML_HOST_IGNORE(c1); uint64_t c2 = (uint64_t)0U - c00; for (uint32_t i = (uint32_t)0U; i < (uint32_t)64U; i++) { @@ -393,6 +394,7 @@ static inline void areduction(uint64_t *n, uint64_t nInv, uint64_t *c, uint64_t uint64_t c00 = c0; uint64_t tmp[64U] = { 0U }; uint64_t c1 = Hacl_Bignum4096_sub(res, n, tmp); + KRML_HOST_IGNORE(c1); uint64_t m = (uint64_t)0U - c00; for (uint32_t i = (uint32_t)0U; i < (uint32_t)64U; i++) { @@ -457,6 +459,7 @@ bn_slow_precomp(uint64_t *n, uint64_t mu, uint64_t *r2, uint64_t *a, uint64_t *r uint64_t c00 = c0; uint64_t tmp[64U] = { 0U }; uint64_t c1 = Hacl_Bignum4096_sub(a_mod, n, tmp); + KRML_HOST_IGNORE(c1); uint64_t m = (uint64_t)0U - c00; for (uint32_t i = (uint32_t)0U; i < (uint32_t)64U; i++) { @@ -1047,6 +1050,7 @@ bool Hacl_Bignum4096_mod_inv_prime_vartime(uint64_t *n, uint64_t *a, uint64_t *r c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t1, (uint64_t)0U, res_i);); uint64_t c1 = c; uint64_t c2 = c1; + KRML_HOST_IGNORE(c2); exp_vartime(nBits, n, a, (uint32_t)4096U, n2, res); } else @@ -1244,6 +1248,7 @@ Hacl_Bignum4096_mod_inv_prime_vartime_precomp( c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t1, (uint64_t)0U, res_i);); uint64_t c1 = c; uint64_t c2 = c1; + KRML_HOST_IGNORE(c2); exp_vartime_precomp(k1.n, k1.mu, k1.r2, a, (uint32_t)4096U, n2, res); } @@ -1362,6 +1367,7 @@ Serialize a bignum into big-endian memory. void Hacl_Bignum4096_bn_to_bytes_be(uint64_t *b, uint8_t *res) { uint8_t tmp[512U] = { 0U }; + KRML_HOST_IGNORE(tmp); for (uint32_t i = (uint32_t)0U; i < (uint32_t)64U; i++) { store64_be(res + i * (uint32_t)8U, b[(uint32_t)64U - i - (uint32_t)1U]); @@ -1377,6 +1383,7 @@ Serialize a bignum into little-endian memory. void Hacl_Bignum4096_bn_to_bytes_le(uint64_t *b, uint8_t *res) { uint8_t tmp[512U] = { 0U }; + KRML_HOST_IGNORE(tmp); for (uint32_t i = (uint32_t)0U; i < (uint32_t)64U; i++) { store64_le(res + i * (uint32_t)8U, b[i]); diff --git a/src/msvc/Hacl_Bignum4096_32.c b/src/msvc/Hacl_Bignum4096_32.c index 1924e7d8..790d0428 100644 --- a/src/msvc/Hacl_Bignum4096_32.c +++ b/src/msvc/Hacl_Bignum4096_32.c @@ -238,6 +238,7 @@ void Hacl_Bignum4096_32_sub_mod(uint32_t *n, uint32_t *a, uint32_t *b, uint32_t c = Lib_IntTypes_Intrinsics_add_carry_u32(c, t12, t2, res_i); } uint32_t c1 = c; + KRML_HOST_IGNORE(c1); uint32_t c2 = (uint32_t)0U - c00; for (uint32_t i = (uint32_t)0U; i < (uint32_t)128U; i++) { @@ -385,6 +386,7 @@ static inline void areduction(uint32_t *n, uint32_t nInv, uint32_t *c, uint32_t uint32_t c00 = c0; uint32_t tmp[128U] = { 0U }; uint32_t c1 = Hacl_Bignum4096_32_sub(res, n, tmp); + KRML_HOST_IGNORE(c1); uint32_t m = (uint32_t)0U - c00; for (uint32_t i = (uint32_t)0U; i < (uint32_t)128U; i++) { @@ -448,6 +450,7 @@ bn_slow_precomp(uint32_t *n, uint32_t mu, uint32_t *r2, uint32_t *a, uint32_t *r uint32_t c00 = c0; uint32_t tmp[128U] = { 0U }; uint32_t c1 = Hacl_Bignum4096_32_sub(a_mod, n, tmp); + KRML_HOST_IGNORE(c1); uint32_t m = (uint32_t)0U - c00; for (uint32_t i = (uint32_t)0U; i < (uint32_t)128U; i++) { @@ -1033,6 +1036,7 @@ bool Hacl_Bignum4096_32_mod_inv_prime_vartime(uint32_t *n, uint32_t *a, uint32_t c = Lib_IntTypes_Intrinsics_sub_borrow_u32(c, t1, (uint32_t)0U, res_i);); uint32_t c1 = c; uint32_t c2 = c1; + KRML_HOST_IGNORE(c2); exp_vartime(nBits, n, a, (uint32_t)4096U, n2, res); } else @@ -1228,6 +1232,7 @@ Hacl_Bignum4096_32_mod_inv_prime_vartime_precomp( c = Lib_IntTypes_Intrinsics_sub_borrow_u32(c, t1, (uint32_t)0U, res_i);); uint32_t c1 = c; uint32_t c2 = c1; + KRML_HOST_IGNORE(c2); exp_vartime_precomp(k1.n, k1.mu, k1.r2, a, (uint32_t)4096U, n2, res); } @@ -1346,6 +1351,7 @@ Serialize a bignum into big-endian memory. void Hacl_Bignum4096_32_bn_to_bytes_be(uint32_t *b, uint8_t *res) { uint8_t tmp[512U] = { 0U }; + KRML_HOST_IGNORE(tmp); for (uint32_t i = (uint32_t)0U; i < (uint32_t)128U; i++) { store32_be(res + i * (uint32_t)4U, b[(uint32_t)128U - i - (uint32_t)1U]); @@ -1361,6 +1367,7 @@ Serialize a bignum into little-endian memory. void Hacl_Bignum4096_32_bn_to_bytes_le(uint32_t *b, uint8_t *res) { uint8_t tmp[512U] = { 0U }; + KRML_HOST_IGNORE(tmp); for (uint32_t i = (uint32_t)0U; i < (uint32_t)128U; i++) { store32_le(res + i * (uint32_t)4U, b[i]); diff --git a/src/msvc/Hacl_Bignum64.c b/src/msvc/Hacl_Bignum64.c index ee99893a..9e701c7b 100644 --- a/src/msvc/Hacl_Bignum64.c +++ b/src/msvc/Hacl_Bignum64.c @@ -180,6 +180,7 @@ bn_slow_precomp( uint64_t *tmp0 = (uint64_t *)alloca(len * sizeof (uint64_t)); memset(tmp0, 0U, len * sizeof (uint64_t)); uint64_t c1 = Hacl_Bignum_Addition_bn_sub_eq_len_u64(len, a_mod, n, tmp0); + KRML_HOST_IGNORE(c1); uint64_t m = (uint64_t)0U - c00; for (uint32_t i = (uint32_t)0U; i < len; i++) { @@ -430,6 +431,7 @@ bool Hacl_Bignum64_mod_inv_prime_vartime(uint32_t len, uint64_t *n, uint64_t *a, { c1 = c0; } + KRML_HOST_IGNORE(c1); Hacl_Bignum_Exponentiation_bn_mod_exp_vartime_u64(len, nBits, n, @@ -669,6 +671,7 @@ Hacl_Bignum64_mod_inv_prime_vartime_precomp( { c1 = c0; } + KRML_HOST_IGNORE(c1); Hacl_Bignum_Exponentiation_bn_mod_exp_vartime_precomp_u64(len1, k1.n, k1.mu, diff --git a/src/msvc/Hacl_Ed25519.c b/src/msvc/Hacl_Ed25519.c index 39d25998..9d7c3bd4 100644 --- a/src/msvc/Hacl_Ed25519.c +++ b/src/msvc/Hacl_Ed25519.c @@ -1483,6 +1483,9 @@ static inline void point_mul_g(uint64_t *out, uint8_t *scalar) uint64_t bits_l2 = Hacl_Bignum_Lib_bn_get_bits_u64((uint32_t)1U, r1, k2, (uint32_t)4U); precomp_get_consttime(Hacl_Ed25519_PrecompTable_precomp_basepoint_table_w4, bits_l2, tmp); Hacl_Impl_Ed25519_PointAdd_point_add(out, out, tmp);); + KRML_HOST_IGNORE(q2); + KRML_HOST_IGNORE(q3); + KRML_HOST_IGNORE(q4); } static inline void @@ -1717,8 +1720,10 @@ static inline void sha512_pre_msg(uint8_t *hash, uint8_t *prefix, uint32_t len, Hacl_SHA2_Scalar32_sha512_init(block_state); Hacl_Streaming_MD_state_64 *st = &p; Hacl_Streaming_Types_error_code - uu____0 = Hacl_Streaming_SHA2_update_512(st, prefix, (uint32_t)32U); - Hacl_Streaming_Types_error_code uu____1 = Hacl_Streaming_SHA2_update_512(st, input, len); + err0 = Hacl_Streaming_SHA2_update_512(st, prefix, (uint32_t)32U); + Hacl_Streaming_Types_error_code err1 = Hacl_Streaming_SHA2_update_512(st, input, len); + KRML_HOST_IGNORE(err0); + KRML_HOST_IGNORE(err1); Hacl_Streaming_SHA2_finish_512(st, hash); } @@ -1739,10 +1744,13 @@ sha512_pre_pre2_msg( Hacl_SHA2_Scalar32_sha512_init(block_state); Hacl_Streaming_MD_state_64 *st = &p; Hacl_Streaming_Types_error_code - uu____0 = Hacl_Streaming_SHA2_update_512(st, prefix, (uint32_t)32U); + err0 = Hacl_Streaming_SHA2_update_512(st, prefix, (uint32_t)32U); Hacl_Streaming_Types_error_code - uu____1 = Hacl_Streaming_SHA2_update_512(st, prefix2, (uint32_t)32U); - Hacl_Streaming_Types_error_code uu____2 = Hacl_Streaming_SHA2_update_512(st, input, len); + err1 = Hacl_Streaming_SHA2_update_512(st, prefix2, (uint32_t)32U); + Hacl_Streaming_Types_error_code err2 = Hacl_Streaming_SHA2_update_512(st, input, len); + KRML_HOST_IGNORE(err0); + KRML_HOST_IGNORE(err1); + KRML_HOST_IGNORE(err2); Hacl_Streaming_SHA2_finish_512(st, hash); } diff --git a/src/msvc/Hacl_Frodo1344.c b/src/msvc/Hacl_Frodo1344.c index a038e69c..2951f848 100644 --- a/src/msvc/Hacl_Frodo1344.c +++ b/src/msvc/Hacl_Frodo1344.c @@ -27,6 +27,7 @@ #include "internal/Hacl_Spec.h" #include "internal/Hacl_Frodo_KEM.h" +#include "lib_memzero0.h" uint32_t Hacl_Frodo1344_crypto_bytes = (uint32_t)32U; @@ -54,7 +55,7 @@ uint32_t Hacl_Frodo1344_crypto_kem_keypair(uint8_t *pk, uint8_t *sk) shake_input_seed_se[0U] = (uint8_t)0x5fU; memcpy(shake_input_seed_se + (uint32_t)1U, seed_se, (uint32_t)32U * sizeof (uint8_t)); Hacl_SHA3_shake256_hacl((uint32_t)33U, shake_input_seed_se, (uint32_t)43008U, r); - Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)33U * sizeof (shake_input_seed_se[0U])); + Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)33U, uint8_t); Hacl_Impl_Frodo_Sample_frodo_sample_matrix1344((uint32_t)1344U, (uint32_t)8U, r, s_matrix); Hacl_Impl_Frodo_Sample_frodo_sample_matrix1344((uint32_t)1344U, (uint32_t)8U, @@ -80,14 +81,14 @@ uint32_t Hacl_Frodo1344_crypto_kem_keypair(uint8_t *pk, uint8_t *sk) b_matrix, b_bytes); Hacl_Impl_Matrix_matrix_to_lbytes((uint32_t)1344U, (uint32_t)8U, s_matrix, s_bytes); - Lib_Memzero0_memzero(s_matrix, (uint32_t)10752U * sizeof (s_matrix[0U])); - Lib_Memzero0_memzero(e_matrix, (uint32_t)10752U * sizeof (e_matrix[0U])); + Lib_Memzero0_memzero(s_matrix, (uint32_t)10752U, uint16_t); + Lib_Memzero0_memzero(e_matrix, (uint32_t)10752U, uint16_t); uint32_t slen1 = (uint32_t)43056U; uint8_t *sk_p = sk; memcpy(sk_p, s, (uint32_t)32U * sizeof (uint8_t)); memcpy(sk_p + (uint32_t)32U, pk, (uint32_t)21520U * sizeof (uint8_t)); Hacl_SHA3_shake256_hacl((uint32_t)21520U, pk, (uint32_t)32U, sk + slen1); - Lib_Memzero0_memzero(coins, (uint32_t)80U * sizeof (coins[0U])); + Lib_Memzero0_memzero(coins, (uint32_t)80U, uint8_t); return (uint32_t)0U; } @@ -112,7 +113,7 @@ uint32_t Hacl_Frodo1344_crypto_kem_enc(uint8_t *ct, uint8_t *ss, uint8_t *pk) shake_input_seed_se[0U] = (uint8_t)0x96U; memcpy(shake_input_seed_se + (uint32_t)1U, seed_se, (uint32_t)32U * sizeof (uint8_t)); Hacl_SHA3_shake256_hacl((uint32_t)33U, shake_input_seed_se, (uint32_t)43136U, r); - Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)33U * sizeof (shake_input_seed_se[0U])); + Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)33U, uint8_t); Hacl_Impl_Frodo_Sample_frodo_sample_matrix1344((uint32_t)8U, (uint32_t)1344U, r, sp_matrix); Hacl_Impl_Frodo_Sample_frodo_sample_matrix1344((uint32_t)8U, (uint32_t)1344U, @@ -156,12 +157,12 @@ uint32_t Hacl_Frodo1344_crypto_kem_enc(uint8_t *ct, uint8_t *ss, uint8_t *pk) coins, mu_encode); Hacl_Impl_Matrix_matrix_add((uint32_t)8U, (uint32_t)8U, v_matrix, mu_encode); - Lib_Memzero0_memzero(mu_encode, (uint32_t)64U * sizeof (mu_encode[0U])); + Lib_Memzero0_memzero(mu_encode, (uint32_t)64U, uint16_t); Hacl_Impl_Frodo_Pack_frodo_pack((uint32_t)8U, (uint32_t)8U, (uint32_t)16U, v_matrix, c2); - Lib_Memzero0_memzero(v_matrix, (uint32_t)64U * sizeof (v_matrix[0U])); - Lib_Memzero0_memzero(sp_matrix, (uint32_t)10752U * sizeof (sp_matrix[0U])); - Lib_Memzero0_memzero(ep_matrix, (uint32_t)10752U * sizeof (ep_matrix[0U])); - Lib_Memzero0_memzero(epp_matrix, (uint32_t)64U * sizeof (epp_matrix[0U])); + Lib_Memzero0_memzero(v_matrix, (uint32_t)64U, uint16_t); + Lib_Memzero0_memzero(sp_matrix, (uint32_t)10752U, uint16_t); + Lib_Memzero0_memzero(ep_matrix, (uint32_t)10752U, uint16_t); + Lib_Memzero0_memzero(epp_matrix, (uint32_t)64U, uint16_t); uint32_t ss_init_len = (uint32_t)21664U; KRML_CHECK_SIZE(sizeof (uint8_t), ss_init_len); uint8_t *shake_input_ss = (uint8_t *)alloca(ss_init_len * sizeof (uint8_t)); @@ -169,9 +170,9 @@ uint32_t Hacl_Frodo1344_crypto_kem_enc(uint8_t *ct, uint8_t *ss, uint8_t *pk) memcpy(shake_input_ss, ct, (uint32_t)21632U * sizeof (uint8_t)); memcpy(shake_input_ss + (uint32_t)21632U, k, (uint32_t)32U * sizeof (uint8_t)); Hacl_SHA3_shake256_hacl(ss_init_len, shake_input_ss, (uint32_t)32U, ss); - Lib_Memzero0_memzero(shake_input_ss, ss_init_len * sizeof (shake_input_ss[0U])); - Lib_Memzero0_memzero(seed_se_k, (uint32_t)64U * sizeof (seed_se_k[0U])); - Lib_Memzero0_memzero(coins, (uint32_t)32U * sizeof (coins[0U])); + Lib_Memzero0_memzero(shake_input_ss, ss_init_len, uint8_t); + Lib_Memzero0_memzero(seed_se_k, (uint32_t)64U, uint8_t); + Lib_Memzero0_memzero(coins, (uint32_t)32U, uint8_t); return (uint32_t)0U; } @@ -200,8 +201,8 @@ uint32_t Hacl_Frodo1344_crypto_kem_dec(uint8_t *ss, uint8_t *ct, uint8_t *sk) (uint32_t)8U, m_matrix, mu_decode); - Lib_Memzero0_memzero(s_matrix, (uint32_t)10752U * sizeof (s_matrix[0U])); - Lib_Memzero0_memzero(m_matrix, (uint32_t)64U * sizeof (m_matrix[0U])); + Lib_Memzero0_memzero(s_matrix, (uint32_t)10752U, uint16_t); + Lib_Memzero0_memzero(m_matrix, (uint32_t)64U, uint16_t); uint8_t seed_se_k[64U] = { 0U }; uint32_t pkh_mu_decode_len = (uint32_t)64U; KRML_CHECK_SIZE(sizeof (uint8_t), pkh_mu_decode_len); @@ -224,7 +225,7 @@ uint32_t Hacl_Frodo1344_crypto_kem_dec(uint8_t *ss, uint8_t *ct, uint8_t *sk) shake_input_seed_se[0U] = (uint8_t)0x96U; memcpy(shake_input_seed_se + (uint32_t)1U, seed_se, (uint32_t)32U * sizeof (uint8_t)); Hacl_SHA3_shake256_hacl((uint32_t)33U, shake_input_seed_se, (uint32_t)43136U, r); - Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)33U * sizeof (shake_input_seed_se[0U])); + Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)33U, uint8_t); Hacl_Impl_Frodo_Sample_frodo_sample_matrix1344((uint32_t)8U, (uint32_t)1344U, r, sp_matrix); Hacl_Impl_Frodo_Sample_frodo_sample_matrix1344((uint32_t)8U, (uint32_t)1344U, @@ -266,12 +267,12 @@ uint32_t Hacl_Frodo1344_crypto_kem_dec(uint8_t *ss, uint8_t *ct, uint8_t *sk) mu_decode, mu_encode); Hacl_Impl_Matrix_matrix_add((uint32_t)8U, (uint32_t)8U, cp_matrix, mu_encode); - Lib_Memzero0_memzero(mu_encode, (uint32_t)64U * sizeof (mu_encode[0U])); + Lib_Memzero0_memzero(mu_encode, (uint32_t)64U, uint16_t); Hacl_Impl_Matrix_mod_pow2((uint32_t)8U, (uint32_t)1344U, (uint32_t)16U, bpp_matrix); Hacl_Impl_Matrix_mod_pow2((uint32_t)8U, (uint32_t)8U, (uint32_t)16U, cp_matrix); - Lib_Memzero0_memzero(sp_matrix, (uint32_t)10752U * sizeof (sp_matrix[0U])); - Lib_Memzero0_memzero(ep_matrix, (uint32_t)10752U * sizeof (ep_matrix[0U])); - Lib_Memzero0_memzero(epp_matrix, (uint32_t)64U * sizeof (epp_matrix[0U])); + Lib_Memzero0_memzero(sp_matrix, (uint32_t)10752U, uint16_t); + Lib_Memzero0_memzero(ep_matrix, (uint32_t)10752U, uint16_t); + Lib_Memzero0_memzero(epp_matrix, (uint32_t)64U, uint16_t); uint16_t b1 = Hacl_Impl_Matrix_matrix_eq((uint32_t)8U, (uint32_t)1344U, bp_matrix, bpp_matrix); uint16_t b2 = Hacl_Impl_Matrix_matrix_eq((uint32_t)8U, (uint32_t)8U, c_matrix, cp_matrix); uint16_t mask = b1 & b2; @@ -291,10 +292,10 @@ uint32_t Hacl_Frodo1344_crypto_kem_dec(uint8_t *ss, uint8_t *ct, uint8_t *sk) memcpy(ss_init, ct, (uint32_t)21632U * sizeof (uint8_t)); memcpy(ss_init + (uint32_t)21632U, kp_s, (uint32_t)32U * sizeof (uint8_t)); Hacl_SHA3_shake256_hacl(ss_init_len, ss_init, (uint32_t)32U, ss); - Lib_Memzero0_memzero(ss_init, ss_init_len * sizeof (ss_init[0U])); - Lib_Memzero0_memzero(kp_s, (uint32_t)32U * sizeof (kp_s[0U])); - Lib_Memzero0_memzero(seed_se_k, (uint32_t)64U * sizeof (seed_se_k[0U])); - Lib_Memzero0_memzero(mu_decode, (uint32_t)32U * sizeof (mu_decode[0U])); + Lib_Memzero0_memzero(ss_init, ss_init_len, uint8_t); + Lib_Memzero0_memzero(kp_s, (uint32_t)32U, uint8_t); + Lib_Memzero0_memzero(seed_se_k, (uint32_t)64U, uint8_t); + Lib_Memzero0_memzero(mu_decode, (uint32_t)32U, uint8_t); return (uint32_t)0U; } diff --git a/src/msvc/Hacl_Frodo64.c b/src/msvc/Hacl_Frodo64.c index d1036c70..45ee9dd6 100644 --- a/src/msvc/Hacl_Frodo64.c +++ b/src/msvc/Hacl_Frodo64.c @@ -27,6 +27,7 @@ #include "internal/Hacl_Spec.h" #include "internal/Hacl_Frodo_KEM.h" +#include "lib_memzero0.h" /* this variant is used only for testing purposes! @@ -59,7 +60,7 @@ uint32_t Hacl_Frodo64_crypto_kem_keypair(uint8_t *pk, uint8_t *sk) shake_input_seed_se[0U] = (uint8_t)0x5fU; memcpy(shake_input_seed_se + (uint32_t)1U, seed_se, (uint32_t)16U * sizeof (uint8_t)); Hacl_SHA3_shake128_hacl((uint32_t)17U, shake_input_seed_se, (uint32_t)2048U, r); - Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)17U * sizeof (shake_input_seed_se[0U])); + Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)17U, uint8_t); Hacl_Impl_Frodo_Sample_frodo_sample_matrix64((uint32_t)64U, (uint32_t)8U, r, s_matrix); Hacl_Impl_Frodo_Sample_frodo_sample_matrix64((uint32_t)64U, (uint32_t)8U, @@ -80,14 +81,14 @@ uint32_t Hacl_Frodo64_crypto_kem_keypair(uint8_t *pk, uint8_t *sk) Hacl_Impl_Matrix_matrix_add((uint32_t)64U, (uint32_t)8U, b_matrix, e_matrix); Hacl_Impl_Frodo_Pack_frodo_pack((uint32_t)64U, (uint32_t)8U, (uint32_t)15U, b_matrix, b_bytes); Hacl_Impl_Matrix_matrix_to_lbytes((uint32_t)64U, (uint32_t)8U, s_matrix, s_bytes); - Lib_Memzero0_memzero(s_matrix, (uint32_t)512U * sizeof (s_matrix[0U])); - Lib_Memzero0_memzero(e_matrix, (uint32_t)512U * sizeof (e_matrix[0U])); + Lib_Memzero0_memzero(s_matrix, (uint32_t)512U, uint16_t); + Lib_Memzero0_memzero(e_matrix, (uint32_t)512U, uint16_t); uint32_t slen1 = (uint32_t)2016U; uint8_t *sk_p = sk; memcpy(sk_p, s, (uint32_t)16U * sizeof (uint8_t)); memcpy(sk_p + (uint32_t)16U, pk, (uint32_t)976U * sizeof (uint8_t)); Hacl_SHA3_shake128_hacl((uint32_t)976U, pk, (uint32_t)16U, sk + slen1); - Lib_Memzero0_memzero(coins, (uint32_t)48U * sizeof (coins[0U])); + Lib_Memzero0_memzero(coins, (uint32_t)48U, uint8_t); return (uint32_t)0U; } @@ -112,7 +113,7 @@ uint32_t Hacl_Frodo64_crypto_kem_enc(uint8_t *ct, uint8_t *ss, uint8_t *pk) shake_input_seed_se[0U] = (uint8_t)0x96U; memcpy(shake_input_seed_se + (uint32_t)1U, seed_se, (uint32_t)16U * sizeof (uint8_t)); Hacl_SHA3_shake128_hacl((uint32_t)17U, shake_input_seed_se, (uint32_t)2176U, r); - Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)17U * sizeof (shake_input_seed_se[0U])); + Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)17U, uint8_t); Hacl_Impl_Frodo_Sample_frodo_sample_matrix64((uint32_t)8U, (uint32_t)64U, r, sp_matrix); Hacl_Impl_Frodo_Sample_frodo_sample_matrix64((uint32_t)8U, (uint32_t)64U, @@ -155,12 +156,12 @@ uint32_t Hacl_Frodo64_crypto_kem_enc(uint8_t *ct, uint8_t *ss, uint8_t *pk) coins, mu_encode); Hacl_Impl_Matrix_matrix_add((uint32_t)8U, (uint32_t)8U, v_matrix, mu_encode); - Lib_Memzero0_memzero(mu_encode, (uint32_t)64U * sizeof (mu_encode[0U])); + Lib_Memzero0_memzero(mu_encode, (uint32_t)64U, uint16_t); Hacl_Impl_Frodo_Pack_frodo_pack((uint32_t)8U, (uint32_t)8U, (uint32_t)15U, v_matrix, c2); - Lib_Memzero0_memzero(v_matrix, (uint32_t)64U * sizeof (v_matrix[0U])); - Lib_Memzero0_memzero(sp_matrix, (uint32_t)512U * sizeof (sp_matrix[0U])); - Lib_Memzero0_memzero(ep_matrix, (uint32_t)512U * sizeof (ep_matrix[0U])); - Lib_Memzero0_memzero(epp_matrix, (uint32_t)64U * sizeof (epp_matrix[0U])); + Lib_Memzero0_memzero(v_matrix, (uint32_t)64U, uint16_t); + Lib_Memzero0_memzero(sp_matrix, (uint32_t)512U, uint16_t); + Lib_Memzero0_memzero(ep_matrix, (uint32_t)512U, uint16_t); + Lib_Memzero0_memzero(epp_matrix, (uint32_t)64U, uint16_t); uint32_t ss_init_len = (uint32_t)1096U; KRML_CHECK_SIZE(sizeof (uint8_t), ss_init_len); uint8_t *shake_input_ss = (uint8_t *)alloca(ss_init_len * sizeof (uint8_t)); @@ -168,9 +169,9 @@ uint32_t Hacl_Frodo64_crypto_kem_enc(uint8_t *ct, uint8_t *ss, uint8_t *pk) memcpy(shake_input_ss, ct, (uint32_t)1080U * sizeof (uint8_t)); memcpy(shake_input_ss + (uint32_t)1080U, k, (uint32_t)16U * sizeof (uint8_t)); Hacl_SHA3_shake128_hacl(ss_init_len, shake_input_ss, (uint32_t)16U, ss); - Lib_Memzero0_memzero(shake_input_ss, ss_init_len * sizeof (shake_input_ss[0U])); - Lib_Memzero0_memzero(seed_se_k, (uint32_t)32U * sizeof (seed_se_k[0U])); - Lib_Memzero0_memzero(coins, (uint32_t)16U * sizeof (coins[0U])); + Lib_Memzero0_memzero(shake_input_ss, ss_init_len, uint8_t); + Lib_Memzero0_memzero(seed_se_k, (uint32_t)32U, uint8_t); + Lib_Memzero0_memzero(coins, (uint32_t)16U, uint8_t); return (uint32_t)0U; } @@ -199,8 +200,8 @@ uint32_t Hacl_Frodo64_crypto_kem_dec(uint8_t *ss, uint8_t *ct, uint8_t *sk) (uint32_t)8U, m_matrix, mu_decode); - Lib_Memzero0_memzero(s_matrix, (uint32_t)512U * sizeof (s_matrix[0U])); - Lib_Memzero0_memzero(m_matrix, (uint32_t)64U * sizeof (m_matrix[0U])); + Lib_Memzero0_memzero(s_matrix, (uint32_t)512U, uint16_t); + Lib_Memzero0_memzero(m_matrix, (uint32_t)64U, uint16_t); uint8_t seed_se_k[32U] = { 0U }; uint32_t pkh_mu_decode_len = (uint32_t)32U; KRML_CHECK_SIZE(sizeof (uint8_t), pkh_mu_decode_len); @@ -223,7 +224,7 @@ uint32_t Hacl_Frodo64_crypto_kem_dec(uint8_t *ss, uint8_t *ct, uint8_t *sk) shake_input_seed_se[0U] = (uint8_t)0x96U; memcpy(shake_input_seed_se + (uint32_t)1U, seed_se, (uint32_t)16U * sizeof (uint8_t)); Hacl_SHA3_shake128_hacl((uint32_t)17U, shake_input_seed_se, (uint32_t)2176U, r); - Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)17U * sizeof (shake_input_seed_se[0U])); + Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)17U, uint8_t); Hacl_Impl_Frodo_Sample_frodo_sample_matrix64((uint32_t)8U, (uint32_t)64U, r, sp_matrix); Hacl_Impl_Frodo_Sample_frodo_sample_matrix64((uint32_t)8U, (uint32_t)64U, @@ -264,12 +265,12 @@ uint32_t Hacl_Frodo64_crypto_kem_dec(uint8_t *ss, uint8_t *ct, uint8_t *sk) mu_decode, mu_encode); Hacl_Impl_Matrix_matrix_add((uint32_t)8U, (uint32_t)8U, cp_matrix, mu_encode); - Lib_Memzero0_memzero(mu_encode, (uint32_t)64U * sizeof (mu_encode[0U])); + Lib_Memzero0_memzero(mu_encode, (uint32_t)64U, uint16_t); Hacl_Impl_Matrix_mod_pow2((uint32_t)8U, (uint32_t)64U, (uint32_t)15U, bpp_matrix); Hacl_Impl_Matrix_mod_pow2((uint32_t)8U, (uint32_t)8U, (uint32_t)15U, cp_matrix); - Lib_Memzero0_memzero(sp_matrix, (uint32_t)512U * sizeof (sp_matrix[0U])); - Lib_Memzero0_memzero(ep_matrix, (uint32_t)512U * sizeof (ep_matrix[0U])); - Lib_Memzero0_memzero(epp_matrix, (uint32_t)64U * sizeof (epp_matrix[0U])); + Lib_Memzero0_memzero(sp_matrix, (uint32_t)512U, uint16_t); + Lib_Memzero0_memzero(ep_matrix, (uint32_t)512U, uint16_t); + Lib_Memzero0_memzero(epp_matrix, (uint32_t)64U, uint16_t); uint16_t b1 = Hacl_Impl_Matrix_matrix_eq((uint32_t)8U, (uint32_t)64U, bp_matrix, bpp_matrix); uint16_t b2 = Hacl_Impl_Matrix_matrix_eq((uint32_t)8U, (uint32_t)8U, c_matrix, cp_matrix); uint16_t mask = b1 & b2; @@ -290,10 +291,10 @@ uint32_t Hacl_Frodo64_crypto_kem_dec(uint8_t *ss, uint8_t *ct, uint8_t *sk) memcpy(ss_init, ct, (uint32_t)1080U * sizeof (uint8_t)); memcpy(ss_init + (uint32_t)1080U, kp_s, (uint32_t)16U * sizeof (uint8_t)); Hacl_SHA3_shake128_hacl(ss_init_len, ss_init, (uint32_t)16U, ss); - Lib_Memzero0_memzero(ss_init, ss_init_len * sizeof (ss_init[0U])); - Lib_Memzero0_memzero(kp_s, (uint32_t)16U * sizeof (kp_s[0U])); - Lib_Memzero0_memzero(seed_se_k, (uint32_t)32U * sizeof (seed_se_k[0U])); - Lib_Memzero0_memzero(mu_decode, (uint32_t)16U * sizeof (mu_decode[0U])); + Lib_Memzero0_memzero(ss_init, ss_init_len, uint8_t); + Lib_Memzero0_memzero(kp_s, (uint32_t)16U, uint8_t); + Lib_Memzero0_memzero(seed_se_k, (uint32_t)32U, uint8_t); + Lib_Memzero0_memzero(mu_decode, (uint32_t)16U, uint8_t); return (uint32_t)0U; } diff --git a/src/msvc/Hacl_Frodo640.c b/src/msvc/Hacl_Frodo640.c index 6a31856c..badd2bae 100644 --- a/src/msvc/Hacl_Frodo640.c +++ b/src/msvc/Hacl_Frodo640.c @@ -27,6 +27,7 @@ #include "internal/Hacl_Spec.h" #include "internal/Hacl_Frodo_KEM.h" +#include "lib_memzero0.h" uint32_t Hacl_Frodo640_crypto_bytes = (uint32_t)16U; @@ -54,7 +55,7 @@ uint32_t Hacl_Frodo640_crypto_kem_keypair(uint8_t *pk, uint8_t *sk) shake_input_seed_se[0U] = (uint8_t)0x5fU; memcpy(shake_input_seed_se + (uint32_t)1U, seed_se, (uint32_t)16U * sizeof (uint8_t)); Hacl_SHA3_shake128_hacl((uint32_t)17U, shake_input_seed_se, (uint32_t)20480U, r); - Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)17U * sizeof (shake_input_seed_se[0U])); + Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)17U, uint8_t); Hacl_Impl_Frodo_Sample_frodo_sample_matrix640((uint32_t)640U, (uint32_t)8U, r, s_matrix); Hacl_Impl_Frodo_Sample_frodo_sample_matrix640((uint32_t)640U, (uint32_t)8U, @@ -80,14 +81,14 @@ uint32_t Hacl_Frodo640_crypto_kem_keypair(uint8_t *pk, uint8_t *sk) b_matrix, b_bytes); Hacl_Impl_Matrix_matrix_to_lbytes((uint32_t)640U, (uint32_t)8U, s_matrix, s_bytes); - Lib_Memzero0_memzero(s_matrix, (uint32_t)5120U * sizeof (s_matrix[0U])); - Lib_Memzero0_memzero(e_matrix, (uint32_t)5120U * sizeof (e_matrix[0U])); + Lib_Memzero0_memzero(s_matrix, (uint32_t)5120U, uint16_t); + Lib_Memzero0_memzero(e_matrix, (uint32_t)5120U, uint16_t); uint32_t slen1 = (uint32_t)19872U; uint8_t *sk_p = sk; memcpy(sk_p, s, (uint32_t)16U * sizeof (uint8_t)); memcpy(sk_p + (uint32_t)16U, pk, (uint32_t)9616U * sizeof (uint8_t)); Hacl_SHA3_shake128_hacl((uint32_t)9616U, pk, (uint32_t)16U, sk + slen1); - Lib_Memzero0_memzero(coins, (uint32_t)48U * sizeof (coins[0U])); + Lib_Memzero0_memzero(coins, (uint32_t)48U, uint8_t); return (uint32_t)0U; } @@ -112,7 +113,7 @@ uint32_t Hacl_Frodo640_crypto_kem_enc(uint8_t *ct, uint8_t *ss, uint8_t *pk) shake_input_seed_se[0U] = (uint8_t)0x96U; memcpy(shake_input_seed_se + (uint32_t)1U, seed_se, (uint32_t)16U * sizeof (uint8_t)); Hacl_SHA3_shake128_hacl((uint32_t)17U, shake_input_seed_se, (uint32_t)20608U, r); - Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)17U * sizeof (shake_input_seed_se[0U])); + Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)17U, uint8_t); Hacl_Impl_Frodo_Sample_frodo_sample_matrix640((uint32_t)8U, (uint32_t)640U, r, sp_matrix); Hacl_Impl_Frodo_Sample_frodo_sample_matrix640((uint32_t)8U, (uint32_t)640U, @@ -156,12 +157,12 @@ uint32_t Hacl_Frodo640_crypto_kem_enc(uint8_t *ct, uint8_t *ss, uint8_t *pk) coins, mu_encode); Hacl_Impl_Matrix_matrix_add((uint32_t)8U, (uint32_t)8U, v_matrix, mu_encode); - Lib_Memzero0_memzero(mu_encode, (uint32_t)64U * sizeof (mu_encode[0U])); + Lib_Memzero0_memzero(mu_encode, (uint32_t)64U, uint16_t); Hacl_Impl_Frodo_Pack_frodo_pack((uint32_t)8U, (uint32_t)8U, (uint32_t)15U, v_matrix, c2); - Lib_Memzero0_memzero(v_matrix, (uint32_t)64U * sizeof (v_matrix[0U])); - Lib_Memzero0_memzero(sp_matrix, (uint32_t)5120U * sizeof (sp_matrix[0U])); - Lib_Memzero0_memzero(ep_matrix, (uint32_t)5120U * sizeof (ep_matrix[0U])); - Lib_Memzero0_memzero(epp_matrix, (uint32_t)64U * sizeof (epp_matrix[0U])); + Lib_Memzero0_memzero(v_matrix, (uint32_t)64U, uint16_t); + Lib_Memzero0_memzero(sp_matrix, (uint32_t)5120U, uint16_t); + Lib_Memzero0_memzero(ep_matrix, (uint32_t)5120U, uint16_t); + Lib_Memzero0_memzero(epp_matrix, (uint32_t)64U, uint16_t); uint32_t ss_init_len = (uint32_t)9736U; KRML_CHECK_SIZE(sizeof (uint8_t), ss_init_len); uint8_t *shake_input_ss = (uint8_t *)alloca(ss_init_len * sizeof (uint8_t)); @@ -169,9 +170,9 @@ uint32_t Hacl_Frodo640_crypto_kem_enc(uint8_t *ct, uint8_t *ss, uint8_t *pk) memcpy(shake_input_ss, ct, (uint32_t)9720U * sizeof (uint8_t)); memcpy(shake_input_ss + (uint32_t)9720U, k, (uint32_t)16U * sizeof (uint8_t)); Hacl_SHA3_shake128_hacl(ss_init_len, shake_input_ss, (uint32_t)16U, ss); - Lib_Memzero0_memzero(shake_input_ss, ss_init_len * sizeof (shake_input_ss[0U])); - Lib_Memzero0_memzero(seed_se_k, (uint32_t)32U * sizeof (seed_se_k[0U])); - Lib_Memzero0_memzero(coins, (uint32_t)16U * sizeof (coins[0U])); + Lib_Memzero0_memzero(shake_input_ss, ss_init_len, uint8_t); + Lib_Memzero0_memzero(seed_se_k, (uint32_t)32U, uint8_t); + Lib_Memzero0_memzero(coins, (uint32_t)16U, uint8_t); return (uint32_t)0U; } @@ -200,8 +201,8 @@ uint32_t Hacl_Frodo640_crypto_kem_dec(uint8_t *ss, uint8_t *ct, uint8_t *sk) (uint32_t)8U, m_matrix, mu_decode); - Lib_Memzero0_memzero(s_matrix, (uint32_t)5120U * sizeof (s_matrix[0U])); - Lib_Memzero0_memzero(m_matrix, (uint32_t)64U * sizeof (m_matrix[0U])); + Lib_Memzero0_memzero(s_matrix, (uint32_t)5120U, uint16_t); + Lib_Memzero0_memzero(m_matrix, (uint32_t)64U, uint16_t); uint8_t seed_se_k[32U] = { 0U }; uint32_t pkh_mu_decode_len = (uint32_t)32U; KRML_CHECK_SIZE(sizeof (uint8_t), pkh_mu_decode_len); @@ -224,7 +225,7 @@ uint32_t Hacl_Frodo640_crypto_kem_dec(uint8_t *ss, uint8_t *ct, uint8_t *sk) shake_input_seed_se[0U] = (uint8_t)0x96U; memcpy(shake_input_seed_se + (uint32_t)1U, seed_se, (uint32_t)16U * sizeof (uint8_t)); Hacl_SHA3_shake128_hacl((uint32_t)17U, shake_input_seed_se, (uint32_t)20608U, r); - Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)17U * sizeof (shake_input_seed_se[0U])); + Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)17U, uint8_t); Hacl_Impl_Frodo_Sample_frodo_sample_matrix640((uint32_t)8U, (uint32_t)640U, r, sp_matrix); Hacl_Impl_Frodo_Sample_frodo_sample_matrix640((uint32_t)8U, (uint32_t)640U, @@ -266,12 +267,12 @@ uint32_t Hacl_Frodo640_crypto_kem_dec(uint8_t *ss, uint8_t *ct, uint8_t *sk) mu_decode, mu_encode); Hacl_Impl_Matrix_matrix_add((uint32_t)8U, (uint32_t)8U, cp_matrix, mu_encode); - Lib_Memzero0_memzero(mu_encode, (uint32_t)64U * sizeof (mu_encode[0U])); + Lib_Memzero0_memzero(mu_encode, (uint32_t)64U, uint16_t); Hacl_Impl_Matrix_mod_pow2((uint32_t)8U, (uint32_t)640U, (uint32_t)15U, bpp_matrix); Hacl_Impl_Matrix_mod_pow2((uint32_t)8U, (uint32_t)8U, (uint32_t)15U, cp_matrix); - Lib_Memzero0_memzero(sp_matrix, (uint32_t)5120U * sizeof (sp_matrix[0U])); - Lib_Memzero0_memzero(ep_matrix, (uint32_t)5120U * sizeof (ep_matrix[0U])); - Lib_Memzero0_memzero(epp_matrix, (uint32_t)64U * sizeof (epp_matrix[0U])); + Lib_Memzero0_memzero(sp_matrix, (uint32_t)5120U, uint16_t); + Lib_Memzero0_memzero(ep_matrix, (uint32_t)5120U, uint16_t); + Lib_Memzero0_memzero(epp_matrix, (uint32_t)64U, uint16_t); uint16_t b1 = Hacl_Impl_Matrix_matrix_eq((uint32_t)8U, (uint32_t)640U, bp_matrix, bpp_matrix); uint16_t b2 = Hacl_Impl_Matrix_matrix_eq((uint32_t)8U, (uint32_t)8U, c_matrix, cp_matrix); uint16_t mask = b1 & b2; @@ -292,10 +293,10 @@ uint32_t Hacl_Frodo640_crypto_kem_dec(uint8_t *ss, uint8_t *ct, uint8_t *sk) memcpy(ss_init, ct, (uint32_t)9720U * sizeof (uint8_t)); memcpy(ss_init + (uint32_t)9720U, kp_s, (uint32_t)16U * sizeof (uint8_t)); Hacl_SHA3_shake128_hacl(ss_init_len, ss_init, (uint32_t)16U, ss); - Lib_Memzero0_memzero(ss_init, ss_init_len * sizeof (ss_init[0U])); - Lib_Memzero0_memzero(kp_s, (uint32_t)16U * sizeof (kp_s[0U])); - Lib_Memzero0_memzero(seed_se_k, (uint32_t)32U * sizeof (seed_se_k[0U])); - Lib_Memzero0_memzero(mu_decode, (uint32_t)16U * sizeof (mu_decode[0U])); + Lib_Memzero0_memzero(ss_init, ss_init_len, uint8_t); + Lib_Memzero0_memzero(kp_s, (uint32_t)16U, uint8_t); + Lib_Memzero0_memzero(seed_se_k, (uint32_t)32U, uint8_t); + Lib_Memzero0_memzero(mu_decode, (uint32_t)16U, uint8_t); return (uint32_t)0U; } diff --git a/src/msvc/Hacl_Frodo976.c b/src/msvc/Hacl_Frodo976.c index 34a7226c..dbd9bc32 100644 --- a/src/msvc/Hacl_Frodo976.c +++ b/src/msvc/Hacl_Frodo976.c @@ -27,6 +27,7 @@ #include "internal/Hacl_Spec.h" #include "internal/Hacl_Frodo_KEM.h" +#include "lib_memzero0.h" uint32_t Hacl_Frodo976_crypto_bytes = (uint32_t)24U; @@ -54,7 +55,7 @@ uint32_t Hacl_Frodo976_crypto_kem_keypair(uint8_t *pk, uint8_t *sk) shake_input_seed_se[0U] = (uint8_t)0x5fU; memcpy(shake_input_seed_se + (uint32_t)1U, seed_se, (uint32_t)24U * sizeof (uint8_t)); Hacl_SHA3_shake256_hacl((uint32_t)25U, shake_input_seed_se, (uint32_t)31232U, r); - Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)25U * sizeof (shake_input_seed_se[0U])); + Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)25U, uint8_t); Hacl_Impl_Frodo_Sample_frodo_sample_matrix976((uint32_t)976U, (uint32_t)8U, r, s_matrix); Hacl_Impl_Frodo_Sample_frodo_sample_matrix976((uint32_t)976U, (uint32_t)8U, @@ -80,14 +81,14 @@ uint32_t Hacl_Frodo976_crypto_kem_keypair(uint8_t *pk, uint8_t *sk) b_matrix, b_bytes); Hacl_Impl_Matrix_matrix_to_lbytes((uint32_t)976U, (uint32_t)8U, s_matrix, s_bytes); - Lib_Memzero0_memzero(s_matrix, (uint32_t)7808U * sizeof (s_matrix[0U])); - Lib_Memzero0_memzero(e_matrix, (uint32_t)7808U * sizeof (e_matrix[0U])); + Lib_Memzero0_memzero(s_matrix, (uint32_t)7808U, uint16_t); + Lib_Memzero0_memzero(e_matrix, (uint32_t)7808U, uint16_t); uint32_t slen1 = (uint32_t)31272U; uint8_t *sk_p = sk; memcpy(sk_p, s, (uint32_t)24U * sizeof (uint8_t)); memcpy(sk_p + (uint32_t)24U, pk, (uint32_t)15632U * sizeof (uint8_t)); Hacl_SHA3_shake256_hacl((uint32_t)15632U, pk, (uint32_t)24U, sk + slen1); - Lib_Memzero0_memzero(coins, (uint32_t)64U * sizeof (coins[0U])); + Lib_Memzero0_memzero(coins, (uint32_t)64U, uint8_t); return (uint32_t)0U; } @@ -112,7 +113,7 @@ uint32_t Hacl_Frodo976_crypto_kem_enc(uint8_t *ct, uint8_t *ss, uint8_t *pk) shake_input_seed_se[0U] = (uint8_t)0x96U; memcpy(shake_input_seed_se + (uint32_t)1U, seed_se, (uint32_t)24U * sizeof (uint8_t)); Hacl_SHA3_shake256_hacl((uint32_t)25U, shake_input_seed_se, (uint32_t)31360U, r); - Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)25U * sizeof (shake_input_seed_se[0U])); + Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)25U, uint8_t); Hacl_Impl_Frodo_Sample_frodo_sample_matrix976((uint32_t)8U, (uint32_t)976U, r, sp_matrix); Hacl_Impl_Frodo_Sample_frodo_sample_matrix976((uint32_t)8U, (uint32_t)976U, @@ -156,12 +157,12 @@ uint32_t Hacl_Frodo976_crypto_kem_enc(uint8_t *ct, uint8_t *ss, uint8_t *pk) coins, mu_encode); Hacl_Impl_Matrix_matrix_add((uint32_t)8U, (uint32_t)8U, v_matrix, mu_encode); - Lib_Memzero0_memzero(mu_encode, (uint32_t)64U * sizeof (mu_encode[0U])); + Lib_Memzero0_memzero(mu_encode, (uint32_t)64U, uint16_t); Hacl_Impl_Frodo_Pack_frodo_pack((uint32_t)8U, (uint32_t)8U, (uint32_t)16U, v_matrix, c2); - Lib_Memzero0_memzero(v_matrix, (uint32_t)64U * sizeof (v_matrix[0U])); - Lib_Memzero0_memzero(sp_matrix, (uint32_t)7808U * sizeof (sp_matrix[0U])); - Lib_Memzero0_memzero(ep_matrix, (uint32_t)7808U * sizeof (ep_matrix[0U])); - Lib_Memzero0_memzero(epp_matrix, (uint32_t)64U * sizeof (epp_matrix[0U])); + Lib_Memzero0_memzero(v_matrix, (uint32_t)64U, uint16_t); + Lib_Memzero0_memzero(sp_matrix, (uint32_t)7808U, uint16_t); + Lib_Memzero0_memzero(ep_matrix, (uint32_t)7808U, uint16_t); + Lib_Memzero0_memzero(epp_matrix, (uint32_t)64U, uint16_t); uint32_t ss_init_len = (uint32_t)15768U; KRML_CHECK_SIZE(sizeof (uint8_t), ss_init_len); uint8_t *shake_input_ss = (uint8_t *)alloca(ss_init_len * sizeof (uint8_t)); @@ -169,9 +170,9 @@ uint32_t Hacl_Frodo976_crypto_kem_enc(uint8_t *ct, uint8_t *ss, uint8_t *pk) memcpy(shake_input_ss, ct, (uint32_t)15744U * sizeof (uint8_t)); memcpy(shake_input_ss + (uint32_t)15744U, k, (uint32_t)24U * sizeof (uint8_t)); Hacl_SHA3_shake256_hacl(ss_init_len, shake_input_ss, (uint32_t)24U, ss); - Lib_Memzero0_memzero(shake_input_ss, ss_init_len * sizeof (shake_input_ss[0U])); - Lib_Memzero0_memzero(seed_se_k, (uint32_t)48U * sizeof (seed_se_k[0U])); - Lib_Memzero0_memzero(coins, (uint32_t)24U * sizeof (coins[0U])); + Lib_Memzero0_memzero(shake_input_ss, ss_init_len, uint8_t); + Lib_Memzero0_memzero(seed_se_k, (uint32_t)48U, uint8_t); + Lib_Memzero0_memzero(coins, (uint32_t)24U, uint8_t); return (uint32_t)0U; } @@ -200,8 +201,8 @@ uint32_t Hacl_Frodo976_crypto_kem_dec(uint8_t *ss, uint8_t *ct, uint8_t *sk) (uint32_t)8U, m_matrix, mu_decode); - Lib_Memzero0_memzero(s_matrix, (uint32_t)7808U * sizeof (s_matrix[0U])); - Lib_Memzero0_memzero(m_matrix, (uint32_t)64U * sizeof (m_matrix[0U])); + Lib_Memzero0_memzero(s_matrix, (uint32_t)7808U, uint16_t); + Lib_Memzero0_memzero(m_matrix, (uint32_t)64U, uint16_t); uint8_t seed_se_k[48U] = { 0U }; uint32_t pkh_mu_decode_len = (uint32_t)48U; KRML_CHECK_SIZE(sizeof (uint8_t), pkh_mu_decode_len); @@ -224,7 +225,7 @@ uint32_t Hacl_Frodo976_crypto_kem_dec(uint8_t *ss, uint8_t *ct, uint8_t *sk) shake_input_seed_se[0U] = (uint8_t)0x96U; memcpy(shake_input_seed_se + (uint32_t)1U, seed_se, (uint32_t)24U * sizeof (uint8_t)); Hacl_SHA3_shake256_hacl((uint32_t)25U, shake_input_seed_se, (uint32_t)31360U, r); - Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)25U * sizeof (shake_input_seed_se[0U])); + Lib_Memzero0_memzero(shake_input_seed_se, (uint32_t)25U, uint8_t); Hacl_Impl_Frodo_Sample_frodo_sample_matrix976((uint32_t)8U, (uint32_t)976U, r, sp_matrix); Hacl_Impl_Frodo_Sample_frodo_sample_matrix976((uint32_t)8U, (uint32_t)976U, @@ -266,12 +267,12 @@ uint32_t Hacl_Frodo976_crypto_kem_dec(uint8_t *ss, uint8_t *ct, uint8_t *sk) mu_decode, mu_encode); Hacl_Impl_Matrix_matrix_add((uint32_t)8U, (uint32_t)8U, cp_matrix, mu_encode); - Lib_Memzero0_memzero(mu_encode, (uint32_t)64U * sizeof (mu_encode[0U])); + Lib_Memzero0_memzero(mu_encode, (uint32_t)64U, uint16_t); Hacl_Impl_Matrix_mod_pow2((uint32_t)8U, (uint32_t)976U, (uint32_t)16U, bpp_matrix); Hacl_Impl_Matrix_mod_pow2((uint32_t)8U, (uint32_t)8U, (uint32_t)16U, cp_matrix); - Lib_Memzero0_memzero(sp_matrix, (uint32_t)7808U * sizeof (sp_matrix[0U])); - Lib_Memzero0_memzero(ep_matrix, (uint32_t)7808U * sizeof (ep_matrix[0U])); - Lib_Memzero0_memzero(epp_matrix, (uint32_t)64U * sizeof (epp_matrix[0U])); + Lib_Memzero0_memzero(sp_matrix, (uint32_t)7808U, uint16_t); + Lib_Memzero0_memzero(ep_matrix, (uint32_t)7808U, uint16_t); + Lib_Memzero0_memzero(epp_matrix, (uint32_t)64U, uint16_t); uint16_t b1 = Hacl_Impl_Matrix_matrix_eq((uint32_t)8U, (uint32_t)976U, bp_matrix, bpp_matrix); uint16_t b2 = Hacl_Impl_Matrix_matrix_eq((uint32_t)8U, (uint32_t)8U, c_matrix, cp_matrix); uint16_t mask = b1 & b2; @@ -291,10 +292,10 @@ uint32_t Hacl_Frodo976_crypto_kem_dec(uint8_t *ss, uint8_t *ct, uint8_t *sk) memcpy(ss_init, ct, (uint32_t)15744U * sizeof (uint8_t)); memcpy(ss_init + (uint32_t)15744U, kp_s, (uint32_t)24U * sizeof (uint8_t)); Hacl_SHA3_shake256_hacl(ss_init_len, ss_init, (uint32_t)24U, ss); - Lib_Memzero0_memzero(ss_init, ss_init_len * sizeof (ss_init[0U])); - Lib_Memzero0_memzero(kp_s, (uint32_t)24U * sizeof (kp_s[0U])); - Lib_Memzero0_memzero(seed_se_k, (uint32_t)48U * sizeof (seed_se_k[0U])); - Lib_Memzero0_memzero(mu_decode, (uint32_t)24U * sizeof (mu_decode[0U])); + Lib_Memzero0_memzero(ss_init, ss_init_len, uint8_t); + Lib_Memzero0_memzero(kp_s, (uint32_t)24U, uint8_t); + Lib_Memzero0_memzero(seed_se_k, (uint32_t)48U, uint8_t); + Lib_Memzero0_memzero(mu_decode, (uint32_t)24U, uint8_t); return (uint32_t)0U; } diff --git a/src/msvc/Hacl_GenericField32.c b/src/msvc/Hacl_GenericField32.c index 1801e114..47ca15e8 100644 --- a/src/msvc/Hacl_GenericField32.c +++ b/src/msvc/Hacl_GenericField32.c @@ -614,6 +614,7 @@ Hacl_GenericField32_inverse( { c1 = c0; } + KRML_HOST_IGNORE(c1); Hacl_GenericField32_exp_vartime(k, aM, k1.len * (uint32_t)32U, n2, aInvM); } diff --git a/src/msvc/Hacl_GenericField64.c b/src/msvc/Hacl_GenericField64.c index 97b3517e..e8084285 100644 --- a/src/msvc/Hacl_GenericField64.c +++ b/src/msvc/Hacl_GenericField64.c @@ -613,6 +613,7 @@ Hacl_GenericField64_inverse( { c1 = c0; } + KRML_HOST_IGNORE(c1); Hacl_GenericField64_exp_vartime(k, aM, k1.len * (uint32_t)64U, n2, aInvM); } diff --git a/src/msvc/Hacl_HMAC.c b/src/msvc/Hacl_HMAC.c index 51032fb2..d46c4812 100644 --- a/src/msvc/Hacl_HMAC.c +++ b/src/msvc/Hacl_HMAC.c @@ -49,16 +49,18 @@ Hacl_HMAC_legacy_compute_sha1( KRML_CHECK_SIZE(sizeof (uint8_t), l); uint8_t *key_block = (uint8_t *)alloca(l * sizeof (uint8_t)); memset(key_block, 0U, l * sizeof (uint8_t)); - uint32_t i0; + uint8_t *nkey = key_block; + uint32_t ite; if (key_len <= (uint32_t)64U) { - i0 = key_len; + ite = key_len; } else { - i0 = (uint32_t)20U; + ite = (uint32_t)20U; } - uint8_t *nkey = key_block; + uint8_t *zeroes = key_block + ite; + KRML_HOST_IGNORE(zeroes); if (key_len <= (uint32_t)64U) { memcpy(nkey, key, key_len * sizeof (uint8_t)); @@ -173,16 +175,18 @@ Hacl_HMAC_compute_sha2_256( KRML_CHECK_SIZE(sizeof (uint8_t), l); uint8_t *key_block = (uint8_t *)alloca(l * sizeof (uint8_t)); memset(key_block, 0U, l * sizeof (uint8_t)); - uint32_t i0; + uint8_t *nkey = key_block; + uint32_t ite; if (key_len <= (uint32_t)64U) { - i0 = key_len; + ite = key_len; } else { - i0 = (uint32_t)32U; + ite = (uint32_t)32U; } - uint8_t *nkey = key_block; + uint8_t *zeroes = key_block + ite; + KRML_HOST_IGNORE(zeroes); if (key_len <= (uint32_t)64U) { memcpy(nkey, key, key_len * sizeof (uint8_t)); @@ -307,16 +311,18 @@ Hacl_HMAC_compute_sha2_384( KRML_CHECK_SIZE(sizeof (uint8_t), l); uint8_t *key_block = (uint8_t *)alloca(l * sizeof (uint8_t)); memset(key_block, 0U, l * sizeof (uint8_t)); - uint32_t i0; + uint8_t *nkey = key_block; + uint32_t ite; if (key_len <= (uint32_t)128U) { - i0 = key_len; + ite = key_len; } else { - i0 = (uint32_t)48U; + ite = (uint32_t)48U; } - uint8_t *nkey = key_block; + uint8_t *zeroes = key_block + ite; + KRML_HOST_IGNORE(zeroes); if (key_len <= (uint32_t)128U) { memcpy(nkey, key, key_len * sizeof (uint8_t)); @@ -442,16 +448,18 @@ Hacl_HMAC_compute_sha2_512( KRML_CHECK_SIZE(sizeof (uint8_t), l); uint8_t *key_block = (uint8_t *)alloca(l * sizeof (uint8_t)); memset(key_block, 0U, l * sizeof (uint8_t)); - uint32_t i0; + uint8_t *nkey = key_block; + uint32_t ite; if (key_len <= (uint32_t)128U) { - i0 = key_len; + ite = key_len; } else { - i0 = (uint32_t)64U; + ite = (uint32_t)64U; } - uint8_t *nkey = key_block; + uint8_t *zeroes = key_block + ite; + KRML_HOST_IGNORE(zeroes); if (key_len <= (uint32_t)128U) { memcpy(nkey, key, key_len * sizeof (uint8_t)); @@ -577,16 +585,18 @@ Hacl_HMAC_compute_blake2s_32( KRML_CHECK_SIZE(sizeof (uint8_t), l); uint8_t *key_block = (uint8_t *)alloca(l * sizeof (uint8_t)); memset(key_block, 0U, l * sizeof (uint8_t)); - uint32_t i0; + uint8_t *nkey = key_block; + uint32_t ite; if (key_len <= (uint32_t)64U) { - i0 = key_len; + ite = key_len; } else { - i0 = (uint32_t)32U; + ite = (uint32_t)32U; } - uint8_t *nkey = key_block; + uint8_t *zeroes = key_block + ite; + KRML_HOST_IGNORE(zeroes); if (key_len <= (uint32_t)64U) { memcpy(nkey, key, key_len * sizeof (uint8_t)); @@ -719,16 +729,18 @@ Hacl_HMAC_compute_blake2b_32( KRML_CHECK_SIZE(sizeof (uint8_t), l); uint8_t *key_block = (uint8_t *)alloca(l * sizeof (uint8_t)); memset(key_block, 0U, l * sizeof (uint8_t)); - uint32_t i0; + uint8_t *nkey = key_block; + uint32_t ite; if (key_len <= (uint32_t)128U) { - i0 = key_len; + ite = key_len; } else { - i0 = (uint32_t)64U; + ite = (uint32_t)64U; } - uint8_t *nkey = key_block; + uint8_t *zeroes = key_block + ite; + KRML_HOST_IGNORE(zeroes); if (key_len <= (uint32_t)128U) { memcpy(nkey, key, key_len * sizeof (uint8_t)); diff --git a/src/msvc/Hacl_HMAC_Blake2b_256.c b/src/msvc/Hacl_HMAC_Blake2b_256.c index 4b5fc1a0..20b050de 100644 --- a/src/msvc/Hacl_HMAC_Blake2b_256.c +++ b/src/msvc/Hacl_HMAC_Blake2b_256.c @@ -47,16 +47,18 @@ Hacl_HMAC_Blake2b_256_compute_blake2b_256( KRML_CHECK_SIZE(sizeof (uint8_t), l); uint8_t *key_block = (uint8_t *)alloca(l * sizeof (uint8_t)); memset(key_block, 0U, l * sizeof (uint8_t)); - uint32_t i0; + uint8_t *nkey = key_block; + uint32_t ite; if (key_len <= (uint32_t)128U) { - i0 = key_len; + ite = key_len; } else { - i0 = (uint32_t)64U; + ite = (uint32_t)64U; } - uint8_t *nkey = key_block; + uint8_t *zeroes = key_block + ite; + KRML_HOST_IGNORE(zeroes); if (key_len <= (uint32_t)128U) { memcpy(nkey, key, key_len * sizeof (uint8_t)); diff --git a/src/msvc/Hacl_HMAC_Blake2s_128.c b/src/msvc/Hacl_HMAC_Blake2s_128.c index 8980e9be..144722e4 100644 --- a/src/msvc/Hacl_HMAC_Blake2s_128.c +++ b/src/msvc/Hacl_HMAC_Blake2s_128.c @@ -46,16 +46,18 @@ Hacl_HMAC_Blake2s_128_compute_blake2s_128( KRML_CHECK_SIZE(sizeof (uint8_t), l); uint8_t *key_block = (uint8_t *)alloca(l * sizeof (uint8_t)); memset(key_block, 0U, l * sizeof (uint8_t)); - uint32_t i0; + uint8_t *nkey = key_block; + uint32_t ite; if (key_len <= (uint32_t)64U) { - i0 = key_len; + ite = key_len; } else { - i0 = (uint32_t)32U; + ite = (uint32_t)32U; } - uint8_t *nkey = key_block; + uint8_t *zeroes = key_block + ite; + KRML_HOST_IGNORE(zeroes); if (key_len <= (uint32_t)64U) { memcpy(nkey, key, key_len * sizeof (uint8_t)); diff --git a/src/msvc/Hacl_HMAC_DRBG.c b/src/msvc/Hacl_HMAC_DRBG.c index b307ee21..93e47dc9 100644 --- a/src/msvc/Hacl_HMAC_DRBG.c +++ b/src/msvc/Hacl_HMAC_DRBG.c @@ -469,10 +469,9 @@ Hacl_HMAC_DRBG_reseed( memcpy(seed_material + entropy_input_len, additional_input_input, additional_input_input_len * sizeof (uint8_t)); - Hacl_HMAC_DRBG_state uu____0 = st; - uint8_t *k = uu____0.k; - uint8_t *v = uu____0.v; - uint32_t *ctr = uu____0.reseed_counter; + uint8_t *k = st.k; + uint8_t *v = st.v; + uint32_t *ctr = st.reseed_counter; uint32_t input_len = (uint32_t)21U + entropy_input_len + additional_input_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len); uint8_t *input0 = (uint8_t *)alloca(input_len * sizeof (uint8_t)); @@ -524,10 +523,9 @@ Hacl_HMAC_DRBG_reseed( memcpy(seed_material + entropy_input_len, additional_input_input, additional_input_input_len * sizeof (uint8_t)); - Hacl_HMAC_DRBG_state uu____1 = st; - uint8_t *k = uu____1.k; - uint8_t *v = uu____1.v; - uint32_t *ctr = uu____1.reseed_counter; + uint8_t *k = st.k; + uint8_t *v = st.v; + uint32_t *ctr = st.reseed_counter; uint32_t input_len = (uint32_t)33U + entropy_input_len + additional_input_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len); uint8_t *input0 = (uint8_t *)alloca(input_len * sizeof (uint8_t)); @@ -579,10 +577,9 @@ Hacl_HMAC_DRBG_reseed( memcpy(seed_material + entropy_input_len, additional_input_input, additional_input_input_len * sizeof (uint8_t)); - Hacl_HMAC_DRBG_state uu____2 = st; - uint8_t *k = uu____2.k; - uint8_t *v = uu____2.v; - uint32_t *ctr = uu____2.reseed_counter; + uint8_t *k = st.k; + uint8_t *v = st.v; + uint32_t *ctr = st.reseed_counter; uint32_t input_len = (uint32_t)49U + entropy_input_len + additional_input_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len); uint8_t *input0 = (uint8_t *)alloca(input_len * sizeof (uint8_t)); @@ -634,10 +631,9 @@ Hacl_HMAC_DRBG_reseed( memcpy(seed_material + entropy_input_len, additional_input_input, additional_input_input_len * sizeof (uint8_t)); - Hacl_HMAC_DRBG_state uu____3 = st; - uint8_t *k = uu____3.k; - uint8_t *v = uu____3.v; - uint32_t *ctr = uu____3.reseed_counter; + uint8_t *k = st.k; + uint8_t *v = st.v; + uint32_t *ctr = st.reseed_counter; uint32_t input_len = (uint32_t)65U + entropy_input_len + additional_input_input_len; KRML_CHECK_SIZE(sizeof (uint8_t), input_len); uint8_t *input0 = (uint8_t *)alloca(input_len * sizeof (uint8_t)); diff --git a/src/msvc/Hacl_Hash_Blake2.c b/src/msvc/Hacl_Hash_Blake2.c index 6080585c..194e7157 100644 --- a/src/msvc/Hacl_Hash_Blake2.c +++ b/src/msvc/Hacl_Hash_Blake2.c @@ -26,6 +26,7 @@ #include "internal/Hacl_Hash_Blake2.h" #include "internal/Hacl_Impl_Blake2_Constants.h" +#include "lib_memzero0.h" static void blake2b_update_block( @@ -531,7 +532,7 @@ Hacl_Blake2b_32_blake2b_update_key( { blake2b_update_block(wv, hash, false, lb, b); } - Lib_Memzero0_memzero(b, (uint32_t)128U * sizeof (b[0U])); + Lib_Memzero0_memzero(b, (uint32_t)128U, uint8_t); } void @@ -571,7 +572,7 @@ Hacl_Blake2b_32_blake2b_update_last( FStar_UInt128_uint128 totlen = FStar_UInt128_add_mod(prev, FStar_UInt128_uint64_to_uint128((uint64_t)len)); blake2b_update_block(wv, hash, true, totlen, b); - Lib_Memzero0_memzero(b, (uint32_t)128U * sizeof (b[0U])); + Lib_Memzero0_memzero(b, (uint32_t)128U, uint8_t); } static void @@ -642,7 +643,7 @@ void Hacl_Blake2b_32_blake2b_finish(uint32_t nn, uint8_t *output, uint64_t *hash store64_le(second + i * (uint32_t)8U, row1[i]);); uint8_t *final = b; memcpy(output, final, nn * sizeof (uint8_t)); - Lib_Memzero0_memzero(b, (uint32_t)64U * sizeof (b[0U])); + Lib_Memzero0_memzero(b, (uint32_t)64U, uint8_t); } /** @@ -670,8 +671,8 @@ Hacl_Blake2b_32_blake2b( Hacl_Blake2b_32_blake2b_init(b, kk, nn); blake2b_update(b1, b, kk, k, ll, d); Hacl_Blake2b_32_blake2b_finish(nn, output, b); - Lib_Memzero0_memzero(b1, (uint32_t)16U * sizeof (b1[0U])); - Lib_Memzero0_memzero(b, (uint32_t)16U * sizeof (b[0U])); + Lib_Memzero0_memzero(b1, (uint32_t)16U, uint64_t); + Lib_Memzero0_memzero(b, (uint32_t)16U, uint64_t); } uint64_t *Hacl_Blake2b_32_blake2b_malloc(void) @@ -1178,7 +1179,7 @@ Hacl_Blake2s_32_blake2s_update_key( { blake2s_update_block(wv, hash, false, lb, b); } - Lib_Memzero0_memzero(b, (uint32_t)64U * sizeof (b[0U])); + Lib_Memzero0_memzero(b, (uint32_t)64U, uint8_t); } void @@ -1214,7 +1215,7 @@ Hacl_Blake2s_32_blake2s_update_last( memcpy(b, last, rem * sizeof (uint8_t)); uint64_t totlen = prev + (uint64_t)len; blake2s_update_block(wv, hash, true, totlen, b); - Lib_Memzero0_memzero(b, (uint32_t)64U * sizeof (b[0U])); + Lib_Memzero0_memzero(b, (uint32_t)64U, uint8_t); } static void @@ -1281,7 +1282,7 @@ void Hacl_Blake2s_32_blake2s_finish(uint32_t nn, uint8_t *output, uint32_t *hash store32_le(second + i * (uint32_t)4U, row1[i]);); uint8_t *final = b; memcpy(output, final, nn * sizeof (uint8_t)); - Lib_Memzero0_memzero(b, (uint32_t)32U * sizeof (b[0U])); + Lib_Memzero0_memzero(b, (uint32_t)32U, uint8_t); } /** @@ -1309,8 +1310,8 @@ Hacl_Blake2s_32_blake2s( Hacl_Blake2s_32_blake2s_init(b, kk, nn); blake2s_update(b1, b, kk, k, ll, d); Hacl_Blake2s_32_blake2s_finish(nn, output, b); - Lib_Memzero0_memzero(b1, (uint32_t)16U * sizeof (b1[0U])); - Lib_Memzero0_memzero(b, (uint32_t)16U * sizeof (b[0U])); + Lib_Memzero0_memzero(b1, (uint32_t)16U, uint32_t); + Lib_Memzero0_memzero(b, (uint32_t)16U, uint32_t); } uint32_t *Hacl_Blake2s_32_blake2s_malloc(void) diff --git a/src/msvc/Hacl_Hash_Blake2b_256.c b/src/msvc/Hacl_Hash_Blake2b_256.c index 2761aeb1..d0df7cd8 100644 --- a/src/msvc/Hacl_Hash_Blake2b_256.c +++ b/src/msvc/Hacl_Hash_Blake2b_256.c @@ -27,6 +27,7 @@ #include "internal/Hacl_Impl_Blake2_Constants.h" #include "internal/Hacl_Hash_Blake2.h" +#include "lib_memzero0.h" static inline void blake2b_update_block( @@ -254,7 +255,7 @@ Hacl_Blake2b_256_blake2b_update_key( { blake2b_update_block(wv, hash, false, lb, b); } - Lib_Memzero0_memzero(b, (uint32_t)128U * sizeof (b[0U])); + Lib_Memzero0_memzero(b, (uint32_t)128U, uint8_t); } void @@ -294,7 +295,7 @@ Hacl_Blake2b_256_blake2b_update_last( FStar_UInt128_uint128 totlen = FStar_UInt128_add_mod(prev, FStar_UInt128_uint64_to_uint128((uint64_t)len)); blake2b_update_block(wv, hash, true, totlen, b); - Lib_Memzero0_memzero(b, (uint32_t)128U * sizeof (b[0U])); + Lib_Memzero0_memzero(b, (uint32_t)128U, uint8_t); } static inline void @@ -369,7 +370,7 @@ Hacl_Blake2b_256_blake2b_finish( Lib_IntVector_Intrinsics_vec256_store64_le(second, row1[0U]); uint8_t *final = b; memcpy(output, final, nn * sizeof (uint8_t)); - Lib_Memzero0_memzero(b, (uint32_t)64U * sizeof (b[0U])); + Lib_Memzero0_memzero(b, (uint32_t)64U, uint8_t); } /** @@ -397,8 +398,8 @@ Hacl_Blake2b_256_blake2b( Hacl_Blake2b_256_blake2b_init(b, kk, nn); blake2b_update(b1, b, kk, k, ll, d); Hacl_Blake2b_256_blake2b_finish(nn, output, b); - Lib_Memzero0_memzero(b1, (uint32_t)4U * sizeof (b1[0U])); - Lib_Memzero0_memzero(b, (uint32_t)4U * sizeof (b[0U])); + Lib_Memzero0_memzero(b1, (uint32_t)4U, Lib_IntVector_Intrinsics_vec256); + Lib_Memzero0_memzero(b, (uint32_t)4U, Lib_IntVector_Intrinsics_vec256); } void diff --git a/src/msvc/Hacl_Hash_Blake2s_128.c b/src/msvc/Hacl_Hash_Blake2s_128.c index ce5252cc..5bf06711 100644 --- a/src/msvc/Hacl_Hash_Blake2s_128.c +++ b/src/msvc/Hacl_Hash_Blake2s_128.c @@ -27,6 +27,7 @@ #include "internal/Hacl_Impl_Blake2_Constants.h" #include "internal/Hacl_Hash_Blake2.h" +#include "lib_memzero0.h" static inline void blake2s_update_block( @@ -254,7 +255,7 @@ Hacl_Blake2s_128_blake2s_update_key( { blake2s_update_block(wv, hash, false, lb, b); } - Lib_Memzero0_memzero(b, (uint32_t)64U * sizeof (b[0U])); + Lib_Memzero0_memzero(b, (uint32_t)64U, uint8_t); } void @@ -290,7 +291,7 @@ Hacl_Blake2s_128_blake2s_update_last( memcpy(b, last, rem * sizeof (uint8_t)); uint64_t totlen = prev + (uint64_t)len; blake2s_update_block(wv, hash, true, totlen, b); - Lib_Memzero0_memzero(b, (uint32_t)64U * sizeof (b[0U])); + Lib_Memzero0_memzero(b, (uint32_t)64U, uint8_t); } static inline void @@ -361,7 +362,7 @@ Hacl_Blake2s_128_blake2s_finish( Lib_IntVector_Intrinsics_vec128_store32_le(second, row1[0U]); uint8_t *final = b; memcpy(output, final, nn * sizeof (uint8_t)); - Lib_Memzero0_memzero(b, (uint32_t)32U * sizeof (b[0U])); + Lib_Memzero0_memzero(b, (uint32_t)32U, uint8_t); } /** @@ -389,8 +390,8 @@ Hacl_Blake2s_128_blake2s( Hacl_Blake2s_128_blake2s_init(b, kk, nn); blake2s_update(b1, b, kk, k, ll, d); Hacl_Blake2s_128_blake2s_finish(nn, output, b); - Lib_Memzero0_memzero(b1, (uint32_t)4U * sizeof (b1[0U])); - Lib_Memzero0_memzero(b, (uint32_t)4U * sizeof (b[0U])); + Lib_Memzero0_memzero(b1, (uint32_t)4U, Lib_IntVector_Intrinsics_vec128); + Lib_Memzero0_memzero(b, (uint32_t)4U, Lib_IntVector_Intrinsics_vec128); } void diff --git a/src/msvc/Hacl_Hash_MD5.c b/src/msvc/Hacl_Hash_MD5.c index 222ac824..1b376960 100644 --- a/src/msvc/Hacl_Hash_MD5.c +++ b/src/msvc/Hacl_Hash_MD5.c @@ -1218,6 +1218,7 @@ void Hacl_Streaming_MD5_legacy_init(Hacl_Streaming_MD_state_32 *s) Hacl_Streaming_MD_state_32 scrut = *s; uint8_t *buf = scrut.buf; uint32_t *block_state = scrut.block_state; + KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Hash_Core_MD5_legacy_init(block_state); Hacl_Streaming_MD_state_32 tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; diff --git a/src/msvc/Hacl_Hash_SHA1.c b/src/msvc/Hacl_Hash_SHA1.c index 5ecb3c0b..80edc004 100644 --- a/src/msvc/Hacl_Hash_SHA1.c +++ b/src/msvc/Hacl_Hash_SHA1.c @@ -254,6 +254,7 @@ void Hacl_Streaming_SHA1_legacy_init(Hacl_Streaming_MD_state_32 *s) Hacl_Streaming_MD_state_32 scrut = *s; uint8_t *buf = scrut.buf; uint32_t *block_state = scrut.block_state; + KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Hash_Core_SHA1_legacy_init(block_state); Hacl_Streaming_MD_state_32 tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; diff --git a/src/msvc/Hacl_Hash_SHA2.c b/src/msvc/Hacl_Hash_SHA2.c index c93c3616..46fde83f 100644 --- a/src/msvc/Hacl_Hash_SHA2.c +++ b/src/msvc/Hacl_Hash_SHA2.c @@ -537,6 +537,7 @@ void Hacl_Streaming_SHA2_init_256(Hacl_Streaming_MD_state_32 *s) Hacl_Streaming_MD_state_32 scrut = *s; uint8_t *buf = scrut.buf; uint32_t *block_state = scrut.block_state; + KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_SHA2_Scalar32_sha256_init(block_state); Hacl_Streaming_MD_state_32 tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; @@ -835,6 +836,7 @@ void Hacl_Streaming_SHA2_init_224(Hacl_Streaming_MD_state_32 *s) Hacl_Streaming_MD_state_32 scrut = *s; uint8_t *buf = scrut.buf; uint32_t *block_state = scrut.block_state; + KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_SHA2_Scalar32_sha224_init(block_state); Hacl_Streaming_MD_state_32 tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; @@ -960,6 +962,7 @@ void Hacl_Streaming_SHA2_init_512(Hacl_Streaming_MD_state_64 *s) Hacl_Streaming_MD_state_64 scrut = *s; uint8_t *buf = scrut.buf; uint64_t *block_state = scrut.block_state; + KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_SHA2_Scalar32_sha512_init(block_state); Hacl_Streaming_MD_state_64 tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; @@ -1259,6 +1262,7 @@ void Hacl_Streaming_SHA2_init_384(Hacl_Streaming_MD_state_64 *s) Hacl_Streaming_MD_state_64 scrut = *s; uint8_t *buf = scrut.buf; uint64_t *block_state = scrut.block_state; + KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_SHA2_Scalar32_sha384_init(block_state); Hacl_Streaming_MD_state_64 tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; diff --git a/src/msvc/Hacl_Hash_SHA3.c b/src/msvc/Hacl_Hash_SHA3.c index 42c24434..5f4707f4 100644 --- a/src/msvc/Hacl_Hash_SHA3.c +++ b/src/msvc/Hacl_Hash_SHA3.c @@ -228,6 +228,8 @@ void Hacl_Streaming_Keccak_reset(Hacl_Streaming_Keccak_state *s) Hacl_Streaming_Keccak_state scrut = *s; uint8_t *buf = scrut.buf; Hacl_Streaming_Keccak_hash_buf block_state = scrut.block_state; + Spec_Hash_Definitions_hash_alg i = block_state.fst; + KRML_HOST_IGNORE(i); uint64_t *s1 = block_state.snd; memset(s1, 0U, (uint32_t)25U * sizeof (uint64_t)); Hacl_Streaming_Keccak_state diff --git a/src/msvc/Hacl_K256_ECDSA.c b/src/msvc/Hacl_K256_ECDSA.c index d2266d00..19395653 100644 --- a/src/msvc/Hacl_K256_ECDSA.c +++ b/src/msvc/Hacl_K256_ECDSA.c @@ -215,6 +215,7 @@ static void sub_mod4(uint64_t *n, uint64_t *a, uint64_t *b, uint64_t *res) c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t12, t2, res_i); } uint64_t c1 = c; + KRML_HOST_IGNORE(c1); uint64_t c2 = (uint64_t)0U - c00; KRML_MAYBE_FOR4(i, (uint32_t)0U, @@ -288,6 +289,7 @@ static void sqr4(uint64_t *a, uint64_t *res) uint64_t r = c; res[i0 + i0] = r;); uint64_t c0 = Hacl_Bignum_Addition_bn_add_eq_len_u64((uint32_t)8U, res, res, res); + KRML_HOST_IGNORE(c0); uint64_t tmp[8U] = { 0U }; KRML_MAYBE_FOR4(i, (uint32_t)0U, @@ -299,6 +301,7 @@ static void sqr4(uint64_t *a, uint64_t *res) tmp[(uint32_t)2U * i] = lo; tmp[(uint32_t)2U * i + (uint32_t)1U] = hi;); uint64_t c1 = Hacl_Bignum_Addition_bn_add_eq_len_u64((uint32_t)8U, res, tmp, res); + KRML_HOST_IGNORE(c1); } static inline uint64_t is_qelem_zero(uint64_t *f) @@ -432,6 +435,7 @@ static inline void load_qelem_modq(uint64_t *f, uint8_t *b) static inline void store_qelem(uint8_t *b, uint64_t *f) { uint8_t tmp[32U] = { 0U }; + KRML_HOST_IGNORE(tmp); KRML_MAYBE_FOR4(i, (uint32_t)0U, (uint32_t)4U, diff --git a/src/msvc/Hacl_P256.c b/src/msvc/Hacl_P256.c index 2b6cb11b..7e586e54 100644 --- a/src/msvc/Hacl_P256.c +++ b/src/msvc/Hacl_P256.c @@ -204,6 +204,7 @@ static inline void bn_sub_mod4(uint64_t *res, uint64_t *n, uint64_t *x, uint64_t c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t12, t2, res_i); } uint64_t c1 = c; + KRML_HOST_IGNORE(c1); uint64_t c2 = (uint64_t)0U - c00; KRML_MAYBE_FOR4(i, (uint32_t)0U, @@ -277,6 +278,7 @@ static inline void bn_sqr4(uint64_t *res, uint64_t *x) uint64_t r = c; res[i0 + i0] = r;); uint64_t c0 = Hacl_Bignum_Addition_bn_add_eq_len_u64((uint32_t)8U, res, res, res); + KRML_HOST_IGNORE(c0); uint64_t tmp[8U] = { 0U }; KRML_MAYBE_FOR4(i, (uint32_t)0U, @@ -288,11 +290,13 @@ static inline void bn_sqr4(uint64_t *res, uint64_t *x) tmp[(uint32_t)2U * i] = lo; tmp[(uint32_t)2U * i + (uint32_t)1U] = hi;); uint64_t c1 = Hacl_Bignum_Addition_bn_add_eq_len_u64((uint32_t)8U, res, tmp, res); + KRML_HOST_IGNORE(c1); } static inline void bn_to_bytes_be4(uint8_t *res, uint64_t *f) { uint8_t tmp[32U] = { 0U }; + KRML_HOST_IGNORE(tmp); KRML_MAYBE_FOR4(i, (uint32_t)0U, (uint32_t)4U, @@ -1057,6 +1061,10 @@ static inline void point_mul_g(uint64_t *res, uint64_t *scalar) uint64_t bits_l2 = Hacl_Bignum_Lib_bn_get_bits_u64((uint32_t)1U, r1, k2, (uint32_t)4U); precomp_get_consttime(Hacl_P256_PrecompTable_precomp_basepoint_table_w4, bits_l2, tmp); point_add(res, res, tmp);); + KRML_HOST_IGNORE(q1); + KRML_HOST_IGNORE(q2); + KRML_HOST_IGNORE(q3); + KRML_HOST_IGNORE(q4); } static inline void @@ -1564,6 +1572,7 @@ Hacl_P256_ecdsa_sign_p256_sha2( uint64_t m_q[4U] = { 0U }; uint8_t mHash[32U] = { 0U }; Hacl_Streaming_SHA2_hash_256(msg, msg_len, mHash); + KRML_HOST_IGNORE(msg_len); uint8_t *mHash32 = mHash; bn_from_bytes_be4(m_q, mHash32); qmod_short(m_q, m_q); @@ -1596,6 +1605,7 @@ Hacl_P256_ecdsa_sign_p256_sha384( uint64_t m_q[4U] = { 0U }; uint8_t mHash[48U] = { 0U }; Hacl_Streaming_SHA2_hash_384(msg, msg_len, mHash); + KRML_HOST_IGNORE(msg_len); uint8_t *mHash32 = mHash; bn_from_bytes_be4(m_q, mHash32); qmod_short(m_q, m_q); @@ -1628,6 +1638,7 @@ Hacl_P256_ecdsa_sign_p256_sha512( uint64_t m_q[4U] = { 0U }; uint8_t mHash[64U] = { 0U }; Hacl_Streaming_SHA2_hash_512(msg, msg_len, mHash); + KRML_HOST_IGNORE(msg_len); uint8_t *mHash32 = mHash; bn_from_bytes_be4(m_q, mHash32); qmod_short(m_q, m_q); @@ -1670,6 +1681,7 @@ Hacl_P256_ecdsa_sign_p256_without_hash( uint64_t m_q[4U] = { 0U }; uint8_t mHash[32U] = { 0U }; memcpy(mHash, msg, (uint32_t)32U * sizeof (uint8_t)); + KRML_HOST_IGNORE(msg_len); uint8_t *mHash32 = mHash; bn_from_bytes_be4(m_q, mHash32); qmod_short(m_q, m_q); @@ -1705,6 +1717,7 @@ Hacl_P256_ecdsa_verif_p256_sha2( uint64_t m_q[4U] = { 0U }; uint8_t mHash[32U] = { 0U }; Hacl_Streaming_SHA2_hash_256(msg, msg_len, mHash); + KRML_HOST_IGNORE(msg_len); uint8_t *mHash32 = mHash; bn_from_bytes_be4(m_q, mHash32); qmod_short(m_q, m_q); @@ -1735,6 +1748,7 @@ Hacl_P256_ecdsa_verif_p256_sha384( uint64_t m_q[4U] = { 0U }; uint8_t mHash[48U] = { 0U }; Hacl_Streaming_SHA2_hash_384(msg, msg_len, mHash); + KRML_HOST_IGNORE(msg_len); uint8_t *mHash32 = mHash; bn_from_bytes_be4(m_q, mHash32); qmod_short(m_q, m_q); @@ -1765,6 +1779,7 @@ Hacl_P256_ecdsa_verif_p256_sha512( uint64_t m_q[4U] = { 0U }; uint8_t mHash[64U] = { 0U }; Hacl_Streaming_SHA2_hash_512(msg, msg_len, mHash); + KRML_HOST_IGNORE(msg_len); uint8_t *mHash32 = mHash; bn_from_bytes_be4(m_q, mHash32); qmod_short(m_q, m_q); @@ -1800,6 +1815,7 @@ Hacl_P256_ecdsa_verif_without_hash( uint64_t m_q[4U] = { 0U }; uint8_t mHash[32U] = { 0U }; memcpy(mHash, msg, (uint32_t)32U * sizeof (uint8_t)); + KRML_HOST_IGNORE(msg_len); uint8_t *mHash32 = mHash; bn_from_bytes_be4(m_q, mHash32); qmod_short(m_q, m_q); diff --git a/src/msvc/Hacl_Streaming_Blake2.c b/src/msvc/Hacl_Streaming_Blake2.c index 948d56c2..4faa859e 100644 --- a/src/msvc/Hacl_Streaming_Blake2.c +++ b/src/msvc/Hacl_Streaming_Blake2.c @@ -54,6 +54,7 @@ void Hacl_Streaming_Blake2_blake2s_32_no_key_init(Hacl_Streaming_Blake2_blake2s_ Hacl_Streaming_Blake2_blake2s_32_state scrut = *s1; uint8_t *buf = scrut.buf; Hacl_Streaming_Blake2_blake2s_32_block_state block_state = scrut.block_state; + KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Blake2s_32_blake2s_init(block_state.snd, (uint32_t)0U, (uint32_t)32U); Hacl_Streaming_Blake2_blake2s_32_state tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; @@ -353,6 +354,7 @@ void Hacl_Streaming_Blake2_blake2b_32_no_key_init(Hacl_Streaming_Blake2_blake2b_ Hacl_Streaming_Blake2_blake2b_32_state scrut = *s1; uint8_t *buf = scrut.buf; Hacl_Streaming_Blake2_blake2b_32_block_state block_state = scrut.block_state; + KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Blake2b_32_blake2b_init(block_state.snd, (uint32_t)0U, (uint32_t)64U); Hacl_Streaming_Blake2_blake2b_32_state tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; diff --git a/src/msvc/Hacl_Streaming_Blake2b_256.c b/src/msvc/Hacl_Streaming_Blake2b_256.c index bdb5433f..d2df234a 100644 --- a/src/msvc/Hacl_Streaming_Blake2b_256.c +++ b/src/msvc/Hacl_Streaming_Blake2b_256.c @@ -66,6 +66,7 @@ Hacl_Streaming_Blake2b_256_blake2b_256_no_key_init( Hacl_Streaming_Blake2b_256_blake2b_256_state scrut = *s; uint8_t *buf = scrut.buf; Hacl_Streaming_Blake2b_256_blake2b_256_block_state block_state = scrut.block_state; + KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Blake2b_256_blake2b_init(block_state.snd, (uint32_t)0U, (uint32_t)64U); Hacl_Streaming_Blake2b_256_blake2b_256_state tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; diff --git a/src/msvc/Hacl_Streaming_Blake2s_128.c b/src/msvc/Hacl_Streaming_Blake2s_128.c index f97bf5d0..eaace7ce 100644 --- a/src/msvc/Hacl_Streaming_Blake2s_128.c +++ b/src/msvc/Hacl_Streaming_Blake2s_128.c @@ -66,6 +66,7 @@ Hacl_Streaming_Blake2s_128_blake2s_128_no_key_init( Hacl_Streaming_Blake2s_128_blake2s_128_state scrut = *s; uint8_t *buf = scrut.buf; Hacl_Streaming_Blake2s_128_blake2s_128_block_state block_state = scrut.block_state; + KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Blake2s_128_blake2s_init(block_state.snd, (uint32_t)0U, (uint32_t)32U); Hacl_Streaming_Blake2s_128_blake2s_128_state tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; diff --git a/src/msvc/Hacl_Streaming_Poly1305_128.c b/src/msvc/Hacl_Streaming_Poly1305_128.c index ff60cde2..c752cfb0 100644 --- a/src/msvc/Hacl_Streaming_Poly1305_128.c +++ b/src/msvc/Hacl_Streaming_Poly1305_128.c @@ -58,6 +58,7 @@ Hacl_Streaming_Poly1305_128_init(uint8_t *k, Hacl_Streaming_Poly1305_128_poly130 uint8_t *k_ = scrut.p_key; uint8_t *buf = scrut.buf; Lib_IntVector_Intrinsics_vec128 *block_state = scrut.block_state; + KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Poly1305_128_poly1305_init(block_state, k); memcpy(k_, k, (uint32_t)32U * sizeof (uint8_t)); uint8_t *k_1 = k_; diff --git a/src/msvc/Hacl_Streaming_Poly1305_256.c b/src/msvc/Hacl_Streaming_Poly1305_256.c index 63685f99..c1915ed9 100644 --- a/src/msvc/Hacl_Streaming_Poly1305_256.c +++ b/src/msvc/Hacl_Streaming_Poly1305_256.c @@ -58,6 +58,7 @@ Hacl_Streaming_Poly1305_256_init(uint8_t *k, Hacl_Streaming_Poly1305_256_poly130 uint8_t *k_ = scrut.p_key; uint8_t *buf = scrut.buf; Lib_IntVector_Intrinsics_vec256 *block_state = scrut.block_state; + KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Poly1305_256_poly1305_init(block_state, k); memcpy(k_, k, (uint32_t)32U * sizeof (uint8_t)); uint8_t *k_1 = k_; diff --git a/src/msvc/Hacl_Streaming_Poly1305_32.c b/src/msvc/Hacl_Streaming_Poly1305_32.c index 249a622f..89852727 100644 --- a/src/msvc/Hacl_Streaming_Poly1305_32.c +++ b/src/msvc/Hacl_Streaming_Poly1305_32.c @@ -53,6 +53,7 @@ Hacl_Streaming_Poly1305_32_init(uint8_t *k, Hacl_Streaming_Poly1305_32_poly1305_ uint8_t *k_ = scrut.p_key; uint8_t *buf = scrut.buf; uint64_t *block_state = scrut.block_state; + KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Poly1305_32_poly1305_init(block_state, k); memcpy(k_, k, (uint32_t)32U * sizeof (uint8_t)); uint8_t *k_1 = k_; diff --git a/src/msvc/Lib_Memzero0.c b/src/msvc/Lib_Memzero0.c index 8e225318..3d8a1e5f 100644 --- a/src/msvc/Lib_Memzero0.c +++ b/src/msvc/Lib_Memzero0.c @@ -22,13 +22,14 @@ #include #include -#include "Lib_Memzero0.h" +/* This is now a hand-written header */ +#include "lib_memzero0.h" #include "krml/internal/target.h" /* The F* formalization talks about the number of elements in the array. The C implementation wants a number of bytes in the array. KaRaMeL is aware of this and inserts a sizeof multiplication. */ -void Lib_Memzero0_memzero(void *dst, uint64_t len) { +void Lib_Memzero0_memzero0(void *dst, uint64_t len) { /* This is safe: karamel checks at run-time (if needed) that all object sizes fit within a size_t, so the size we receive has been checked at allocation-time, possibly via KRML_CHECK_SIZE, to fit in a size_t. */ diff --git a/src/wasm/EverCrypt_Hash.wasm b/src/wasm/EverCrypt_Hash.wasm index 843f2e857135bff6c07c504916c16854b061277e..6b1a6c3fcd7de9879f50ecfa716db8f695b4acdf 100644 GIT binary patch delta 177 zcmZ3}$b7Gnd4n@Q7=*tQLzh6HqwENptf|rwxoO%8Wpsr;F0&e3y(^2=DqrrOkgA#;`$DMy^oW zT)#q*m+|N1gf;sO9>nKOI< delta 156 zcmccD$h@YJd4n@QRd8nC%;+<}fY z>|3G8%Xn?_hOKUse{EG_Rc2BUD4Z;}O^KO@n|pG^HlPTj0#D)Onr#Z3*K9N50sx`= BFxdbA diff --git a/src/wasm/Hacl_Bignum.wasm b/src/wasm/Hacl_Bignum.wasm index c0b9d97a839de4f0a1a78f539696113f7f47d377..579c0d56f1da11845ae83f0630d77869216c5fb2 100644 GIT binary patch delta 10057 zcmZ{q33yh;)yLnNH%K6AK~^d18KHnk*#&Dsd9kMDc|O{&l|G+ZK@_Prp(tS0YQha9 zVGD$W%M$io*04o3*;HhgeczN#HW$PVMAYwp=FZ%?Z=Uvnym{x`x$`?S^FMRv&dK(3 zDeruevLwB7#j|_za$@yo_?;_1DsJoFi@LA12Rk=ETI*8OVmDVx!NqVYLET-N} z#8g(i17%UuPAMG{G1#b;%1*@SiA-umS&5Wh8L;(9c-qvD9&on4sy}51Me5%MH)bV7 zhRX5>)T(b5j2h%QV*%Md-%p`EeFppCH=!zkTT*{}(k=y@@>g6EXX4>QS^)FbU2?ij(067mWi`tOHX8 zO@afH*@3C-z%)VAoCDJZq3X2If$6&I+)jp66aBp}SFdEGGefXQ@0=-UCZx%-m?_jO zR_Sc^bGCoAW;JhifM=<_CA4lLmN|l2LziqZUd|OXOY3r;pts=V9QJY^dpTdweCOo? zL8v-E@N$-*1=>rNy>2X=Aa9|AI$f4VxZw;fvgpNv76M($=*5g)B4~+2FBOEUOG5P0 zB(ziDGA4V0L(W>}&`y_cTl8{4%YZIp^m0b85VXRfR|-Pa6(M?M651(nRoLmC31?mH z&`y`{So9h}tAJk3=rxR9D`>4luM>o-YeV!pjh@Z2P_tPT{_Qm@dFy%N*GC1~5=AS} z4R9+`d>8(3(MFAEINV@bzIPK%%g{Ai#j0)6^{qAcu>#@J+L9s z#p=lj)LB1@a>IfC*rHDfItlbCMt{WU(}GS15>jXINJGWbA^J=*+QsVG2-;cCMbIvU zKe6cZg3bbcp3&zReL>I#gT5#T^}Guq`eHKL#p|r=r07J-seodBZdj0FEsj)R`MYoz(oxzc~@8mSD=IN2?O0-u`!~)WVa&atLzY$ z&D?)wUHMwjmvH54cI7I&@{OQxj4R&?LcMRoLHJgC!i^w+udpk37zKTY!J=)VpSl(Z z_qw3#M!467`ksY*gB`w6PPkf#PH11RZKOR~mYrqye&&21?NL z@S*Z0Z}i#~U&QIb%%IHZr# z^cz~lH$oBn5}NR3M8puOFYRM!Gelt?NGy;0*O zp=wF!%y{jLFDvlF!T0;jtx+}5(*#LS@&uWQ{nHYv?@f|4Nd`NnNm5P5S2cxQo&uMn z>#tVS6dA6+Q_YY@Ow%OoV;Qr_xIbOeWZ4M&tr?Q0!u=T%F*pq$YNn)_a9^*#vm~M7 z%)t4{l4iMi)NO@3sM!&y)9_nSZm8io7Cl$eY@p{d`YlG!lQb_FIW^ytgo^V*^!#MB zlj?#9+F2Jy&`!Xm7QIN)0-zT$dLg41OImEuOC+J5w>U&ENk%)JE{&j_by)=M)LUlJ zZ%bMV^xKSH#^~jemK*d6NvOA+$yk3e;43tG3RIV&ra&xrc`I21E6d4tWhmQK>=Le9 z8Lwt%xNPSA9qYy#Nvq(-8g^qfyRlZ%TI0q#NvO9r9DsG&3vL8!?@HFJ7l>!Q*6ezj zp*BFDbWLQccUh?Kv6Jsbo!lqX`;y+(-n?hM!)^+uejHfN)>mzmgt~!+HflBs7y*37 zR7I6a75z8n-r5+gZIHH&iLy^$^#R9*?5#FQ?3*@)o!+biYKx>TXn)yGx!hqTnfx3X&8|8)pwa=pWOWFhUen#(Q^Z`i+%$y!XK%wG+5PdKi?Ly~J z1nsPcBWM>;M=biNq(eX-W%OZ2ACq*raFcGi;-v{6tBj-BDM znfFhu8|NjRg&XJDjdSeA1xXi-8y6*^-i2@gE^05h5d_p39Z-RIE=js1)n!SSrTSD7 z^!zD;>ob;f41x}){Bud4YqfnL=?ht!hynT;L$64>VxV7g9hCGI;7h5l0*6*&89`H- zol-nhNCexm+PyN=SA2shqxdyP$TvE4zLkXkSJ`XWzT=X*#+R@2;9bYyxn>h0Gx~V? zilgbei>B`-q2a(}hVX`@Yq~Q(;F*dc`~e-|9;us>ZgOWlybAm%3H5I3-T?d)-$Oqd zkA9XEa$L0J#3QJ1=mx|MZD5>o;@CpP4J|iLxp94_rSjs0YPoS9I>5YqzK8PSL2*#r z(OiHGj?mmh4Y9PLaT*NTP)i#Yr(uRx5GPa{W@*DUtiZrV0Or{Nb1_jEp}CkCX=z1q zDg>>_(u(6$Y-pq6glff>=4;w0LmM5(T=7ziPqWlgY8yX$ZYqu#)fl`cmY-*g}lSih)ot$U}K1}i|XX=-YmrpDE@I8BSI>2aDKS2N;%VXIo=h<~tgXOU7?@BYlx zG#r>HoT@ArYK1?dRqcw0X6NL@I!K=u*YLA&rn?G1S(O|4scE%ks^>3Ezq_nc>n0T* zq?WvedK^R31tZXfDusQ%RsA&)qvn}(D|Inl56%vnM=i0K#U#URH1L4T(g_1g3t{evIMPkZL(@FAFC+jlXY86v`f z?iEn}Ng1W|Pf#*J=}o-@%1hLXdK=11ni4=<+`eof(hI?TEX4(K-+WQ^?>qkdbO1P4a#evyg_dSlsD;hdc#oO zWJ(W?)E<6|c6GfV!QfuVpAK^fDx12xLVxPUIRrh0$_r>Yg0f4IJOHmhcmwzhI3Nz> zSL*@6E9`T~9xyb>KtLY1sETw8RfO$U;df|Pp`xDbTz&};9k(+{OIo&A`}e$3*N;n0uS0!OYe*m<9=-QadI;%X}U zQT@K4Lr6H}avC91A<>}U9_Hdi6o~_ioaYohU#A!JE5v-E7OypHy?-n7mHVIzvXP0QJ_1IUaWveO{kTcGBJ8$jaT25R2K0@wrrgle8AP_}YLQlWdKh$KO9 z*$n+w>&7>cSkSN$G z6wYL!=v}C@n*|+%q{BrFM_qfg)^J#`R|M}5yP1l29UK*LVprj<9M$#()crys8-QL0 z`#&_L-yd-JgnxLN+=-3EL4EKXlu^W~aZDX{!E;35fFC&pOd>8E<&rwab&m509#3k! z+)D(q4=Jb-Zahv1WE_mi4CG0H90ErV4*gGHAo)OFzeIe@2l*y=PVtF9iad}2pXPgT z{vVXi@UgUQGz_D&QB*j7=Pd1$;2{4KOT)qbc{6?&1djGmGBEF=rd=?!OA(rjlFJdA zi;_<*?K8ng_WJBz_w7F)-E-HjXqY~}N9jwzJli)H8CN4T7a3n!+Sh_l<@NErru~=G zd9?qXrs*Skl&;GYv5h*yOhXim;9g!C#5JnV~g>(Gi?<8=T z&p9ZR&CLH`{kLw z!BVOKv8Jhk5~u76hv~Ue<>4hzs(k-{(rZ^cT9}g)Q?h@mC;LnMRPy5fmBy_^ioYOz zt9QGqMiP$`_?U`VsLlnmvFCCP;*EU`s$QikZ|rN@9XnsEg=>{@ttMaNjeQNO6;!Jo zt#&6i_I09+Uq&|e9ye4M$l7!#)v1!E?!xyv^h>H+rLwx4?xMT1)jesy^LA^|REk7*3=^fLm`s4emp@HKc|eV_Ed8EY*k_sr#s*YE1W$ z*EnC@kKc{6RTFALDE*r5r(fr(rZ6_mSIwwd;*ruJsyQ{HhWV;RM~_UPqCu9-s!)sBJ7p52!YYP&C9#Qh#c|D^l%X*xLrB zpzt8X_?vMpT8P^I@YZSGL-Y`}K_jsKmL5{=@Vh-k*dCqKM8<>5*h&N@rbKA1V)tCayWu>AE%St+=0v_ePUxA#cT8QO2C#!Qb7e=>j`lHG?;`YNqfzr`IZ5(s_DSe@W+6 zWtF;LPD!H{{OtQnB1TR8u8-HfqgnLWfgbNiDL8XT7e#)rp6x|d|LUs8%C7VrSot=* z-LYOi5*_ho=kM;O@V5%5>>%f&FCUA1+?(=D=dx=rSAMu`YoEEdv;?J1rs|4_>4xd* m7TNlwsAurD`5S)0vVYV@T>&qf@p>2GH_ob2)_&z}Z~i}D;~yIU delta 10541 zcmZ{q33OCN*2lZ5!y@?2pr8|RyEUTX_#Kx4@pD|Da6?2?5Kwgfx0YA0IpaARy6WAo-@mHvtyfjI zm+i@Ub9c_d>l-!reto($(V`-3-{{(~W$R|)*R5KHI~z5_|LsKmI@LI@VTV*g4NSJ9 zfppQ0Iqg!3mWc$lQbnl*-BCcTXkaR*cRuR+rUG5nk1q3dg{qi}Op%J);EMxOB3}&* z59BsW-l0mus=wrhuMB7$1cWd1^FWmf@X7>$Wr8kB<@AZ5m!@)1*W2<`xu8F1*Hj3) z%+?q)l@?SgAWmfjm5W-c5VggW!5=k9&>)eb+RB=g=o_fPf?zvH)Ub$BL4yTd?akRRTSP(Zd)$T+r|ctwsnM8gPw6kH|vH2tCrHedQ>RMx{lM zcIYZWBY_^p=qg5!5j4i5LqRYdBWeQM>o5zQjL>5}+EU48sZPcd zf+j=86qfM>%a|r;nwK$M5KN~{){5Y1xkG9rI}q^_9=WxY4}TI`n)&PXql7qvtbvfuIF`z!t()VY?tg zFU&%F$9&eKedTi=?Y*_mp`RD@EYQy}`guk#612#p7Yl-EuqZ+=&O&>~T;kEb@&%9f z-n!JGmkC+|^b3q$#^@IXz39;|34-a1Og=e*Iii;|dbak~+1gu|vkxqfd+VQ3bl&(VY7<1lXVygR7Nk9_XNFtT-E!6 z-f>lSvOW;BNeAf`LGNL*wussydLMt(RzX`aSpnWDYMUS!ZZ%W2NzgVuj1kdC_jmGt3hu$veL!h@a`Xff~5VXViiQ0(>h2f3}y)zr_qj6UZ?Q1`Yp?#2k>d?Cd z?E-o?qd#Hv9zlC7`ZGbW3-(0l&$7`z8b6PreeD-9v=7oR9r`Olp9B3BqrYJEUO{^; z`fEY3+sovp2}}@ut?t7)o|HP{I^cW z0YTqD#{t%{pLKjE=sT<9dqJ@KE*gRFwG3_qA-a#_r-|{N9|V=qTG3A(jQsYHphMPg z4+-@n`|V+teE2xO)gF1+`|S}y>)AfI3NX~}Qei0=I~BYm%Z?VuRld+%UJuauOLwKRz7l}sNZX^5uRqyqGP zs3h19iReSK>E2a`#pu3vc#Q5Hc!Z;mlr#+V;Y=UN^ih&VS-R+Zwi+!7wxc5YXiYz? zefY5P;VKD-sFE=shL2WB=fh)IR;(PdATC=c80(~rlQafWLY6X)rHq#}K9ZuUCBbxj zq@-Fasgm{iHBcpa|9-OZrU{bZ$`fRPnkb{~{3J<}q}d})l4>$Oswpgd3WUd3U_Gr< zWV8ZLwWAuVdP35>?8#hZJ26etWXXG~>5`_R6VoLE@d^AMZ(sNwBM9GFD&=`12Y)1-_S$+1D%ZB6fmB$9eCf$a@#FCOmiEyoA+o z*-rcmPRCM7i=ksF>sZ1%mPuM>b-XAEcFUp>cu~vXM)H$tk#^m{xX(-4bzhSCYB@ZV z4vGTxGP~*uR=Fas@?D``k@T{bv%<;4{s~q6IKX^ep;{>kwx)(wYB&lQ1N=>>2C5-7 z2#@5Rcp+L_E?pZFW#2;eDo2OxqgF|5l~zT)UhU&*jifbbg;&HiQoY6vu4S=nkBh6- z(1^+?u3op(8moFkQe9~4J((4%Bw|IEp;Ne{-X&r`F$JN`CV7ShV?`x9Y z)?M^%MRD~`4C>=*eViM`)w>S8LDD-wZ(#I#MsJj~(a!89#1#xTM(9o1XdgkFV`yLd zUJUKy>V1d)K+mUK|}=m_4k7|0{&4R=c&m2{MQ6yRv^lO)(3)m;MkXZ{ZTWECBg z6mfje{1Qh+ZQ!F5Af;?<7|zX&fY1JINE0G{H)qn56M7xM=5NlGZ%YYMz|b z&E-P|c34d>h0rOs(R%RN#%gMkrY6-B$<+R1iw_nzrW0aaOC%bv3xD`idm-!cE-Yx6 z`x`dP!VRr17R^G@x+Cs)Z)<&1J-*-Vh;DbJ6QYiusBTRq=#m0DkviJ`n(Kl~a9i*{ zzOGQ+Mz@+G-Nvt_jy&WY!?HHbuvkYo1h>A)s#BjIhRe2BHl~wLeolM!z^1alRgP;f9Q%gOtV0A}y_oSXC+IrEw)Kf22U8xrj z$DM)wa`aZb&$aKP`~Cnza4kIs z$|ImWPLCT(e|nT2x0L=&>BbJ!jU6cLoY$~m0Oo5z?6h+y4RG-{knZw@BI<;Kougty zETMt5R03iVh@4^I+kWI1sF(taEY)XQd@)}QU}k+ixn($#w+PBPWng@#T&M~@j;96W zr11iZ`w#m^+K|~ZGJ-m1*C5q!x2>@P2MemuXYoqG*$Ctv_&myI@gV|<0xeWu^dgA> z+acyGUV%)3*6WDgg@$>kuSA|9;zph|!l6eB&PE{bz=u&rj}k}}Xf)pfjK(z*Y)3`t z(OGEkYgHcYE0Je#Xzy;JLyyIg6zDOGMv|adA(b%BqsI$^X)rEAkIzDTZ>#obUx_?} zLpvwTR}&q2lHhCv5)VL6V)SHA5JbI38Ud!0nT*XA27HP}r}Ys$Eu32hQ`r%w!V#hs zvlEKWGm&)Y94k(PA}-p=pYF8G5S)@g_5oUEu$GxRwP15nYL+0F&WuK3mX^ZpV8b<4 zYiVh`Xtv;7*=(F&o@C#|5dyh|B+>^CS)(0#jzBWOIP@HWlmZ-j9`^&;ge-@y;q&%9 z@6k`25slR#g%BCpUe$6wg8hHKNgyD1P{dh;q9}pDd!L0OmOYp&$Yc+EThVIutY>iWS$eATC=e$QGE1 zU&}dzTHI+u${LpPI^X^qDQ^fQ5>V31F2>*ut%MuNS8|n>5|~zyCwNn+w~z-A3fHr6 z=ykBc#Vl{io`Nq}EUvxY(f)=TgZ0839^PguPCB?S(n~!~<}iELP&WvLtN?mx_I+qd zA0BW8WxA4!)50cw0d2}C;`TV9-qW%3zQ7$n(h3+r)P2AuwS^yV<-yyU)$DQS1|%SI zU=i&wwh1I1Y?bZIhXQE?4j$b5Z^Ib!oxVOde9U+G=nTh>zVt_t#}MEh{2inKOlc=y zPP;~R4(fmUHt)m?fd^fKz={4;)?z zt}ii=`l24CgF1-=mqRKiq3Wv!RG%8O35U1Q=Y~W7Wug%$xU7d4;I=yET=0S@p5Rxw z&Nsi4z@0v4qENPzf5b^XDsY9bFXqkU;}-rWI~{yy--3&FK8|V4KilcRjXgJ)4;gqv zHN6(Xf3=O)gU>crr4kqJs!X~wLBm+raBf&Tva~dzWJ$w7mdHSqoDd|#-(A>B%98N* z)@Ow$-7wc}<{Kg^n#MNsTy93ZnQul-o1Da(`BU63ou8eGXN~ae6n@5=`DS#gG5bT@ zEEk*k)7)mBzt=prndfqFI)?TSluM^IX{^q`=hLV;o!+F8I+Mxf{}bLrd*5Pj#-d3lKwIxuxU|<9H|GU(ah@p7P%He+OH`!uM1^Wi=hFF?Clb_JU6zX6 z;A~!EO6Xj(!Z4^!yl^>Y;s2^t@0>Ec^P#r|5L2~N`K|j zbpc&V*QM34m3ol!TU*EeSJM3MSC-AI2=tDER1{rn$z@Hagi z|G-~rYlfpeT|@0mSN@-_r1s|H&13~*6~|z(xLYF4`Q+y9pGJ2Fx`jGu-5sf;x|MDT zZ@>SN;FgT)1Y{?zr874Dozv=WZ1`Af7d*I2Yw5yTIv6co>7Ufm2!C~34l4B7q6$KVmC z8%v(m{ixGzRzcSNn9=<>AFj0S{?uO$phwj}9Hs_lR1yDEtcr0GLa78l(JD#fgfxJH z44;qi6D%IjGC??=WmLI? zBYm(yHwFn)s1$S+FIZRcdc_wqL*hYW+??0dp#l+rLr_)-M9XR$JaVHjOwi?Aw9b#S zkM@2XVen*x(4#Pte-6dxoMA$Z=Ccic{*+Nwf&FNI9;GWoKBC|ll2$mZz;G-K%_)UP zW;{29Rx+xZyI!rwhJWEy&A(|%^KoOM8JbD_e7qSNe8$j>5N2#}@PNpX7?3kKzOXZi^LFwsg#!M8g7Mf249Rwp0n=Bd)h^sn>t8Xz z2tP5vK=5OX!4Cdm3zO@*_HA^H7#kKWXeH{^Om s-Om%L6ZbQ!C{$grvDHQDf?X6og4UUD-s;-+ClQ`FzhT|@~ diff --git a/src/wasm/Hacl_Bignum256.wasm b/src/wasm/Hacl_Bignum256.wasm index 2443d3482b4690fc4a122e564b0c1829d88b56bf..b3b0455710a1c98525a21975f2bf9210436ce45f 100644 GIT binary patch delta 226 zcmccE$M&s{ZNqjp#toZyuvLgM{+?_oW6LPGIbUWI7q3DCqb37`;$22328HU$>!cM$ z>J;uXI&$P>0fn2L>J{!Wwkj}Bek|?Vyj*?za&<;WJI2}5U#2ozGKy}GvtVRq+OC$t zc!!g>2xQDXMxc7d`;5~Wix|bs9xy5}DLw?6toVqL*+Jm}qa%Yii-RMB1_Oh_Lq-sv zF&ku)!Xrj=pb(g^_+auzFOltuMU0%Rj5DWamousYEt*))sKmyr0eirg^!JHO#IG0=gz&b>D=!;{=e^>@BiJ~ z&mIP!JPdyOIP&~I_Udw=>C>yr%YoWpd8_D*Zx{C(YV3IQXk4_$zq9|{_9z@j%bq}h zcNzig6F((hdf_#68{w=;gL%V3R{5K@1?hDKkl8Q2sDWiK!&z#p zIY*Qs3@OS*oX3!+Ty!W35_E1tLN2+Gpj90kb}6(>Q$`eJ6qhO(CCV^S#xSNRCPpx( zDW;DSsw!q&iZ_&XAvEMb4x4;jQ6`Y7V1g)FqD*2^QF0i^q^9H~rB{})mkd)cer$@3 z<*8nIBjFW`BIOo7g-$OhfKi~&HLZw6OjS@MVu6SyloW9W(7QmP>@QE5v)JI5)~cAi0x7tBJ==Q0f_X||mQq;2f=Xc# zb6C(REXovUo5@R0rBEv#B%)F0982QWwwKw@;{CQmY=>QL`#RQ-_ncP-IsKgsAEu2X zl;nudf3AB4ugH6x z#f3je z8a2o%({3oaIF%{LS0r#%9(0+Ws{dS35h&JPUv-d9Oq;})JL~OV?)(vEe~TYPBMaHT Ui*RUbousv(g}-h;`KV>f|FPM5YXATM delta 2696 zcmZ9OOKe+36ox(5b{=&KDNUOyRoj0`gph(LqAw_j=AwdBwIs2V*h%c9=_3zcJ8|Mi z-nHGPP17cA5L2lVs1lnhY%CR-B@#ufSXAuTu!0Q>kYI^WB{*|uuJ3I(j?bAp|9582 ze{%iD6XS~~#^YauFK<_`mwksnzgaH(nvCKO5f1IH`s+GFjjNlK+N)EdC)C1%VzIqb zJPMtu{pma+ycc1-Nx4AUqQtCOLO2J%o5=D$ z^r{ejCumE=WEPJIb8m}yuVYs=(z?UXZj0fzBf(&a6&qz)j8z}CMT2!_Gw(u|FwOnq zzlWh?-RL%bQliUbDc(h;beX<$PAT0KQ4#2-GTev6*AI6m(an3P_%Q7Vdy4l_q{^PNpSwVy|c93yhf zY&HYawVPvR05MyW>g5B(@WzAC>&$+H4qLRC48AtbhC6;TY! zKkQv4rV5lBM;v`Ob)kl^OidX@RKz}LH>0?0%P1AYKBiQ;;;6W(F-L_`T4kJ6zO_}7 z9u9!^kU36IbGd>C=OLpgUy;&Mo8i7Yi}ScMpo;DiJx zYD04N=%$}-h@Ve9KO_fFJ`IYMS^n8uA@SAhN%2kduE{=5&f`%kA?hi?pvbYh=X;UI z=w@xJ4K*`hZMDWo=Qrw&JP7r6CL{s}Fe&|D4rBcgbz zjYpu@b%!n>F1zU=6`sVg-^&0b@Q zGLFj?j1%PwQ6?~VE%5O)+(ijqdMf;3SqqD)~*QKpf? zl%`C3DDGHf9EzKoagO3l$_b0yZr@lInTqr?W{8qQPEp9|$Z1MmQe11*CaFMfDR?F+ zM3J7PIrO{1JmiY*(}JQdVy=QkqRta_2}_E)j0G%d>awKLHj5X?nRUD#b*QIYlQ{Io zO9x(Qqrqu-ZXxva0lkn88^wL%llBg_N5otASAXc-sFyQ#I>pE6>2WG~++*-2>fRVW zq?|irV>vXri7cPQgbHCdbzGJ-E=JF_1eo_CBz5$Qv| z>g1`^L*nl zM>5Wh&kDYOpV&GY3TKg3Rc3jPXn7LIn?~(FVH4RkUmLgrW>u^kNB`yIfX!o0{#ihw zf*JAU=$=vzi+1G zluC|p$(@@rQ_|NM%1nx1XDBK4YmDTt(+6Lbi&$kEvC3X#xKne3IS^-TEPhin));Qu zjN`W$ZZJhzlayPMvM!gg?oifUN?!UWPd(gQy3MEqx0$DhO)}I?yhC&u>igf&;7x`N z8+@1Hj^=Jk?p?{fCs%RL;oft(Qpw`<>Erdh0rhAQ|DM@#$ZqNuL&|JGM*T9`VzQOw zAB$(CNrUv$0IBN9^Yf>SzdjX@*AB8k^{2Jp>OYEsmdvt2za)(2HX6yG*+306c!?-w vdAg#<%_WMoo69yrhP)`g@7Y(y)}I0PyV!aEkeF_5tRBDr%&5Nq;7H^D8J32E diff --git a/src/wasm/Hacl_Bignum32.wasm b/src/wasm/Hacl_Bignum32.wasm index 4952f6e00e3d9437c2424ed48e58b2b62dc56bec..020a40abca476f576064a0d475e0bd6ffc630646 100644 GIT binary patch delta 291 zcmYk%ze)o^5C-sF?;wFBL`2M)>KiLlDHyD82ogfxzz6U)w|l!$ixd`OX(w!L|Hk?7O84uhVcogK&AC!^#|pWnf)$x0 zhk;t8IV)*lKr0lO!EowIDctijibo7~g$F9JY9q>PSuw0jGVx_}npoKQKAKD&9IK{h zSzEGl!?Ifb-*A#dhZBD{6u*v+`;ID3p&WVmIL;>1fY3_5k-SKLPYRM6DQu;7sFAWj WYsfoDuts&*8%xkQKvjQaKWBgQ`$5tG delta 301 zcmYk1y-EX75QXQOg)GF7MWQUh;*6D63I^*PEJQ4QhrP-D3u=+V!rD&Qx3CiSHEi+{ zwt0ojvPvw!!7GgW7U_tj;C3H@N zF)vW#7FM$0GBZnH^lb3Jr{!3=E2Q8J!puswYdz zD2dc5+-G#;$jJfP^2uG-Eg3~OAG!XDo3{w0^&TTo zjpBXA$!i~rn>}DuU{ZVtG)(akBeR3T14c&%Zx#nf1`P%Vg@=qFK4Uh>aD_*V=0G7Z vU-7}_UyoH-8D~$Hf2j&I+V!Oh8?Oq;=n0Gp6BrdIGEUZcp|g3)`&v!_hf6@c delta 264 zcmdn?iFx8D<_!|;OfMg8mSS%bW%@a7@;n(EMuExm!d*7Y%a(8@IWZ_y*DBs+bYxJx z$H?rUaF5aP0D~usgCm0m1A_vy;(bPiyNn8TAaRbIEKLT6W~X|fNUH)fl2D7{14ad) zN{Awb2aM)Gy+96Q7SPbi8*5ZID{JJhXPh~C@^wo_;mv2SzvA`@S71wyn+2b!uyXeHHZ(8@GSzWR UUVmK{XidyZ6}HWN?^kdF0KW83p8x;= diff --git a/src/wasm/Hacl_Bignum4096_32.wasm b/src/wasm/Hacl_Bignum4096_32.wasm index ca76643bee1b65861b773eb6342429a27600a5ba..d937d02cadb5b167e7fbcbd852dd8f020dc3d18c 100644 GIT binary patch delta 556 zcmYk2u}fP~6vpp)dFGikh>3zWM0;+bXd7u1wYcdmMGy;09a^k9NSefV-+M7ysFS|9 zi-tSep}07-L*Y&$=pvoEIrksvpq<1aV9zzRal7BS-}!y#oSizH*5P{?b-rFyL-zQy z>W_WVea??K)YL^Xr)JYaFQuNeC_m}gf?-x|BzscNaZcEt+s{}4->qE1$;@xW^`d46V1XJU%^sC;>rtZDGG3TQSoOTjtDL8qN~JAM*SIn zFd|V3W<0I{$z2L_1)ILhlB6gFB?UK41nP`S?upRmKKkmUyTJ-DXs~?4@`>f&V+EuP zEBME1m<+2c;APs7R0v@6ozN+N3TgsY1%?dDDj*k*b=cyTIsGC6+v7`(tyyUg+i0|eif4r@4sV+?Fug&JHX(}@By zx}p!YJ+L#QhYeUwB{Xi(NL}y%>#BQcQXLlx+Md3W=g-u&*$Q`6X}qdm7B3DN8=^2H7&m)*15F{F=qzt5@X;AJ*^6hn~T$gxDrr zhj5)i+z4(%8*Y-B;o5sJk{LbRf$dbnj=^;duA??96P}P3`rxbkIHSJJ4=)A~2xfYG z!9(;3<_mW3|1|?rL;-Wjtcijq^8toJIv7Eu4sNGeF~n(BWU?a4iUzV`QYI_@mz6e| ztf?4xX+v7Uf?Wv5az$XkA=DoiA1_$H_toZBi91?uef91-Jj4OqMr_adMYIwwUS()CwVGopj>)${iA!qRwob3 J`ud~M+#fKhryc+R diff --git a/src/wasm/Hacl_Bignum_Base.wasm b/src/wasm/Hacl_Bignum_Base.wasm index 36c90f4f3c558f4e65a7cf49416997e2e3284dbc..e407cd7801c73d69dfcdfc15c6db86c600fcf01f 100644 GIT binary patch delta 865 zcmZvayG|QH6ozNkUMmTaQX{4KM-(ANf>VG<$CODLyj~mI%f;qmV7(YH%f$q-De3(X zt|p4)7vKf*1nDECPoJEb+4Z`h7|oo2&pF>ed*=5e|NF>)JS*^Dljnu^@A&u8YI$kC zl<@l(wA`7cHD~gz+;LwmEixw7!N5XML1px3`EBCClWc`CR3z_-N@0x->`QS?GD?O= zQ85bPQIID|CR|a1ixO!sxy$F~;E5{9KGpkRpR#%mU)NK$!p!+z)KHU9591G_j@npk zpeh~sk%4V!QX2EnNOdjwl83?{{al{sjnTjILefOjdT)vr!2^N^XvkuJ%6DWDf$6HR zzDZqY<1M7$xk(Y*Xz8>aY%1)iJ8Y>t(MH=C6&-A&J=Q*2=;+N!Y%^<77w%^Lb7^mi z2xUsyx0D0yDjX1Hk0@PqE#(mV=%$oIL$MIY{09v=${_Z zC=nt{IYEdhrJT%A3e%4LjFL;I8H6MQNkVaEDd*@boD=1gC<6>E+G{P8-e13@2_aiP*&4VjAi0j#1udRz4Tq@jKflrn8b zFObgF%`oE^;05v;sZ*p+_H-x9g+{llyZx=S`uog(Kl7)B9RD?anftKHf5x9nA72+D z{j~W<7W^k1#1sZHQeeJs&sWp7Ugj z*h9l?+sCfPzJ5ScKZq7uw%G&hp*1nhG;m;UUSx~eKFz^)T0cu2&Il!)a%7cbv^9=N zIV7cnj#W-@gpN~A62&53@-Yl@nj&5_%XL$QwmId@Dhj6>ij*!XJ@l;7#~FG~>CY*- zS;g~I$x?$9p;UsbD{*0!OPp(5k}@D=h@n-kaDkyyu8b0zDTZc>k(m;WSBz+8Bh<2i zVdQ=qag9nA+`yy2z1yu-?{KYgN9ql!V~nkOk6VnLdT&%Zro@Q;kAf(ofFk9V;^mDO K)9}licmDxq+r|q3 diff --git a/src/wasm/Hacl_Ed25519.wasm b/src/wasm/Hacl_Ed25519.wasm index e4d48bf9111441625360fa22fede70b8093beda5..57ca4d366a2d9d8f5a81677d96a5d09bdce14907 100644 GIT binary patch delta 11448 zcmb7JX>1i&mVUlVcnMKDGr_?mVfvgVsMDGs>G?B+MVgqA(w)&rqn3I`-ReL6XQU`< zrT@%GGn)6Xjd^BY3$vNUHkic=2Fzx&g8>6J*zAO07PAHnm?i9C&b?LlRoz={TOFP7 zsPBCDEZ@0xdG%`cRZ)0Rtb3ef&s!UwB>(->w>vHu6(-tp*f?G=!u#WAzxUc}k{;B4 z{*!?PIpf|6|My_zr{1{Qw;TR#&nA>t7@iP|Kp1DXe2& z#czidtYtvfH+KXrcS%V*U@`@DOqrb~6Nl0k#oPYpcXHPFrXpI7uhgWp=Oc({SV2Ct&~!#M*7CL0)#)iW=@ zd~kjP8=DxBNaiPSqk?f0gH3E8Zf3BV;T8tZZK<|c`BJ#mm#UEgS>IeGl}k#36_BLb z%9L4XA`^$w7DY?d$gs(ks!2<=jR6@sU8$P1RLZBN+OBxGgTW3X)lLRvO}GxtqeODv@<-;V5X%GbXb=u zJmEKSk^x!YTs3Exl(YlVoKG-icA88aN?Q~?=aURixpO|H=X{z089CiKpVD(yK0W6% ziic+zoHe(^IR<2>{7Ik7PWoE~<9P<>Y0}^I*EnAAMe1Zg*1t$DDK63l24t>CF(@w5 zfKG-N8C=wpzQo`=hL;&!Vt9o?sihBGwk}iHRfgBxNng{GzRrM*obIHr=}9Y}p7agH!xgy1&xJU!;GQ7v&o}To526q_tFu2d~0fPmWKG0)b zrtqQP#3Ke|eRI{MT~g8xNRxiZl-X%AaVTw3^rRm#eC$s8v7Yn~49LjoPWrK)wDRdm zKT$k<%HXM)^fLxzkNrtM%TD^ag7F1|7c}XY{WXrSe35=+K-RxVE-5b3D+Xk)NHHib z(tsZszGm=RP5RS94lfxNaVX?Cp2I>*A1LBcxl&l{;s1X8{sazWF4go|{aVm$Yd>~G9I!QP+r*OK`qF@FGGFJ<$rj*+B zE-9|ebPi;$GBHRg6L##4{=+-T860PFn9044uDpU-9Hw!c&0!YDIUHt3$cY4c9F8-b z%i#*cQVtIo&f_qi<9rTtI4Tv%Q(!pY2|96W>s(?D<@VZhXpokxmu@LD>#rXCsq{+ZL?OY zb(*z`1KCRc9}{pjhs7M%a9GB%nnNYW8V*$)YdNguSjS-iuH}%#dJb>mIu38)dJY3k z!?=ON8a^zCo)zBL*iVYb!5Z&xrVRc)HYisB!uyId4jK%Q!i|>OEXGY7HW?Cb?kze! zPpAzwVk-wSqHR<~l<3VvfGNpOYOYKUUEt6$vEsIvyeYMgVkId!HfF;Ojs(CNdBd8b z9Srt!HDzPqHgbFGGw=OuJBRHC#vQ$d%h{Mvu zT?O2oCUw}=E{?miA@jl@h6!0r3xRtSIiNwF-{>9#q;PM<{YAJI_i@-~SlIm6B;2p1 zIKY977VZtDARuTysKZ=^U3gQcMTZ;k_M1vV84hqfm<=~165#&Cyx+A%nt~yI&n?*) zc*t^_wRo7rVMD?ry#>!{)%~?`AS2eHus;HVj)I)#%A}w@b${Yuuk%-LL^g21Z8fRG z9@{t`&4&CS668`b-J-{$U3}m-c`O?Q+by?Qj2#?03<;0-7M47WIbpA8otLe+Ga=l$+>q$zU<-Ok3qJC@rd$8HYY zhJ<%}3!ZaN_jjKI8L{q!{Sgp!6dWw(%A}w@We%aR$AEj!qz-$$&#{L?jY<%`MQi+9 z^nr4j!3N(G9vFb0mn^rb03UI9WJvh9x9ALi&|N;^Kt{BOVV4A$lKflLT$vo83LH8n zR@@IJZ`k1zj!(1U!dtXP-=fc=9RxSTvuq4}PHugRzToh}!1%Jaa5=AZM?Z2PBi8e< zBLadRf-L4L(vi7E!>$7EE0a3x>PL>Rvmvv$V`N%c%)dnoMbzhuS}20#DJ+V(e--(j zFkZlT!@^=k(iuq8PR5jEfEkj5u`C!k(PoT9BC`y&M~>ewmgAz1=P8dtMeyUs$9#J@}cS)+R5|7e*oPyFQy z#R>rxVjx!P#qnzu#(*$NTT40Skgc`46!SD}jX-CshWG&NEs3EOs3fifsP^Xxu*uhZv#<9S z0c0BU_4con-kSxGxq8z&(mT0D;8p=!h58Zar;P$O2yCJqDR7&BgVvUVF7J!Equz~y zv*zahiv=d3E4q-j)^?%HLTTbLC`}ag>zg;AG?zW)-rtq}T77&~I&Ab)C*m#vWEM&h zV^EqXI$~$(p!cB3+B@{P?T>Vy0J1%n)8(oi?2?i;iTd0tl-X%AaVTw3yv0l3$=xTg z+1>WddfV?8Kt@jY=f-A#+iR!Z_6HOb57ONHZQmk*tXXgSmh84aq)_e zg-)cf)z_#^0GT!Bgfme6laWh`?}b(YWbR&wL256AEvsYZ=WPOy3OH&h;cS5v9`oyM z7eLlGSIyKVCGCJT(_=!JyVGKj+G$R`?E*UlblCOUnUBx+J$PII znVlvRhvIuMc|zbx0VnlQ0H*{T5qMhAU+@em8EKBn_?~e5HmRRLt=bdRbo|ESVV zeN?E}bqlr>@+aK8-0c8DeO_vnk znzsdz*=aIyNNvrq5`9$N5!fxD+fu^Wktw|E*LzO@S>If>#avR-4oHK%E0nn#KL)9d z@6>xw;C%u2?RxFKn!+Bx-UkB6`sS*7T~hp(=n+6>r^&>jzi>-D5cp8QL%UwOC5p>O zeiK8(UV}sFv9mOOOFR-l=H3!9D7YoOf36thUFdonp3rU)_*Bqe@EIMQ5t&Jl9y)F+ zNB(0Bjn((USxPTqxmR8}Xn2nmFays?KntR`uKt)s3pfr@Id){kVKIm^@ZZrmcH7HcCLko%|kiE8iE>&#@mz1k7lY_4g$}o@YEXfGoTc}oI9WoKz$p^837jh7jKFCU zo(Y^TVY0*-66hV{6q(NdCwgl-Q^HJ1k4Pm1rWA^^6oRuQ%#t`q0=z=LxMEs$7BqmejI!a91>E1}dZnlE9#zi1sT3Ou+#p}0`O0*Q+x(3?&waG_aK zMq>JF*3+86gNqf4OC&6oxKskY5T$mO=rsk@%`yqgB)xPkAy3MBvwk8 zCvmxiMG{v?SSqnfLWRVYa%}giGdHTb7QBh8Kvy#>X9^9+Y0^BEI zuf%2v`{dZ1H15|j_Nt&v)tbEPdwD=edR@HUCxe|F#)Q6aWAK delta 11706 zcmai4X>3&4m9DzWP#w2=U;@~58ud8?X-y}sVe*THw3OH*jnYw~XnxG7`$v>SiqxY? zq>hwK`cGAxt=xbC8y>6KY`|>ZFt%y-&Fq+c-@LHzV0LJhIrrAP_1=9~cA9X%>`EY7~>#lyYdfBd=kvlR)iY{k!i zkXIc4`Yrm)-B%Ar4DsF{QPA}7Bg%$(eZP1=UhDnj4?{&AgF5e>FF+2D#pqwDFEGEB z0a+C*j1~6%b7B0?|NCJqmWEod<%^Hrt7BNtpoU=sgYI~k0S#VD`-ju=@&-0CAalHL z+6R1UfeB~`=SU=B6;o!Rl-Yq&l&kB~An)%T!ziD(s^hQf_0>?Z1s*@dzV)9-E9oW$RFAW zg&)_ACq}=&4id`eRh`QJ-gd>qRtBwJzrTObX9okatzP5Vf{{B|QEYfDQ5eIW3dLOv zcCkF%ol7_F(MzxmdeYk>AoITJUqhS zi0xo>t@uXg&Qw+#*FHw}_F40K_WYHyZAa{xSoML#I z!D%mkdC;&k3{EgS%is*da}3I?rGc~7Fp1~2h6@bHdZ(&3M@b1g9<}*AQ)XvLyHLua z=r&(q*dA?jyJ>R=12XbQ+uW|(tbDr7or;HD47zliFESu&*KNL-ZSy6C;$;Sxsm)h% z>Bg&iiLNmq%e_QVlDkA#8IVPn$bsA?>T`|Zbq3dUn{P0TZNA5VjQr6y-_>naKHcW~ ziih3w&aB(~fC1TE-R1|`Ha}D-K4S2Q+Wa_|ZhWGb=qUrT+)ETCxl8nf0aj5yvgk57kh@HYZ#a(UFrIrq? znd1~5`NeArb?h%ge^ADOjJ(lKEC2NZshwW;{|(G5S4^DBVQRM5(>Rb#@fxQTjGUJ3 zwWm;=&S5(BdPXkoI8!gvEDmJ3mnlkemuV&kvgk57kh@HYSsZ86e$%}!p2J}V#|o;6 z<6I6E)(YV~4(Axo=WvVR0uJ9XT*#r6VNt?q604rWBAeBq=4sX{4rC4dzsF%ChiZpA2Z!MK6LYCa@RzrhdG*guZ_8diIalk-2vjmqVNFi>&6hK&YD;wH;& zCgWxfn+*xK^c0;wW2g-^d>aQcqHR(|lqA&|BfylDNoqzWhc0mNCr)u&P2QxMN3jwV z3%6&(<%a^4mlk~18di{>$<>;Tfjca>nTtC)>@+0Y)l=~JZmn+*2Qp&q2=o!)EAn%i zkx4=N%1iUT&awXx(&%${o792EJskIDLl%UBbf*f2>DttMa)AP3l0^A&!T$AqRzm{4QPa z*%9UOF&LClb;JNkJZibkTs+3%m?7cuo`T0uXpJX1kP+)>ppgJym7mj$ObS}e-=(7( zeeMa9I?#BM9C4-Ga^rCgWws}!JKdBj+9HjC$qr>OV=bbls1BDkjwsUAw!NWI9Q|5;0P%b~JxnVjCki<^Q zZL(t*hb}|Hi#l=XOEP}4{UCjM+QjZW6Ny{ zz$YA@7!p41DR}&u*7%$Q8L=J*8VT@K`L~7{nH02`=7w?VduCDx8lQ7~!J%0t2%o>^ z%=!CHxr|8v9sWB5(8nOlZ7RT599|g`zV0bH!#7&xC;?Zfyu_PYF?9Gh z0?3FpR*;s=Z!iS-iu{~rWKxhmbN-zAN=)iN<2M4wXF~?(uUVhJ31JcbZl92iffLEC z&tIv4QUl|pp2Ec^YgJPOkP&NQpo#!rho8laLaNO93sm{s$tHE6YKp)z0WHzJ*^=3t z<;vwpHt!AP*&sO8a+?Zpnt*ABgkDe48BW(KX9yr8+SEWL0j8wP-ZUeV15|;7KXHni zZt?~SX9%2`4HxXq7QHuTg%$YwWL7o?&bHhpInEI<$B?k1r{M9qTHibYWW<^s=p(>a zSX;7p5#9H0suJklv{k;xkw;EIwGc0Br0qd_RMv!q=pWl_|Z8Xv3@*eIY; zgul6fI%}B3)wXRk=}8!j4Dft`^GdENK@?Srq*pOq0OoXs?^8WAq(N3mqJ~ z0j<(?ua*CLflyBG5A*Z$)+i!=E8ttx>cm+NCN1#A%5O8Z*i4grU)jSIJ}VG?)hjj>ArS?^S}F`}e|9gnKs zDU{h+(k_&;D0(0761ZEyZmat++8QS538gxAd#N3{sH)s3DPhN>a`y;jc9ygYr7Vgr zcdx*G0`^(;L8~=P;(lFjn*g%jsjA#4DPhN>a`y{mc9ygYr7Vg*c5MO=M33Ep%&|Kt zfQ-D+uRfKZj-7JqV|Pdq@i1+a?6Er{fQ*QA>_#5R9=oFo#$y7G(Xl(8YiHpJy-X(s zkmcTlQIfj}PY583ZbAogH(~xsfu{tVvetrn@72s1@uh=?7fgSzb|x~_-EXG_kVW^K z1F8L{5A~la2C!D)jj8yBdTFZ|qF%Zy`u{Mx2hK&eh1vr;MA2M*FF?D1;{rPb{R2Cx zQ0pRqhur(Od89FlIvOuVrY2}=h(w#TODMBYy0{!DrE;pP@culBaLHcs@zyYjm-P<0 zLN~0)K~)DSN=kqgk7~Rulvya%=s+opqR;&mfma1wwd#YJ)-Z|Jbh+0Bko8VgO*F!>SKDtYH#w>T+)hAnTo~%8il|c04Ngrch>QNxM+W zqUdYtmcZN5YwC99nz|!^jJ(lnO8M!UQcitM-Bm=qC*WT8nz}E5jEHni{rG-s*+VeAs{cP(n=MBFW$CHz z%QFFFPb}e4s_ILWX0?4Af-htd*pZ`qYa{i4)ZC*~Jqjkd2pN6;Z0% zP*GCCCXuKKQkk74?LsMwq7HguqQp`OrP3Q#{vM-8#8g*evIH`Xfz15t&a}Y=lO&MQ z2gK09r{}%Wn^6Aa4<<{TB4LWHWwbR+Vwsj*E`h9fs*)Wg(Yts!9?34FRhKqOy>uXY z7Y|KTvWv?lPL(h<1jl0f12a7u#c2}i1$q*82%IjVQ{W5NeV=xHRysF2AFf1ZSSvanc9SW6Rp7tU8OE}$Mt zTqt23J?xdRz)Y%?P?<@xj^_9ttWqd0l29dau>^Y9Nd+!4bCyu6GIQ3`9N&Z03dN4>vX(fBG_pjk2iyLtHJ3V%Q{$M$w-*HdFpp5?drRN?aph zwZv~FG)Y`5p;_WO36!SAU*Yv6EhD5xCKZYs6oMP6dWoAPP%#u^qtUQg!sZOWmiWF0 zwL+0lu znI4pg!90Z2f diff --git a/src/wasm/Hacl_HMAC.wasm b/src/wasm/Hacl_HMAC.wasm index b557e0f35ecaeb3bcf073ca364f6275a4be036cb..32bdf4664eb86ba0eaa1148ff829265d6bc3ec25 100644 GIT binary patch literal 29842 zcmeHQX>?u1k-lv`!NU^pFy4?6R9Uhu88Gs0*~a*K!}7k{*x=_US+=!WmSp2ai%k&w zV%7j*u_0^$Ljqw7Au;=!ge+&0ANfB&=A4;1XU^oz{Fuyq)!lcIbf4bk41qv&kl*d< z?y9cp+ts(ay1H>PZB5E?9Cgq2M~^z=cc?DawL^8QZu67Z-R-AMZr6}*Tc%-KA<^9x zR16~}kS`Q$UaumQ#49>OY6kQLG|lx+^{HaO05=~Qn#h+)40-u>^vl>YmuFftO|^}A zO|?x!oK(SPbldvFV0{y^Xaqra4ZIDpRL8Do2&cGn^seD(8nA0w0HK zTlYG7;TpYI$u!pOZcc-hM7YYZUPLmDjeBdH{BVUa;R>EO>6T1QL+wuIjBw3VxMq86 zro}lkTwEM3uGv#t(~z#-ziU@*Yr3uOaIKR(XKALUF}*a?wkN%QsXMu-H<)g$-JPj9 zl-`4K=d3<;IlAutmYtdQ+H_;4t=$>g2cL^YApRdf^v2rlyRm3A-ldN z)0ko5>`7GekBqvaEkji8I~~IWG@LX>W3DV zFbd5`c(M0s7>da!lg1lqZO`j=@@_hc@5UL#V@pcMopGZ8s@rj$f-~PehV+?sK3eH6 z^k%x6y-h9qF@0ecnCy_94y8O)Fhx&4oUKsQa%{Fj8Q~>HXO@P^+7X6V;gn`A7WtiV zXBiPOednp6AN}bV1bp^cNHb(e*XOF+b;=xv&vH*YJd}oV0TrZ@MLLs)x~ftBq(*%z z;W~UKC+SQ|&HzRs6}rxB$DsmOHE==Rd?cLZiTMV#P_i5Asqiub8%d)CAJ{w^{on%^kS(FnbU~Z@ziOYbfZ}={6-9k07g13>fyU4n z_s{xG6^TSe;0S}jf1P6hi9}pl8D@6AKv$~GcZPxyycIt{k3a`lR)yXZ~n^%hh{iQB>(d4 zC&v^F0wn+az0V%&nBk;|m}w-BB@FW=7>2ySp^+GpsiFCz8YPsVl4dTIM+=XmQgjZD zL)Cq#TPj^P-Y}LFN{q9o$*xC*Z|fbXBkc4aw^Y{L1H3Jq*5ULR!?;*5<1AFm&;O)&gFv>x&GFMSyuS ztmj1tfUG58eo2^l^rypDnZ90X`nt;W^)l1f%RzjJ$N35*hl{XFscN5#M;k5M*Ou>2 zpe0o(np-8qRLbzPY#&ugXOY0BIFn<>t5JXUu_CT3Jua>uFUzt*GbK#I#yOX1Yq0k7=oU zQ9FKy9B35{WU3PFV_GJfw?z77Np!!gLBFgC_sbOk(W7SEtP#vL5t!0N4zHC*g4f9- z$?N4&$Q$I5;*Ds1EzPJmT&|;;NC~6sX%uLX)|r|hu#)x+2O0@k>IWJNb)v$6!JClNb$80mABLOm40}X?jP!pdLI7mdf%&>H^XN~9>rG!b zn7(c_ecfdGx*5dlJO$c|q*kB?Y7_-(Xrm^hKy_6pG72PR)PMqNlu{@Va;QlwP>Utt zDNtQ61riDo3bc>vMS<$I0=3jrb3N^=r@i&uictqmaqzI?vOyH6AyA-3Gc=oIT-Hgy z)J6A88~UX!+%G!-`U-?;tDf5;Fr|weZkI=b_sb*62jo%6*U2Nr2f?<JV>?U8&K*+)R_NQfE(l79HN|9R~{J5vP)0yUv^L}(p}pe1VE z;SQ&cX6}?n3wKc`RF1l=DbOj3Xl!bCKvUqTBK&nrYeyAGbyJ6D4IGmqzFyJwDvm|) zJw^EI6iRrCu>;0$kWB7T)T0XcMnyNOUZ%lKeR2|fvm#`6H1aKq4)d+}p7^69?~ z*nGP}58jSE?}bQb+@WB>;pcY!dDZ5`ok|9X!*}Utf{*KGlJC~fLcT{oQ+%(I$?iTy z_o^nMX-_aBH9X)B^(GPV)Ks1`h zPbs0ICrY3^p=7E&soLmCWhTqVRh3jQ)1|3_aw$e-T?><@&Ih39&8K~e-pmR7u`bV{pdJv23U(~{Y>yH`kCaP>SrOps-G!-P3!RMie8Va!*3{h1MG=#uWKECU6?{L z&|y>oEJOPZPlvs#5ptmtzbOL$ObGp~*V_T4br|9x8R+m^ir%t1{BuP=hYr7~YXmy{ zwz64)4*$Z-3Uv6FURI#PrxgJgby0TO)8RfjT8H29a7EB}^f(2N7(MvyKYEb$uE_Up zFZr|%zh~dk`}Q4uVBgV)_8ons8v>%$;g6M2(K-y253~-y4;}u{>hQbJVN@_WY-$i5 zC`M&n3p%Xx0caim#HZ-#Fz~}VtjR^_@TZF2(>jb_(cw>^yC31-r}+0Vy5cj4K%eQp zVbnBQ@V?ez{Q5fl0ZK#bk`^5X!mE-N-huR*q*G8sX&=8) z?L%Qt;lm6&={7|-tJF|2lzt~N{SF=JsWmwQ`r{qsH5eF60MQ11`?ujbbXKqIg7=Oe z)y~3=e~-RG`ucr^g@eArZ-cKe$wcH^mdSw}QA}(;NhDS!L7OP_Jpvt>9klX`LYqpx zbj13yna3i#1o$Ox(pSc@TxwStXTx(i4rO*G9#5qPFiyb|(a93Gze>_ro&euune|OB zaAX$fzz;lh6H@1B2W2@WsJxjc%AGF?eNoQc?NN`71`Y#@DOM74O`V z&>X&k%HSy^z7iC#3~@9Mklp3D!cSW6q=ZqqKfRHRT^V*k%MEciffxA0av{8!t~V?f z!KtYMS|sn$6+Ybvy6Aph>=G?*hW8GS7WgaS##;`Dpz({tvDd&$V+^}0_#u}{TUDU5 zloor#ZW&eaa#|i|*sUP=K!wB#?Q#UWD`^Ehl&cEhja(fXW)83E1t;JpT!SXzCY%o+ z;e1->4Z95x5UX1mX>dBquv;GtyLA|HYvmvOgcx=*>Ne8Gc%yC;93gtIWutV^M!c7e z=(Yr264sUQA|e~3Zj*hlrcy-z(@C3G5_+$j0fk4MK*6ZnB5!j`6t&IpOgg+3 zf@}lDZ6S`f0^8=E*2Vxe&|+g_24yDNtbg)46MmC*<*OJ zVR$lQ$22ELFm_C9`jMomJS_&+beit9Hr=!~ooB?rn@KZ0yqN}XCeMn22TRGrt2B6( z*u~8)9X5GAyg3GM4$sB@GI}(4b%cHjpbmNGlVHFFc}duKA*cgp=Vb)81Ed~gfS(|v zQ}&Dlu;+#z_sUZ@gLaZ8!ECw$TxqL#SUyrb4`%GVX1-D$Eo^Kl!gp40+iQafhK+fZ zuoAPW?gBB0#I{%fIxfxg%#($*fEUrCIOfS>T1;08iN!SESj9_dG3=$Q3V12OL<()& z!xRd^35F4bCSeEV@d{YQ%RTdCr6=n7MX;NWsz#VT6H@0Fc>)cfgfNSMpp|fyd3&oE zHd4+py#|)ja*ejepsj)NB*s;syKBQx2d|4kb$yIF8)$>a@dnfM28Pj;lVg}#mg7wZ zP1{U4(YC;bvK_R=;BDcnV>Gvww%X>l8nmrq8|7^78oI`!U1QL$!A@{)wC%LrqHQ;5 z+c_NrZ3peJXgdtr4$i=|MR$hYBP`1R(yF_j&;x#6QY^#(>Y#P_4@~=6P7gA`PLR=w z4crhIR^9bn9fNV~IMXsc{Avv2HN2C67&JjU!%zp;#-O?@MxEWX+qS&hw7i@5#6YW~ zI*V3k(CQc)1v!U91NN1ToDBx8flWZsz@OG8YO-ie2Ca#kW3;xH_FA;P25m35U{Ahx zze3uem-TSyT_cH2?4U-n1Kaww1f~O|9%O)>AfuC7!eDqf?Bad2kCxF&OlZTfqCf3m zN4(WvT%CrEk$p|yh7E4Lx@wiBNh{Vet!}WoY6B#zt2VoSF_oeWtu}5)_I}{+53R1+ z1@b~V5XU8u7%eGnw(S@5YJU{9c5I)Q@pWzm9|XmNA&#yCWLH-Q{G{bhN*I; zI)v=QpmjLJ-2^^j*YxLc2X#o9F#|j4hykcmKEsEF&%+UPG3#-cTR~mT*u}=9g=Lo- z+{!Ms`D}IzPsae6aXi3x^Lp9BrepBRJ4k@sG3-x!A5ZL6U$11J`i5A$+IoU1a+q}x^$<)KDgIa1ALK>%Qhca(a6Uw@^K}b=7Jw+4R!#- zU}ym zu)!XqWo(e+&$j%qMSfWE58@zWryYM5`4Nl!h~h`%AY&UIe-`;Mi~N|<`^Pyu?1Uox zS>zKI`Gn$=vYD&n96~Q$dNBa?{EJG`J$`NyfdgT%1N+1BCzAM;@KHvV>~9BIow6Su zg2NN>y^5beVNPKXFMz*W&G3EF3iG7mA4-rwm^ilR!(ay@3Sy9dI!>i$6!!i-9-gs0 zJfjc@5Tk|XWFOx{e$FC4r}#&4ke^qwO>d=t-XcG*u(=RKA(#OLuL_}8Rp=Xv7zcqv-*^oMA9;ZIdg3?Yv;0$qmvyOQA9Sb=I#ek_uW~w6 zM+`bt&FZt?5wJmrYX4(#-&u$1$bTG%>Zq_ob=06kHROHZL5FI8ogZ|lhAm+pbg2Ga zJ5)!0w;ZbQ4Sziz)e-+6kLqd1xK!o&Rr*vx?_1+k#b-6_RE_mv9dxStKEgq#YHmN| zpi{NnaR!~La-0f(|4>fVk^c}*RebIL#$MGwJ&Gt*T#fUv@R*lXbsl$d ziEu3s!5Qs3snLV}({F?SG{qD;^pcXDZN!4hhqIsej)}jjLoYNI7vzj}6Q;R(E(Kr@ z+|O_at8rTmx_FKBHLjOZsWC-( z|$8iAgpWvD;q+rYy>2%Y_zPHN>QwAghz21f;20^&MAZ?c1YNl9)bEK*Jj%6 z^Mk``A5v8nfmHw!_-P2!v~2d&e@2gB(4F?nvnF>fb5=g#!uRwkP=4a2%0XAJ*M)C zFg@)=57dTxU>5*?g5M3mpWyfSGcAH2!8ZaPy{Q*rjWWSE`WXmVlnK7s&p;@mOzFvsv~VYN;N8fzF**vpLtX%`k3nC#O2$vNDD-aJ5rf-Z9E9T$b9RVRj&qUdUauO18htRtt zjS_RWQ?88JDWP{-J?jx;hdB-Lb+-l49Rp6T2(h~z4GK#Vi`M{L3}Cr)#@Am|0W34h z?cS9TUe&0fd%MELG&0fNq4Z39p*PcNcalG$49L}8Ch|_WLRcTTx>LA9GT;hT01H=l zd0cr_qqw?D$z3?OiAN@0q$=r%oaIN3nR^lIcX!M#)1h6a%McF;=I$2eBs9?PGE@O9 z%-!QL=T(hj?jFU6D8qZjubGQ)mRkmpajTN)nEKq*GvH)wFY1wS9q;xXu!m&8p1G(; z=H&ama2>B|6npxj9$c$~ctZRJb2B0bE9D-Z(Cqv$nnCa%8bm-`FtGwrV1H@_l7_v> z6#!;e{Pv#;k@bksdn8N`Eeq_^LkyyZJ$e8@55N8Ci5!ngWF8}Y(2;OK;uF#UuCfVw z=y4^mowrfZ2kgwPVcG>u|^ zjf}YAZ+MODAJ_a^!;55=30BD$4z7~FrK{v@UtRv{j%|il$q375f0ZnNze*OsTO}9E zDj6PKf0bO!SS6RkX7X0a#klI>l5&_x-YU6Ru7NFwMdYoLi{;{ma)pAs~`nO%9bu-v);!*GE$3|-9qyfB7gh$D!!Q0$aNptF$Xdxqg+TEt6e zNgS&X2NBH)$E#?8F$tH_Rg7yH3UK^zS;+Kra1JpHCvYZlIhw?63wc;h=g~^f3S12% z5a$JZ8(Z1l5LUpZ&(?_0Yw#&tgRbyyM8E|Nutw`?t$jnLQq&t-8}Gm&tv9XdN0QdF z94^FhwMty(Agl6=WmO)&&Ouv>*_cO2j3JlxItO8XlVv`~bq+a)7Z$oSUmp_*PA1ZF z@ZX5bW-IAxT1Cr^062^oulKjnHY31R>HV$f{jH(i-v&qo*k%PVm7;oo8(-rM*8%k7 zS{xI!r(~{`W|MTSERJ&uj>~Ror4~GG&~R%lmf4{oblMSyIye)9YITe{ICtoATw|KX z!NVAMat6+DTx-y3PDGeNX~@Pg!qJu{mD|{^8Z|^WeF-QHc?CQ;-Kg#?8n}!I$CJ!*P{c zkvAIt2tQBzD#V(Cf5G^*is2Z58$b*yoYeF3u)IHxyb3JL{XD&B7qbdWY%tuTD+=4_(61O2S8W;G&e<5{{xJ%bT;%;3BiF>7vXJ_H)UXL=C7FN;L)WQ-QeRjVl zfrM!W3DXP`rWy34X$A??3=*apBuq1~Rj}$l?O^5FEJylus)exzmXm4A<@BEMW&y8GjGy)1g?igCv&Z4=B%i!8N!z#HY{a#j#-YdK%n_9fb6QNQh?(>t-yo zv6Oxs2SiUOlI5~d6z$nM*(WE#PbeIR6E^rs@vGqgTQ@xkp+vXp<+NIgacJu4K7N{P zrol6ECQask2Po1rPb=t#9B1>D162TH*rKLYG_PuuR(z=gZKmbk$Jy}SpM|!_C9~od z)25C-z!uL|ctH+>8M@DFiJljUkPIY36~H3V3!X$?)hLNxPzcwE@il!>&Ya=RXcOQ? zd)Dnm#W(?fXN zUezecexh(rErw(`x`xwj)+TzzN@fqJ*zi1fj zkTYtztu8r>mXn7!<%(HPfHy4ldc*iNdwOW^3>haRGqu7r*_@8f1MT^u7qwL(6~zdcU@?M-PRdhu{A6M2_Do zTpx_ve97V8%ZHTzAT9hM+(o}v0$U>tHGROEVHyTrbPJ#xLfiigRy)d%NN$?16#gtV;d~XvTRv;mSsKJ_|Roy zbKgfC!cBlU29t2a5Fm-UA>_{1=AZn(wY62dTeY>R-9I+Fzn+=zkn}yhk6J>2sF2@G z&rHvB&rHwP(=$CdwV8d&aUAvFE#2MD_#LWKb?#7Is>}T3b#?i1liE3`%jRj=7D#k; z1_i@N38YI6Hmye%a^huOASHwP1vJg|jP)vFzyLQN3A&Qc6B+dC-RPH+3zyfn*6yoM z=k2TCH^@m9Y(}@OKiJZ;zqM^xC|Q$Db%N}gmRohlyldjFQIfHwl6bC2^_qW#TCTnVH_SCo4)HIYk1wD&T z8?B44Z)>fu-M6=Sj})J#X{niZZG}_VtF)n~dS6T06kJl@T;IC4&eq=`C>Qra8D|=h zYS-7*rfXZLPpio^)S_rjn2k$%p-s$**1Qu#+LUoF?S+}0qv@41oK&yUIXDuO%X*0a5SVBS{9B%XdXvHdtqkh=-R2%oMF96=io?ChWA3r!V!x0;AliIv@9Hj&^(SV zPX)7bLAti7e%j?a!NfB)m=im7a>f~Hs-+XFU;Z2fWw{6=r4rB1x|6FCc_+to9w~i zm3`2{97drT4##+(hQU~TYHKhet!;T-PTpB_DY)>xVv>ikS~xz0q#;fvh!4iBcmTtEe>WRXs!!LCZn zpOk1!C0vIuJN<-uEJB)_86~gaOsd^}A85*Kxm?VSWVYYo!D58BD#>0_3 z0{A0naJAQ8!)b)z1Dh|WivwUJ*&Mo@MrPdqRR@Fwlx^e@QMC`|Q8X$ZLq$~N{z(tc zDB)-nC>j;ws0fg7RAf0ag`(Ol;wz9m8u+6_99==9J&uaOkq=x+HiwGoN}nTSH}dF+ z+VymD^HG(X$TAbh&=~jlM-RVs0j4FQcl`0(UpgzC1fqZW$-jJfq{2xe`sdT19#_x- z5dHV}KYOyh!b#B>CK}F6nAz83_R#`|hGQnC2Iq@3lu&|7nz>Yh79LBb=o}i0q6bj6 zRJv@OAx;T#$t=W;r|~pS2pf-j#!*SS38aC~2{fK3(!~52Rg_T~l}Z(5G}a(bqB6dU zt}5WG>1x-JwlPv7#*=%%3BHCVqe-4Zd0b9;G({*yQJxA4reVOQxyqY@!t!*?w&^rY z3%wMZK_sJhbTX03cP3(V2k=D6q_4N7tdgl;Zg`KcD6z zFRw|O5!R|Sob+K=!>GHzEB4J>jOzU|O z3?OMSh+iBg9{uU?^`@_vn7&?W`nuZm^)ghx*rR+oqQivQCA9Q_iy%YQ2QvBY1X^5; zthv=PO(hRM)dy&)_#=uiLs zum5#8-~GpL-Svm|0wArV>)re|{9JLUl~y#;vPN3jNXr{}6%nlxmWi$x;Uik&UfG79 zL5EsJ0*RK2^bu8yI5fdsm&@9AKA|Q=CEuuLjZOp5pjWpSt zd?G-bsGK&@Mt|yUmX;m9L4pKtks!%iB`D-=5~TP>u*x^lO)&*%J8d@|agzwpO(5Z> zkN|B5B$IDDS`{`;p$PJ6JJ%q22k>`<`+A2Fpv_1P1gMs3Q6B_oC+*Cq8sr56RHxxU zfOcs(5TJSu2LiO4>S!0$({3w3AxI0*9$j8|*dq+=kpABh!2psPKzu`(c=V^kdredGk(wL%01+K9Q**DGmyIGoje!8+%OO)UE%UNL z`lTVdUs};Gt>J#D0q6@*t6;W9U`iJ`oRJ{GZ4xB;pag|{NP-mKjMg)B0|diCtc|uH zCIWPjwjw41bcnVgCRE-`HzJmzjndr4$mSq0XKBjWcA84pqy`s2>Ey$CRdm?R_e6>q zkUtMmt3a}Dr|>Cv0HN-~QFRaJBS=1q+Kz^5BS6v*|MoxU{<9-hU?9{cbsd$ujz-ia zVtvdVM#q}DU4jY*0g+AAf&w<$v6u{7VV=m_6|AG%!= zFQ5H8fz5X*^xj=a^9DmY;%)`)4L^73PpeiX?ol#19KKhF3BFHm>#2;A37=uoOP72)HPV zyvLPY4|}EPHSq}#R~UUlPkqpc`HJ7Zx)G9|6#kyVOiwFWLh zAfrLGdfK2i#jai zmvorovj_==?p0VU9mG-aK8ee+io*9xTozU!JRotQ9Y_yKJf+365t16wK9XKmc~$hX z2)Z}RMTCE-2;z?4mjfC8ktWCCS9F-*S9O@=*K}COuj??yKh`pQPSLrzGW>?3H$a{+ zcTUUjIUx$sK!#BSuuSbYJQ?$r&@%i!WcWiX z!|y_dQNYNsDM1L3jl#MVWLT#I&@%jqU!y0(zz@r?t}a4`KUMUemSOyg41WUI{Rsa) z#lMfy6~6!r^b6fLgpx)I-q$jWUtfklK#s`4hX_+bJ5cc(*^8e^FMige7curo@MRcr z;N!P1zLDWy>W)qDuXLE?U+b`tf1|?`{}v&k&?_R74&o^Is>DTxQTR29iwpzdb%_h@ zK>D%7QxHRGAHPxULtxM1!weniPDQt=)L>DPey8%P=y&KyPprui(4X(9UW0+61Q2cD zw{IJ+Ll^Z(E;x68x3&##_^O!(=}R*W77myOzYeCsB*XOQE0f9o>`ssg^A#E+isTpw z(3sFChycmDEDNm2uqo6-EUev$n2}rp{1P|m%O7*8-Beu6V`(h%?BY9)N)2FafF&Y^ zB~kS(eSGf)t za3Sp3?UAq;(pAFa)u`txn&@ppU^#@f@R~R~kSR2U%A|@ZGzqI5*eRzeJe8&v@H7}q z!uCiQ6GLzU2F2-U5(dRQSQGQ;TF*o`(_{70BASkPnkvBerA5*WbS;*@8S;;2N@rlB zNU%Ou`U6j<7R`L0V~SZc%N$cwN)J_H;3`7{KMN3cJTz;vIi@g$q6TOd&qneb;LiyS z{A@tMx;tJ&!LmC?h8yJeMZGFi3nIYP>E)(L6x*P-CtiwbV%tqj2B)hVy(R zSD~(|5Ow3(^{3?m7%i*3X}OSG1JFVl$10(-DxzL=KQD5L7B$0IhoA-KNm%Wc!~SQ? z;IQL0@sb$RZYj);OQfx(sAmZ+@}^xiE#+mjEY7rBPB3{&6=>c}yA`w?2FaBLFg~sd zO*4mA_ka_y3a&#S?AZuNX5B_RuBK2#|Ik)Wt@vkgCT?<0UcG3U8erlwCc*k)&Zr2T7X9P&15D z(GS)n=po(etk5z^(33O?=aay6Q~JCSG!vAQ0BUEPTjs2Ga*Q(2Sq#BCNYXVtB?eYG zm3su28-mN_Of)A&&~Hp@I!Mwqo*n~h2F>tVn_*g;!PmyXtDp)GufpI}@XQ!^P>wvj zN`qI4bK2b8;TYG$n{DuB^BkNYqep|GBlJ@Mwab`KhRznGC85@Zpmu1QR};t%kWL~2 z^aKeVaw;5vCr_Mo=bybDbth>uG^M$qN-M%c@)6^C&|K#=^K}xm;80i8CxZT?59YOw z1YIVlBJ7F|B9E=HO4wBDn5y=i(qLr=;{F|;d7@kWED z)ufzgo1r$@4%%$+HuDWJn%hEKY;#)-+7?lVayGY(wpp}o25lS8dUK=UDA=OiWYBKn z?J>}5aI|SgvBsd)@D6CR=+4kMLYWL8ExPLnJ>aJ$MJWuRc3O-7K(wFaoJ0c12@*PR zL>mIbqPvc3V-SurWvbTGZ>J%AC)W`WgC?jh47KyF7`4{ND6^Y(+m?5mmUr`>7-$XD zV9^>3S_AKmf!2tVW5Z{oL2Klu7-(rqTeP%6OY^=MXwB4Y(V7ifGw;W#d(VCaw?QxK z>Cm%8635g*iDWwt?spN04vrn(Q4%klG}ja7TQo{ z1oAFz;HH*9qG+YG+SVrORa;bT861#L;6rXX-;5e>4pDRnklj!n^rMzK$zc@kv!Q|o z=rEFxpsph!>c;a?yN$n$kI^y7GiqQv9W?;y!8;;!9*L+Is~&f_<?jqza{##-DBV(OT$Bo-e+C zPg&%rl$^FdXs$AZ23>kF0JZ$0kaUlqn#A3JFxZYGVEGeH{6hF5BT0_1gQO0^k#`6V zufh*1ochNYgJmx!P4-8 z!dZWe7Ea4iy@!0-BA-_LgE+`%l$^xdmd{w^GYaSTFW#PxzuA$-K2Q}QRA1gIw^N$3lbI&eoI42LJt z^NMlCjz28Ecgu1*M1Rh4ec+YgVnF{NbX+lb74^$)_E)f6H{tF9K6{7;Uv(6bEPU5r zRrb^A6^;1Fp%CsXAmeqZ=yetPfZ`g1z@ZPk27@m=Kzus!8}UtkP2t)DIgC3A<@|=! zEf*Sm)#IGL;9x)XD2Pl0Sc)|ayojpZKK9dhzmE3P^UjxMKpi$3v0y_|9O`oSnTsf@=l zC{OSca9>oO3n=pwa1~S@4!Fus!0kVILSV9=0E44ECNRZMz-7#d&M@4+G=BM`#EWF2 zGZI%Ty#!pKoal^(+sIg&AouOYivLLh0X$if2queD-8h;edE*E#Fv?Rq(2oTn(9hTb)}}dQe7Q-t`c`OW?63? zH`U_-oPNjei+um)yo2{(aKTfY7>1{cVB*q#Lf`D`kty-`@GlMZ+t=DFM8<-5p(rxe!gpmU2oWchN}6{TH$#^iQgDwl9x3o&F{G>)Qr3f%^&wI= z01{F*SW--(C{i}Sf>@19n3W*sEUq24%e5{&1GRJ3CfelF)30-u+{n~Nz?+1gO`r!i z6#cH*3`kCYH`}9BQz(ia+~cGh@Vw3quAUG;!XrDCcwwh9Sl)1r(LR@x@cs6-=;v}| znUi+5X-FJtWIo{OoJPjmIw8BM_ktX62c_HHpq{M)`NzvQYRIc+yVQd#lYQy|#jrW@ z4w{8~lEgbv=gtuKwSerg@(w?0dqQ#;g(K?3wdO=BuL#Ri9eQ9_xCiP1_zV1Q0R95M z$6sl2xe@&HUOxfX7G;5N@)K|&Q5N`pegdu<$^yUNPrx-lS>O-&3Anr`3w*{;Xrne+ z;1BuV$zMJ;T0>8(+kF$p|lDCHrO5Ps2*P>a^rn-7l-FZA7QyJJ!f zqImj6d@e(m?F#sW+?tcGoSw-tg8Cj^C?z3x>X3LeEw}3GoXU4|lng}4Vi;=H0!#66%Gcg8TT_%%!M zZSqtA67Ep48dI<5cKTh5?Q1)7A;)_{2jn3dkY`@ok)`rs??R4OG>Sa^+79jz;>I9; zgQXdF11se*ozUX^D4N0bJ~W6cZ^60>M1lR46-XNP)>Z&mT=Cm?B}CF=Qr~0Y`p~k# zeto!Qs9~=@0H_bYed`lG9+$g!j0=MD!VY@(DQN)j(F8s8q<*EwF54)G%pSLaGz`4x z2F%*s`#pv?Ucz>E{Gd*P1EtFPFRybV@=CMj3vON~Bft2o=79NSTp*H#CD<2_9@rOu zP4~swzO(ejIbw$Q#kgo6?285P_r(Hu`{H8R7sG7p?~98W`{FWaN#4G=81FSqDuYtw z?Td>U`{FX_K;FK%SYBT!bI9Kp7voih@-k@tnepGN;n)i^UNS z`(p8#!@hW?lahV$OlPF*izN^HV#&k4Sn{whMxN`Ob(3drm7VbdyEBGDfAZu>vo{tr z?2QEtdt*Vv-dL){-dOUmHK_&UzU+B!S5w94DC z=yaNcjt&Y%Eu{KwSfiQsb3cC`%`>g(AW8G^vH~Th{*8Nm3l`F---E@p!v;Q zB|!_jcrO8}plemZDj{}33{?R0F zLNmVIpy8!iY^Fmu%c&*|weyY`wbsTc15ZMa;+>{xxDv*|6R$Qy@h*e5EAH(Vues0d zKWLi!-2Q_G?Q{DN8nn;tKWNZG{)4rI?hHHx2zP`6NP8dDQrM@kkN@Bf+R@v8a7S$a z!CLqaE{Bn(5?+MMX_a1{|Ax0&>4*DQAHHW-Cjc5nr;ddB9iZ^S0gHszI ztWO37ujL9PZV2*0%leuv>M<^XK|Kex-=9~{&Av;Z)RWZ>5ELJ!qqqPwi{)u4?f`MH zVfeexc0hLPa?Fofi<9Jt!K1ImDTAs!lT#=9pex)5Sgx(jNqPjv3u|-|=oV$oKgGsn z5ZwSfhMxvo#YrVP)U8384hfjU`1FMRb5!scC^PFs#{gebh zqX>y0L!Pbe6o<4wnhrbXGAO+Tf5Vst>MoREmEa2JLC9 zzrnHXhcU-W`_;AFUePGdex%@c7K1amqQP6usza|@ z&aA^(PL1ewaX-Tp)!p*CMSfi|yv1HalviOr2HvzZ zys7l-vpJF9lJ|2x2HvvBZz+B|PRsAe3%Op)?^xt_6#q01GG5iipY6JzS>&H7{&^ha z^9m2`ddTN3@_D7-ip|OMd-7JThy0#JeoyiHaa#UB9@_PgKd{IjD0!pz4gKRStPe7WV2xChEg)-};1)-zvQLiwAhg;or-Ll>Z5qrP7 zd7w`!iXpbjIR+R$%ddIz@v3JWABwNDgIfb9NaSY?<21pF4|E((iU0rr delta 492 zcmZvXF;2rk5JhJ<;pe(6NqyK;>*u(-)$2l=Qr$QOv}<0;;{yzMhN2POfh>hKkCu;h&Sh`g;bzo#1^VZkeKhkf5nz6mcqC}mB?hNlI`a=rnbn0=dw=a kecAw?BdviK0=yfR*eItt7Fh0xMb9~Hi8l@(R=)f83zWM{6951J diff --git a/src/wasm/Hacl_HMAC_Blake2s_128.wasm b/src/wasm/Hacl_HMAC_Blake2s_128.wasm index 874949d0089779659a6afdfeea348354111f182e..5b04e5663628bd8c6c5e734fe1c2651170be3455 100644 GIT binary patch delta 503 zcmZvXJx;?w5QS$qjuLG0Z^!XEPTn*K2`Fe%P-Qz1qJ}dV8bnXh7Pq188{K#d=(OoG<-BMKCL!0~1JgChvuypOsEgch~FO|A?x=5Q?2cNewHhk!wq2bVl?)WQiNxL<7wk(V?oVAV9=JX~*J^;a}~jhKQYC z+&q#Wl|_QBa*7d>C;O`&UA*Wy$NS=aHZW`86si4L!x%?wWTUANr&2lMbW6M$+83Gf nSlXHRvkLJT*^YQ3#APwXMmfnb!L%e6J?Cssy!9A`s=xmMml;h= delta 425 zcmYk1u};G<6h&<(MWRugG)~jnP0M`?u&@CG1FAPr#0=jMSP(mO=@;Zj_yi;n6AL^4 z0?&|yESB%P*Y_QNMsLycg^EA6n~jj~{#5GG)Yoczquh(Q3ZI|`4iSwpq8RN=Qi7N! zP?QF1q)wFK+KEFUFkvNcoxH1%bk`#x&e-z~rL_x;<|;@hoJe*fiy>*~`aIk}$dI{H zpVdCAxm@?kGe73$tUeAFNz-20!0h8WT;N8&^TCP T)j_dcQNev#5Yk>f9=!el1YJjz diff --git a/src/wasm/Hacl_HMAC_DRBG.wasm b/src/wasm/Hacl_HMAC_DRBG.wasm index 7582346593f81307f4c62b8139c281007bdb0a11..990b72e231ac84134f8464954de2ceab58ef4aea 100644 GIT binary patch delta 2982 zcmZ8jTT_!)6wQfo8t~H4Nq{7Pdy9|+p@v&fE|LS-Ix066?HFRm3j&FqcG_}NYH_^O zc0|BaZKoYTs;$+R+Ocna(P_u`&a@Am=}+lH_x{ewmoI%`&N_Rab=F$nKEU6v#ILW! zvnh{w@qF4dR8@TE$-;um?Y{C*sH<%;FL*L|O~5rJs_VM03%D+%tKH>-YeI@FRW>Dg z={oF5N>`Njsf9}yGqh@OIa}2qHU56u#Tx=P;Y|TI1b!yKjklQOmXn0G35%@7L!CA- zj26aQ%vcJW@pI+^H+Ay?{6c_7EmaSyRMqyr+X9GL`m9pa<-x_m4KLmi@}&#hWHf_I z0+s|W3s@FDZ%8{@66*Epimnv_E5`e><$alD(=zX!TDU~sS90D>D=QtLUA!ycu0SPV zQQ(&Xl)!sJzHs4vCcEz>yC)c%45-xxCIbuOeP&imt;J!E^DAa2H@PIfrc}t6S`6%0 zf7Mj9Q<1(%lCFi@d@Xg8U*Fac$)Qc&S>&I*L(;zCHvE=%l&6#_e00^89WQfntqNEb zxF%pNAJ?jmYhA#)iEGV@YmFV!G9MSUaEant&&6e0bzJKL9|(9LaKno0I{_O4AF>*J z#AJ`0WDf;n6Bo7Gz{F)?e3Xl8gyZ_2*&T8HpyR^F%>LNPP8Gt2osQYSuv-`(6FYoL zl!8Mh)jDJ{v6>5cqcCJL^rIE>6U)|9zWAy0;wOT!xtLmQU@o>W@)7i65qP0U{ZkVN z&`gVj%Ozb~H*K*-08@}s8_`(9D2(a{oFZ0C(S0eI|0JV?_=AjUdL>SWw!A{|c zG`oC z;|#L+A)LpLh%i)=P?fu_rxVP%n1U&shH2Zyl;vUuX0(fGb}>yZrX4P32(gP9<3cyF zi@q70g;|^<7nfiTFUvU2)8To?;md@~x42|44G~vxo`|Z*^d~TzH+@B$?y0v-*U$1~ z$6?MgJquIX^jzNb94-iQeN~X{r}d}&7jk3hHe=Wf%{+#Y7HH8n!PHL3 zFzvIKhKVcKVb5!4!F+nKs{ng(zeF>y-O!CmNZMbz+xpTHr1qa=-Xsa3zn}IWQAvpX zOLMtyvgTD{5A2SG;+9t z$9a+uw&Dm3<>NSE#epY@?4*P21R+BD?d-~|K?y=oXIIW@%1M5? zLw=ADXBRY*brTOtUl2nO!Y~A|0>W4+{a8hZs~m?b2^sGd_R1*PHtsPX26;uQwI;dJcQcHK#I_`)N;-DgiS2uA`B@v85 z6k`-r9mH_A^s6$^FKQb$Ks4|CP3>G!bu#saT4*RvM|m#%5VKrIp+>uoGO2kzq|hffk(Ha{yO?>Q2eetzz(ll*M`b(Oo-`Z!-nKQna^_{i$_pSBqwMTw_tNwngemdt@ z|GYl$Pprs#@%+*yUq;4-XZEk9Yy2~cW^A=G+AynVR$0DHJ|E2}OAYgkTGAw;uif8d z`O5JfC6XE$LR9TbE4A~gf*;N*zN%;mUsH5d@mGp6?AebR>|j-1Xeoa!A1MRJg@Lat z^4tG8*&f9=6y1Q770_9T@y++X`1#g*Uo!a{WxerH2Kk4E*j8jKo>MfZ0-0f_VO!a6 zDvKND70sK`=JaTDG8)3vXef~sMw?HLmMoRg_RTB4t?0JmJBn^8{#MZ)#dnqUi;wRK z**!1WT_sozYd(~^z?h~n&Iz-9GoHN{Zha^0m?r7ZeRzer_<^uL@UkNVY}j$k1%_Q? zeqjF=p^KozH8r7Gx+%><11<$}!x#b|<;yMkSH57N@1=|%>aiY)@FTDALnYV0tU zT+m|jf|8|TV|Y>V6GcxHKh+oXgQBO3pUEWlpV@i`#py7delBGmr+;*uwzuXq*ndQd zFCwYLGY~nRfp;P4+0%5-pz%U`_ELNHO4@$qZTqDXY&=7$3yfzPvm9|fdlw0Xu-K~J z=d*mdOLCk&=%YS+w6-GNPyNm#?GvB+px5VdsUJu@>NoUGkr>p}&jWaxM`(bLQU)Kx z!DF6-M}bV2N8HemNQRFIN!wCBP6Me&e1iOZ5=}Pn5RBOLp)5w?lT{fR~{ds5yu(4yI~$iTf?5VMu5bb5z~rOB(3C) z@F% zdK1;B_Ifk+dJCAgc$hW=8KzBcXqY6!TZ9RFy_L46?R7&M_H$zz&g3SG&0bq%aWgf$ z%V6ncXrUIznPyRGMqACEwpxJ1nHJNEQ>2%ngS+6n43xQIHJpF)icuBn|7J4o*&*6PQrpdi-Xow`k`#ruMpstj! z2OVDzf$)%r@F0*OJm7|gP%?Z-``RThl&D+#+C?3XuiYtMySWFx9!AT(Q0Vn290oE9 zJ#J_eB*VR;pqgIy)Yht99Hd~{_J-21pYzjjCNHx>W_t^$fD5V6y^I2V8DYZTV)932 zp=cGNxk68KVfl>92%CnSB7GTQE}|kXrhHyb#k|4_atRKXcn+@sGLtQLLqjAPE-{yp zyN#&G3ME(E*&Z$hU8#qTfeanFp`nuum+Gr1l5v7mOd%^sMN|;T3R6B61LRvl0mZzM zLc9tMuZF^EkHRV-qp;Eqje=x&wP_fCFx6${l~EZ-DB>DgrVTBpa>vk!oQOao;*lr^ z5<|-kty828E$0fV;3y2Oq$pRRziJ$=_8hJPGW}J$p&^nCSG$I;p^B8DYn|PWfiC8u zTMK09*0`aelMKhi&_spoc95dl&!PPzz)fYTVHNtD5Bh NX0_~f3(3`O&F#Q8Y$=7HZrNIDx^MM0Q|IEXuWD!2j>J3C=k-~t4}71+7~mtgG< z%!rERN$x$#eXkySb)J^g;gXix#(VCzTW|^+KU>vD6Ce*=26mUMmbL>9`P`xaeX5Ls z!eW8}!`w+2IsjM^QVR)N4Ew@4QIH+0wQN(PUc^9JDw^Hdw<0r(+Ws98>H-XW1fRo$^v)j%tsyt+@lZ!sx5({@&ZGKt+!wp0ANi> z?bzR2j3&ZgqR^dNZI`ua95av>MYF&8DRQ%@E&2@Nu@Y6=6ksO0W@Smcd%ZP`u{s7H jWqp}|!IwApG9;3|&_!6Hw z@&cJq-p{(qN>%7fm4}9>o`(xyU@95f)KM|2q<;h}p-3ru1rdd7)=?MOie5v`G<*%V zf2Mz$t;Q&YIrIjw3os_MSsvw(c*J2QfjOxa;W_b=3E7ef5E?b&LOqun?28R>a%155 zV}>WgjuD%ZEnNVXIrraox zM~G4)J#Q%t8?;H%B{>sq2HebLXiNI-5(v-U3b>WKbECG2jgzqxyKk53qRsl-C_6Le zN*u#YxMAf$!96r4Y(Vq7O)nm4v>Ad zXB6wet(MjdH&&yoIeP%BIW|c3u3}MxtC-a2DvI_3)GIf29d)}wf*O_0Sxqz=hh054ask< z*+cJ@XYa#!J}nUW(%t;KspVtt{D6L_1F*vZKHBQY%?&TsKj=(zC-Nnp1*U%e*zx#w zS3{mVgL6W?eD%4TH^P)m;=E9QH{{ME`;VIH4&{RGOVLFwO}eC|MVGY<()cS{LAuJJ zGNEf)nsi-Di*9Hcq?=k|dU7d@&1L6Xur|H26bkA_L+-NGc-uSr19rnZ3}kT+1>9vI z$9*K=9s^n2V*&RW$l^K$=zSTs3K%v7=n3Ex7Eb}6vUmpgEd8Mrt_^ut#g~EUi}mv^ z0Uuuo1GAUP;H7VddkGYA!eah~iu+tPg^YTC9W?m@DE`m?U&3DelN6`gFAfTDma%e> NaX2pfeK~9o{Q(MOUIhRE delta 1327 zcmZuxOKenS6#lh#PqV<^eLfM!5NrJe3V-k6df2(yin4OE%0fy6R4qHB0advETL>2o-_)#68RV;)BckDH3hTmcruSFC?sz{c+wrX#t%Ekys;KhD;ZZAH9Zoou3V&gSo8w`3PW=_Ec<>h^Bpd3-!iJsJu1N3oBhdZDp3vSV=qyl31s(G4fwTd+;UrEa)rn6zFU4InX!Y z^Pq3R7sP|k)?4~c!IS`9=tTwR1ZW%ID>yGe7kWv-1p&Iy%L?os)1JwsJ!E(qG%ex^ z=!%G|NYYhAlN)d(8tKB~`+w?{JIYBE?+O+a5u}O<`ME*#$4e;IR|C{?9BZKaV}xc diff --git a/src/wasm/Hacl_Lib.wasm b/src/wasm/Hacl_Lib.wasm new file mode 100644 index 0000000000000000000000000000000000000000..f29473f2d8c429e311a0338499453bff4dd71905 GIT binary patch literal 474 zcmaKpJx&8L5QX2YAt7uN0Ue^^1pFvHH6;b5Guccaip{RPPLm>DQP6Q1uEi-ZtRhXM zh-Ng>`~1mz18zM5ps%j$Fq+bqws{mOO)1eo!=#k+;`=>6D~FF9*o!k>e1UQKoUKpm zrl~``P`jN;tes5m0gYT9LTtm;O6DL?%E-b7b2_4$&kG ZK7P+c2@kpS&%b@t16gaR>|@F$8C^-2PNBid2lG9 delta 153 zcmZ43#X6&lbweu$W7Fm~j`;%YpQbf5Fvv4aUdJIl*qIR$e_W%punJbpHbm1qe2}>m?I}klYybxsU9fOs=$CG o)S~!+Q30qDqDbKZqd8D7ki(dzcyICrVYTL^D%+Q;FxDsl007A?%K!iX diff --git a/src/wasm/INFO.txt b/src/wasm/INFO.txt index 0288bd71..7ed8e74a 100644 --- a/src/wasm/INFO.txt +++ b/src/wasm/INFO.txt @@ -1,4 +1,4 @@ This code was generated with the following toolchain. -F* version: e617752a1b014a16892f7d8772d62e5c234f06c1 -Karamel version: 2cf2974007f4103dba5619e4eb9e3eaeefad533b +F* version: 155853a14336aa0713dba7db5408f4c8ab512a06 +KaRaMeL version: db63c1de17565be0ec4989f58532717a04e3ff40 Vale version: 0.3.19 diff --git a/src/wasm/main.html b/src/wasm/main.html index a4841fcb..76be617a 100644 --- a/src/wasm/main.html +++ b/src/wasm/main.html @@ -8,7 +8,7 @@ diff --git a/src/wasm/shell.js b/src/wasm/shell.js index 7c0dd16d..2b0217e7 100644 --- a/src/wasm/shell.js +++ b/src/wasm/shell.js @@ -1,7 +1,7 @@ // To be loaded by main.js var my_js_files = ["./test.js"]; -var my_modules = ["WasmSupport", "FStar", "LowStar_Endianness", "Hacl_Impl_Blake2_Constants", "Hacl_Hash_Blake2", "Hacl_Hash_Blake2b_256", "Hacl_Hash_Blake2s_128", "Hacl_Hash_SHA3", "Hacl_Hash_Base", "Hacl_Hash_MD5", "Hacl_Hash_SHA1", "Hacl_Hash_SHA2", "EverCrypt_TargetConfig", "EverCrypt", "Vale", "EverCrypt_Hash", "Hacl_Chacha20", "Hacl_Salsa20", "Hacl_IntTypes_Intrinsics", "Hacl_Bignum_Base", "Hacl_Bignum", "Hacl_Bignum25519_51", "Hacl_Curve25519_51", "Hacl_Ed25519_PrecompTable", "Hacl_Ed25519", "Hacl_Poly1305_32", "Hacl_NaCl", "Hacl_P256_PrecompTable", "Hacl_P256", "Hacl_Bignum_K256", "Hacl_K256_PrecompTable", "Hacl_K256_ECDSA", "Hacl_HMAC", "Hacl_HKDF", "Hacl_Chacha20Poly1305_32", "Hacl_HPKE_Curve51_CP32_SHA256", "Hacl_HPKE_Curve51_CP32_SHA512", "Hacl_Streaming_Blake2b_256", "Hacl_Streaming_Blake2s_128", "Hacl_GenericField32", "Hacl_SHA2_Vec256", "Hacl_EC_K256", "Hacl_Bignum4096", "Hacl_Chacha20_Vec32", "Hacl_Bignum4096_32", "Hacl_HMAC_Blake2s_128", "Hacl_HKDF_Blake2s_128", "Hacl_GenericField64", "Hacl_Bignum32", "Hacl_Bignum256_32", "Hacl_SHA2_Vec128", "Hacl_Streaming_Poly1305_32", "Hacl_HMAC_DRBG", "Hacl_Streaming_Blake2", "Hacl_Bignum64", "Hacl_HMAC_Blake2b_256", "Hacl_HKDF_Blake2b_256", "Hacl_EC_Ed25519", "Hacl_Bignum256"]; +var my_modules = ["WasmSupport", "FStar", "LowStar_Endianness", "Hacl_Impl_Blake2_Constants", "Hacl_Lib", "Hacl_Hash_Blake2", "Hacl_Hash_Blake2b_256", "Hacl_Hash_Blake2s_128", "Hacl_Hash_SHA3", "Hacl_Hash_Base", "Hacl_Hash_MD5", "Hacl_Hash_SHA1", "Hacl_Hash_SHA2", "EverCrypt_TargetConfig", "EverCrypt", "Vale", "EverCrypt_Hash", "Hacl_Chacha20", "Hacl_Salsa20", "Hacl_IntTypes_Intrinsics", "Hacl_Bignum_Base", "Hacl_Bignum", "Hacl_Bignum25519_51", "Hacl_Curve25519_51", "Hacl_Ed25519_PrecompTable", "Hacl_Ed25519", "Hacl_Poly1305_32", "Hacl_NaCl", "Hacl_P256_PrecompTable", "Hacl_P256", "Hacl_Bignum_K256", "Hacl_K256_PrecompTable", "Hacl_K256_ECDSA", "Hacl_HMAC", "Hacl_HKDF", "Hacl_Chacha20Poly1305_32", "Hacl_HPKE_Curve51_CP32_SHA256", "Hacl_HPKE_Curve51_CP32_SHA512", "Hacl_Streaming_Blake2b_256", "Hacl_Streaming_Blake2s_128", "Hacl_GenericField32", "Hacl_SHA2_Vec256", "Hacl_EC_K256", "Hacl_Bignum4096", "Hacl_Chacha20_Vec32", "Hacl_Bignum4096_32", "Hacl_HMAC_Blake2s_128", "Hacl_HKDF_Blake2s_128", "Hacl_GenericField64", "Hacl_Bignum32", "Hacl_Bignum256_32", "Hacl_SHA2_Vec128", "Hacl_Streaming_Poly1305_32", "Hacl_HMAC_DRBG", "Hacl_Streaming_Blake2", "Hacl_Bignum64", "Hacl_HMAC_Blake2b_256", "Hacl_HKDF_Blake2b_256", "Hacl_EC_Ed25519", "Hacl_Bignum256"]; var my_debug = false; if (typeof module !== "undefined") diff --git a/tools/configure.py b/tools/configure.py index 9d5e06d1..1edd68e0 100644 --- a/tools/configure.py +++ b/tools/configure.py @@ -72,7 +72,8 @@ def dependencies(self, source_dir, algorithm, source_file): files = [] for line in stdout.splitlines(): # Remove object file and the c file itself - first_line_search = "(\w*).o: " + re.escape(join(source_dir, "(\w*).c")) + first_line_search = "(\w*).o: " + \ + re.escape(join(source_dir, "(\w*).c")) line = re.sub(first_line_search, "", line) line = line.strip() line = line.split(" ") @@ -86,7 +87,8 @@ def dependencies(self, source_dir, algorithm, source_file): # Get all source files in source_dir source_files = glob(join(source_dir, "*.c")) # remove source_dir and .c - source_files = list(map(lambda s: s[len(source_dir) + 1 : -2], source_files)) + source_files = list( + map(lambda s: s[len(source_dir) + 1: -2], source_files)) # Now let's collect the c files from the included headers # This adds all files without looking at the feature requirements into deps. @@ -96,8 +98,9 @@ def dependencies(self, source_dir, algorithm, source_file): # Get the file name from the path file_name = os.path.splitext(os.path.basename(include))[0] # Only add the dependency if there's a corresponding source file. - if file_name in source_files: - deps.append(join(source_dir, file_name + ".c")) + for s in source_files: + if s.lower() == file_name.lower(): + deps.append(join(source_dir, s + ".c")) # We take all includes though if include.endswith(".h"): includes.append(include) @@ -174,7 +177,8 @@ def __init__( self.hacl_includes = [] for a in self.hacl_files: for source_file in self.hacl_files[a]: - files, includes = self.dependencies(source_dir, a, source_file["file"]) + files, includes = self.dependencies( + source_dir, a, source_file["file"]) self.hacl_includes.extend( includes if type(includes) == list else [includes] ) @@ -236,7 +240,8 @@ def __init__( self.hacl_compile_feature[k] = list( dict.fromkeys(self.hacl_compile_feature[k]) ) - self.evercrypt_compile_files = list(dict.fromkeys(self.evercrypt_compile_files)) + self.evercrypt_compile_files = list( + dict.fromkeys(self.evercrypt_compile_files)) self.hacl_includes = list(dict.fromkeys(self.hacl_includes)) # Drop Hacl_ files from evercrypt self.evercrypt_compile_files = [ From 8ab2d0fbbc7425cecdb2b1fa9727ef50590e7bf6 Mon Sep 17 00:00:00 2001 From: Franziskus Kiefer Date: Wed, 27 Sep 2023 09:18:13 +0200 Subject: [PATCH 2/7] Update .clabot --- .clabot | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.clabot b/.clabot index a23279be..48f58d25 100644 --- a/.clabot +++ b/.clabot @@ -9,7 +9,8 @@ "addressxception": "InfernoRed", "bkmgit": "", "mamonet": "", - "emillon": "" + "emillon": "", + "protz": "" }, "contributors": [ "franziskuskiefer", @@ -21,6 +22,7 @@ "bkmgit", "mgstoyanov", "mamonet", - "emillon" + "emillon", + "protz" ] } From 1a0f62c0b5e4bafa5bc1da5aef4cc9ad2ef43547 Mon Sep 17 00:00:00 2001 From: Franziskus Kiefer Date: Wed, 27 Sep 2023 09:20:05 +0200 Subject: [PATCH 3/7] Update .clabot --- .clabot | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.clabot b/.clabot index 48f58d25..a049f5a8 100644 --- a/.clabot +++ b/.clabot @@ -10,7 +10,8 @@ "bkmgit": "", "mamonet": "", "emillon": "", - "protz": "" + "protz": "", + "ma-ilsi": "" }, "contributors": [ "franziskuskiefer", @@ -23,6 +24,7 @@ "mgstoyanov", "mamonet", "emillon", - "protz" + "protz", + "ma-ilsi" ] } From fa640943968b9abd61a8223dfaa5e5772e14cf0f Mon Sep 17 00:00:00 2001 From: Jonathan Protzenko Date: Wed, 27 Sep 2023 02:41:59 -0700 Subject: [PATCH 4/7] Refresh list of algorithms (#427) --- docs/book/src/algorithms.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/book/src/algorithms.md b/docs/book/src/algorithms.md index ea43ca0d..72feaafe 100644 --- a/docs/book/src/algorithms.md +++ b/docs/book/src/algorithms.md @@ -15,6 +15,7 @@ For a detailed description fo the Support column, please see the [Architectures | Signature | Ed25519 | Portable | | Signature | ECDSA P-256r1 | Portable | | Signature | ECDSA P-256k1 | Portable | +| Signature | RSA-PSS | Portable | | Hash | SHA2-224 | Portable \| SHAEXT | | Hash | SHA2-256 | Portable \| SHAEXT | | Hash | SHA2-384 | Portable | @@ -29,3 +30,5 @@ For a detailed description fo the Support column, please see the [Architectures | MAC | HMAC | Portable (depends on hash) | | MAC | Poly1305 | Portable \| vec128 \| vec256 \| x64 ASM | | Hybrid Encryption | Nacl | Portable | +| Hybrid Encryption | HPKE | Portable (depends on hash, aead, dh) | +| Random Generation | HMAC-DRBG | Portable (depends on hash) | From 27f40b2174da5267627acd3e1a60116f303c3d85 Mon Sep 17 00:00:00 2001 From: Muhammad Ali Date: Wed, 27 Sep 2023 07:07:44 -0400 Subject: [PATCH 5/7] Improve RSAPSS usage example (#425) Case analysis of invlaid key arguments. --- tests/rsapss.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/rsapss.cc b/tests/rsapss.cc index 029065a2..440e63e3 100644 --- a/tests/rsapss.cc +++ b/tests/rsapss.cc @@ -35,8 +35,17 @@ TEST(ApiSuite, ApiTest) generate_rsapss_key(&e, &eBits, &d, &dBits, &mod, &modBits); uint64_t* skey = Hacl_RSAPSS_new_rsapss_load_skey(modBits, eBits, dBits, mod, e, d); + + if (skey == NULL) { + //Error + } + uint64_t* pkey = Hacl_RSAPSS_new_rsapss_load_pkey(modBits, eBits, mod, e); + if (pkey == NULL) { + //Error + } + // Message const char* msg = "Hello, World!"; size_t msgLen = strlen(msg); From 4d3ac1cbb383f1719da96cd3b7e7d678c0ce87bc Mon Sep 17 00:00:00 2001 From: Franziskus Kiefer Date: Wed, 11 Oct 2023 14:01:05 +0200 Subject: [PATCH 6/7] update HACL to 1b30697fc2b0d8d5e2f541eccfd3fb52b45b905c (#429) --- CMakeLists.txt | 6 +- include/Hacl_RSAPSS.h | 45 +- include/internal/Hacl_Bignum25519_51.h | 4 + include/msvc/Hacl_RSAPSS.h | 45 +- include/msvc/internal/Hacl_Bignum25519_51.h | 4 + info.txt | 6 +- karamel/include/krml/internal/target.h | 8 + karamel/krmllib/dist/minimal/Makefile.basic | 56 --- karamel/krmllib/dist/minimal/Makefile.include | 5 - .../dist/minimal/fstar_uint128_gcc64.h | 4 +- karamel/krmllib/dist/minimal/libkrmllib.def | 11 - ocaml/ctypes.depend | 10 +- src/EverCrypt_AEAD.c | 438 +++++++++++------- src/EverCrypt_AutoConfig2.c | 48 +- src/EverCrypt_DRBG.c | 4 + src/EverCrypt_Hash.c | 5 +- src/EverCrypt_Poly1305.c | 16 +- src/Hacl_Chacha20_Vec128.c | 6 +- src/Hacl_Chacha20_Vec256.c | 6 +- src/Hacl_Chacha20_Vec32.c | 6 +- src/Hacl_Curve25519_64.c | 18 +- src/Hacl_Ed25519.c | 84 ++-- src/Hacl_FFDHE.c | 7 +- src/Hacl_Frodo_KEM.c | 2 +- src/Hacl_HMAC_DRBG.c | 3 + src/Hacl_Hash_Blake2.c | 2 + src/Hacl_Hash_Blake2b_256.c | 1 + src/Hacl_Hash_Blake2s_128.c | 1 + src/Hacl_Hash_MD5.c | 1 - src/Hacl_Hash_SHA1.c | 1 - src/Hacl_Hash_SHA2.c | 4 - src/Hacl_Hash_SHA3.c | 7 +- src/Hacl_K256_ECDSA.c | 28 +- src/Hacl_RSAPSS.c | 45 +- src/Hacl_Salsa20.c | 8 +- src/Hacl_Streaming_Blake2.c | 2 - src/Hacl_Streaming_Blake2b_256.c | 1 - src/Hacl_Streaming_Blake2s_128.c | 1 - src/Hacl_Streaming_Poly1305_128.c | 3 +- src/Hacl_Streaming_Poly1305_256.c | 3 +- src/Hacl_Streaming_Poly1305_32.c | 1 - src/msvc/EverCrypt_AEAD.c | 438 +++++++++++------- src/msvc/EverCrypt_AutoConfig2.c | 48 +- src/msvc/EverCrypt_DRBG.c | 4 + src/msvc/EverCrypt_Hash.c | 5 +- src/msvc/EverCrypt_Poly1305.c | 16 +- src/msvc/Hacl_Chacha20_Vec128.c | 6 +- src/msvc/Hacl_Chacha20_Vec256.c | 6 +- src/msvc/Hacl_Chacha20_Vec32.c | 6 +- src/msvc/Hacl_Curve25519_64.c | 18 +- src/msvc/Hacl_Ed25519.c | 84 ++-- src/msvc/Hacl_FFDHE.c | 7 +- src/msvc/Hacl_Frodo_KEM.c | 2 +- src/msvc/Hacl_HMAC_DRBG.c | 3 + src/msvc/Hacl_Hash_Blake2.c | 2 + src/msvc/Hacl_Hash_Blake2b_256.c | 1 + src/msvc/Hacl_Hash_Blake2s_128.c | 1 + src/msvc/Hacl_Hash_MD5.c | 1 - src/msvc/Hacl_Hash_SHA1.c | 1 - src/msvc/Hacl_Hash_SHA2.c | 4 - src/msvc/Hacl_Hash_SHA3.c | 7 +- src/msvc/Hacl_K256_ECDSA.c | 28 +- src/msvc/Hacl_RSAPSS.c | 45 +- src/msvc/Hacl_Salsa20.c | 8 +- src/msvc/Hacl_Streaming_Blake2.c | 2 - src/msvc/Hacl_Streaming_Blake2b_256.c | 1 - src/msvc/Hacl_Streaming_Blake2s_128.c | 1 - src/msvc/Hacl_Streaming_Poly1305_128.c | 3 +- src/msvc/Hacl_Streaming_Poly1305_256.c | 3 +- src/msvc/Hacl_Streaming_Poly1305_32.c | 1 - src/wasm/EverCrypt_Hash.wasm | Bin 49374 -> 49373 bytes src/wasm/Hacl_Bignum.wasm | Bin 78522 -> 78554 bytes src/wasm/Hacl_Bignum256.wasm | Bin 100214 -> 100226 bytes src/wasm/Hacl_Bignum256_32.wasm | Bin 41067 -> 41067 bytes src/wasm/Hacl_Bignum32.wasm | Bin 15248 -> 15248 bytes src/wasm/Hacl_Bignum4096.wasm | Bin 63798 -> 63810 bytes src/wasm/Hacl_Bignum4096_32.wasm | Bin 32319 -> 32319 bytes src/wasm/Hacl_Bignum64.wasm | Bin 24421 -> 24432 bytes src/wasm/Hacl_Chacha20Poly1305_32.wasm | Bin 7661 -> 7657 bytes src/wasm/Hacl_Chacha20_Vec32.wasm | Bin 5552 -> 5544 bytes src/wasm/Hacl_Curve25519_51.wasm | Bin 7170 -> 7166 bytes src/wasm/Hacl_GenericField32.wasm | Bin 10727 -> 10731 bytes src/wasm/Hacl_GenericField64.wasm | Bin 11708 -> 11718 bytes src/wasm/Hacl_HMAC.wasm | Bin 29842 -> 29855 bytes src/wasm/Hacl_HPKE_Curve51_CP32_SHA256.wasm | Bin 21304 -> 21306 bytes src/wasm/Hacl_HPKE_Curve51_CP32_SHA512.wasm | Bin 21432 -> 21434 bytes src/wasm/Hacl_Hash_MD5.wasm | Bin 15550 -> 15558 bytes src/wasm/Hacl_Hash_SHA1.wasm | Bin 13140 -> 13148 bytes src/wasm/Hacl_Hash_SHA3.wasm | Bin 17639 -> 17611 bytes src/wasm/Hacl_K256_ECDSA.wasm | Bin 98203 -> 98193 bytes src/wasm/Hacl_NaCl.wasm | Bin 5031 -> 5027 bytes src/wasm/Hacl_P256.wasm | Bin 83233 -> 83213 bytes src/wasm/Hacl_Salsa20.wasm | Bin 10032 -> 10024 bytes src/wasm/INFO.txt | 4 +- 94 files changed, 927 insertions(+), 785 deletions(-) delete mode 100644 karamel/krmllib/dist/minimal/Makefile.basic delete mode 100644 karamel/krmllib/dist/minimal/Makefile.include delete mode 100644 karamel/krmllib/dist/minimal/libkrmllib.def diff --git a/CMakeLists.txt b/CMakeLists.txt index 825b1192..dcdd2f68 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,12 +93,9 @@ if(NOT MSVC) # -pedantic # -Wconversion # -Wsign-conversion - # -Werror=gcc-compat $<$:-g> $<$:-Og> $<$:-O3> - # $<$:-g> - # $<$:-Wno-deprecated-declarations> ) endif() @@ -337,6 +334,9 @@ configure_file(config/Config.h.in config.h) # Now combine everything into the hacl library # # Dynamic library add_library(hacl SHARED ${SOURCES_std} ${VALE_OBJECTS}) +if(NOT MSVC) + target_compile_options(hacl PRIVATE -Wsign-conversion -Wconversion -Wall -Wextra -pedantic) +endif() if(TOOLCHAIN_CAN_COMPILE_VEC128 AND HACL_VEC128_O) add_dependencies(hacl hacl_vec128) diff --git a/include/Hacl_RSAPSS.h b/include/Hacl_RSAPSS.h index 8f4de949..90bd69ce 100644 --- a/include/Hacl_RSAPSS.h +++ b/include/Hacl_RSAPSS.h @@ -43,9 +43,9 @@ extern "C" { Sign a message `msg` and write the signature to `sgnt`. @param a Hash algorithm to use. Allowed values for `a` are ... - * Spec_Hash_Definitions_SHA2_256, - * Spec_Hash_Definitions_SHA2_384, and - * Spec_Hash_Definitions_SHA2_512. + - Spec_Hash_Definitions_SHA2_256, + - Spec_Hash_Definitions_SHA2_384, and + - Spec_Hash_Definitions_SHA2_512. @param modBits Count of bits in the modulus (`n`). @param eBits Count of bits in `e` value. @param dBits Count of bits in `d` value. @@ -75,7 +75,10 @@ Hacl_RSAPSS_rsapss_sign( /** Verify the signature `sgnt` of a message `msg`. -@param a Hash algorithm to use. +@param a Hash algorithm to use. Allowed values for `a` are ... + - Spec_Hash_Definitions_SHA2_256, + - Spec_Hash_Definitions_SHA2_384, and + - Spec_Hash_Definitions_SHA2_512. @param modBits Count of bits in the modulus (`n`). @param eBits Count of bits in `e` value. @param pkey Pointer to public key created by `Hacl_RSAPSS_new_rsapss_load_pkey`. @@ -105,10 +108,10 @@ Load a public key from key parts. @param modBits Count of bits in modulus (`n`). @param eBits Count of bits in `e` value. -@param nb Pointer to `ceil(modBits / 8)` bytes where the modulus (`n`) is read from. -@param eb Pointer to `ceil(modBits / 8)` bytes where the `e` value is read from. +@param nb Pointer to `ceil(modBits / 8)` bytes where the modulus (`n`), in big-endian byte order, is read from. +@param eb Pointer to `ceil(modBits / 8)` bytes where the `e` value, in big-endian byte order, is read from. -@return Returns an allocated public key. Note: caller must take care to `free()` the created key. +@return Returns an allocated public key upon success, otherwise, `NULL` if key part arguments are invalid or memory allocation fails. Note: caller must take care to `free()` the created key. */ uint64_t *Hacl_RSAPSS_new_rsapss_load_pkey(uint32_t modBits, uint32_t eBits, uint8_t *nb, uint8_t *eb); @@ -119,11 +122,11 @@ Load a secret key from key parts. @param modBits Count of bits in modulus (`n`). @param eBits Count of bits in `e` value. @param dBits Count of bits in `d` value. -@param nb Pointer to `ceil(modBits / 8)` bytes where the modulus (`n`) is read from. -@param eb Pointer to `ceil(modBits / 8)` bytes where the `e` value is read from. -@param db Pointer to `ceil(modBits / 8)` bytes where the `d` value is read from. +@param nb Pointer to `ceil(modBits / 8)` bytes where the modulus (`n`), in big-endian byte order, is read from. +@param eb Pointer to `ceil(modBits / 8)` bytes where the `e` value, in big-endian byte order, is read from. +@param db Pointer to `ceil(modBits / 8)` bytes where the `d` value, in big-endian byte order, is read from. -@return Returns an allocated secret key. Note: caller must take care to `free()` the created key. +@return Returns an allocated secret key upon success, otherwise, `NULL` if key part arguments are invalid or memory allocation fails. Note: caller must take care to `free()` the created key. */ uint64_t *Hacl_RSAPSS_new_rsapss_load_skey( @@ -138,13 +141,16 @@ uint64_t /** Sign a message `msg` and write the signature to `sgnt`. -@param a Hash algorithm to use. +@param a Hash algorithm to use. Allowed values for `a` are ... + - Spec_Hash_Definitions_SHA2_256, + - Spec_Hash_Definitions_SHA2_384, and + - Spec_Hash_Definitions_SHA2_512. @param modBits Count of bits in the modulus (`n`). @param eBits Count of bits in `e` value. @param dBits Count of bits in `d` value. -@param nb Pointer to `ceil(modBits / 8)` bytes where the modulus (`n`) is read from. -@param eb Pointer to `ceil(modBits / 8)` bytes where the `e` value is read from. -@param db Pointer to `ceil(modBits / 8)` bytes where the `d` value is read from. +@param nb Pointer to `ceil(modBits / 8)` bytes where the modulus (`n`), in big-endian byte order, is read from. +@param eb Pointer to `ceil(modBits / 8)` bytes where the `e` value, in big-endian byte order, is read from. +@param db Pointer to `ceil(modBits / 8)` bytes where the `d` value, in big-endian byte order, is read from. @param saltLen Length of salt. @param salt Pointer to `saltLen` bytes where the salt is read from. @param msgLen Length of message. @@ -172,11 +178,14 @@ Hacl_RSAPSS_rsapss_skey_sign( /** Verify the signature `sgnt` of a message `msg`. -@param a Hash algorithm to use. +@param a Hash algorithm to use. Allowed values for `a` are ... + - Spec_Hash_Definitions_SHA2_256, + - Spec_Hash_Definitions_SHA2_384, and + - Spec_Hash_Definitions_SHA2_512. @param modBits Count of bits in the modulus (`n`). @param eBits Count of bits in `e` value. -@param nb Pointer to `ceil(modBits / 8)` bytes where the modulus (`n`) is read from. -@param eb Pointer to `ceil(modBits / 8)` bytes where the `e` value is read from. +@param nb Pointer to `ceil(modBits / 8)` bytes where the modulus (`n`), in big-endian byte order, is read from. +@param eb Pointer to `ceil(modBits / 8)` bytes where the `e` value, in big-endian byte order, is read from. @param saltLen Length of salt. @param sgntLen Length of signature. @param sgnt Pointer to `sgntLen` bytes where the signature is read from. diff --git a/include/internal/Hacl_Bignum25519_51.h b/include/internal/Hacl_Bignum25519_51.h index 9fe5e9fc..25a10503 100644 --- a/include/internal/Hacl_Bignum25519_51.h +++ b/include/internal/Hacl_Bignum25519_51.h @@ -84,6 +84,7 @@ Hacl_Impl_Curve25519_Field51_fmul( FStar_UInt128_uint128 *uu___ ) { + KRML_HOST_IGNORE(uu___); uint64_t f10 = f1[0U]; uint64_t f11 = f1[1U]; uint64_t f12 = f1[2U]; @@ -167,6 +168,7 @@ Hacl_Impl_Curve25519_Field51_fmul2( FStar_UInt128_uint128 *uu___ ) { + KRML_HOST_IGNORE(uu___); uint64_t f10 = f1[0U]; uint64_t f11 = f1[1U]; uint64_t f12 = f1[2U]; @@ -371,6 +373,7 @@ static inline void Hacl_Impl_Curve25519_Field51_fmul1(uint64_t *out, uint64_t *f static inline void Hacl_Impl_Curve25519_Field51_fsqr(uint64_t *out, uint64_t *f, FStar_UInt128_uint128 *uu___) { + KRML_HOST_IGNORE(uu___); uint64_t f0 = f[0U]; uint64_t f1 = f[1U]; uint64_t f2 = f[2U]; @@ -446,6 +449,7 @@ Hacl_Impl_Curve25519_Field51_fsqr(uint64_t *out, uint64_t *f, FStar_UInt128_uint static inline void Hacl_Impl_Curve25519_Field51_fsqr2(uint64_t *out, uint64_t *f, FStar_UInt128_uint128 *uu___) { + KRML_HOST_IGNORE(uu___); uint64_t f10 = f[0U]; uint64_t f11 = f[1U]; uint64_t f12 = f[2U]; diff --git a/include/msvc/Hacl_RSAPSS.h b/include/msvc/Hacl_RSAPSS.h index 8f4de949..90bd69ce 100644 --- a/include/msvc/Hacl_RSAPSS.h +++ b/include/msvc/Hacl_RSAPSS.h @@ -43,9 +43,9 @@ extern "C" { Sign a message `msg` and write the signature to `sgnt`. @param a Hash algorithm to use. Allowed values for `a` are ... - * Spec_Hash_Definitions_SHA2_256, - * Spec_Hash_Definitions_SHA2_384, and - * Spec_Hash_Definitions_SHA2_512. + - Spec_Hash_Definitions_SHA2_256, + - Spec_Hash_Definitions_SHA2_384, and + - Spec_Hash_Definitions_SHA2_512. @param modBits Count of bits in the modulus (`n`). @param eBits Count of bits in `e` value. @param dBits Count of bits in `d` value. @@ -75,7 +75,10 @@ Hacl_RSAPSS_rsapss_sign( /** Verify the signature `sgnt` of a message `msg`. -@param a Hash algorithm to use. +@param a Hash algorithm to use. Allowed values for `a` are ... + - Spec_Hash_Definitions_SHA2_256, + - Spec_Hash_Definitions_SHA2_384, and + - Spec_Hash_Definitions_SHA2_512. @param modBits Count of bits in the modulus (`n`). @param eBits Count of bits in `e` value. @param pkey Pointer to public key created by `Hacl_RSAPSS_new_rsapss_load_pkey`. @@ -105,10 +108,10 @@ Load a public key from key parts. @param modBits Count of bits in modulus (`n`). @param eBits Count of bits in `e` value. -@param nb Pointer to `ceil(modBits / 8)` bytes where the modulus (`n`) is read from. -@param eb Pointer to `ceil(modBits / 8)` bytes where the `e` value is read from. +@param nb Pointer to `ceil(modBits / 8)` bytes where the modulus (`n`), in big-endian byte order, is read from. +@param eb Pointer to `ceil(modBits / 8)` bytes where the `e` value, in big-endian byte order, is read from. -@return Returns an allocated public key. Note: caller must take care to `free()` the created key. +@return Returns an allocated public key upon success, otherwise, `NULL` if key part arguments are invalid or memory allocation fails. Note: caller must take care to `free()` the created key. */ uint64_t *Hacl_RSAPSS_new_rsapss_load_pkey(uint32_t modBits, uint32_t eBits, uint8_t *nb, uint8_t *eb); @@ -119,11 +122,11 @@ Load a secret key from key parts. @param modBits Count of bits in modulus (`n`). @param eBits Count of bits in `e` value. @param dBits Count of bits in `d` value. -@param nb Pointer to `ceil(modBits / 8)` bytes where the modulus (`n`) is read from. -@param eb Pointer to `ceil(modBits / 8)` bytes where the `e` value is read from. -@param db Pointer to `ceil(modBits / 8)` bytes where the `d` value is read from. +@param nb Pointer to `ceil(modBits / 8)` bytes where the modulus (`n`), in big-endian byte order, is read from. +@param eb Pointer to `ceil(modBits / 8)` bytes where the `e` value, in big-endian byte order, is read from. +@param db Pointer to `ceil(modBits / 8)` bytes where the `d` value, in big-endian byte order, is read from. -@return Returns an allocated secret key. Note: caller must take care to `free()` the created key. +@return Returns an allocated secret key upon success, otherwise, `NULL` if key part arguments are invalid or memory allocation fails. Note: caller must take care to `free()` the created key. */ uint64_t *Hacl_RSAPSS_new_rsapss_load_skey( @@ -138,13 +141,16 @@ uint64_t /** Sign a message `msg` and write the signature to `sgnt`. -@param a Hash algorithm to use. +@param a Hash algorithm to use. Allowed values for `a` are ... + - Spec_Hash_Definitions_SHA2_256, + - Spec_Hash_Definitions_SHA2_384, and + - Spec_Hash_Definitions_SHA2_512. @param modBits Count of bits in the modulus (`n`). @param eBits Count of bits in `e` value. @param dBits Count of bits in `d` value. -@param nb Pointer to `ceil(modBits / 8)` bytes where the modulus (`n`) is read from. -@param eb Pointer to `ceil(modBits / 8)` bytes where the `e` value is read from. -@param db Pointer to `ceil(modBits / 8)` bytes where the `d` value is read from. +@param nb Pointer to `ceil(modBits / 8)` bytes where the modulus (`n`), in big-endian byte order, is read from. +@param eb Pointer to `ceil(modBits / 8)` bytes where the `e` value, in big-endian byte order, is read from. +@param db Pointer to `ceil(modBits / 8)` bytes where the `d` value, in big-endian byte order, is read from. @param saltLen Length of salt. @param salt Pointer to `saltLen` bytes where the salt is read from. @param msgLen Length of message. @@ -172,11 +178,14 @@ Hacl_RSAPSS_rsapss_skey_sign( /** Verify the signature `sgnt` of a message `msg`. -@param a Hash algorithm to use. +@param a Hash algorithm to use. Allowed values for `a` are ... + - Spec_Hash_Definitions_SHA2_256, + - Spec_Hash_Definitions_SHA2_384, and + - Spec_Hash_Definitions_SHA2_512. @param modBits Count of bits in the modulus (`n`). @param eBits Count of bits in `e` value. -@param nb Pointer to `ceil(modBits / 8)` bytes where the modulus (`n`) is read from. -@param eb Pointer to `ceil(modBits / 8)` bytes where the `e` value is read from. +@param nb Pointer to `ceil(modBits / 8)` bytes where the modulus (`n`), in big-endian byte order, is read from. +@param eb Pointer to `ceil(modBits / 8)` bytes where the `e` value, in big-endian byte order, is read from. @param saltLen Length of salt. @param sgntLen Length of signature. @param sgnt Pointer to `sgntLen` bytes where the signature is read from. diff --git a/include/msvc/internal/Hacl_Bignum25519_51.h b/include/msvc/internal/Hacl_Bignum25519_51.h index 9fe5e9fc..25a10503 100644 --- a/include/msvc/internal/Hacl_Bignum25519_51.h +++ b/include/msvc/internal/Hacl_Bignum25519_51.h @@ -84,6 +84,7 @@ Hacl_Impl_Curve25519_Field51_fmul( FStar_UInt128_uint128 *uu___ ) { + KRML_HOST_IGNORE(uu___); uint64_t f10 = f1[0U]; uint64_t f11 = f1[1U]; uint64_t f12 = f1[2U]; @@ -167,6 +168,7 @@ Hacl_Impl_Curve25519_Field51_fmul2( FStar_UInt128_uint128 *uu___ ) { + KRML_HOST_IGNORE(uu___); uint64_t f10 = f1[0U]; uint64_t f11 = f1[1U]; uint64_t f12 = f1[2U]; @@ -371,6 +373,7 @@ static inline void Hacl_Impl_Curve25519_Field51_fmul1(uint64_t *out, uint64_t *f static inline void Hacl_Impl_Curve25519_Field51_fsqr(uint64_t *out, uint64_t *f, FStar_UInt128_uint128 *uu___) { + KRML_HOST_IGNORE(uu___); uint64_t f0 = f[0U]; uint64_t f1 = f[1U]; uint64_t f2 = f[2U]; @@ -446,6 +449,7 @@ Hacl_Impl_Curve25519_Field51_fsqr(uint64_t *out, uint64_t *f, FStar_UInt128_uint static inline void Hacl_Impl_Curve25519_Field51_fsqr2(uint64_t *out, uint64_t *f, FStar_UInt128_uint128 *uu___) { + KRML_HOST_IGNORE(uu___); uint64_t f10 = f[0U]; uint64_t f11 = f[1U]; uint64_t f12 = f[2U]; diff --git a/info.txt b/info.txt index 1a29e888..af3dbf98 100644 --- a/info.txt +++ b/info.txt @@ -1,5 +1,5 @@ The code was generated with the following toolchain. -F* version: 155853a14336aa0713dba7db5408f4c8ab512a06 -KaRaMeL version: db63c1de17565be0ec4989f58532717a04e3ff40 -HACL* version: ad60c9d98c9ce8f6a4fa13090511fa4b3a2c137b +F* version: bc622701c668f6b4092760879372968265d4a4e1 +KaRaMeL version: 7cffd27cfefbd220e986e561e8d350f043609f76 +HACL* version: 1b30697fc2b0d8d5e2f541eccfd3fb52b45b905c Vale version: 0.3.19 diff --git a/karamel/include/krml/internal/target.h b/karamel/include/krml/internal/target.h index 634c20fc..4903d224 100644 --- a/karamel/include/krml/internal/target.h +++ b/karamel/include/krml/internal/target.h @@ -57,6 +57,14 @@ # define KRML_HOST_IGNORE(x) (void)(x) #endif +#ifndef KRML_MAYBE_UNUSED +# if defined(__GNUC__) +# define KRML_MAYBE_UNUSED __attribute__((unused)) +# else +# define KRML_MAYBE_UNUSED +# endif +#endif + #ifndef KRML_NOINLINE # if defined(_MSC_VER) # define KRML_NOINLINE __declspec(noinline) diff --git a/karamel/krmllib/dist/minimal/Makefile.basic b/karamel/krmllib/dist/minimal/Makefile.basic deleted file mode 100644 index d7a1fdfd..00000000 --- a/karamel/krmllib/dist/minimal/Makefile.basic +++ /dev/null @@ -1,56 +0,0 @@ -# A basic Makefile that KaRaMeL copies in the output directory; this is not -# guaranteed to work and will only work well for very simple projects. This -# Makefile uses: -# - the custom C files passed to your krml invocation -# - the custom C flags passed to your krml invocation -# - the -o option passed to your krml invocation - -include Makefile.include - -ifeq (,$(KRML_HOME)) - $(error please define KRML_HOME to point to the root of your KaRaMeL git checkout) -endif - -CFLAGS += -I. -I $(KRML_HOME)/include -I $(KRML_HOME)/krmllib/dist/minimal -CFLAGS += -Wall -Wextra -Werror -std=c11 -Wno-unused-variable \ - -Wno-unknown-warning-option -Wno-unused-but-set-variable -Wno-unused-function \ - -Wno-unused-parameter -Wno-infinite-recursion \ - -g -fwrapv -D_BSD_SOURCE -D_DEFAULT_SOURCE -ifeq ($(OS),Windows_NT) -CFLAGS += -D__USE_MINGW_ANSI_STDIO -else -CFLAGS += -fPIC -endif -CFLAGS += $(USER_CFLAGS) - -SOURCES += $(ALL_C_FILES) $(USER_C_FILES) -ifneq (,$(BLACKLIST)) - SOURCES := $(filter-out $(BLACKLIST),$(SOURCES)) -endif -OBJS += $(patsubst %.c,%.o,$(SOURCES)) - -all: $(USER_TARGET) - -$(USER_TARGET): $(OBJS) - -AR ?= ar - -%.a: - $(AR) cr $@ $^ - -%.exe: - $(CC) $(CFLAGS) -o $@ $^ $(KRML_HOME)/krmllib/dist/generic/libkrmllib.a - -%.so: - $(CC) $(CFLAGS) -shared -o $@ $^ - -%.d: %.c - @set -e; rm -f $@; \ - $(CC) -MM -MG $(CFLAGS) $< > $@.$$$$; \ - sed 's,\($(notdir $*)\)\.o[ :]*,$(dir $@)\1.o $@ : ,g' < $@.$$$$ > $@; \ - rm -f $@.$$$$ - -include $(patsubst %.c,%.d,$(SOURCES)) - -clean: - rm -rf *.o *.d $(USER_TARGET) diff --git a/karamel/krmllib/dist/minimal/Makefile.include b/karamel/krmllib/dist/minimal/Makefile.include deleted file mode 100644 index ad532171..00000000 --- a/karamel/krmllib/dist/minimal/Makefile.include +++ /dev/null @@ -1,5 +0,0 @@ -USER_TARGET=libkrmllib.a -USER_CFLAGS= -USER_C_FILES=fstar_uint128.c -ALL_C_FILES= -ALL_H_FILES=FStar_UInt128.h FStar_UInt_8_16_32_64.h LowStar_Endianness.h diff --git a/karamel/krmllib/dist/minimal/fstar_uint128_gcc64.h b/karamel/krmllib/dist/minimal/fstar_uint128_gcc64.h index e40304b2..ae109004 100644 --- a/karamel/krmllib/dist/minimal/fstar_uint128_gcc64.h +++ b/karamel/krmllib/dist/minimal/fstar_uint128_gcc64.h @@ -110,7 +110,7 @@ inline static uint128_t FStar_UInt128_mul_wide(uint64_t x, uint64_t y) { inline static uint128_t FStar_UInt128_eq_mask(uint128_t x, uint128_t y) { uint64_t mask = FStar_UInt64_eq_mask((uint64_t)(x >> 64), (uint64_t)(y >> 64)) & - FStar_UInt64_eq_mask(x, y); + FStar_UInt64_eq_mask((uint64_t)x, (uint64_t)y); return ((uint128_t)mask) << 64 | mask; } @@ -118,7 +118,7 @@ inline static uint128_t FStar_UInt128_gte_mask(uint128_t x, uint128_t y) { uint64_t mask = (FStar_UInt64_gte_mask(x >> 64, y >> 64) & ~(FStar_UInt64_eq_mask(x >> 64, y >> 64))) | - (FStar_UInt64_eq_mask(x >> 64, y >> 64) & FStar_UInt64_gte_mask(x, y)); + (FStar_UInt64_eq_mask(x >> 64, y >> 64) & FStar_UInt64_gte_mask((uint64_t)x, (uint64_t)y)); return ((uint128_t)mask) << 64 | mask; } diff --git a/karamel/krmllib/dist/minimal/libkrmllib.def b/karamel/krmllib/dist/minimal/libkrmllib.def deleted file mode 100644 index c4ab8e38..00000000 --- a/karamel/krmllib/dist/minimal/libkrmllib.def +++ /dev/null @@ -1,11 +0,0 @@ -LIBRARY libkrmllib - -EXPORTS - FStar_UInt64_eq_mask - FStar_UInt64_gte_mask - FStar_UInt32_eq_mask - FStar_UInt32_gte_mask - FStar_UInt16_eq_mask - FStar_UInt16_gte_mask - FStar_UInt8_eq_mask - FStar_UInt8_gte_mask diff --git a/ocaml/ctypes.depend b/ocaml/ctypes.depend index 86af86df..31393b5e 100644 --- a/ocaml/ctypes.depend +++ b/ocaml/ctypes.depend @@ -1,4 +1,4 @@ -CTYPES_DEPS=lib/Hacl_Streaming_Types_stubs.cmx lib/Hacl_Streaming_Types_bindings.cmx lib/Hacl_Spec_stubs.cmx lib/Hacl_Spec_bindings.cmx lib/Hacl_Hash_Blake2_stubs.cmx lib/Hacl_Hash_Blake2_bindings.cmx lib/Hacl_Hash_Blake2b_256_stubs.cmx lib/Hacl_Hash_Blake2b_256_bindings.cmx lib/Hacl_Hash_Blake2s_128_stubs.cmx lib/Hacl_Hash_Blake2s_128_bindings.cmx lib/Hacl_Hash_SHA3_stubs.cmx lib/Hacl_Hash_SHA3_bindings.cmx lib/Hacl_Hash_Base_stubs.cmx lib/Hacl_Hash_Base_bindings.cmx lib/Hacl_Hash_MD5_stubs.cmx lib/Hacl_Hash_MD5_bindings.cmx lib/Hacl_Hash_SHA1_stubs.cmx lib/Hacl_Hash_SHA1_bindings.cmx lib/Hacl_SHA2_Types_stubs.cmx lib/Hacl_SHA2_Types_bindings.cmx lib/Hacl_Hash_SHA2_stubs.cmx lib/Hacl_Hash_SHA2_bindings.cmx lib/EverCrypt_Error_stubs.cmx lib/EverCrypt_Error_bindings.cmx lib/EverCrypt_AutoConfig2_stubs.cmx lib/EverCrypt_AutoConfig2_bindings.cmx lib/EverCrypt_Hash_stubs.cmx lib/EverCrypt_Hash_bindings.cmx lib/Hacl_Chacha20_stubs.cmx lib/Hacl_Chacha20_bindings.cmx lib/Hacl_Salsa20_stubs.cmx lib/Hacl_Salsa20_bindings.cmx lib/Hacl_Bignum_Base_stubs.cmx lib/Hacl_Bignum_Base_bindings.cmx lib/Hacl_Bignum_stubs.cmx lib/Hacl_Bignum_bindings.cmx lib/Hacl_Curve25519_64_stubs.cmx lib/Hacl_Curve25519_64_bindings.cmx lib/Hacl_Bignum25519_51_stubs.cmx lib/Hacl_Bignum25519_51_bindings.cmx lib/Hacl_Curve25519_51_stubs.cmx lib/Hacl_Curve25519_51_bindings.cmx lib/Hacl_Ed25519_stubs.cmx lib/Hacl_Ed25519_bindings.cmx lib/Hacl_Poly1305_32_stubs.cmx lib/Hacl_Poly1305_32_bindings.cmx lib/Hacl_Poly1305_128_stubs.cmx lib/Hacl_Poly1305_128_bindings.cmx lib/Hacl_Poly1305_256_stubs.cmx lib/Hacl_Poly1305_256_bindings.cmx lib/Hacl_NaCl_stubs.cmx lib/Hacl_NaCl_bindings.cmx lib/Hacl_P256_stubs.cmx lib/Hacl_P256_bindings.cmx lib/Hacl_Bignum_K256_stubs.cmx lib/Hacl_Bignum_K256_bindings.cmx lib/Hacl_K256_ECDSA_stubs.cmx lib/Hacl_K256_ECDSA_bindings.cmx lib/Hacl_Frodo_KEM_stubs.cmx lib/Hacl_Frodo_KEM_bindings.cmx lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_stubs.cmx lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_bindings.cmx lib/Hacl_IntTypes_Intrinsics_stubs.cmx lib/Hacl_IntTypes_Intrinsics_bindings.cmx lib/Hacl_IntTypes_Intrinsics_128_stubs.cmx lib/Hacl_IntTypes_Intrinsics_128_bindings.cmx lib/Hacl_RSAPSS_stubs.cmx lib/Hacl_RSAPSS_bindings.cmx lib/Hacl_FFDHE_stubs.cmx lib/Hacl_FFDHE_bindings.cmx lib/Hacl_Frodo640_stubs.cmx lib/Hacl_Frodo640_bindings.cmx lib/Hacl_Chacha20_Vec128_stubs.cmx lib/Hacl_Chacha20_Vec128_bindings.cmx lib/Hacl_Chacha20Poly1305_128_stubs.cmx lib/Hacl_Chacha20Poly1305_128_bindings.cmx lib/Hacl_HMAC_stubs.cmx lib/Hacl_HMAC_bindings.cmx lib/Hacl_HKDF_stubs.cmx lib/Hacl_HKDF_bindings.cmx lib/Hacl_HPKE_Curve51_CP128_SHA512_stubs.cmx lib/Hacl_HPKE_Curve51_CP128_SHA512_bindings.cmx lib/EverCrypt_Cipher_stubs.cmx lib/EverCrypt_Cipher_bindings.cmx lib/Hacl_GenericField32_stubs.cmx lib/Hacl_GenericField32_bindings.cmx lib/Hacl_SHA2_Vec256_stubs.cmx lib/Hacl_SHA2_Vec256_bindings.cmx lib/Hacl_EC_K256_stubs.cmx lib/Hacl_EC_K256_bindings.cmx lib/Hacl_Bignum4096_stubs.cmx lib/Hacl_Bignum4096_bindings.cmx lib/Hacl_Chacha20_Vec32_stubs.cmx lib/Hacl_Chacha20_Vec32_bindings.cmx lib/EverCrypt_Ed25519_stubs.cmx lib/EverCrypt_Ed25519_bindings.cmx lib/Hacl_Bignum4096_32_stubs.cmx lib/Hacl_Bignum4096_32_bindings.cmx lib/EverCrypt_HMAC_stubs.cmx lib/EverCrypt_HMAC_bindings.cmx lib/Hacl_HMAC_DRBG_stubs.cmx lib/Hacl_HMAC_DRBG_bindings.cmx lib/EverCrypt_DRBG_stubs.cmx lib/EverCrypt_DRBG_bindings.cmx lib/Hacl_HPKE_Curve64_CP128_SHA512_stubs.cmx lib/Hacl_HPKE_Curve64_CP128_SHA512_bindings.cmx lib/Hacl_HPKE_P256_CP128_SHA256_stubs.cmx lib/Hacl_HPKE_P256_CP128_SHA256_bindings.cmx lib/EverCrypt_Curve25519_stubs.cmx lib/EverCrypt_Curve25519_bindings.cmx lib/Hacl_Chacha20_Vec256_stubs.cmx lib/Hacl_Chacha20_Vec256_bindings.cmx lib/Hacl_Chacha20Poly1305_256_stubs.cmx lib/Hacl_Chacha20Poly1305_256_bindings.cmx lib/Hacl_HPKE_Curve51_CP256_SHA512_stubs.cmx lib/Hacl_HPKE_Curve51_CP256_SHA512_bindings.cmx lib/Hacl_Frodo976_stubs.cmx lib/Hacl_Frodo976_bindings.cmx lib/Hacl_HMAC_Blake2s_128_stubs.cmx lib/Hacl_HMAC_Blake2s_128_bindings.cmx lib/Hacl_HKDF_Blake2s_128_stubs.cmx lib/Hacl_HKDF_Blake2s_128_bindings.cmx lib/Hacl_GenericField64_stubs.cmx lib/Hacl_GenericField64_bindings.cmx lib/Hacl_Frodo1344_stubs.cmx lib/Hacl_Frodo1344_bindings.cmx lib/Hacl_HPKE_Curve64_CP256_SHA512_stubs.cmx lib/Hacl_HPKE_Curve64_CP256_SHA512_bindings.cmx lib/Hacl_Bignum32_stubs.cmx lib/Hacl_Bignum32_bindings.cmx lib/Hacl_HPKE_Curve51_CP128_SHA256_stubs.cmx lib/Hacl_HPKE_Curve51_CP128_SHA256_bindings.cmx lib/Hacl_HPKE_Curve64_CP128_SHA256_stubs.cmx lib/Hacl_HPKE_Curve64_CP128_SHA256_bindings.cmx lib/Hacl_Bignum256_32_stubs.cmx lib/Hacl_Bignum256_32_bindings.cmx lib/Hacl_SHA2_Vec128_stubs.cmx lib/Hacl_SHA2_Vec128_bindings.cmx lib/Hacl_Chacha20Poly1305_32_stubs.cmx lib/Hacl_Chacha20Poly1305_32_bindings.cmx lib/Hacl_HPKE_Curve51_CP32_SHA256_stubs.cmx lib/Hacl_HPKE_Curve51_CP32_SHA256_bindings.cmx lib/EverCrypt_Poly1305_stubs.cmx lib/EverCrypt_Poly1305_bindings.cmx lib/Hacl_HPKE_Curve64_CP256_SHA256_stubs.cmx lib/Hacl_HPKE_Curve64_CP256_SHA256_bindings.cmx lib/Hacl_Streaming_Poly1305_32_stubs.cmx lib/Hacl_Streaming_Poly1305_32_bindings.cmx lib/Hacl_HPKE_Curve51_CP32_SHA512_stubs.cmx lib/Hacl_HPKE_Curve51_CP32_SHA512_bindings.cmx lib/Hacl_Streaming_Blake2_stubs.cmx lib/Hacl_Streaming_Blake2_bindings.cmx lib/Hacl_HPKE_P256_CP256_SHA256_stubs.cmx lib/Hacl_HPKE_P256_CP256_SHA256_bindings.cmx lib/Hacl_HPKE_P256_CP32_SHA256_stubs.cmx lib/Hacl_HPKE_P256_CP32_SHA256_bindings.cmx lib/Hacl_Bignum64_stubs.cmx lib/Hacl_Bignum64_bindings.cmx lib/Hacl_Frodo64_stubs.cmx lib/Hacl_Frodo64_bindings.cmx lib/Hacl_HMAC_Blake2b_256_stubs.cmx lib/Hacl_HMAC_Blake2b_256_bindings.cmx lib/Hacl_HKDF_Blake2b_256_stubs.cmx lib/Hacl_HKDF_Blake2b_256_bindings.cmx lib/Hacl_HPKE_Curve64_CP32_SHA256_stubs.cmx lib/Hacl_HPKE_Curve64_CP32_SHA256_bindings.cmx lib/Hacl_HPKE_Curve64_CP32_SHA512_stubs.cmx lib/Hacl_HPKE_Curve64_CP32_SHA512_bindings.cmx lib/EverCrypt_HKDF_stubs.cmx lib/EverCrypt_HKDF_bindings.cmx lib/Hacl_EC_Ed25519_stubs.cmx lib/Hacl_EC_Ed25519_bindings.cmx lib/Hacl_HPKE_Curve51_CP256_SHA256_stubs.cmx lib/Hacl_HPKE_Curve51_CP256_SHA256_bindings.cmx lib/EverCrypt_Chacha20Poly1305_stubs.cmx lib/EverCrypt_Chacha20Poly1305_bindings.cmx lib/EverCrypt_AEAD_stubs.cmx lib/EverCrypt_AEAD_bindings.cmx lib/Hacl_Bignum256_stubs.cmx lib/Hacl_Bignum256_bindings.cmx +CTYPES_DEPS=lib/Hacl_Streaming_Types_stubs.cmx lib/Hacl_Streaming_Types_bindings.cmx lib/Hacl_Spec_stubs.cmx lib/Hacl_Spec_bindings.cmx lib/Hacl_Hash_Blake2_stubs.cmx lib/Hacl_Hash_Blake2_bindings.cmx lib/Hacl_Hash_Blake2b_256_stubs.cmx lib/Hacl_Hash_Blake2b_256_bindings.cmx lib/Hacl_Hash_Blake2s_128_stubs.cmx lib/Hacl_Hash_Blake2s_128_bindings.cmx lib/Hacl_Hash_SHA3_stubs.cmx lib/Hacl_Hash_SHA3_bindings.cmx lib/Hacl_Hash_Base_stubs.cmx lib/Hacl_Hash_Base_bindings.cmx lib/Hacl_Hash_MD5_stubs.cmx lib/Hacl_Hash_MD5_bindings.cmx lib/Hacl_Hash_SHA1_stubs.cmx lib/Hacl_Hash_SHA1_bindings.cmx lib/Hacl_SHA2_Types_stubs.cmx lib/Hacl_SHA2_Types_bindings.cmx lib/Hacl_Hash_SHA2_stubs.cmx lib/Hacl_Hash_SHA2_bindings.cmx lib/EverCrypt_Error_stubs.cmx lib/EverCrypt_Error_bindings.cmx lib/EverCrypt_AutoConfig2_stubs.cmx lib/EverCrypt_AutoConfig2_bindings.cmx lib/EverCrypt_Hash_stubs.cmx lib/EverCrypt_Hash_bindings.cmx lib/Hacl_Chacha20_stubs.cmx lib/Hacl_Chacha20_bindings.cmx lib/Hacl_Salsa20_stubs.cmx lib/Hacl_Salsa20_bindings.cmx lib/Hacl_Bignum_Base_stubs.cmx lib/Hacl_Bignum_Base_bindings.cmx lib/Hacl_Bignum_stubs.cmx lib/Hacl_Bignum_bindings.cmx lib/Hacl_Curve25519_64_stubs.cmx lib/Hacl_Curve25519_64_bindings.cmx lib/Hacl_Bignum25519_51_stubs.cmx lib/Hacl_Bignum25519_51_bindings.cmx lib/Hacl_Curve25519_51_stubs.cmx lib/Hacl_Curve25519_51_bindings.cmx lib/Hacl_Ed25519_stubs.cmx lib/Hacl_Ed25519_bindings.cmx lib/Hacl_Poly1305_32_stubs.cmx lib/Hacl_Poly1305_32_bindings.cmx lib/Hacl_Poly1305_128_stubs.cmx lib/Hacl_Poly1305_128_bindings.cmx lib/Hacl_Poly1305_256_stubs.cmx lib/Hacl_Poly1305_256_bindings.cmx lib/Hacl_NaCl_stubs.cmx lib/Hacl_NaCl_bindings.cmx lib/Hacl_P256_stubs.cmx lib/Hacl_P256_bindings.cmx lib/Hacl_Bignum_K256_stubs.cmx lib/Hacl_Bignum_K256_bindings.cmx lib/Hacl_K256_ECDSA_stubs.cmx lib/Hacl_K256_ECDSA_bindings.cmx lib/Hacl_Frodo_KEM_stubs.cmx lib/Hacl_Frodo_KEM_bindings.cmx lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_stubs.cmx lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_bindings.cmx lib/Hacl_IntTypes_Intrinsics_stubs.cmx lib/Hacl_IntTypes_Intrinsics_bindings.cmx lib/Hacl_IntTypes_Intrinsics_128_stubs.cmx lib/Hacl_IntTypes_Intrinsics_128_bindings.cmx lib/Hacl_RSAPSS_stubs.cmx lib/Hacl_RSAPSS_bindings.cmx lib/Hacl_FFDHE_stubs.cmx lib/Hacl_FFDHE_bindings.cmx lib/Hacl_Frodo640_stubs.cmx lib/Hacl_Frodo640_bindings.cmx lib/Hacl_Chacha20_Vec128_stubs.cmx lib/Hacl_Chacha20_Vec128_bindings.cmx lib/Hacl_Chacha20Poly1305_128_stubs.cmx lib/Hacl_Chacha20Poly1305_128_bindings.cmx lib/Hacl_HMAC_stubs.cmx lib/Hacl_HMAC_bindings.cmx lib/Hacl_HKDF_stubs.cmx lib/Hacl_HKDF_bindings.cmx lib/Hacl_HPKE_Curve51_CP128_SHA512_stubs.cmx lib/Hacl_HPKE_Curve51_CP128_SHA512_bindings.cmx lib/EverCrypt_Cipher_stubs.cmx lib/EverCrypt_Cipher_bindings.cmx lib/Hacl_GenericField32_stubs.cmx lib/Hacl_GenericField32_bindings.cmx lib/Hacl_SHA2_Vec256_stubs.cmx lib/Hacl_SHA2_Vec256_bindings.cmx lib/Hacl_EC_K256_stubs.cmx lib/Hacl_EC_K256_bindings.cmx lib/Hacl_Bignum4096_stubs.cmx lib/Hacl_Bignum4096_bindings.cmx lib/Hacl_Chacha20_Vec32_stubs.cmx lib/Hacl_Chacha20_Vec32_bindings.cmx lib/EverCrypt_Ed25519_stubs.cmx lib/EverCrypt_Ed25519_bindings.cmx lib/Hacl_Bignum4096_32_stubs.cmx lib/Hacl_Bignum4096_32_bindings.cmx lib/EverCrypt_HMAC_stubs.cmx lib/EverCrypt_HMAC_bindings.cmx lib/Hacl_HMAC_DRBG_stubs.cmx lib/Hacl_HMAC_DRBG_bindings.cmx lib/EverCrypt_DRBG_stubs.cmx lib/EverCrypt_DRBG_bindings.cmx lib/Hacl_HPKE_Curve64_CP128_SHA512_stubs.cmx lib/Hacl_HPKE_Curve64_CP128_SHA512_bindings.cmx lib/Hacl_HPKE_P256_CP128_SHA256_stubs.cmx lib/Hacl_HPKE_P256_CP128_SHA256_bindings.cmx lib/EverCrypt_Curve25519_stubs.cmx lib/EverCrypt_Curve25519_bindings.cmx lib/Hacl_Chacha20_Vec256_stubs.cmx lib/Hacl_Chacha20_Vec256_bindings.cmx lib/Hacl_Chacha20Poly1305_256_stubs.cmx lib/Hacl_Chacha20Poly1305_256_bindings.cmx lib/Hacl_HPKE_Curve51_CP256_SHA512_stubs.cmx lib/Hacl_HPKE_Curve51_CP256_SHA512_bindings.cmx lib/Hacl_Frodo976_stubs.cmx lib/Hacl_Frodo976_bindings.cmx lib/Hacl_HMAC_Blake2s_128_stubs.cmx lib/Hacl_HMAC_Blake2s_128_bindings.cmx lib/Hacl_HKDF_Blake2s_128_stubs.cmx lib/Hacl_HKDF_Blake2s_128_bindings.cmx lib/Hacl_GenericField64_stubs.cmx lib/Hacl_GenericField64_bindings.cmx lib/Hacl_Frodo1344_stubs.cmx lib/Hacl_Frodo1344_bindings.cmx lib/Hacl_HPKE_Curve64_CP256_SHA512_stubs.cmx lib/Hacl_HPKE_Curve64_CP256_SHA512_bindings.cmx lib/Hacl_Bignum32_stubs.cmx lib/Hacl_Bignum32_bindings.cmx lib/Hacl_HPKE_Curve51_CP128_SHA256_stubs.cmx lib/Hacl_HPKE_Curve51_CP128_SHA256_bindings.cmx lib/Hacl_HPKE_Curve64_CP128_SHA256_stubs.cmx lib/Hacl_HPKE_Curve64_CP128_SHA256_bindings.cmx lib/Hacl_Bignum256_32_stubs.cmx lib/Hacl_Bignum256_32_bindings.cmx lib/Hacl_SHA2_Vec128_stubs.cmx lib/Hacl_SHA2_Vec128_bindings.cmx lib/Hacl_Chacha20Poly1305_32_stubs.cmx lib/Hacl_Chacha20Poly1305_32_bindings.cmx lib/Hacl_HPKE_Curve51_CP32_SHA256_stubs.cmx lib/Hacl_HPKE_Curve51_CP32_SHA256_bindings.cmx lib/Hacl_HPKE_Curve64_CP256_SHA256_stubs.cmx lib/Hacl_HPKE_Curve64_CP256_SHA256_bindings.cmx lib/EverCrypt_Poly1305_stubs.cmx lib/EverCrypt_Poly1305_bindings.cmx lib/Hacl_Streaming_Poly1305_32_stubs.cmx lib/Hacl_Streaming_Poly1305_32_bindings.cmx lib/Hacl_HPKE_Curve51_CP32_SHA512_stubs.cmx lib/Hacl_HPKE_Curve51_CP32_SHA512_bindings.cmx lib/Hacl_Streaming_Blake2_stubs.cmx lib/Hacl_Streaming_Blake2_bindings.cmx lib/Hacl_HPKE_P256_CP256_SHA256_stubs.cmx lib/Hacl_HPKE_P256_CP256_SHA256_bindings.cmx lib/Hacl_HPKE_P256_CP32_SHA256_stubs.cmx lib/Hacl_HPKE_P256_CP32_SHA256_bindings.cmx lib/Hacl_Bignum64_stubs.cmx lib/Hacl_Bignum64_bindings.cmx lib/Hacl_Frodo64_stubs.cmx lib/Hacl_Frodo64_bindings.cmx lib/Hacl_HMAC_Blake2b_256_stubs.cmx lib/Hacl_HMAC_Blake2b_256_bindings.cmx lib/Hacl_HKDF_Blake2b_256_stubs.cmx lib/Hacl_HKDF_Blake2b_256_bindings.cmx lib/Hacl_HPKE_Curve64_CP32_SHA256_stubs.cmx lib/Hacl_HPKE_Curve64_CP32_SHA256_bindings.cmx lib/Hacl_HPKE_Curve64_CP32_SHA512_stubs.cmx lib/Hacl_HPKE_Curve64_CP32_SHA512_bindings.cmx lib/EverCrypt_HKDF_stubs.cmx lib/EverCrypt_HKDF_bindings.cmx lib/Hacl_EC_Ed25519_stubs.cmx lib/Hacl_EC_Ed25519_bindings.cmx lib/Hacl_HPKE_Curve51_CP256_SHA256_stubs.cmx lib/Hacl_HPKE_Curve51_CP256_SHA256_bindings.cmx lib/EverCrypt_Chacha20Poly1305_stubs.cmx lib/EverCrypt_Chacha20Poly1305_bindings.cmx lib/EverCrypt_AEAD_stubs.cmx lib/EverCrypt_AEAD_bindings.cmx lib/Hacl_Bignum256_stubs.cmx lib/Hacl_Bignum256_bindings.cmx lib/Hacl_Streaming_Types_bindings.cmx: lib/Hacl_Streaming_Types_bindings.cmo: lib_gen/Hacl_Streaming_Types_gen.cmx: lib/Hacl_Streaming_Types_bindings.cmx @@ -283,14 +283,14 @@ lib/Hacl_HPKE_Curve51_CP32_SHA256_bindings.cmx: lib/Hacl_HPKE_Interface_Hacl_Imp lib/Hacl_HPKE_Curve51_CP32_SHA256_bindings.cmo: lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_bindings.cmo lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_stubs.cmo lib_gen/Hacl_HPKE_Curve51_CP32_SHA256_gen.cmx: lib/Hacl_HPKE_Curve51_CP32_SHA256_bindings.cmx lib_gen/Hacl_HPKE_Curve51_CP32_SHA256_gen.exe: lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_bindings.cmx lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_stubs.cmx lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_c_stubs.o lib/Hacl_HPKE_Curve51_CP32_SHA256_bindings.cmx lib_gen/Hacl_HPKE_Curve51_CP32_SHA256_gen.cmx -lib/EverCrypt_Poly1305_bindings.cmx: -lib/EverCrypt_Poly1305_bindings.cmo: -lib_gen/EverCrypt_Poly1305_gen.cmx: lib/EverCrypt_Poly1305_bindings.cmx -lib_gen/EverCrypt_Poly1305_gen.exe: lib/EverCrypt_Poly1305_bindings.cmx lib_gen/EverCrypt_Poly1305_gen.cmx lib/Hacl_HPKE_Curve64_CP256_SHA256_bindings.cmx: lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_bindings.cmx lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_stubs.cmx lib/Hacl_HPKE_Curve64_CP256_SHA256_bindings.cmo: lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_bindings.cmo lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_stubs.cmo lib_gen/Hacl_HPKE_Curve64_CP256_SHA256_gen.cmx: lib/Hacl_HPKE_Curve64_CP256_SHA256_bindings.cmx lib_gen/Hacl_HPKE_Curve64_CP256_SHA256_gen.exe: lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_bindings.cmx lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_stubs.cmx lib/Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE_c_stubs.o lib/Hacl_HPKE_Curve64_CP256_SHA256_bindings.cmx lib_gen/Hacl_HPKE_Curve64_CP256_SHA256_gen.cmx +lib/EverCrypt_Poly1305_bindings.cmx: +lib/EverCrypt_Poly1305_bindings.cmo: +lib_gen/EverCrypt_Poly1305_gen.cmx: lib/EverCrypt_Poly1305_bindings.cmx +lib_gen/EverCrypt_Poly1305_gen.exe: lib/EverCrypt_Poly1305_bindings.cmx lib_gen/EverCrypt_Poly1305_gen.cmx lib/Hacl_Streaming_Poly1305_32_bindings.cmx: lib/Hacl_Streaming_Types_bindings.cmx lib/Hacl_Streaming_Types_stubs.cmx lib/Hacl_Streaming_Poly1305_32_bindings.cmo: lib/Hacl_Streaming_Types_bindings.cmo lib/Hacl_Streaming_Types_stubs.cmo lib_gen/Hacl_Streaming_Poly1305_32_gen.cmx: lib/Hacl_Streaming_Poly1305_32_bindings.cmx diff --git a/src/EverCrypt_AEAD.c b/src/EverCrypt_AEAD.c index 564dbc2e..d3a4ffbe 100644 --- a/src/EverCrypt_AEAD.c +++ b/src/EverCrypt_AEAD.c @@ -46,6 +46,8 @@ The state may be reused as many times as desired. */ bool EverCrypt_AEAD_uu___is_Ek(Spec_Agile_AEAD_alg a, EverCrypt_AEAD_state_s projectee) { + KRML_HOST_IGNORE(a); + KRML_HOST_IGNORE(projectee); return true; } @@ -58,8 +60,7 @@ Return the algorithm used in the AEAD state. */ Spec_Agile_AEAD_alg EverCrypt_AEAD_alg_of_state(EverCrypt_AEAD_state_s *s) { - EverCrypt_AEAD_state_s scrut = *s; - Spec_Cipher_Expansion_impl impl = scrut.impl; + Spec_Cipher_Expansion_impl impl = (*s).impl; switch (impl) { case Spec_Cipher_Expansion_Hacl_CHACHA20: @@ -97,6 +98,8 @@ create_in_chacha20_poly1305(EverCrypt_AEAD_state_s **dst, uint8_t *k) static EverCrypt_Error_error_code create_in_aes128_gcm(EverCrypt_AEAD_state_s **dst, uint8_t *k) { + KRML_HOST_IGNORE(dst); + KRML_HOST_IGNORE(k); #if HACL_CAN_COMPILE_VALE bool has_aesni = EverCrypt_AutoConfig2_has_aesni(); bool has_pclmulqdq = EverCrypt_AutoConfig2_has_pclmulqdq(); @@ -108,8 +111,8 @@ create_in_aes128_gcm(EverCrypt_AEAD_state_s **dst, uint8_t *k) uint8_t *ek = (uint8_t *)KRML_HOST_CALLOC((uint32_t)480U, sizeof (uint8_t)); uint8_t *keys_b = ek; uint8_t *hkeys_b = ek + (uint32_t)176U; - uint64_t scrut = aes128_key_expansion(k, keys_b); - uint64_t scrut0 = aes128_keyhash_init(keys_b, hkeys_b); + KRML_HOST_IGNORE(aes128_key_expansion(k, keys_b)); + KRML_HOST_IGNORE(aes128_keyhash_init(keys_b, hkeys_b)); EverCrypt_AEAD_state_s *p = (EverCrypt_AEAD_state_s *)KRML_HOST_MALLOC(sizeof (EverCrypt_AEAD_state_s)); p[0U] = ((EverCrypt_AEAD_state_s){ .impl = Spec_Cipher_Expansion_Vale_AES128, .ek = ek }); @@ -125,6 +128,8 @@ create_in_aes128_gcm(EverCrypt_AEAD_state_s **dst, uint8_t *k) static EverCrypt_Error_error_code create_in_aes256_gcm(EverCrypt_AEAD_state_s **dst, uint8_t *k) { + KRML_HOST_IGNORE(dst); + KRML_HOST_IGNORE(k); #if HACL_CAN_COMPILE_VALE bool has_aesni = EverCrypt_AutoConfig2_has_aesni(); bool has_pclmulqdq = EverCrypt_AutoConfig2_has_pclmulqdq(); @@ -136,8 +141,8 @@ create_in_aes256_gcm(EverCrypt_AEAD_state_s **dst, uint8_t *k) uint8_t *ek = (uint8_t *)KRML_HOST_CALLOC((uint32_t)544U, sizeof (uint8_t)); uint8_t *keys_b = ek; uint8_t *hkeys_b = ek + (uint32_t)240U; - uint64_t scrut = aes256_key_expansion(k, keys_b); - uint64_t scrut0 = aes256_keyhash_init(keys_b, hkeys_b); + KRML_HOST_IGNORE(aes256_key_expansion(k, keys_b)); + KRML_HOST_IGNORE(aes256_keyhash_init(keys_b, hkeys_b)); EverCrypt_AEAD_state_s *p = (EverCrypt_AEAD_state_s *)KRML_HOST_MALLOC(sizeof (EverCrypt_AEAD_state_s)); p[0U] = ((EverCrypt_AEAD_state_s){ .impl = Spec_Cipher_Expansion_Vale_AES256, .ek = ek }); @@ -203,6 +208,15 @@ encrypt_aes128_gcm( uint8_t *tag ) { + KRML_HOST_IGNORE(s); + KRML_HOST_IGNORE(iv); + KRML_HOST_IGNORE(iv_len); + KRML_HOST_IGNORE(ad); + KRML_HOST_IGNORE(ad_len); + KRML_HOST_IGNORE(plain); + KRML_HOST_IGNORE(plain_len); + KRML_HOST_IGNORE(cipher); + KRML_HOST_IGNORE(tag); #if HACL_CAN_COMPILE_VALE if (s == NULL) { @@ -212,8 +226,7 @@ encrypt_aes128_gcm( { return EverCrypt_Error_InvalidIVLength; } - EverCrypt_AEAD_state_s scrut = *s; - uint8_t *ek = scrut.ek; + uint8_t *ek = (*s).ek; uint8_t *scratch_b = ek + (uint32_t)304U; uint8_t *ek1 = ek; uint8_t *keys_b = ek1; @@ -223,8 +236,12 @@ encrypt_aes128_gcm( uint32_t bytes_len = len * (uint32_t)16U; uint8_t *iv_b = iv; memcpy(tmp_iv, iv + bytes_len, iv_len % (uint32_t)16U * sizeof (uint8_t)); - uint64_t - uu____0 = compute_iv_stdcall(iv_b, (uint64_t)iv_len, (uint64_t)len, tmp_iv, tmp_iv, hkeys_b); + KRML_HOST_IGNORE(compute_iv_stdcall(iv_b, + (uint64_t)iv_len, + (uint64_t)len, + tmp_iv, + tmp_iv, + hkeys_b)); uint8_t *inout_b = scratch_b; uint8_t *abytes_b = scratch_b + (uint32_t)16U; uint8_t *scratch_b1 = scratch_b + (uint32_t)32U; @@ -250,9 +267,7 @@ encrypt_aes128_gcm( uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; uint64_t len128x6_ = len128x6 / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; - uint64_t - scrut0 = - gcm128_encrypt_opt(auth_b_, + KRML_HOST_IGNORE(gcm128_encrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, keys_b, @@ -268,7 +283,7 @@ encrypt_aes128_gcm( inout_b, (uint64_t)plain_len, scratch_b1, - tag); + tag)); } else { @@ -281,9 +296,7 @@ encrypt_aes128_gcm( uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t len128x6_ = (uint64_t)0U; - uint64_t - scrut0 = - gcm128_encrypt_opt(auth_b_, + KRML_HOST_IGNORE(gcm128_encrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, keys_b, @@ -299,7 +312,7 @@ encrypt_aes128_gcm( inout_b, (uint64_t)plain_len, scratch_b1, - tag); + tag)); } memcpy(cipher + (uint32_t)(uint64_t)plain_len / (uint32_t)16U * (uint32_t)16U, inout_b, @@ -327,6 +340,15 @@ encrypt_aes256_gcm( uint8_t *tag ) { + KRML_HOST_IGNORE(s); + KRML_HOST_IGNORE(iv); + KRML_HOST_IGNORE(iv_len); + KRML_HOST_IGNORE(ad); + KRML_HOST_IGNORE(ad_len); + KRML_HOST_IGNORE(plain); + KRML_HOST_IGNORE(plain_len); + KRML_HOST_IGNORE(cipher); + KRML_HOST_IGNORE(tag); #if HACL_CAN_COMPILE_VALE if (s == NULL) { @@ -336,8 +358,7 @@ encrypt_aes256_gcm( { return EverCrypt_Error_InvalidIVLength; } - EverCrypt_AEAD_state_s scrut = *s; - uint8_t *ek = scrut.ek; + uint8_t *ek = (*s).ek; uint8_t *scratch_b = ek + (uint32_t)368U; uint8_t *ek1 = ek; uint8_t *keys_b = ek1; @@ -347,8 +368,12 @@ encrypt_aes256_gcm( uint32_t bytes_len = len * (uint32_t)16U; uint8_t *iv_b = iv; memcpy(tmp_iv, iv + bytes_len, iv_len % (uint32_t)16U * sizeof (uint8_t)); - uint64_t - uu____0 = compute_iv_stdcall(iv_b, (uint64_t)iv_len, (uint64_t)len, tmp_iv, tmp_iv, hkeys_b); + KRML_HOST_IGNORE(compute_iv_stdcall(iv_b, + (uint64_t)iv_len, + (uint64_t)len, + tmp_iv, + tmp_iv, + hkeys_b)); uint8_t *inout_b = scratch_b; uint8_t *abytes_b = scratch_b + (uint32_t)16U; uint8_t *scratch_b1 = scratch_b + (uint32_t)32U; @@ -374,9 +399,7 @@ encrypt_aes256_gcm( uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; uint64_t len128x6_ = len128x6 / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; - uint64_t - scrut0 = - gcm256_encrypt_opt(auth_b_, + KRML_HOST_IGNORE(gcm256_encrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, keys_b, @@ -392,7 +415,7 @@ encrypt_aes256_gcm( inout_b, (uint64_t)plain_len, scratch_b1, - tag); + tag)); } else { @@ -405,9 +428,7 @@ encrypt_aes256_gcm( uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t len128x6_ = (uint64_t)0U; - uint64_t - scrut0 = - gcm256_encrypt_opt(auth_b_, + KRML_HOST_IGNORE(gcm256_encrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, keys_b, @@ -423,7 +444,7 @@ encrypt_aes256_gcm( inout_b, (uint64_t)plain_len, scratch_b1, - tag); + tag)); } memcpy(cipher + (uint32_t)(uint64_t)plain_len / (uint32_t)16U * (uint32_t)16U, inout_b, @@ -525,27 +546,34 @@ EverCrypt_AEAD_encrypt_expand_aes128_gcm_no_check( uint8_t *tag ) { + KRML_HOST_IGNORE(k); + KRML_HOST_IGNORE(iv); + KRML_HOST_IGNORE(iv_len); + KRML_HOST_IGNORE(ad); + KRML_HOST_IGNORE(ad_len); + KRML_HOST_IGNORE(plain); + KRML_HOST_IGNORE(plain_len); + KRML_HOST_IGNORE(cipher); + KRML_HOST_IGNORE(tag); #if HACL_CAN_COMPILE_VALE uint8_t ek[480U] = { 0U }; uint8_t *keys_b0 = ek; uint8_t *hkeys_b0 = ek + (uint32_t)176U; - uint64_t scrut0 = aes128_key_expansion(k, keys_b0); - uint64_t scrut1 = aes128_keyhash_init(keys_b0, hkeys_b0); + KRML_HOST_IGNORE(aes128_key_expansion(k, keys_b0)); + KRML_HOST_IGNORE(aes128_keyhash_init(keys_b0, hkeys_b0)); EverCrypt_AEAD_state_s p = { .impl = Spec_Cipher_Expansion_Vale_AES128, .ek = ek }; EverCrypt_AEAD_state_s *s = &p; - EverCrypt_Error_error_code r; if (s == NULL) { - r = EverCrypt_Error_InvalidKey; + KRML_HOST_IGNORE(EverCrypt_Error_InvalidKey); } else if (iv_len == (uint32_t)0U) { - r = EverCrypt_Error_InvalidIVLength; + KRML_HOST_IGNORE(EverCrypt_Error_InvalidIVLength); } else { - EverCrypt_AEAD_state_s scrut = *s; - uint8_t *ek0 = scrut.ek; + uint8_t *ek0 = (*s).ek; uint8_t *scratch_b = ek0 + (uint32_t)304U; uint8_t *ek1 = ek0; uint8_t *keys_b = ek1; @@ -555,8 +583,12 @@ EverCrypt_AEAD_encrypt_expand_aes128_gcm_no_check( uint32_t bytes_len = len * (uint32_t)16U; uint8_t *iv_b = iv; memcpy(tmp_iv, iv + bytes_len, iv_len % (uint32_t)16U * sizeof (uint8_t)); - uint64_t - uu____0 = compute_iv_stdcall(iv_b, (uint64_t)iv_len, (uint64_t)len, tmp_iv, tmp_iv, hkeys_b); + KRML_HOST_IGNORE(compute_iv_stdcall(iv_b, + (uint64_t)iv_len, + (uint64_t)len, + tmp_iv, + tmp_iv, + hkeys_b)); uint8_t *inout_b = scratch_b; uint8_t *abytes_b = scratch_b + (uint32_t)16U; uint8_t *scratch_b1 = scratch_b + (uint32_t)32U; @@ -582,9 +614,7 @@ EverCrypt_AEAD_encrypt_expand_aes128_gcm_no_check( uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; uint64_t len128x6_ = len128x6 / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; - uint64_t - scrut2 = - gcm128_encrypt_opt(auth_b_, + KRML_HOST_IGNORE(gcm128_encrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, keys_b, @@ -600,7 +630,7 @@ EverCrypt_AEAD_encrypt_expand_aes128_gcm_no_check( inout_b, (uint64_t)plain_len, scratch_b1, - tag); + tag)); } else { @@ -613,9 +643,7 @@ EverCrypt_AEAD_encrypt_expand_aes128_gcm_no_check( uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t len128x6_ = (uint64_t)0U; - uint64_t - scrut2 = - gcm128_encrypt_opt(auth_b_, + KRML_HOST_IGNORE(gcm128_encrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, keys_b, @@ -631,12 +659,12 @@ EverCrypt_AEAD_encrypt_expand_aes128_gcm_no_check( inout_b, (uint64_t)plain_len, scratch_b1, - tag); + tag)); } memcpy(cipher + (uint32_t)(uint64_t)plain_len / (uint32_t)16U * (uint32_t)16U, inout_b, (uint32_t)(uint64_t)plain_len % (uint32_t)16U * sizeof (uint8_t)); - r = EverCrypt_Error_Success; + KRML_HOST_IGNORE(EverCrypt_Error_Success); } return EverCrypt_Error_Success; #else @@ -669,27 +697,34 @@ EverCrypt_AEAD_encrypt_expand_aes256_gcm_no_check( uint8_t *tag ) { + KRML_HOST_IGNORE(k); + KRML_HOST_IGNORE(iv); + KRML_HOST_IGNORE(iv_len); + KRML_HOST_IGNORE(ad); + KRML_HOST_IGNORE(ad_len); + KRML_HOST_IGNORE(plain); + KRML_HOST_IGNORE(plain_len); + KRML_HOST_IGNORE(cipher); + KRML_HOST_IGNORE(tag); #if HACL_CAN_COMPILE_VALE uint8_t ek[544U] = { 0U }; uint8_t *keys_b0 = ek; uint8_t *hkeys_b0 = ek + (uint32_t)240U; - uint64_t scrut0 = aes256_key_expansion(k, keys_b0); - uint64_t scrut1 = aes256_keyhash_init(keys_b0, hkeys_b0); + KRML_HOST_IGNORE(aes256_key_expansion(k, keys_b0)); + KRML_HOST_IGNORE(aes256_keyhash_init(keys_b0, hkeys_b0)); EverCrypt_AEAD_state_s p = { .impl = Spec_Cipher_Expansion_Vale_AES256, .ek = ek }; EverCrypt_AEAD_state_s *s = &p; - EverCrypt_Error_error_code r; if (s == NULL) { - r = EverCrypt_Error_InvalidKey; + KRML_HOST_IGNORE(EverCrypt_Error_InvalidKey); } else if (iv_len == (uint32_t)0U) { - r = EverCrypt_Error_InvalidIVLength; + KRML_HOST_IGNORE(EverCrypt_Error_InvalidIVLength); } else { - EverCrypt_AEAD_state_s scrut = *s; - uint8_t *ek0 = scrut.ek; + uint8_t *ek0 = (*s).ek; uint8_t *scratch_b = ek0 + (uint32_t)368U; uint8_t *ek1 = ek0; uint8_t *keys_b = ek1; @@ -699,8 +734,12 @@ EverCrypt_AEAD_encrypt_expand_aes256_gcm_no_check( uint32_t bytes_len = len * (uint32_t)16U; uint8_t *iv_b = iv; memcpy(tmp_iv, iv + bytes_len, iv_len % (uint32_t)16U * sizeof (uint8_t)); - uint64_t - uu____0 = compute_iv_stdcall(iv_b, (uint64_t)iv_len, (uint64_t)len, tmp_iv, tmp_iv, hkeys_b); + KRML_HOST_IGNORE(compute_iv_stdcall(iv_b, + (uint64_t)iv_len, + (uint64_t)len, + tmp_iv, + tmp_iv, + hkeys_b)); uint8_t *inout_b = scratch_b; uint8_t *abytes_b = scratch_b + (uint32_t)16U; uint8_t *scratch_b1 = scratch_b + (uint32_t)32U; @@ -726,9 +765,7 @@ EverCrypt_AEAD_encrypt_expand_aes256_gcm_no_check( uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; uint64_t len128x6_ = len128x6 / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; - uint64_t - scrut2 = - gcm256_encrypt_opt(auth_b_, + KRML_HOST_IGNORE(gcm256_encrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, keys_b, @@ -744,7 +781,7 @@ EverCrypt_AEAD_encrypt_expand_aes256_gcm_no_check( inout_b, (uint64_t)plain_len, scratch_b1, - tag); + tag)); } else { @@ -757,9 +794,7 @@ EverCrypt_AEAD_encrypt_expand_aes256_gcm_no_check( uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t len128x6_ = (uint64_t)0U; - uint64_t - scrut2 = - gcm256_encrypt_opt(auth_b_, + KRML_HOST_IGNORE(gcm256_encrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, keys_b, @@ -775,12 +810,12 @@ EverCrypt_AEAD_encrypt_expand_aes256_gcm_no_check( inout_b, (uint64_t)plain_len, scratch_b1, - tag); + tag)); } memcpy(cipher + (uint32_t)(uint64_t)plain_len / (uint32_t)16U * (uint32_t)16U, inout_b, (uint32_t)(uint64_t)plain_len % (uint32_t)16U * sizeof (uint8_t)); - r = EverCrypt_Error_Success; + KRML_HOST_IGNORE(EverCrypt_Error_Success); } return EverCrypt_Error_Success; #else @@ -805,6 +840,15 @@ EverCrypt_AEAD_encrypt_expand_aes128_gcm( uint8_t *tag ) { + KRML_HOST_IGNORE(k); + KRML_HOST_IGNORE(iv); + KRML_HOST_IGNORE(iv_len); + KRML_HOST_IGNORE(ad); + KRML_HOST_IGNORE(ad_len); + KRML_HOST_IGNORE(plain); + KRML_HOST_IGNORE(plain_len); + KRML_HOST_IGNORE(cipher); + KRML_HOST_IGNORE(tag); #if HACL_CAN_COMPILE_VALE bool has_pclmulqdq = EverCrypt_AutoConfig2_has_pclmulqdq(); bool has_avx = EverCrypt_AutoConfig2_has_avx(); @@ -816,23 +860,21 @@ EverCrypt_AEAD_encrypt_expand_aes128_gcm( uint8_t ek[480U] = { 0U }; uint8_t *keys_b0 = ek; uint8_t *hkeys_b0 = ek + (uint32_t)176U; - uint64_t scrut0 = aes128_key_expansion(k, keys_b0); - uint64_t scrut1 = aes128_keyhash_init(keys_b0, hkeys_b0); + KRML_HOST_IGNORE(aes128_key_expansion(k, keys_b0)); + KRML_HOST_IGNORE(aes128_keyhash_init(keys_b0, hkeys_b0)); EverCrypt_AEAD_state_s p = { .impl = Spec_Cipher_Expansion_Vale_AES128, .ek = ek }; EverCrypt_AEAD_state_s *s = &p; - EverCrypt_Error_error_code r; if (s == NULL) { - r = EverCrypt_Error_InvalidKey; + KRML_HOST_IGNORE(EverCrypt_Error_InvalidKey); } else if (iv_len == (uint32_t)0U) { - r = EverCrypt_Error_InvalidIVLength; + KRML_HOST_IGNORE(EverCrypt_Error_InvalidIVLength); } else { - EverCrypt_AEAD_state_s scrut = *s; - uint8_t *ek0 = scrut.ek; + uint8_t *ek0 = (*s).ek; uint8_t *scratch_b = ek0 + (uint32_t)304U; uint8_t *ek1 = ek0; uint8_t *keys_b = ek1; @@ -842,8 +884,12 @@ EverCrypt_AEAD_encrypt_expand_aes128_gcm( uint32_t bytes_len = len * (uint32_t)16U; uint8_t *iv_b = iv; memcpy(tmp_iv, iv + bytes_len, iv_len % (uint32_t)16U * sizeof (uint8_t)); - uint64_t - uu____0 = compute_iv_stdcall(iv_b, (uint64_t)iv_len, (uint64_t)len, tmp_iv, tmp_iv, hkeys_b); + KRML_HOST_IGNORE(compute_iv_stdcall(iv_b, + (uint64_t)iv_len, + (uint64_t)len, + tmp_iv, + tmp_iv, + hkeys_b)); uint8_t *inout_b = scratch_b; uint8_t *abytes_b = scratch_b + (uint32_t)16U; uint8_t *scratch_b1 = scratch_b + (uint32_t)32U; @@ -869,9 +915,7 @@ EverCrypt_AEAD_encrypt_expand_aes128_gcm( uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; uint64_t len128x6_ = len128x6 / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; - uint64_t - scrut2 = - gcm128_encrypt_opt(auth_b_, + KRML_HOST_IGNORE(gcm128_encrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, keys_b, @@ -887,7 +931,7 @@ EverCrypt_AEAD_encrypt_expand_aes128_gcm( inout_b, (uint64_t)plain_len, scratch_b1, - tag); + tag)); } else { @@ -900,9 +944,7 @@ EverCrypt_AEAD_encrypt_expand_aes128_gcm( uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t len128x6_ = (uint64_t)0U; - uint64_t - scrut2 = - gcm128_encrypt_opt(auth_b_, + KRML_HOST_IGNORE(gcm128_encrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, keys_b, @@ -918,12 +960,12 @@ EverCrypt_AEAD_encrypt_expand_aes128_gcm( inout_b, (uint64_t)plain_len, scratch_b1, - tag); + tag)); } memcpy(cipher + (uint32_t)(uint64_t)plain_len / (uint32_t)16U * (uint32_t)16U, inout_b, (uint32_t)(uint64_t)plain_len % (uint32_t)16U * sizeof (uint8_t)); - r = EverCrypt_Error_Success; + KRML_HOST_IGNORE(EverCrypt_Error_Success); } return EverCrypt_Error_Success; } @@ -946,6 +988,15 @@ EverCrypt_AEAD_encrypt_expand_aes256_gcm( uint8_t *tag ) { + KRML_HOST_IGNORE(k); + KRML_HOST_IGNORE(iv); + KRML_HOST_IGNORE(iv_len); + KRML_HOST_IGNORE(ad); + KRML_HOST_IGNORE(ad_len); + KRML_HOST_IGNORE(plain); + KRML_HOST_IGNORE(plain_len); + KRML_HOST_IGNORE(cipher); + KRML_HOST_IGNORE(tag); #if HACL_CAN_COMPILE_VALE bool has_pclmulqdq = EverCrypt_AutoConfig2_has_pclmulqdq(); bool has_avx = EverCrypt_AutoConfig2_has_avx(); @@ -957,23 +1008,21 @@ EverCrypt_AEAD_encrypt_expand_aes256_gcm( uint8_t ek[544U] = { 0U }; uint8_t *keys_b0 = ek; uint8_t *hkeys_b0 = ek + (uint32_t)240U; - uint64_t scrut0 = aes256_key_expansion(k, keys_b0); - uint64_t scrut1 = aes256_keyhash_init(keys_b0, hkeys_b0); + KRML_HOST_IGNORE(aes256_key_expansion(k, keys_b0)); + KRML_HOST_IGNORE(aes256_keyhash_init(keys_b0, hkeys_b0)); EverCrypt_AEAD_state_s p = { .impl = Spec_Cipher_Expansion_Vale_AES256, .ek = ek }; EverCrypt_AEAD_state_s *s = &p; - EverCrypt_Error_error_code r; if (s == NULL) { - r = EverCrypt_Error_InvalidKey; + KRML_HOST_IGNORE(EverCrypt_Error_InvalidKey); } else if (iv_len == (uint32_t)0U) { - r = EverCrypt_Error_InvalidIVLength; + KRML_HOST_IGNORE(EverCrypt_Error_InvalidIVLength); } else { - EverCrypt_AEAD_state_s scrut = *s; - uint8_t *ek0 = scrut.ek; + uint8_t *ek0 = (*s).ek; uint8_t *scratch_b = ek0 + (uint32_t)368U; uint8_t *ek1 = ek0; uint8_t *keys_b = ek1; @@ -983,8 +1032,12 @@ EverCrypt_AEAD_encrypt_expand_aes256_gcm( uint32_t bytes_len = len * (uint32_t)16U; uint8_t *iv_b = iv; memcpy(tmp_iv, iv + bytes_len, iv_len % (uint32_t)16U * sizeof (uint8_t)); - uint64_t - uu____0 = compute_iv_stdcall(iv_b, (uint64_t)iv_len, (uint64_t)len, tmp_iv, tmp_iv, hkeys_b); + KRML_HOST_IGNORE(compute_iv_stdcall(iv_b, + (uint64_t)iv_len, + (uint64_t)len, + tmp_iv, + tmp_iv, + hkeys_b)); uint8_t *inout_b = scratch_b; uint8_t *abytes_b = scratch_b + (uint32_t)16U; uint8_t *scratch_b1 = scratch_b + (uint32_t)32U; @@ -1010,9 +1063,7 @@ EverCrypt_AEAD_encrypt_expand_aes256_gcm( uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; uint64_t len128x6_ = len128x6 / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; - uint64_t - scrut2 = - gcm256_encrypt_opt(auth_b_, + KRML_HOST_IGNORE(gcm256_encrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, keys_b, @@ -1028,7 +1079,7 @@ EverCrypt_AEAD_encrypt_expand_aes256_gcm( inout_b, (uint64_t)plain_len, scratch_b1, - tag); + tag)); } else { @@ -1041,9 +1092,7 @@ EverCrypt_AEAD_encrypt_expand_aes256_gcm( uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t len128x6_ = (uint64_t)0U; - uint64_t - scrut2 = - gcm256_encrypt_opt(auth_b_, + KRML_HOST_IGNORE(gcm256_encrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, keys_b, @@ -1059,12 +1108,12 @@ EverCrypt_AEAD_encrypt_expand_aes256_gcm( inout_b, (uint64_t)plain_len, scratch_b1, - tag); + tag)); } memcpy(cipher + (uint32_t)(uint64_t)plain_len / (uint32_t)16U * (uint32_t)16U, inout_b, (uint32_t)(uint64_t)plain_len % (uint32_t)16U * sizeof (uint8_t)); - r = EverCrypt_Error_Success; + KRML_HOST_IGNORE(EverCrypt_Error_Success); } return EverCrypt_Error_Success; } @@ -1087,12 +1136,12 @@ EverCrypt_AEAD_encrypt_expand_chacha20_poly1305( uint8_t *tag ) { + KRML_HOST_IGNORE(iv_len); uint8_t ek[32U] = { 0U }; EverCrypt_AEAD_state_s p = { .impl = Spec_Cipher_Expansion_Hacl_CHACHA20, .ek = ek }; memcpy(ek, k, (uint32_t)32U * sizeof (uint8_t)); EverCrypt_AEAD_state_s *s = &p; - EverCrypt_AEAD_state_s scrut = *s; - uint8_t *ek0 = scrut.ek; + uint8_t *ek0 = (*s).ek; EverCrypt_Chacha20Poly1305_aead_encrypt(ek0, iv, ad_len, ad, plain_len, plain, cipher, tag); return EverCrypt_Error_Success; } @@ -1173,6 +1222,15 @@ decrypt_aes128_gcm( uint8_t *dst ) { + KRML_HOST_IGNORE(s); + KRML_HOST_IGNORE(iv); + KRML_HOST_IGNORE(iv_len); + KRML_HOST_IGNORE(ad); + KRML_HOST_IGNORE(ad_len); + KRML_HOST_IGNORE(cipher); + KRML_HOST_IGNORE(cipher_len); + KRML_HOST_IGNORE(tag); + KRML_HOST_IGNORE(dst); #if HACL_CAN_COMPILE_VALE if (s == NULL) { @@ -1182,8 +1240,7 @@ decrypt_aes128_gcm( { return EverCrypt_Error_InvalidIVLength; } - EverCrypt_AEAD_state_s scrut = *s; - uint8_t *ek = scrut.ek; + uint8_t *ek = (*s).ek; uint8_t *scratch_b = ek + (uint32_t)304U; uint8_t *ek1 = ek; uint8_t *keys_b = ek1; @@ -1193,8 +1250,12 @@ decrypt_aes128_gcm( uint32_t bytes_len = len * (uint32_t)16U; uint8_t *iv_b = iv; memcpy(tmp_iv, iv + bytes_len, iv_len % (uint32_t)16U * sizeof (uint8_t)); - uint64_t - uu____0 = compute_iv_stdcall(iv_b, (uint64_t)iv_len, (uint64_t)len, tmp_iv, tmp_iv, hkeys_b); + KRML_HOST_IGNORE(compute_iv_stdcall(iv_b, + (uint64_t)iv_len, + (uint64_t)len, + tmp_iv, + tmp_iv, + hkeys_b)); uint8_t *inout_b = scratch_b; uint8_t *abytes_b = scratch_b + (uint32_t)16U; uint8_t *scratch_b1 = scratch_b + (uint32_t)32U; @@ -1222,7 +1283,7 @@ decrypt_aes128_gcm( uint64_t len128x6_ = len128x6 / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t - scrut0 = + c0 = gcm128_decrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, @@ -1240,7 +1301,6 @@ decrypt_aes128_gcm( (uint64_t)cipher_len, scratch_b1, tag); - uint64_t c0 = scrut0; c = c0; } else @@ -1255,7 +1315,7 @@ decrypt_aes128_gcm( uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t len128x6_ = (uint64_t)0U; uint64_t - scrut0 = + c0 = gcm128_decrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, @@ -1273,7 +1333,6 @@ decrypt_aes128_gcm( (uint64_t)cipher_len, scratch_b1, tag); - uint64_t c0 = scrut0; c = c0; } memcpy(dst + (uint32_t)(uint64_t)cipher_len / (uint32_t)16U * (uint32_t)16U, @@ -1307,6 +1366,15 @@ decrypt_aes256_gcm( uint8_t *dst ) { + KRML_HOST_IGNORE(s); + KRML_HOST_IGNORE(iv); + KRML_HOST_IGNORE(iv_len); + KRML_HOST_IGNORE(ad); + KRML_HOST_IGNORE(ad_len); + KRML_HOST_IGNORE(cipher); + KRML_HOST_IGNORE(cipher_len); + KRML_HOST_IGNORE(tag); + KRML_HOST_IGNORE(dst); #if HACL_CAN_COMPILE_VALE if (s == NULL) { @@ -1316,8 +1384,7 @@ decrypt_aes256_gcm( { return EverCrypt_Error_InvalidIVLength; } - EverCrypt_AEAD_state_s scrut = *s; - uint8_t *ek = scrut.ek; + uint8_t *ek = (*s).ek; uint8_t *scratch_b = ek + (uint32_t)368U; uint8_t *ek1 = ek; uint8_t *keys_b = ek1; @@ -1327,8 +1394,12 @@ decrypt_aes256_gcm( uint32_t bytes_len = len * (uint32_t)16U; uint8_t *iv_b = iv; memcpy(tmp_iv, iv + bytes_len, iv_len % (uint32_t)16U * sizeof (uint8_t)); - uint64_t - uu____0 = compute_iv_stdcall(iv_b, (uint64_t)iv_len, (uint64_t)len, tmp_iv, tmp_iv, hkeys_b); + KRML_HOST_IGNORE(compute_iv_stdcall(iv_b, + (uint64_t)iv_len, + (uint64_t)len, + tmp_iv, + tmp_iv, + hkeys_b)); uint8_t *inout_b = scratch_b; uint8_t *abytes_b = scratch_b + (uint32_t)16U; uint8_t *scratch_b1 = scratch_b + (uint32_t)32U; @@ -1356,7 +1427,7 @@ decrypt_aes256_gcm( uint64_t len128x6_ = len128x6 / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t - scrut0 = + c0 = gcm256_decrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, @@ -1374,7 +1445,6 @@ decrypt_aes256_gcm( (uint64_t)cipher_len, scratch_b1, tag); - uint64_t c0 = scrut0; c = c0; } else @@ -1389,7 +1459,7 @@ decrypt_aes256_gcm( uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t len128x6_ = (uint64_t)0U; uint64_t - scrut0 = + c0 = gcm256_decrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, @@ -1407,7 +1477,6 @@ decrypt_aes256_gcm( (uint64_t)cipher_len, scratch_b1, tag); - uint64_t c0 = scrut0; c = c0; } memcpy(dst + (uint32_t)(uint64_t)cipher_len / (uint32_t)16U * (uint32_t)16U, @@ -1449,8 +1518,7 @@ decrypt_chacha20_poly1305( { return EverCrypt_Error_InvalidIVLength; } - EverCrypt_AEAD_state_s scrut = *s; - uint8_t *ek = scrut.ek; + uint8_t *ek = (*s).ek; uint32_t r = EverCrypt_Chacha20Poly1305_aead_decrypt(ek, iv, ad_len, ad, cipher_len, dst, cipher, tag); if (r == (uint32_t)0U) @@ -1508,8 +1576,7 @@ EverCrypt_AEAD_decrypt( { return EverCrypt_Error_InvalidKey; } - EverCrypt_AEAD_state_s scrut = *s; - Spec_Cipher_Expansion_impl i = scrut.impl; + Spec_Cipher_Expansion_impl i = (*s).impl; switch (i) { case Spec_Cipher_Expansion_Vale_AES128: @@ -1553,12 +1620,21 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm_no_check( uint8_t *dst ) { + KRML_HOST_IGNORE(k); + KRML_HOST_IGNORE(iv); + KRML_HOST_IGNORE(iv_len); + KRML_HOST_IGNORE(ad); + KRML_HOST_IGNORE(ad_len); + KRML_HOST_IGNORE(cipher); + KRML_HOST_IGNORE(cipher_len); + KRML_HOST_IGNORE(tag); + KRML_HOST_IGNORE(dst); #if HACL_CAN_COMPILE_VALE uint8_t ek[480U] = { 0U }; uint8_t *keys_b0 = ek; uint8_t *hkeys_b0 = ek + (uint32_t)176U; - uint64_t scrut = aes128_key_expansion(k, keys_b0); - uint64_t scrut0 = aes128_keyhash_init(keys_b0, hkeys_b0); + KRML_HOST_IGNORE(aes128_key_expansion(k, keys_b0)); + KRML_HOST_IGNORE(aes128_keyhash_init(keys_b0, hkeys_b0)); EverCrypt_AEAD_state_s p = { .impl = Spec_Cipher_Expansion_Vale_AES128, .ek = ek }; EverCrypt_AEAD_state_s *s = &p; if (s == NULL) @@ -1569,8 +1645,7 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm_no_check( { return EverCrypt_Error_InvalidIVLength; } - EverCrypt_AEAD_state_s scrut1 = *s; - uint8_t *ek0 = scrut1.ek; + uint8_t *ek0 = (*s).ek; uint8_t *scratch_b = ek0 + (uint32_t)304U; uint8_t *ek1 = ek0; uint8_t *keys_b = ek1; @@ -1580,8 +1655,12 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm_no_check( uint32_t bytes_len = len * (uint32_t)16U; uint8_t *iv_b = iv; memcpy(tmp_iv, iv + bytes_len, iv_len % (uint32_t)16U * sizeof (uint8_t)); - uint64_t - uu____0 = compute_iv_stdcall(iv_b, (uint64_t)iv_len, (uint64_t)len, tmp_iv, tmp_iv, hkeys_b); + KRML_HOST_IGNORE(compute_iv_stdcall(iv_b, + (uint64_t)iv_len, + (uint64_t)len, + tmp_iv, + tmp_iv, + hkeys_b)); uint8_t *inout_b = scratch_b; uint8_t *abytes_b = scratch_b + (uint32_t)16U; uint8_t *scratch_b1 = scratch_b + (uint32_t)32U; @@ -1609,7 +1688,7 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm_no_check( uint64_t len128x6_ = len128x6 / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t - scrut2 = + c0 = gcm128_decrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, @@ -1627,7 +1706,6 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm_no_check( (uint64_t)cipher_len, scratch_b1, tag); - uint64_t c0 = scrut2; c = c0; } else @@ -1642,7 +1720,7 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm_no_check( uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t len128x6_ = (uint64_t)0U; uint64_t - scrut2 = + c0 = gcm128_decrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, @@ -1660,7 +1738,6 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm_no_check( (uint64_t)cipher_len, scratch_b1, tag); - uint64_t c0 = scrut2; c = c0; } memcpy(dst + (uint32_t)(uint64_t)cipher_len / (uint32_t)16U * (uint32_t)16U, @@ -1702,12 +1779,21 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm_no_check( uint8_t *dst ) { + KRML_HOST_IGNORE(k); + KRML_HOST_IGNORE(iv); + KRML_HOST_IGNORE(iv_len); + KRML_HOST_IGNORE(ad); + KRML_HOST_IGNORE(ad_len); + KRML_HOST_IGNORE(cipher); + KRML_HOST_IGNORE(cipher_len); + KRML_HOST_IGNORE(tag); + KRML_HOST_IGNORE(dst); #if HACL_CAN_COMPILE_VALE uint8_t ek[544U] = { 0U }; uint8_t *keys_b0 = ek; uint8_t *hkeys_b0 = ek + (uint32_t)240U; - uint64_t scrut = aes256_key_expansion(k, keys_b0); - uint64_t scrut0 = aes256_keyhash_init(keys_b0, hkeys_b0); + KRML_HOST_IGNORE(aes256_key_expansion(k, keys_b0)); + KRML_HOST_IGNORE(aes256_keyhash_init(keys_b0, hkeys_b0)); EverCrypt_AEAD_state_s p = { .impl = Spec_Cipher_Expansion_Vale_AES256, .ek = ek }; EverCrypt_AEAD_state_s *s = &p; if (s == NULL) @@ -1718,8 +1804,7 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm_no_check( { return EverCrypt_Error_InvalidIVLength; } - EverCrypt_AEAD_state_s scrut1 = *s; - uint8_t *ek0 = scrut1.ek; + uint8_t *ek0 = (*s).ek; uint8_t *scratch_b = ek0 + (uint32_t)368U; uint8_t *ek1 = ek0; uint8_t *keys_b = ek1; @@ -1729,8 +1814,12 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm_no_check( uint32_t bytes_len = len * (uint32_t)16U; uint8_t *iv_b = iv; memcpy(tmp_iv, iv + bytes_len, iv_len % (uint32_t)16U * sizeof (uint8_t)); - uint64_t - uu____0 = compute_iv_stdcall(iv_b, (uint64_t)iv_len, (uint64_t)len, tmp_iv, tmp_iv, hkeys_b); + KRML_HOST_IGNORE(compute_iv_stdcall(iv_b, + (uint64_t)iv_len, + (uint64_t)len, + tmp_iv, + tmp_iv, + hkeys_b)); uint8_t *inout_b = scratch_b; uint8_t *abytes_b = scratch_b + (uint32_t)16U; uint8_t *scratch_b1 = scratch_b + (uint32_t)32U; @@ -1758,7 +1847,7 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm_no_check( uint64_t len128x6_ = len128x6 / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t - scrut2 = + c0 = gcm256_decrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, @@ -1776,7 +1865,6 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm_no_check( (uint64_t)cipher_len, scratch_b1, tag); - uint64_t c0 = scrut2; c = c0; } else @@ -1791,7 +1879,7 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm_no_check( uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t len128x6_ = (uint64_t)0U; uint64_t - scrut2 = + c0 = gcm256_decrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, @@ -1809,7 +1897,6 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm_no_check( (uint64_t)cipher_len, scratch_b1, tag); - uint64_t c0 = scrut2; c = c0; } memcpy(dst + (uint32_t)(uint64_t)cipher_len / (uint32_t)16U * (uint32_t)16U, @@ -1843,6 +1930,15 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm( uint8_t *dst ) { + KRML_HOST_IGNORE(k); + KRML_HOST_IGNORE(iv); + KRML_HOST_IGNORE(iv_len); + KRML_HOST_IGNORE(ad); + KRML_HOST_IGNORE(ad_len); + KRML_HOST_IGNORE(cipher); + KRML_HOST_IGNORE(cipher_len); + KRML_HOST_IGNORE(tag); + KRML_HOST_IGNORE(dst); #if HACL_CAN_COMPILE_VALE bool has_pclmulqdq = EverCrypt_AutoConfig2_has_pclmulqdq(); bool has_avx = EverCrypt_AutoConfig2_has_avx(); @@ -1854,8 +1950,8 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm( uint8_t ek[480U] = { 0U }; uint8_t *keys_b0 = ek; uint8_t *hkeys_b0 = ek + (uint32_t)176U; - uint64_t scrut = aes128_key_expansion(k, keys_b0); - uint64_t scrut0 = aes128_keyhash_init(keys_b0, hkeys_b0); + KRML_HOST_IGNORE(aes128_key_expansion(k, keys_b0)); + KRML_HOST_IGNORE(aes128_keyhash_init(keys_b0, hkeys_b0)); EverCrypt_AEAD_state_s p = { .impl = Spec_Cipher_Expansion_Vale_AES128, .ek = ek }; EverCrypt_AEAD_state_s *s = &p; if (s == NULL) @@ -1866,8 +1962,7 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm( { return EverCrypt_Error_InvalidIVLength; } - EverCrypt_AEAD_state_s scrut1 = *s; - uint8_t *ek0 = scrut1.ek; + uint8_t *ek0 = (*s).ek; uint8_t *scratch_b = ek0 + (uint32_t)304U; uint8_t *ek1 = ek0; uint8_t *keys_b = ek1; @@ -1877,8 +1972,12 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm( uint32_t bytes_len = len * (uint32_t)16U; uint8_t *iv_b = iv; memcpy(tmp_iv, iv + bytes_len, iv_len % (uint32_t)16U * sizeof (uint8_t)); - uint64_t - uu____0 = compute_iv_stdcall(iv_b, (uint64_t)iv_len, (uint64_t)len, tmp_iv, tmp_iv, hkeys_b); + KRML_HOST_IGNORE(compute_iv_stdcall(iv_b, + (uint64_t)iv_len, + (uint64_t)len, + tmp_iv, + tmp_iv, + hkeys_b)); uint8_t *inout_b = scratch_b; uint8_t *abytes_b = scratch_b + (uint32_t)16U; uint8_t *scratch_b1 = scratch_b + (uint32_t)32U; @@ -1906,7 +2005,7 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm( uint64_t len128x6_ = len128x6 / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t - scrut2 = + c0 = gcm128_decrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, @@ -1924,7 +2023,6 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm( (uint64_t)cipher_len, scratch_b1, tag); - uint64_t c0 = scrut2; c = c0; } else @@ -1939,7 +2037,7 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm( uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t len128x6_ = (uint64_t)0U; uint64_t - scrut2 = + c0 = gcm128_decrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, @@ -1957,7 +2055,6 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm( (uint64_t)cipher_len, scratch_b1, tag); - uint64_t c0 = scrut2; c = c0; } memcpy(dst + (uint32_t)(uint64_t)cipher_len / (uint32_t)16U * (uint32_t)16U, @@ -1989,6 +2086,15 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm( uint8_t *dst ) { + KRML_HOST_IGNORE(k); + KRML_HOST_IGNORE(iv); + KRML_HOST_IGNORE(iv_len); + KRML_HOST_IGNORE(ad); + KRML_HOST_IGNORE(ad_len); + KRML_HOST_IGNORE(cipher); + KRML_HOST_IGNORE(cipher_len); + KRML_HOST_IGNORE(tag); + KRML_HOST_IGNORE(dst); #if HACL_CAN_COMPILE_VALE bool has_pclmulqdq = EverCrypt_AutoConfig2_has_pclmulqdq(); bool has_avx = EverCrypt_AutoConfig2_has_avx(); @@ -2000,8 +2106,8 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm( uint8_t ek[544U] = { 0U }; uint8_t *keys_b0 = ek; uint8_t *hkeys_b0 = ek + (uint32_t)240U; - uint64_t scrut = aes256_key_expansion(k, keys_b0); - uint64_t scrut0 = aes256_keyhash_init(keys_b0, hkeys_b0); + KRML_HOST_IGNORE(aes256_key_expansion(k, keys_b0)); + KRML_HOST_IGNORE(aes256_keyhash_init(keys_b0, hkeys_b0)); EverCrypt_AEAD_state_s p = { .impl = Spec_Cipher_Expansion_Vale_AES256, .ek = ek }; EverCrypt_AEAD_state_s *s = &p; if (s == NULL) @@ -2012,8 +2118,7 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm( { return EverCrypt_Error_InvalidIVLength; } - EverCrypt_AEAD_state_s scrut1 = *s; - uint8_t *ek0 = scrut1.ek; + uint8_t *ek0 = (*s).ek; uint8_t *scratch_b = ek0 + (uint32_t)368U; uint8_t *ek1 = ek0; uint8_t *keys_b = ek1; @@ -2023,8 +2128,12 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm( uint32_t bytes_len = len * (uint32_t)16U; uint8_t *iv_b = iv; memcpy(tmp_iv, iv + bytes_len, iv_len % (uint32_t)16U * sizeof (uint8_t)); - uint64_t - uu____0 = compute_iv_stdcall(iv_b, (uint64_t)iv_len, (uint64_t)len, tmp_iv, tmp_iv, hkeys_b); + KRML_HOST_IGNORE(compute_iv_stdcall(iv_b, + (uint64_t)iv_len, + (uint64_t)len, + tmp_iv, + tmp_iv, + hkeys_b)); uint8_t *inout_b = scratch_b; uint8_t *abytes_b = scratch_b + (uint32_t)16U; uint8_t *scratch_b1 = scratch_b + (uint32_t)32U; @@ -2052,7 +2161,7 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm( uint64_t len128x6_ = len128x6 / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t - scrut2 = + c0 = gcm256_decrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, @@ -2070,7 +2179,6 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm( (uint64_t)cipher_len, scratch_b1, tag); - uint64_t c0 = scrut2; c = c0; } else @@ -2085,7 +2193,7 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm( uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t len128x6_ = (uint64_t)0U; uint64_t - scrut2 = + c0 = gcm256_decrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, @@ -2103,7 +2211,6 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm( (uint64_t)cipher_len, scratch_b1, tag); - uint64_t c0 = scrut2; c = c0; } memcpy(dst + (uint32_t)(uint64_t)cipher_len / (uint32_t)16U * (uint32_t)16U, @@ -2214,8 +2321,7 @@ Cleanup and free the AEAD state. */ void EverCrypt_AEAD_free(EverCrypt_AEAD_state_s *s) { - EverCrypt_AEAD_state_s scrut = *s; - uint8_t *ek = scrut.ek; + uint8_t *ek = (*s).ek; KRML_HOST_FREE(ek); KRML_HOST_FREE(s); } diff --git a/src/EverCrypt_AutoConfig2.c b/src/EverCrypt_AutoConfig2.c index fe93ef8a..b549d020 100644 --- a/src/EverCrypt_AutoConfig2.c +++ b/src/EverCrypt_AutoConfig2.c @@ -113,75 +113,59 @@ void EverCrypt_AutoConfig2_recall(void) void EverCrypt_AutoConfig2_init(void) { #if HACL_CAN_COMPILE_VALE - uint64_t scrut = check_aesni(); - if (scrut != (uint64_t)0U) + if (check_aesni() != (uint64_t)0U) { cpu_has_aesni[0U] = true; cpu_has_pclmulqdq[0U] = true; } - uint64_t scrut0 = check_sha(); - if (scrut0 != (uint64_t)0U) + if (check_sha() != (uint64_t)0U) { cpu_has_shaext[0U] = true; } - uint64_t scrut1 = check_adx_bmi2(); - if (scrut1 != (uint64_t)0U) + if (check_adx_bmi2() != (uint64_t)0U) { cpu_has_bmi2[0U] = true; cpu_has_adx[0U] = true; } - uint64_t scrut2 = check_avx(); - if (scrut2 != (uint64_t)0U) + if (check_avx() != (uint64_t)0U) { - uint64_t scrut3 = check_osxsave(); - if (scrut3 != (uint64_t)0U) + if (check_osxsave() != (uint64_t)0U) { - uint64_t scrut4 = check_avx_xcr0(); - if (scrut4 != (uint64_t)0U) + if (check_avx_xcr0() != (uint64_t)0U) { cpu_has_avx[0U] = true; } } } - uint64_t scrut3 = check_avx2(); - if (scrut3 != (uint64_t)0U) + if (check_avx2() != (uint64_t)0U) { - uint64_t scrut4 = check_osxsave(); - if (scrut4 != (uint64_t)0U) + if (check_osxsave() != (uint64_t)0U) { - uint64_t scrut5 = check_avx_xcr0(); - if (scrut5 != (uint64_t)0U) + if (check_avx_xcr0() != (uint64_t)0U) { cpu_has_avx2[0U] = true; } } } - uint64_t scrut4 = check_sse(); - if (scrut4 != (uint64_t)0U) + if (check_sse() != (uint64_t)0U) { cpu_has_sse[0U] = true; } - uint64_t scrut5 = check_movbe(); - if (scrut5 != (uint64_t)0U) + if (check_movbe() != (uint64_t)0U) { cpu_has_movbe[0U] = true; } - uint64_t scrut6 = check_rdrand(); - if (scrut6 != (uint64_t)0U) + if (check_rdrand() != (uint64_t)0U) { cpu_has_rdrand[0U] = true; } - uint64_t scrut7 = check_avx512(); - if (scrut7 != (uint64_t)0U) + if (check_avx512() != (uint64_t)0U) { - uint64_t scrut8 = check_osxsave(); - if (scrut8 != (uint64_t)0U) + if (check_osxsave() != (uint64_t)0U) { - uint64_t scrut9 = check_avx_xcr0(); - if (scrut9 != (uint64_t)0U) + if (check_avx_xcr0() != (uint64_t)0U) { - uint64_t scrut10 = check_avx512_xcr0(); - if (scrut10 != (uint64_t)0U) + if (check_avx512_xcr0() != (uint64_t)0U) { cpu_has_avx512[0U] = true; return; diff --git a/src/EverCrypt_DRBG.c b/src/EverCrypt_DRBG.c index f21313e9..13e517e5 100644 --- a/src/EverCrypt_DRBG.c +++ b/src/EverCrypt_DRBG.c @@ -92,6 +92,7 @@ EverCrypt_DRBG_uu___is_SHA1_s( EverCrypt_DRBG_state_s projectee ) { + KRML_HOST_IGNORE(uu___); if (projectee.tag == SHA1_s) { return true; @@ -105,6 +106,7 @@ EverCrypt_DRBG_uu___is_SHA2_256_s( EverCrypt_DRBG_state_s projectee ) { + KRML_HOST_IGNORE(uu___); if (projectee.tag == SHA2_256_s) { return true; @@ -118,6 +120,7 @@ EverCrypt_DRBG_uu___is_SHA2_384_s( EverCrypt_DRBG_state_s projectee ) { + KRML_HOST_IGNORE(uu___); if (projectee.tag == SHA2_384_s) { return true; @@ -131,6 +134,7 @@ EverCrypt_DRBG_uu___is_SHA2_512_s( EverCrypt_DRBG_state_s projectee ) { + KRML_HOST_IGNORE(uu___); if (projectee.tag == SHA2_512_s) { return true; diff --git a/src/EverCrypt_Hash.c b/src/EverCrypt_Hash.c index 914a105f..b88df9e2 100644 --- a/src/EverCrypt_Hash.c +++ b/src/EverCrypt_Hash.c @@ -399,7 +399,7 @@ void EverCrypt_Hash_update_multi_256(uint32_t *s, uint8_t *blocks, uint32_t n) if (has_shaext && has_sse) { uint64_t n1 = (uint64_t)n; - uint64_t scrut = sha256_update(s, blocks, n1, k224_256); + KRML_HOST_IGNORE(sha256_update(s, blocks, n1, k224_256)); return; } Hacl_SHA2_Scalar32_sha256_update_nblocks(n * (uint32_t)64U, blocks, s); @@ -2156,8 +2156,7 @@ Perform a run-time test to determine which algorithm was chosen for the given pi Spec_Hash_Definitions_hash_alg EverCrypt_Hash_Incremental_alg_of_state(EverCrypt_Hash_Incremental_hash_state *s) { - EverCrypt_Hash_Incremental_hash_state scrut = *s; - EverCrypt_Hash_state_s *block_state = scrut.block_state; + EverCrypt_Hash_state_s *block_state = (*s).block_state; return alg_of_state(block_state); } diff --git a/src/EverCrypt_Poly1305.c b/src/EverCrypt_Poly1305.c index 717b9527..454c0fce 100644 --- a/src/EverCrypt_Poly1305.c +++ b/src/EverCrypt_Poly1305.c @@ -28,8 +28,13 @@ #include "internal/Vale.h" #include "config.h" -static void poly1305_vale(uint8_t *dst, uint8_t *src, uint32_t len, uint8_t *key) +KRML_MAYBE_UNUSED static void +poly1305_vale(uint8_t *dst, uint8_t *src, uint32_t len, uint8_t *key) { + KRML_HOST_IGNORE(dst); + KRML_HOST_IGNORE(src); + KRML_HOST_IGNORE(len); + KRML_HOST_IGNORE(key); #if HACL_CAN_COMPILE_VALE uint8_t ctx[192U] = { 0U }; memcpy(ctx + (uint32_t)24U, key, (uint32_t)32U * sizeof (uint8_t)); @@ -38,19 +43,16 @@ static void poly1305_vale(uint8_t *dst, uint8_t *src, uint32_t len, uint8_t *key uint8_t tmp[16U] = { 0U }; if (n_extra == (uint32_t)0U) { - uint64_t scrut = x64_poly1305(ctx, src, (uint64_t)len, (uint64_t)1U); - KRML_HOST_IGNORE((void *)(uint8_t)0U); + KRML_HOST_IGNORE(x64_poly1305(ctx, src, (uint64_t)len, (uint64_t)1U)); } else { uint32_t len16 = n_blocks * (uint32_t)16U; uint8_t *src16 = src; memcpy(tmp, src + len16, n_extra * sizeof (uint8_t)); - uint64_t scrut = x64_poly1305(ctx, src16, (uint64_t)len16, (uint64_t)0U); - KRML_HOST_IGNORE((void *)(uint8_t)0U); + KRML_HOST_IGNORE(x64_poly1305(ctx, src16, (uint64_t)len16, (uint64_t)0U)); memcpy(ctx + (uint32_t)24U, key, (uint32_t)32U * sizeof (uint8_t)); - uint64_t scrut0 = x64_poly1305(ctx, tmp, (uint64_t)n_extra, (uint64_t)1U); - KRML_HOST_IGNORE((void *)(uint8_t)0U); + KRML_HOST_IGNORE(x64_poly1305(ctx, tmp, (uint64_t)n_extra, (uint64_t)1U)); } memcpy(dst, ctx, (uint32_t)16U * sizeof (uint8_t)); #endif diff --git a/src/Hacl_Chacha20_Vec128.c b/src/Hacl_Chacha20_Vec128.c index ed112654..1e0c4ec1 100644 --- a/src/Hacl_Chacha20_Vec128.c +++ b/src/Hacl_Chacha20_Vec128.c @@ -370,9 +370,8 @@ Hacl_Chacha20_Vec128_chacha20_encrypt_128( if (rem1 > (uint32_t)0U) { uint8_t *uu____2 = out + nb * (uint32_t)256U; - uint8_t *uu____3 = text + nb * (uint32_t)256U; uint8_t plain[256U] = { 0U }; - memcpy(plain, uu____3, rem * sizeof (uint8_t)); + memcpy(plain, text + nb * (uint32_t)256U, rem * sizeof (uint8_t)); KRML_PRE_ALIGN(16) Lib_IntVector_Intrinsics_vec128 k[16U] KRML_POST_ALIGN(16) = { 0U }; chacha20_core_128(k, ctx, nb); Lib_IntVector_Intrinsics_vec128 st0 = k[0U]; @@ -676,9 +675,8 @@ Hacl_Chacha20_Vec128_chacha20_decrypt_128( if (rem1 > (uint32_t)0U) { uint8_t *uu____2 = out + nb * (uint32_t)256U; - uint8_t *uu____3 = cipher + nb * (uint32_t)256U; uint8_t plain[256U] = { 0U }; - memcpy(plain, uu____3, rem * sizeof (uint8_t)); + memcpy(plain, cipher + nb * (uint32_t)256U, rem * sizeof (uint8_t)); KRML_PRE_ALIGN(16) Lib_IntVector_Intrinsics_vec128 k[16U] KRML_POST_ALIGN(16) = { 0U }; chacha20_core_128(k, ctx, nb); Lib_IntVector_Intrinsics_vec128 st0 = k[0U]; diff --git a/src/Hacl_Chacha20_Vec256.c b/src/Hacl_Chacha20_Vec256.c index 2df300b6..620f5040 100644 --- a/src/Hacl_Chacha20_Vec256.c +++ b/src/Hacl_Chacha20_Vec256.c @@ -470,9 +470,8 @@ Hacl_Chacha20_Vec256_chacha20_encrypt_256( if (rem1 > (uint32_t)0U) { uint8_t *uu____2 = out + nb * (uint32_t)512U; - uint8_t *uu____3 = text + nb * (uint32_t)512U; uint8_t plain[512U] = { 0U }; - memcpy(plain, uu____3, rem * sizeof (uint8_t)); + memcpy(plain, text + nb * (uint32_t)512U, rem * sizeof (uint8_t)); KRML_PRE_ALIGN(32) Lib_IntVector_Intrinsics_vec256 k[16U] KRML_POST_ALIGN(32) = { 0U }; chacha20_core_256(k, ctx, nb); Lib_IntVector_Intrinsics_vec256 st0 = k[0U]; @@ -968,9 +967,8 @@ Hacl_Chacha20_Vec256_chacha20_decrypt_256( if (rem1 > (uint32_t)0U) { uint8_t *uu____2 = out + nb * (uint32_t)512U; - uint8_t *uu____3 = cipher + nb * (uint32_t)512U; uint8_t plain[512U] = { 0U }; - memcpy(plain, uu____3, rem * sizeof (uint8_t)); + memcpy(plain, cipher + nb * (uint32_t)512U, rem * sizeof (uint8_t)); KRML_PRE_ALIGN(32) Lib_IntVector_Intrinsics_vec256 k[16U] KRML_POST_ALIGN(32) = { 0U }; chacha20_core_256(k, ctx, nb); Lib_IntVector_Intrinsics_vec256 st0 = k[0U]; diff --git a/src/Hacl_Chacha20_Vec32.c b/src/Hacl_Chacha20_Vec32.c index 6f137f39..2bf4764c 100644 --- a/src/Hacl_Chacha20_Vec32.c +++ b/src/Hacl_Chacha20_Vec32.c @@ -229,9 +229,8 @@ Hacl_Chacha20_Vec32_chacha20_encrypt_32( if (rem1 > (uint32_t)0U) { uint8_t *uu____2 = out + nb * (uint32_t)64U; - uint8_t *uu____3 = text + nb * (uint32_t)64U; uint8_t plain[64U] = { 0U }; - memcpy(plain, uu____3, rem * sizeof (uint8_t)); + memcpy(plain, text + nb * (uint32_t)64U, rem * sizeof (uint8_t)); uint32_t k[16U] = { 0U }; chacha20_core_32(k, ctx, nb); KRML_MAYBE_FOR16(i, @@ -279,9 +278,8 @@ Hacl_Chacha20_Vec32_chacha20_decrypt_32( if (rem1 > (uint32_t)0U) { uint8_t *uu____2 = out + nb * (uint32_t)64U; - uint8_t *uu____3 = cipher + nb * (uint32_t)64U; uint8_t plain[64U] = { 0U }; - memcpy(plain, uu____3, rem * sizeof (uint8_t)); + memcpy(plain, cipher + nb * (uint32_t)64U, rem * sizeof (uint8_t)); uint32_t k[16U] = { 0U }; chacha20_core_32(k, ctx, nb); KRML_MAYBE_FOR16(i, diff --git a/src/Hacl_Curve25519_64.c b/src/Hacl_Curve25519_64.c index 526fbd22..fb0974fe 100644 --- a/src/Hacl_Curve25519_64.c +++ b/src/Hacl_Curve25519_64.c @@ -35,7 +35,7 @@ static inline void add_scalar0(uint64_t *out, uint64_t *f1, uint64_t f2) #if HACL_CAN_COMPILE_INLINE_ASM add_scalar(out, f1, f2); #else - uint64_t uu____0 = add_scalar_e(out, f1, f2); + KRML_HOST_IGNORE(add_scalar_e(out, f1, f2)); #endif } @@ -44,7 +44,7 @@ static inline void fadd0(uint64_t *out, uint64_t *f1, uint64_t *f2) #if HACL_CAN_COMPILE_INLINE_ASM fadd(out, f1, f2); #else - uint64_t uu____0 = fadd_e(out, f1, f2); + KRML_HOST_IGNORE(fadd_e(out, f1, f2)); #endif } @@ -53,7 +53,7 @@ static inline void fsub0(uint64_t *out, uint64_t *f1, uint64_t *f2) #if HACL_CAN_COMPILE_INLINE_ASM fsub(out, f1, f2); #else - uint64_t uu____0 = fsub_e(out, f1, f2); + KRML_HOST_IGNORE(fsub_e(out, f1, f2)); #endif } @@ -62,7 +62,7 @@ static inline void fmul0(uint64_t *out, uint64_t *f1, uint64_t *f2, uint64_t *tm #if HACL_CAN_COMPILE_INLINE_ASM fmul(out, f1, f2, tmp); #else - uint64_t uu____0 = fmul_e(tmp, f1, out, f2); + KRML_HOST_IGNORE(fmul_e(tmp, f1, out, f2)); #endif } @@ -71,7 +71,7 @@ static inline void fmul20(uint64_t *out, uint64_t *f1, uint64_t *f2, uint64_t *t #if HACL_CAN_COMPILE_INLINE_ASM fmul2(out, f1, f2, tmp); #else - uint64_t uu____0 = fmul2_e(tmp, f1, out, f2); + KRML_HOST_IGNORE(fmul2_e(tmp, f1, out, f2)); #endif } @@ -80,7 +80,7 @@ static inline void fmul_scalar0(uint64_t *out, uint64_t *f1, uint64_t f2) #if HACL_CAN_COMPILE_INLINE_ASM fmul_scalar(out, f1, f2); #else - uint64_t uu____0 = fmul_scalar_e(out, f1, f2); + KRML_HOST_IGNORE(fmul_scalar_e(out, f1, f2)); #endif } @@ -89,7 +89,7 @@ static inline void fsqr0(uint64_t *out, uint64_t *f1, uint64_t *tmp) #if HACL_CAN_COMPILE_INLINE_ASM fsqr(out, f1, tmp); #else - uint64_t uu____0 = fsqr_e(tmp, f1, out); + KRML_HOST_IGNORE(fsqr_e(tmp, f1, out)); #endif } @@ -98,7 +98,7 @@ static inline void fsqr20(uint64_t *out, uint64_t *f, uint64_t *tmp) #if HACL_CAN_COMPILE_INLINE_ASM fsqr2(out, f, tmp); #else - uint64_t uu____0 = fsqr2_e(tmp, f, out); + KRML_HOST_IGNORE(fsqr2_e(tmp, f, out)); #endif } @@ -107,7 +107,7 @@ static inline void cswap20(uint64_t bit, uint64_t *p1, uint64_t *p2) #if HACL_CAN_COMPILE_INLINE_ASM cswap2(bit, p1, p2); #else - uint64_t uu____0 = cswap2_e(bit, p1, p2); + KRML_HOST_IGNORE(cswap2_e(bit, p1, p2)); #endif } diff --git a/src/Hacl_Ed25519.c b/src/Hacl_Ed25519.c index 9d7c3bd4..f9881e91 100644 --- a/src/Hacl_Ed25519.c +++ b/src/Hacl_Ed25519.c @@ -711,65 +711,53 @@ static inline void barrett_reduction(uint64_t *z, uint64_t *t) FStar_UInt128_uint128 c00 = carry0; FStar_UInt128_uint128 carry1 = FStar_UInt128_shift_right(FStar_UInt128_add_mod(z11, c00), (uint32_t)56U); - uint64_t - t100 = - FStar_UInt128_uint128_to_uint64(FStar_UInt128_add_mod(z11, c00)) - & (uint64_t)0xffffffffffffffU; FStar_UInt128_uint128 c10 = carry1; FStar_UInt128_uint128 carry2 = FStar_UInt128_shift_right(FStar_UInt128_add_mod(z21, c10), (uint32_t)56U); - uint64_t - t101 = - FStar_UInt128_uint128_to_uint64(FStar_UInt128_add_mod(z21, c10)) - & (uint64_t)0xffffffffffffffU; FStar_UInt128_uint128 c20 = carry2; FStar_UInt128_uint128 carry3 = FStar_UInt128_shift_right(FStar_UInt128_add_mod(z31, c20), (uint32_t)56U); - uint64_t - t102 = - FStar_UInt128_uint128_to_uint64(FStar_UInt128_add_mod(z31, c20)) - & (uint64_t)0xffffffffffffffU; FStar_UInt128_uint128 c30 = carry3; FStar_UInt128_uint128 carry4 = FStar_UInt128_shift_right(FStar_UInt128_add_mod(z41, c30), (uint32_t)56U); uint64_t - t103 = + t100 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_add_mod(z41, c30)) & (uint64_t)0xffffffffffffffU; FStar_UInt128_uint128 c40 = carry4; - uint64_t t410 = t103; + uint64_t t410 = t100; FStar_UInt128_uint128 carry5 = FStar_UInt128_shift_right(FStar_UInt128_add_mod(z5, c40), (uint32_t)56U); uint64_t - t104 = + t101 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_add_mod(z5, c40)) & (uint64_t)0xffffffffffffffU; FStar_UInt128_uint128 c5 = carry5; - uint64_t t51 = t104; + uint64_t t51 = t101; FStar_UInt128_uint128 carry6 = FStar_UInt128_shift_right(FStar_UInt128_add_mod(z6, c5), (uint32_t)56U); uint64_t - t105 = + t102 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_add_mod(z6, c5)) & (uint64_t)0xffffffffffffffU; FStar_UInt128_uint128 c6 = carry6; - uint64_t t61 = t105; + uint64_t t61 = t102; FStar_UInt128_uint128 carry7 = FStar_UInt128_shift_right(FStar_UInt128_add_mod(z7, c6), (uint32_t)56U); uint64_t - t106 = + t103 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_add_mod(z7, c6)) & (uint64_t)0xffffffffffffffU; FStar_UInt128_uint128 c7 = carry7; - uint64_t t71 = t106; + uint64_t t71 = t103; FStar_UInt128_uint128 carry8 = FStar_UInt128_shift_right(FStar_UInt128_add_mod(z8, c7), (uint32_t)56U); uint64_t - t107 = + t104 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_add_mod(z8, c7)) & (uint64_t)0xffffffffffffffU; FStar_UInt128_uint128 c8 = carry8; - uint64_t t81 = t107; + uint64_t t81 = t104; uint64_t t91 = FStar_UInt128_uint128_to_uint64(c8); uint64_t qmu4_ = t410; uint64_t qmu5_ = t51; @@ -818,19 +806,19 @@ static inline void barrett_reduction(uint64_t *z, uint64_t *t) FStar_UInt128_uint128 xy31 = FStar_UInt128_mul_wide(qdiv3, m1); FStar_UInt128_uint128 xy40 = FStar_UInt128_mul_wide(qdiv4, m0); FStar_UInt128_uint128 carry9 = FStar_UInt128_shift_right(xy00, (uint32_t)56U); - uint64_t t108 = FStar_UInt128_uint128_to_uint64(xy00) & (uint64_t)0xffffffffffffffU; + uint64_t t105 = FStar_UInt128_uint128_to_uint64(xy00) & (uint64_t)0xffffffffffffffU; FStar_UInt128_uint128 c0 = carry9; - uint64_t t010 = t108; + uint64_t t010 = t105; FStar_UInt128_uint128 carry10 = FStar_UInt128_shift_right(FStar_UInt128_add_mod(FStar_UInt128_add_mod(xy01, xy10), c0), (uint32_t)56U); uint64_t - t109 = + t106 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_add_mod(FStar_UInt128_add_mod(xy01, xy10), c0)) & (uint64_t)0xffffffffffffffU; FStar_UInt128_uint128 c11 = carry10; - uint64_t t110 = t109; + uint64_t t110 = t106; FStar_UInt128_uint128 carry11 = FStar_UInt128_shift_right(FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_add_mod(xy02, @@ -839,14 +827,14 @@ static inline void barrett_reduction(uint64_t *z, uint64_t *t) c11), (uint32_t)56U); uint64_t - t1010 = + t107 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_add_mod(xy02, xy11), xy20), c11)) & (uint64_t)0xffffffffffffffU; FStar_UInt128_uint128 c21 = carry11; - uint64_t t210 = t1010; + uint64_t t210 = t107; FStar_UInt128_uint128 carry = FStar_UInt128_shift_right(FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_add_mod(xy03, @@ -856,7 +844,7 @@ static inline void barrett_reduction(uint64_t *z, uint64_t *t) c21), (uint32_t)56U); uint64_t - t1011 = + t108 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_add_mod(xy03, xy12), xy21), @@ -864,7 +852,7 @@ static inline void barrett_reduction(uint64_t *z, uint64_t *t) c21)) & (uint64_t)0xffffffffffffffU; FStar_UInt128_uint128 c31 = carry; - uint64_t t310 = t1011; + uint64_t t310 = t108; uint64_t t411 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_add_mod(xy04, @@ -880,24 +868,24 @@ static inline void barrett_reduction(uint64_t *z, uint64_t *t) uint64_t qmul3 = t310; uint64_t qmul4 = t411; uint64_t b5 = (r0 - qmul0) >> (uint32_t)63U; - uint64_t t1012 = (b5 << (uint32_t)56U) + r0 - qmul0; + uint64_t t109 = (b5 << (uint32_t)56U) + r0 - qmul0; uint64_t c1 = b5; - uint64_t t011 = t1012; + uint64_t t011 = t109; uint64_t b6 = (r1 - (qmul1 + c1)) >> (uint32_t)63U; - uint64_t t1013 = (b6 << (uint32_t)56U) + r1 - (qmul1 + c1); + uint64_t t1010 = (b6 << (uint32_t)56U) + r1 - (qmul1 + c1); uint64_t c2 = b6; - uint64_t t111 = t1013; + uint64_t t111 = t1010; uint64_t b7 = (r2 - (qmul2 + c2)) >> (uint32_t)63U; - uint64_t t1014 = (b7 << (uint32_t)56U) + r2 - (qmul2 + c2); + uint64_t t1011 = (b7 << (uint32_t)56U) + r2 - (qmul2 + c2); uint64_t c3 = b7; - uint64_t t211 = t1014; + uint64_t t211 = t1011; uint64_t b8 = (r3 - (qmul3 + c3)) >> (uint32_t)63U; - uint64_t t1015 = (b8 << (uint32_t)56U) + r3 - (qmul3 + c3); + uint64_t t1012 = (b8 << (uint32_t)56U) + r3 - (qmul3 + c3); uint64_t c4 = b8; - uint64_t t311 = t1015; + uint64_t t311 = t1012; uint64_t b9 = (r4 - (qmul4 + c4)) >> (uint32_t)63U; - uint64_t t1016 = (b9 << (uint32_t)40U) + r4 - (qmul4 + c4); - uint64_t t412 = t1016; + uint64_t t1013 = (b9 << (uint32_t)40U) + r4 - (qmul4 + c4); + uint64_t t412 = t1013; uint64_t s0 = t011; uint64_t s1 = t111; uint64_t s2 = t211; @@ -914,21 +902,21 @@ static inline void barrett_reduction(uint64_t *z, uint64_t *t) uint64_t y3 = m31; uint64_t y4 = m41; uint64_t b10 = (s0 - y0) >> (uint32_t)63U; - uint64_t t1017 = (b10 << (uint32_t)56U) + s0 - y0; + uint64_t t1014 = (b10 << (uint32_t)56U) + s0 - y0; uint64_t b0 = b10; - uint64_t t01 = t1017; + uint64_t t01 = t1014; uint64_t b11 = (s1 - (y1 + b0)) >> (uint32_t)63U; - uint64_t t1018 = (b11 << (uint32_t)56U) + s1 - (y1 + b0); + uint64_t t1015 = (b11 << (uint32_t)56U) + s1 - (y1 + b0); uint64_t b1 = b11; - uint64_t t11 = t1018; + uint64_t t11 = t1015; uint64_t b12 = (s2 - (y2 + b1)) >> (uint32_t)63U; - uint64_t t1019 = (b12 << (uint32_t)56U) + s2 - (y2 + b1); + uint64_t t1016 = (b12 << (uint32_t)56U) + s2 - (y2 + b1); uint64_t b2 = b12; - uint64_t t21 = t1019; + uint64_t t21 = t1016; uint64_t b13 = (s3 - (y3 + b2)) >> (uint32_t)63U; - uint64_t t1020 = (b13 << (uint32_t)56U) + s3 - (y3 + b2); + uint64_t t1017 = (b13 << (uint32_t)56U) + s3 - (y3 + b2); uint64_t b3 = b13; - uint64_t t31 = t1020; + uint64_t t31 = t1017; uint64_t b = (s4 - (y4 + b3)) >> (uint32_t)63U; uint64_t t10 = (b << (uint32_t)56U) + s4 - (y4 + b3); uint64_t b4 = b; diff --git a/src/Hacl_FFDHE.c b/src/Hacl_FFDHE.c index 78aaaab6..9cf2ddfb 100644 --- a/src/Hacl_FFDHE.c +++ b/src/Hacl_FFDHE.c @@ -127,7 +127,6 @@ static inline uint64_t ffdhe_check_pk(Spec_FFDHE_ffdhe_alg a, uint64_t *pk_n, ui memset(p_n1, 0U, nLen * sizeof (uint64_t)); uint64_t c0 = Lib_IntTypes_Intrinsics_sub_borrow_u64((uint64_t)0U, p_n[0U], (uint64_t)1U, p_n1); - uint64_t c1; if ((uint32_t)1U < nLen) { uint64_t *a1 = p_n + (uint32_t)1U; @@ -159,12 +158,12 @@ static inline uint64_t ffdhe_check_pk(Spec_FFDHE_ffdhe_alg a, uint64_t *pk_n, ui uint64_t *res_i = res1 + i; c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t1, (uint64_t)0U, res_i); } - uint64_t c10 = c; - c1 = c10; + uint64_t c1 = c; + KRML_HOST_IGNORE(c1); } else { - c1 = c0; + KRML_HOST_IGNORE(c0); } KRML_CHECK_SIZE(sizeof (uint64_t), nLen); uint64_t b2[nLen]; diff --git a/src/Hacl_Frodo_KEM.c b/src/Hacl_Frodo_KEM.c index 13db363a..4265ac0e 100644 --- a/src/Hacl_Frodo_KEM.c +++ b/src/Hacl_Frodo_KEM.c @@ -30,6 +30,6 @@ void randombytes_(uint32_t len, uint8_t *res) { - bool b = Lib_RandomBuffer_System_randombytes(res, len); + KRML_HOST_IGNORE(Lib_RandomBuffer_System_randombytes(res, len)); } diff --git a/src/Hacl_HMAC_DRBG.c b/src/Hacl_HMAC_DRBG.c index 181a8ef4..0a09aaed 100644 --- a/src/Hacl_HMAC_DRBG.c +++ b/src/Hacl_HMAC_DRBG.c @@ -71,6 +71,8 @@ uint32_t Hacl_HMAC_DRBG_min_length(Spec_Hash_Definitions_hash_alg a) bool Hacl_HMAC_DRBG_uu___is_State(Spec_Hash_Definitions_hash_alg a, Hacl_HMAC_DRBG_state projectee) { + KRML_HOST_IGNORE(a); + KRML_HOST_IGNORE(projectee); return true; } @@ -1084,6 +1086,7 @@ Hacl_HMAC_DRBG_generate( void Hacl_HMAC_DRBG_free(Spec_Hash_Definitions_hash_alg uu___, Hacl_HMAC_DRBG_state s) { + KRML_HOST_IGNORE(uu___); uint8_t *k = s.k; uint8_t *v = s.v; uint32_t *ctr = s.reseed_counter; diff --git a/src/Hacl_Hash_Blake2.c b/src/Hacl_Hash_Blake2.c index 194e7157..aecc6165 100644 --- a/src/Hacl_Hash_Blake2.c +++ b/src/Hacl_Hash_Blake2.c @@ -545,6 +545,7 @@ Hacl_Blake2b_32_blake2b_update_multi( uint32_t nb ) { + KRML_HOST_IGNORE(len); for (uint32_t i = (uint32_t)0U; i < nb; i++) { FStar_UInt128_uint128 @@ -1192,6 +1193,7 @@ Hacl_Blake2s_32_blake2s_update_multi( uint32_t nb ) { + KRML_HOST_IGNORE(len); for (uint32_t i = (uint32_t)0U; i < nb; i++) { uint64_t totlen = prev + (uint64_t)((i + (uint32_t)1U) * (uint32_t)64U); diff --git a/src/Hacl_Hash_Blake2b_256.c b/src/Hacl_Hash_Blake2b_256.c index d0df7cd8..b37ffc5f 100644 --- a/src/Hacl_Hash_Blake2b_256.c +++ b/src/Hacl_Hash_Blake2b_256.c @@ -268,6 +268,7 @@ Hacl_Blake2b_256_blake2b_update_multi( uint32_t nb ) { + KRML_HOST_IGNORE(len); for (uint32_t i = (uint32_t)0U; i < nb; i++) { FStar_UInt128_uint128 diff --git a/src/Hacl_Hash_Blake2s_128.c b/src/Hacl_Hash_Blake2s_128.c index 5bf06711..86c4f030 100644 --- a/src/Hacl_Hash_Blake2s_128.c +++ b/src/Hacl_Hash_Blake2s_128.c @@ -268,6 +268,7 @@ Hacl_Blake2s_128_blake2s_update_multi( uint32_t nb ) { + KRML_HOST_IGNORE(len); for (uint32_t i = (uint32_t)0U; i < nb; i++) { uint64_t totlen = prev + (uint64_t)((i + (uint32_t)1U) * (uint32_t)64U); diff --git a/src/Hacl_Hash_MD5.c b/src/Hacl_Hash_MD5.c index 1b376960..222ac824 100644 --- a/src/Hacl_Hash_MD5.c +++ b/src/Hacl_Hash_MD5.c @@ -1218,7 +1218,6 @@ void Hacl_Streaming_MD5_legacy_init(Hacl_Streaming_MD_state_32 *s) Hacl_Streaming_MD_state_32 scrut = *s; uint8_t *buf = scrut.buf; uint32_t *block_state = scrut.block_state; - KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Hash_Core_MD5_legacy_init(block_state); Hacl_Streaming_MD_state_32 tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; diff --git a/src/Hacl_Hash_SHA1.c b/src/Hacl_Hash_SHA1.c index 80edc004..5ecb3c0b 100644 --- a/src/Hacl_Hash_SHA1.c +++ b/src/Hacl_Hash_SHA1.c @@ -254,7 +254,6 @@ void Hacl_Streaming_SHA1_legacy_init(Hacl_Streaming_MD_state_32 *s) Hacl_Streaming_MD_state_32 scrut = *s; uint8_t *buf = scrut.buf; uint32_t *block_state = scrut.block_state; - KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Hash_Core_SHA1_legacy_init(block_state); Hacl_Streaming_MD_state_32 tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; diff --git a/src/Hacl_Hash_SHA2.c b/src/Hacl_Hash_SHA2.c index 46fde83f..c93c3616 100644 --- a/src/Hacl_Hash_SHA2.c +++ b/src/Hacl_Hash_SHA2.c @@ -537,7 +537,6 @@ void Hacl_Streaming_SHA2_init_256(Hacl_Streaming_MD_state_32 *s) Hacl_Streaming_MD_state_32 scrut = *s; uint8_t *buf = scrut.buf; uint32_t *block_state = scrut.block_state; - KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_SHA2_Scalar32_sha256_init(block_state); Hacl_Streaming_MD_state_32 tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; @@ -836,7 +835,6 @@ void Hacl_Streaming_SHA2_init_224(Hacl_Streaming_MD_state_32 *s) Hacl_Streaming_MD_state_32 scrut = *s; uint8_t *buf = scrut.buf; uint32_t *block_state = scrut.block_state; - KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_SHA2_Scalar32_sha224_init(block_state); Hacl_Streaming_MD_state_32 tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; @@ -962,7 +960,6 @@ void Hacl_Streaming_SHA2_init_512(Hacl_Streaming_MD_state_64 *s) Hacl_Streaming_MD_state_64 scrut = *s; uint8_t *buf = scrut.buf; uint64_t *block_state = scrut.block_state; - KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_SHA2_Scalar32_sha512_init(block_state); Hacl_Streaming_MD_state_64 tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; @@ -1262,7 +1259,6 @@ void Hacl_Streaming_SHA2_init_384(Hacl_Streaming_MD_state_64 *s) Hacl_Streaming_MD_state_64 scrut = *s; uint8_t *buf = scrut.buf; uint64_t *block_state = scrut.block_state; - KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_SHA2_Scalar32_sha384_init(block_state); Hacl_Streaming_MD_state_64 tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; diff --git a/src/Hacl_Hash_SHA3.c b/src/Hacl_Hash_SHA3.c index 5f4707f4..19d13b1b 100644 --- a/src/Hacl_Hash_SHA3.c +++ b/src/Hacl_Hash_SHA3.c @@ -125,10 +125,9 @@ Hacl_Hash_SHA3_update_last_sha3( if (input_len == len) { Hacl_Impl_SHA3_absorb_inner(len, input, s); - uint8_t *uu____0 = input + input_len; uint8_t lastBlock_[200U] = { 0U }; uint8_t *lastBlock = lastBlock_; - memcpy(lastBlock, uu____0, (uint32_t)0U * sizeof (uint8_t)); + memcpy(lastBlock, input + input_len, (uint32_t)0U * sizeof (uint8_t)); lastBlock[0U] = suffix; Hacl_Impl_SHA3_loadState(len, lastBlock, s); if (!((suffix & (uint8_t)0x80U) == (uint8_t)0U) && (uint32_t)0U == len - (uint32_t)1U) @@ -167,8 +166,7 @@ hash_buf2; Spec_Hash_Definitions_hash_alg Hacl_Streaming_Keccak_get_alg(Hacl_Streaming_Keccak_state *s) { - Hacl_Streaming_Keccak_state scrut = *s; - Hacl_Streaming_Keccak_hash_buf block_state = scrut.block_state; + Hacl_Streaming_Keccak_hash_buf block_state = (*s).block_state; return block_state.fst; } @@ -809,6 +807,7 @@ Hacl_Impl_SHA3_keccak( uint8_t *output ) { + KRML_HOST_IGNORE(capacity); uint32_t rateInBytes = rate / (uint32_t)8U; uint64_t s[25U] = { 0U }; absorb(s, rateInBytes, inputByteLen, input, delimitedSuffix); diff --git a/src/Hacl_K256_ECDSA.c b/src/Hacl_K256_ECDSA.c index fb53f3fd..2ffc1060 100644 --- a/src/Hacl_K256_ECDSA.c +++ b/src/Hacl_K256_ECDSA.c @@ -498,7 +498,7 @@ mul_pow2_256_minus_q_add( uint64_t r = c; tmp[len + i0] = r;); memcpy(res + (uint32_t)2U, a, len * sizeof (uint64_t)); - uint64_t uu____0 = bn_add(resLen, res, len + (uint32_t)2U, tmp, res); + KRML_HOST_IGNORE(bn_add(resLen, res, len + (uint32_t)2U, tmp, res)); uint64_t c = bn_add(resLen, res, (uint32_t)4U, e, res); return c; } @@ -514,15 +514,23 @@ static inline void modq(uint64_t *out, uint64_t *a) uint64_t *t01 = tmp; uint64_t m[7U] = { 0U }; uint64_t p[5U] = { 0U }; - uint64_t - c0 = mul_pow2_256_minus_q_add((uint32_t)4U, (uint32_t)7U, t01, a + (uint32_t)4U, a, m); - uint64_t - c10 = mul_pow2_256_minus_q_add((uint32_t)3U, (uint32_t)5U, t01, m + (uint32_t)4U, m, p); + KRML_HOST_IGNORE(mul_pow2_256_minus_q_add((uint32_t)4U, + (uint32_t)7U, + t01, + a + (uint32_t)4U, + a, + m)); + KRML_HOST_IGNORE(mul_pow2_256_minus_q_add((uint32_t)3U, + (uint32_t)5U, + t01, + m + (uint32_t)4U, + m, + p)); uint64_t c2 = mul_pow2_256_minus_q_add((uint32_t)1U, (uint32_t)4U, t01, p + (uint32_t)4U, p, r); - uint64_t c00 = c2; + uint64_t c0 = c2; uint64_t c1 = add4(r, tmp, out); - uint64_t mask = (uint64_t)0U - (c00 + c1); + uint64_t mask = (uint64_t)0U - (c0 + c1); KRML_MAYBE_FOR4(i, (uint32_t)0U, (uint32_t)4U, @@ -612,7 +620,7 @@ static inline void qmul_shift_384(uint64_t *res, uint64_t *a, uint64_t *b) uint64_t *res_i = res1 + i; c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t1, (uint64_t)0U, res_i);); uint64_t c1 = c; - uint64_t uu____0 = c1; + KRML_HOST_IGNORE(c1); uint64_t flag = l[5U] >> (uint32_t)63U; uint64_t mask = (uint64_t)0U - flag; KRML_MAYBE_FOR4(i, @@ -1223,6 +1231,7 @@ static inline void point_mul_g(uint64_t *out, uint64_t *scalar) (uint64_t)118285133003718U, (uint64_t)434519962075150U, (uint64_t)1114612377498854U, (uint64_t)3488596944003813U, (uint64_t)450716531072892U, (uint64_t)66044973203836U }; + KRML_HOST_IGNORE(q2); uint64_t q3[15U] = { @@ -1232,6 +1241,7 @@ static inline void point_mul_g(uint64_t *out, uint64_t *scalar) (uint64_t)265969268774814U, (uint64_t)1913228635640715U, (uint64_t)2831959046949342U, (uint64_t)888030405442963U, (uint64_t)1817092932985033U, (uint64_t)101515844997121U }; + KRML_HOST_IGNORE(q3); uint64_t q4[15U] = { @@ -1241,6 +1251,7 @@ static inline void point_mul_g(uint64_t *out, uint64_t *scalar) (uint64_t)12245672982162U, (uint64_t)2119364213800870U, (uint64_t)2034960311715107U, (uint64_t)3172697815804487U, (uint64_t)4185144850224160U, (uint64_t)2792055915674U }; + KRML_HOST_IGNORE(q4); uint64_t *r1 = scalar; uint64_t *r2 = scalar + (uint32_t)1U; uint64_t *r3 = scalar + (uint32_t)2U; @@ -1605,6 +1616,7 @@ Hacl_K256_ECDSA_ecdsa_sign_hashed_msg( ) { uint64_t oneq[4U] = { (uint64_t)0x1U, (uint64_t)0x0U, (uint64_t)0x0U, (uint64_t)0x0U }; + KRML_HOST_IGNORE(oneq); uint64_t rsdk_q[16U] = { 0U }; uint64_t *r_q = rsdk_q; uint64_t *s_q = rsdk_q + (uint32_t)4U; diff --git a/src/Hacl_RSAPSS.c b/src/Hacl_RSAPSS.c index 19d4e5b4..ceb9a6f0 100644 --- a/src/Hacl_RSAPSS.c +++ b/src/Hacl_RSAPSS.c @@ -404,9 +404,9 @@ load_skey( Sign a message `msg` and write the signature to `sgnt`. @param a Hash algorithm to use. Allowed values for `a` are ... - * Spec_Hash_Definitions_SHA2_256, - * Spec_Hash_Definitions_SHA2_384, and - * Spec_Hash_Definitions_SHA2_512. + - Spec_Hash_Definitions_SHA2_256, + - Spec_Hash_Definitions_SHA2_384, and + - Spec_Hash_Definitions_SHA2_512. @param modBits Count of bits in the modulus (`n`). @param eBits Count of bits in `e` value. @param dBits Count of bits in `d` value. @@ -518,7 +518,10 @@ Hacl_RSAPSS_rsapss_sign( /** Verify the signature `sgnt` of a message `msg`. -@param a Hash algorithm to use. +@param a Hash algorithm to use. Allowed values for `a` are ... + - Spec_Hash_Definitions_SHA2_256, + - Spec_Hash_Definitions_SHA2_384, and + - Spec_Hash_Definitions_SHA2_512. @param modBits Count of bits in the modulus (`n`). @param eBits Count of bits in `e` value. @param pkey Pointer to public key created by `Hacl_RSAPSS_new_rsapss_load_pkey`. @@ -637,10 +640,10 @@ Load a public key from key parts. @param modBits Count of bits in modulus (`n`). @param eBits Count of bits in `e` value. -@param nb Pointer to `ceil(modBits / 8)` bytes where the modulus (`n`) is read from. -@param eb Pointer to `ceil(modBits / 8)` bytes where the `e` value is read from. +@param nb Pointer to `ceil(modBits / 8)` bytes where the modulus (`n`), in big-endian byte order, is read from. +@param eb Pointer to `ceil(modBits / 8)` bytes where the `e` value, in big-endian byte order, is read from. -@return Returns an allocated public key. Note: caller must take care to `free()` the created key. +@return Returns an allocated public key upon success, otherwise, `NULL` if key part arguments are invalid or memory allocation fails. Note: caller must take care to `free()` the created key. */ uint64_t *Hacl_RSAPSS_new_rsapss_load_pkey(uint32_t modBits, uint32_t eBits, uint8_t *nb, uint8_t *eb) @@ -707,11 +710,11 @@ Load a secret key from key parts. @param modBits Count of bits in modulus (`n`). @param eBits Count of bits in `e` value. @param dBits Count of bits in `d` value. -@param nb Pointer to `ceil(modBits / 8)` bytes where the modulus (`n`) is read from. -@param eb Pointer to `ceil(modBits / 8)` bytes where the `e` value is read from. -@param db Pointer to `ceil(modBits / 8)` bytes where the `d` value is read from. +@param nb Pointer to `ceil(modBits / 8)` bytes where the modulus (`n`), in big-endian byte order, is read from. +@param eb Pointer to `ceil(modBits / 8)` bytes where the `e` value, in big-endian byte order, is read from. +@param db Pointer to `ceil(modBits / 8)` bytes where the `d` value, in big-endian byte order, is read from. -@return Returns an allocated secret key. Note: caller must take care to `free()` the created key. +@return Returns an allocated secret key upon success, otherwise, `NULL` if key part arguments are invalid or memory allocation fails. Note: caller must take care to `free()` the created key. */ uint64_t *Hacl_RSAPSS_new_rsapss_load_skey( @@ -804,13 +807,16 @@ uint64_t /** Sign a message `msg` and write the signature to `sgnt`. -@param a Hash algorithm to use. +@param a Hash algorithm to use. Allowed values for `a` are ... + - Spec_Hash_Definitions_SHA2_256, + - Spec_Hash_Definitions_SHA2_384, and + - Spec_Hash_Definitions_SHA2_512. @param modBits Count of bits in the modulus (`n`). @param eBits Count of bits in `e` value. @param dBits Count of bits in `d` value. -@param nb Pointer to `ceil(modBits / 8)` bytes where the modulus (`n`) is read from. -@param eb Pointer to `ceil(modBits / 8)` bytes where the `e` value is read from. -@param db Pointer to `ceil(modBits / 8)` bytes where the `d` value is read from. +@param nb Pointer to `ceil(modBits / 8)` bytes where the modulus (`n`), in big-endian byte order, is read from. +@param eb Pointer to `ceil(modBits / 8)` bytes where the `e` value, in big-endian byte order, is read from. +@param db Pointer to `ceil(modBits / 8)` bytes where the `d` value, in big-endian byte order, is read from. @param saltLen Length of salt. @param salt Pointer to `saltLen` bytes where the salt is read from. @param msgLen Length of message. @@ -873,11 +879,14 @@ Hacl_RSAPSS_rsapss_skey_sign( /** Verify the signature `sgnt` of a message `msg`. -@param a Hash algorithm to use. +@param a Hash algorithm to use. Allowed values for `a` are ... + - Spec_Hash_Definitions_SHA2_256, + - Spec_Hash_Definitions_SHA2_384, and + - Spec_Hash_Definitions_SHA2_512. @param modBits Count of bits in the modulus (`n`). @param eBits Count of bits in `e` value. -@param nb Pointer to `ceil(modBits / 8)` bytes where the modulus (`n`) is read from. -@param eb Pointer to `ceil(modBits / 8)` bytes where the `e` value is read from. +@param nb Pointer to `ceil(modBits / 8)` bytes where the modulus (`n`), in big-endian byte order, is read from. +@param eb Pointer to `ceil(modBits / 8)` bytes where the `e` value, in big-endian byte order, is read from. @param saltLen Length of salt. @param sgntLen Length of signature. @param sgnt Pointer to `sgntLen` bytes where the signature is read from. diff --git a/src/Hacl_Salsa20.c b/src/Hacl_Salsa20.c index e157d5ef..2758f8a4 100644 --- a/src/Hacl_Salsa20.c +++ b/src/Hacl_Salsa20.c @@ -181,6 +181,7 @@ salsa20_encrypt( memcpy(ctx + (uint32_t)11U, k10, (uint32_t)4U * sizeof (uint32_t)); ctx[15U] = (uint32_t)0x6b206574U; uint32_t k[16U] = { 0U }; + KRML_HOST_IGNORE(k); uint32_t rem = len % (uint32_t)64U; uint32_t nb = len / (uint32_t)64U; uint32_t rem1 = len % (uint32_t)64U; @@ -217,9 +218,8 @@ salsa20_encrypt( if (rem1 > (uint32_t)0U) { uint8_t *uu____2 = out + nb * (uint32_t)64U; - uint8_t *uu____3 = text + nb * (uint32_t)64U; uint8_t plain[64U] = { 0U }; - memcpy(plain, uu____3, rem * sizeof (uint8_t)); + memcpy(plain, text + nb * (uint32_t)64U, rem * sizeof (uint8_t)); uint32_t k1[16U] = { 0U }; salsa20_core(k1, ctx, nb); uint32_t bl[16U] = { 0U }; @@ -294,6 +294,7 @@ salsa20_decrypt( memcpy(ctx + (uint32_t)11U, k10, (uint32_t)4U * sizeof (uint32_t)); ctx[15U] = (uint32_t)0x6b206574U; uint32_t k[16U] = { 0U }; + KRML_HOST_IGNORE(k); uint32_t rem = len % (uint32_t)64U; uint32_t nb = len / (uint32_t)64U; uint32_t rem1 = len % (uint32_t)64U; @@ -330,9 +331,8 @@ salsa20_decrypt( if (rem1 > (uint32_t)0U) { uint8_t *uu____2 = out + nb * (uint32_t)64U; - uint8_t *uu____3 = cipher + nb * (uint32_t)64U; uint8_t plain[64U] = { 0U }; - memcpy(plain, uu____3, rem * sizeof (uint8_t)); + memcpy(plain, cipher + nb * (uint32_t)64U, rem * sizeof (uint8_t)); uint32_t k1[16U] = { 0U }; salsa20_core(k1, ctx, nb); uint32_t bl[16U] = { 0U }; diff --git a/src/Hacl_Streaming_Blake2.c b/src/Hacl_Streaming_Blake2.c index 4faa859e..948d56c2 100644 --- a/src/Hacl_Streaming_Blake2.c +++ b/src/Hacl_Streaming_Blake2.c @@ -54,7 +54,6 @@ void Hacl_Streaming_Blake2_blake2s_32_no_key_init(Hacl_Streaming_Blake2_blake2s_ Hacl_Streaming_Blake2_blake2s_32_state scrut = *s1; uint8_t *buf = scrut.buf; Hacl_Streaming_Blake2_blake2s_32_block_state block_state = scrut.block_state; - KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Blake2s_32_blake2s_init(block_state.snd, (uint32_t)0U, (uint32_t)32U); Hacl_Streaming_Blake2_blake2s_32_state tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; @@ -354,7 +353,6 @@ void Hacl_Streaming_Blake2_blake2b_32_no_key_init(Hacl_Streaming_Blake2_blake2b_ Hacl_Streaming_Blake2_blake2b_32_state scrut = *s1; uint8_t *buf = scrut.buf; Hacl_Streaming_Blake2_blake2b_32_block_state block_state = scrut.block_state; - KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Blake2b_32_blake2b_init(block_state.snd, (uint32_t)0U, (uint32_t)64U); Hacl_Streaming_Blake2_blake2b_32_state tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; diff --git a/src/Hacl_Streaming_Blake2b_256.c b/src/Hacl_Streaming_Blake2b_256.c index d2df234a..bdb5433f 100644 --- a/src/Hacl_Streaming_Blake2b_256.c +++ b/src/Hacl_Streaming_Blake2b_256.c @@ -66,7 +66,6 @@ Hacl_Streaming_Blake2b_256_blake2b_256_no_key_init( Hacl_Streaming_Blake2b_256_blake2b_256_state scrut = *s; uint8_t *buf = scrut.buf; Hacl_Streaming_Blake2b_256_blake2b_256_block_state block_state = scrut.block_state; - KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Blake2b_256_blake2b_init(block_state.snd, (uint32_t)0U, (uint32_t)64U); Hacl_Streaming_Blake2b_256_blake2b_256_state tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; diff --git a/src/Hacl_Streaming_Blake2s_128.c b/src/Hacl_Streaming_Blake2s_128.c index eaace7ce..f97bf5d0 100644 --- a/src/Hacl_Streaming_Blake2s_128.c +++ b/src/Hacl_Streaming_Blake2s_128.c @@ -66,7 +66,6 @@ Hacl_Streaming_Blake2s_128_blake2s_128_no_key_init( Hacl_Streaming_Blake2s_128_blake2s_128_state scrut = *s; uint8_t *buf = scrut.buf; Hacl_Streaming_Blake2s_128_blake2s_128_block_state block_state = scrut.block_state; - KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Blake2s_128_blake2s_init(block_state.snd, (uint32_t)0U, (uint32_t)32U); Hacl_Streaming_Blake2s_128_blake2s_128_state tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; diff --git a/src/Hacl_Streaming_Poly1305_128.c b/src/Hacl_Streaming_Poly1305_128.c index c752cfb0..c3f7c19a 100644 --- a/src/Hacl_Streaming_Poly1305_128.c +++ b/src/Hacl_Streaming_Poly1305_128.c @@ -58,7 +58,6 @@ Hacl_Streaming_Poly1305_128_init(uint8_t *k, Hacl_Streaming_Poly1305_128_poly130 uint8_t *k_ = scrut.p_key; uint8_t *buf = scrut.buf; Lib_IntVector_Intrinsics_vec128 *block_state = scrut.block_state; - KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Poly1305_128_poly1305_init(block_state, k); memcpy(k_, k, (uint32_t)32U * sizeof (uint8_t)); uint8_t *k_1 = k_; @@ -312,7 +311,7 @@ Hacl_Streaming_Poly1305_128_finish( { ite1 = r % (uint32_t)16U; } - uint64_t prev_len_last = total_len - (uint64_t)ite1; + KRML_HOST_IGNORE(total_len - (uint64_t)ite1); uint32_t ite2; if (r % (uint32_t)16U == (uint32_t)0U && r > (uint32_t)0U) { diff --git a/src/Hacl_Streaming_Poly1305_256.c b/src/Hacl_Streaming_Poly1305_256.c index c1915ed9..e56275a4 100644 --- a/src/Hacl_Streaming_Poly1305_256.c +++ b/src/Hacl_Streaming_Poly1305_256.c @@ -58,7 +58,6 @@ Hacl_Streaming_Poly1305_256_init(uint8_t *k, Hacl_Streaming_Poly1305_256_poly130 uint8_t *k_ = scrut.p_key; uint8_t *buf = scrut.buf; Lib_IntVector_Intrinsics_vec256 *block_state = scrut.block_state; - KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Poly1305_256_poly1305_init(block_state, k); memcpy(k_, k, (uint32_t)32U * sizeof (uint8_t)); uint8_t *k_1 = k_; @@ -312,7 +311,7 @@ Hacl_Streaming_Poly1305_256_finish( { ite1 = r % (uint32_t)16U; } - uint64_t prev_len_last = total_len - (uint64_t)ite1; + KRML_HOST_IGNORE(total_len - (uint64_t)ite1); uint32_t ite2; if (r % (uint32_t)16U == (uint32_t)0U && r > (uint32_t)0U) { diff --git a/src/Hacl_Streaming_Poly1305_32.c b/src/Hacl_Streaming_Poly1305_32.c index 89852727..249a622f 100644 --- a/src/Hacl_Streaming_Poly1305_32.c +++ b/src/Hacl_Streaming_Poly1305_32.c @@ -53,7 +53,6 @@ Hacl_Streaming_Poly1305_32_init(uint8_t *k, Hacl_Streaming_Poly1305_32_poly1305_ uint8_t *k_ = scrut.p_key; uint8_t *buf = scrut.buf; uint64_t *block_state = scrut.block_state; - KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Poly1305_32_poly1305_init(block_state, k); memcpy(k_, k, (uint32_t)32U * sizeof (uint8_t)); uint8_t *k_1 = k_; diff --git a/src/msvc/EverCrypt_AEAD.c b/src/msvc/EverCrypt_AEAD.c index 564dbc2e..d3a4ffbe 100644 --- a/src/msvc/EverCrypt_AEAD.c +++ b/src/msvc/EverCrypt_AEAD.c @@ -46,6 +46,8 @@ The state may be reused as many times as desired. */ bool EverCrypt_AEAD_uu___is_Ek(Spec_Agile_AEAD_alg a, EverCrypt_AEAD_state_s projectee) { + KRML_HOST_IGNORE(a); + KRML_HOST_IGNORE(projectee); return true; } @@ -58,8 +60,7 @@ Return the algorithm used in the AEAD state. */ Spec_Agile_AEAD_alg EverCrypt_AEAD_alg_of_state(EverCrypt_AEAD_state_s *s) { - EverCrypt_AEAD_state_s scrut = *s; - Spec_Cipher_Expansion_impl impl = scrut.impl; + Spec_Cipher_Expansion_impl impl = (*s).impl; switch (impl) { case Spec_Cipher_Expansion_Hacl_CHACHA20: @@ -97,6 +98,8 @@ create_in_chacha20_poly1305(EverCrypt_AEAD_state_s **dst, uint8_t *k) static EverCrypt_Error_error_code create_in_aes128_gcm(EverCrypt_AEAD_state_s **dst, uint8_t *k) { + KRML_HOST_IGNORE(dst); + KRML_HOST_IGNORE(k); #if HACL_CAN_COMPILE_VALE bool has_aesni = EverCrypt_AutoConfig2_has_aesni(); bool has_pclmulqdq = EverCrypt_AutoConfig2_has_pclmulqdq(); @@ -108,8 +111,8 @@ create_in_aes128_gcm(EverCrypt_AEAD_state_s **dst, uint8_t *k) uint8_t *ek = (uint8_t *)KRML_HOST_CALLOC((uint32_t)480U, sizeof (uint8_t)); uint8_t *keys_b = ek; uint8_t *hkeys_b = ek + (uint32_t)176U; - uint64_t scrut = aes128_key_expansion(k, keys_b); - uint64_t scrut0 = aes128_keyhash_init(keys_b, hkeys_b); + KRML_HOST_IGNORE(aes128_key_expansion(k, keys_b)); + KRML_HOST_IGNORE(aes128_keyhash_init(keys_b, hkeys_b)); EverCrypt_AEAD_state_s *p = (EverCrypt_AEAD_state_s *)KRML_HOST_MALLOC(sizeof (EverCrypt_AEAD_state_s)); p[0U] = ((EverCrypt_AEAD_state_s){ .impl = Spec_Cipher_Expansion_Vale_AES128, .ek = ek }); @@ -125,6 +128,8 @@ create_in_aes128_gcm(EverCrypt_AEAD_state_s **dst, uint8_t *k) static EverCrypt_Error_error_code create_in_aes256_gcm(EverCrypt_AEAD_state_s **dst, uint8_t *k) { + KRML_HOST_IGNORE(dst); + KRML_HOST_IGNORE(k); #if HACL_CAN_COMPILE_VALE bool has_aesni = EverCrypt_AutoConfig2_has_aesni(); bool has_pclmulqdq = EverCrypt_AutoConfig2_has_pclmulqdq(); @@ -136,8 +141,8 @@ create_in_aes256_gcm(EverCrypt_AEAD_state_s **dst, uint8_t *k) uint8_t *ek = (uint8_t *)KRML_HOST_CALLOC((uint32_t)544U, sizeof (uint8_t)); uint8_t *keys_b = ek; uint8_t *hkeys_b = ek + (uint32_t)240U; - uint64_t scrut = aes256_key_expansion(k, keys_b); - uint64_t scrut0 = aes256_keyhash_init(keys_b, hkeys_b); + KRML_HOST_IGNORE(aes256_key_expansion(k, keys_b)); + KRML_HOST_IGNORE(aes256_keyhash_init(keys_b, hkeys_b)); EverCrypt_AEAD_state_s *p = (EverCrypt_AEAD_state_s *)KRML_HOST_MALLOC(sizeof (EverCrypt_AEAD_state_s)); p[0U] = ((EverCrypt_AEAD_state_s){ .impl = Spec_Cipher_Expansion_Vale_AES256, .ek = ek }); @@ -203,6 +208,15 @@ encrypt_aes128_gcm( uint8_t *tag ) { + KRML_HOST_IGNORE(s); + KRML_HOST_IGNORE(iv); + KRML_HOST_IGNORE(iv_len); + KRML_HOST_IGNORE(ad); + KRML_HOST_IGNORE(ad_len); + KRML_HOST_IGNORE(plain); + KRML_HOST_IGNORE(plain_len); + KRML_HOST_IGNORE(cipher); + KRML_HOST_IGNORE(tag); #if HACL_CAN_COMPILE_VALE if (s == NULL) { @@ -212,8 +226,7 @@ encrypt_aes128_gcm( { return EverCrypt_Error_InvalidIVLength; } - EverCrypt_AEAD_state_s scrut = *s; - uint8_t *ek = scrut.ek; + uint8_t *ek = (*s).ek; uint8_t *scratch_b = ek + (uint32_t)304U; uint8_t *ek1 = ek; uint8_t *keys_b = ek1; @@ -223,8 +236,12 @@ encrypt_aes128_gcm( uint32_t bytes_len = len * (uint32_t)16U; uint8_t *iv_b = iv; memcpy(tmp_iv, iv + bytes_len, iv_len % (uint32_t)16U * sizeof (uint8_t)); - uint64_t - uu____0 = compute_iv_stdcall(iv_b, (uint64_t)iv_len, (uint64_t)len, tmp_iv, tmp_iv, hkeys_b); + KRML_HOST_IGNORE(compute_iv_stdcall(iv_b, + (uint64_t)iv_len, + (uint64_t)len, + tmp_iv, + tmp_iv, + hkeys_b)); uint8_t *inout_b = scratch_b; uint8_t *abytes_b = scratch_b + (uint32_t)16U; uint8_t *scratch_b1 = scratch_b + (uint32_t)32U; @@ -250,9 +267,7 @@ encrypt_aes128_gcm( uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; uint64_t len128x6_ = len128x6 / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; - uint64_t - scrut0 = - gcm128_encrypt_opt(auth_b_, + KRML_HOST_IGNORE(gcm128_encrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, keys_b, @@ -268,7 +283,7 @@ encrypt_aes128_gcm( inout_b, (uint64_t)plain_len, scratch_b1, - tag); + tag)); } else { @@ -281,9 +296,7 @@ encrypt_aes128_gcm( uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t len128x6_ = (uint64_t)0U; - uint64_t - scrut0 = - gcm128_encrypt_opt(auth_b_, + KRML_HOST_IGNORE(gcm128_encrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, keys_b, @@ -299,7 +312,7 @@ encrypt_aes128_gcm( inout_b, (uint64_t)plain_len, scratch_b1, - tag); + tag)); } memcpy(cipher + (uint32_t)(uint64_t)plain_len / (uint32_t)16U * (uint32_t)16U, inout_b, @@ -327,6 +340,15 @@ encrypt_aes256_gcm( uint8_t *tag ) { + KRML_HOST_IGNORE(s); + KRML_HOST_IGNORE(iv); + KRML_HOST_IGNORE(iv_len); + KRML_HOST_IGNORE(ad); + KRML_HOST_IGNORE(ad_len); + KRML_HOST_IGNORE(plain); + KRML_HOST_IGNORE(plain_len); + KRML_HOST_IGNORE(cipher); + KRML_HOST_IGNORE(tag); #if HACL_CAN_COMPILE_VALE if (s == NULL) { @@ -336,8 +358,7 @@ encrypt_aes256_gcm( { return EverCrypt_Error_InvalidIVLength; } - EverCrypt_AEAD_state_s scrut = *s; - uint8_t *ek = scrut.ek; + uint8_t *ek = (*s).ek; uint8_t *scratch_b = ek + (uint32_t)368U; uint8_t *ek1 = ek; uint8_t *keys_b = ek1; @@ -347,8 +368,12 @@ encrypt_aes256_gcm( uint32_t bytes_len = len * (uint32_t)16U; uint8_t *iv_b = iv; memcpy(tmp_iv, iv + bytes_len, iv_len % (uint32_t)16U * sizeof (uint8_t)); - uint64_t - uu____0 = compute_iv_stdcall(iv_b, (uint64_t)iv_len, (uint64_t)len, tmp_iv, tmp_iv, hkeys_b); + KRML_HOST_IGNORE(compute_iv_stdcall(iv_b, + (uint64_t)iv_len, + (uint64_t)len, + tmp_iv, + tmp_iv, + hkeys_b)); uint8_t *inout_b = scratch_b; uint8_t *abytes_b = scratch_b + (uint32_t)16U; uint8_t *scratch_b1 = scratch_b + (uint32_t)32U; @@ -374,9 +399,7 @@ encrypt_aes256_gcm( uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; uint64_t len128x6_ = len128x6 / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; - uint64_t - scrut0 = - gcm256_encrypt_opt(auth_b_, + KRML_HOST_IGNORE(gcm256_encrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, keys_b, @@ -392,7 +415,7 @@ encrypt_aes256_gcm( inout_b, (uint64_t)plain_len, scratch_b1, - tag); + tag)); } else { @@ -405,9 +428,7 @@ encrypt_aes256_gcm( uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t len128x6_ = (uint64_t)0U; - uint64_t - scrut0 = - gcm256_encrypt_opt(auth_b_, + KRML_HOST_IGNORE(gcm256_encrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, keys_b, @@ -423,7 +444,7 @@ encrypt_aes256_gcm( inout_b, (uint64_t)plain_len, scratch_b1, - tag); + tag)); } memcpy(cipher + (uint32_t)(uint64_t)plain_len / (uint32_t)16U * (uint32_t)16U, inout_b, @@ -525,27 +546,34 @@ EverCrypt_AEAD_encrypt_expand_aes128_gcm_no_check( uint8_t *tag ) { + KRML_HOST_IGNORE(k); + KRML_HOST_IGNORE(iv); + KRML_HOST_IGNORE(iv_len); + KRML_HOST_IGNORE(ad); + KRML_HOST_IGNORE(ad_len); + KRML_HOST_IGNORE(plain); + KRML_HOST_IGNORE(plain_len); + KRML_HOST_IGNORE(cipher); + KRML_HOST_IGNORE(tag); #if HACL_CAN_COMPILE_VALE uint8_t ek[480U] = { 0U }; uint8_t *keys_b0 = ek; uint8_t *hkeys_b0 = ek + (uint32_t)176U; - uint64_t scrut0 = aes128_key_expansion(k, keys_b0); - uint64_t scrut1 = aes128_keyhash_init(keys_b0, hkeys_b0); + KRML_HOST_IGNORE(aes128_key_expansion(k, keys_b0)); + KRML_HOST_IGNORE(aes128_keyhash_init(keys_b0, hkeys_b0)); EverCrypt_AEAD_state_s p = { .impl = Spec_Cipher_Expansion_Vale_AES128, .ek = ek }; EverCrypt_AEAD_state_s *s = &p; - EverCrypt_Error_error_code r; if (s == NULL) { - r = EverCrypt_Error_InvalidKey; + KRML_HOST_IGNORE(EverCrypt_Error_InvalidKey); } else if (iv_len == (uint32_t)0U) { - r = EverCrypt_Error_InvalidIVLength; + KRML_HOST_IGNORE(EverCrypt_Error_InvalidIVLength); } else { - EverCrypt_AEAD_state_s scrut = *s; - uint8_t *ek0 = scrut.ek; + uint8_t *ek0 = (*s).ek; uint8_t *scratch_b = ek0 + (uint32_t)304U; uint8_t *ek1 = ek0; uint8_t *keys_b = ek1; @@ -555,8 +583,12 @@ EverCrypt_AEAD_encrypt_expand_aes128_gcm_no_check( uint32_t bytes_len = len * (uint32_t)16U; uint8_t *iv_b = iv; memcpy(tmp_iv, iv + bytes_len, iv_len % (uint32_t)16U * sizeof (uint8_t)); - uint64_t - uu____0 = compute_iv_stdcall(iv_b, (uint64_t)iv_len, (uint64_t)len, tmp_iv, tmp_iv, hkeys_b); + KRML_HOST_IGNORE(compute_iv_stdcall(iv_b, + (uint64_t)iv_len, + (uint64_t)len, + tmp_iv, + tmp_iv, + hkeys_b)); uint8_t *inout_b = scratch_b; uint8_t *abytes_b = scratch_b + (uint32_t)16U; uint8_t *scratch_b1 = scratch_b + (uint32_t)32U; @@ -582,9 +614,7 @@ EverCrypt_AEAD_encrypt_expand_aes128_gcm_no_check( uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; uint64_t len128x6_ = len128x6 / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; - uint64_t - scrut2 = - gcm128_encrypt_opt(auth_b_, + KRML_HOST_IGNORE(gcm128_encrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, keys_b, @@ -600,7 +630,7 @@ EverCrypt_AEAD_encrypt_expand_aes128_gcm_no_check( inout_b, (uint64_t)plain_len, scratch_b1, - tag); + tag)); } else { @@ -613,9 +643,7 @@ EverCrypt_AEAD_encrypt_expand_aes128_gcm_no_check( uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t len128x6_ = (uint64_t)0U; - uint64_t - scrut2 = - gcm128_encrypt_opt(auth_b_, + KRML_HOST_IGNORE(gcm128_encrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, keys_b, @@ -631,12 +659,12 @@ EverCrypt_AEAD_encrypt_expand_aes128_gcm_no_check( inout_b, (uint64_t)plain_len, scratch_b1, - tag); + tag)); } memcpy(cipher + (uint32_t)(uint64_t)plain_len / (uint32_t)16U * (uint32_t)16U, inout_b, (uint32_t)(uint64_t)plain_len % (uint32_t)16U * sizeof (uint8_t)); - r = EverCrypt_Error_Success; + KRML_HOST_IGNORE(EverCrypt_Error_Success); } return EverCrypt_Error_Success; #else @@ -669,27 +697,34 @@ EverCrypt_AEAD_encrypt_expand_aes256_gcm_no_check( uint8_t *tag ) { + KRML_HOST_IGNORE(k); + KRML_HOST_IGNORE(iv); + KRML_HOST_IGNORE(iv_len); + KRML_HOST_IGNORE(ad); + KRML_HOST_IGNORE(ad_len); + KRML_HOST_IGNORE(plain); + KRML_HOST_IGNORE(plain_len); + KRML_HOST_IGNORE(cipher); + KRML_HOST_IGNORE(tag); #if HACL_CAN_COMPILE_VALE uint8_t ek[544U] = { 0U }; uint8_t *keys_b0 = ek; uint8_t *hkeys_b0 = ek + (uint32_t)240U; - uint64_t scrut0 = aes256_key_expansion(k, keys_b0); - uint64_t scrut1 = aes256_keyhash_init(keys_b0, hkeys_b0); + KRML_HOST_IGNORE(aes256_key_expansion(k, keys_b0)); + KRML_HOST_IGNORE(aes256_keyhash_init(keys_b0, hkeys_b0)); EverCrypt_AEAD_state_s p = { .impl = Spec_Cipher_Expansion_Vale_AES256, .ek = ek }; EverCrypt_AEAD_state_s *s = &p; - EverCrypt_Error_error_code r; if (s == NULL) { - r = EverCrypt_Error_InvalidKey; + KRML_HOST_IGNORE(EverCrypt_Error_InvalidKey); } else if (iv_len == (uint32_t)0U) { - r = EverCrypt_Error_InvalidIVLength; + KRML_HOST_IGNORE(EverCrypt_Error_InvalidIVLength); } else { - EverCrypt_AEAD_state_s scrut = *s; - uint8_t *ek0 = scrut.ek; + uint8_t *ek0 = (*s).ek; uint8_t *scratch_b = ek0 + (uint32_t)368U; uint8_t *ek1 = ek0; uint8_t *keys_b = ek1; @@ -699,8 +734,12 @@ EverCrypt_AEAD_encrypt_expand_aes256_gcm_no_check( uint32_t bytes_len = len * (uint32_t)16U; uint8_t *iv_b = iv; memcpy(tmp_iv, iv + bytes_len, iv_len % (uint32_t)16U * sizeof (uint8_t)); - uint64_t - uu____0 = compute_iv_stdcall(iv_b, (uint64_t)iv_len, (uint64_t)len, tmp_iv, tmp_iv, hkeys_b); + KRML_HOST_IGNORE(compute_iv_stdcall(iv_b, + (uint64_t)iv_len, + (uint64_t)len, + tmp_iv, + tmp_iv, + hkeys_b)); uint8_t *inout_b = scratch_b; uint8_t *abytes_b = scratch_b + (uint32_t)16U; uint8_t *scratch_b1 = scratch_b + (uint32_t)32U; @@ -726,9 +765,7 @@ EverCrypt_AEAD_encrypt_expand_aes256_gcm_no_check( uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; uint64_t len128x6_ = len128x6 / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; - uint64_t - scrut2 = - gcm256_encrypt_opt(auth_b_, + KRML_HOST_IGNORE(gcm256_encrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, keys_b, @@ -744,7 +781,7 @@ EverCrypt_AEAD_encrypt_expand_aes256_gcm_no_check( inout_b, (uint64_t)plain_len, scratch_b1, - tag); + tag)); } else { @@ -757,9 +794,7 @@ EverCrypt_AEAD_encrypt_expand_aes256_gcm_no_check( uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t len128x6_ = (uint64_t)0U; - uint64_t - scrut2 = - gcm256_encrypt_opt(auth_b_, + KRML_HOST_IGNORE(gcm256_encrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, keys_b, @@ -775,12 +810,12 @@ EverCrypt_AEAD_encrypt_expand_aes256_gcm_no_check( inout_b, (uint64_t)plain_len, scratch_b1, - tag); + tag)); } memcpy(cipher + (uint32_t)(uint64_t)plain_len / (uint32_t)16U * (uint32_t)16U, inout_b, (uint32_t)(uint64_t)plain_len % (uint32_t)16U * sizeof (uint8_t)); - r = EverCrypt_Error_Success; + KRML_HOST_IGNORE(EverCrypt_Error_Success); } return EverCrypt_Error_Success; #else @@ -805,6 +840,15 @@ EverCrypt_AEAD_encrypt_expand_aes128_gcm( uint8_t *tag ) { + KRML_HOST_IGNORE(k); + KRML_HOST_IGNORE(iv); + KRML_HOST_IGNORE(iv_len); + KRML_HOST_IGNORE(ad); + KRML_HOST_IGNORE(ad_len); + KRML_HOST_IGNORE(plain); + KRML_HOST_IGNORE(plain_len); + KRML_HOST_IGNORE(cipher); + KRML_HOST_IGNORE(tag); #if HACL_CAN_COMPILE_VALE bool has_pclmulqdq = EverCrypt_AutoConfig2_has_pclmulqdq(); bool has_avx = EverCrypt_AutoConfig2_has_avx(); @@ -816,23 +860,21 @@ EverCrypt_AEAD_encrypt_expand_aes128_gcm( uint8_t ek[480U] = { 0U }; uint8_t *keys_b0 = ek; uint8_t *hkeys_b0 = ek + (uint32_t)176U; - uint64_t scrut0 = aes128_key_expansion(k, keys_b0); - uint64_t scrut1 = aes128_keyhash_init(keys_b0, hkeys_b0); + KRML_HOST_IGNORE(aes128_key_expansion(k, keys_b0)); + KRML_HOST_IGNORE(aes128_keyhash_init(keys_b0, hkeys_b0)); EverCrypt_AEAD_state_s p = { .impl = Spec_Cipher_Expansion_Vale_AES128, .ek = ek }; EverCrypt_AEAD_state_s *s = &p; - EverCrypt_Error_error_code r; if (s == NULL) { - r = EverCrypt_Error_InvalidKey; + KRML_HOST_IGNORE(EverCrypt_Error_InvalidKey); } else if (iv_len == (uint32_t)0U) { - r = EverCrypt_Error_InvalidIVLength; + KRML_HOST_IGNORE(EverCrypt_Error_InvalidIVLength); } else { - EverCrypt_AEAD_state_s scrut = *s; - uint8_t *ek0 = scrut.ek; + uint8_t *ek0 = (*s).ek; uint8_t *scratch_b = ek0 + (uint32_t)304U; uint8_t *ek1 = ek0; uint8_t *keys_b = ek1; @@ -842,8 +884,12 @@ EverCrypt_AEAD_encrypt_expand_aes128_gcm( uint32_t bytes_len = len * (uint32_t)16U; uint8_t *iv_b = iv; memcpy(tmp_iv, iv + bytes_len, iv_len % (uint32_t)16U * sizeof (uint8_t)); - uint64_t - uu____0 = compute_iv_stdcall(iv_b, (uint64_t)iv_len, (uint64_t)len, tmp_iv, tmp_iv, hkeys_b); + KRML_HOST_IGNORE(compute_iv_stdcall(iv_b, + (uint64_t)iv_len, + (uint64_t)len, + tmp_iv, + tmp_iv, + hkeys_b)); uint8_t *inout_b = scratch_b; uint8_t *abytes_b = scratch_b + (uint32_t)16U; uint8_t *scratch_b1 = scratch_b + (uint32_t)32U; @@ -869,9 +915,7 @@ EverCrypt_AEAD_encrypt_expand_aes128_gcm( uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; uint64_t len128x6_ = len128x6 / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; - uint64_t - scrut2 = - gcm128_encrypt_opt(auth_b_, + KRML_HOST_IGNORE(gcm128_encrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, keys_b, @@ -887,7 +931,7 @@ EverCrypt_AEAD_encrypt_expand_aes128_gcm( inout_b, (uint64_t)plain_len, scratch_b1, - tag); + tag)); } else { @@ -900,9 +944,7 @@ EverCrypt_AEAD_encrypt_expand_aes128_gcm( uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t len128x6_ = (uint64_t)0U; - uint64_t - scrut2 = - gcm128_encrypt_opt(auth_b_, + KRML_HOST_IGNORE(gcm128_encrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, keys_b, @@ -918,12 +960,12 @@ EverCrypt_AEAD_encrypt_expand_aes128_gcm( inout_b, (uint64_t)plain_len, scratch_b1, - tag); + tag)); } memcpy(cipher + (uint32_t)(uint64_t)plain_len / (uint32_t)16U * (uint32_t)16U, inout_b, (uint32_t)(uint64_t)plain_len % (uint32_t)16U * sizeof (uint8_t)); - r = EverCrypt_Error_Success; + KRML_HOST_IGNORE(EverCrypt_Error_Success); } return EverCrypt_Error_Success; } @@ -946,6 +988,15 @@ EverCrypt_AEAD_encrypt_expand_aes256_gcm( uint8_t *tag ) { + KRML_HOST_IGNORE(k); + KRML_HOST_IGNORE(iv); + KRML_HOST_IGNORE(iv_len); + KRML_HOST_IGNORE(ad); + KRML_HOST_IGNORE(ad_len); + KRML_HOST_IGNORE(plain); + KRML_HOST_IGNORE(plain_len); + KRML_HOST_IGNORE(cipher); + KRML_HOST_IGNORE(tag); #if HACL_CAN_COMPILE_VALE bool has_pclmulqdq = EverCrypt_AutoConfig2_has_pclmulqdq(); bool has_avx = EverCrypt_AutoConfig2_has_avx(); @@ -957,23 +1008,21 @@ EverCrypt_AEAD_encrypt_expand_aes256_gcm( uint8_t ek[544U] = { 0U }; uint8_t *keys_b0 = ek; uint8_t *hkeys_b0 = ek + (uint32_t)240U; - uint64_t scrut0 = aes256_key_expansion(k, keys_b0); - uint64_t scrut1 = aes256_keyhash_init(keys_b0, hkeys_b0); + KRML_HOST_IGNORE(aes256_key_expansion(k, keys_b0)); + KRML_HOST_IGNORE(aes256_keyhash_init(keys_b0, hkeys_b0)); EverCrypt_AEAD_state_s p = { .impl = Spec_Cipher_Expansion_Vale_AES256, .ek = ek }; EverCrypt_AEAD_state_s *s = &p; - EverCrypt_Error_error_code r; if (s == NULL) { - r = EverCrypt_Error_InvalidKey; + KRML_HOST_IGNORE(EverCrypt_Error_InvalidKey); } else if (iv_len == (uint32_t)0U) { - r = EverCrypt_Error_InvalidIVLength; + KRML_HOST_IGNORE(EverCrypt_Error_InvalidIVLength); } else { - EverCrypt_AEAD_state_s scrut = *s; - uint8_t *ek0 = scrut.ek; + uint8_t *ek0 = (*s).ek; uint8_t *scratch_b = ek0 + (uint32_t)368U; uint8_t *ek1 = ek0; uint8_t *keys_b = ek1; @@ -983,8 +1032,12 @@ EverCrypt_AEAD_encrypt_expand_aes256_gcm( uint32_t bytes_len = len * (uint32_t)16U; uint8_t *iv_b = iv; memcpy(tmp_iv, iv + bytes_len, iv_len % (uint32_t)16U * sizeof (uint8_t)); - uint64_t - uu____0 = compute_iv_stdcall(iv_b, (uint64_t)iv_len, (uint64_t)len, tmp_iv, tmp_iv, hkeys_b); + KRML_HOST_IGNORE(compute_iv_stdcall(iv_b, + (uint64_t)iv_len, + (uint64_t)len, + tmp_iv, + tmp_iv, + hkeys_b)); uint8_t *inout_b = scratch_b; uint8_t *abytes_b = scratch_b + (uint32_t)16U; uint8_t *scratch_b1 = scratch_b + (uint32_t)32U; @@ -1010,9 +1063,7 @@ EverCrypt_AEAD_encrypt_expand_aes256_gcm( uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; uint64_t len128x6_ = len128x6 / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; - uint64_t - scrut2 = - gcm256_encrypt_opt(auth_b_, + KRML_HOST_IGNORE(gcm256_encrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, keys_b, @@ -1028,7 +1079,7 @@ EverCrypt_AEAD_encrypt_expand_aes256_gcm( inout_b, (uint64_t)plain_len, scratch_b1, - tag); + tag)); } else { @@ -1041,9 +1092,7 @@ EverCrypt_AEAD_encrypt_expand_aes256_gcm( uint64_t auth_num = (uint64_t)ad_len / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t len128x6_ = (uint64_t)0U; - uint64_t - scrut2 = - gcm256_encrypt_opt(auth_b_, + KRML_HOST_IGNORE(gcm256_encrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, keys_b, @@ -1059,12 +1108,12 @@ EverCrypt_AEAD_encrypt_expand_aes256_gcm( inout_b, (uint64_t)plain_len, scratch_b1, - tag); + tag)); } memcpy(cipher + (uint32_t)(uint64_t)plain_len / (uint32_t)16U * (uint32_t)16U, inout_b, (uint32_t)(uint64_t)plain_len % (uint32_t)16U * sizeof (uint8_t)); - r = EverCrypt_Error_Success; + KRML_HOST_IGNORE(EverCrypt_Error_Success); } return EverCrypt_Error_Success; } @@ -1087,12 +1136,12 @@ EverCrypt_AEAD_encrypt_expand_chacha20_poly1305( uint8_t *tag ) { + KRML_HOST_IGNORE(iv_len); uint8_t ek[32U] = { 0U }; EverCrypt_AEAD_state_s p = { .impl = Spec_Cipher_Expansion_Hacl_CHACHA20, .ek = ek }; memcpy(ek, k, (uint32_t)32U * sizeof (uint8_t)); EverCrypt_AEAD_state_s *s = &p; - EverCrypt_AEAD_state_s scrut = *s; - uint8_t *ek0 = scrut.ek; + uint8_t *ek0 = (*s).ek; EverCrypt_Chacha20Poly1305_aead_encrypt(ek0, iv, ad_len, ad, plain_len, plain, cipher, tag); return EverCrypt_Error_Success; } @@ -1173,6 +1222,15 @@ decrypt_aes128_gcm( uint8_t *dst ) { + KRML_HOST_IGNORE(s); + KRML_HOST_IGNORE(iv); + KRML_HOST_IGNORE(iv_len); + KRML_HOST_IGNORE(ad); + KRML_HOST_IGNORE(ad_len); + KRML_HOST_IGNORE(cipher); + KRML_HOST_IGNORE(cipher_len); + KRML_HOST_IGNORE(tag); + KRML_HOST_IGNORE(dst); #if HACL_CAN_COMPILE_VALE if (s == NULL) { @@ -1182,8 +1240,7 @@ decrypt_aes128_gcm( { return EverCrypt_Error_InvalidIVLength; } - EverCrypt_AEAD_state_s scrut = *s; - uint8_t *ek = scrut.ek; + uint8_t *ek = (*s).ek; uint8_t *scratch_b = ek + (uint32_t)304U; uint8_t *ek1 = ek; uint8_t *keys_b = ek1; @@ -1193,8 +1250,12 @@ decrypt_aes128_gcm( uint32_t bytes_len = len * (uint32_t)16U; uint8_t *iv_b = iv; memcpy(tmp_iv, iv + bytes_len, iv_len % (uint32_t)16U * sizeof (uint8_t)); - uint64_t - uu____0 = compute_iv_stdcall(iv_b, (uint64_t)iv_len, (uint64_t)len, tmp_iv, tmp_iv, hkeys_b); + KRML_HOST_IGNORE(compute_iv_stdcall(iv_b, + (uint64_t)iv_len, + (uint64_t)len, + tmp_iv, + tmp_iv, + hkeys_b)); uint8_t *inout_b = scratch_b; uint8_t *abytes_b = scratch_b + (uint32_t)16U; uint8_t *scratch_b1 = scratch_b + (uint32_t)32U; @@ -1222,7 +1283,7 @@ decrypt_aes128_gcm( uint64_t len128x6_ = len128x6 / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t - scrut0 = + c0 = gcm128_decrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, @@ -1240,7 +1301,6 @@ decrypt_aes128_gcm( (uint64_t)cipher_len, scratch_b1, tag); - uint64_t c0 = scrut0; c = c0; } else @@ -1255,7 +1315,7 @@ decrypt_aes128_gcm( uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t len128x6_ = (uint64_t)0U; uint64_t - scrut0 = + c0 = gcm128_decrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, @@ -1273,7 +1333,6 @@ decrypt_aes128_gcm( (uint64_t)cipher_len, scratch_b1, tag); - uint64_t c0 = scrut0; c = c0; } memcpy(dst + (uint32_t)(uint64_t)cipher_len / (uint32_t)16U * (uint32_t)16U, @@ -1307,6 +1366,15 @@ decrypt_aes256_gcm( uint8_t *dst ) { + KRML_HOST_IGNORE(s); + KRML_HOST_IGNORE(iv); + KRML_HOST_IGNORE(iv_len); + KRML_HOST_IGNORE(ad); + KRML_HOST_IGNORE(ad_len); + KRML_HOST_IGNORE(cipher); + KRML_HOST_IGNORE(cipher_len); + KRML_HOST_IGNORE(tag); + KRML_HOST_IGNORE(dst); #if HACL_CAN_COMPILE_VALE if (s == NULL) { @@ -1316,8 +1384,7 @@ decrypt_aes256_gcm( { return EverCrypt_Error_InvalidIVLength; } - EverCrypt_AEAD_state_s scrut = *s; - uint8_t *ek = scrut.ek; + uint8_t *ek = (*s).ek; uint8_t *scratch_b = ek + (uint32_t)368U; uint8_t *ek1 = ek; uint8_t *keys_b = ek1; @@ -1327,8 +1394,12 @@ decrypt_aes256_gcm( uint32_t bytes_len = len * (uint32_t)16U; uint8_t *iv_b = iv; memcpy(tmp_iv, iv + bytes_len, iv_len % (uint32_t)16U * sizeof (uint8_t)); - uint64_t - uu____0 = compute_iv_stdcall(iv_b, (uint64_t)iv_len, (uint64_t)len, tmp_iv, tmp_iv, hkeys_b); + KRML_HOST_IGNORE(compute_iv_stdcall(iv_b, + (uint64_t)iv_len, + (uint64_t)len, + tmp_iv, + tmp_iv, + hkeys_b)); uint8_t *inout_b = scratch_b; uint8_t *abytes_b = scratch_b + (uint32_t)16U; uint8_t *scratch_b1 = scratch_b + (uint32_t)32U; @@ -1356,7 +1427,7 @@ decrypt_aes256_gcm( uint64_t len128x6_ = len128x6 / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t - scrut0 = + c0 = gcm256_decrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, @@ -1374,7 +1445,6 @@ decrypt_aes256_gcm( (uint64_t)cipher_len, scratch_b1, tag); - uint64_t c0 = scrut0; c = c0; } else @@ -1389,7 +1459,7 @@ decrypt_aes256_gcm( uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t len128x6_ = (uint64_t)0U; uint64_t - scrut0 = + c0 = gcm256_decrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, @@ -1407,7 +1477,6 @@ decrypt_aes256_gcm( (uint64_t)cipher_len, scratch_b1, tag); - uint64_t c0 = scrut0; c = c0; } memcpy(dst + (uint32_t)(uint64_t)cipher_len / (uint32_t)16U * (uint32_t)16U, @@ -1449,8 +1518,7 @@ decrypt_chacha20_poly1305( { return EverCrypt_Error_InvalidIVLength; } - EverCrypt_AEAD_state_s scrut = *s; - uint8_t *ek = scrut.ek; + uint8_t *ek = (*s).ek; uint32_t r = EverCrypt_Chacha20Poly1305_aead_decrypt(ek, iv, ad_len, ad, cipher_len, dst, cipher, tag); if (r == (uint32_t)0U) @@ -1508,8 +1576,7 @@ EverCrypt_AEAD_decrypt( { return EverCrypt_Error_InvalidKey; } - EverCrypt_AEAD_state_s scrut = *s; - Spec_Cipher_Expansion_impl i = scrut.impl; + Spec_Cipher_Expansion_impl i = (*s).impl; switch (i) { case Spec_Cipher_Expansion_Vale_AES128: @@ -1553,12 +1620,21 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm_no_check( uint8_t *dst ) { + KRML_HOST_IGNORE(k); + KRML_HOST_IGNORE(iv); + KRML_HOST_IGNORE(iv_len); + KRML_HOST_IGNORE(ad); + KRML_HOST_IGNORE(ad_len); + KRML_HOST_IGNORE(cipher); + KRML_HOST_IGNORE(cipher_len); + KRML_HOST_IGNORE(tag); + KRML_HOST_IGNORE(dst); #if HACL_CAN_COMPILE_VALE uint8_t ek[480U] = { 0U }; uint8_t *keys_b0 = ek; uint8_t *hkeys_b0 = ek + (uint32_t)176U; - uint64_t scrut = aes128_key_expansion(k, keys_b0); - uint64_t scrut0 = aes128_keyhash_init(keys_b0, hkeys_b0); + KRML_HOST_IGNORE(aes128_key_expansion(k, keys_b0)); + KRML_HOST_IGNORE(aes128_keyhash_init(keys_b0, hkeys_b0)); EverCrypt_AEAD_state_s p = { .impl = Spec_Cipher_Expansion_Vale_AES128, .ek = ek }; EverCrypt_AEAD_state_s *s = &p; if (s == NULL) @@ -1569,8 +1645,7 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm_no_check( { return EverCrypt_Error_InvalidIVLength; } - EverCrypt_AEAD_state_s scrut1 = *s; - uint8_t *ek0 = scrut1.ek; + uint8_t *ek0 = (*s).ek; uint8_t *scratch_b = ek0 + (uint32_t)304U; uint8_t *ek1 = ek0; uint8_t *keys_b = ek1; @@ -1580,8 +1655,12 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm_no_check( uint32_t bytes_len = len * (uint32_t)16U; uint8_t *iv_b = iv; memcpy(tmp_iv, iv + bytes_len, iv_len % (uint32_t)16U * sizeof (uint8_t)); - uint64_t - uu____0 = compute_iv_stdcall(iv_b, (uint64_t)iv_len, (uint64_t)len, tmp_iv, tmp_iv, hkeys_b); + KRML_HOST_IGNORE(compute_iv_stdcall(iv_b, + (uint64_t)iv_len, + (uint64_t)len, + tmp_iv, + tmp_iv, + hkeys_b)); uint8_t *inout_b = scratch_b; uint8_t *abytes_b = scratch_b + (uint32_t)16U; uint8_t *scratch_b1 = scratch_b + (uint32_t)32U; @@ -1609,7 +1688,7 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm_no_check( uint64_t len128x6_ = len128x6 / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t - scrut2 = + c0 = gcm128_decrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, @@ -1627,7 +1706,6 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm_no_check( (uint64_t)cipher_len, scratch_b1, tag); - uint64_t c0 = scrut2; c = c0; } else @@ -1642,7 +1720,7 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm_no_check( uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t len128x6_ = (uint64_t)0U; uint64_t - scrut2 = + c0 = gcm128_decrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, @@ -1660,7 +1738,6 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm_no_check( (uint64_t)cipher_len, scratch_b1, tag); - uint64_t c0 = scrut2; c = c0; } memcpy(dst + (uint32_t)(uint64_t)cipher_len / (uint32_t)16U * (uint32_t)16U, @@ -1702,12 +1779,21 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm_no_check( uint8_t *dst ) { + KRML_HOST_IGNORE(k); + KRML_HOST_IGNORE(iv); + KRML_HOST_IGNORE(iv_len); + KRML_HOST_IGNORE(ad); + KRML_HOST_IGNORE(ad_len); + KRML_HOST_IGNORE(cipher); + KRML_HOST_IGNORE(cipher_len); + KRML_HOST_IGNORE(tag); + KRML_HOST_IGNORE(dst); #if HACL_CAN_COMPILE_VALE uint8_t ek[544U] = { 0U }; uint8_t *keys_b0 = ek; uint8_t *hkeys_b0 = ek + (uint32_t)240U; - uint64_t scrut = aes256_key_expansion(k, keys_b0); - uint64_t scrut0 = aes256_keyhash_init(keys_b0, hkeys_b0); + KRML_HOST_IGNORE(aes256_key_expansion(k, keys_b0)); + KRML_HOST_IGNORE(aes256_keyhash_init(keys_b0, hkeys_b0)); EverCrypt_AEAD_state_s p = { .impl = Spec_Cipher_Expansion_Vale_AES256, .ek = ek }; EverCrypt_AEAD_state_s *s = &p; if (s == NULL) @@ -1718,8 +1804,7 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm_no_check( { return EverCrypt_Error_InvalidIVLength; } - EverCrypt_AEAD_state_s scrut1 = *s; - uint8_t *ek0 = scrut1.ek; + uint8_t *ek0 = (*s).ek; uint8_t *scratch_b = ek0 + (uint32_t)368U; uint8_t *ek1 = ek0; uint8_t *keys_b = ek1; @@ -1729,8 +1814,12 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm_no_check( uint32_t bytes_len = len * (uint32_t)16U; uint8_t *iv_b = iv; memcpy(tmp_iv, iv + bytes_len, iv_len % (uint32_t)16U * sizeof (uint8_t)); - uint64_t - uu____0 = compute_iv_stdcall(iv_b, (uint64_t)iv_len, (uint64_t)len, tmp_iv, tmp_iv, hkeys_b); + KRML_HOST_IGNORE(compute_iv_stdcall(iv_b, + (uint64_t)iv_len, + (uint64_t)len, + tmp_iv, + tmp_iv, + hkeys_b)); uint8_t *inout_b = scratch_b; uint8_t *abytes_b = scratch_b + (uint32_t)16U; uint8_t *scratch_b1 = scratch_b + (uint32_t)32U; @@ -1758,7 +1847,7 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm_no_check( uint64_t len128x6_ = len128x6 / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t - scrut2 = + c0 = gcm256_decrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, @@ -1776,7 +1865,6 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm_no_check( (uint64_t)cipher_len, scratch_b1, tag); - uint64_t c0 = scrut2; c = c0; } else @@ -1791,7 +1879,7 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm_no_check( uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t len128x6_ = (uint64_t)0U; uint64_t - scrut2 = + c0 = gcm256_decrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, @@ -1809,7 +1897,6 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm_no_check( (uint64_t)cipher_len, scratch_b1, tag); - uint64_t c0 = scrut2; c = c0; } memcpy(dst + (uint32_t)(uint64_t)cipher_len / (uint32_t)16U * (uint32_t)16U, @@ -1843,6 +1930,15 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm( uint8_t *dst ) { + KRML_HOST_IGNORE(k); + KRML_HOST_IGNORE(iv); + KRML_HOST_IGNORE(iv_len); + KRML_HOST_IGNORE(ad); + KRML_HOST_IGNORE(ad_len); + KRML_HOST_IGNORE(cipher); + KRML_HOST_IGNORE(cipher_len); + KRML_HOST_IGNORE(tag); + KRML_HOST_IGNORE(dst); #if HACL_CAN_COMPILE_VALE bool has_pclmulqdq = EverCrypt_AutoConfig2_has_pclmulqdq(); bool has_avx = EverCrypt_AutoConfig2_has_avx(); @@ -1854,8 +1950,8 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm( uint8_t ek[480U] = { 0U }; uint8_t *keys_b0 = ek; uint8_t *hkeys_b0 = ek + (uint32_t)176U; - uint64_t scrut = aes128_key_expansion(k, keys_b0); - uint64_t scrut0 = aes128_keyhash_init(keys_b0, hkeys_b0); + KRML_HOST_IGNORE(aes128_key_expansion(k, keys_b0)); + KRML_HOST_IGNORE(aes128_keyhash_init(keys_b0, hkeys_b0)); EverCrypt_AEAD_state_s p = { .impl = Spec_Cipher_Expansion_Vale_AES128, .ek = ek }; EverCrypt_AEAD_state_s *s = &p; if (s == NULL) @@ -1866,8 +1962,7 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm( { return EverCrypt_Error_InvalidIVLength; } - EverCrypt_AEAD_state_s scrut1 = *s; - uint8_t *ek0 = scrut1.ek; + uint8_t *ek0 = (*s).ek; uint8_t *scratch_b = ek0 + (uint32_t)304U; uint8_t *ek1 = ek0; uint8_t *keys_b = ek1; @@ -1877,8 +1972,12 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm( uint32_t bytes_len = len * (uint32_t)16U; uint8_t *iv_b = iv; memcpy(tmp_iv, iv + bytes_len, iv_len % (uint32_t)16U * sizeof (uint8_t)); - uint64_t - uu____0 = compute_iv_stdcall(iv_b, (uint64_t)iv_len, (uint64_t)len, tmp_iv, tmp_iv, hkeys_b); + KRML_HOST_IGNORE(compute_iv_stdcall(iv_b, + (uint64_t)iv_len, + (uint64_t)len, + tmp_iv, + tmp_iv, + hkeys_b)); uint8_t *inout_b = scratch_b; uint8_t *abytes_b = scratch_b + (uint32_t)16U; uint8_t *scratch_b1 = scratch_b + (uint32_t)32U; @@ -1906,7 +2005,7 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm( uint64_t len128x6_ = len128x6 / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t - scrut2 = + c0 = gcm128_decrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, @@ -1924,7 +2023,6 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm( (uint64_t)cipher_len, scratch_b1, tag); - uint64_t c0 = scrut2; c = c0; } else @@ -1939,7 +2037,7 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm( uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t len128x6_ = (uint64_t)0U; uint64_t - scrut2 = + c0 = gcm128_decrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, @@ -1957,7 +2055,6 @@ EverCrypt_AEAD_decrypt_expand_aes128_gcm( (uint64_t)cipher_len, scratch_b1, tag); - uint64_t c0 = scrut2; c = c0; } memcpy(dst + (uint32_t)(uint64_t)cipher_len / (uint32_t)16U * (uint32_t)16U, @@ -1989,6 +2086,15 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm( uint8_t *dst ) { + KRML_HOST_IGNORE(k); + KRML_HOST_IGNORE(iv); + KRML_HOST_IGNORE(iv_len); + KRML_HOST_IGNORE(ad); + KRML_HOST_IGNORE(ad_len); + KRML_HOST_IGNORE(cipher); + KRML_HOST_IGNORE(cipher_len); + KRML_HOST_IGNORE(tag); + KRML_HOST_IGNORE(dst); #if HACL_CAN_COMPILE_VALE bool has_pclmulqdq = EverCrypt_AutoConfig2_has_pclmulqdq(); bool has_avx = EverCrypt_AutoConfig2_has_avx(); @@ -2000,8 +2106,8 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm( uint8_t ek[544U] = { 0U }; uint8_t *keys_b0 = ek; uint8_t *hkeys_b0 = ek + (uint32_t)240U; - uint64_t scrut = aes256_key_expansion(k, keys_b0); - uint64_t scrut0 = aes256_keyhash_init(keys_b0, hkeys_b0); + KRML_HOST_IGNORE(aes256_key_expansion(k, keys_b0)); + KRML_HOST_IGNORE(aes256_keyhash_init(keys_b0, hkeys_b0)); EverCrypt_AEAD_state_s p = { .impl = Spec_Cipher_Expansion_Vale_AES256, .ek = ek }; EverCrypt_AEAD_state_s *s = &p; if (s == NULL) @@ -2012,8 +2118,7 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm( { return EverCrypt_Error_InvalidIVLength; } - EverCrypt_AEAD_state_s scrut1 = *s; - uint8_t *ek0 = scrut1.ek; + uint8_t *ek0 = (*s).ek; uint8_t *scratch_b = ek0 + (uint32_t)368U; uint8_t *ek1 = ek0; uint8_t *keys_b = ek1; @@ -2023,8 +2128,12 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm( uint32_t bytes_len = len * (uint32_t)16U; uint8_t *iv_b = iv; memcpy(tmp_iv, iv + bytes_len, iv_len % (uint32_t)16U * sizeof (uint8_t)); - uint64_t - uu____0 = compute_iv_stdcall(iv_b, (uint64_t)iv_len, (uint64_t)len, tmp_iv, tmp_iv, hkeys_b); + KRML_HOST_IGNORE(compute_iv_stdcall(iv_b, + (uint64_t)iv_len, + (uint64_t)len, + tmp_iv, + tmp_iv, + hkeys_b)); uint8_t *inout_b = scratch_b; uint8_t *abytes_b = scratch_b + (uint32_t)16U; uint8_t *scratch_b1 = scratch_b + (uint32_t)32U; @@ -2052,7 +2161,7 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm( uint64_t len128x6_ = len128x6 / (uint64_t)16U; uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t - scrut2 = + c0 = gcm256_decrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, @@ -2070,7 +2179,6 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm( (uint64_t)cipher_len, scratch_b1, tag); - uint64_t c0 = scrut2; c = c0; } else @@ -2085,7 +2193,7 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm( uint64_t len128_num_ = len128_num / (uint64_t)16U; uint64_t len128x6_ = (uint64_t)0U; uint64_t - scrut2 = + c0 = gcm256_decrypt_opt(auth_b_, (uint64_t)ad_len, auth_num, @@ -2103,7 +2211,6 @@ EverCrypt_AEAD_decrypt_expand_aes256_gcm( (uint64_t)cipher_len, scratch_b1, tag); - uint64_t c0 = scrut2; c = c0; } memcpy(dst + (uint32_t)(uint64_t)cipher_len / (uint32_t)16U * (uint32_t)16U, @@ -2214,8 +2321,7 @@ Cleanup and free the AEAD state. */ void EverCrypt_AEAD_free(EverCrypt_AEAD_state_s *s) { - EverCrypt_AEAD_state_s scrut = *s; - uint8_t *ek = scrut.ek; + uint8_t *ek = (*s).ek; KRML_HOST_FREE(ek); KRML_HOST_FREE(s); } diff --git a/src/msvc/EverCrypt_AutoConfig2.c b/src/msvc/EverCrypt_AutoConfig2.c index fe93ef8a..b549d020 100644 --- a/src/msvc/EverCrypt_AutoConfig2.c +++ b/src/msvc/EverCrypt_AutoConfig2.c @@ -113,75 +113,59 @@ void EverCrypt_AutoConfig2_recall(void) void EverCrypt_AutoConfig2_init(void) { #if HACL_CAN_COMPILE_VALE - uint64_t scrut = check_aesni(); - if (scrut != (uint64_t)0U) + if (check_aesni() != (uint64_t)0U) { cpu_has_aesni[0U] = true; cpu_has_pclmulqdq[0U] = true; } - uint64_t scrut0 = check_sha(); - if (scrut0 != (uint64_t)0U) + if (check_sha() != (uint64_t)0U) { cpu_has_shaext[0U] = true; } - uint64_t scrut1 = check_adx_bmi2(); - if (scrut1 != (uint64_t)0U) + if (check_adx_bmi2() != (uint64_t)0U) { cpu_has_bmi2[0U] = true; cpu_has_adx[0U] = true; } - uint64_t scrut2 = check_avx(); - if (scrut2 != (uint64_t)0U) + if (check_avx() != (uint64_t)0U) { - uint64_t scrut3 = check_osxsave(); - if (scrut3 != (uint64_t)0U) + if (check_osxsave() != (uint64_t)0U) { - uint64_t scrut4 = check_avx_xcr0(); - if (scrut4 != (uint64_t)0U) + if (check_avx_xcr0() != (uint64_t)0U) { cpu_has_avx[0U] = true; } } } - uint64_t scrut3 = check_avx2(); - if (scrut3 != (uint64_t)0U) + if (check_avx2() != (uint64_t)0U) { - uint64_t scrut4 = check_osxsave(); - if (scrut4 != (uint64_t)0U) + if (check_osxsave() != (uint64_t)0U) { - uint64_t scrut5 = check_avx_xcr0(); - if (scrut5 != (uint64_t)0U) + if (check_avx_xcr0() != (uint64_t)0U) { cpu_has_avx2[0U] = true; } } } - uint64_t scrut4 = check_sse(); - if (scrut4 != (uint64_t)0U) + if (check_sse() != (uint64_t)0U) { cpu_has_sse[0U] = true; } - uint64_t scrut5 = check_movbe(); - if (scrut5 != (uint64_t)0U) + if (check_movbe() != (uint64_t)0U) { cpu_has_movbe[0U] = true; } - uint64_t scrut6 = check_rdrand(); - if (scrut6 != (uint64_t)0U) + if (check_rdrand() != (uint64_t)0U) { cpu_has_rdrand[0U] = true; } - uint64_t scrut7 = check_avx512(); - if (scrut7 != (uint64_t)0U) + if (check_avx512() != (uint64_t)0U) { - uint64_t scrut8 = check_osxsave(); - if (scrut8 != (uint64_t)0U) + if (check_osxsave() != (uint64_t)0U) { - uint64_t scrut9 = check_avx_xcr0(); - if (scrut9 != (uint64_t)0U) + if (check_avx_xcr0() != (uint64_t)0U) { - uint64_t scrut10 = check_avx512_xcr0(); - if (scrut10 != (uint64_t)0U) + if (check_avx512_xcr0() != (uint64_t)0U) { cpu_has_avx512[0U] = true; return; diff --git a/src/msvc/EverCrypt_DRBG.c b/src/msvc/EverCrypt_DRBG.c index 243d8eb4..9591823c 100644 --- a/src/msvc/EverCrypt_DRBG.c +++ b/src/msvc/EverCrypt_DRBG.c @@ -92,6 +92,7 @@ EverCrypt_DRBG_uu___is_SHA1_s( EverCrypt_DRBG_state_s projectee ) { + KRML_HOST_IGNORE(uu___); if (projectee.tag == SHA1_s) { return true; @@ -105,6 +106,7 @@ EverCrypt_DRBG_uu___is_SHA2_256_s( EverCrypt_DRBG_state_s projectee ) { + KRML_HOST_IGNORE(uu___); if (projectee.tag == SHA2_256_s) { return true; @@ -118,6 +120,7 @@ EverCrypt_DRBG_uu___is_SHA2_384_s( EverCrypt_DRBG_state_s projectee ) { + KRML_HOST_IGNORE(uu___); if (projectee.tag == SHA2_384_s) { return true; @@ -131,6 +134,7 @@ EverCrypt_DRBG_uu___is_SHA2_512_s( EverCrypt_DRBG_state_s projectee ) { + KRML_HOST_IGNORE(uu___); if (projectee.tag == SHA2_512_s) { return true; diff --git a/src/msvc/EverCrypt_Hash.c b/src/msvc/EverCrypt_Hash.c index 914a105f..b88df9e2 100644 --- a/src/msvc/EverCrypt_Hash.c +++ b/src/msvc/EverCrypt_Hash.c @@ -399,7 +399,7 @@ void EverCrypt_Hash_update_multi_256(uint32_t *s, uint8_t *blocks, uint32_t n) if (has_shaext && has_sse) { uint64_t n1 = (uint64_t)n; - uint64_t scrut = sha256_update(s, blocks, n1, k224_256); + KRML_HOST_IGNORE(sha256_update(s, blocks, n1, k224_256)); return; } Hacl_SHA2_Scalar32_sha256_update_nblocks(n * (uint32_t)64U, blocks, s); @@ -2156,8 +2156,7 @@ Perform a run-time test to determine which algorithm was chosen for the given pi Spec_Hash_Definitions_hash_alg EverCrypt_Hash_Incremental_alg_of_state(EverCrypt_Hash_Incremental_hash_state *s) { - EverCrypt_Hash_Incremental_hash_state scrut = *s; - EverCrypt_Hash_state_s *block_state = scrut.block_state; + EverCrypt_Hash_state_s *block_state = (*s).block_state; return alg_of_state(block_state); } diff --git a/src/msvc/EverCrypt_Poly1305.c b/src/msvc/EverCrypt_Poly1305.c index 717b9527..454c0fce 100644 --- a/src/msvc/EverCrypt_Poly1305.c +++ b/src/msvc/EverCrypt_Poly1305.c @@ -28,8 +28,13 @@ #include "internal/Vale.h" #include "config.h" -static void poly1305_vale(uint8_t *dst, uint8_t *src, uint32_t len, uint8_t *key) +KRML_MAYBE_UNUSED static void +poly1305_vale(uint8_t *dst, uint8_t *src, uint32_t len, uint8_t *key) { + KRML_HOST_IGNORE(dst); + KRML_HOST_IGNORE(src); + KRML_HOST_IGNORE(len); + KRML_HOST_IGNORE(key); #if HACL_CAN_COMPILE_VALE uint8_t ctx[192U] = { 0U }; memcpy(ctx + (uint32_t)24U, key, (uint32_t)32U * sizeof (uint8_t)); @@ -38,19 +43,16 @@ static void poly1305_vale(uint8_t *dst, uint8_t *src, uint32_t len, uint8_t *key uint8_t tmp[16U] = { 0U }; if (n_extra == (uint32_t)0U) { - uint64_t scrut = x64_poly1305(ctx, src, (uint64_t)len, (uint64_t)1U); - KRML_HOST_IGNORE((void *)(uint8_t)0U); + KRML_HOST_IGNORE(x64_poly1305(ctx, src, (uint64_t)len, (uint64_t)1U)); } else { uint32_t len16 = n_blocks * (uint32_t)16U; uint8_t *src16 = src; memcpy(tmp, src + len16, n_extra * sizeof (uint8_t)); - uint64_t scrut = x64_poly1305(ctx, src16, (uint64_t)len16, (uint64_t)0U); - KRML_HOST_IGNORE((void *)(uint8_t)0U); + KRML_HOST_IGNORE(x64_poly1305(ctx, src16, (uint64_t)len16, (uint64_t)0U)); memcpy(ctx + (uint32_t)24U, key, (uint32_t)32U * sizeof (uint8_t)); - uint64_t scrut0 = x64_poly1305(ctx, tmp, (uint64_t)n_extra, (uint64_t)1U); - KRML_HOST_IGNORE((void *)(uint8_t)0U); + KRML_HOST_IGNORE(x64_poly1305(ctx, tmp, (uint64_t)n_extra, (uint64_t)1U)); } memcpy(dst, ctx, (uint32_t)16U * sizeof (uint8_t)); #endif diff --git a/src/msvc/Hacl_Chacha20_Vec128.c b/src/msvc/Hacl_Chacha20_Vec128.c index ed112654..1e0c4ec1 100644 --- a/src/msvc/Hacl_Chacha20_Vec128.c +++ b/src/msvc/Hacl_Chacha20_Vec128.c @@ -370,9 +370,8 @@ Hacl_Chacha20_Vec128_chacha20_encrypt_128( if (rem1 > (uint32_t)0U) { uint8_t *uu____2 = out + nb * (uint32_t)256U; - uint8_t *uu____3 = text + nb * (uint32_t)256U; uint8_t plain[256U] = { 0U }; - memcpy(plain, uu____3, rem * sizeof (uint8_t)); + memcpy(plain, text + nb * (uint32_t)256U, rem * sizeof (uint8_t)); KRML_PRE_ALIGN(16) Lib_IntVector_Intrinsics_vec128 k[16U] KRML_POST_ALIGN(16) = { 0U }; chacha20_core_128(k, ctx, nb); Lib_IntVector_Intrinsics_vec128 st0 = k[0U]; @@ -676,9 +675,8 @@ Hacl_Chacha20_Vec128_chacha20_decrypt_128( if (rem1 > (uint32_t)0U) { uint8_t *uu____2 = out + nb * (uint32_t)256U; - uint8_t *uu____3 = cipher + nb * (uint32_t)256U; uint8_t plain[256U] = { 0U }; - memcpy(plain, uu____3, rem * sizeof (uint8_t)); + memcpy(plain, cipher + nb * (uint32_t)256U, rem * sizeof (uint8_t)); KRML_PRE_ALIGN(16) Lib_IntVector_Intrinsics_vec128 k[16U] KRML_POST_ALIGN(16) = { 0U }; chacha20_core_128(k, ctx, nb); Lib_IntVector_Intrinsics_vec128 st0 = k[0U]; diff --git a/src/msvc/Hacl_Chacha20_Vec256.c b/src/msvc/Hacl_Chacha20_Vec256.c index 2df300b6..620f5040 100644 --- a/src/msvc/Hacl_Chacha20_Vec256.c +++ b/src/msvc/Hacl_Chacha20_Vec256.c @@ -470,9 +470,8 @@ Hacl_Chacha20_Vec256_chacha20_encrypt_256( if (rem1 > (uint32_t)0U) { uint8_t *uu____2 = out + nb * (uint32_t)512U; - uint8_t *uu____3 = text + nb * (uint32_t)512U; uint8_t plain[512U] = { 0U }; - memcpy(plain, uu____3, rem * sizeof (uint8_t)); + memcpy(plain, text + nb * (uint32_t)512U, rem * sizeof (uint8_t)); KRML_PRE_ALIGN(32) Lib_IntVector_Intrinsics_vec256 k[16U] KRML_POST_ALIGN(32) = { 0U }; chacha20_core_256(k, ctx, nb); Lib_IntVector_Intrinsics_vec256 st0 = k[0U]; @@ -968,9 +967,8 @@ Hacl_Chacha20_Vec256_chacha20_decrypt_256( if (rem1 > (uint32_t)0U) { uint8_t *uu____2 = out + nb * (uint32_t)512U; - uint8_t *uu____3 = cipher + nb * (uint32_t)512U; uint8_t plain[512U] = { 0U }; - memcpy(plain, uu____3, rem * sizeof (uint8_t)); + memcpy(plain, cipher + nb * (uint32_t)512U, rem * sizeof (uint8_t)); KRML_PRE_ALIGN(32) Lib_IntVector_Intrinsics_vec256 k[16U] KRML_POST_ALIGN(32) = { 0U }; chacha20_core_256(k, ctx, nb); Lib_IntVector_Intrinsics_vec256 st0 = k[0U]; diff --git a/src/msvc/Hacl_Chacha20_Vec32.c b/src/msvc/Hacl_Chacha20_Vec32.c index 6f137f39..2bf4764c 100644 --- a/src/msvc/Hacl_Chacha20_Vec32.c +++ b/src/msvc/Hacl_Chacha20_Vec32.c @@ -229,9 +229,8 @@ Hacl_Chacha20_Vec32_chacha20_encrypt_32( if (rem1 > (uint32_t)0U) { uint8_t *uu____2 = out + nb * (uint32_t)64U; - uint8_t *uu____3 = text + nb * (uint32_t)64U; uint8_t plain[64U] = { 0U }; - memcpy(plain, uu____3, rem * sizeof (uint8_t)); + memcpy(plain, text + nb * (uint32_t)64U, rem * sizeof (uint8_t)); uint32_t k[16U] = { 0U }; chacha20_core_32(k, ctx, nb); KRML_MAYBE_FOR16(i, @@ -279,9 +278,8 @@ Hacl_Chacha20_Vec32_chacha20_decrypt_32( if (rem1 > (uint32_t)0U) { uint8_t *uu____2 = out + nb * (uint32_t)64U; - uint8_t *uu____3 = cipher + nb * (uint32_t)64U; uint8_t plain[64U] = { 0U }; - memcpy(plain, uu____3, rem * sizeof (uint8_t)); + memcpy(plain, cipher + nb * (uint32_t)64U, rem * sizeof (uint8_t)); uint32_t k[16U] = { 0U }; chacha20_core_32(k, ctx, nb); KRML_MAYBE_FOR16(i, diff --git a/src/msvc/Hacl_Curve25519_64.c b/src/msvc/Hacl_Curve25519_64.c index 526fbd22..fb0974fe 100644 --- a/src/msvc/Hacl_Curve25519_64.c +++ b/src/msvc/Hacl_Curve25519_64.c @@ -35,7 +35,7 @@ static inline void add_scalar0(uint64_t *out, uint64_t *f1, uint64_t f2) #if HACL_CAN_COMPILE_INLINE_ASM add_scalar(out, f1, f2); #else - uint64_t uu____0 = add_scalar_e(out, f1, f2); + KRML_HOST_IGNORE(add_scalar_e(out, f1, f2)); #endif } @@ -44,7 +44,7 @@ static inline void fadd0(uint64_t *out, uint64_t *f1, uint64_t *f2) #if HACL_CAN_COMPILE_INLINE_ASM fadd(out, f1, f2); #else - uint64_t uu____0 = fadd_e(out, f1, f2); + KRML_HOST_IGNORE(fadd_e(out, f1, f2)); #endif } @@ -53,7 +53,7 @@ static inline void fsub0(uint64_t *out, uint64_t *f1, uint64_t *f2) #if HACL_CAN_COMPILE_INLINE_ASM fsub(out, f1, f2); #else - uint64_t uu____0 = fsub_e(out, f1, f2); + KRML_HOST_IGNORE(fsub_e(out, f1, f2)); #endif } @@ -62,7 +62,7 @@ static inline void fmul0(uint64_t *out, uint64_t *f1, uint64_t *f2, uint64_t *tm #if HACL_CAN_COMPILE_INLINE_ASM fmul(out, f1, f2, tmp); #else - uint64_t uu____0 = fmul_e(tmp, f1, out, f2); + KRML_HOST_IGNORE(fmul_e(tmp, f1, out, f2)); #endif } @@ -71,7 +71,7 @@ static inline void fmul20(uint64_t *out, uint64_t *f1, uint64_t *f2, uint64_t *t #if HACL_CAN_COMPILE_INLINE_ASM fmul2(out, f1, f2, tmp); #else - uint64_t uu____0 = fmul2_e(tmp, f1, out, f2); + KRML_HOST_IGNORE(fmul2_e(tmp, f1, out, f2)); #endif } @@ -80,7 +80,7 @@ static inline void fmul_scalar0(uint64_t *out, uint64_t *f1, uint64_t f2) #if HACL_CAN_COMPILE_INLINE_ASM fmul_scalar(out, f1, f2); #else - uint64_t uu____0 = fmul_scalar_e(out, f1, f2); + KRML_HOST_IGNORE(fmul_scalar_e(out, f1, f2)); #endif } @@ -89,7 +89,7 @@ static inline void fsqr0(uint64_t *out, uint64_t *f1, uint64_t *tmp) #if HACL_CAN_COMPILE_INLINE_ASM fsqr(out, f1, tmp); #else - uint64_t uu____0 = fsqr_e(tmp, f1, out); + KRML_HOST_IGNORE(fsqr_e(tmp, f1, out)); #endif } @@ -98,7 +98,7 @@ static inline void fsqr20(uint64_t *out, uint64_t *f, uint64_t *tmp) #if HACL_CAN_COMPILE_INLINE_ASM fsqr2(out, f, tmp); #else - uint64_t uu____0 = fsqr2_e(tmp, f, out); + KRML_HOST_IGNORE(fsqr2_e(tmp, f, out)); #endif } @@ -107,7 +107,7 @@ static inline void cswap20(uint64_t bit, uint64_t *p1, uint64_t *p2) #if HACL_CAN_COMPILE_INLINE_ASM cswap2(bit, p1, p2); #else - uint64_t uu____0 = cswap2_e(bit, p1, p2); + KRML_HOST_IGNORE(cswap2_e(bit, p1, p2)); #endif } diff --git a/src/msvc/Hacl_Ed25519.c b/src/msvc/Hacl_Ed25519.c index 9d7c3bd4..f9881e91 100644 --- a/src/msvc/Hacl_Ed25519.c +++ b/src/msvc/Hacl_Ed25519.c @@ -711,65 +711,53 @@ static inline void barrett_reduction(uint64_t *z, uint64_t *t) FStar_UInt128_uint128 c00 = carry0; FStar_UInt128_uint128 carry1 = FStar_UInt128_shift_right(FStar_UInt128_add_mod(z11, c00), (uint32_t)56U); - uint64_t - t100 = - FStar_UInt128_uint128_to_uint64(FStar_UInt128_add_mod(z11, c00)) - & (uint64_t)0xffffffffffffffU; FStar_UInt128_uint128 c10 = carry1; FStar_UInt128_uint128 carry2 = FStar_UInt128_shift_right(FStar_UInt128_add_mod(z21, c10), (uint32_t)56U); - uint64_t - t101 = - FStar_UInt128_uint128_to_uint64(FStar_UInt128_add_mod(z21, c10)) - & (uint64_t)0xffffffffffffffU; FStar_UInt128_uint128 c20 = carry2; FStar_UInt128_uint128 carry3 = FStar_UInt128_shift_right(FStar_UInt128_add_mod(z31, c20), (uint32_t)56U); - uint64_t - t102 = - FStar_UInt128_uint128_to_uint64(FStar_UInt128_add_mod(z31, c20)) - & (uint64_t)0xffffffffffffffU; FStar_UInt128_uint128 c30 = carry3; FStar_UInt128_uint128 carry4 = FStar_UInt128_shift_right(FStar_UInt128_add_mod(z41, c30), (uint32_t)56U); uint64_t - t103 = + t100 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_add_mod(z41, c30)) & (uint64_t)0xffffffffffffffU; FStar_UInt128_uint128 c40 = carry4; - uint64_t t410 = t103; + uint64_t t410 = t100; FStar_UInt128_uint128 carry5 = FStar_UInt128_shift_right(FStar_UInt128_add_mod(z5, c40), (uint32_t)56U); uint64_t - t104 = + t101 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_add_mod(z5, c40)) & (uint64_t)0xffffffffffffffU; FStar_UInt128_uint128 c5 = carry5; - uint64_t t51 = t104; + uint64_t t51 = t101; FStar_UInt128_uint128 carry6 = FStar_UInt128_shift_right(FStar_UInt128_add_mod(z6, c5), (uint32_t)56U); uint64_t - t105 = + t102 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_add_mod(z6, c5)) & (uint64_t)0xffffffffffffffU; FStar_UInt128_uint128 c6 = carry6; - uint64_t t61 = t105; + uint64_t t61 = t102; FStar_UInt128_uint128 carry7 = FStar_UInt128_shift_right(FStar_UInt128_add_mod(z7, c6), (uint32_t)56U); uint64_t - t106 = + t103 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_add_mod(z7, c6)) & (uint64_t)0xffffffffffffffU; FStar_UInt128_uint128 c7 = carry7; - uint64_t t71 = t106; + uint64_t t71 = t103; FStar_UInt128_uint128 carry8 = FStar_UInt128_shift_right(FStar_UInt128_add_mod(z8, c7), (uint32_t)56U); uint64_t - t107 = + t104 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_add_mod(z8, c7)) & (uint64_t)0xffffffffffffffU; FStar_UInt128_uint128 c8 = carry8; - uint64_t t81 = t107; + uint64_t t81 = t104; uint64_t t91 = FStar_UInt128_uint128_to_uint64(c8); uint64_t qmu4_ = t410; uint64_t qmu5_ = t51; @@ -818,19 +806,19 @@ static inline void barrett_reduction(uint64_t *z, uint64_t *t) FStar_UInt128_uint128 xy31 = FStar_UInt128_mul_wide(qdiv3, m1); FStar_UInt128_uint128 xy40 = FStar_UInt128_mul_wide(qdiv4, m0); FStar_UInt128_uint128 carry9 = FStar_UInt128_shift_right(xy00, (uint32_t)56U); - uint64_t t108 = FStar_UInt128_uint128_to_uint64(xy00) & (uint64_t)0xffffffffffffffU; + uint64_t t105 = FStar_UInt128_uint128_to_uint64(xy00) & (uint64_t)0xffffffffffffffU; FStar_UInt128_uint128 c0 = carry9; - uint64_t t010 = t108; + uint64_t t010 = t105; FStar_UInt128_uint128 carry10 = FStar_UInt128_shift_right(FStar_UInt128_add_mod(FStar_UInt128_add_mod(xy01, xy10), c0), (uint32_t)56U); uint64_t - t109 = + t106 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_add_mod(FStar_UInt128_add_mod(xy01, xy10), c0)) & (uint64_t)0xffffffffffffffU; FStar_UInt128_uint128 c11 = carry10; - uint64_t t110 = t109; + uint64_t t110 = t106; FStar_UInt128_uint128 carry11 = FStar_UInt128_shift_right(FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_add_mod(xy02, @@ -839,14 +827,14 @@ static inline void barrett_reduction(uint64_t *z, uint64_t *t) c11), (uint32_t)56U); uint64_t - t1010 = + t107 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_add_mod(xy02, xy11), xy20), c11)) & (uint64_t)0xffffffffffffffU; FStar_UInt128_uint128 c21 = carry11; - uint64_t t210 = t1010; + uint64_t t210 = t107; FStar_UInt128_uint128 carry = FStar_UInt128_shift_right(FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_add_mod(xy03, @@ -856,7 +844,7 @@ static inline void barrett_reduction(uint64_t *z, uint64_t *t) c21), (uint32_t)56U); uint64_t - t1011 = + t108 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_add_mod(xy03, xy12), xy21), @@ -864,7 +852,7 @@ static inline void barrett_reduction(uint64_t *z, uint64_t *t) c21)) & (uint64_t)0xffffffffffffffU; FStar_UInt128_uint128 c31 = carry; - uint64_t t310 = t1011; + uint64_t t310 = t108; uint64_t t411 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_add_mod(xy04, @@ -880,24 +868,24 @@ static inline void barrett_reduction(uint64_t *z, uint64_t *t) uint64_t qmul3 = t310; uint64_t qmul4 = t411; uint64_t b5 = (r0 - qmul0) >> (uint32_t)63U; - uint64_t t1012 = (b5 << (uint32_t)56U) + r0 - qmul0; + uint64_t t109 = (b5 << (uint32_t)56U) + r0 - qmul0; uint64_t c1 = b5; - uint64_t t011 = t1012; + uint64_t t011 = t109; uint64_t b6 = (r1 - (qmul1 + c1)) >> (uint32_t)63U; - uint64_t t1013 = (b6 << (uint32_t)56U) + r1 - (qmul1 + c1); + uint64_t t1010 = (b6 << (uint32_t)56U) + r1 - (qmul1 + c1); uint64_t c2 = b6; - uint64_t t111 = t1013; + uint64_t t111 = t1010; uint64_t b7 = (r2 - (qmul2 + c2)) >> (uint32_t)63U; - uint64_t t1014 = (b7 << (uint32_t)56U) + r2 - (qmul2 + c2); + uint64_t t1011 = (b7 << (uint32_t)56U) + r2 - (qmul2 + c2); uint64_t c3 = b7; - uint64_t t211 = t1014; + uint64_t t211 = t1011; uint64_t b8 = (r3 - (qmul3 + c3)) >> (uint32_t)63U; - uint64_t t1015 = (b8 << (uint32_t)56U) + r3 - (qmul3 + c3); + uint64_t t1012 = (b8 << (uint32_t)56U) + r3 - (qmul3 + c3); uint64_t c4 = b8; - uint64_t t311 = t1015; + uint64_t t311 = t1012; uint64_t b9 = (r4 - (qmul4 + c4)) >> (uint32_t)63U; - uint64_t t1016 = (b9 << (uint32_t)40U) + r4 - (qmul4 + c4); - uint64_t t412 = t1016; + uint64_t t1013 = (b9 << (uint32_t)40U) + r4 - (qmul4 + c4); + uint64_t t412 = t1013; uint64_t s0 = t011; uint64_t s1 = t111; uint64_t s2 = t211; @@ -914,21 +902,21 @@ static inline void barrett_reduction(uint64_t *z, uint64_t *t) uint64_t y3 = m31; uint64_t y4 = m41; uint64_t b10 = (s0 - y0) >> (uint32_t)63U; - uint64_t t1017 = (b10 << (uint32_t)56U) + s0 - y0; + uint64_t t1014 = (b10 << (uint32_t)56U) + s0 - y0; uint64_t b0 = b10; - uint64_t t01 = t1017; + uint64_t t01 = t1014; uint64_t b11 = (s1 - (y1 + b0)) >> (uint32_t)63U; - uint64_t t1018 = (b11 << (uint32_t)56U) + s1 - (y1 + b0); + uint64_t t1015 = (b11 << (uint32_t)56U) + s1 - (y1 + b0); uint64_t b1 = b11; - uint64_t t11 = t1018; + uint64_t t11 = t1015; uint64_t b12 = (s2 - (y2 + b1)) >> (uint32_t)63U; - uint64_t t1019 = (b12 << (uint32_t)56U) + s2 - (y2 + b1); + uint64_t t1016 = (b12 << (uint32_t)56U) + s2 - (y2 + b1); uint64_t b2 = b12; - uint64_t t21 = t1019; + uint64_t t21 = t1016; uint64_t b13 = (s3 - (y3 + b2)) >> (uint32_t)63U; - uint64_t t1020 = (b13 << (uint32_t)56U) + s3 - (y3 + b2); + uint64_t t1017 = (b13 << (uint32_t)56U) + s3 - (y3 + b2); uint64_t b3 = b13; - uint64_t t31 = t1020; + uint64_t t31 = t1017; uint64_t b = (s4 - (y4 + b3)) >> (uint32_t)63U; uint64_t t10 = (b << (uint32_t)56U) + s4 - (y4 + b3); uint64_t b4 = b; diff --git a/src/msvc/Hacl_FFDHE.c b/src/msvc/Hacl_FFDHE.c index 53b87f73..bc77dbdc 100644 --- a/src/msvc/Hacl_FFDHE.c +++ b/src/msvc/Hacl_FFDHE.c @@ -127,7 +127,6 @@ static inline uint64_t ffdhe_check_pk(Spec_FFDHE_ffdhe_alg a, uint64_t *pk_n, ui memset(p_n1, 0U, nLen * sizeof (uint64_t)); uint64_t c0 = Lib_IntTypes_Intrinsics_sub_borrow_u64((uint64_t)0U, p_n[0U], (uint64_t)1U, p_n1); - uint64_t c1; if ((uint32_t)1U < nLen) { uint64_t *a1 = p_n + (uint32_t)1U; @@ -159,12 +158,12 @@ static inline uint64_t ffdhe_check_pk(Spec_FFDHE_ffdhe_alg a, uint64_t *pk_n, ui uint64_t *res_i = res1 + i; c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t1, (uint64_t)0U, res_i); } - uint64_t c10 = c; - c1 = c10; + uint64_t c1 = c; + KRML_HOST_IGNORE(c1); } else { - c1 = c0; + KRML_HOST_IGNORE(c0); } KRML_CHECK_SIZE(sizeof (uint64_t), nLen); uint64_t *b2 = (uint64_t *)alloca(nLen * sizeof (uint64_t)); diff --git a/src/msvc/Hacl_Frodo_KEM.c b/src/msvc/Hacl_Frodo_KEM.c index 13db363a..4265ac0e 100644 --- a/src/msvc/Hacl_Frodo_KEM.c +++ b/src/msvc/Hacl_Frodo_KEM.c @@ -30,6 +30,6 @@ void randombytes_(uint32_t len, uint8_t *res) { - bool b = Lib_RandomBuffer_System_randombytes(res, len); + KRML_HOST_IGNORE(Lib_RandomBuffer_System_randombytes(res, len)); } diff --git a/src/msvc/Hacl_HMAC_DRBG.c b/src/msvc/Hacl_HMAC_DRBG.c index 93e47dc9..b3acf354 100644 --- a/src/msvc/Hacl_HMAC_DRBG.c +++ b/src/msvc/Hacl_HMAC_DRBG.c @@ -71,6 +71,8 @@ uint32_t Hacl_HMAC_DRBG_min_length(Spec_Hash_Definitions_hash_alg a) bool Hacl_HMAC_DRBG_uu___is_State(Spec_Hash_Definitions_hash_alg a, Hacl_HMAC_DRBG_state projectee) { + KRML_HOST_IGNORE(a); + KRML_HOST_IGNORE(projectee); return true; } @@ -1104,6 +1106,7 @@ Hacl_HMAC_DRBG_generate( void Hacl_HMAC_DRBG_free(Spec_Hash_Definitions_hash_alg uu___, Hacl_HMAC_DRBG_state s) { + KRML_HOST_IGNORE(uu___); uint8_t *k = s.k; uint8_t *v = s.v; uint32_t *ctr = s.reseed_counter; diff --git a/src/msvc/Hacl_Hash_Blake2.c b/src/msvc/Hacl_Hash_Blake2.c index 194e7157..aecc6165 100644 --- a/src/msvc/Hacl_Hash_Blake2.c +++ b/src/msvc/Hacl_Hash_Blake2.c @@ -545,6 +545,7 @@ Hacl_Blake2b_32_blake2b_update_multi( uint32_t nb ) { + KRML_HOST_IGNORE(len); for (uint32_t i = (uint32_t)0U; i < nb; i++) { FStar_UInt128_uint128 @@ -1192,6 +1193,7 @@ Hacl_Blake2s_32_blake2s_update_multi( uint32_t nb ) { + KRML_HOST_IGNORE(len); for (uint32_t i = (uint32_t)0U; i < nb; i++) { uint64_t totlen = prev + (uint64_t)((i + (uint32_t)1U) * (uint32_t)64U); diff --git a/src/msvc/Hacl_Hash_Blake2b_256.c b/src/msvc/Hacl_Hash_Blake2b_256.c index d0df7cd8..b37ffc5f 100644 --- a/src/msvc/Hacl_Hash_Blake2b_256.c +++ b/src/msvc/Hacl_Hash_Blake2b_256.c @@ -268,6 +268,7 @@ Hacl_Blake2b_256_blake2b_update_multi( uint32_t nb ) { + KRML_HOST_IGNORE(len); for (uint32_t i = (uint32_t)0U; i < nb; i++) { FStar_UInt128_uint128 diff --git a/src/msvc/Hacl_Hash_Blake2s_128.c b/src/msvc/Hacl_Hash_Blake2s_128.c index 5bf06711..86c4f030 100644 --- a/src/msvc/Hacl_Hash_Blake2s_128.c +++ b/src/msvc/Hacl_Hash_Blake2s_128.c @@ -268,6 +268,7 @@ Hacl_Blake2s_128_blake2s_update_multi( uint32_t nb ) { + KRML_HOST_IGNORE(len); for (uint32_t i = (uint32_t)0U; i < nb; i++) { uint64_t totlen = prev + (uint64_t)((i + (uint32_t)1U) * (uint32_t)64U); diff --git a/src/msvc/Hacl_Hash_MD5.c b/src/msvc/Hacl_Hash_MD5.c index 1b376960..222ac824 100644 --- a/src/msvc/Hacl_Hash_MD5.c +++ b/src/msvc/Hacl_Hash_MD5.c @@ -1218,7 +1218,6 @@ void Hacl_Streaming_MD5_legacy_init(Hacl_Streaming_MD_state_32 *s) Hacl_Streaming_MD_state_32 scrut = *s; uint8_t *buf = scrut.buf; uint32_t *block_state = scrut.block_state; - KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Hash_Core_MD5_legacy_init(block_state); Hacl_Streaming_MD_state_32 tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; diff --git a/src/msvc/Hacl_Hash_SHA1.c b/src/msvc/Hacl_Hash_SHA1.c index 80edc004..5ecb3c0b 100644 --- a/src/msvc/Hacl_Hash_SHA1.c +++ b/src/msvc/Hacl_Hash_SHA1.c @@ -254,7 +254,6 @@ void Hacl_Streaming_SHA1_legacy_init(Hacl_Streaming_MD_state_32 *s) Hacl_Streaming_MD_state_32 scrut = *s; uint8_t *buf = scrut.buf; uint32_t *block_state = scrut.block_state; - KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Hash_Core_SHA1_legacy_init(block_state); Hacl_Streaming_MD_state_32 tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; diff --git a/src/msvc/Hacl_Hash_SHA2.c b/src/msvc/Hacl_Hash_SHA2.c index 46fde83f..c93c3616 100644 --- a/src/msvc/Hacl_Hash_SHA2.c +++ b/src/msvc/Hacl_Hash_SHA2.c @@ -537,7 +537,6 @@ void Hacl_Streaming_SHA2_init_256(Hacl_Streaming_MD_state_32 *s) Hacl_Streaming_MD_state_32 scrut = *s; uint8_t *buf = scrut.buf; uint32_t *block_state = scrut.block_state; - KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_SHA2_Scalar32_sha256_init(block_state); Hacl_Streaming_MD_state_32 tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; @@ -836,7 +835,6 @@ void Hacl_Streaming_SHA2_init_224(Hacl_Streaming_MD_state_32 *s) Hacl_Streaming_MD_state_32 scrut = *s; uint8_t *buf = scrut.buf; uint32_t *block_state = scrut.block_state; - KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_SHA2_Scalar32_sha224_init(block_state); Hacl_Streaming_MD_state_32 tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; @@ -962,7 +960,6 @@ void Hacl_Streaming_SHA2_init_512(Hacl_Streaming_MD_state_64 *s) Hacl_Streaming_MD_state_64 scrut = *s; uint8_t *buf = scrut.buf; uint64_t *block_state = scrut.block_state; - KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_SHA2_Scalar32_sha512_init(block_state); Hacl_Streaming_MD_state_64 tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; @@ -1262,7 +1259,6 @@ void Hacl_Streaming_SHA2_init_384(Hacl_Streaming_MD_state_64 *s) Hacl_Streaming_MD_state_64 scrut = *s; uint8_t *buf = scrut.buf; uint64_t *block_state = scrut.block_state; - KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_SHA2_Scalar32_sha384_init(block_state); Hacl_Streaming_MD_state_64 tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; diff --git a/src/msvc/Hacl_Hash_SHA3.c b/src/msvc/Hacl_Hash_SHA3.c index 5f4707f4..19d13b1b 100644 --- a/src/msvc/Hacl_Hash_SHA3.c +++ b/src/msvc/Hacl_Hash_SHA3.c @@ -125,10 +125,9 @@ Hacl_Hash_SHA3_update_last_sha3( if (input_len == len) { Hacl_Impl_SHA3_absorb_inner(len, input, s); - uint8_t *uu____0 = input + input_len; uint8_t lastBlock_[200U] = { 0U }; uint8_t *lastBlock = lastBlock_; - memcpy(lastBlock, uu____0, (uint32_t)0U * sizeof (uint8_t)); + memcpy(lastBlock, input + input_len, (uint32_t)0U * sizeof (uint8_t)); lastBlock[0U] = suffix; Hacl_Impl_SHA3_loadState(len, lastBlock, s); if (!((suffix & (uint8_t)0x80U) == (uint8_t)0U) && (uint32_t)0U == len - (uint32_t)1U) @@ -167,8 +166,7 @@ hash_buf2; Spec_Hash_Definitions_hash_alg Hacl_Streaming_Keccak_get_alg(Hacl_Streaming_Keccak_state *s) { - Hacl_Streaming_Keccak_state scrut = *s; - Hacl_Streaming_Keccak_hash_buf block_state = scrut.block_state; + Hacl_Streaming_Keccak_hash_buf block_state = (*s).block_state; return block_state.fst; } @@ -809,6 +807,7 @@ Hacl_Impl_SHA3_keccak( uint8_t *output ) { + KRML_HOST_IGNORE(capacity); uint32_t rateInBytes = rate / (uint32_t)8U; uint64_t s[25U] = { 0U }; absorb(s, rateInBytes, inputByteLen, input, delimitedSuffix); diff --git a/src/msvc/Hacl_K256_ECDSA.c b/src/msvc/Hacl_K256_ECDSA.c index 19395653..c5dda43f 100644 --- a/src/msvc/Hacl_K256_ECDSA.c +++ b/src/msvc/Hacl_K256_ECDSA.c @@ -498,7 +498,7 @@ mul_pow2_256_minus_q_add( uint64_t r = c; tmp[len + i0] = r;); memcpy(res + (uint32_t)2U, a, len * sizeof (uint64_t)); - uint64_t uu____0 = bn_add(resLen, res, len + (uint32_t)2U, tmp, res); + KRML_HOST_IGNORE(bn_add(resLen, res, len + (uint32_t)2U, tmp, res)); uint64_t c = bn_add(resLen, res, (uint32_t)4U, e, res); return c; } @@ -514,15 +514,23 @@ static inline void modq(uint64_t *out, uint64_t *a) uint64_t *t01 = tmp; uint64_t m[7U] = { 0U }; uint64_t p[5U] = { 0U }; - uint64_t - c0 = mul_pow2_256_minus_q_add((uint32_t)4U, (uint32_t)7U, t01, a + (uint32_t)4U, a, m); - uint64_t - c10 = mul_pow2_256_minus_q_add((uint32_t)3U, (uint32_t)5U, t01, m + (uint32_t)4U, m, p); + KRML_HOST_IGNORE(mul_pow2_256_minus_q_add((uint32_t)4U, + (uint32_t)7U, + t01, + a + (uint32_t)4U, + a, + m)); + KRML_HOST_IGNORE(mul_pow2_256_minus_q_add((uint32_t)3U, + (uint32_t)5U, + t01, + m + (uint32_t)4U, + m, + p)); uint64_t c2 = mul_pow2_256_minus_q_add((uint32_t)1U, (uint32_t)4U, t01, p + (uint32_t)4U, p, r); - uint64_t c00 = c2; + uint64_t c0 = c2; uint64_t c1 = add4(r, tmp, out); - uint64_t mask = (uint64_t)0U - (c00 + c1); + uint64_t mask = (uint64_t)0U - (c0 + c1); KRML_MAYBE_FOR4(i, (uint32_t)0U, (uint32_t)4U, @@ -612,7 +620,7 @@ static inline void qmul_shift_384(uint64_t *res, uint64_t *a, uint64_t *b) uint64_t *res_i = res1 + i; c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t1, (uint64_t)0U, res_i);); uint64_t c1 = c; - uint64_t uu____0 = c1; + KRML_HOST_IGNORE(c1); uint64_t flag = l[5U] >> (uint32_t)63U; uint64_t mask = (uint64_t)0U - flag; KRML_MAYBE_FOR4(i, @@ -1223,6 +1231,7 @@ static inline void point_mul_g(uint64_t *out, uint64_t *scalar) (uint64_t)118285133003718U, (uint64_t)434519962075150U, (uint64_t)1114612377498854U, (uint64_t)3488596944003813U, (uint64_t)450716531072892U, (uint64_t)66044973203836U }; + KRML_HOST_IGNORE(q2); uint64_t q3[15U] = { @@ -1232,6 +1241,7 @@ static inline void point_mul_g(uint64_t *out, uint64_t *scalar) (uint64_t)265969268774814U, (uint64_t)1913228635640715U, (uint64_t)2831959046949342U, (uint64_t)888030405442963U, (uint64_t)1817092932985033U, (uint64_t)101515844997121U }; + KRML_HOST_IGNORE(q3); uint64_t q4[15U] = { @@ -1241,6 +1251,7 @@ static inline void point_mul_g(uint64_t *out, uint64_t *scalar) (uint64_t)12245672982162U, (uint64_t)2119364213800870U, (uint64_t)2034960311715107U, (uint64_t)3172697815804487U, (uint64_t)4185144850224160U, (uint64_t)2792055915674U }; + KRML_HOST_IGNORE(q4); uint64_t *r1 = scalar; uint64_t *r2 = scalar + (uint32_t)1U; uint64_t *r3 = scalar + (uint32_t)2U; @@ -1605,6 +1616,7 @@ Hacl_K256_ECDSA_ecdsa_sign_hashed_msg( ) { uint64_t oneq[4U] = { (uint64_t)0x1U, (uint64_t)0x0U, (uint64_t)0x0U, (uint64_t)0x0U }; + KRML_HOST_IGNORE(oneq); uint64_t rsdk_q[16U] = { 0U }; uint64_t *r_q = rsdk_q; uint64_t *s_q = rsdk_q + (uint32_t)4U; diff --git a/src/msvc/Hacl_RSAPSS.c b/src/msvc/Hacl_RSAPSS.c index ce2fb517..084f10b3 100644 --- a/src/msvc/Hacl_RSAPSS.c +++ b/src/msvc/Hacl_RSAPSS.c @@ -404,9 +404,9 @@ load_skey( Sign a message `msg` and write the signature to `sgnt`. @param a Hash algorithm to use. Allowed values for `a` are ... - * Spec_Hash_Definitions_SHA2_256, - * Spec_Hash_Definitions_SHA2_384, and - * Spec_Hash_Definitions_SHA2_512. + - Spec_Hash_Definitions_SHA2_256, + - Spec_Hash_Definitions_SHA2_384, and + - Spec_Hash_Definitions_SHA2_512. @param modBits Count of bits in the modulus (`n`). @param eBits Count of bits in `e` value. @param dBits Count of bits in `d` value. @@ -518,7 +518,10 @@ Hacl_RSAPSS_rsapss_sign( /** Verify the signature `sgnt` of a message `msg`. -@param a Hash algorithm to use. +@param a Hash algorithm to use. Allowed values for `a` are ... + - Spec_Hash_Definitions_SHA2_256, + - Spec_Hash_Definitions_SHA2_384, and + - Spec_Hash_Definitions_SHA2_512. @param modBits Count of bits in the modulus (`n`). @param eBits Count of bits in `e` value. @param pkey Pointer to public key created by `Hacl_RSAPSS_new_rsapss_load_pkey`. @@ -637,10 +640,10 @@ Load a public key from key parts. @param modBits Count of bits in modulus (`n`). @param eBits Count of bits in `e` value. -@param nb Pointer to `ceil(modBits / 8)` bytes where the modulus (`n`) is read from. -@param eb Pointer to `ceil(modBits / 8)` bytes where the `e` value is read from. +@param nb Pointer to `ceil(modBits / 8)` bytes where the modulus (`n`), in big-endian byte order, is read from. +@param eb Pointer to `ceil(modBits / 8)` bytes where the `e` value, in big-endian byte order, is read from. -@return Returns an allocated public key. Note: caller must take care to `free()` the created key. +@return Returns an allocated public key upon success, otherwise, `NULL` if key part arguments are invalid or memory allocation fails. Note: caller must take care to `free()` the created key. */ uint64_t *Hacl_RSAPSS_new_rsapss_load_pkey(uint32_t modBits, uint32_t eBits, uint8_t *nb, uint8_t *eb) @@ -707,11 +710,11 @@ Load a secret key from key parts. @param modBits Count of bits in modulus (`n`). @param eBits Count of bits in `e` value. @param dBits Count of bits in `d` value. -@param nb Pointer to `ceil(modBits / 8)` bytes where the modulus (`n`) is read from. -@param eb Pointer to `ceil(modBits / 8)` bytes where the `e` value is read from. -@param db Pointer to `ceil(modBits / 8)` bytes where the `d` value is read from. +@param nb Pointer to `ceil(modBits / 8)` bytes where the modulus (`n`), in big-endian byte order, is read from. +@param eb Pointer to `ceil(modBits / 8)` bytes where the `e` value, in big-endian byte order, is read from. +@param db Pointer to `ceil(modBits / 8)` bytes where the `d` value, in big-endian byte order, is read from. -@return Returns an allocated secret key. Note: caller must take care to `free()` the created key. +@return Returns an allocated secret key upon success, otherwise, `NULL` if key part arguments are invalid or memory allocation fails. Note: caller must take care to `free()` the created key. */ uint64_t *Hacl_RSAPSS_new_rsapss_load_skey( @@ -804,13 +807,16 @@ uint64_t /** Sign a message `msg` and write the signature to `sgnt`. -@param a Hash algorithm to use. +@param a Hash algorithm to use. Allowed values for `a` are ... + - Spec_Hash_Definitions_SHA2_256, + - Spec_Hash_Definitions_SHA2_384, and + - Spec_Hash_Definitions_SHA2_512. @param modBits Count of bits in the modulus (`n`). @param eBits Count of bits in `e` value. @param dBits Count of bits in `d` value. -@param nb Pointer to `ceil(modBits / 8)` bytes where the modulus (`n`) is read from. -@param eb Pointer to `ceil(modBits / 8)` bytes where the `e` value is read from. -@param db Pointer to `ceil(modBits / 8)` bytes where the `d` value is read from. +@param nb Pointer to `ceil(modBits / 8)` bytes where the modulus (`n`), in big-endian byte order, is read from. +@param eb Pointer to `ceil(modBits / 8)` bytes where the `e` value, in big-endian byte order, is read from. +@param db Pointer to `ceil(modBits / 8)` bytes where the `d` value, in big-endian byte order, is read from. @param saltLen Length of salt. @param salt Pointer to `saltLen` bytes where the salt is read from. @param msgLen Length of message. @@ -875,11 +881,14 @@ Hacl_RSAPSS_rsapss_skey_sign( /** Verify the signature `sgnt` of a message `msg`. -@param a Hash algorithm to use. +@param a Hash algorithm to use. Allowed values for `a` are ... + - Spec_Hash_Definitions_SHA2_256, + - Spec_Hash_Definitions_SHA2_384, and + - Spec_Hash_Definitions_SHA2_512. @param modBits Count of bits in the modulus (`n`). @param eBits Count of bits in `e` value. -@param nb Pointer to `ceil(modBits / 8)` bytes where the modulus (`n`) is read from. -@param eb Pointer to `ceil(modBits / 8)` bytes where the `e` value is read from. +@param nb Pointer to `ceil(modBits / 8)` bytes where the modulus (`n`), in big-endian byte order, is read from. +@param eb Pointer to `ceil(modBits / 8)` bytes where the `e` value, in big-endian byte order, is read from. @param saltLen Length of salt. @param sgntLen Length of signature. @param sgnt Pointer to `sgntLen` bytes where the signature is read from. diff --git a/src/msvc/Hacl_Salsa20.c b/src/msvc/Hacl_Salsa20.c index e157d5ef..2758f8a4 100644 --- a/src/msvc/Hacl_Salsa20.c +++ b/src/msvc/Hacl_Salsa20.c @@ -181,6 +181,7 @@ salsa20_encrypt( memcpy(ctx + (uint32_t)11U, k10, (uint32_t)4U * sizeof (uint32_t)); ctx[15U] = (uint32_t)0x6b206574U; uint32_t k[16U] = { 0U }; + KRML_HOST_IGNORE(k); uint32_t rem = len % (uint32_t)64U; uint32_t nb = len / (uint32_t)64U; uint32_t rem1 = len % (uint32_t)64U; @@ -217,9 +218,8 @@ salsa20_encrypt( if (rem1 > (uint32_t)0U) { uint8_t *uu____2 = out + nb * (uint32_t)64U; - uint8_t *uu____3 = text + nb * (uint32_t)64U; uint8_t plain[64U] = { 0U }; - memcpy(plain, uu____3, rem * sizeof (uint8_t)); + memcpy(plain, text + nb * (uint32_t)64U, rem * sizeof (uint8_t)); uint32_t k1[16U] = { 0U }; salsa20_core(k1, ctx, nb); uint32_t bl[16U] = { 0U }; @@ -294,6 +294,7 @@ salsa20_decrypt( memcpy(ctx + (uint32_t)11U, k10, (uint32_t)4U * sizeof (uint32_t)); ctx[15U] = (uint32_t)0x6b206574U; uint32_t k[16U] = { 0U }; + KRML_HOST_IGNORE(k); uint32_t rem = len % (uint32_t)64U; uint32_t nb = len / (uint32_t)64U; uint32_t rem1 = len % (uint32_t)64U; @@ -330,9 +331,8 @@ salsa20_decrypt( if (rem1 > (uint32_t)0U) { uint8_t *uu____2 = out + nb * (uint32_t)64U; - uint8_t *uu____3 = cipher + nb * (uint32_t)64U; uint8_t plain[64U] = { 0U }; - memcpy(plain, uu____3, rem * sizeof (uint8_t)); + memcpy(plain, cipher + nb * (uint32_t)64U, rem * sizeof (uint8_t)); uint32_t k1[16U] = { 0U }; salsa20_core(k1, ctx, nb); uint32_t bl[16U] = { 0U }; diff --git a/src/msvc/Hacl_Streaming_Blake2.c b/src/msvc/Hacl_Streaming_Blake2.c index 4faa859e..948d56c2 100644 --- a/src/msvc/Hacl_Streaming_Blake2.c +++ b/src/msvc/Hacl_Streaming_Blake2.c @@ -54,7 +54,6 @@ void Hacl_Streaming_Blake2_blake2s_32_no_key_init(Hacl_Streaming_Blake2_blake2s_ Hacl_Streaming_Blake2_blake2s_32_state scrut = *s1; uint8_t *buf = scrut.buf; Hacl_Streaming_Blake2_blake2s_32_block_state block_state = scrut.block_state; - KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Blake2s_32_blake2s_init(block_state.snd, (uint32_t)0U, (uint32_t)32U); Hacl_Streaming_Blake2_blake2s_32_state tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; @@ -354,7 +353,6 @@ void Hacl_Streaming_Blake2_blake2b_32_no_key_init(Hacl_Streaming_Blake2_blake2b_ Hacl_Streaming_Blake2_blake2b_32_state scrut = *s1; uint8_t *buf = scrut.buf; Hacl_Streaming_Blake2_blake2b_32_block_state block_state = scrut.block_state; - KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Blake2b_32_blake2b_init(block_state.snd, (uint32_t)0U, (uint32_t)64U); Hacl_Streaming_Blake2_blake2b_32_state tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; diff --git a/src/msvc/Hacl_Streaming_Blake2b_256.c b/src/msvc/Hacl_Streaming_Blake2b_256.c index d2df234a..bdb5433f 100644 --- a/src/msvc/Hacl_Streaming_Blake2b_256.c +++ b/src/msvc/Hacl_Streaming_Blake2b_256.c @@ -66,7 +66,6 @@ Hacl_Streaming_Blake2b_256_blake2b_256_no_key_init( Hacl_Streaming_Blake2b_256_blake2b_256_state scrut = *s; uint8_t *buf = scrut.buf; Hacl_Streaming_Blake2b_256_blake2b_256_block_state block_state = scrut.block_state; - KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Blake2b_256_blake2b_init(block_state.snd, (uint32_t)0U, (uint32_t)64U); Hacl_Streaming_Blake2b_256_blake2b_256_state tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; diff --git a/src/msvc/Hacl_Streaming_Blake2s_128.c b/src/msvc/Hacl_Streaming_Blake2s_128.c index eaace7ce..f97bf5d0 100644 --- a/src/msvc/Hacl_Streaming_Blake2s_128.c +++ b/src/msvc/Hacl_Streaming_Blake2s_128.c @@ -66,7 +66,6 @@ Hacl_Streaming_Blake2s_128_blake2s_128_no_key_init( Hacl_Streaming_Blake2s_128_blake2s_128_state scrut = *s; uint8_t *buf = scrut.buf; Hacl_Streaming_Blake2s_128_blake2s_128_block_state block_state = scrut.block_state; - KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Blake2s_128_blake2s_init(block_state.snd, (uint32_t)0U, (uint32_t)32U); Hacl_Streaming_Blake2s_128_blake2s_128_state tmp = { .block_state = block_state, .buf = buf, .total_len = (uint64_t)(uint32_t)0U }; diff --git a/src/msvc/Hacl_Streaming_Poly1305_128.c b/src/msvc/Hacl_Streaming_Poly1305_128.c index c752cfb0..c3f7c19a 100644 --- a/src/msvc/Hacl_Streaming_Poly1305_128.c +++ b/src/msvc/Hacl_Streaming_Poly1305_128.c @@ -58,7 +58,6 @@ Hacl_Streaming_Poly1305_128_init(uint8_t *k, Hacl_Streaming_Poly1305_128_poly130 uint8_t *k_ = scrut.p_key; uint8_t *buf = scrut.buf; Lib_IntVector_Intrinsics_vec128 *block_state = scrut.block_state; - KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Poly1305_128_poly1305_init(block_state, k); memcpy(k_, k, (uint32_t)32U * sizeof (uint8_t)); uint8_t *k_1 = k_; @@ -312,7 +311,7 @@ Hacl_Streaming_Poly1305_128_finish( { ite1 = r % (uint32_t)16U; } - uint64_t prev_len_last = total_len - (uint64_t)ite1; + KRML_HOST_IGNORE(total_len - (uint64_t)ite1); uint32_t ite2; if (r % (uint32_t)16U == (uint32_t)0U && r > (uint32_t)0U) { diff --git a/src/msvc/Hacl_Streaming_Poly1305_256.c b/src/msvc/Hacl_Streaming_Poly1305_256.c index c1915ed9..e56275a4 100644 --- a/src/msvc/Hacl_Streaming_Poly1305_256.c +++ b/src/msvc/Hacl_Streaming_Poly1305_256.c @@ -58,7 +58,6 @@ Hacl_Streaming_Poly1305_256_init(uint8_t *k, Hacl_Streaming_Poly1305_256_poly130 uint8_t *k_ = scrut.p_key; uint8_t *buf = scrut.buf; Lib_IntVector_Intrinsics_vec256 *block_state = scrut.block_state; - KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Poly1305_256_poly1305_init(block_state, k); memcpy(k_, k, (uint32_t)32U * sizeof (uint8_t)); uint8_t *k_1 = k_; @@ -312,7 +311,7 @@ Hacl_Streaming_Poly1305_256_finish( { ite1 = r % (uint32_t)16U; } - uint64_t prev_len_last = total_len - (uint64_t)ite1; + KRML_HOST_IGNORE(total_len - (uint64_t)ite1); uint32_t ite2; if (r % (uint32_t)16U == (uint32_t)0U && r > (uint32_t)0U) { diff --git a/src/msvc/Hacl_Streaming_Poly1305_32.c b/src/msvc/Hacl_Streaming_Poly1305_32.c index 89852727..249a622f 100644 --- a/src/msvc/Hacl_Streaming_Poly1305_32.c +++ b/src/msvc/Hacl_Streaming_Poly1305_32.c @@ -53,7 +53,6 @@ Hacl_Streaming_Poly1305_32_init(uint8_t *k, Hacl_Streaming_Poly1305_32_poly1305_ uint8_t *k_ = scrut.p_key; uint8_t *buf = scrut.buf; uint64_t *block_state = scrut.block_state; - KRML_HOST_IGNORE((void *)(uint8_t)0U); Hacl_Poly1305_32_poly1305_init(block_state, k); memcpy(k_, k, (uint32_t)32U * sizeof (uint8_t)); uint8_t *k_1 = k_; diff --git a/src/wasm/EverCrypt_Hash.wasm b/src/wasm/EverCrypt_Hash.wasm index 6b1a6c3fcd7de9879f50ecfa716db8f695b4acdf..8fdc7b27e028cff8b53492b41b29a176bc2bb191 100644 GIT binary patch delta 1974 zcmZ9NOHU+K6vwOjRR!HM-89{FSHsZf&_F+Epy&sW=6L~uh8dtW1I$dKnWZ?5@Otri3`7jaWWe>ZX|K#!pAwcit56o7xh1V9{=CDw^A=Ig1=q_ zpKZkTKQA}q@0!uS&(F`bVBo27rpuo)n|kiDH)|z(uRf=6An^3$O#bnvCATV5{U-K; z4m~3DMCklGg@|J-NduwDNOWw$T zhKevly)wRDSq_usEL--H*uf%X(V|7=s3PYhut;?Y29)X& zn>s|wB^dM`Wo}9le70bj!{WJydC1F7v)BLthak@cdFqw-^#W2%04{-(rkSc~@dssnaqYvo=Q?7-51DhXAoa1f#;nG3qhqn>tF$B`A20^1-xo2ER{P<~So1 zp{Ni_P;wB8j8LRzMPIWLDMl!{2u_lNP{J}HRH&ljLnyQI5XP12B2*Zm!u2aq#tA~G zvYAP0GU*#zCFL?qc#p0H{s$+i#fmuvQ{od{49RmlCEu{E;51Cj_w8EH23tO}YdteC zBYxIsg39>Uwv3tptV3PhzXmiM^g6e!lZU#`LxU8fH{7{S5?g-+4QxUaXQ3$)l*4H_ z2Q{3Bnh0?qM1cibPK$cBM96!`W?6a5nOBN$D8IxlUQJ7W`t?9}|(h@A;GHrE*FjuL|st;&|l)Kbr?@{LKXfy?gP{Ndn)pB&Lpoh+=nnG$x z>#*)DN$`>c^%TCI>!f%|>+X`ABz9xLI&Q!QZo)=)Nw2^fZpo8+%iQK;-+>)<2iwqg zX6*2c9h$M@o6#o4GurM9C&@X8HtxbM?!hkEbr0e$Y~wxHb`HX%gV?8oIG~;fzK!mY z>fX|OO7Sh_*X)2ddY}&Ckjf5yWp_z+%l4JJE<5D1L$(zsOC9Lot8@^r@#TB|xGKMC z4(huy-Lzx(3jx|N;UB?~!as&%2mgrik7(wR5C51H;~%^DP7==J0An7p4F+TIIUzj!0P{8vCvY1Za2!Z%gPV5Kc1t3)n`G4{PFi(u z-9?vGvTquRR^7E(A7)CstZ! z@99C{k=y&<#l?lmCX&s?t6$Mm6^ST8cO=u(NtkJGls1x+cPxe!?z8!Tf3P2zD zI3u|p13YiE& zXl5c8hOl8G#C0Je4%vvqgxEybAd{Cb*IE$9Rk9JG(umE*DxtZJ6&=lOMA$||x3P** zvav=wVnh+MOEA%NONLCIJbI zguKW>3lg|N>Vb;DrhbEwbzs(YG})wspzKkG!0JI)zkx{VuZaRCi6Uv6bB&Ox9<8OR zo_8>*tN-jfP5#^nxv#T>6r^+qX-FFmQe2oK=9G;&O^6+&^gC1(zD@;QCyAuoTT z?_JoHe-_HF0=>{86lVvkQi76UsmPX!G^uEtR3gNdN@hSt5$pS~gk>mW15)6uN2 z!F>&u{7>N(5Z)oegO=#YCM@O^1A@>bgmgwVMxQq8F@e{UrN-U=~LnnmH!+OtJn&x;1 zPnkvQQ?GncT9NQdlY7oTz~lG&+mkmtW0_ptd%> XKRi`s@o~Zd3-aBM;pso${~r7wCd_Bg diff --git a/src/wasm/Hacl_Bignum.wasm b/src/wasm/Hacl_Bignum.wasm index 579c0d56f1da11845ae83f0630d77869216c5fb2..b9c99c898a2c73ae248089b38ce824515f17262c 100644 GIT binary patch delta 4324 zcmcgvX>3&26`u2+!A>ltQko{Hvcz{<60;;YEHR52+cO4(+0Bv_$kMW8AS7gISv))& z&m(5B!G3@-O8^rBNo19jgi5I@^-q5ES3^nCHX(&15Yi^>yTQZjCx*7V-F(J@L{B@r3nLMnarkVoE5G~Q=Nz1HVico!v8;IsKJUaL ze8CAChjt78xHz}_MF;YC){%E4a7kHwS%bG7+%+0RU zxcSy#MOJAnBD*gIkziPgjf$?aEzy>c=q48%h3KYmS2nxYY7AENOUe7u((C|z?%7w+=ML8!!bKPwk5plB6%WHOj$$YmBZ^|5OVlID zr6^Ta3?+!AI4;h(&t)i!m9*9Ia16sxpGU+!jPT=B#pM`*@)VE6NF5&~f#GpV`WPj@ z@knhdPPJTtA`BZOn^@uS=-~and3TP%5OWN3`s12+^rLP~1-agMjK^r1EY1lS z&lBZYDV3>|g6XOa2#c03%^3MiE9b>zsa|qSCSk0xr8a8y$(X3zQ!oirsw8usimCiC zCh;S97?1e;sCp#%F+8TM$2~lX$5Z@-c%Sfj8m8&Irei85`8-3?o1yc55;O2*il4$$ zI{vf-rt7?)mS0RUc|U{6m}*k_1t#JdGyEkiVL95C^UO5ogr~kK#e0_FJsUGITl1cS zIs7bUastmH;qzSeNb)?)Q`U2si|0~2U!3!Oejd+jS}$M@X8OE9*e%esU&I2unBtf4 zl8(PDffqFGmlf^VLfeyiy@FYoW61tWc)wzXzYcjzJFvVLhP+LOP_!2r+KaIei#6>f zSi)6U$VpTo>GM+cNU{e{S=EH4sHPOxkoarJXKxu{8EJO4ge6$$bBcs!igW@#$q2r@ zv7E5n%zIVEYf0xJV@YJO+5bAiA}lfNSCC{QRk_@p?UTPtU`Ts&eyhEVwuw=p>U73%N{Ayexf_&nHu2r}3u8NM;t z4wJl_Ab-lahwuhrk7W9$j=m|rw+L^UoZnUpVS7+E?cS(l|F+5gH#+-PoBdvbkl1Mx zen(}$*BZYi%{0N=g45mZDv~y`&(Q6H(YgFC;a%eQ2=5W^C+sKw9sP%PdMG$BU@qnC ziw?YWN5O~0e<2(oqdNXfa;qOC93*qkengPyLDH(@BjS&P>1Ex2@(JNX*|YGn_$vvQ zzXgqDJ-ojY8sQ zQv{iIGDJJA!A@DQGXmy?8berwIs=TN?)cHwKZ;8jIa*|yZz zLV_KHt3t3NBzT>0-4eV(kZIRLg4K?y^bJd}#<@)|m*92^Y6`UgS*B*l_tQnb&|I!{ zQ0s8YLCRrY)T6`8o$$oubV^DD$X5;3)sdeE@08zllK?qf{sDRSaZltc0dj8@_d+l3 zjePEd-st1={pykA2k?Nh`r>}{O>u!Z3w(YM59&LiA9^9*=l;?V`s)i}0QzGh6w$kT7U#agL1nSiCh^Zv&B0M zMI4o9v6QAbSXuE?Z?K%P;Q;^P4PI4io~dbj zviGJ7DBiOS@BgDl^0Y|0RU<_+8p-m`=!%8mc4t(@B18Ls(MX;aNk5!MigwmW#j0Z! z-*mQvhQhAuzbH{d5u?WuUQJ3$tX4ft^vF%IbPF3Sp|G5ysD>!h9vl%u`s9e1lE@k( zB}81UB_*utNr@^MG>Jk8JUdJ(RV9DQDXJ<^!YaiZbaaFGnw5~!M@l4>tW__*7A2%w zjF#M_?W96@L5PV4`oWE^DVW((>(9kN^rI7$78s8z2y9AV3@u)RxJYh@iF%=5a&v zE;9+?GJ`;<76emmqyA`r^+$iSe@dOIU>S;FOQ}pn2oUH#!+kH4X&Cb0rLa(4N|T#m%14=CylnO6Pone z+?GdZD_krSv=tHBN*60F+A0?^Y-NPDT7#{!U~2@-k0#7bqcwIylU|F~6rrtk(I{wZ zBeZ50%@%E)3mMiNp@kZ4okd&k%367pkcE}JvpEOZ$SDXb_vQFvZ*c#2p=Gjpqbs{$ zejjVymUR&Bf;K%CzgTU31=MIlt=aa0#Ii zp3D7KcOkmN2JIqyHqJX;>~wjTi(M|axM*>CcX+IK?j4^r*VV;(gg1J3rMuhEr>E-| zmd0u^xR!@vC>NoSi&2E)fQPA9l1osctl=1j;VJf{(+jv1rCv$vavp)9C=7UHsgIFC zDb?~QjKruEm!VAiM~h=bDJ27pmfzA?L#mV-cnpSM=pZ>JW4PR-@K1g7?iq_A<{;+C zK^!N^{CLyv`%`YX){o~_paSJGTzbc&f+xtkQl`E#?B6fXA1kM-vc{9oddcRWh;hc2 zc~+4oVS?(OjER_BD`|2Ss`wF1%|4ifJi+8c%yAzD&Y1;(1CZ`HcKxvPtq;OhT1m{S!>Uv!?k|Si*8( zE$8WJ&U!~H+A|F8nV625n)WQr;@Oza&tW#63pk-(Nv=kgy~ z`I@#bb8pVQ;=RD|UWoZvsCh5KB7Oz)xfZXWHsGXsC3!IxE6Ya`ev0czdh00QC4?oU zsnrt}VSd03Bpe$^vrmz#5a z)zMcq>Q#zr)PU$NQYC5!$vN5aHD9_yjTKik1v_O5lxfe+E}MM|K|C!c``v`y#J^Bo z{2Dc3afReZQ0eRU^9bz(;kclkh|o?FPFl1t z2r}$sg!T`O_Ju|JXD76bvN+W#uZ*(z*LNbc(}Yukc3Pu_2fF4>mNd@jz+c+HXFCPX zh=_BY0%t_T`6%uM!a0e1!Ni^OgS>ks?pHeQMH}}L$pWbJcPN}!_PrlozG=CQ5>%(J zT`gLBcy`qHXUm$m%OV+tc100Twq35P5%e{}6@k7MO<)J1!%pCJf(+}3Ch&&lbKUZ( z69uXHv@1SUOB}QOU1TT4x!ys&!wn7^98QUxb2xCK?Vcm4-ND(o1KG0W;-5Cw)y3FZ zoZ~x-9r?S{cjcY6nEbojj+PxJzo$|PJ!&~0`P>UVxi@;DcfftrE6Mlceq}v?K6oI- zeWkN+!2Qrqm-GjbkDdYdm-F0T*Yk(a9}lH?00wCPKyf^%>-a$Vjg-Q}xDWYKxbZL- zh*I#%^X?gh`!Y&lup}_VD1~u@;(j3tQDEx4=n^gxZ?UXFadaFJ6~}Z9936lS}J_NrvAo${YVS^v$iw zo1%=ov9vQfVR}T{@zcC#7~Z#_Z~mY1##h?&CVf+s(KnWNMik7CcxN=h0z>(LUm7G|E7*bc;puHQUZzEx& zx$ifrKoTY3&FbdgY?Q$kk`}heH=>EQnvvU-f0I!L(w6hoXqAD8BO%!oDFcy4Mc8hY mfoLI>ipV=vDZA}7$#g+MoOdZf!7WPduvI#3-yHwP&;JW_30IN; diff --git a/src/wasm/Hacl_Bignum256.wasm b/src/wasm/Hacl_Bignum256.wasm index b3b0455710a1c98525a21975f2bf9210436ce45f..24cf040619ff738d3363a3ea5d31270ff81a4ad1 100644 GIT binary patch delta 1871 zcmYjSOK%fb6rK}1lRyZe4XUWh<2!`B1B6$cw>^`DyyH0UgaooE229!li&iQbPrx%F zJOg+!Y8S1#s45mn>_VkV?XsKxhpxKly6Up(xp$n0Wc$o{%)Q_D-E*%0ePKS_G~aER z^h@r&x%J+pwrf@2f3vn`oG8kcx{++eJ)AY&ecDD`GaGd&OK#=Xp)`FEF&lB-CMRgT zMfLkG-~wO7MZOf={g95lE-7Lg0ym9Av!4TIZY z>^kjeL%Yu%wu=tmrd94l2Rc3OLYEbPyTRS)mQ6XncY(y-1uP`khPBK+u+igluQCqz zp-*|2(TmF-_e-$f=K&1pMF(ZKL0Q)4A;b_zOkm|C7WXk^yXtAkw~d^a^Aw?0i!$6A z{F$c1m8z15Q6nXn{2YdJJhG#}C`LmCMtMvWNQwf{`KLqti1C@Fgsvx#DuErxM`julf`nf05YU-)T-XE0*B zsigXKW#h^YEpaXSiP%Ns^p-cfbWwtx9a|d~5`+T}W@ZIQC;JY1m^ruP5`CK%bho%NkTa;^>rt6IcTp^dJT>=*hed>HKh*mkz~<&W~aQ zqaKf8Oy`s67aEcsw#ikjl8RM#$Z8y2h=;7k_pmD3VU^luC85HROoXf^ky5NC9hMoB z0ZYl4Ok>8E5fS6CjEC~(F^hRmI(-@o{u$}^D;m`zret7wNpLM`)K{^Ds~%s&HJx8p z`TVc@kKVvy2!C0Op#M~%pA6Ao#{{NA^w;;GkL;jNZ=;t`0sV~-{Y|75`kM~l!Y$4q zo&Ooll+OQ+6Y{&C6Xn(TTCG{5E{K}oyH)zgy)UhM--_(Eu6TueXcblB6!vh!J+fF; zdt~L@;qn?`l^+nqJ|LeT7M>i=5#*y{9znt$dF<<~FR^vPI%!EBxda!hK5vkywn199 z$0Sd9EU!EvJP8Y*7V4gSU%7<2P7CnLPINAEM2`3G~F6Ies#}Pl$;$j*z5Kp>nXjI`iTt}B`IwK; z$K0n#{!@fvx0-)>x4LRHm1N7EP&VX5vk|94+mI837X`rY@b z>#O59&L?n!`}~L7sbS;op=$rneyVKdSSXH|8NL#Zn?|Q$fW#|b&U6_DpN8Szj#F>- zmY6BA_i@UU$ui1t%&%LbX#FX*d>9>;gFY{Z;T(_XJU^9HI-?l1jFYnSD36&2CnR5D zOFl!qLcVc~TZYFIvde^L(G#A;1SVa+hHK`z56^iDQ%co!j6r^qGAApqdq{l9xhg?I zF-k~|QjVY$kv_xNMn0A(yxaV2=r?{{<{KEXobj+@hB=Ak#zVhRSRPLy6|hX2^njB> zGHDt^#iFFd6Ou?tQk5xKq_yu!@iYvje+DyFiESA+&tjJ6FysI6fO>ewK)S=$x zs05=P@4ybta3`u!AjCNf@but}j3H(A;_oGdPJEdU_8=W?Hp^FcogS&A6-5wuQ#^ysfq`bp8 zh{G-)k>C-Jd(b1o%AWI4bfIHoq^ijg>v5k*?9&xEi9Vck`4mp+3dC?!Np^4|C_qdM zI)eh7#(s1u6>T`JOo29KiX+kgg?Xmf5@!PPXVI_7pS9T;zyO~^KgV$nagR-9Y_?!2 z?>tPLclm+@FL-Cmj8Qe<5g|=L2cTuZm@QBuhcuz)sLmCADf}gt`@J5Yy~ai z6w*8i(%4v0X>6Ob$g+bKUL`nKC6Av54>ms|$e#-32olYa%dP@l33&vMbS2g(j4W3C zzvrlZP98jdNm8|!q|5e-eQLXt``@p-I;y!o9~-9_qW>pt@iQrSz0r?gnD3nKWj|yMmP1K z$N0J7F=9*E(LVGErB6}NNBu&fffOGGM8>?sCzJ-xsvJ2EL;OjDP#%LJ3}Q&9VG+f! zF4Pc>U>GA28pWvazMwITaYGtUuJl z(;Vg`bDn$6GgYSr^kW?TEGo>oaUBaHD!&$Vp@bvhh_o{xMGY8VR*ReuCutFNe56+o zV=+ui29>#`|D$CroBo$+h5h^4zdy;p!ja{F6{|wgX^kms50=-lhV=+-U_;8=#HO^o zg%$8)Y1`7_H}&|X9>4MFjms&29?~|JM0Cax6&Vyj!1#4q*Aqn0)Dn=S080r7WifFT zL5^4of?O^gnunyrCIo2*^1f&nJG6)0xX|LqLWv*KKK2FTr`JLa(^KpjN9S&J=jQc! zua>pV7ov)oh8^SE#jd(^LvQaLng3qJVoI)dl4TTM-ZW%WE}lHn@{niK@{x+h^sKEl_)oIQ|l5`PFd7?liGkfliI-4Ml{;c zCe)+Rf;LGg&o)FZ9&{?DAr)!HkJYT_4r=DHH;eSgv2$c?b_us42%E( delta 836 zcmYk4&ubGw6vubhNSlV{2T5wu*5><68k01pzmj6S*Z~p5q)F4XP11T5jHQqUytR!8 z+Cr&^Dd?t7RtW*TSqu|wpCl9%Ze}Qkh=^B=Sote*k-h1<=dv0{kjSn9WhvtO- zl;$yodHLlqZcigk8DwZd(pW&Yat`^a;0#gr$|AC2@PTbnXfaKL&NJIqoqy>LG#M?= zIs29bFFh_l8DL1SQ&!F%`MkFkn?qFWW1-nVu0i?B5Zg;w650Z5m#82#Dsr%5Uoeel zy`)nH5qd_eSXJe$p#UBnvBBV46UD}k(ihcnRjNVV4sBqg zEsXZA(AvASiA{m_!I{t-^awS%eH74ZomWR0V`v?GlcHtt>eu6%p6}4>uFd}UWvit* zjXk^cpL8O_|4mLfEt3llIL}l9E^^C1CxNRTID{^9X;NK-mp`}K_L7gU)X!D;g>LoF zBj2W@@sYO55CP6Ih@j;j#We&k+&+vdhevkP$@rK_UuSv(6BZr9I3{{@$fWOOl5v>y z4W`2gTXY13aF33d^t((lHEGf}nT{c5(Q!l(>(OyVa}9O!s}6c?l;ENgVxX_6-&v%l zOw}z`rI4~z(?}xKQ%x&XLa7p}aYH`Uv>D9MZ0GKq9|QJp&$$DJu{SKoPhYrQ>KV8( Q2p;N5$zSj1RNe_rOu>i_@% diff --git a/src/wasm/Hacl_Bignum32.wasm b/src/wasm/Hacl_Bignum32.wasm index 020a40abca476f576064a0d475e0bd6ffc630646..fa107b622cacbea76c88e7bad3eaafe849ef3f52 100644 GIT binary patch delta 1241 zcmYk6%}x_h6vt;uAvS@9+Ho=bV|d*JrOU{tYyYVoI1t(i|KP zB#@wKOw)|K40p-#SfewGSz*i=24*QK46^DnuwZQZGs1{-)CWuWkBhvd6wK?*98#FG zDJ>kNZDAH^9%;;%X#oo&`id5@$SEmv^S-!we+hz?u|zLcu#6R(R@LK(*082_>sZBl znKn4MVbdly74sqIddO6pwva>yNfuS&SjNVdaMWtc7DlODDl0pd5@pE}!Xb5#9^o#Z zn6XQERHALq{>ct@wEZ1=%=WWvKYPQziL7UT7rVl+X^$y;RmV@ThbLv)$G%ec6i=1o z13U)*Txkb3vRY17$;rygc(?=AzmMq<+rnA%J1{7RoP5_al*l8m)#MZ_$6|8A*z$Uj z=NIRr&yQyTz-i~&BE1>*k@nUAy?lg0OJ@1`7&NG zx8-hM=;~Lzw?6Ru{pqQ3+xNCf{*89Z?y-w_Gqs|nB7BuM!l=BVAc6vw59h)xQ5#wj zJXiVKC?x-kMccw?7N#(dl{jkWDt5@AHRyDr6Cpmwfi84XH$NlnD1rc+6aJIhjD>|C zk?L*bpa<=G?*e<#t-^iisVFVzV?F)oujz@R7yU{P^MP(e^^zR8T(ju4aG-`RdU6Lf z{SF2+{SMP(h}Gyr7(~pa-(~ucrpG%B4>;J)!9{h^S$V$Y3hu zaM5PHhH#lE$sI~o1J~_A(kq~acHX%8Q#$_~ES-Oj^QV#a^79uVg|wS~fz!|H^oxp6 ztbT0jNp_@ex3Gpxl~s>WBZ;ez6JKuyzQ5y{^r@K)SPx_=wcijxD-VwRnfmr04^RjH delta 1241 zcmYk5%Tg0T6ozL)P$Hl}VoU_&KS&^41j8-Kgg{!5i(CUJCRjc|q@a>1WhJ94-HFvp zAHa<%wRi$|y7B=mpTTnF$|_H%XCjN#bf5Hm|No!Ub9#Jw{OM2cr3qm^p-GHjQvU57 z3`}8)rZG)P`8gDkzhcc!3MpYs8wOI876w@jIan}O{5fI7x$1)@{0AjoQU>P#%?vV_ zu_-GYWNl%VXck$_R%i}$qURaqkW<3q{QGy#zdw&Vw19bfd>0G2Yty27JfS5lsogRb zv0R}QF0R;g5BC&vm9QEM>})WrTw2AgyD7 zPbBR!*2}cv#XsD{rjEZ!TO2>n@$={6o5*|dx3Mh@n|7G8Q%k&y9qd-j)%gi{e3_Wu_2sAzXO8`D9D$c{gXu$wVQ%s71&Hc7^~ha zioD}lpvZI;Q6EwfTZ*&~Q^kCQNAgW9B2U6i@?$Jw?w@^)z4Ns^smy9>t61 zhRk;d&wj?c8UsIGy?9|<_MJ4#-#yo4bo5i-m8$Snp9`b&-Ry)BMhBne;x&XR!p|t@i6X$!g#WO9!-B$( zXpNx!Uq?vqU1%pFs@#R^Rpkd=?5P{wbx$|YiEibI`8|l>hF-#f%QZ{h0I7~Hd6s)M z{U%7$Z!*0PeRX;az36l4{Y;N(`hW-b)!}gu&Lw5t;f4%q`ViupKE(844A4R!jMN9U5;nA;kjz?g<77(R}14-T5ZZH&A0Nv2O|`V^w-Dn{i|BJ50i z)8HOalE;&*75>i#Nw0e;gm~kMr?t3+loq#GJcEoUPBZ+0W?bzoYtLxySw$#Ol4sRO z7tkn=6PH`&YOF?dG*j;EZQ?^y;M+^SkUrl@t87h=$*0z?JWXG02%uelx4!%XC`t_6 diff --git a/src/wasm/Hacl_Bignum4096.wasm b/src/wasm/Hacl_Bignum4096.wasm index a3db37774c90287d829923c700de1e0df1b8a2eb..c1ced14d7f5db133e6216d1f7adca5a9616d2979 100644 GIT binary patch delta 1820 zcmY*aNlYA95be*vfXx;O4p=efl`+F+8*F13U|^=3&8)+)&9K>E8)6fZT;o7bL#Ert zHh4)NqC~zU5?P9clv|`IH|LV=U?~#5B$wn8$x@UYQ~&p{M4FlURlnxfd-Y#+fBnYy z-5cLmCE4Qh-4oe&ek}j;v$Zv?EF+m?`I0`XIO(^JDeJTR$xKTmg;lis;#G;yUyF-| zFx_8%tv+@Mm#6^^blF|sDYqKYXlPBEhDK`AH46G7246#Zfv?63v8`|{n^9^c8I~Szz(E}n!56}@I1M@m{z(9vXozj@p zg)ZrJqZ8dW^>DDqp)0te4(;V?y?m@geP}`$O$;l=v9N%y1 zJGWC@BonD00nWJWq|l$D0mXh0gC6@q8e;ZQW*uwt1O zhbWG?tABIS4ZqH9NFd?ijO*fEiZjf(uJ!NVQGz{2i3C@b#Jwa*{8WM_p-J*nn51b; z85yRbnKXkLn#GiRXRlsNxnJy+@$dJ0%_pWYBM*3w-iM|OT`bFU=>tseo_xKNb$kLW z2z?Ehbbt75S`6&g{(d~GaC?hISR_TL1n0hZRqD?E@vJD93Xq>JScpP;3;FI(+4Umd z-C^eW?#sNoVtHGJND)wgLRlI_?z2Bj3Qi;U5J0)QtTQ+Rk~wFng8LZYE(G+#1ErqU zGZ9dLCErSvdw!Zj6)I%78kNi+)h5-ThH6nsXHko@4xN+6r1Lm0y*ivjolW%|tas=F zF7Op+Z_q{5pwitwRcf(ysEM`Eq_hxZIRkY=TY7By|W+bG4FLJJ#IdrVtVg&N7C z0h*nt1D|+})$?T<{I;$vWCtcI@Y9_HNYbLpquxL$SmDUB=t_z1gPOnT# z3Gl~~L0f?1wy?=j+YZO>3fvW{H}^OTs}5}l?%sw_?Yl2{h5P)E2Lcbgyoc$$O_{gp z8=YJObIVj|VUH#v`{{uZ|x|#q0 delta 1786 zcmYjSNlYA95be*f1q=)ZvtwSd8H{bP*}*K`Uf5yS%nXYSwuzkyan1&M8ZzBBUcgTJ z6eV|yNRBNbMam(P<$IziJ|v1n4oNP#IFh9(mU2n`--AJ#nd+)n{j1)q|Np#v3M R!{9jzk8AF&< zj~djwuYRq5uK^9zh(>C1*SE{uw_l}$T7BJU)n90R@!h&srD+iCCNG7nHI3S!x$DpB z(+`An4!wL9PU0jHrdD@;J3FgI<_@CLu+Zd0F&L#GxxO`wVMA-?C5LH5*C@c10tYK; z?8YjMV${$a8sjC#97C+qIL0t;(*!2;uBRI`iAl-i5=OvZt{3IZOAZ20qqeLNklh5h zNCG7y0f|kTcF4W;Ix+u+rqZ7*(G-RZYc$^C4k(DAtAAJY*)ORLA%wgpgSz;Tg4|%BH(#M$I!Ef6MDN|t8^)+DHef7tT7}}}*GbJJQi%p(!rkt^y=eJf` ztVlZ2DFbQbM+W>3WlCexVH}oT7BZ1#Q#J>)9Xf&|O1&JUBh8^))+|@4n}=NF*_4lb zg%@~uA>)M#FG3-TY$`^v!jB@y=oco#1v~{F@liI07PSo#r4pnfUD7KdAX(S+yd`EB zuF~T7sS;B6ol>r+S`_LNPP?obc6)uWp3MGtyy z>O-Hx`#pSs@d1SoVgQ3S4Pi*(!?@^?>NkWXM>;H7b$F~sa2A~&tC0h&;@+_e?6Kld zY$T%|t1$#5t1**L@Hije03Y26OgemY*_eC^r=%C;V;r<8#KDkb@kyFiUCm$|0f%O} z>si(H9A+_R(`8&%_!SSIXMA4a3z)}(O;>SM;n(;ms!?5G!=$cBQez&e>lnqjN9y_k zQogW$CUyxe?y=%njMe)ds~cF9tZtZe6F2DtEV_06Iygz#kck z3UD+kY_cV2bI1{Jgi_&-Km^u`Lw5xWbyp~*HUvLmgWtF(aL-G;FB3WMfy{g0@~ diff --git a/src/wasm/Hacl_Bignum4096_32.wasm b/src/wasm/Hacl_Bignum4096_32.wasm index d937d02cadb5b167e7fbcbd852dd8f020dc3d18c..a088be23f89c350f1125b831fb5ba639affb670f 100644 GIT binary patch delta 1197 zcmYk4$!-%-5JkHk3o^%vhd85eWg_4t&OA>q^X$yF6Cf;*A{HEe3M zCB47i#Gk3HP{(+93|5-6QOPA4}Jf zj-aU}D76Gxi_DKGJ;@Czgpl#e-)vy4VmOSjDJmq1A=VTU%4TjHVUAc5 z!rVi;G!IFajxa?aM@A=z&?!!g+Nihl6i=_^xo7koicp0bljU@VNFjJ3FXKjwmf6aW z!4nrLAYy!sovK?mcd3soZr zs!@~e=b&1Y3Pm_#+>*D)UT9Z`ibCMbE};u9)JmBya`PZOY}zAy`5mkic6hSFrM-GM z&DiqdgV^(U=$21TPx1qTFbbO)Q)m%?&r%oJU4;H`HQMThVM%Tbb&E zFHZ$p;IpVGqT2FQ%0W40No_Ns?I07{&d?5YZ04z*XhVlZ?JS~}|x+nSCrXfIwbl zKY9_cRQAh8Tp1<5+`{tgECw(@gT~#Po|}Qo%)_!DA9#OkwyR1b^DbaCB#tUed1=%O Ql=9#-1#FR0XbWX(ze5=cWs*rSns7HHDnpsu;+U8aA5HYN!I&ttCd9aZ ze*~*0B*ZmK6aNJ_822t*xFXSW`-XPWr04Y9-}jxNS2x<#jdpQ-=%10=5zQinS@Xl; zX!9KAXdd(C=He`9sbLvQvaCJyE=!RV0vdQPr+uSeCF*G_Y#Wnki#Z6L(wQtYck@1;(z^h7^=$wRF9j;Lujv#HJKQ+G5OB zQPH=th3x|EU`NK^(JppX8++IQe^}Ds!o4EWMnUn@>P4FUgrXAF-}AJOHCbBmmROK7 z$e2G*WX8>7_*b=g=p~zN|>hyM&a!^B}100y`dUPm zDLsRbn$+^@DLqH77QAqVacSs2kAELLV_61r=2`wgTf4l@|MB|%elC|qz;o&|e;8jM zwN|93aw0|LgaQaiRKA=`&7d~4AW+q7qabccA%l6A+RBuNY%V*uM-_sZ1>ZJuu4bKSy84CWni{c za!b7~Qg^1*XHomnYf<}|8bi#b#?gnEO^w%4JuVdvlvB1oQm4qMa_3|Z6>rY4bep`#c^(uR&IXhfZ3ga_S7O=v`uc~tPdk~f0J zc<^KLpQufqL;D|)LI(%7Q(>% diff --git a/src/wasm/Hacl_Bignum64.wasm b/src/wasm/Hacl_Bignum64.wasm index c848593e20ba1382136898fa1c6d4f91efc54688..edc590b15151087ece0332fefb9eb32fc02f45b4 100644 GIT binary patch delta 2221 zcmaKu%TrWG6vl7EFgg-M1QkK?JE9^Wpok0u2;3`gubq5m#aF!x<(L3Qz?=QA@#Nm_iNlO9iZ^5Q`!q{eh77!NoiE}Y!Cw+)mY z+=Q)`u>F6VN<%fMp>5bkwLUG*_gli5P8ea!2pa~%RA(9#NpC>}MpvN4G&XWH4H0wU zM6A>>s2<||q5<`2@Tk#p(CArWnzo}6+g)lxliB?GCN-m(&!m&4Z z>_DqWZE~=w9qn?}fi`rw)XBk4kGjyMHtpuqx_MiVdQgWJ)Nxx0jsxH$=-%M47}D24akND_>3SeKoARR4dWxRIzwb; znm-xp55AqCedx8E!GHsUhB54CHEyVhBC0zaHpOWg<_3pNqbGGkQC{&4A<73zY+WR= zi=s3FA<;)MLSq=U(rnAHX+QSUI7a=K=4LVK|7xz`-+!4AG3J+8MPg*G-O31N?c>Wz zlYJQz81aWYM?~-3TxUl{_Rn|u*%hY67wISFzip`StNVU%vSfI^p6VU^0S*7+jN7peRj z6k&}^08~CoSjp;hdbNBZ36NazW3WVm)?x{Aq&RD-*c1qL1>#s_8fN~4DJEhYjese5 zB4wm?$a=q6&zH49y_9>InNA5xP|Uk6P0~Iz^qLQjmPMcAM%^q!$gH6?_maDDUf~_vqpvpmwC(WyHYf*`E zkHX9wR&vxKj5?Ph{OqOw>UF+>^9?HBhz2yeY}4&3--KGNR=rlMi3e0@wVJUBm722! zrD)bu(?OC;#8Qs1=Fws){dQ=&R#=jb9o>dDcD2QpZbyg5mgd2hmX@n-bfVj3JGZlS z*`YgCbG__-%cDMSzE3sZk3RG}E)B35CEcJd_#Y?sYPvy9Cw+-lO*h2fls1jDkLiZ= zbT|c7Z@Ty1Ga7{IL9aEU}Xqvm9R^8i}hV4=uag}#;enxP?j8GM`f@hc& zF5M8gAyipH;JSu%G-N_lNX+vZ(-k;}DGlcd26csAd?HXLKeJ`NIkwE9Puc9+oMvEx zZVI;RO&xk~R*t0J^DTk(a+wt5Gu~NR^|rt*AvL+ppZ7ZgcLaSdLv&YwCwGNMUnFNX z-4oy+8N2TYaQr@lJy7Wf9P|ZzjrdS*#JhO(NQ&`Di}6_S43GJ5o(MeAl~3m@pUKK+ zy7IZ;8J=_H3xOB9@}=yItcdy$zLWuOT`TuWfU)i*<@!=;_bR#gN+|Xi>m=1% wOkZpM3>0V5H*<{9 delta 2174 zcmYk8*;5o(6vq1wBM1Zm#RXjWjv@jAZY;9X4amL>i^4FtuSi637n=sB+cmE3u1S1L zB~@0X!b9?8@&}|+mFJ}LmUpd6UhefNG{yniSDekZ=am7Mt7 zcXPAGYX5z5&iuE@N!xQDzMP#kHU?%EI|(xhPS#AKlcL51Cvhg|Wcg`5B|p^u6G+)% z37g7Lj57bf`oiRLlv4#NsM4n;tNg~wRR7P)B@R_5G@=?td$7?o3Je1QRGW(@#tRLD zY9Kx?YEgq)kLoN3b)F@zQa$QW?@|LA%!ao&sS%CxdFH1ZSf6gt1dE!{L@j7Wi$}ZU zVE0oiTII40yU^xRJ4f3+>OhCuw3DCK$=iC=g({e+;YzgTa3JcQorhC;HT5I-Z4l8}g`3d8tJ_^0cG+2${X z`oT97G>jh02?ZS(G=dR7vo^mhjIi!-#1toKgc}?&jn4Q9g?Ys%gfKr)V(21?ofD=} z2#Fp+#0uD!Vbd7KXfGoE8*{6O_`jRE{QbeK5~KcRYn>RK@30mnrVaB!1!Pag1V;Tx zTUhkW|Jc^LDD|g%eAluAGb!p`{o$m?cFjNrWg?xHA`?qJS|$gZvXCWL%drg0U0T7x z6&|g`N+s4RWFXz6Y!)+HiJ60JJE53uxnU$t+FR1XI#A*=*fr zwyw#(ZNV;&ZOenrwq@gbY};0}yKLJQba>Q>PSso&o7wcJo7?MF&G(=iJ&sH4KvmGE z3qo8FQU(3&#D13sFre~->~cldr|AYIU6ZC8f`w*{w43RM^mI=gF0cSM9EanOJUWLj z#E7N~V_4FKZMMxQduEv362X`!4TCY8_FilZujOy`et{#$r;DEDmaNln(mmUJ1ObHnr;Fk7}ZFhGu?!q zo{G~YEYMBH={OX-n5Q+|8B9vJGd4|Oiq2w^&fzT1c@CYIqfHlZftPd<=W)@cOB}r9 z(Pdm#&0WD1COw+w?x$7vS22yNF4?eEen#gV&O0hUE8t*OxHKm)CsfTffh(GDMiX8W zJQm@MW{e7)#*`*=1ye?aUU&k9^37T3_eGXFbX~-qX$B|ghG4JW(4mh`b9-o>NGf~9yYlon3}&+vqQ^Hkueu6(vo`CL{$*Oe~>&+vjPUkbd`m9GSR zDHK;d6IPXa*S(SfZe1()T7a?c#N_%?YWF&}_(~}Dan?zymrh@6{zX`yN^gY!S6Au$ lrlFq~r~W#}Z}x-$|M!sOe;9L9GWY@fN>4_nKfU+g{{ihM4^IF9 diff --git a/src/wasm/Hacl_Chacha20Poly1305_32.wasm b/src/wasm/Hacl_Chacha20Poly1305_32.wasm index 57b13d122acc1359ed36e6b0bacc393afd4bd45a..eb45d058f670de2e077ee014b939dcfe4bf2427d 100644 GIT binary patch delta 68 zcmV-K0K5O~JLx;H#{vP7v&aJX7zvq#fPer30)7^=$Q!2t3Kbw6K>=$){{eB6eH|?W a9UvW(tsNN)9zg&FK>-UPA0Qu-(H$H|@f4o` delta 92 zcmaE9{nmQJaVEy8n@=!(m*AY+($K)b#8fA~`GoXxMm`xw#%#y`jD?D_3Ze?KlPhI) t)#ViAfFf=nQI>iI76n!XHU$O+Mn^^gE=74q23AK#ZbbzJg~?}SWdL#=7_a~U diff --git a/src/wasm/Hacl_Chacha20_Vec32.wasm b/src/wasm/Hacl_Chacha20_Vec32.wasm index 8ca2ca540f219633048e867c05eff7dcd8f4ad7e..6d808d9a6c28d619538eb10245905d33308b7199 100644 GIT binary patch delta 802 zcmeHEyH3ME5IkQD5eg5ZBn?pPHZhV##oZ;ovlCxjAwuk!6_EMQ)>ubqz%*T*ss<9K#qVFrgbyRJ6Lq0)EM$@BwlgRG9n1nL-QaIHi6i f*_Vw#Q$lq=yBX_#p23p(_1#1N`2Q#V$WO%I(9oMc delta 810 zcmeHE!AiqG5Z$DqP--=xf{4P*rBR9}lifDENi%IO;>j=Yo)$cK*Iv986t*AXvCtpz zOFa7-&PrR;FYqGlVcyKV_hx3_d&}O^`rdrC@V}a^*ZFKFeE%t1y|g|XC*VUwA7Vt&#y%(V}ekIG7 lwZX=W*87dN;rd9ff+Y(a+J}Sl|KH%7?wtA0e&hN0@*D9Un}h%W diff --git a/src/wasm/Hacl_Curve25519_51.wasm b/src/wasm/Hacl_Curve25519_51.wasm index 0ddac4a401efa55adb1289142bf33887f2593393..12a0dd5c375c47fdf0842e4043e0be5386fc7b75 100644 GIT binary patch delta 65 zcmZp&_-DSspM~k~y3K(se?&PyHZ?RbFfr8$ZVr^N_5%Rr&J?Bq delta 69 zcmexo-ej@CpM|M${pLWHKcbvpn;IGzn3(E>Hit=xF!BjIGG;seXDn0{QQ%P!nOq{R V%P*=R3KVezi;5|TP2M2w2LKQr6qx`3 diff --git a/src/wasm/Hacl_GenericField32.wasm b/src/wasm/Hacl_GenericField32.wasm index b8e4b468986347e138e2a445c00ea9e029735889..52efafdf1d60e8bcb44b3c33f4fd7f2a6e19ba25 100644 GIT binary patch delta 697 zcmZwE%TB^T6vpumQW8_5h=^1~z5^7wc>@I%FU-=NiEmMji4TCd(}i)senS% zw1PYeK@FO0B~(Ja%DSWURgK3Yyryv; z1?eMRNL}d-)Rf*}y@_U|w@^nj)Yn*VDSch*Q<1)*bsmL_*;M!zHWa?acpGhvkEnx9 zv_pNH^^VeaU`yeW&HFMb0TT(HCxt02i$`7kJiIjO@q6_qgTKc@Pp@+q89szHd#Yw1 qyQ*gYlymy%>l`}39{OR;A=ezJnxlYlsrP@)@kBL|wrJqB>Tkca1B@2{ delta 662 zcmYMx%TB^j5C-5DS`(CjfJnK?f4CMDuxg@lWn38_ z#)S{y)+wi_uG*Qj-#?l8nSM`So^kk9b#H@vc}B zNe=IR&ecn{ia3&UOHr`OQto53l1?MeRj$ssHnUlVD{RgEY}TACvPjW))L2KB<>+Zd zPhlX&)pM?0oN1?AG091D4aVYcs#qQwQ3qfFIlo;*-t%Wck>)9(6wXsd0VRJP@;8t} zS-e&p>8iFrm~SAYZ8 z=xx$F=!AL~COUz>NqSf4TT+jPdQa-q3Kr8B_y9eD4+tM(C~>e6`WOcKHt8dw@4(=y z%?$U}Tz7WmHE2i7qVrgb#{X?#$?feSLq!n2FT%&z6X9bDpI{=x*#Y)339=6<`#@wL d`GU%JHIi|L%^eUo?tlv_DlQ2!?xNx_5y4%!Ty*YH0@0x3 zj!Pbr$5f>%ugPovh5R|D&*>RbHC283`+83G@0)w)ujD_;KYlHuxj%m^8b!(H=TlRW z>VnB70Zmd+p5^Gj!7?sEaiYLaM0_qqDKAGcmti@|442#D^9ro6-Aa^WWylpGRv2D| zRooqSpB_pfW+e*lVPi z3}CxRCQML<86_xfi$uU&mz`fZ8r5ixMr5o@$i6oyvKcB@JoHcyT7N5`KyzMUF94>@>QN)XeFX56~ z?lO|-H#{iI54z>AU=UYAzKW~Pzo!0>_(RUWjv-tRIY=Sp28MB2>8>f=u%#PNx-?EB zsYpKvU0RPf@^p(9=tlB%BIO>;n+i9I5eql!^BBhX7Do6sZsE2G_>QeU-^E>N`5x}z zUdZ=Fyl?mc9=PQmVhkgO$7TC*xBUdhF%hy4-}#g32jU0LpCSa9qL3dE9+8`QOn9h- zlS=rQq&8qw88d{N7*n#4gfc_g7((2m6vwl3jTONY%D z6Y6c73*$$**goPjglV#Q%#hEsgjwRBti;aH AWdHyG delta 1569 zcmY+E*;5o(6vq4DjDdoH3(A0~-;n?_0^$aU>vZFWqT&_=+)>eCg5WOF(yRB}y}Y{2Cp{*9-GgQ%-eJ zrX;A$e3fl&sLJkc_&X@~ihR%UxdIiu1m(OGOR!Y&G97$gj^(X{RbtwB%)VU6Sll`|i zmYr`X4eC)3mQ$qJfO>9}7+;h`93?J|xRKHBNYZuU@+<4y2;%0rgyV1mb+*p^!g@67 zb`ug}6`Fi*Ml-h{!5h$m4T@WJ@OdLP>S_~Ou_@%uXbG@c@fK_`xLeVTgyJ^gZ8LVX zqYdpLcc8=Q+pOLxdZ*F1qZ8Xh-hmxP--)f-p8(seTRSD7$-1=*>(OjEccT%zY`Q1N zb5Tk=r5Tb1v{c?d*V1`NYC6y7E_Cr;BzYh9VxQvuI{1752Xu81`*ASjZfSNaK7>PN zxx?r}QgM&0*JGAHf*u?RLOzP4X5g3|=#_z9GjJTeI3Dr|oG|)H9JX}FEZs>>=UKW_ zaM5LvP7B>Bn|_;zD=NVC<>92I|GGe)jx(07AAOpx-{%1g@F4p5ECz8_@i`rQK9BRd zx`1=I5b{N7UQ~Pum&|gPF@QeBL$dskS^f%!a3$ocxN7ukRv#99*yz_WjO!r>H*muY zq;T2NU9)s4P1kSfMsNlL7AY-sBR2gmPq(N*H=3uDR_?*PY2n5&s^P|b9>+M}!YJRy zE!MQBJCcL)DZ}d5Gh~g}XF%ZB5+JaQ^1V=4=t&TF%8jkF!s&UsmX>--w_KCEs*eyA3 zciv9UId4a!uLr7^JcSS6fAOUbV*K)?IXVdNJaJn?eXZxCfX~z^`-t~ZLeaU;iScV! zFl4TX`a+GepLjo|?#D&i zNFT1LhYL4C^>)V71_Wo!8%SL77&PqJ^;E8(jjt&(B}=AnV$%~P)3-3aZIMCAc7hne0K<8Lve~So=Jl56 zTbfcb6z9{@2|v&V%O;8r9J1L|O3sv0y1~CYR}%?M zP=g!X$ZvoCTdBwJ{F6_AI8Ho5F43&-=USTh3}yHfo^d><(d${1%xA560S0@F^GR}B zn)O}L(p2juVHt%d4LJrG=v4?E)-k<|F-_>0Cf1AzpA!bOU)(I{2$;}yskaG!XOr^f zoXMn2noP_0CIk5ak^wqG8C^GF0DDx|@&N8tT?<1%sJa%1prfh>MwpCrX@MW1z$qW$8nL5{r5ezV#*JJ9evlw-5#QC(L8@4?t5}$ZJrcOaSDy-?q zKK#vSunW;(7o)*0MT5O%nGqOK=Qe2;qYgqAjXDdU&Qe630;mH(kvc^LJ4pC}HW;X5 z4jha+cSL9`6)F~9HbC>w0Q3r3O&K*$Z7M{C!Zll+GD4FkB^8#dXHy4aLc$cWN z2#;>(5@evYBD4@wXIaOzyk<=JC@_?$104a&N}Z2wg7mXWkW%WD@_6CR_OsaVG^EpT(-K nXvHg-OH3seSta(=R@zdA#m@S-Jg^brh(1=d@#zmXzxv+)5M=Lq delta 2020 zcmZ8hO-x-?5WYk2BRB9OSH+r0qcd7;6HSa85{)K3i7_ROF>&RBg)0{iVuVLX%HN~a z)?%qG+#*G7DbOEKE3{Ccv|38}=?`ipCc090rYjdlcSgUNckg>b^6vd+=FFTk^WF2k zq5IT#pC(@nDpr5q*X5OtjdgW-B_*9}QRD0VQ@;d{mQ_5-d!66lNPiiYD0ujpnpWpY z+m>D2=2Er(F6Zs^JQjFrA zI=RDnd$`kiuQvKQI8-mW==t4GRd*5Nm(vZp2+28aZ>X>Fd>p<{mt;Tj{^+^g)w%bG z@$1k`U}rw(eGSS1;saDJ2Z;}o^ITwKpe^}eQ^c1;#0a)GNH=k-e25o!Q#`mFMz!=1 zhVDTunc88TBlHSy<0FKHgeLijSoDyihQ1s#45ZgEEq#WeMC9&ya-8@$MZZ<-2>OZp zaZpV(T_p2tfQPF{XS?C zcVQsveW6k(8q$e|HcVv1oi>7e88!@L#4s(RhM}CXolzJMbCz_MN@W5iBh={B$nq#P zW>anl7Hc)(rCPmX`3!bItRvgfvZ?$6oNTtdT+S7?bc26(|CmbY20L+r8~*9{zf0AP zEM8#jIm!na6B+K@Kh_{9$sBH|x8krK!dX5E;Qr z8aN6J^(d4MDNWCUrg5cdd;?ARoCsiiTo>>P8wKMicqGbIrQZJBi1OtN!$7_?Ov?qs zP`&~(l8#bF%Y~76Ol|EB$-Qc8UnuBPTYE!Mq;_Z`$ViX&_ZIq_(EcV=Kgq>ZWlR!7 zMR-pXm2uI|_vDhHFH?qrOdF=pSQR`(^kA&&%N&bP5 z0$;D%oT;Xms;uPZNUo@e=e2Nt1DEhjL}(6XQAAgXuf`&}Mtlt-x?&kc5q(W@s3@Xu zl2B1Z*AaTdDvKgoAVx8gvAB?kXj8;QbR*eMC%a+y2uXqD7r(al=F=qMI?t zOEJgGF~=)0$E&t83S$x7BHhJAgpy?w(GoK{12;*=Z^pY diff --git a/src/wasm/Hacl_HPKE_Curve51_CP32_SHA256.wasm b/src/wasm/Hacl_HPKE_Curve51_CP32_SHA256.wasm index 000976b0d7efa99286a8a02cc418b3c1e56f1721..7f40d696b3c8016523a7564df64dc38b9bb78558 100644 GIT binary patch delta 7898 zcmZ8l3Aj$x8s2N4BT9-(h4l2Th}%GhlsM{a!$F)7LUc=|bjVm~z(Gl&!cK$AAtiGs zhlny%=6O~pH(kx68>w97zVF&=t$pfw`2X)+>l@ba?r;C^SvE^8pQQ@hWR^bk%BYb+ z=Fy@KnVrLnYD(=$^^H!cK~l4J5DcQ#I0&LZ*O6M0%G0&t85Pd0e}$RVb)_yGa_E$q zAE{DNP*&HIdb+;UkAfTwtqybpX;8k5zA~P4X_a_-sj}G(rC}5#DX)?SD5e`A`_&oQ z072W#>?rtW5J*E#^~;lnSVZF7$U3ur&Nb3dHRuUeJO8MKwQ?hM*V8)VdN;F*hJ`1WVemQ&b4TVLP?>&yaYx0klM zLsUw4l#WP#WBh%Y>e-#7lS|xLIx=xbB<_O5`1XlAaSDk$`NTI_XD05^RXXWz(oJ`l z?$Ks@`ZvQ~3tJ&w57=8_hp>A}w?5!cz8m&;uup^CM|$ad@SPVm(0!$^ z?kD|lDEB60A`$qH%*rbtkH|bbyT9~zOC2DXLa8UjIK@GCbJgEG^ z(q9jeA^JYKFWP{G@G-d`_72!Qs0U#40J))|uz7&o(1WmRC;NE_=5Y*jKM%vMmu%+| zoY^oL5|wsGI~*510;?NQVs$l#16no?^QK>Fz8TUZxYYATD!E6GQb>8GOF3HMKKj;a z9`7wz@w_ogTIt6*U(wBvRguI8lKJxElynf>q70F~<;&{v@w_X{c|3!O29XB5)=36^4#b0)Y!I)XR~s9|3Z;Rb^>Jl@rrc)W zVN9M5_?$s3aR$)y-nA^y3kDs-+?hZx66vX27G6YAHLyoN)LPMyja zR6cBCPVjXz7P?EArDT@!fpxQ!H z^mJGBO$D|Ua$|)hH}<9?wuD272Y#1t*+E^%T~=A7WUA6dCiz(|`C=87i?`J?w5zgI zp@AVsIW(l#d4+f{Ui z-l1d%%k7NoR;bZ#my%t+(r!+%5tj* zq}=<+AjiFr4RYKoHpp@B6Glgw?miDHIq28;Zv!Oh51$&x)12cWB{_$@=VwX)RO0y` z<5|Xe9#(SLJAQ6JM&kGdhV_^6nubYt`bx=H%Dg<-oxV1RorGTB7{nI{yVJJ@xmV72 z27QA$cBk(Ra^2|%@5%1;qe1L=>`p%!#E!@Abfm6E9^fQq@N(voQa*TKS zOG=^RN{;&-{>ph?EItGM8!wiYzgReP9v6E&z1ZJ<5HGgQ2`1G4GZ%Z3Y5q`AHT|cO zKb1bEIH$ z!-V?rP#zEU*igoXzOg-FkR#WV203z#Gsux^yg|0HO)$VUwxp! zPfrZ-2ubIC-Q5aQ~ z%sgEbN>Qj6hq9Q}mtcy#EDHHH&V4(Sw=t5O&Qkht1^5i~GOmD@Ujdvsj}^R~uHcnN6eK5IbyCd$Psh3L6(?n3~aXR*b);l9(ZD|w}S{a#M}_doKSBx={+$wh0*DgvkWgQZw;lC-e%^j zI$CZIB{Lq7IMm%0%3I`a6kv%sbI@{kDC?Ep6UrWc?t4jIy$=&{<*I#3zZL3Y*hOQj z9#d+6JgnM5buzyBg8piI(Z&lVaj3_I2i5xc8X1nErScqyZn%g;msjV|-0DX;H0@#z z4XcTv_(aVsO086-WMy2ZR%P`;QL9>?gcsG8D|sFisI_qjB?M|isY8KUCsvoATmLFE ztFM-;;rdsB+DIDdYvdX)P#a5QaI6UgYK`nH$#TSM3S9_VH3qA$#kJtub1I8dU{sdB z1&T;Ivvyv#WNG}W!#}Gkn@Ka>T$)Q*{&d{}`C3X#Q(ctKfzWIfiEfP&txJ?>1!S*1 z$D6)f8#AO^vs}gNg-+nLcIfcEn z_sMUx&P;xGCuy%c4L;JL1b2rFTA8|c30`@l6R9XOx^{_yCXTiee$lHLh`OY z`OVgu$$RvWt`LwtHFYB&Dt0>xM?O;Qb+^KHLi0B18D+Qw?FHp${cndUiTfQ$b*JeR z5H@FBQZ2u?^!7sYF4&*hym#Aic8or--CO@2*hk=#iSazxPH6Up&EE;^oc*M?hOE^6 zAv6cb06kC!;$Q|P4QfELKm#B&&%fmC?7=eFEp>_X;0p|L6klkNB{>u-939OI zmD~dzB0kygGpTMRw|6e=F}9J#4ch z29tlI`zkw#U}n!+t>hf(90}5c2S#D9K}N5zt$0op_6Ldz`$Hukl0IvpurJPq7+!~f zgf;6qg_7_AYc_CwwEX(u%z3b8UCNq`X%Lrm&L(Emo3R)OX4%40Td9qz=WbK7&DYw_ zIo85w0M(0Hw0tc%a~`#}rL}gZL9A727c=VJ)Yf~H>|w3F(AHJ>n#S86uN<%1rl5!q88OU)SLK(<$9!eR=asCja zqs;iSf1H1-B=5e%X2?rvXyVWPy1y{MD(NqcqgT?2K(=@HwGpURNq@slehVdCBOhw` zyHrI(4Ffq9{ewY#JF@rvXpnoKLJh;yspumHx!wmcj5*i)em2Od=%WU)pR)HIgNn8V zsiJ@Ju2j*-iS(~z%5O@3)-WbjDiFplh-=7)G#(RbNaAs!h7=y3Divs9AV(i)VIW5zh+!Z{ z9|&9^+cF`20bI+RWRUHc(7f0wl>z?o_LoB$8EQyuWcTuW8c)7} z*`cq~wNEqp*JeiuCjZtm6Ag~LD=^tBL51UwCL{s!Us3Fgh-ail9pxpI# zX5U^iJM=rS&5jTceD)o75W&peZ6_qYhO|d=FZ&_uGob2`oVwm0Jcfa7a)fx`lSBNQ zK?E~-UHlnf37@wpKz>|59*6y*Y*zX}Clqx-Ec4q#+_WR(^Ju`RCow;*ocF(SS z$Si-zEbdj@`0d$aMn}b;HS{g6icf5pm>ZMBrdH38Qw0CpMNutr=O{`dZJ(|_qRm-9 zw#|B`oQa+a_7>+7(qH=)fqT=!-`au*)Cw2|4kxq!5IiKsC(}5+&Rdkk4+C?JmDqXZJ5j_vX&np;S z280!mp=&S$)%mtb&m+}k<bPh;cr-fCA%>D%0PaJb0+z5 zeWg+_O&V!G=?CJ=Y|fHKX>D=q@+ztF{Fh5V^7jLOfAHgP;ICpA_^Sf{70#LbRn=0Z z17v_+DOV<&-3D9*dp&Fex~pMtg&o7bMg}BBAS0jtRDSBC{|u&N?$?59VEW0Aj!)|v zmE^9I>ymwr^yjemI?`Xbc9LEX`yI3w!5#$r6WGPDe+m0D*eEl-0rp3*kAVFvxlU{F z_r~OG9V~-&hzvnuZpw;@Q{z8YR!wPoOL5ckp)%CZbC?WamWE(-EwY5aAxlHqg)9vX zS^BkeW|nfpWvGsj5qh)SoNUBIcs70mdpm4q>9??%JuYY@Y-W!O`W@_c*?N8t^9wX{ zJ%50GX11I^B4MLsMAA5$d5zwJ&CX$Vxq{i9dJCYd#!7^RNLHSBa=Kt_N=9_JJj4SJm)S)F? z<6Qb6Z*a!wdCV)Vuw`&&KPt7(gj7Bd1~HYn`6Sc_jXa3GNe&+_sx6JX*bF{o+hV_W z4;y*dgnE9&B45#uTI6f`F^havFR;kf_2U-!%3f$>AUIudKVeYai)_#%ebB`Q1zyjE z)fX;ou_1N^gCPNgRX*t&wVtc2ZZI;_=n_kQj3{H+bBvu-qqj?v;iQxK$)yRY<7x5$q3YAd%9e z^;r-$N=ym=>uMvbf%!y@bd5>YM!MF>T9(dpY3H+B@oKGHXJj3mvZ{HW-IxOWFl0Ta zNGntgoY{}6S(mSx7s4RUs`&;I>PE~*Uo`R}qiss3l(wzhY-DqYw1r)agx^TFG7_y2 z3C`?Cq|NzAFNHxi(l!$6c9VQZcNp2hNH3?g9a`FTy<+5*5bafVGa7y)-N|UQLNqwD zAJJaPM|&*{Vzk^Y66)(lUN`!NkvH-M|E5L0;NP;y7yNFEe8KPG=%mK)w^RueXIkX>x3f+;|e|?Xlb*>x5V)#No=k!y;cnf3nC|&_s)T z1x>QZU73?D@K@%Y7P%Yqu9$T?g|YlAL5~`p8sn@?~0>62_UQ_b&WcW zE2+LamIFrbvFzXVMLIoBN^}OvXB3i8kBJ>Qh6E7E?{$qj!;=3wmamQ8XUSW8@|jHg zERxSEB%c`*J8}#OAdt^?jXI0u&F_x|MZgL`X0X$EMVOOLIX62gb+OdN2`fHAw7C}j z3yAeH&!P{2IFkn~`WUDPXud@}H#{j1TEx@9*Mx^G;%VSXdDtTVn(#>Q^?TiRGF6QFzuOe-u_*tPQP{xAZz!Dn3o)@PD2xdp6x2r7s2gmxz8K46v2L>L;V5j5lOuHt$+r}e zZ;pu_Ifeuf$hW#i-9qv!UW%oWZnNC2{7KjzOR?@C_l`ntGy^+s3<)4`zw8=yhb@6u zVtJA$Es2mAY&}lGtFhp@?Y4O*Pl~>VrnF_N8yY_u>szoJCbT+W%)_cs?=~ZoR zGTR$AwVBGMt54ixHm03r6q=UHbT(b`eKxf_iA@Vm+RvsrC$nkPDQHR$ozlM1YSTzo zr|nNY-aOaP^VHq(i4^$!G@u=&o!~#_U+^KJQ+odCZO;0MZPs(-od5ffaIT!Iouza5 zkkCcCpq#s=cb?w1yiCgc>du3PM+tX91)q;p;%}(mGIpVQ%R=VZPv>-RyW?sSDTCne zhBsm-V7p6qy+AIIxb#Tv0lo^Uu+hcnh4?7YGZF2D5WNaQ^aOHSbzv|=xZbu&dof(I zi{wOw{MU;?(?|MXEtlX*I6jrrO3M36U%#G9r4Ogr2cG>941dFV`mzh_=^FxE=A0Se zxGL$Zm*Z8szw`(B753QU!$8y1T9;Q#wdWro{mI`S{8xe>e*=FtyTD%^_^)!#7kPD?C%eyU8xhPTS`Mzr{^vZpvMP9kj3a(V{ zkmeZZl{+N*RAU9Y)>-8aJwDe!hs!*^lpO&J|h+Tg69WD0GxjQtMzQ+3+qFxPu+HATG^@UzjNsyK~=ZSK^gxe zuc-fNkyq4E#^~eogqPCC7I{StWsE+rs6VyHUrG?h=<}BngfWm;)CVl$MaN6&^Y#{c zMg2u^rK0|lNWWtB95ix}`}yxsJrKc%LKYx{4%$7%Z=_#yPicicg){rHr-$-;`b`+b zJv{^Z`H{c_{(0><8J$C*<<@SRs=q#tL~nDX%4vh}gmu?p?lN{VU}%5`}R#VRWpeI+Pan9H-mgd|;smTU%4L@VqJ z@Ebv)Vg|Ir4B*Uu%wSc129U0PkS$Dz*Hy7Xw62L2Vs&l4Frij~d|^VZ0{Oy(Tm|xl z2?+}13KQZKz!&BQi(Fwsm7*{qM%NS;<|Y>A$t|hgrJAOhM>P~; zu|gNZA;?W=!Xn+t1newK0GfeaU1CT8;SCSU(Kcc*vvK;aSeClFL`s&kE?^|qE7i`N%W5>l2+`xrczpA4!PvkE}7-aPmxyIMj|~`+GuGa+7`px)*4<4gjJB? z)DQ-$(`=KrB~|x-Nt;BF$z&~)GEF2;PnSg7fww()+t=c42jqB94`JXv!!~Jq@-{4& z#@YcZI}(d=c0^)l)WUbzf==wh0y+i$vt2Uz5AGtJ zv};mFyGb{2pOaS9JG!j9boazPq#KF5fw(7#@g0b}vkS!C1M#^onZ!MMNq6lnz4bgf zFWKNW|9r%&5gX85fcOo>G2#oQcarBf?;^R#SHBpc5%ZbCaru$N(KG zLv@%8OV(i`d_b;4{3c><()EbBd0fzN#N0eC=mx~ax%J$La1WZfo|_Oi&n@R>?AI+a zG^y*ibp#H1BxX0V*6f;&0CYmUC4^zBRkle-a;l9+8R@5^4JZ%vl((9sZu;)=?b22a z8a5hZq=VkU{)WDPtVtv-Kf(4l9%rPh^hqKaD*X%U>)lu$HZwUW-JD-kHQva0ll+Kf za0ez>^aT+2;2w*3#N35@E#d)kA0}EvDe!0~S@a1IH)FCzlmL%6wTKn!0^JwJ?GH5N z5({^svmW667O}(uKo5k}`alm_v>SZ~0zE{eQ#s3rO|m1>X-1|QeZf=Tp$37?f z_T>#Oh)=Z}_=IhX{W&~olt8AV{PG?V9;FUJtNMCR|u`MuA z+d^Bko-g{ef#9mSu$qqgHd3h0hq7YP80ZH}K?(4TMwL!YZrq zS%d3)nN2v{Cp>5H&PboiWt6^Py4}rr8cmOrSKW)>nz16ltME5QEGiw>WwgnrHVF^P&b+6 z0DaTQo2;}M9DM!`;PY3p#mJUW@hzsXB0eMC%8HCaMI^Hy6}My+-wuPUHn)*bw;S1R z^c^GbWb%90A}_!9Eb{W(VUd^L`y8F*`y<_HWM`P;2Np=~hWOAX?&lLfGE)9g$o$v{ zKwd8M-!^l9pSjD(u8{bN1upSZH0x(+^ON{vqv~@bpBwuI;q~-|MZ8Lw^rc07i|~5- z$|C>X`P!l{(Z}oQKNk7x>6?(r>*-sIc;)eW`pzO=dAy#!FR_pXc|H9%r1E91iB&$M_i3H5*WOn)QI z?vrkog$)ZIjO90@57~?&pD`6h)8bQXM$sd&;52v?m?KW1pn*BuJi>Mn|P2jZGvEamBPy0(*c5*O6d_TW21&ag8Oqvdd! z9TL$qQR2*6B{~4PGcONeDA&<8>6t9o@GLn}VJ5W#G@Ye0)^j#o=Fw$cq>EomSLw{@ zbw*Y<6vB5{OBZ%wEnNcnIWC#x2X~h)+5E+3LOHY#b1o?R& z$9Ev_#V(Nd3gqXzWRmx|KzhMGUZ`}9e4=>K(KhmV;x%^(VsA71$c0Is-_XABelGt~ zgpy0Y3{;oHW*%L2gIMM(l5*TM)Z@Xaquk3ynnV?w~4c z7Hr{ge*sm(AL5*EHJBj0VQz-adE>%2qQQv~Ljnj>zRfjaG-uuGb|cp+Jmv7rZr%aA zsbfhFW0@@u--cGg1+uMgjD(x-&D+YRd3m-etSQo1^ zti7FSWTt^zl}Gto?=kEY4|k?XwWO%?EF-hfl6wSUv>xSNAsMt!aAO$-%_5ooQ0=Vj z_a=O*A7qs~n~XZg$Q+!`pA0U1D%$W$vwvODc}C`C4g*dV$jci}703&Gfkj^83oUXY zhciW@mwC03O97qI;YlylXKc}6aBHab#a!9q+AD)o1$L6bkN|>YmbgX?<}%M)YGk@m zxL7PHINW7$xcVH~VP&&@gUtnY>=+V2U|;SUG1#&{Z}5760S0++$1uOEBDh|#)Axo` zdC~e{$Br@R{EOUIx<(8pd+918hf0q`Ko1>QXZ;cwgR^$7Ip?fjvCjHcBd=0EtKqDV z?F<*Z1_N@cS<5bzgrkOP)^UD}!u*iTeyC&d7a>=Iu$@;Yn10Y}t? zFP+XCjcg3{HnE%a@EO7Gq8_7A56SFDy^UGD&DkK|-X&)vT$ZH=i z8OUoNHW|ok|09l0^3w^29Ns{3FTY*3X}@&oA;%Q6Gx+4st>tuw^o0e^Cx6LRda$X{~sy6E$l+z%Fcll-Gayf}Hu z?S@Hq1!7dx-RBD~Vr>{K7N(HArHwk-g!3V5okv=Y!8kf8+Tu3g?4l_Tzl^ zX6N&JHi+kQJUsDU>xpqbqqt(Y;39X*j+Lh6F|7a z?sttkg)8a(KrBBSg&hWaFe4AaD(h5|PpwT3yA15eF(iOM{;+G*sg`_NETdwDlLmQk z*>ur5gXFN!+03U~d+W$C1f74m9&;8O2RDP{Mex}8!w3}sdYm*o&|?6+8tU=Xt6;Qe zWd`jp^nz2{X5l>xDVT&}X?^vWEgz8^}Ktu-ZWWp@7#0@(%_4Gmv{I;H&}s zL$Ssp_fWu6Ddmg+yxar=*uA>>) zabrjTfg2XzHtJS#m%!^U;WL*+pvOVunb;o72BYu9@(x;aYI~PYj=qPEbaUH&b(h5Y zA>x|kH2hs)N7}knp|*R{ zK_uy>bf=OoR4Pd>C*(eiam%GKH1E6iTI>JEJWu`Sd)NBb`>pk@Z>_!Gy?mxwI@8Rb zRap18Y1N}Lg`*bEFRX}~w~kH!c)uB{$H`HG|E)8bp~USonK+}zC(Y{~apDQKS=&e( z^pvr;FdLgXai&O5loRzNIVsMRp=otS+e+KwdU|qVPH8gbfTEIi(k{-VRHsN=gwnQP zJ++_&AaizMNt`)4laY4p8c-$e5Il80%{eD)iVi7jFYUC0Wb}0DpdDk;P8i-PZ+J%_ zEP@QD2QyIp)i!A-Qk_>K9b$neofVdzAq840XJ}{eb^&jfJl@Vgj<+(O%LE#OEcG|8f{}TOk#m`+Vs|?q1;T4Q~7m+!gEscSYd7z&Vq_?u)lGklg9(f%$gVsACdSd}!~nM$Xc4q;BY`#~T#<9i+Y^pL)C@cGMUVK%lItE}mfITqOdO-JIX5mNZJP_~!ix}b{pa+9%5zs>x z?L}XGpofWcDrfnKiQmoWG$YfDK5FDqgIb-A4qkfGlD>_OD6cV6gNAg8kI@BbgD(a@ z&a~1BI|gU=qfl#1$mA1Y5Hp#bK|+1f$dlNbc>n%_p~X=Lo4}`RTjaNHrjeN@l=IUT z`GTHhkuT|IEb>J?+ag!i&syLMdybL5;B>V;*PyuP*`Npdpz{stdjS`=Ab(-=4Y8{i z3<)5t@;TS23%JV4g+`_tU1Z7s;K`pi@xi*7fknuyvd!tx!2|WzBb!2~&Fo?*{AP3uL(vMM;LLu6+LR0R zS{TGojkc0dx0(1L-EL$%BfXyNY0FoJ@*PHYgkW#5m%;Fx(VYxND+Gfx`w?tMF4&u4 z5QAlRkx<_<@|MxJjl7*J`gbhyMgOivzUXT$@a(PEJFY+bxslI}eGc;0`-ermp_qU#EaJ0} zx89c)`KRYUE&2!gNcWXR{?_|f@Z_!cwMD#1dFy>+5pPo7df%R4Ap`Q(`!2Zh*884F z_u2~i!N?EXw;yeV{AA>(u*{#?#ZAL+M)z^kXoXFKGyAb=Kjk*<-(e6pt@SS?)c@E` z`;|1mnYfwmH?rU8s7OXd2wjaN@Fv~Q^U(daNNz(zdLBm8g;T(9M#n^$0~HBrop&mh!e7X1r|_l5BL9BybnxU!nbnw3pNaTjm>tP%mgKXMQ$F42 zL^21V)49!MHx>;)jGV`$&T_gR7{yJcuu2z2vMAE$ zBYB>|7o&^kVNsN9FKpI*NhC|qlFnc$eK-UBW^@^6Kr74u&g{nwmgHuzJU56l$gUux zu8d@5q%TDBLheAkXpuhzVo>voUG#9)#ivm=t{c;Mm;a)Zsr zd3YldJh$Ce@8o&WH_?=2n_gS@xk%rIz3}U%KN|B^@@cc(=GWxqBL#~;I-sUc$9Za5 z(os74)pde`M;UiO75^2v#NSZE9odBn?if;iFRAil^slepqysf5nI#L9af;0!3J?|FQAuU-z@ ze-G#@m&64=nH2lZpITp1_bWkl6}|_w$o7+d;bXwnu=hB^Yg{|d1jK#6@G+nY_BZh1 z72O}U{}?a;HeY~vJr9(A3hA$d@iAbC4AG%76xp~gy#8A8O{DJK6ZIyt%h_=bl2=_;L%qVxMY}SL}}jS1NW$at!o}9nyTVvBF$ytYU`{ zf6PFD%j0~-eFDkibM-Nk^gX&+ITZE`w4`SPD(-Rnu8Uv1JutVlLNURa{V1myxp!Si zZ#RhP%sx#*h31}x{rMls4&{wDJRZ_-ZnKTd&Z!q@Zy;ZGb1d?O2knhMUwZQ_a>WO& zjV@n)3yd5I=qeB@`x0Gfg9gdI2ql=D*T5E4lO;x`8-+l|w1Vzl2Hl;!lzLRIG;)SQ zTc&lBbu41OTKnXXN^J4)!cEgJ2mq1A2 z%>TMJ)x@cIe%XrWbw<{46W7BJn;2K8n+UPH0WIk!Zln)FLpWm-U*SAyg?Yl6{n*3} zxlMdE4C2%pZz7>?wkzFYWD8@y25r=o2cvwek*y)zHg+={elt+E2uCY~gERXPZfh>w z>tPVXHG=TnYV-{%=$%G(GTNI^&@Ib%8QB#gLG816L!IjebCnEjX zmd`#T`?#V14&?(i{7Xm!#Lzywsrb$4uiR8xVN>DEer)P5xlR2o4C1C92O<5771G#L z%4mgjZl+Mpqa&zg8ACa7JKAw#(8O!6JJj%4w4^5nLTn7KrT%cn;PHH`r4{A?XZB+b zV{>u>s@V^+Pg3aSv5`VAPlyycd16jZKqv$G%7Rb^@|6Xp4CE^d>KDjeZP3L4{%V_I zk-OO-h_O`2;0Zxa98jhAK~5w)8(K|wv^rAg zQFsKMJDnM*VFqgQGcetXMR&Jh2s(dvx21v=Ijo78jz*BI__D#>06(&h_xdNGbJHg) zH0z9<)`eyT@>&;~707E{XjUMvb)i{-yw;s%k=MGImJiXR^Hh8jh=RoVu zh;**iy7MBL$NHF0t=qCYWa$FTIjsu_lXeS%53-dB0lOkn2-nq-La?sMRVEZGkgrTARv=%QkgPzyG9g2OTxCL_0{F_@ zV3Dg#C{t7>^yupR%6yfTIiX2fnUI%rBZa7hOQ_7P5Ua_))T0s_u}~ol;SdBTL}7vM zWCC{PCjiaBt}rnqfbg~l>1Z1QCJoBi^i>&~ X`kx8GS({wml}(+xv1w(u-|GDrq@g^% diff --git a/src/wasm/Hacl_Hash_MD5.wasm b/src/wasm/Hacl_Hash_MD5.wasm index 16b8442342ef70b4d09ecf6759a06371ef87ef7e..c6c7b045a3db6d4a13da0847a3fc92289b2d17ca 100644 GIT binary patch delta 101 zcmdm2d8~57W@g6so3}96t8=byYG`0!VyY9GY@>Zgm{ULoTmGrz$C0770I(f|Me delta 93 zcmX?Bxvz4=W@g6co3}96t8*@IYG`0!VyY9IY@>aLpGiT~ktN5G5rnc7I5%tSh;a$t kX$C4`W2$4TXRPA}V#duuW}S@uj0)mNYWX+6Grz$C0FNLW>Hq)$ diff --git a/src/wasm/Hacl_Hash_SHA1.wasm b/src/wasm/Hacl_Hash_SHA1.wasm index 40ffd059753b1b103d46df0369d56d6cb98b7161..b345c0a6f97ec37aa1ff1b4c5e11524688ef9084 100644 GIT binary patch delta 102 zcmcbTb|-B^D>LKz&27x(9Go9I8X6dwnCeV7v+>BY2y-f0DljQnII`q8GJ;T+g5_ot tflMjESzSPNY)o}*^^A3TK+Lpxoz_7XVSYtx1x5ucB=y#t>-4WN0{|a^9J>Gj delta 94 zcmcbUb|q~?D>LKr&27x(9Gq`D8X6dwnCeV6v+>BY@G~h`II`q8GJ;T+0_SE6flMjE lXD diff --git a/src/wasm/Hacl_Hash_SHA3.wasm b/src/wasm/Hacl_Hash_SHA3.wasm index e318aff08a7d65bf76da26645fd115f889cc1e55..3243ec79e02b4b850f6427f46581ab175a85b6db 100644 GIT binary patch delta 1720 zcma)+J#Q015Qg{8KHoWZ9NQPjhwU(v4{Vb-wy_=Ci7)YnC;}lm{s0w{p{D|p0tpHv zq;2^DP=S;R_yHhMQBzS-fhZ^t6fm>5F&6|9ij>{ioqgt=_tyLIf%W!*^?cv4zkWZu z=wz+rmq!N&B5B|8)wRS!SH7_@1u6Axr`%3MT8d2}ASJCEn2HT)A}+^=QdDR$&C54O zkgkbHl4^R>dug16Nz8x^F-qYqoPrEyrNA6fauG_FBI||*O^v5aRIk=blNm@-eb$tR zJZmcZ;D?&>tSL{le1zsx#F~8d#Ko46(^T~oOyg;oz!}P&iR7N9$W%Txo~otEd{5s__mkQ#Jn*eVr9Lxgvk}juf5f{VbftGWE>M+`AsR_wv0i{a=yR z2v=Bp#>$rFrEvJ$RiL7Ms6sXLp~6KgRI3tES*3`5s2XKqlDJO}4+6>MCCRjfe_ z*Xi(jkRT&^@SXbZ&e-Y`c^fd5h|;5Zk^!u2)scND{H9xDI7Mi zNg~ce6IB5tK`B!x-r&6z%K!X|FP)*qLRzu*7{ z8XiCp!Uqf=5PT4U2NW?pFz_&m;llv8VGDO)8;4|?q=PbYkRxN-&Uk7dyo2)Cv|T#6 z8!>I0q7$ZFfD5=sX7MtcrbjkyPn)*OrtPvM^)fTF^zwk-KHI(%zpLLgbU;WUV>kJ* z6eCPP;^JKv2^AAw=qvDd`%LOQd(Xg1XhrT$f^>lvobf;mmd*se!fuhD4W$4ry~B!Nf;KTjJkM zP*d8a5k1`Ks&|fWxhgjoT=l>Mhj1~BLk!}K`(XtBH_pEM`%emR)pl#`@?XHO4cPf# Oo#3*$?$L|ZdhQo8ZZs_b delta 1538 zcmZWpJ#Q015Z$};*}n5f;+&ntiA`ogzHFStmjoM|*vS&GKva}eh=RsY@dNTvP*8x7 zmLCBB02E4uM2D0nR7m^*>PScwAi>PuVlG0qZg*y9-n{qjv?oukZ%?f^1J{1>^Z2Ga zZh7Bd93BeK-Y=^A$!A5d!I9P@`VTQ9KUtWCta|G$s}B=x^)6K?L@)qC{tTmmT&!?SE4A*%DA&81kS(= z&Vr@W!@nyX!0eMYJVww4?$6605;h=o-Rr>Ka5 zyeeLR3pfXJ>L?dD0HEOzFoFYy1A>DX98$z^XyBqE?GxfW%;80t#|83fks23cjSCbR zpDvEJ282&=QTwz+ZA&qq<|#Vo(=sgM3i-on_DQeo(~9(sm+YhI(s2wNR(RWge~Lw~)) z(U;hSrX~|Y7?Ei*nI_>iV|XD&OeQpBq9P{K4{?J?Y{CX^k;9j%@p7zjiy}j0bF?)e ze4;*POSh!J7WK7a7H?2=&f+$-@d{bXX|`CeZ1ELsaf>Z(X^X#P*PRY@w5l$2BUK%m zg&i8wiIMA4#HzZ6P*lVqUKg*zRosSc{TcS4r{Vh0kKlR?*CV)I46aWR!}SeZRK#$( zKJLIa?!pdA@YPpnxNwai)T_K!zeh-WG4(qXol}1uuHy|-&1qJzS5|*RtKVbwds_Xe zpH%Pj1@FTlU0Sxi@2c!XRox47$G`G&e(Kdxl=coJUon^jfhkC-v#?f597xNx5B~k6 z08c#+8>>EeAZV;VUZ6WqWcbd5B)zr-x{v_3B}C@T3{0yZQ`Nhk6p?}->oYwxqyclLSyhwRfoWM9k9%lPkauHTgR)jo>Gz8>32bbWdFhw7GcCeC)U zIE%CGQaP2u_@Cfd5|CUDaBjP0<^6|y?3k6E5w;^)vB!>#U;pm>Rig6Pl?!E&a))ql z0T(-24h=bhp#d)DT>BO&;S!m|xt!0IT_&X=izjjE=$MqjbuhD+gHBdoR6>jH?Q%sWVAIP*Ts; zp6>f>;9Bi&f$b$&vT`l=X19!Ju1dz0WVOkmwUK3Do!za9alme0^kh^$pd?}Fuw$K1uqQK^P zz?O0+cX_~;rUA=H0_#fvLzkbhWgf8Q+{eoeuob*QR&t-L;+4G0mD^N|$!cD$+8Vx% z*Ff|b3fnh%2pL)vW>T?b`Njmd!n)( zo!ed6!8;6`oxFuNy0QzXb{V+$@-DtND);ey=KB4(u+zZ3U*T@{;12L6-r~U>n4q#w zAD6nAOfHT%mJDK@4mz2sbqdXU@??msq4*Iz;6<>Thj_OMU=Qz+y*wntyqAYv*{5Pm zMtDTE{k)I&N96!I54iFmKWG3RcI#U8zOINm=% zl@VZJ>?k%DIc--?M6vM|Ir&#k@Y=kRm;$*fm-6&ss?!y_PaAh)u zgHpkTT%iaGc}j;BfWVGtLrm_lf(Wt_F;=F9n9o&}h)pMru>BU|q8F)csh3I(qcScN zXi|~GzLiXMvg8)NCHCc|y4Yvemq$2H_o6Bl0jXADOO1-4)T&^q<0`K9!qc5h!>jSa zYd}N8tM$TbL_@=?^TNaagk7xxyILc*v?lCl!Yv9+xLLy!p59?Cupy^;@wFnp*0lJh zLQ91wM$;ayz7ToFjHk2;i5=JI46=D&Wx0Vvm%+{>_5`8 zP$vq)Ww@RbnGiOmNCI)WovLqq6`~s%Ih9<4B^iHd5jE!4axGF&C-w0!7EyJifg3_5 zy$#anSkeT{O=*~IX#Nv5jZ0EWVr$2mZ#Iu}3%2!^sI(#~-8N_N42+2FJ-ctF_kWc% zUc;uCtt{?}>@Yt864Yo~1B4YCoHX_Emme=~3PV%aQP0Hhy4`u_+>e*(zeycCyw zR9pFO-WvP6U`2#?=rZ2PMX8Is(k)TNP{Qt&`}sb;-<1IsV=~Btstxe~4@KnxbUxt9 zZr*JkjXhYed(3j*i<*eKsKKCbr^|c2<-Rw$+yfTIMTq?-L|aW|7`B^S9v+u{-g-yb z^49x^#u|WT*1Hiw9+CZs`~V_9kRCbe+J5x-0UzXpD0)T74nC;s{SZIs_3$B0_5nq5 zz(cYR)o&3W9+x9dwjAZ7F?r8l_M?mntL8^_`5eW#N7I(iC^TL6qlhGBWPIk1%9z6v z=5So@p}MvRqY}=8qp&&(!x6T&PPu^i8RlsHPsC#c&c zcKv~(W}v7Jgl1|Wm_XM|xQT&$QynPclAItO)9L<+kpVerq%98{8I(tiWOWyd9XW)5K zJv9S2qa2(i5YPlk_J{{;Fb!wbS^U?lDKGbBg?NtmoCond@p&KOIRo*Wj)Z0kB24rW zAf8V^^i2)K^CYh*#0z@kg>;B7lj6SN%-z0g9_$`v_x|H80emj+b?stga@e}a2Nx<8R7|m1yU;R3GpW+pAvsc@)_|FxV;Xy5&n$a@p1W_ z`1AN9>*({`51$2JF2Mm${EqeXZ_F7o5%`M%ALlyBcd2~5;!MO!EB3h2B)qqjf}0kb z{FG{0Dpmx=`j!^S*GVp8hydPjAZ)zkKm_$YCuFVRAby5%t=r-s6*)*a}xvbi#i=jp{QuuJdr%_`F9;krEi6Xq$7wU~JrCq5ae z7o;jApc)ClnN2bQ1$ZUW6O?L`fHLoupav$oKzd?nK zgC2+=PI>Aze7rs&{6_QJWWt}O*Dbs!nVXuun_9e^@P3dCza<$yT7F#3|0{e%-yFIt zMSXp<=|2u12TB_LjA6WV2+thGiIR;YJM7FwJZl)2Onx0pX5#^B<2E}WbCf@s1F+t9 zoHi*T!SxPq!xkxRXwF66Ad{q{9h#=79r1a_oxZWYT+hNC^SE7b%)|wDJ>F(e3AoD^ z95@wnzG?NqW&yZKFZTj~6aO;X2Y~aY1b~Iys{r&h2Zk=>JiAktqOT7eZ5c1afXic_{Ia?i$4!Z`R`N0(YZO(6AlAVapqzq^fs@xm>X*V_-8tVI+Sck^bA zXfv8y5fNlEqJF)E?DczP6c*cjV~t36ihH{b9+;M~- z6i|2>Me4_R4F1EZ%r8u^bQl~1Bh_KX&^FW>jpR5Hy@vewd>tmo6XrV5CUk&TM+Rl-HiGdD+ zF%9x7ei)!!gM0x>00F$J%0(zPl-E?b1Vvvlz^Vp8wK{O{VhLE*QQm;92CQlj=h8>* zc@hE1x{6d|r{_Tp6jTc`ARtME5H&vysqu z|MmD6fBFy4-Q?u}bZR8@_h0?~TTBtUG!r+pD=}qWK0uukT?QyCPHFi2JkHllVQV2}ajSCFd8R0zd(DTMW57WVnoD!Y_;v65^k2B2*u8>Nu zl&ShbEB?d?dbX;VvSgTYjn+s0)M&k04=;47#lnUcksoYju6o*zGq{N-kZ3;g_j zbAV1|S3k)41Bt-8B7vXmZz{mb)6wT}|vCKP|DgT^0ca4mCxYB5^N^D+T`=noGiP&=^|@xw zI=K$hS?AALi;EB0cK&-L!AOIoUm(Qj0KKPkgig?fWPvmT27x#Y<}k(vV|++}EpZy88Su;x z_*~erJvLt37>v&aV`CfJtPhsmt=&zW*xs#5Qk6}mlG;?fRmo;6aV3>4$N66OKZnbd znAflS{jb0Gb^qP(?>_Zy&a>a59gF{dVu$iv9twY3-Nui4NKsBO zo3bg#F5$;KgulF?#a_-OFXeVwmhZouBS)+pPuPx3ia&NJdil?1FRBO^2eX1Xluvdr zJE(RBy*r1=rfGI1PY){i%cp7ShG~?Gh7u~_8I(&?$g*d!KV;Di@{dn&DY`4m8lbXZ z_R{QupcSwzvbdZ|$wD0*H&|9Q6roZF54#nmRy4*HRBm*t=*BZ;K{d=}i9hXB)8m&8 z+n4V=|EkCL&7%N6%@dvyvE${hmQN}Qdm<_v-+lgg{Q9eZ8z~A|;~_Q9Q)wzsqarS* zX;kd+bP*GRShN{5oo2+?k4nG8rBoX1zi@)fXet#sTn=RAj`$Eb6)~PkGj;ncG?azZ zghR9N8v@{vigG1_nkr~3nJC{6t_*q1WTlm=_~(WG_?aGGq?)RU#J-wqz*8-FstsBx zo)}cuYW6`A*HM+xU7z(-Bh>+_qrf;KTnyiA&kfgo?iAMHBn9&f+#c$t9u2pbBE5VAb#ouxKz$C+7cs#LXn|<`G@troJb=mphl3Q< za6;5e-3~7Vs)ZWvB3ej`VtgarsM{B#A*A6h7PvhI?h=|uy$0@*47i?13h!VNuP23f zslmI925FhbJ48dgoCbLXEvFR@uM{!Ct7w&It7#>zj`12)u5tJ#x=F)XOG7m1@H(Jc zr{UgA>*(efuc!6WzMVIqWv#}$LGUg!csJ5g8Zvk{X5h_A!QGUEiz;_E++yHvrcJb2 z!@ZSmDEytZCPEWrp)S4F;H}M1SH$>;qKMJyh>||S(nt96(TiRAxnCZ`8Z*fg_QgNF z`a&YSUmc8~UyBO~!ppV@n~OyFvC=>g7MnsWogEjB#jxhs!6_F`P*E@->U0$RP^Shf zL@hy~2I{n+E$R#^#zHh5t56A6pcz;u3#eQG6;N5X<%KBiw(LGgf4AjFv=xZ9A~RZO z-kmaP3QKl@)`o%Bw!}*X!it}|ToV8BN5083gV{WbX2sRHx{gY!3~7s5K{dj&;B;2d z8cHtLmC$4dsDvYNV~pbJt>TERb3S2%MR>VNgw53={9Ge~xRx06RkI;$n6Oc8*r-QA z*r+jV1W*t*Y7HA$nXsPKV?7ICF>Am|M${|-h?;~AqEI8~fShgEXvrF&mJBv#LQAtj zT1&IhB7@wL-chE0;zZj|zl71A;RzQ-JmE=^yl_^eIGi2H3g>)B&&H0EA1*=rq=@gz zuS4peJb5*kvj}x2)h6D)Q8nb&0ewBt2NG>Js_F<9XG1a8XbfB(KmAL`w4=*~y|YA-PfLX-r%zR>ihh@&XtH99j_N{=~I~s(SYT4TSXT zG9Zz8p+VS2_-TNHh%R>frXlm$2K@t)qA&n%r zpBH1^E}wW zuRe)LM@vIjKRx@ufB4arzxfcl7kXF%S{i~TZ`(5XUzQO}5f4!o_T*)WIeS!b>2g|* z&0z>8(&-BExJ;lgi+@p7lC_dn8qC-+4Ca-Bc_n#lw1#g2uC?&7HWL>#m*91@I<4s4$KmxD$n|aQ+wsI!0NeT?vHx;FyxhK=Xy>t%`)4lQe4SJT3 z>RCQUx6|EpyTk#Y#X%6rW$$M$7r`96uv3r){* zE&Q~P_an{&i1R>ZoP3b>qsAQsY;d#}*pn6XfXwnkbkNk$A))zzAUR-=?B&C>m<~sI zJeb21G!f^Q$`dDxl&>R9VMFkQOr8n!i%l=JQiq|*gOL-bW{bcUYH$0o;rdictbJm4kpqBheuVjm1!C;s+pdDRPloY9q@ikMvkv*!+PIgjBQTDROl-bNqDSBM-4;B4Daa_^Kor<4ObV~7) zih$!uy^x~t1PWfMiKAdk;fE;5>hqLD_!K_BQrX&rO7!#&2VlxKMb9V_yo6$rU0;Tjs(@@8c~PM>7230;gvLVD zVP-$4=s7d9pI7uedXt&`oCffm06;Mf04CA|0M939wreT?mOQWc1(@?0dGJgo<(8;v z#tX3epHU-0{2?05C6j2u2DG0MU&R)_T}(d4FDl?XtLUu3c}~$e7w1`x^Q?4-Vj3q* zqzO3BC2_i@;(PF%;+F*Hd3o@BCe9a?=xLyZ0DAuWKw$%*=i#h)G6wNwMK7B{d_~bK z?jXLbvArx^pqR!66X-ICuOtW2H5F_*uPA<1nO)&EMXxEdVZEmKbwT`wxO*cLae=6Y zME7C*&MQ>{H{#n_Y}Qn7`US7ip#)znt}HOGKy&iU;z94$TaO)1~#O zvvQ~+BWpwBZDN;M=bDvgBzx<8@{cQVs$?yu%26irq+e4;Y*mO2$1SO)HXq+KjCZKY zqIlM%PXGv;10wu5qNx)C>UHP={fo~65HMTX z@mXLVYBCQsn}=Em>AxFxbBX|z+{l`~OF(c72*|8+%^JT?08WF1fYwoNBcirZd`{Rn zzr&(iL~};bq!|VsbMb1lQ@icuj>NWcRXxy2oqC5yTNkxs{o{5NyTKY{Dj(^DCIodN zHgE)sd9JY>KeTZVb#gC`bn@+boCINcr(T4UQY z3|6xH5cNy<{V-jK?jcj%2cb##!BqG7+R(<*J>fee$cvF^6`(_(-NX2H;6Y?u_%c9u z%M#aix!vLDC)wR{S}Gov!gK|?gG_Zd1WmddN_Dr=H8zJWt7r)4M2mxYvLC<@r$wu2 zjXed&MXP1-*NX5mQg)d!H;eG&s0f011CEI>an|W6bF=epkx<{jRZbKT5lJ4DR>P9=J!YpB!t+_ua|5 zpZ19RJ#a4>K4i-MK4^k|U&{SK*I3*a<4kKGAHs8oF#zKqVXFhdUQJ|unJ%Q}PRlj7l&csP|Az)77q-yxN$FeHbLi$B|vJo*Wp zM?a~MBqLuomcvMf&7zagHHhq#^cG>Hv?uYbADOEz*pj_UjhB&`O2IM-Xy{w>Z*o-9 zOXRs7$mmZiQ(YOwQ5FvEkV_(Y4WI>Suh?5rd<&rA1xbYQJ#Ye9DjKq)_#i-a?iqy& zd=;FC_kU3mIivWzq8F7UU&F}u3}hr%lJntP0F)pX8m5<^*ic>*o*-8m#yRjIyO)tUT>z_C$Vt*u@G}x8RFLFNZ)0rT zJp;K^vUo{_&YgWS&)tVy%{6;dg&sWdr#G*>___&g; z>Nlhyi_(E31Ji*cCDMUk)zZ&BNUL<<$gswQAtY3gUPf*OX-j4W>1X6skiG zo>;U^HF>V9gs)yzY#*avy5K*9A^i%94BcOe@@psp_^(Cz3n(&lpNsOBP-N)75Jitz zPSEn@1eK4!RP-gpZxsCo;rDcGpoY)y3p&Q)k=(3P{%tl;L1@rUP6@aT7Ie#rdr{%M>xet<)+fn{7DHY>OfB zXrei|hoZUKsT@_d>qDFlVq8%%V96m)gF_wW5T_&K5U0wdUSIrYafcYPTv}B+)EVV2 z>Iy~H;11N{EY7AZ%9cCN>kom!Tu(UPW$<72sYg9|a*@ZCxVEfJ96SgH!51_B%yr%B zO}_YwcXA_{H+AXs(1$Z?m%KWp6Dg%0mvi+F2LLFb$!nkhHN=qa&DL=?Qls?R1in(w zG-o&EYv4M9O*ZTv6L;j=8LBr49$jyq(%9LPpqf&f85j;8m^(g}f$* zx(#{V8RXRpd9`wyZ|nQSd9bWAi%4|%-+3|w%3Y^4CAFa4UN;S4+TF#+14A2~m4z5xiT%|%x z$modHMIF=?!^q5)i_Cd6PY+oSNbk`@){CpvR;qW0tknV0`e?p4HDq23{er82d~4WZ z$v5EfT8D0ka-ZIzchAR(K9&{>LJyi2w$c1FA4#>v{Rq52GjOoJz+}wg6Dc??k5F>NZ$LRjm9-{$2!$JC46&tW187#tUkPN(e)%qeY3T+Uok4r`K3sQ@C7Dcc~7SE39V`av^-w zH=+jW%L*FHMNTvwP)!@&oo9_s$B{y2V$kxXnT*;Bvr zj*?hK(*IiVZc<1w(+OB@pagBgq%=(REtKr@>rw_$Wz7K~6fU&^#FBzR1Oe(%78>QC zf#z*_1+rmV%e3W>66?MfGujRuB^pBTkOFK@LN=G%(KZ8duCUZIIV%EGf zYxb|>Yn@#<>_$46XJi6qN$2i+!G6W_elRY(Cwk3S4Gb z&mv^P@_ur*Dk@V3)#)M!0qjyaFuXd1q#ES^73y&52sLVO&?Zl6E(C2bngu-y%P{Ei jgra8Pn>;}lb>xu-l(bAbRebz`K`pfWH!C|%na}zk=AmGM diff --git a/src/wasm/Hacl_P256.wasm b/src/wasm/Hacl_P256.wasm index 113d780fc88014d7bf47007aee3d6843061bec5e..83a71ab29e05334d2a59c1cdd3a5fc530097d357 100644 GIT binary patch delta 1427 zcmZWoOKcle6rDF7Pn?XKO#BJRaoT$u(k3*B#*Smhc5S~&n-aUYHcgtJTk-2hDH3I0 zW+D<(T7)Vzi&=Gnx=4kD6k#A6SRup)@!51iOB)HXMal*c3&ee6QyW#XY~T0p=bZD- z{phCmgPY#%x=;S|uf}!X+Lrd<-Su_JBbyc(wElPvWNff>Oag;+4Lo_K&lfoU7`YCEp(r8lnf0L4gCd}Cy zhV2jUgzevV^~Rmg|7O9TZxB7dY<63+DO=2(w$#SNZ{d&~;Al<{?WZULI4o)UB%rnGz|$Nx`eo=Jf(_!HYXT zjj(~yIrj>SP{b0H@D!XPVlEq!;6<)r8Opj3PdoSw8=kH}#gLlvRG~~yi)En{Jr4br z{yE~*qx6RI>7q&rYeQPf7Yk5Hwb zK$RA#()QlL0Z#@pPF0ALg{YC|*k)=quCEIjMD@nlcWbxQzU%Z)voa+n7 zVV=Mhs7;{*oS&kWCpa8y2L^C3>NrC?GgCL%H9QV8aC{R_zzLrJYPWmupL=hLHXY>-yJwfE0b%egvzE!8*No!|N6C_57R7uR|_Z2$lO delta 1476 zcmZWpO>Yxd6n)R0*v4bWj_m}AkmOttX;K=Bjj?NoB%UD<5(iRK67oSHfwlw_^$$=y zsEPX#RCO^D!>U!)MOKv}nUW1sS5>>J+C{~p5~kYy{i>V0E3G3w&Y%zbk|&OPtk z_vuEoFKO^X%Lt+Wu+AAgo=Tg&`*hvjsl|N;D1?yx)05ugVT28l7Xl$e z-ldSYz#pQh6%5hGn_;!RT1I$4h`d7)*_8=XE2odJW5m$L|8o><1yy;GArYVBGHsn=bVX` zaynK_b~#^+%2@5IZ~l_;7oTvSAy4Ii<*9fqS;<-c+SazIb(a)dmoWiejAkt>1h?=O ziiRvx(Ke2COk8pQ&@`rL1~YUOSD8qf#VpNX&JgD{%MdM)9Bs-qn#a5;OSAxq1ti9z zhv=FibzP@LEY?<^eMga<4;V{}r{ZNCJ}X!&ypS>&Q#j(#5x2*7`XdP>s2%Op0iS81 zqh{^=Xmdsdh&i2po_Cw5BNpXf`^ceHTU(r)E%X#LU-4pVtrMR-{aSNDdq695+g~cZE%&=7# z3SDQ(?HM<49XG19#Oy3pP5C}8V+qUabQ3p?k*`0dTezjjcpKNiYoCmFI0c{VBA4>n zzr@=H=w0_W-NtQN!3uMt(;eK=sf;oL%8mT+!LO#}d*?)-Jm_z?f_!lL_GF*@Oj84s zM3P0@`Dj4u=@e4+p-C#zlH5+RiLew~O3o=IXC9)ulfC;qQAp7#u9oJ2bW{I=t^MH% zvCz{m37y$v5AG?CSX~%6tHXqSl!75mZdis zSdIg7O~6jGwGS-Jz;gcsmQ%oT_U@4mZytHacun@E2Qlah3wZ@2&sp@F@sB(aXvpO`#bq=Xj}}ha+&ce RKjx}y?xnE(`$>5`@h=MxLyQ0b diff --git a/src/wasm/Hacl_Salsa20.wasm b/src/wasm/Hacl_Salsa20.wasm index 0df1cd7668501856c53e7f3dc0ecc229350021dc..c712bb36a95d3f9441da82d29d4899cfec4ae3b3 100644 GIT binary patch delta 1169 zcmeH_Jx{`55XYZZ&=@soLLo+t-Ysfkl*AAQCY}UZprxg}l@}RYfw;IEzJOCFH%2EV z;S2a}j0qpYJHT33XSVy_%kS=a$QWQqkrM)nQW;@!D^G^7VtFYp$!V~AJOtxfM3RDOQm-0lf(mJ3jVXn*ummQS z;RY*2sYEDcQp#uvDuw2n$PugrQ(cd1Xn_@IiSsKPY$>wT-{Po6I7|KxWs{20P&Q4N z4W7?V5@2H$s&D{lZSP2G=zznVj0^6H<1oh|juYXyq?qF}hnlUDcsbj}niS|!fhV={ z&ui4M4kmeG;l>SUP%$>4i7jYh8|usO5ZVm%q%uU0c1z`bLivAC9jK9q`tv(iL-P^4 z&{-+yGQ?+y&yd?5L3$C0Nh+L$aI6@|Wj!wI(K4xA9}0L!XBklWAhQ1*sr6a#8f&Tr0<_j#uzX8*D@;d+k delta 1173 zcmeH_IZne+5Qd*kh=f>VK?o6|m}yuFRs{+~ktY$`NxWrWoJ68^($S;b!8JV8dMfGSA#)@HVQVHsA(@}nl zsC#PLMh6_&gmZ0upLi~~GoA X@G^6;93VlHvK*j)576WbPgcJH4@C5$ diff --git a/src/wasm/INFO.txt b/src/wasm/INFO.txt index 7ed8e74a..60cb7b00 100644 --- a/src/wasm/INFO.txt +++ b/src/wasm/INFO.txt @@ -1,4 +1,4 @@ This code was generated with the following toolchain. -F* version: 155853a14336aa0713dba7db5408f4c8ab512a06 -KaRaMeL version: db63c1de17565be0ec4989f58532717a04e3ff40 +F* version: bc622701c668f6b4092760879372968265d4a4e1 +Karamel version: 7cffd27cfefbd220e986e561e8d350f043609f76 Vale version: 0.3.19 From 484a64f9dcdb18c0316d30d0b544d2787b8202d7 Mon Sep 17 00:00:00 2001 From: Paul-Nicolas Madelaine Date: Tue, 28 Nov 2023 21:07:31 +0100 Subject: [PATCH 7/7] update to HACL* ae5d839c2e1fa95055b618cda60aeb1c486c720c (#377) --------- Co-authored-by: Franziskus Kiefer --- .github/workflows/js.yml | 4 +- benchmarks/blake.cc | 137 +- benchmarks/chacha20poly1305.cc | 39 +- benchmarks/hmac.cc | 2 +- benchmarks/sha1.cc | 12 +- benchmarks/sha2.cc | 80 +- benchmarks/sha3.cc | 35 +- config/config.json | 28 +- config/default_config.cmake | 96 +- docs/reference/evercrypt/hash/index.md | 12 +- docs/reference/hacl/aead/chacha20poly1305.md | 18 +- docs/reference/hacl/hash/blake2/blake2b.md | 36 +- docs/reference/hacl/hash/blake2/blake2s.md | 36 +- docs/reference/hacl/hash/index.md | 10 +- docs/reference/hacl/hash/sha1.md | 14 +- docs/reference/hacl/hash/sha2.md | 64 +- docs/reference/hacl/hash/sha3.md | 24 +- include/EverCrypt_Chacha20Poly1305.h | 6 +- include/EverCrypt_HMAC.h | 5 +- include/EverCrypt_Hash.h | 64 +- include/EverCrypt_Poly1305.h | 8 +- include/Hacl_AEAD_Chacha20Poly1305.h | 104 ++ include/Hacl_AEAD_Chacha20Poly1305_Simd128.h | 104 ++ include/Hacl_AEAD_Chacha20Poly1305_Simd256.h | 104 ++ include/Hacl_Chacha20Poly1305_128.h | 107 -- include/Hacl_Chacha20Poly1305_256.h | 107 -- include/Hacl_Chacha20Poly1305_32.h | 107 -- include/Hacl_HMAC.h | 5 +- include/Hacl_HMAC_Blake2b_256.h | 2 +- include/Hacl_HMAC_Blake2s_128.h | 2 +- include/Hacl_HPKE_Curve51_CP128_SHA256.h | 2 +- include/Hacl_HPKE_Curve51_CP128_SHA512.h | 2 +- include/Hacl_HPKE_Curve51_CP256_SHA256.h | 2 +- include/Hacl_HPKE_Curve51_CP256_SHA512.h | 2 +- include/Hacl_HPKE_Curve51_CP32_SHA256.h | 2 +- include/Hacl_HPKE_Curve51_CP32_SHA512.h | 2 +- include/Hacl_HPKE_Curve64_CP128_SHA256.h | 2 +- include/Hacl_HPKE_Curve64_CP128_SHA512.h | 2 +- include/Hacl_HPKE_Curve64_CP256_SHA256.h | 2 +- include/Hacl_HPKE_Curve64_CP256_SHA512.h | 2 +- include/Hacl_HPKE_Curve64_CP32_SHA256.h | 2 +- include/Hacl_HPKE_Curve64_CP32_SHA512.h | 2 +- include/Hacl_HPKE_P256_CP128_SHA256.h | 2 +- include/Hacl_HPKE_P256_CP256_SHA256.h | 2 +- include/Hacl_HPKE_P256_CP32_SHA256.h | 2 +- include/Hacl_Hash_Blake2.h | 155 -- ...ming_Blake2b_256.h => Hacl_Hash_Blake2b.h} | 64 +- include/Hacl_Hash_Blake2b_Simd256.h | 113 ++ ...ming_Blake2s_128.h => Hacl_Hash_Blake2s.h} | 64 +- include/Hacl_Hash_Blake2s_Simd128.h | 112 ++ include/Hacl_Hash_MD5.h | 16 +- include/Hacl_Hash_SHA1.h | 16 +- include/Hacl_Hash_SHA2.h | 104 +- include/Hacl_Hash_SHA3.h | 50 +- include/Hacl_IntTypes_Intrinsics.h | 9 +- include/Hacl_IntTypes_Intrinsics_128.h | 7 +- ...ming_Poly1305_32.h => Hacl_MAC_Poly1305.h} | 33 +- ...1305_128.h => Hacl_MAC_Poly1305_Simd128.h} | 41 +- ...1305_256.h => Hacl_MAC_Poly1305_Simd256.h} | 41 +- include/Hacl_NaCl.h | 2 +- include/Hacl_Poly1305_256.h | 67 - include/Hacl_Poly1305_32.h | 57 - include/Hacl_Streaming_Blake2.h | 147 -- include/internal/EverCrypt_HMAC.h | 4 +- include/internal/EverCrypt_Hash.h | 6 +- include/internal/Hacl_Bignum.h | 36 +- include/internal/Hacl_Bignum25519_51.h | 345 ++-- include/internal/Hacl_Bignum_Base.h | 292 ++-- include/internal/Hacl_Bignum_K256.h | 322 ++-- include/internal/Hacl_Ed25519_PrecompTable.h | 1086 ++++++------ include/internal/Hacl_Frodo_KEM.h | 357 ++-- .../Hacl_HMAC.h} | 14 +- include/internal/Hacl_Hash_Blake2b.h | 70 + .../Hacl_Hash_Blake2b_Simd256.h} | 52 +- include/internal/Hacl_Hash_Blake2s.h | 70 + .../Hacl_Hash_Blake2s_Simd128.h} | 51 +- include/internal/Hacl_Hash_MD5.h | 17 +- include/internal/Hacl_Hash_SHA1.h | 17 +- include/internal/Hacl_Hash_SHA2.h | 138 +- include/internal/Hacl_Hash_SHA3.h | 4 +- include/internal/Hacl_Impl_Blake2_Constants.h | 50 +- include/internal/Hacl_Impl_FFDHE_Constants.h | 723 +++----- include/internal/Hacl_K256_PrecompTable.h | 816 ++++----- ...acl_Poly1305_128.h => Hacl_MAC_Poly1305.h} | 18 +- .../Hacl_MAC_Poly1305_Simd128.h} | 23 +- .../Hacl_MAC_Poly1305_Simd256.h} | 23 +- include/internal/Hacl_P256_PrecompTable.h | 776 ++++----- include/internal/Hacl_SHA2_Types.h | 56 +- include/msvc/EverCrypt_Chacha20Poly1305.h | 6 +- include/msvc/EverCrypt_HMAC.h | 5 +- include/msvc/EverCrypt_Hash.h | 64 +- include/msvc/EverCrypt_Poly1305.h | 8 +- include/msvc/Hacl_AEAD_Chacha20Poly1305.h | 104 ++ .../msvc/Hacl_AEAD_Chacha20Poly1305_Simd128.h | 104 ++ .../msvc/Hacl_AEAD_Chacha20Poly1305_Simd256.h | 104 ++ include/msvc/Hacl_Chacha20Poly1305_128.h | 107 -- include/msvc/Hacl_Chacha20Poly1305_256.h | 107 -- include/msvc/Hacl_Chacha20Poly1305_32.h | 107 -- include/msvc/Hacl_HMAC.h | 5 +- include/msvc/Hacl_HMAC_Blake2b_256.h | 2 +- include/msvc/Hacl_HMAC_Blake2s_128.h | 2 +- include/msvc/Hacl_HPKE_Curve51_CP128_SHA256.h | 2 +- include/msvc/Hacl_HPKE_Curve51_CP128_SHA512.h | 2 +- include/msvc/Hacl_HPKE_Curve51_CP256_SHA256.h | 2 +- include/msvc/Hacl_HPKE_Curve51_CP256_SHA512.h | 2 +- include/msvc/Hacl_HPKE_Curve51_CP32_SHA256.h | 2 +- include/msvc/Hacl_HPKE_Curve51_CP32_SHA512.h | 2 +- include/msvc/Hacl_HPKE_Curve64_CP128_SHA256.h | 2 +- include/msvc/Hacl_HPKE_Curve64_CP128_SHA512.h | 2 +- include/msvc/Hacl_HPKE_Curve64_CP256_SHA256.h | 2 +- include/msvc/Hacl_HPKE_Curve64_CP256_SHA512.h | 2 +- include/msvc/Hacl_HPKE_Curve64_CP32_SHA256.h | 2 +- include/msvc/Hacl_HPKE_Curve64_CP32_SHA512.h | 2 +- include/msvc/Hacl_HPKE_P256_CP128_SHA256.h | 2 +- include/msvc/Hacl_HPKE_P256_CP256_SHA256.h | 2 +- include/msvc/Hacl_HPKE_P256_CP32_SHA256.h | 2 +- include/msvc/Hacl_Hash_Blake2.h | 155 -- ...ming_Blake2b_256.h => Hacl_Hash_Blake2b.h} | 64 +- include/msvc/Hacl_Hash_Blake2b_Simd256.h | 113 ++ ...ming_Blake2s_128.h => Hacl_Hash_Blake2s.h} | 64 +- include/msvc/Hacl_Hash_Blake2s_Simd128.h | 112 ++ include/msvc/Hacl_Hash_MD5.h | 16 +- include/msvc/Hacl_Hash_SHA1.h | 16 +- include/msvc/Hacl_Hash_SHA2.h | 104 +- include/msvc/Hacl_Hash_SHA3.h | 50 +- include/msvc/Hacl_IntTypes_Intrinsics.h | 9 +- include/msvc/Hacl_IntTypes_Intrinsics_128.h | 7 +- .../Hacl_MAC_Poly1305.h} | 33 +- ...1305_128.h => Hacl_MAC_Poly1305_Simd128.h} | 41 +- .../Hacl_MAC_Poly1305_Simd256.h} | 41 +- include/msvc/Hacl_NaCl.h | 2 +- include/msvc/Hacl_Poly1305_128.h | 67 - include/msvc/Hacl_Poly1305_32.h | 57 - include/msvc/Hacl_Streaming_Blake2.h | 147 -- include/msvc/internal/EverCrypt_HMAC.h | 4 +- include/msvc/internal/EverCrypt_Hash.h | 6 +- include/msvc/internal/Hacl_Bignum.h | 36 +- include/msvc/internal/Hacl_Bignum25519_51.h | 345 ++-- include/msvc/internal/Hacl_Bignum_Base.h | 292 ++-- include/msvc/internal/Hacl_Bignum_K256.h | 322 ++-- .../msvc/internal/Hacl_Ed25519_PrecompTable.h | 1086 ++++++------ include/msvc/internal/Hacl_Frodo_KEM.h | 357 ++-- .../internal/Hacl_HMAC.h} | 14 +- include/msvc/internal/Hacl_Hash_Blake2b.h | 70 + .../Hacl_Hash_Blake2b_Simd256.h} | 52 +- include/msvc/internal/Hacl_Hash_Blake2s.h | 70 + .../internal/Hacl_Hash_Blake2s_Simd128.h} | 51 +- include/msvc/internal/Hacl_Hash_MD5.h | 17 +- include/msvc/internal/Hacl_Hash_SHA1.h | 17 +- include/msvc/internal/Hacl_Hash_SHA2.h | 138 +- include/msvc/internal/Hacl_Hash_SHA3.h | 4 +- .../internal/Hacl_Impl_Blake2_Constants.h | 50 +- .../msvc/internal/Hacl_Impl_FFDHE_Constants.h | 723 +++----- .../msvc/internal/Hacl_K256_PrecompTable.h | 816 ++++----- .../internal/Hacl_MAC_Poly1305.h} | 18 +- .../internal/Hacl_MAC_Poly1305_Simd128.h} | 27 +- .../Hacl_MAC_Poly1305_Simd256.h} | 27 +- .../msvc/internal/Hacl_P256_PrecompTable.h | 776 ++++----- include/msvc/internal/Hacl_SHA2_Types.h | 56 +- info.txt | 6 +- js/api.js | 6 +- js/api.json | 434 +++-- js/test.html | 2 +- js/test3.js | 11 +- karamel/include/krml/internal/builtin.h | 2 + karamel/include/krml/internal/target.h | 4 + .../dist/minimal/FStar_UInt128_Verified.h | 18 +- .../dist/minimal/FStar_UInt_8_16_32_64.h | 68 +- karamel/krmllib/dist/minimal/Makefile.basic | 56 + karamel/krmllib/dist/minimal/Makefile.include | 5 + karamel/krmllib/dist/minimal/libkrmllib.def | 11 + ocaml/Makefile | 9 +- ocaml/ctypes.depend | 150 +- ocaml/hacl-star-raw.opam | 4 +- ocaml/hacl-star/EverCrypt.ml | 13 +- ocaml/hacl-star/Hacl.ml | 93 +- ocaml/hacl-star/Hacl.mli | 14 +- ocaml/hacl-star/SharedDefs.ml | 3 +- ocaml/hacl-star/SharedFunctors.ml | 22 +- ocaml/hacl-star/tests/hash_test.ml | 8 +- ocaml/hacl-star/tests/poly1305_test.ml | 6 +- ocaml/lib/EverCrypt_HMAC_bindings.ml | 2 +- ocaml/lib/EverCrypt_Hash_bindings.ml | 50 +- ocaml/lib/EverCrypt_Poly1305_bindings.ml | 4 +- ...AEAD_Chacha20Poly1305_Simd128_bindings.ml} | 16 +- ...AEAD_Chacha20Poly1305_Simd256_bindings.ml} | 16 +- ...=> Hacl_AEAD_Chacha20Poly1305_bindings.ml} | 16 +- ocaml/lib/Hacl_Bignum_bindings.ml | 24 +- ocaml/lib/Hacl_HMAC_bindings.ml | 4 +- ocaml/lib/Hacl_Hash_Blake2_bindings.ml | 61 - ocaml/lib/Hacl_Hash_Blake2b_256_bindings.ml | 12 - .../lib/Hacl_Hash_Blake2b_Simd256_bindings.ml | 12 + ocaml/lib/Hacl_Hash_Blake2b_bindings.ml | 61 + ocaml/lib/Hacl_Hash_Blake2s_128_bindings.ml | 12 - .../lib/Hacl_Hash_Blake2s_Simd128_bindings.ml | 12 + ocaml/lib/Hacl_Hash_Blake2s_bindings.ml | 75 + ocaml/lib/Hacl_Hash_MD5_bindings.ml | 59 +- ocaml/lib/Hacl_Hash_SHA1_bindings.ml | 59 +- ocaml/lib/Hacl_Hash_SHA2_bindings.ml | 188 +-- ocaml/lib/Hacl_Hash_SHA3_bindings.ml | 163 +- .../lib/Hacl_MAC_Poly1305_Simd128_bindings.ml | 9 + .../lib/Hacl_MAC_Poly1305_Simd256_bindings.ml | 9 + ocaml/lib/Hacl_MAC_Poly1305_bindings.ml | 51 + ocaml/lib/Hacl_Poly1305_128_bindings.ml | 9 - ocaml/lib/Hacl_Poly1305_256_bindings.ml | 9 - ocaml/lib/Hacl_Poly1305_32_bindings.ml | 22 - ocaml/lib/Hacl_SHA2_Types_bindings.ml | 175 +- ocaml/lib/Hacl_Streaming_Blake2_bindings.ml | 90 - .../Hacl_Streaming_Poly1305_32_bindings.ml | 46 - .../Hacl_AEAD_Chacha20Poly1305_Simd128_gen.ml | 10 + .../Hacl_AEAD_Chacha20Poly1305_Simd256_gen.ml | 10 + .../lib_gen/Hacl_AEAD_Chacha20Poly1305_gen.ml | 10 + .../lib_gen/Hacl_Chacha20Poly1305_128_gen.ml | 10 - .../lib_gen/Hacl_Chacha20Poly1305_256_gen.ml | 10 - ocaml/lib_gen/Hacl_Chacha20Poly1305_32_gen.ml | 10 - ocaml/lib_gen/Hacl_HMAC_gen.ml | 3 +- ocaml/lib_gen/Hacl_Hash_Blake2_gen.ml | 11 - ocaml/lib_gen/Hacl_Hash_Blake2b_256_gen.ml | 10 - .../lib_gen/Hacl_Hash_Blake2b_Simd256_gen.ml | 11 + ocaml/lib_gen/Hacl_Hash_Blake2b_gen.ml | 11 + ocaml/lib_gen/Hacl_Hash_Blake2s_128_gen.ml | 10 - .../lib_gen/Hacl_Hash_Blake2s_Simd128_gen.ml | 11 + ocaml/lib_gen/Hacl_Hash_Blake2s_gen.ml | 11 + .../lib_gen/Hacl_MAC_Poly1305_Simd128_gen.ml | 11 + .../lib_gen/Hacl_MAC_Poly1305_Simd256_gen.ml | 11 + ocaml/lib_gen/Hacl_MAC_Poly1305_gen.ml | 11 + ocaml/lib_gen/Hacl_Poly1305_128_gen.ml | 11 - ocaml/lib_gen/Hacl_Poly1305_256_gen.ml | 11 - ocaml/lib_gen/Hacl_Poly1305_32_gen.ml | 10 - ocaml/lib_gen/Hacl_Streaming_Blake2_gen.ml | 10 - .../lib_gen/Hacl_Streaming_Poly1305_32_gen.ml | 10 - rust/hacl-sys/build.rs | 20 +- rust/hacl-sys/src/bindings/bindings.rs | 638 +++---- rust/hacl-sys/wrapper.h | 3 +- rust/src/digest.rs | 20 +- rust/src/hazmat/blake2.rs | 38 +- rust/src/hazmat/chacha20_poly1305.rs | 84 +- rust/src/hazmat/hmac.rs | 4 +- rust/src/hazmat/sha2.rs | 94 +- rust/src/hazmat/sha3.rs | 32 +- src/EverCrypt_AEAD.c | 1460 ++++++++--------- src/EverCrypt_AutoConfig2.c | 32 +- src/EverCrypt_Chacha20Poly1305.c | 28 +- src/EverCrypt_DRBG.c | 922 ++++++----- src/EverCrypt_HKDF.c | 156 +- src/EverCrypt_HMAC.c | 471 +++--- src/EverCrypt_Hash.c | 787 ++++----- src/EverCrypt_Poly1305.c | 46 +- ...1305_32.c => Hacl_AEAD_Chacha20Poly1305.c} | 301 ++-- ...c => Hacl_AEAD_Chacha20Poly1305_Simd128.c} | 460 +++--- ...c => Hacl_AEAD_Chacha20Poly1305_Simd256.c} | 457 +++--- src/Hacl_Bignum.c | 1428 ++++++++-------- src/Hacl_Bignum256.c | 996 +++++------ src/Hacl_Bignum256_32.c | 1103 ++++++------- src/Hacl_Bignum32.c | 299 ++-- src/Hacl_Bignum4096.c | 894 +++++----- src/Hacl_Bignum4096_32.c | 843 +++++----- src/Hacl_Bignum64.c | 299 ++-- src/Hacl_Chacha20.c | 97 +- src/Hacl_Chacha20_Vec128.c | 189 ++- src/Hacl_Chacha20_Vec256.c | 192 ++- src/Hacl_Chacha20_Vec32.c | 184 +-- src/Hacl_Curve25519_51.c | 197 ++- src/Hacl_Curve25519_64.c | 213 ++- src/Hacl_EC_Ed25519.c | 74 +- src/Hacl_EC_K256.c | 62 +- src/Hacl_Ed25519.c | 1217 +++++++------- src/Hacl_FFDHE.c | 152 +- src/Hacl_Frodo1344.c | 311 ++-- src/Hacl_Frodo64.c | 305 ++-- src/Hacl_Frodo640.c | 315 ++-- src/Hacl_Frodo976.c | 311 ++-- src/Hacl_Frodo_KEM.c | 2 +- src/Hacl_GenericField32.c | 199 ++- src/Hacl_GenericField64.c | 199 ++- src/Hacl_HKDF.c | 130 +- src/Hacl_HKDF_Blake2b_256.c | 34 +- src/Hacl_HKDF_Blake2s_128.c | 34 +- src/Hacl_HMAC.c | 476 +++--- src/Hacl_HMAC_Blake2b_256.c | 86 +- src/Hacl_HMAC_Blake2s_128.c | 74 +- src/Hacl_HMAC_DRBG.c | 730 ++++----- src/Hacl_HPKE_Curve51_CP128_SHA256.c | 753 ++++----- src/Hacl_HPKE_Curve51_CP128_SHA512.c | 753 ++++----- src/Hacl_HPKE_Curve51_CP256_SHA256.c | 753 ++++----- src/Hacl_HPKE_Curve51_CP256_SHA512.c | 753 ++++----- src/Hacl_HPKE_Curve51_CP32_SHA256.c | 753 ++++----- src/Hacl_HPKE_Curve51_CP32_SHA512.c | 753 ++++----- src/Hacl_HPKE_Curve64_CP128_SHA256.c | 753 ++++----- src/Hacl_HPKE_Curve64_CP128_SHA512.c | 753 ++++----- src/Hacl_HPKE_Curve64_CP256_SHA256.c | 753 ++++----- src/Hacl_HPKE_Curve64_CP256_SHA512.c | 753 ++++----- src/Hacl_HPKE_Curve64_CP32_SHA256.c | 753 ++++----- src/Hacl_HPKE_Curve64_CP32_SHA512.c | 753 ++++----- src/Hacl_HPKE_P256_CP128_SHA256.c | 761 ++++----- src/Hacl_HPKE_P256_CP256_SHA256.c | 761 ++++----- src/Hacl_HPKE_P256_CP32_SHA256.c | 761 ++++----- src/Hacl_Hash_Base.c | 76 +- src/Hacl_Hash_Blake2.c | 1324 --------------- src/Hacl_Hash_Blake2b.c | 971 +++++++++++ src/Hacl_Hash_Blake2b_256.c | 499 ------ src/Hacl_Hash_Blake2b_Simd256.c | 828 ++++++++++ src/Hacl_Hash_Blake2s.c | 931 +++++++++++ src/Hacl_Hash_Blake2s_128.c | 491 ------ src/Hacl_Hash_Blake2s_Simd128.c | 794 +++++++++ src/Hacl_Hash_MD5.c | 688 ++++---- src/Hacl_Hash_SHA1.c | 339 ++-- src/Hacl_Hash_SHA2.c | 932 +++++------ src/Hacl_Hash_SHA3.c | 508 +++--- src/Hacl_K256_ECDSA.c | 1335 ++++++++------- src/Hacl_MAC_Poly1305.c | 712 ++++++++ ...1305_128.c => Hacl_MAC_Poly1305_Simd128.c} | 1006 ++++++------ ...1305_256.c => Hacl_MAC_Poly1305_Simd256.c} | 1094 ++++++------ src/Hacl_NaCl.c | 92 +- src/Hacl_P256.c | 1090 ++++++------ src/Hacl_Poly1305_32.c | 572 ------- src/Hacl_RSAPSS.c | 388 ++--- src/Hacl_SHA2_Vec128.c | 384 ++--- src/Hacl_SHA2_Vec256.c | 848 +++++----- src/Hacl_Salsa20.c | 302 ++-- src/Hacl_Streaming_Blake2.c | 655 -------- src/Hacl_Streaming_Blake2b_256.c | 371 ----- src/Hacl_Streaming_Blake2s_128.c | 341 ---- src/Hacl_Streaming_Poly1305_128.c | 341 ---- src/Hacl_Streaming_Poly1305_256.c | 341 ---- src/Hacl_Streaming_Poly1305_32.c | 308 ---- src/msvc/EverCrypt_AEAD.c | 1460 ++++++++--------- src/msvc/EverCrypt_AutoConfig2.c | 32 +- src/msvc/EverCrypt_Chacha20Poly1305.c | 28 +- src/msvc/EverCrypt_DRBG.c | 922 ++++++----- src/msvc/EverCrypt_HKDF.c | 156 +- src/msvc/EverCrypt_HMAC.c | 471 +++--- src/msvc/EverCrypt_Hash.c | 787 ++++----- src/msvc/EverCrypt_Poly1305.c | 46 +- ...1305_32.c => Hacl_AEAD_Chacha20Poly1305.c} | 301 ++-- ...c => Hacl_AEAD_Chacha20Poly1305_Simd128.c} | 460 +++--- .../Hacl_AEAD_Chacha20Poly1305_Simd256.c} | 457 +++--- src/msvc/Hacl_Bignum.c | 1428 ++++++++-------- src/msvc/Hacl_Bignum256.c | 996 +++++------ src/msvc/Hacl_Bignum256_32.c | 1103 ++++++------- src/msvc/Hacl_Bignum32.c | 299 ++-- src/msvc/Hacl_Bignum4096.c | 894 +++++----- src/msvc/Hacl_Bignum4096_32.c | 843 +++++----- src/msvc/Hacl_Bignum64.c | 299 ++-- src/msvc/Hacl_Chacha20.c | 97 +- src/msvc/Hacl_Chacha20_Vec128.c | 189 ++- src/msvc/Hacl_Chacha20_Vec256.c | 192 ++- src/msvc/Hacl_Chacha20_Vec32.c | 184 +-- src/msvc/Hacl_Curve25519_51.c | 197 ++- src/msvc/Hacl_Curve25519_64.c | 213 ++- src/msvc/Hacl_EC_Ed25519.c | 74 +- src/msvc/Hacl_EC_K256.c | 62 +- src/msvc/Hacl_Ed25519.c | 1217 +++++++------- src/msvc/Hacl_FFDHE.c | 152 +- src/msvc/Hacl_Frodo1344.c | 311 ++-- src/msvc/Hacl_Frodo64.c | 305 ++-- src/msvc/Hacl_Frodo640.c | 315 ++-- src/msvc/Hacl_Frodo976.c | 311 ++-- src/msvc/Hacl_Frodo_KEM.c | 2 +- src/msvc/Hacl_GenericField32.c | 199 ++- src/msvc/Hacl_GenericField64.c | 199 ++- src/msvc/Hacl_HKDF.c | 130 +- src/msvc/Hacl_HKDF_Blake2b_256.c | 34 +- src/msvc/Hacl_HKDF_Blake2s_128.c | 34 +- src/msvc/Hacl_HMAC.c | 476 +++--- src/msvc/Hacl_HMAC_Blake2b_256.c | 86 +- src/msvc/Hacl_HMAC_Blake2s_128.c | 74 +- src/msvc/Hacl_HMAC_DRBG.c | 730 ++++----- src/msvc/Hacl_HPKE_Curve51_CP128_SHA256.c | 753 ++++----- src/msvc/Hacl_HPKE_Curve51_CP128_SHA512.c | 753 ++++----- src/msvc/Hacl_HPKE_Curve51_CP256_SHA256.c | 753 ++++----- src/msvc/Hacl_HPKE_Curve51_CP256_SHA512.c | 753 ++++----- src/msvc/Hacl_HPKE_Curve51_CP32_SHA256.c | 753 ++++----- src/msvc/Hacl_HPKE_Curve51_CP32_SHA512.c | 753 ++++----- src/msvc/Hacl_HPKE_Curve64_CP128_SHA256.c | 753 ++++----- src/msvc/Hacl_HPKE_Curve64_CP128_SHA512.c | 753 ++++----- src/msvc/Hacl_HPKE_Curve64_CP256_SHA256.c | 753 ++++----- src/msvc/Hacl_HPKE_Curve64_CP256_SHA512.c | 753 ++++----- src/msvc/Hacl_HPKE_Curve64_CP32_SHA256.c | 753 ++++----- src/msvc/Hacl_HPKE_Curve64_CP32_SHA512.c | 753 ++++----- src/msvc/Hacl_HPKE_P256_CP128_SHA256.c | 761 ++++----- src/msvc/Hacl_HPKE_P256_CP256_SHA256.c | 761 ++++----- src/msvc/Hacl_HPKE_P256_CP32_SHA256.c | 761 ++++----- src/msvc/Hacl_Hash_Base.c | 76 +- src/msvc/Hacl_Hash_Blake2.c | 1324 --------------- src/msvc/Hacl_Hash_Blake2b.c | 971 +++++++++++ src/msvc/Hacl_Hash_Blake2b_256.c | 499 ------ src/msvc/Hacl_Hash_Blake2b_Simd256.c | 828 ++++++++++ src/msvc/Hacl_Hash_Blake2s.c | 931 +++++++++++ src/msvc/Hacl_Hash_Blake2s_128.c | 491 ------ src/msvc/Hacl_Hash_Blake2s_Simd128.c | 794 +++++++++ src/msvc/Hacl_Hash_MD5.c | 688 ++++---- src/msvc/Hacl_Hash_SHA1.c | 339 ++-- src/msvc/Hacl_Hash_SHA2.c | 932 +++++------ src/msvc/Hacl_Hash_SHA3.c | 508 +++--- src/msvc/Hacl_K256_ECDSA.c | 1335 ++++++++------- src/msvc/Hacl_MAC_Poly1305.c | 712 ++++++++ .../Hacl_MAC_Poly1305_Simd128.c} | 1006 ++++++------ .../Hacl_MAC_Poly1305_Simd256.c} | 1094 ++++++------ src/msvc/Hacl_NaCl.c | 92 +- src/msvc/Hacl_P256.c | 1090 ++++++------ src/msvc/Hacl_Poly1305_32.c | 572 ------- src/msvc/Hacl_RSAPSS.c | 390 ++--- src/msvc/Hacl_SHA2_Vec128.c | 384 ++--- src/msvc/Hacl_SHA2_Vec256.c | 848 +++++----- src/msvc/Hacl_Salsa20.c | 302 ++-- src/msvc/Hacl_Streaming_Blake2.c | 655 -------- src/msvc/Hacl_Streaming_Blake2b_256.c | 371 ----- src/msvc/Hacl_Streaming_Blake2s_128.c | 341 ---- src/msvc/Hacl_Streaming_Poly1305_128.c | 341 ---- src/msvc/Hacl_Streaming_Poly1305_256.c | 341 ---- src/msvc/Hacl_Streaming_Poly1305_32.c | 308 ---- src/wasm/EverCrypt_Hash.wasm | Bin 49373 -> 49305 bytes ...2.wasm => Hacl_AEAD_Chacha20Poly1305.wasm} | Bin 7657 -> 7653 bytes .../Hacl_AEAD_Chacha20Poly1305_Simd128.wasm | Bin 0 -> 1910 bytes .../Hacl_AEAD_Chacha20Poly1305_Simd256.wasm | Bin 0 -> 1910 bytes src/wasm/Hacl_Bignum.wasm | Bin 78554 -> 74661 bytes src/wasm/Hacl_Bignum256.wasm | Bin 100226 -> 70325 bytes src/wasm/Hacl_Bignum256_32.wasm | Bin 41067 -> 32207 bytes src/wasm/Hacl_Bignum32.wasm | Bin 15248 -> 13286 bytes src/wasm/Hacl_Bignum4096.wasm | Bin 63810 -> 52302 bytes src/wasm/Hacl_Bignum4096_32.wasm | Bin 32319 -> 28696 bytes src/wasm/Hacl_Bignum64.wasm | Bin 24432 -> 14527 bytes ..._Chacha20_Vec128_Hacl_Chacha20_Vec256.wasm | Bin 0 -> 1845 bytes src/wasm/Hacl_Ed25519.wasm | Bin 77696 -> 77669 bytes src/wasm/Hacl_HMAC.wasm | Bin 29855 -> 29754 bytes src/wasm/Hacl_HMAC_Blake2b_256.wasm | Bin 1491 -> 1510 bytes src/wasm/Hacl_HMAC_Blake2s_128.wasm | Bin 1489 -> 1508 bytes src/wasm/Hacl_HMAC_DRBG.wasm | Bin 25403 -> 25396 bytes src/wasm/Hacl_HPKE_Curve51_CP32_SHA256.wasm | Bin 21306 -> 21320 bytes src/wasm/Hacl_HPKE_Curve51_CP32_SHA512.wasm | Bin 21434 -> 21448 bytes src/wasm/Hacl_Hash_Blake2.wasm | Bin 20644 -> 0 bytes src/wasm/Hacl_Hash_Blake2b.wasm | Bin 0 -> 15858 bytes src/wasm/Hacl_Hash_Blake2b_256.wasm | Bin 4552 -> 0 bytes src/wasm/Hacl_Hash_Blake2b_Simd256.wasm | Bin 0 -> 6794 bytes src/wasm/Hacl_Hash_Blake2s.wasm | Bin 0 -> 14005 bytes src/wasm/Hacl_Hash_Blake2s_128.wasm | Bin 3629 -> 0 bytes src/wasm/Hacl_Hash_Blake2s_Simd128.wasm | Bin 0 -> 5638 bytes src/wasm/Hacl_Hash_MD5.wasm | Bin 15558 -> 15447 bytes src/wasm/Hacl_Hash_SHA1.wasm | Bin 13148 -> 13044 bytes src/wasm/Hacl_Hash_SHA2.wasm | Bin 23682 -> 23468 bytes src/wasm/Hacl_Hash_SHA3.wasm | Bin 17611 -> 17565 bytes src/wasm/Hacl_Impl_Blake2_Constants.wasm | Bin 1544 -> 1517 bytes src/wasm/Hacl_K256_ECDSA.wasm | Bin 98193 -> 98188 bytes src/wasm/Hacl_MAC_Poly1305.wasm | Bin 0 -> 9539 bytes src/wasm/Hacl_NaCl.wasm | Bin 5027 -> 5020 bytes src/wasm/Hacl_P256.wasm | Bin 83213 -> 83198 bytes ..._Hacl_Poly1305_256_Hacl_Impl_Poly1305.wasm | Bin 0 -> 1993 bytes src/wasm/Hacl_Poly1305_32.wasm | Bin 6511 -> 0 bytes src/wasm/Hacl_Streaming_Blake2.wasm | Bin 12128 -> 0 bytes src/wasm/Hacl_Streaming_Blake2b_256.wasm | Bin 4495 -> 0 bytes src/wasm/Hacl_Streaming_Blake2s_128.wasm | Bin 4260 -> 0 bytes src/wasm/Hacl_Streaming_Poly1305_32.wasm | Bin 5365 -> 0 bytes src/wasm/INFO.txt | 4 +- src/wasm/layouts.json | 2 +- src/wasm/main.html | 2 +- src/wasm/shell.js | 2 +- tests/blake2b.cc | 75 +- tests/blake2s.cc | 76 +- tests/chacha20poly1305.cc | 74 +- tests/hmac.cc | 2 +- tests/k256_ecdsa.cc | 2 +- tests/md5.cc | 11 +- tests/poly1305.cc | 141 +- tests/sha1.cc | 36 +- tests/sha2.cc | 89 +- tests/sha3.cc | 49 +- 467 files changed, 51436 insertions(+), 60881 deletions(-) create mode 100644 include/Hacl_AEAD_Chacha20Poly1305.h create mode 100644 include/Hacl_AEAD_Chacha20Poly1305_Simd128.h create mode 100644 include/Hacl_AEAD_Chacha20Poly1305_Simd256.h delete mode 100644 include/Hacl_Chacha20Poly1305_128.h delete mode 100644 include/Hacl_Chacha20Poly1305_256.h delete mode 100644 include/Hacl_Chacha20Poly1305_32.h delete mode 100644 include/Hacl_Hash_Blake2.h rename include/{Hacl_Streaming_Blake2b_256.h => Hacl_Hash_Blake2b.h} (56%) create mode 100644 include/Hacl_Hash_Blake2b_Simd256.h rename include/{Hacl_Streaming_Blake2s_128.h => Hacl_Hash_Blake2s.h} (56%) create mode 100644 include/Hacl_Hash_Blake2s_Simd128.h rename include/{msvc/Hacl_Streaming_Poly1305_32.h => Hacl_MAC_Poly1305.h} (67%) rename include/{Hacl_Streaming_Poly1305_128.h => Hacl_MAC_Poly1305_Simd128.h} (67%) rename include/{msvc/Hacl_Streaming_Poly1305_256.h => Hacl_MAC_Poly1305_Simd256.h} (67%) delete mode 100644 include/Hacl_Poly1305_256.h delete mode 100644 include/Hacl_Poly1305_32.h delete mode 100644 include/Hacl_Streaming_Blake2.h rename include/{msvc/internal/Hacl_Hash_Blake2.h => internal/Hacl_HMAC.h} (82%) create mode 100644 include/internal/Hacl_Hash_Blake2b.h rename include/{Hacl_Hash_Blake2b_256.h => internal/Hacl_Hash_Blake2b_Simd256.h} (61%) create mode 100644 include/internal/Hacl_Hash_Blake2s.h rename include/{msvc/Hacl_Hash_Blake2s_128.h => internal/Hacl_Hash_Blake2s_Simd128.h} (61%) rename include/internal/{Hacl_Poly1305_128.h => Hacl_MAC_Poly1305.h} (77%) rename include/{msvc/internal/Hacl_Poly1305_128.h => internal/Hacl_MAC_Poly1305_Simd128.h} (73%) rename include/{msvc/internal/Hacl_Poly1305_256.h => internal/Hacl_MAC_Poly1305_Simd256.h} (73%) create mode 100644 include/msvc/Hacl_AEAD_Chacha20Poly1305.h create mode 100644 include/msvc/Hacl_AEAD_Chacha20Poly1305_Simd128.h create mode 100644 include/msvc/Hacl_AEAD_Chacha20Poly1305_Simd256.h delete mode 100644 include/msvc/Hacl_Chacha20Poly1305_128.h delete mode 100644 include/msvc/Hacl_Chacha20Poly1305_256.h delete mode 100644 include/msvc/Hacl_Chacha20Poly1305_32.h delete mode 100644 include/msvc/Hacl_Hash_Blake2.h rename include/msvc/{Hacl_Streaming_Blake2b_256.h => Hacl_Hash_Blake2b.h} (56%) create mode 100644 include/msvc/Hacl_Hash_Blake2b_Simd256.h rename include/msvc/{Hacl_Streaming_Blake2s_128.h => Hacl_Hash_Blake2s.h} (56%) create mode 100644 include/msvc/Hacl_Hash_Blake2s_Simd128.h rename include/{Hacl_Streaming_Poly1305_32.h => msvc/Hacl_MAC_Poly1305.h} (67%) rename include/msvc/{Hacl_Streaming_Poly1305_128.h => Hacl_MAC_Poly1305_Simd128.h} (67%) rename include/{Hacl_Streaming_Poly1305_256.h => msvc/Hacl_MAC_Poly1305_Simd256.h} (67%) delete mode 100644 include/msvc/Hacl_Poly1305_128.h delete mode 100644 include/msvc/Hacl_Poly1305_32.h delete mode 100644 include/msvc/Hacl_Streaming_Blake2.h rename include/{internal/Hacl_Hash_Blake2.h => msvc/internal/Hacl_HMAC.h} (82%) create mode 100644 include/msvc/internal/Hacl_Hash_Blake2b.h rename include/msvc/{Hacl_Hash_Blake2b_256.h => internal/Hacl_Hash_Blake2b_Simd256.h} (61%) create mode 100644 include/msvc/internal/Hacl_Hash_Blake2s.h rename include/{Hacl_Hash_Blake2s_128.h => msvc/internal/Hacl_Hash_Blake2s_Simd128.h} (61%) rename include/{internal/Hacl_Poly1305_256.h => msvc/internal/Hacl_MAC_Poly1305.h} (77%) rename include/{Hacl_Poly1305_128.h => msvc/internal/Hacl_MAC_Poly1305_Simd128.h} (72%) rename include/msvc/{Hacl_Poly1305_256.h => internal/Hacl_MAC_Poly1305_Simd256.h} (72%) create mode 100644 karamel/krmllib/dist/minimal/Makefile.basic create mode 100644 karamel/krmllib/dist/minimal/Makefile.include create mode 100644 karamel/krmllib/dist/minimal/libkrmllib.def rename ocaml/lib/{Hacl_Chacha20Poly1305_128_bindings.ml => Hacl_AEAD_Chacha20Poly1305_Simd128_bindings.ml} (58%) rename ocaml/lib/{Hacl_Chacha20Poly1305_256_bindings.ml => Hacl_AEAD_Chacha20Poly1305_Simd256_bindings.ml} (58%) rename ocaml/lib/{Hacl_Chacha20Poly1305_32_bindings.ml => Hacl_AEAD_Chacha20Poly1305_bindings.ml} (60%) delete mode 100644 ocaml/lib/Hacl_Hash_Blake2_bindings.ml delete mode 100644 ocaml/lib/Hacl_Hash_Blake2b_256_bindings.ml create mode 100644 ocaml/lib/Hacl_Hash_Blake2b_Simd256_bindings.ml create mode 100644 ocaml/lib/Hacl_Hash_Blake2b_bindings.ml delete mode 100644 ocaml/lib/Hacl_Hash_Blake2s_128_bindings.ml create mode 100644 ocaml/lib/Hacl_Hash_Blake2s_Simd128_bindings.ml create mode 100644 ocaml/lib/Hacl_Hash_Blake2s_bindings.ml create mode 100644 ocaml/lib/Hacl_MAC_Poly1305_Simd128_bindings.ml create mode 100644 ocaml/lib/Hacl_MAC_Poly1305_Simd256_bindings.ml create mode 100644 ocaml/lib/Hacl_MAC_Poly1305_bindings.ml delete mode 100644 ocaml/lib/Hacl_Poly1305_128_bindings.ml delete mode 100644 ocaml/lib/Hacl_Poly1305_256_bindings.ml delete mode 100644 ocaml/lib/Hacl_Poly1305_32_bindings.ml delete mode 100644 ocaml/lib/Hacl_Streaming_Blake2_bindings.ml delete mode 100644 ocaml/lib/Hacl_Streaming_Poly1305_32_bindings.ml create mode 100644 ocaml/lib_gen/Hacl_AEAD_Chacha20Poly1305_Simd128_gen.ml create mode 100644 ocaml/lib_gen/Hacl_AEAD_Chacha20Poly1305_Simd256_gen.ml create mode 100644 ocaml/lib_gen/Hacl_AEAD_Chacha20Poly1305_gen.ml delete mode 100644 ocaml/lib_gen/Hacl_Chacha20Poly1305_128_gen.ml delete mode 100644 ocaml/lib_gen/Hacl_Chacha20Poly1305_256_gen.ml delete mode 100644 ocaml/lib_gen/Hacl_Chacha20Poly1305_32_gen.ml delete mode 100644 ocaml/lib_gen/Hacl_Hash_Blake2_gen.ml delete mode 100644 ocaml/lib_gen/Hacl_Hash_Blake2b_256_gen.ml create mode 100644 ocaml/lib_gen/Hacl_Hash_Blake2b_Simd256_gen.ml create mode 100644 ocaml/lib_gen/Hacl_Hash_Blake2b_gen.ml delete mode 100644 ocaml/lib_gen/Hacl_Hash_Blake2s_128_gen.ml create mode 100644 ocaml/lib_gen/Hacl_Hash_Blake2s_Simd128_gen.ml create mode 100644 ocaml/lib_gen/Hacl_Hash_Blake2s_gen.ml create mode 100644 ocaml/lib_gen/Hacl_MAC_Poly1305_Simd128_gen.ml create mode 100644 ocaml/lib_gen/Hacl_MAC_Poly1305_Simd256_gen.ml create mode 100644 ocaml/lib_gen/Hacl_MAC_Poly1305_gen.ml delete mode 100644 ocaml/lib_gen/Hacl_Poly1305_128_gen.ml delete mode 100644 ocaml/lib_gen/Hacl_Poly1305_256_gen.ml delete mode 100644 ocaml/lib_gen/Hacl_Poly1305_32_gen.ml delete mode 100644 ocaml/lib_gen/Hacl_Streaming_Blake2_gen.ml delete mode 100644 ocaml/lib_gen/Hacl_Streaming_Poly1305_32_gen.ml rename src/{Hacl_Chacha20Poly1305_32.c => Hacl_AEAD_Chacha20Poly1305.c} (65%) rename src/{Hacl_Chacha20Poly1305_128.c => Hacl_AEAD_Chacha20Poly1305_Simd128.c} (77%) rename src/{msvc/Hacl_Chacha20Poly1305_256.c => Hacl_AEAD_Chacha20Poly1305_Simd256.c} (77%) delete mode 100644 src/Hacl_Hash_Blake2.c create mode 100644 src/Hacl_Hash_Blake2b.c delete mode 100644 src/Hacl_Hash_Blake2b_256.c create mode 100644 src/Hacl_Hash_Blake2b_Simd256.c create mode 100644 src/Hacl_Hash_Blake2s.c delete mode 100644 src/Hacl_Hash_Blake2s_128.c create mode 100644 src/Hacl_Hash_Blake2s_Simd128.c create mode 100644 src/Hacl_MAC_Poly1305.c rename src/{msvc/Hacl_Poly1305_128.c => Hacl_MAC_Poly1305_Simd128.c} (66%) rename src/{msvc/Hacl_Poly1305_256.c => Hacl_MAC_Poly1305_Simd256.c} (71%) delete mode 100644 src/Hacl_Poly1305_32.c delete mode 100644 src/Hacl_Streaming_Blake2.c delete mode 100644 src/Hacl_Streaming_Blake2b_256.c delete mode 100644 src/Hacl_Streaming_Blake2s_128.c delete mode 100644 src/Hacl_Streaming_Poly1305_128.c delete mode 100644 src/Hacl_Streaming_Poly1305_256.c delete mode 100644 src/Hacl_Streaming_Poly1305_32.c rename src/msvc/{Hacl_Chacha20Poly1305_32.c => Hacl_AEAD_Chacha20Poly1305.c} (65%) rename src/msvc/{Hacl_Chacha20Poly1305_128.c => Hacl_AEAD_Chacha20Poly1305_Simd128.c} (77%) rename src/{Hacl_Chacha20Poly1305_256.c => msvc/Hacl_AEAD_Chacha20Poly1305_Simd256.c} (77%) delete mode 100644 src/msvc/Hacl_Hash_Blake2.c create mode 100644 src/msvc/Hacl_Hash_Blake2b.c delete mode 100644 src/msvc/Hacl_Hash_Blake2b_256.c create mode 100644 src/msvc/Hacl_Hash_Blake2b_Simd256.c create mode 100644 src/msvc/Hacl_Hash_Blake2s.c delete mode 100644 src/msvc/Hacl_Hash_Blake2s_128.c create mode 100644 src/msvc/Hacl_Hash_Blake2s_Simd128.c create mode 100644 src/msvc/Hacl_MAC_Poly1305.c rename src/{Hacl_Poly1305_128.c => msvc/Hacl_MAC_Poly1305_Simd128.c} (66%) rename src/{Hacl_Poly1305_256.c => msvc/Hacl_MAC_Poly1305_Simd256.c} (71%) delete mode 100644 src/msvc/Hacl_Poly1305_32.c delete mode 100644 src/msvc/Hacl_Streaming_Blake2.c delete mode 100644 src/msvc/Hacl_Streaming_Blake2b_256.c delete mode 100644 src/msvc/Hacl_Streaming_Blake2s_128.c delete mode 100644 src/msvc/Hacl_Streaming_Poly1305_128.c delete mode 100644 src/msvc/Hacl_Streaming_Poly1305_256.c delete mode 100644 src/msvc/Hacl_Streaming_Poly1305_32.c rename src/wasm/{Hacl_Chacha20Poly1305_32.wasm => Hacl_AEAD_Chacha20Poly1305.wasm} (78%) create mode 100644 src/wasm/Hacl_AEAD_Chacha20Poly1305_Simd128.wasm create mode 100644 src/wasm/Hacl_AEAD_Chacha20Poly1305_Simd256.wasm create mode 100644 src/wasm/Hacl_Chacha20_Vec128_Hacl_Chacha20_Vec256.wasm delete mode 100644 src/wasm/Hacl_Hash_Blake2.wasm create mode 100644 src/wasm/Hacl_Hash_Blake2b.wasm delete mode 100644 src/wasm/Hacl_Hash_Blake2b_256.wasm create mode 100644 src/wasm/Hacl_Hash_Blake2b_Simd256.wasm create mode 100644 src/wasm/Hacl_Hash_Blake2s.wasm delete mode 100644 src/wasm/Hacl_Hash_Blake2s_128.wasm create mode 100644 src/wasm/Hacl_Hash_Blake2s_Simd128.wasm create mode 100644 src/wasm/Hacl_MAC_Poly1305.wasm create mode 100644 src/wasm/Hacl_Poly1305_128_Hacl_Poly1305_256_Hacl_Impl_Poly1305.wasm delete mode 100644 src/wasm/Hacl_Poly1305_32.wasm delete mode 100644 src/wasm/Hacl_Streaming_Blake2.wasm delete mode 100644 src/wasm/Hacl_Streaming_Blake2b_256.wasm delete mode 100644 src/wasm/Hacl_Streaming_Blake2s_128.wasm delete mode 100644 src/wasm/Hacl_Streaming_Poly1305_32.wasm diff --git a/.github/workflows/js.yml b/.github/workflows/js.yml index bddfc330..cdd803b9 100644 --- a/.github/workflows/js.yml +++ b/.github/workflows/js.yml @@ -18,7 +18,9 @@ jobs: - uses: actions/checkout@v3 - name: Setup - run: sudo apt-get install ninja-build nodejs + run: | + sudo apt-get update + sudo apt-get install ninja-build nodejs - name: Build JS bindings run: | diff --git a/benchmarks/blake.cc b/benchmarks/blake.cc index 91a77a03..19f7ed8a 100644 --- a/benchmarks/blake.cc +++ b/benchmarks/blake.cc @@ -7,19 +7,17 @@ */ #include "EverCrypt_Hash.h" -#include "Hacl_Hash_Blake2.h" -#include "Hacl_Streaming_Blake2.h" +#include "Hacl_Hash_Blake2b.h" +#include "Hacl_Hash_Blake2s.h" #include "util.h" #ifdef HACL_CAN_COMPILE_VEC128 -#include "Hacl_Hash_Blake2s_128.h" -#include "Hacl_Streaming_Blake2s_128.h" +#include "Hacl_Hash_Blake2s_Simd128.h" #endif #ifdef HACL_CAN_COMPILE_VEC256 -#include "Hacl_Hash_Blake2b_256.h" -#include "Hacl_Streaming_Blake2b_256.h" +#include "Hacl_Hash_Blake2b_Simd256.h" #endif #include "blake2.h" @@ -47,12 +45,9 @@ HACL_blake2b_32_oneshot(benchmark::State& state) bytes input(state.range(0), 0xAB); for (auto _ : state) { - Hacl_Blake2b_32_blake2b(digest2b.size(), - digest2b.data(), - input.size(), - (uint8_t*)input.data(), - 0, - NULL); + Hacl_Hash_Blake2b_hash_with_key( + digest2b.data(), digest2b.size(), (uint8_t*)input.data(), input.size(), + NULL, 0); } } @@ -70,12 +65,9 @@ HACL_blake2b_vec256_oneshot(benchmark::State& state) bytes input(state.range(0), 0xAB); for (auto _ : state) { - Hacl_Blake2b_256_blake2b(digest2b.size(), - digest2b.data(), - input.size(), - (uint8_t*)input.data(), - 0, - NULL); + Hacl_Hash_Blake2b_Simd256_hash_with_key( + digest2b.data(), digest2b.size(), (uint8_t*)input.data(), input.size(), + NULL, 0); } } @@ -89,9 +81,7 @@ EverCrypt_blake2b_oneshot(benchmark::State& state) for (auto _ : state) { EverCrypt_Hash_Incremental_hash(Spec_Hash_Definitions_Blake2B, - digest2b.data(), - input.data(), - input.size()); + digest2b.data(), input.data(), input.size()); } } @@ -113,12 +103,9 @@ static void HACL_blake2b_32_oneshot_keyed(benchmark::State& state) { for (auto _ : state) { - Hacl_Blake2b_32_blake2b(digest2b.size(), - digest2b.data(), - input.size(), - (uint8_t*)input.data(), - key.size(), - key.data()); + Hacl_Hash_Blake2b_hash_with_key( + digest2b.data(), digest2b.size(), (uint8_t*)input.data(), input.size(), + key.data(), key.size()); } } @@ -134,12 +121,9 @@ HACL_blake2b_vec256_oneshot_keyed(benchmark::State& state) } for (auto _ : state) { - Hacl_Blake2b_256_blake2b(digest2b.size(), - digest2b.data(), - input.size(), - (uint8_t*)input.data(), - key.size(), - key.data()); + Hacl_Hash_Blake2b_Simd256_hash_with_key( + digest2b.data(), digest2b.size(), (uint8_t*)input.data(), input.size(), + key.data(), key.size()); } } @@ -175,8 +159,8 @@ HACL_blake2s_32_oneshot(benchmark::State& state) bytes input(state.range(0), 0xAB); for (auto _ : state) { - Hacl_Blake2s_32_blake2s( - digest2s.size(), digest2s.data(), input.size(), input.data(), 0, NULL); + Hacl_Hash_Blake2s_hash_with_key( + digest2s.data(), digest2s.size(), input.data(), input.size(), NULL, 0); } } @@ -194,8 +178,8 @@ HACL_blake2s_vec128_oneshot(benchmark::State& state) bytes input(state.range(0), 0xAB); for (auto _ : state) { - Hacl_Blake2s_128_blake2s( - digest2s.size(), digest2s.data(), input.size(), input.data(), 0, NULL); + Hacl_Hash_Blake2s_Simd128_hash_with_key( + digest2s.data(), digest2s.size(), input.data(), input.size(), NULL, 0); } } @@ -209,9 +193,7 @@ EverCrypt_blake2s_oneshot(benchmark::State& state) for (auto _ : state) { EverCrypt_Hash_Incremental_hash(Spec_Hash_Definitions_Blake2S, - digest2s.data(), - input.data(), - input.size()); + digest2s.data(), input.data(), input.size()); } } @@ -233,12 +215,9 @@ static void HACL_blake2s_32_oneshot_keyed(benchmark::State& state) { for (auto _ : state) { - Hacl_Blake2s_32_blake2s(digest2s.size(), - digest2s.data(), - input.size(), - (uint8_t*)input.data(), - key.size(), - key.data()); + Hacl_Hash_Blake2s_hash_with_key( + digest2s.data(), digest2s.size(), (uint8_t*)input.data(), input.size(), + key.data(), key.size()); } } @@ -254,12 +233,9 @@ HACL_blake2s_vec128_oneshot_keyed(benchmark::State& state) } for (auto _ : state) { - Hacl_Blake2s_128_blake2s(digest2s.size(), - digest2s.data(), - input.size(), - (uint8_t*)input.data(), - key.size(), - key.data()); + Hacl_Hash_Blake2s_Simd128_hash_with_key( + digest2s.data(), digest2s.size(), (uint8_t*)input.data(), input.size(), + key.data(), key.size()); } } @@ -295,19 +271,18 @@ HACL_blake2b_32_streaming(benchmark::State& state) uint8_t digest[HACL_HASH_BLAKE2B_DIGEST_LENGTH_MAX]; // Init - Hacl_Streaming_Blake2_blake2b_32_state_s* ctx = - Hacl_Streaming_Blake2_blake2b_32_no_key_create_in(); - Hacl_Streaming_Blake2_blake2b_32_no_key_init(ctx); + Hacl_Hash_Blake2b_state_t* ctx = + Hacl_Hash_Blake2b_malloc(); // Update for (auto chunk : chunk(input, chunk_len)) { - Hacl_Streaming_Blake2_blake2b_32_no_key_update( + Hacl_Hash_Blake2b_update( ctx, (uint8_t*)chunk.data(), chunk.size()); } // Finish - Hacl_Streaming_Blake2_blake2b_32_no_key_finish(ctx, digest); - Hacl_Streaming_Blake2_blake2b_32_no_key_free(ctx); + Hacl_Hash_Blake2b_digest(ctx, digest); + Hacl_Hash_Blake2b_free(ctx); } } @@ -348,19 +323,18 @@ HACL_blake2b_vec256_streaming(benchmark::State& state) uint8_t digest[HACL_HASH_BLAKE2B_DIGEST_LENGTH_MAX]; // Init - Hacl_Streaming_Blake2b_256_blake2b_256_state_s* ctx = - Hacl_Streaming_Blake2b_256_blake2b_256_no_key_create_in(); - Hacl_Streaming_Blake2b_256_blake2b_256_no_key_init(ctx); + Hacl_Hash_Blake2b_Simd256_state_t* ctx = + Hacl_Hash_Blake2b_Simd256_malloc(); // Update for (auto chunk : chunk(input, chunk_len)) { - Hacl_Streaming_Blake2b_256_blake2b_256_no_key_update( + Hacl_Hash_Blake2b_Simd256_update( ctx, (uint8_t*)chunk.data(), chunk.size()); } // Finish - Hacl_Streaming_Blake2b_256_blake2b_256_no_key_finish(ctx, digest); - Hacl_Streaming_Blake2b_256_blake2b_256_no_key_free(ctx); + Hacl_Hash_Blake2b_Simd256_digest(ctx, digest); + Hacl_Hash_Blake2b_Simd256_free(ctx); } } @@ -374,9 +348,8 @@ EverCrypt_blake2b_streaming(benchmark::State& state) uint8_t digest[HACL_HASH_BLAKE2B_DIGEST_LENGTH_MAX]; // Init - EverCrypt_Hash_Incremental_hash_state_s* ctx = - EverCrypt_Hash_Incremental_create_in(Spec_Hash_Definitions_Blake2B); - EverCrypt_Hash_Incremental_init(ctx); + EverCrypt_Hash_Incremental_state_t* ctx = + EverCrypt_Hash_Incremental_malloc(Spec_Hash_Definitions_Blake2B); // Update for (auto chunk : chunk(input, chunk_len)) { @@ -384,7 +357,7 @@ EverCrypt_blake2b_streaming(benchmark::State& state) } // Finish - EverCrypt_Hash_Incremental_finish(ctx, digest); + EverCrypt_Hash_Incremental_digest(ctx, digest); EverCrypt_Hash_Incremental_free(ctx); } } @@ -411,19 +384,16 @@ HACL_blake2s_32_streaming(benchmark::State& state) uint8_t digest[HACL_HASH_BLAKE2S_DIGEST_LENGTH_MAX]; // Init - Hacl_Streaming_Blake2_blake2s_32_state_s* ctx = - Hacl_Streaming_Blake2_blake2s_32_no_key_create_in(); - Hacl_Streaming_Blake2_blake2s_32_no_key_init(ctx); + Hacl_Hash_Blake2s_state_t* ctx = Hacl_Hash_Blake2s_malloc(); // Update for (auto chunk : chunk(input, chunk_len)) { - Hacl_Streaming_Blake2_blake2s_32_no_key_update( - ctx, (uint8_t*)chunk.data(), chunk.size()); + Hacl_Hash_Blake2s_update(ctx, (uint8_t*)chunk.data(), chunk.size()); } // Finish - Hacl_Streaming_Blake2_blake2s_32_no_key_finish(ctx, digest); - Hacl_Streaming_Blake2_blake2s_32_no_key_free(ctx); + Hacl_Hash_Blake2s_digest(ctx, digest); + Hacl_Hash_Blake2s_free(ctx); } } @@ -464,19 +434,17 @@ HACL_blake2s_vec128_streaming(benchmark::State& state) uint8_t digest[HACL_HASH_BLAKE2S_DIGEST_LENGTH_MAX]; // Init - Hacl_Streaming_Blake2s_128_blake2s_128_state_s* ctx = - Hacl_Streaming_Blake2s_128_blake2s_128_no_key_create_in(); - Hacl_Streaming_Blake2s_128_blake2s_128_no_key_init(ctx); + Hacl_Hash_Blake2s_Simd128_state_t* ctx = Hacl_Hash_Blake2s_Simd128_malloc(); // Update for (auto chunk : chunk(input, chunk_len)) { - Hacl_Streaming_Blake2s_128_blake2s_128_no_key_update( + Hacl_Hash_Blake2s_Simd128_update( ctx, (uint8_t*)chunk.data(), chunk.size()); } // Finish - Hacl_Streaming_Blake2s_128_blake2s_128_no_key_finish(ctx, digest); - Hacl_Streaming_Blake2s_128_blake2s_128_no_key_free(ctx); + Hacl_Hash_Blake2s_Simd128_digest(ctx, digest); + Hacl_Hash_Blake2s_Simd128_free(ctx); } } @@ -490,9 +458,8 @@ EverCrypt_blake2s_streaming(benchmark::State& state) uint8_t digest[HACL_HASH_BLAKE2S_DIGEST_LENGTH_MAX]; // Init - EverCrypt_Hash_Incremental_hash_state_s* ctx = - EverCrypt_Hash_Incremental_create_in(Spec_Hash_Definitions_Blake2S); - EverCrypt_Hash_Incremental_init(ctx); + EverCrypt_Hash_Incremental_state_t* ctx = + EverCrypt_Hash_Incremental_malloc(Spec_Hash_Definitions_Blake2S); // Update for (auto chunk : chunk(input, chunk_len)) { @@ -500,7 +467,7 @@ EverCrypt_blake2s_streaming(benchmark::State& state) } // Finish - EverCrypt_Hash_Incremental_finish(ctx, digest); + EverCrypt_Hash_Incremental_digest(ctx, digest); EverCrypt_Hash_Incremental_free(ctx); } } diff --git a/benchmarks/chacha20poly1305.cc b/benchmarks/chacha20poly1305.cc index ee01f721..998ab022 100644 --- a/benchmarks/chacha20poly1305.cc +++ b/benchmarks/chacha20poly1305.cc @@ -6,12 +6,12 @@ * - http://opensource.org/licenses/MIT */ -#include "Hacl_Chacha20Poly1305_32.h" +#include "Hacl_AEAD_Chacha20Poly1305.h" #ifdef HACL_CAN_COMPILE_VEC128 -#include "Hacl_Chacha20Poly1305_128.h" +#include "Hacl_AEAD_Chacha20Poly1305_Simd128.h" #endif #ifdef HACL_CAN_COMPILE_VEC256 -#include "Hacl_Chacha20Poly1305_256.h" +#include "Hacl_AEAD_Chacha20Poly1305_Simd256.h" #endif #include "EverCrypt_AEAD.h" @@ -112,14 +112,9 @@ static void HACL_Chacha20Poly1305_32_encrypt(benchmark::State& state) { for (auto _ : state) { - Hacl_Chacha20Poly1305_32_aead_encrypt(key.data(), - nonce.data(), - aad.size(), - aad.data(), - INPUT_LEN, - plaintext.data(), - ciphertext.data(), - mac.data()); + Hacl_AEAD_Chacha20Poly1305_encrypt( + ciphertext.data(), mac.data(), plaintext.data(), INPUT_LEN, + aad.data(), aad.size(), key.data(), nonce.data()); } if (ciphertext != expected_ciphertext) { @@ -139,14 +134,9 @@ HACL_Chacha20Poly1305_Vec128_encrypt(benchmark::State& state) } for (auto _ : state) { - Hacl_Chacha20Poly1305_128_aead_decrypt(key.data(), - nonce.data(), - aad.size(), - aad.data(), - INPUT_LEN, - plaintext.data(), - ciphertext.data(), - mac.data()); + Hacl_AEAD_Chacha20Poly1305_Simd128_decrypt( + plaintext.data(), ciphertext.data(), INPUT_LEN, aad.data(), + aad.size(), key.data(), nonce.data(), mac.data()); } if (ciphertext != expected_ciphertext) { @@ -167,14 +157,9 @@ HACL_Chacha20Poly1305_Vec256_encrypt(benchmark::State& state) } for (auto _ : state) { - Hacl_Chacha20Poly1305_256_aead_encrypt(key.data(), - nonce.data(), - aad.size(), - aad.data(), - INPUT_LEN, - plaintext.data(), - ciphertext.data(), - mac.data()); + Hacl_AEAD_Chacha20Poly1305_Simd256_encrypt( + ciphertext.data(), mac.data(), plaintext.data(), INPUT_LEN, + aad.data(), aad.size(), key.data(), nonce.data()); } if (ciphertext != expected_ciphertext) { diff --git a/benchmarks/hmac.cc b/benchmarks/hmac.cc index 61dec7a8..dc4d950f 100644 --- a/benchmarks/hmac.cc +++ b/benchmarks/hmac.cc @@ -131,7 +131,7 @@ BENCHMARK_CAPTURE( sha1, from_hex("7DD9CDC17DD7C7CD4B1D39C13FA7E511354CC6EB7F5BEB07ED2D353E138A9428"), HACL_MAC_HMAC_SHA1_TAG_LEN, - Hacl_HMAC_legacy_compute_sha1) + Hacl_HMAC_compute_sha1) ->Setup(DoSetup) ->Arg(4096); diff --git a/benchmarks/sha1.cc b/benchmarks/sha1.cc index 1b0ac299..87428664 100644 --- a/benchmarks/sha1.cc +++ b/benchmarks/sha1.cc @@ -16,7 +16,7 @@ HACL_Sha1_oneshot(benchmark::State& state) bytes digest(HACL_HASH_SHA1_DIGEST_LENGTH, 0); for (auto _ : state) { - Hacl_Streaming_SHA1_legacy_hash(input.data(), input.size(), digest.data()); + Hacl_Hash_SHA1_hash(digest.data(), input.data(), input.size()); } if (digest != expected_digest) { @@ -55,20 +55,18 @@ HACL_Sha1_streaming(benchmark::State& state) for (auto _ : state) { // Init - Hacl_Streaming_SHA1_state* state = - Hacl_Streaming_SHA1_legacy_create_in(); - Hacl_Streaming_SHA1_legacy_init(state); + Hacl_Hash_SHA1_state_t* state = Hacl_Hash_SHA1_malloc(); // Update for (size_t i = 0; i < input.size();) { - Hacl_Streaming_SHA1_legacy_update( + Hacl_Hash_SHA1_update( state, input.data() + i, min(chunk_len, input.size() - i)); i += chunk_len; } // Finish - Hacl_Streaming_SHA1_legacy_finish(state, digest.data()); - Hacl_Streaming_SHA1_legacy_free(state); + Hacl_Hash_SHA1_digest(state, digest.data()); + Hacl_Hash_SHA1_free(state); } if (digest != expected_digest) { diff --git a/benchmarks/sha2.cc b/benchmarks/sha2.cc index f41933b8..7a862761 100644 --- a/benchmarks/sha2.cc +++ b/benchmarks/sha2.cc @@ -9,11 +9,11 @@ #include "Hacl_Hash_SHA2.h" #ifdef HACL_CAN_COMPILE_VEC128 -#include "Hacl_Hash_Blake2s_128.h" +#include "Hacl_Hash_Blake2s_Simd128.h" #endif #ifdef HACL_CAN_COMPILE_VEC256 -#include "Hacl_Hash_Blake2b_256.h" +#include "Hacl_Hash_Blake2b_Simd256.h" #endif #include "util.h" @@ -47,13 +47,13 @@ HACL_Sha2_oneshot(benchmark::State& state, Args&&... args) auto expected_digest = std::get<1>(args_tuple); auto hash = std::get<2>(args_tuple); - bytes digest(digest_len, 0); + bytes output(digest_len, 0); for (auto _ : state) { - hash((uint8_t*)input.data(), input.size(), digest.data()); + hash(output.data(), (uint8_t*)input.data(), input.size()); } - if (digest != expected_digest) { + if (output != expected_digest) { state.SkipWithError("Incorrect digest."); return; } @@ -90,18 +90,17 @@ HACL_Sha2_streaming(benchmark::State& state, Args&&... args) auto digest_len = std::get<0>(args_tuple); auto expected_digest = std::get<1>(args_tuple); - auto create_in = std::get<2>(args_tuple); - auto init = std::get<3>(args_tuple); + auto malloc = std::get<2>(args_tuple); + //auto reset = std::get<3>(args_tuple); auto update = std::get<4>(args_tuple); - auto finish = std::get<5>(args_tuple); + auto digest = std::get<5>(args_tuple); auto free = std::get<6>(args_tuple); - bytes digest(digest_len, 0); + bytes output(digest_len, 0); for (auto _ : state) { // Init - auto* ctx = create_in(); - init(ctx); + auto* ctx = malloc(); // Update for (auto chunk : chunk(input, chunk_len)) { @@ -109,11 +108,11 @@ HACL_Sha2_streaming(benchmark::State& state, Args&&... args) } // Finish - finish(ctx, digest.data()); + digest(ctx, output.data()); free(ctx); } - if (digest != expected_digest) { + if (output != expected_digest) { state.SkipWithError("Incorrect digest."); return; } @@ -133,9 +132,8 @@ EverCrypt_Sha2_streaming(benchmark::State& state, Args&&... args) for (auto _ : state) { // Init - EverCrypt_Hash_Incremental_hash_state* ctx = - EverCrypt_Hash_Incremental_create_in(algorithm); - EverCrypt_Hash_Incremental_init(ctx); + EverCrypt_Hash_Incremental_state_t* ctx = + EverCrypt_Hash_Incremental_malloc(algorithm); // Update for (auto chunk : chunk(input, chunk_len)) { @@ -143,7 +141,7 @@ EverCrypt_Sha2_streaming(benchmark::State& state, Args&&... args) } // Finish - EverCrypt_Hash_Incremental_finish(ctx, digest.data()); + EverCrypt_Hash_Incremental_digest(ctx, digest.data()); EverCrypt_Hash_Incremental_free(ctx); } @@ -159,7 +157,7 @@ BENCHMARK_CAPTURE(HACL_Sha2_oneshot, sha2_224, HACL_HASH_SHA2_224_DIGEST_LENGTH, expected_digest_sha2_224, - Hacl_Streaming_SHA2_hash_224) + Hacl_Hash_SHA2_hash_224) ->Setup(DoSetup); BENCHMARK_CAPTURE(EverCrypt_Sha2_oneshot, @@ -182,7 +180,7 @@ BENCHMARK_CAPTURE(HACL_Sha2_oneshot, sha2_256, HACL_HASH_SHA2_256_DIGEST_LENGTH, expected_digest_sha2_256, - Hacl_Streaming_SHA2_hash_256) + Hacl_Hash_SHA2_hash_256) ->Setup(DoSetup); BENCHMARK_CAPTURE(EverCrypt_Sha2_oneshot, @@ -205,7 +203,7 @@ BENCHMARK_CAPTURE(HACL_Sha2_oneshot, sha2_384, HACL_HASH_SHA2_384_DIGEST_LENGTH, expected_digest_sha2_384, - Hacl_Streaming_SHA2_hash_384) + Hacl_Hash_SHA2_hash_384) ->Setup(DoSetup); BENCHMARK_CAPTURE(EverCrypt_Sha2_oneshot, @@ -228,7 +226,7 @@ BENCHMARK_CAPTURE(HACL_Sha2_oneshot, sha2_512, HACL_HASH_SHA2_512_DIGEST_LENGTH, expected_digest_sha2_512, - Hacl_Streaming_SHA2_hash_512) + Hacl_Hash_SHA2_hash_512) ->Setup(DoSetup); BENCHMARK_CAPTURE(EverCrypt_Sha2_oneshot, @@ -253,11 +251,11 @@ BENCHMARK_CAPTURE(HACL_Sha2_streaming, sha2_224, HACL_HASH_SHA2_224_DIGEST_LENGTH, expected_digest_sha2_224, - Hacl_Streaming_SHA2_create_in_224, - Hacl_Streaming_SHA2_init_224, - Hacl_Streaming_SHA2_update_224, - Hacl_Streaming_SHA2_finish_224, - Hacl_Streaming_SHA2_free_224) + Hacl_Hash_SHA2_malloc_224, + Hacl_Hash_SHA2_reset_224, + Hacl_Hash_SHA2_update_224, + Hacl_Hash_SHA2_digest_224, + Hacl_Hash_SHA2_free_224) ->Setup(DoSetup); BENCHMARK_CAPTURE(EverCrypt_Sha2_streaming, @@ -281,11 +279,11 @@ BENCHMARK_CAPTURE(HACL_Sha2_streaming, sha2_256, HACL_HASH_SHA2_256_DIGEST_LENGTH, expected_digest_sha2_256, - Hacl_Streaming_SHA2_create_in_256, - Hacl_Streaming_SHA2_init_256, - Hacl_Streaming_SHA2_update_256, - Hacl_Streaming_SHA2_finish_256, - Hacl_Streaming_SHA2_free_256) + Hacl_Hash_SHA2_malloc_256, + Hacl_Hash_SHA2_reset_256, + Hacl_Hash_SHA2_update_256, + Hacl_Hash_SHA2_digest_256, + Hacl_Hash_SHA2_free_256) ->Setup(DoSetup); BENCHMARK_CAPTURE(EverCrypt_Sha2_streaming, @@ -337,11 +335,11 @@ BENCHMARK_CAPTURE(HACL_Sha2_streaming, sha2_384, HACL_HASH_SHA2_384_DIGEST_LENGTH, expected_digest_sha2_384, - Hacl_Streaming_SHA2_create_in_384, - Hacl_Streaming_SHA2_init_384, - Hacl_Streaming_SHA2_update_384, - Hacl_Streaming_SHA2_finish_384, - Hacl_Streaming_SHA2_free_384) + Hacl_Hash_SHA2_malloc_384, + Hacl_Hash_SHA2_reset_384, + Hacl_Hash_SHA2_update_384, + Hacl_Hash_SHA2_digest_384, + Hacl_Hash_SHA2_free_384) ->Setup(DoSetup); BENCHMARK_CAPTURE(EverCrypt_Sha2_streaming, @@ -365,11 +363,11 @@ BENCHMARK_CAPTURE(HACL_Sha2_streaming, sha2_512, HACL_HASH_SHA2_512_DIGEST_LENGTH, expected_digest_sha2_512, - Hacl_Streaming_SHA2_create_in_512, - Hacl_Streaming_SHA2_init_512, - Hacl_Streaming_SHA2_update_512, - Hacl_Streaming_SHA2_finish_512, - Hacl_Streaming_SHA2_free_512) + Hacl_Hash_SHA2_malloc_512, + Hacl_Hash_SHA2_reset_512, + Hacl_Hash_SHA2_update_512, + Hacl_Hash_SHA2_digest_512, + Hacl_Hash_SHA2_free_512) ->Setup(DoSetup); BENCHMARK_CAPTURE(EverCrypt_Sha2_streaming, diff --git a/benchmarks/sha3.cc b/benchmarks/sha3.cc index 7f45a7f7..de744d8f 100644 --- a/benchmarks/sha3.cc +++ b/benchmarks/sha3.cc @@ -27,7 +27,7 @@ static void Hacl_Sha3_224(benchmark::State& state) { for (auto _ : state) { - Hacl_SHA3_sha3_224(input.size(), (uint8_t*)input.data(), digest224.data()); + Hacl_Hash_SHA3_sha3_224(digest224.data(), (uint8_t*)input.data(), input.size()); } if (digest224 != expected_digest_sha3_224) { state.SkipWithError("Incorrect digest."); @@ -51,7 +51,7 @@ static void Hacl_Sha3_256(benchmark::State& state) { for (auto _ : state) { - Hacl_SHA3_sha3_256(input.size(), (uint8_t*)input.data(), digest256.data()); + Hacl_Hash_SHA3_sha3_256(digest256.data(), (uint8_t*)input.data(), input.size()); } if (digest256 != expected_digest_sha3_256) { state.SkipWithError("Incorrect digest."); @@ -102,7 +102,7 @@ static void Hacl_Sha3_384(benchmark::State& state) { for (auto _ : state) { - Hacl_SHA3_sha3_384(input.size(), (uint8_t*)input.data(), digest384.data()); + Hacl_Hash_SHA3_sha3_384(digest384.data(), (uint8_t*)input.data(), input.size()); } if (digest384 != expected_digest_sha3_384) { state.SkipWithError("Incorrect digest."); @@ -126,7 +126,7 @@ static void Hacl_Sha3_512(benchmark::State& state) { for (auto _ : state) { - Hacl_SHA3_sha3_512(input.size(), (uint8_t*)input.data(), digest512.data()); + Hacl_Hash_SHA3_sha3_512(digest512.data(), (uint8_t*)input.data(), input.size()); } if (digest512 != expected_digest_sha3_512) { state.SkipWithError("Incorrect digest."); @@ -176,21 +176,20 @@ Hacl_Sha3_256_Streaming(benchmark::State& state) { for (auto _ : state) { // Init - Hacl_Streaming_Keccak_state* sha_state = - Hacl_Streaming_Keccak_malloc(Spec_Hash_Definitions_SHA3_256); - Hacl_Streaming_Keccak_reset(sha_state); + Hacl_Hash_SHA3_state_t* sha_state = + Hacl_Hash_SHA3_malloc(Spec_Hash_Definitions_SHA3_256); // Update for (size_t i = 0; i < input.size();) { - Hacl_Streaming_Keccak_update(sha_state, - (uint8_t*)input.data() + i, - min(chunk_len, input.size() - i)); + Hacl_Hash_SHA3_update(sha_state, + (uint8_t*)input.data() + i, + min(chunk_len, input.size() - i)); i += chunk_len; } // Finish - Hacl_Streaming_Keccak_finish(sha_state, digest256.data()); - Hacl_Streaming_Keccak_free(sha_state); + Hacl_Hash_SHA3_digest(sha_state, digest256.data()); + Hacl_Hash_SHA3_free(sha_state); } if (digest256 != expected_digest_sha3_256) { @@ -243,10 +242,8 @@ static void Hacl_Sha3_shake128(benchmark::State& state) { for (auto _ : state) { - Hacl_SHA3_shake128_hacl(input.size(), - (uint8_t*)input.data(), - digest_shake.size(), - digest_shake.data()); + Hacl_Hash_SHA3_shake128_hacl( + input.size(), (uint8_t*)input.data(), digest_shake.size(), digest_shake.data()); } } @@ -256,10 +253,8 @@ static void Hacl_Sha3_shake256(benchmark::State& state) { for (auto _ : state) { - Hacl_SHA3_shake256_hacl(input.size(), - (uint8_t*)input.data(), - digest_shake.size(), - digest_shake.data()); + Hacl_Hash_SHA3_shake256_hacl( + input.size(), (uint8_t*)input.data(), digest_shake.size(), digest_shake.data()); } } diff --git a/config/config.json b/config/config.json index 06ff34fe..7dd4cae3 100644 --- a/config/config.json +++ b/config/config.json @@ -42,27 +42,19 @@ "features": "std" }, { - "file": "Hacl_Hash_Blake2.c", + "file": "Hacl_Hash_Blake2b.c", "features": "std" }, { - "file": "Hacl_Streaming_Blake2.c", + "file": "Hacl_Hash_Blake2s.c", "features": "std" }, { - "file": "Hacl_Hash_Blake2b_256.c", + "file": "Hacl_Hash_Blake2b_Simd256.c", "features": "vec256" }, { - "file": "Hacl_Streaming_Blake2b_256.c", - "features": "vec256" - }, - { - "file": "Hacl_Hash_Blake2s_128.c", - "features": "vec128" - }, - { - "file": "Hacl_Streaming_Blake2s_128.c", + "file": "Hacl_Hash_Blake2s_Simd128.c", "features": "vec128" } ], @@ -104,11 +96,11 @@ ], "chacha20poly1305": [ { - "file": "Hacl_Chacha20Poly1305_32.c", + "file": "Hacl_AEAD_Chacha20Poly1305.c", "features": "std" }, { - "file": "Hacl_Streaming_Poly1305_32.c", + "file": "Hacl_MAC_Poly1305.c", "features": "std" }, { @@ -116,11 +108,11 @@ "features": "std" }, { - "file": "Hacl_Chacha20Poly1305_128.c", + "file": "Hacl_AEAD_Chacha20Poly1305_Simd128.c", "features": "vec128" }, { - "file": "Hacl_Streaming_Poly1305_128.c", + "file": "Hacl_MAC_Poly1305_Simd128.c", "features": "vec128" }, { @@ -128,11 +120,11 @@ "features": "vec128" }, { - "file": "Hacl_Chacha20Poly1305_256.c", + "file": "Hacl_AEAD_Chacha20Poly1305_Simd256.c", "features": "vec256" }, { - "file": "Hacl_Streaming_Poly1305_256.c", + "file": "Hacl_MAC_Poly1305_Simd256.c", "features": "vec256" }, { diff --git a/config/default_config.cmake b/config/default_config.cmake index a2fe0e07..9a05896e 100644 --- a/config/default_config.cmake +++ b/config/default_config.cmake @@ -1,26 +1,25 @@ set(SOURCES_std ${PROJECT_SOURCE_DIR}/src/Hacl_NaCl.c ${PROJECT_SOURCE_DIR}/src/Hacl_Salsa20.c - ${PROJECT_SOURCE_DIR}/src/Hacl_Poly1305_32.c + ${PROJECT_SOURCE_DIR}/src/Hacl_MAC_Poly1305.c ${PROJECT_SOURCE_DIR}/src/Hacl_Curve25519_51.c ${PROJECT_SOURCE_DIR}/src/Hacl_HMAC_DRBG.c ${PROJECT_SOURCE_DIR}/src/Hacl_HMAC.c ${PROJECT_SOURCE_DIR}/src/Hacl_Hash_SHA2.c - ${PROJECT_SOURCE_DIR}/src/Hacl_Hash_Blake2.c + ${PROJECT_SOURCE_DIR}/src/Hacl_Hash_Blake2b.c + ${PROJECT_SOURCE_DIR}/src/Hacl_Hash_Blake2s.c ${PROJECT_SOURCE_DIR}/src/Hacl_Ed25519.c ${PROJECT_SOURCE_DIR}/src/Hacl_EC_Ed25519.c ${PROJECT_SOURCE_DIR}/src/Hacl_Hash_Base.c ${PROJECT_SOURCE_DIR}/src/Lib_Memzero0.c - ${PROJECT_SOURCE_DIR}/src/Hacl_Streaming_Blake2.c ${PROJECT_SOURCE_DIR}/src/Hacl_Bignum256_32.c ${PROJECT_SOURCE_DIR}/src/Hacl_Bignum.c ${PROJECT_SOURCE_DIR}/src/Hacl_Bignum256.c ${PROJECT_SOURCE_DIR}/src/Hacl_Bignum32.c ${PROJECT_SOURCE_DIR}/src/Hacl_Bignum4096_32.c ${PROJECT_SOURCE_DIR}/src/Hacl_GenericField32.c - ${PROJECT_SOURCE_DIR}/src/Hacl_Chacha20Poly1305_32.c + ${PROJECT_SOURCE_DIR}/src/Hacl_AEAD_Chacha20Poly1305.c ${PROJECT_SOURCE_DIR}/src/Hacl_Chacha20.c - ${PROJECT_SOURCE_DIR}/src/Hacl_Streaming_Poly1305_32.c ${PROJECT_SOURCE_DIR}/src/Hacl_Chacha20_Vec32.c ${PROJECT_SOURCE_DIR}/src/Hacl_P256.c ${PROJECT_SOURCE_DIR}/src/Hacl_K256_ECDSA.c @@ -55,12 +54,10 @@ set(SOURCES_std ${PROJECT_SOURCE_DIR}/src/EverCrypt_AEAD.c ) set(SOURCES_vec256 - ${PROJECT_SOURCE_DIR}/src/Hacl_Hash_Blake2b_256.c - ${PROJECT_SOURCE_DIR}/src/Hacl_Streaming_Blake2b_256.c - ${PROJECT_SOURCE_DIR}/src/Hacl_Chacha20Poly1305_256.c - ${PROJECT_SOURCE_DIR}/src/Hacl_Poly1305_256.c + ${PROJECT_SOURCE_DIR}/src/Hacl_Hash_Blake2b_Simd256.c + ${PROJECT_SOURCE_DIR}/src/Hacl_AEAD_Chacha20Poly1305_Simd256.c + ${PROJECT_SOURCE_DIR}/src/Hacl_MAC_Poly1305_Simd256.c ${PROJECT_SOURCE_DIR}/src/Hacl_Chacha20_Vec256.c - ${PROJECT_SOURCE_DIR}/src/Hacl_Streaming_Poly1305_256.c ${PROJECT_SOURCE_DIR}/src/Hacl_SHA2_Vec256.c ${PROJECT_SOURCE_DIR}/src/Hacl_HKDF_Blake2b_256.c ${PROJECT_SOURCE_DIR}/src/Hacl_HMAC_Blake2b_256.c @@ -69,15 +66,13 @@ set(SOURCES_vec256 ${PROJECT_SOURCE_DIR}/src/Hacl_HPKE_P256_CP256_SHA256.c ) set(SOURCES_vec128 - ${PROJECT_SOURCE_DIR}/src/Hacl_Hash_Blake2s_128.c - ${PROJECT_SOURCE_DIR}/src/Hacl_Streaming_Blake2s_128.c + ${PROJECT_SOURCE_DIR}/src/Hacl_Hash_Blake2s_Simd128.c ${PROJECT_SOURCE_DIR}/src/Hacl_Bignum4096.c ${PROJECT_SOURCE_DIR}/src/Hacl_Bignum64.c ${PROJECT_SOURCE_DIR}/src/Hacl_GenericField64.c - ${PROJECT_SOURCE_DIR}/src/Hacl_Chacha20Poly1305_128.c - ${PROJECT_SOURCE_DIR}/src/Hacl_Poly1305_128.c + ${PROJECT_SOURCE_DIR}/src/Hacl_AEAD_Chacha20Poly1305_Simd128.c + ${PROJECT_SOURCE_DIR}/src/Hacl_MAC_Poly1305_Simd128.c ${PROJECT_SOURCE_DIR}/src/Hacl_Chacha20_Vec128.c - ${PROJECT_SOURCE_DIR}/src/Hacl_Streaming_Poly1305_128.c ${PROJECT_SOURCE_DIR}/src/Hacl_SHA2_Vec128.c ${PROJECT_SOURCE_DIR}/src/Hacl_HKDF_Blake2s_128.c ${PROJECT_SOURCE_DIR}/src/Hacl_HMAC_Blake2s_128.c @@ -114,7 +109,7 @@ set(INCLUDES ${PROJECT_SOURCE_DIR}/karamel/krmllib/dist/minimal/FStar_UInt_8_16_32_64.h ${PROJECT_SOURCE_DIR}/karamel/krmllib/dist/minimal/LowStar_Endianness.h ${PROJECT_SOURCE_DIR}/include/Hacl_Salsa20.h - ${PROJECT_SOURCE_DIR}/include/Hacl_Poly1305_32.h + ${PROJECT_SOURCE_DIR}/include/Hacl_MAC_Poly1305.h ${PROJECT_SOURCE_DIR}/include/Hacl_Krmllib.h ${PROJECT_SOURCE_DIR}/include/Hacl_Curve25519_51.h ${PROJECT_SOURCE_DIR}/include/internal/Hacl_Krmllib.h @@ -123,7 +118,8 @@ set(INCLUDES ${PROJECT_SOURCE_DIR}/include/Hacl_Streaming_Types.h ${PROJECT_SOURCE_DIR}/include/Hacl_HMAC.h ${PROJECT_SOURCE_DIR}/include/Hacl_Hash_SHA2.h - ${PROJECT_SOURCE_DIR}/include/Hacl_Hash_Blake2.h + ${PROJECT_SOURCE_DIR}/include/Hacl_Hash_Blake2b.h + ${PROJECT_SOURCE_DIR}/include/Hacl_Hash_Blake2s.h ${PROJECT_SOURCE_DIR}/include/internal/Hacl_Ed25519.h ${PROJECT_SOURCE_DIR}/include/internal/Hacl_Hash_SHA2.h ${PROJECT_SOURCE_DIR}/include/internal/../Hacl_Hash_SHA2.h @@ -139,16 +135,15 @@ set(INCLUDES ${PROJECT_SOURCE_DIR}/include/internal/../Hacl_Ed25519.h ${PROJECT_SOURCE_DIR}/include/Hacl_EC_Ed25519.h ${PROJECT_SOURCE_DIR}/include/Hacl_Hash_Base.h - ${PROJECT_SOURCE_DIR}/include/internal/Hacl_Hash_Blake2.h + ${PROJECT_SOURCE_DIR}/include/internal/Hacl_Hash_Blake2b.h + ${PROJECT_SOURCE_DIR}/include/internal/Hacl_Hash_Blake2s.h ${PROJECT_SOURCE_DIR}/include/internal/Hacl_Impl_Blake2_Constants.h - ${PROJECT_SOURCE_DIR}/include/internal/../Hacl_Hash_Blake2.h + ${PROJECT_SOURCE_DIR}/include/internal/../Hacl_Hash_Blake2b.h + ${PROJECT_SOURCE_DIR}/include/internal/../Hacl_Hash_Blake2s.h ${PROJECT_SOURCE_DIR}/include/lib_memzero0.h - ${PROJECT_SOURCE_DIR}/include/Hacl_Streaming_Blake2.h - ${PROJECT_SOURCE_DIR}/include/Hacl_Hash_Blake2b_256.h + ${PROJECT_SOURCE_DIR}/include/Hacl_Hash_Blake2b_Simd256.h ${PROJECT_SOURCE_DIR}/include/libintvector.h - ${PROJECT_SOURCE_DIR}/include/Hacl_Streaming_Blake2b_256.h - ${PROJECT_SOURCE_DIR}/include/Hacl_Hash_Blake2s_128.h - ${PROJECT_SOURCE_DIR}/include/Hacl_Streaming_Blake2s_128.h + ${PROJECT_SOURCE_DIR}/include/Hacl_Hash_Blake2s_Simd128.h ${PROJECT_SOURCE_DIR}/include/Hacl_Bignum256_32.h ${PROJECT_SOURCE_DIR}/include/Hacl_Bignum.h ${PROJECT_SOURCE_DIR}/include/internal/Hacl_Bignum.h @@ -160,24 +155,21 @@ set(INCLUDES ${PROJECT_SOURCE_DIR}/include/Hacl_Bignum64.h ${PROJECT_SOURCE_DIR}/include/Hacl_GenericField32.h ${PROJECT_SOURCE_DIR}/include/Hacl_GenericField64.h - ${PROJECT_SOURCE_DIR}/include/Hacl_Chacha20Poly1305_32.h + ${PROJECT_SOURCE_DIR}/include/Hacl_AEAD_Chacha20Poly1305.h ${PROJECT_SOURCE_DIR}/include/Hacl_Chacha20.h - ${PROJECT_SOURCE_DIR}/include/Hacl_Streaming_Poly1305_32.h ${PROJECT_SOURCE_DIR}/include/Hacl_Chacha20_Vec32.h ${PROJECT_SOURCE_DIR}/include/internal/Hacl_Chacha20.h ${PROJECT_SOURCE_DIR}/include/internal/../Hacl_Chacha20.h - ${PROJECT_SOURCE_DIR}/include/Hacl_Chacha20Poly1305_128.h - ${PROJECT_SOURCE_DIR}/include/Hacl_Poly1305_128.h + ${PROJECT_SOURCE_DIR}/include/Hacl_AEAD_Chacha20Poly1305_Simd128.h + ${PROJECT_SOURCE_DIR}/include/Hacl_MAC_Poly1305_Simd128.h ${PROJECT_SOURCE_DIR}/include/Hacl_Chacha20_Vec128.h - ${PROJECT_SOURCE_DIR}/include/internal/Hacl_Poly1305_128.h - ${PROJECT_SOURCE_DIR}/include/internal/../Hacl_Poly1305_128.h - ${PROJECT_SOURCE_DIR}/include/Hacl_Streaming_Poly1305_128.h - ${PROJECT_SOURCE_DIR}/include/Hacl_Chacha20Poly1305_256.h - ${PROJECT_SOURCE_DIR}/include/Hacl_Poly1305_256.h + ${PROJECT_SOURCE_DIR}/include/internal/Hacl_MAC_Poly1305_Simd128.h + ${PROJECT_SOURCE_DIR}/include/internal/../Hacl_MAC_Poly1305_Simd128.h + ${PROJECT_SOURCE_DIR}/include/Hacl_AEAD_Chacha20Poly1305_Simd256.h + ${PROJECT_SOURCE_DIR}/include/Hacl_MAC_Poly1305_Simd256.h ${PROJECT_SOURCE_DIR}/include/Hacl_Chacha20_Vec256.h - ${PROJECT_SOURCE_DIR}/include/internal/Hacl_Poly1305_256.h - ${PROJECT_SOURCE_DIR}/include/internal/../Hacl_Poly1305_256.h - ${PROJECT_SOURCE_DIR}/include/Hacl_Streaming_Poly1305_256.h + ${PROJECT_SOURCE_DIR}/include/internal/Hacl_MAC_Poly1305_Simd256.h + ${PROJECT_SOURCE_DIR}/include/internal/../Hacl_MAC_Poly1305_Simd256.h ${PROJECT_SOURCE_DIR}/include/Hacl_Curve25519_64.h ${PROJECT_SOURCE_DIR}/include/internal/Vale.h ${PROJECT_SOURCE_DIR}/include/curve25519-inline.h @@ -256,7 +248,7 @@ set(PUBLIC_INCLUDES ${PROJECT_SOURCE_DIR}/karamel/krmllib/dist/minimal/FStar_UInt_8_16_32_64.h ${PROJECT_SOURCE_DIR}/karamel/krmllib/dist/minimal/LowStar_Endianness.h ${PROJECT_SOURCE_DIR}/include/Hacl_Salsa20.h - ${PROJECT_SOURCE_DIR}/include/Hacl_Poly1305_32.h + ${PROJECT_SOURCE_DIR}/include/Hacl_MAC_Poly1305.h ${PROJECT_SOURCE_DIR}/include/Hacl_Krmllib.h ${PROJECT_SOURCE_DIR}/include/Hacl_Curve25519_51.h ${PROJECT_SOURCE_DIR}/include/internal/../Hacl_Krmllib.h @@ -264,7 +256,8 @@ set(PUBLIC_INCLUDES ${PROJECT_SOURCE_DIR}/include/Hacl_Streaming_Types.h ${PROJECT_SOURCE_DIR}/include/Hacl_HMAC.h ${PROJECT_SOURCE_DIR}/include/Hacl_Hash_SHA2.h - ${PROJECT_SOURCE_DIR}/include/Hacl_Hash_Blake2.h + ${PROJECT_SOURCE_DIR}/include/Hacl_Hash_Blake2b.h + ${PROJECT_SOURCE_DIR}/include/Hacl_Hash_Blake2s.h ${PROJECT_SOURCE_DIR}/include/internal/../Hacl_Hash_SHA2.h ${PROJECT_SOURCE_DIR}/include/internal/../Hacl_Curve25519_51.h ${PROJECT_SOURCE_DIR}/include/lib_intrinsics.h @@ -274,14 +267,12 @@ set(PUBLIC_INCLUDES ${PROJECT_SOURCE_DIR}/include/internal/../Hacl_Ed25519.h ${PROJECT_SOURCE_DIR}/include/Hacl_EC_Ed25519.h ${PROJECT_SOURCE_DIR}/include/Hacl_Hash_Base.h - ${PROJECT_SOURCE_DIR}/include/internal/../Hacl_Hash_Blake2.h + ${PROJECT_SOURCE_DIR}/include/internal/../Hacl_Hash_Blake2b.h + ${PROJECT_SOURCE_DIR}/include/internal/../Hacl_Hash_Blake2s.h ${PROJECT_SOURCE_DIR}/include/lib_memzero0.h - ${PROJECT_SOURCE_DIR}/include/Hacl_Streaming_Blake2.h - ${PROJECT_SOURCE_DIR}/include/Hacl_Hash_Blake2b_256.h + ${PROJECT_SOURCE_DIR}/include/Hacl_Hash_Blake2b_Simd256.h ${PROJECT_SOURCE_DIR}/include/libintvector.h - ${PROJECT_SOURCE_DIR}/include/Hacl_Streaming_Blake2b_256.h - ${PROJECT_SOURCE_DIR}/include/Hacl_Hash_Blake2s_128.h - ${PROJECT_SOURCE_DIR}/include/Hacl_Streaming_Blake2s_128.h + ${PROJECT_SOURCE_DIR}/include/Hacl_Hash_Blake2s_Simd128.h ${PROJECT_SOURCE_DIR}/include/Hacl_Bignum256_32.h ${PROJECT_SOURCE_DIR}/include/Hacl_Bignum.h ${PROJECT_SOURCE_DIR}/include/internal/../Hacl_Bignum.h @@ -292,21 +283,18 @@ set(PUBLIC_INCLUDES ${PROJECT_SOURCE_DIR}/include/Hacl_Bignum64.h ${PROJECT_SOURCE_DIR}/include/Hacl_GenericField32.h ${PROJECT_SOURCE_DIR}/include/Hacl_GenericField64.h - ${PROJECT_SOURCE_DIR}/include/Hacl_Chacha20Poly1305_32.h + ${PROJECT_SOURCE_DIR}/include/Hacl_AEAD_Chacha20Poly1305.h ${PROJECT_SOURCE_DIR}/include/Hacl_Chacha20.h - ${PROJECT_SOURCE_DIR}/include/Hacl_Streaming_Poly1305_32.h ${PROJECT_SOURCE_DIR}/include/Hacl_Chacha20_Vec32.h ${PROJECT_SOURCE_DIR}/include/internal/../Hacl_Chacha20.h - ${PROJECT_SOURCE_DIR}/include/Hacl_Chacha20Poly1305_128.h - ${PROJECT_SOURCE_DIR}/include/Hacl_Poly1305_128.h + ${PROJECT_SOURCE_DIR}/include/Hacl_AEAD_Chacha20Poly1305_Simd128.h + ${PROJECT_SOURCE_DIR}/include/Hacl_MAC_Poly1305_Simd128.h ${PROJECT_SOURCE_DIR}/include/Hacl_Chacha20_Vec128.h - ${PROJECT_SOURCE_DIR}/include/internal/../Hacl_Poly1305_128.h - ${PROJECT_SOURCE_DIR}/include/Hacl_Streaming_Poly1305_128.h - ${PROJECT_SOURCE_DIR}/include/Hacl_Chacha20Poly1305_256.h - ${PROJECT_SOURCE_DIR}/include/Hacl_Poly1305_256.h + ${PROJECT_SOURCE_DIR}/include/internal/../Hacl_MAC_Poly1305_Simd128.h + ${PROJECT_SOURCE_DIR}/include/Hacl_AEAD_Chacha20Poly1305_Simd256.h + ${PROJECT_SOURCE_DIR}/include/Hacl_MAC_Poly1305_Simd256.h ${PROJECT_SOURCE_DIR}/include/Hacl_Chacha20_Vec256.h - ${PROJECT_SOURCE_DIR}/include/internal/../Hacl_Poly1305_256.h - ${PROJECT_SOURCE_DIR}/include/Hacl_Streaming_Poly1305_256.h + ${PROJECT_SOURCE_DIR}/include/internal/../Hacl_MAC_Poly1305_Simd256.h ${PROJECT_SOURCE_DIR}/include/Hacl_Curve25519_64.h ${PROJECT_SOURCE_DIR}/include/curve25519-inline.h ${PROJECT_SOURCE_DIR}/include/internal/../Hacl_P256.h diff --git a/docs/reference/evercrypt/hash/index.md b/docs/reference/evercrypt/hash/index.md index c2a829dc..62095760 100644 --- a/docs/reference/evercrypt/hash/index.md +++ b/docs/reference/evercrypt/hash/index.md @@ -42,12 +42,12 @@ EverCrypt provides multiple hash algorithms, i.e., ... ```{doxygendefine} Spec_Hash_Definitions_Blake2B ``` -```{doxygentypedef} EverCrypt_Hash_Incremental_hash_state +```{doxygentypedef} EverCrypt_Hash_Incremental_state_t ``` ## Functions - + ```{doxygenfunction} EverCrypt_Hash_Incremental_hash ``` @@ -59,17 +59,17 @@ EverCrypt provides multiple hash algorithms, i.e., ... -------------------------------------------------------------------------------- -```{doxygenfunction} EverCrypt_Hash_Incremental_create_in +```{doxygenfunction} EverCrypt_Hash_Incremental_malloc ``` Create a hash state. `a` Algorithm to use. -```{doxygenfunction} EverCrypt_Hash_Incremental_init +```{doxygenfunction} EverCrypt_Hash_Incremental_reset ``` -Initialize hash state). +Reset hash state). `s` The hash state. @@ -82,7 +82,7 @@ Feed the next chunk of the message that will be hashed. `data` Pointer to the next chunk of the message that will be hashed. `len` Length of the next chunk of the message that will be hashed. -```{doxygenfunction} EverCrypt_Hash_Incremental_finish +```{doxygenfunction} EverCrypt_Hash_Incremental_digest ``` Finish the hash calculation and write the digest to `dst`. diff --git a/docs/reference/hacl/aead/chacha20poly1305.md b/docs/reference/hacl/aead/chacha20poly1305.md index f52443e9..04075548 100644 --- a/docs/reference/hacl/aead/chacha20poly1305.md +++ b/docs/reference/hacl/aead/chacha20poly1305.md @@ -10,7 +10,7 @@ All memory for the output variables have to be allocated by the caller. ````{group-tab} 32 ```c -#include "Hacl_Chacha20Poly1305_32.h" +#include "Hacl_AEAD_Chacha20Poly1305.h" ``` A portable C implementation that can be compiled and run on any platform that is 32-bit or higher. @@ -20,7 +20,7 @@ This implementation works on all CPUs. ````{group-tab} 128 ```c -#include "Hacl_Chacha20Poly1305_128.h" +#include "Hacl_AEAD_Chacha20Poly1305_Simd128.h" ``` A 128-bit vectorized C implementation that can be compiled and run on any platform that supports 128-bit SIMD instructions. @@ -30,7 +30,7 @@ Support for VEC128 is needed. Please see the [HACL Packages book]. ````{group-tab} 256 ```c -#include "Hacl_Chacha20Poly1305_256.h" +#include "Hacl_AEAD_Chacha20Poly1305_Simd256.h" ``` A 256-bit vectorized C implementation that can be compiled and run on any platform that supports 256-bit SIMD instructions. @@ -59,21 +59,21 @@ Support for VEC256 is needed. Please see the [HACL Packages book]. `````{tabs} ````{group-tab} 32 -```{doxygenfunction} Hacl_Chacha20Poly1305_32_aead_encrypt +```{doxygenfunction} Hacl_AEAD_Chacha20Poly1305_encrypt ``` -```{doxygenfunction} Hacl_Chacha20Poly1305_32_aead_decrypt +```{doxygenfunction} Hacl_AEAD_Chacha20Poly1305_decrypt ``` ```` ````{group-tab} 128 -```{doxygenfunction} Hacl_Chacha20Poly1305_128_aead_encrypt +```{doxygenfunction} Hacl_AEAD_Chacha20Poly1305_Simd128_encrypt ``` -```{doxygenfunction} Hacl_Chacha20Poly1305_128_aead_decrypt +```{doxygenfunction} Hacl_AEAD_Chacha20Poly1305_Simd128_decrypt ``` ```` ````{group-tab} 256 -```{doxygenfunction} Hacl_Chacha20Poly1305_256_aead_encrypt +```{doxygenfunction} Hacl_AEAD_Chacha20Poly1305_Simd256_encrypt ``` -```{doxygenfunction} Hacl_Chacha20Poly1305_256_aead_decrypt +```{doxygenfunction} Hacl_AEAD_Chacha20Poly1305_Simd256_decrypt ``` ```` ````` diff --git a/docs/reference/hacl/hash/blake2/blake2b.md b/docs/reference/hacl/hash/blake2/blake2b.md index e727c883..03e03300 100644 --- a/docs/reference/hacl/hash/blake2/blake2b.md +++ b/docs/reference/hacl/hash/blake2/blake2b.md @@ -12,12 +12,12 @@ It also has a build-in keying mechanism so that it can be used to replace HMAC-b `````{tabs} ````{group-tab} 32 ```C -#include "Hacl_Hash_Blake2.h" +#include "Hacl_Hash_Blake2b.h" ``` ```` ````{group-tab} 256 ```C -#include "Hacl_Hash_Blake2b_256.h" +#include "Hacl_Hash_Blake2b_Simd256.h" ``` ```` ````` @@ -47,11 +47,11 @@ It also has a build-in keying mechanism so that it can be used to replace HMAC-b `````{tabs} ````{group-tab} 32 -```{doxygenfunction} Hacl_Blake2b_32_blake2b +```{doxygenfunction} Hacl_Hash_Blake2b_hash_with_key ``` ```` ````{group-tab} 256 -```{doxygenfunction} Hacl_Blake2b_256_blake2b +```{doxygenfunction} Hacl_Hash_Blake2b_Simd256_hash_with_key ``` ```` ````` @@ -63,12 +63,12 @@ It also has a build-in keying mechanism so that it can be used to replace HMAC-b `````{tabs} ````{group-tab} 32 ```C -#include "Hacl_Streaming_Blake2.h" +#include "Hacl_Hash_Blake2b.h" ``` ```` ````{group-tab} 256 ```C -#include "Hacl_Streaming_Blake2b_256.h" +#include "Hacl_Hash_Blake2b_Simd256.h" ``` ```` ````` @@ -98,31 +98,31 @@ It also has a build-in keying mechanism so that it can be used to replace HMAC-b `````{tabs} ````{group-tab} 32 -```{doxygentypedef} Hacl_Streaming_Blake2_blake2b_32_state +```{doxygentypedef} Hacl_Hash_Blake2b_state_t ``` -```{doxygenfunction} Hacl_Streaming_Blake2_blake2b_32_no_key_create_in +```{doxygenfunction} Hacl_Hash_Blake2b_malloc ``` -```{doxygenfunction} Hacl_Streaming_Blake2_blake2b_32_no_key_init +```{doxygenfunction} Hacl_Hash_Blake2b_update ``` -```{doxygenfunction} Hacl_Streaming_Blake2_blake2b_32_no_key_update +```{doxygenfunction} Hacl_Hash_Blake2b_digest ``` -```{doxygenfunction} Hacl_Streaming_Blake2_blake2b_32_no_key_finish +```{doxygenfunction} Hacl_Hash_Blake2b_reset ``` -```{doxygenfunction} Hacl_Streaming_Blake2_blake2b_32_no_key_free +```{doxygenfunction} Hacl_Hash_Blake2b_free ``` ```` ````{group-tab} 256 -```{doxygentypedef} Hacl_Streaming_Blake2b_256_blake2b_256_state +```{doxygentypedef} Hacl_Hash_Blake2b_Simd256_state_t ``` -```{doxygenfunction} Hacl_Streaming_Blake2b_256_blake2b_256_no_key_create_in +```{doxygenfunction} Hacl_Hash_Blake2b_Simd256_malloc ``` -```{doxygenfunction} Hacl_Streaming_Blake2b_256_blake2b_256_no_key_init +```{doxygenfunction} Hacl_Hash_Blake2b_Simd256_update ``` -```{doxygenfunction} Hacl_Streaming_Blake2b_256_blake2b_256_no_key_update +```{doxygenfunction} Hacl_Hash_Blake2b_Simd256_digest ``` -```{doxygenfunction} Hacl_Streaming_Blake2b_256_blake2b_256_no_key_finish +```{doxygenfunction} Hacl_Hash_Blake2b_Simd256_reset ``` -```{doxygenfunction} Hacl_Streaming_Blake2b_256_blake2b_256_no_key_free +```{doxygenfunction} Hacl_Hash_Blake2b_Simd256_free ``` ```` ````` diff --git a/docs/reference/hacl/hash/blake2/blake2s.md b/docs/reference/hacl/hash/blake2/blake2s.md index c960a683..e234bd6f 100644 --- a/docs/reference/hacl/hash/blake2/blake2s.md +++ b/docs/reference/hacl/hash/blake2/blake2s.md @@ -11,12 +11,12 @@ BLAKE2s is optimized for 8- to 32-bit platforms and produces digests of any size `````{tabs} ````{group-tab} 32 ```C -#include "Hacl_Hash_Blake2.h" +#include "Hacl_Hash_Blake2s.h" ``` ```` ````{group-tab} 128 ```C -#include "Hacl_Hash_Blake2s_128.h" +#include "Hacl_Hash_Blake2s_Simd128.h" ``` ```` ````` @@ -46,11 +46,11 @@ BLAKE2s is optimized for 8- to 32-bit platforms and produces digests of any size `````{tabs} ````{group-tab} 32 -```{doxygenfunction} Hacl_Blake2s_32_blake2s +```{doxygenfunction} Hacl_Hash_Blake2s_hash_with_key ``` ```` ````{group-tab} 128 -```{doxygenfunction} Hacl_Blake2s_128_blake2s +```{doxygenfunction} Hacl_Hash_Blake2s_Simd128_hash_with_key ``` ```` ````` @@ -62,12 +62,12 @@ BLAKE2s is optimized for 8- to 32-bit platforms and produces digests of any size `````{tabs} ````{group-tab} 32 ```C -#include "Hacl_Streaming_Blake2.h" +#include "Hacl_Hash_Blake2.h" ``` ```` ````{group-tab} 128 ```C -#include "Hacl_Streaming_Blake2s_128.h" +#include "Hacl_Hash_Blake2s_Simd128.h" ``` ```` ````` @@ -97,31 +97,31 @@ BLAKE2s is optimized for 8- to 32-bit platforms and produces digests of any size `````{tabs} ````{group-tab} 32 -```{doxygentypedef} Hacl_Streaming_Blake2_blake2s_32_state +```{doxygentypedef} Hacl_Hash_Blake2s_state_t ``` -```{doxygenfunction} Hacl_Streaming_Blake2_blake2s_32_no_key_create_in +```{doxygenfunction} Hacl_Hash_Blake2s_malloc ``` -```{doxygenfunction} Hacl_Streaming_Blake2_blake2s_32_no_key_init +```{doxygenfunction} Hacl_Hash_Blake2s_update ``` -```{doxygenfunction} Hacl_Streaming_Blake2_blake2s_32_no_key_update +```{doxygenfunction} Hacl_Hash_Blake2s_digest ``` -```{doxygenfunction} Hacl_Streaming_Blake2_blake2s_32_no_key_finish +```{doxygenfunction} Hacl_Hash_Blake2s_reset ``` -```{doxygenfunction} Hacl_Streaming_Blake2_blake2s_32_no_key_free +```{doxygenfunction} Hacl_Hash_Blake2s_free ``` ```` ````{group-tab} 128 -```{doxygentypedef} Hacl_Streaming_Blake2s_128_blake2s_128_state +```{doxygentypedef} Hacl_Hash_Blake2s_Simd128_state_t ``` -```{doxygenfunction} Hacl_Streaming_Blake2s_128_blake2s_128_no_key_create_in +```{doxygenfunction} Hacl_Hash_Blake2s_Simd128_malloc ``` -```{doxygenfunction} Hacl_Streaming_Blake2s_128_blake2s_128_no_key_init +```{doxygenfunction} Hacl_Hash_Blake2s_Simd128_update ``` -```{doxygenfunction} Hacl_Streaming_Blake2s_128_blake2s_128_no_key_update +```{doxygenfunction} Hacl_Hash_Blake2s_Simd128_digest ``` -```{doxygenfunction} Hacl_Streaming_Blake2s_128_blake2s_128_no_key_finish +```{doxygenfunction} Hacl_Hash_Blake2s_Simd128_reset ``` -```{doxygenfunction} Hacl_Streaming_Blake2s_128_blake2s_128_no_key_free +```{doxygenfunction} Hacl_Hash_Blake2s_Simd128_free ``` ```` ````` diff --git a/docs/reference/hacl/hash/index.md b/docs/reference/hacl/hash/index.md index a0910450..1d5260e0 100644 --- a/docs/reference/hacl/hash/index.md +++ b/docs/reference/hacl/hash/index.md @@ -13,15 +13,15 @@ If you want to hash a complete messages, i.e., can provide a slice of memory tha If you need to provide a message chunk-by-chunk, e.g., because you read the message from network or similar, it could be more appropriate to use the streaming API. The streaming API has roughly three phases: init, update, and finish. -Typically, you create a state element by using `init`, call `update` as often as needed, and then call `finish` to obtain the final digest. +Typically, you create a state element by using `malloc`, call `update` as often as needed, and then call `digest` to obtain the final digest. Finally, you `free` the state element. **Streaming API (with intermediate digests)** -It is also possible to obtain all intermediate digests by calling `finish` more than once. -You can call `update("Hello, ")`, and `finish` to obtain the hash of `"Hello, "`. -Then you can call `update("World!")`, and `finish` *again* to obtain the hash of `"Hello, World!"`. -You only need to call `init` and `free` once to obtain both digests. +It is also possible to obtain all intermediate digests by calling `digest` more than once. +You can call `update("Hello, ")`, and `digest` to obtain the hash of `"Hello, "`. +Then you can call `update("World!")`, and `digest` *again* to obtain the hash of `"Hello, World!"`. +You only need to call `malloc` and `free` once to obtain both digests. ```{toctree} :caption: "Algorithms" diff --git a/docs/reference/hacl/hash/sha1.md b/docs/reference/hacl/hash/sha1.md index 64fef04f..7889d30d 100644 --- a/docs/reference/hacl/hash/sha1.md +++ b/docs/reference/hacl/hash/sha1.md @@ -24,7 +24,7 @@ SHA-1 is insecure. Please avoid or ask your cryptographer of trust for permissio :end-before: "// END OneShot" ``` -```{doxygenfunction} Hacl_Streaming_SHA1_legacy_hash +```{doxygenfunction} Hacl_Hash_SHA1_hash ``` ### Streaming @@ -52,20 +52,20 @@ SHA-1 is insecure. Please avoid or ask your cryptographer of trust for permissio :end-before: "// ANCHOR_END(streaming)" ``` -```{doxygentypedef} Hacl_Streaming_SHA1_state +```{doxygentypedef} Hacl_Hash_SHA1_state_t ``` -```{doxygenfunction} Hacl_Streaming_SHA1_legacy_create_in +```{doxygenfunction} Hacl_Hash_SHA1_malloc ``` -```{doxygenfunction} Hacl_Streaming_SHA1_legacy_init +```{doxygenfunction} Hacl_Hash_SHA1_update ``` -```{doxygenfunction} Hacl_Streaming_SHA1_legacy_update +```{doxygenfunction} Hacl_Hash_SHA1_digest ``` -```{doxygenfunction} Hacl_Streaming_SHA1_legacy_finish +```{doxygenfunction} Hacl_Hash_SHA1_reset ``` -```{doxygenfunction} Hacl_Streaming_SHA1_legacy_free +```{doxygenfunction} Hacl_Hash_SHA1_free ``` diff --git a/docs/reference/hacl/hash/sha2.md b/docs/reference/hacl/hash/sha2.md index 55702c64..990db76e 100644 --- a/docs/reference/hacl/hash/sha2.md +++ b/docs/reference/hacl/hash/sha2.md @@ -86,26 +86,26 @@ it is sometimes called `SHA2-256` to avoid confusion with SHA-1 and SHA-3. **Init** -```{doxygentypedef} Hacl_Streaming_SHA2_state_sha2_224 +```{doxygentypedef} Hacl_Hash_SHA2_state_t_224 ``` -```{doxygenfunction} Hacl_Streaming_SHA2_create_in_224 -``` - -```{doxygenfunction} Hacl_Streaming_SHA2_init_224 +```{doxygenfunction} Hacl_Hash_SHA2_malloc_224 ``` **Update** -```{doxygenfunction} Hacl_Streaming_SHA2_update_224 +```{doxygenfunction} Hacl_Hash_SHA2_update_224 ``` **Finish** -```{doxygenfunction} Hacl_Streaming_SHA2_finish_224 +```{doxygenfunction} Hacl_Hash_SHA2_digest_224 +``` + +```{doxygenfunction} Hacl_Hash_SHA2_reset_224 ``` -```{doxygenfunction} Hacl_Streaming_SHA2_free_224 +```{doxygenfunction} Hacl_Hash_SHA2_free_224 ``` ```` @@ -113,26 +113,26 @@ it is sometimes called `SHA2-256` to avoid confusion with SHA-1 and SHA-3. **Init** -```{doxygentypedef} Hacl_Streaming_SHA2_state_sha2_256 +```{doxygentypedef} Hacl_Hash_SHA2_state_t_256 ``` -```{doxygenfunction} Hacl_Streaming_SHA2_create_in_256 -``` - -```{doxygenfunction} Hacl_Streaming_SHA2_init_256 +```{doxygenfunction} Hacl_Hash_SHA2_malloc_256 ``` **Update** -```{doxygenfunction} Hacl_Streaming_SHA2_update_256 +```{doxygenfunction} Hacl_Hash_SHA2_update_256 ``` **Finish** -```{doxygenfunction} Hacl_Streaming_SHA2_finish_256 +```{doxygenfunction} Hacl_Hash_SHA2_digest_256 +``` + +```{doxygenfunction} Hacl_Hash_SHA2_reset_256 ``` -```{doxygenfunction} Hacl_Streaming_SHA2_free_256 +```{doxygenfunction} Hacl_Hash_SHA2_free_256 ``` ```` @@ -140,26 +140,26 @@ it is sometimes called `SHA2-256` to avoid confusion with SHA-1 and SHA-3. **Init** -```{doxygentypedef} Hacl_Streaming_SHA2_state_sha2_384 +```{doxygentypedef} Hacl_Hash_SHA2_state_t_384 ``` -```{doxygenfunction} Hacl_Streaming_SHA2_create_in_384 -``` - -```{doxygenfunction} Hacl_Streaming_SHA2_init_384 +```{doxygenfunction} Hacl_Hash_SHA2_malloc_384 ``` **Update** -```{doxygenfunction} Hacl_Streaming_SHA2_update_384 +```{doxygenfunction} Hacl_Hash_SHA2_update_384 ``` **Finish** -```{doxygenfunction} Hacl_Streaming_SHA2_finish_384 +```{doxygenfunction} Hacl_Hash_SHA2_digest_384 +``` + +```{doxygenfunction} Hacl_Hash_SHA2_reset_384 ``` -```{doxygenfunction} Hacl_Streaming_SHA2_free_384 +```{doxygenfunction} Hacl_Hash_SHA2_free_384 ``` ```` @@ -168,26 +168,26 @@ it is sometimes called `SHA2-256` to avoid confusion with SHA-1 and SHA-3. **Init** -```{doxygentypedef} Hacl_Streaming_SHA2_state_sha2_512 +```{doxygentypedef} Hacl_Hash_SHA2_state_t_512 ``` -```{doxygenfunction} Hacl_Streaming_SHA2_create_in_512 -``` - -```{doxygenfunction} Hacl_Streaming_SHA2_init_512 +```{doxygenfunction} Hacl_Hash_SHA2_malloc_512 ``` **Update** -```{doxygenfunction} Hacl_Streaming_SHA2_update_512 +```{doxygenfunction} Hacl_Hash_SHA2_update_512 ``` **Finish** -```{doxygenfunction} Hacl_Streaming_SHA2_finish_512 +```{doxygenfunction} Hacl_Hash_SHA2_digest_512 +``` + +```{doxygenfunction} Hacl_Hash_SHA2_reset_512 ``` -```{doxygenfunction} Hacl_Streaming_SHA2_free_512 +```{doxygenfunction} Hacl_Hash_SHA2_free_512 ``` ```` ````` diff --git a/docs/reference/hacl/hash/sha3.md b/docs/reference/hacl/hash/sha3.md index 9fae5bb4..1bbe5e3e 100644 --- a/docs/reference/hacl/hash/sha3.md +++ b/docs/reference/hacl/hash/sha3.md @@ -34,22 +34,22 @@ SHAKE128 and SHAKE256 have a 128- or 256-bit security strength and can produce a `````{tabs} ````{tab} 28 byte digest -```{doxygenfunction} Hacl_SHA3_sha3_224 +```{doxygenfunction} Hacl_Hash_SHA3_sha3_224 ``` ```` ````{tab} 32 byte digest -```{doxygenfunction} Hacl_SHA3_sha3_256 +```{doxygenfunction} Hacl_Hash_SHA3_sha3_256 ``` ```` ````{tab} 48 byte digest -```{doxygenfunction} Hacl_SHA3_sha3_384 +```{doxygenfunction} Hacl_Hash_SHA3_sha3_384 ``` ```` ````{tab} 64 byte digest -```{doxygenfunction} Hacl_SHA3_sha3_512 +```{doxygenfunction} Hacl_Hash_SHA3_sha3_512 ``` ```` ````` @@ -79,22 +79,22 @@ SHAKE128 and SHAKE256 have a 128- or 256-bit security strength and can produce a :end-before: "// ANCHOR_END(streaming)" ``` -```{doxygentypedef} Hacl_Streaming_SHA3_state_256 +```{doxygentypedef} Hacl_Hash_SHA3_state_t ``` -```{doxygenfunction} Hacl_Streaming_SHA3_create_in_256 +```{doxygenfunction} Hacl_Hash_SHA3_malloc ``` -```{doxygenfunction} Hacl_Streaming_SHA3_init_256 +```{doxygenfunction} Hacl_Hash_SHA3_update ``` -```{doxygenfunction} Hacl_Streaming_SHA3_update_256 +```{doxygenfunction} Hacl_Hash_SHA3_digest ``` -```{doxygenfunction} Hacl_Streaming_SHA3_finish_256 +```{doxygenfunction} Hacl_Hash_SHA3_reset ``` -```{doxygenfunction} Hacl_Streaming_SHA3_free_256 +```{doxygenfunction} Hacl_Hash_SHA3_free ``` ## SHAKE @@ -114,12 +114,12 @@ SHAKE128 and SHAKE256 have a 128- or 256-bit security strength and can produce a `````{tabs} ````{tab} 128-bit security strength -```{doxygenfunction} Hacl_SHA3_shake128_hacl +```{doxygenfunction} Hacl_Hash_SHA3_shake128_hacl ``` ```` ````{tab} 256-bit security strength -```{doxygenfunction} Hacl_SHA3_shake256_hacl +```{doxygenfunction} Hacl_Hash_SHA3_shake256_hacl ``` ```` ````` diff --git a/include/EverCrypt_Chacha20Poly1305.h b/include/EverCrypt_Chacha20Poly1305.h index c3eb2655..bd59e48b 100644 --- a/include/EverCrypt_Chacha20Poly1305.h +++ b/include/EverCrypt_Chacha20Poly1305.h @@ -35,9 +35,9 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -#include "Hacl_Chacha20Poly1305_32.h" -#include "Hacl_Chacha20Poly1305_256.h" -#include "Hacl_Chacha20Poly1305_128.h" +#include "Hacl_AEAD_Chacha20Poly1305_Simd256.h" +#include "Hacl_AEAD_Chacha20Poly1305_Simd128.h" +#include "Hacl_AEAD_Chacha20Poly1305.h" #include "EverCrypt_AutoConfig2.h" void diff --git a/include/EverCrypt_HMAC.h b/include/EverCrypt_HMAC.h index 6c64a37f..7d1da14d 100644 --- a/include/EverCrypt_HMAC.h +++ b/include/EverCrypt_HMAC.h @@ -38,13 +38,14 @@ extern "C" { #include "Hacl_Streaming_Types.h" #include "Hacl_Krmllib.h" #include "Hacl_Hash_SHA2.h" -#include "Hacl_Hash_Blake2.h" +#include "Hacl_Hash_Blake2s.h" +#include "Hacl_Hash_Blake2b.h" bool EverCrypt_HMAC_is_supported_alg(Spec_Hash_Definitions_hash_alg uu___); typedef Spec_Hash_Definitions_hash_alg EverCrypt_HMAC_supported_alg; -extern void (*EverCrypt_HMAC_hash_256)(uint8_t *x0, uint32_t x1, uint8_t *x2); +extern void (*EverCrypt_HMAC_hash_256)(uint8_t *x0, uint8_t *x1, uint32_t x2); void EverCrypt_HMAC_compute( diff --git a/include/EverCrypt_Hash.h b/include/EverCrypt_Hash.h index 6791dc27..b35dcf5f 100644 --- a/include/EverCrypt_Hash.h +++ b/include/EverCrypt_Hash.h @@ -39,9 +39,10 @@ extern "C" { #include "Hacl_Krmllib.h" #include "Hacl_Hash_SHA3.h" #include "Hacl_Hash_SHA2.h" -#include "Hacl_Hash_Blake2s_128.h" -#include "Hacl_Hash_Blake2b_256.h" -#include "Hacl_Hash_Blake2.h" +#include "Hacl_Hash_Blake2s_Simd128.h" +#include "Hacl_Hash_Blake2s.h" +#include "Hacl_Hash_Blake2b_Simd256.h" +#include "Hacl_Hash_Blake2b.h" #include "EverCrypt_Error.h" #include "EverCrypt_AutoConfig2.h" @@ -49,13 +50,13 @@ typedef struct EverCrypt_Hash_state_s_s EverCrypt_Hash_state_s; uint32_t EverCrypt_Hash_Incremental_hash_len(Spec_Hash_Definitions_hash_alg a); -typedef struct EverCrypt_Hash_Incremental_hash_state_s +typedef struct EverCrypt_Hash_Incremental_state_t_s { EverCrypt_Hash_state_s *block_state; uint8_t *buf; uint64_t total_len; } -EverCrypt_Hash_Incremental_hash_state; +EverCrypt_Hash_Incremental_state_t; /** Allocate initial state for the agile hash. The argument `a` stands for the @@ -63,13 +64,13 @@ choice of algorithm (see Hacl_Spec.h). This API will automatically pick the most efficient implementation, provided you have called EverCrypt_AutoConfig2_init() before. The state is to be freed by calling `free`. */ -EverCrypt_Hash_Incremental_hash_state -*EverCrypt_Hash_Incremental_create_in(Spec_Hash_Definitions_hash_alg a); +EverCrypt_Hash_Incremental_state_t +*EverCrypt_Hash_Incremental_malloc(Spec_Hash_Definitions_hash_alg a); /** Reset an existing state to the initial hash state with empty data. */ -void EverCrypt_Hash_Incremental_init(EverCrypt_Hash_Incremental_hash_state *s); +void EverCrypt_Hash_Incremental_reset(EverCrypt_Hash_Incremental_state_t *state); /** Feed an arbitrary amount of data into the hash. This function returns @@ -80,34 +81,35 @@ algorithm. Both limits are unlikely to be attained in practice. */ EverCrypt_Error_error_code EverCrypt_Hash_Incremental_update( - EverCrypt_Hash_Incremental_hash_state *s, - uint8_t *data, - uint32_t len + EverCrypt_Hash_Incremental_state_t *state, + uint8_t *chunk, + uint32_t chunk_len ); /** Perform a run-time test to determine which algorithm was chosen for the given piece of state. */ Spec_Hash_Definitions_hash_alg -EverCrypt_Hash_Incremental_alg_of_state(EverCrypt_Hash_Incremental_hash_state *s); +EverCrypt_Hash_Incremental_alg_of_state(EverCrypt_Hash_Incremental_state_t *s); /** -Write the resulting hash into `dst`, an array whose length is +Write the resulting hash into `output`, an array whose length is algorithm-specific. You can use the macros defined earlier in this file to allocate a destination buffer of the right length. The state remains valid after -a call to `finish`, meaning the user may feed more data into the hash via +a call to `digest`, meaning the user may feed more data into the hash via `update`. (The finish function operates on an internal copy of the state and therefore does not invalidate the client-held state.) */ -void EverCrypt_Hash_Incremental_finish(EverCrypt_Hash_Incremental_hash_state *s, uint8_t *dst); +void +EverCrypt_Hash_Incremental_digest(EverCrypt_Hash_Incremental_state_t *state, uint8_t *output); /** Free a state previously allocated with `create_in`. */ -void EverCrypt_Hash_Incremental_free(EverCrypt_Hash_Incremental_hash_state *s); +void EverCrypt_Hash_Incremental_free(EverCrypt_Hash_Incremental_state_t *state); /** -Hash `input`, of len `len`, into `dst`, an array whose length is determined by +Hash `input`, of len `input_len`, into `output`, an array whose length is determined by your choice of algorithm `a` (see Hacl_Spec.h). You can use the macros defined earlier in this file to allocate a destination buffer of the right length. This API will automatically pick the most efficient implementation, provided you have @@ -116,34 +118,34 @@ called EverCrypt_AutoConfig2_init() before. void EverCrypt_Hash_Incremental_hash( Spec_Hash_Definitions_hash_alg a, - uint8_t *dst, + uint8_t *output, uint8_t *input, - uint32_t len + uint32_t input_len ); -#define MD5_HASH_LEN ((uint32_t)16U) +#define MD5_HASH_LEN (16U) -#define SHA1_HASH_LEN ((uint32_t)20U) +#define SHA1_HASH_LEN (20U) -#define SHA2_224_HASH_LEN ((uint32_t)28U) +#define SHA2_224_HASH_LEN (28U) -#define SHA2_256_HASH_LEN ((uint32_t)32U) +#define SHA2_256_HASH_LEN (32U) -#define SHA2_384_HASH_LEN ((uint32_t)48U) +#define SHA2_384_HASH_LEN (48U) -#define SHA2_512_HASH_LEN ((uint32_t)64U) +#define SHA2_512_HASH_LEN (64U) -#define SHA3_224_HASH_LEN ((uint32_t)28U) +#define SHA3_224_HASH_LEN (28U) -#define SHA3_256_HASH_LEN ((uint32_t)32U) +#define SHA3_256_HASH_LEN (32U) -#define SHA3_384_HASH_LEN ((uint32_t)48U) +#define SHA3_384_HASH_LEN (48U) -#define SHA3_512_HASH_LEN ((uint32_t)64U) +#define SHA3_512_HASH_LEN (64U) -#define BLAKE2S_HASH_LEN ((uint32_t)32U) +#define BLAKE2S_HASH_LEN (32U) -#define BLAKE2B_HASH_LEN ((uint32_t)64U) +#define BLAKE2B_HASH_LEN (64U) #if defined(__cplusplus) } diff --git a/include/EverCrypt_Poly1305.h b/include/EverCrypt_Poly1305.h index 62c00764..fba04059 100644 --- a/include/EverCrypt_Poly1305.h +++ b/include/EverCrypt_Poly1305.h @@ -35,12 +35,12 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -#include "Hacl_Poly1305_32.h" -#include "Hacl_Poly1305_256.h" -#include "Hacl_Poly1305_128.h" +#include "Hacl_MAC_Poly1305_Simd256.h" +#include "Hacl_MAC_Poly1305_Simd128.h" +#include "Hacl_MAC_Poly1305.h" #include "EverCrypt_AutoConfig2.h" -void EverCrypt_Poly1305_poly1305(uint8_t *dst, uint8_t *src, uint32_t len, uint8_t *key); +void EverCrypt_Poly1305_mac(uint8_t *output, uint8_t *input, uint32_t input_len, uint8_t *key); #if defined(__cplusplus) } diff --git a/include/Hacl_AEAD_Chacha20Poly1305.h b/include/Hacl_AEAD_Chacha20Poly1305.h new file mode 100644 index 00000000..2a8daa75 --- /dev/null +++ b/include/Hacl_AEAD_Chacha20Poly1305.h @@ -0,0 +1,104 @@ +/* MIT License + * + * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation + * Copyright (c) 2022-2023 HACL* Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + + +#ifndef __Hacl_AEAD_Chacha20Poly1305_H +#define __Hacl_AEAD_Chacha20Poly1305_H + +#if defined(__cplusplus) +extern "C" { +#endif + +#include +#include "krml/internal/types.h" +#include "krml/lowstar_endianness.h" +#include "krml/internal/target.h" + +#include "Hacl_Chacha20.h" + +/** +Encrypt a message `input` with key `key`. + +The arguments `key`, `nonce`, `data`, and `data_len` are same in encryption/decryption. +Note: Encryption and decryption can be executed in-place, i.e., `input` and `output` can point to the same memory. + +@param output Pointer to `input_len` bytes of memory where the ciphertext is written to. +@param tag Pointer to 16 bytes of memory where the mac is written to. +@param input Pointer to `input_len` bytes of memory where the message is read from. +@param input_len Length of the message. +@param data Pointer to `data_len` bytes of memory where the associated data is read from. +@param data_len Length of the associated data. +@param key Pointer to 32 bytes of memory where the AEAD key is read from. +@param nonce Pointer to 12 bytes of memory where the AEAD nonce is read from. +*/ +void +Hacl_AEAD_Chacha20Poly1305_encrypt( + uint8_t *output, + uint8_t *tag, + uint8_t *input, + uint32_t input_len, + uint8_t *data, + uint32_t data_len, + uint8_t *key, + uint8_t *nonce +); + +/** +Decrypt a ciphertext `input` with key `key`. + +The arguments `key`, `nonce`, `data`, and `data_len` are same in encryption/decryption. +Note: Encryption and decryption can be executed in-place, i.e., `output` and `input` can point to the same memory. + +If decryption succeeds, the resulting plaintext is stored in `output` and the function returns the success code 0. +If decryption fails, the array `output` remains unchanged and the function returns the error code 1. + +@param output Pointer to `input_len` bytes of memory where the message is written to. +@param input Pointer to `input_len` bytes of memory where the ciphertext is read from. +@param input_len Length of the ciphertext. +@param data Pointer to `data_len` bytes of memory where the associated data is read from. +@param data_len Length of the associated data. +@param key Pointer to 32 bytes of memory where the AEAD key is read from. +@param nonce Pointer to 12 bytes of memory where the AEAD nonce is read from. +@param tag Pointer to 16 bytes of memory where the mac is read from. + +@returns 0 on succeess; 1 on failure. +*/ +uint32_t +Hacl_AEAD_Chacha20Poly1305_decrypt( + uint8_t *output, + uint8_t *input, + uint32_t input_len, + uint8_t *data, + uint32_t data_len, + uint8_t *key, + uint8_t *nonce, + uint8_t *tag +); + +#if defined(__cplusplus) +} +#endif + +#define __Hacl_AEAD_Chacha20Poly1305_H_DEFINED +#endif diff --git a/include/Hacl_AEAD_Chacha20Poly1305_Simd128.h b/include/Hacl_AEAD_Chacha20Poly1305_Simd128.h new file mode 100644 index 00000000..de26c907 --- /dev/null +++ b/include/Hacl_AEAD_Chacha20Poly1305_Simd128.h @@ -0,0 +1,104 @@ +/* MIT License + * + * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation + * Copyright (c) 2022-2023 HACL* Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + + +#ifndef __Hacl_AEAD_Chacha20Poly1305_Simd128_H +#define __Hacl_AEAD_Chacha20Poly1305_Simd128_H + +#if defined(__cplusplus) +extern "C" { +#endif + +#include +#include "krml/internal/types.h" +#include "krml/lowstar_endianness.h" +#include "krml/internal/target.h" + +#include "Hacl_Chacha20_Vec128.h" + +/** +Encrypt a message `input` with key `key`. + +The arguments `key`, `nonce`, `data`, and `data_len` are same in encryption/decryption. +Note: Encryption and decryption can be executed in-place, i.e., `input` and `output` can point to the same memory. + +@param output Pointer to `input_len` bytes of memory where the ciphertext is written to. +@param tag Pointer to 16 bytes of memory where the mac is written to. +@param input Pointer to `input_len` bytes of memory where the message is read from. +@param input_len Length of the message. +@param data Pointer to `data_len` bytes of memory where the associated data is read from. +@param data_len Length of the associated data. +@param key Pointer to 32 bytes of memory where the AEAD key is read from. +@param nonce Pointer to 12 bytes of memory where the AEAD nonce is read from. +*/ +void +Hacl_AEAD_Chacha20Poly1305_Simd128_encrypt( + uint8_t *output, + uint8_t *tag, + uint8_t *input, + uint32_t input_len, + uint8_t *data, + uint32_t data_len, + uint8_t *key, + uint8_t *nonce +); + +/** +Decrypt a ciphertext `input` with key `key`. + +The arguments `key`, `nonce`, `data`, and `data_len` are same in encryption/decryption. +Note: Encryption and decryption can be executed in-place, i.e., `input` and `output` can point to the same memory. + +If decryption succeeds, the resulting plaintext is stored in `output` and the function returns the success code 0. +If decryption fails, the array `output` remains unchanged and the function returns the error code 1. + +@param output Pointer to `input_len` bytes of memory where the message is written to. +@param input Pointer to `input_len` bytes of memory where the ciphertext is read from. +@param input_len Length of the ciphertext. +@param data Pointer to `data_len` bytes of memory where the associated data is read from. +@param data_len Length of the associated data. +@param key Pointer to 32 bytes of memory where the AEAD key is read from. +@param nonce Pointer to 12 bytes of memory where the AEAD nonce is read from. +@param tag Pointer to 16 bytes of memory where the mac is read from. + +@returns 0 on succeess; 1 on failure. +*/ +uint32_t +Hacl_AEAD_Chacha20Poly1305_Simd128_decrypt( + uint8_t *output, + uint8_t *input, + uint32_t input_len, + uint8_t *data, + uint32_t data_len, + uint8_t *key, + uint8_t *nonce, + uint8_t *tag +); + +#if defined(__cplusplus) +} +#endif + +#define __Hacl_AEAD_Chacha20Poly1305_Simd128_H_DEFINED +#endif diff --git a/include/Hacl_AEAD_Chacha20Poly1305_Simd256.h b/include/Hacl_AEAD_Chacha20Poly1305_Simd256.h new file mode 100644 index 00000000..0abcdc59 --- /dev/null +++ b/include/Hacl_AEAD_Chacha20Poly1305_Simd256.h @@ -0,0 +1,104 @@ +/* MIT License + * + * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation + * Copyright (c) 2022-2023 HACL* Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + + +#ifndef __Hacl_AEAD_Chacha20Poly1305_Simd256_H +#define __Hacl_AEAD_Chacha20Poly1305_Simd256_H + +#if defined(__cplusplus) +extern "C" { +#endif + +#include +#include "krml/internal/types.h" +#include "krml/lowstar_endianness.h" +#include "krml/internal/target.h" + +#include "Hacl_Chacha20_Vec256.h" + +/** +Encrypt a message `input` with key `key`. + +The arguments `key`, `nonce`, `data`, and `data_len` are same in encryption/decryption. +Note: Encryption and decryption can be executed in-place, i.e., `input` and `output` can point to the same memory. + +@param output Pointer to `input_len` bytes of memory where the ciphertext is written to. +@param tag Pointer to 16 bytes of memory where the mac is written to. +@param input Pointer to `input_len` bytes of memory where the message is read from. +@param input_len Length of the message. +@param data Pointer to `data_len` bytes of memory where the associated data is read from. +@param data_len Length of the associated data. +@param key Pointer to 32 bytes of memory where the AEAD key is read from. +@param nonce Pointer to 12 bytes of memory where the AEAD nonce is read from. +*/ +void +Hacl_AEAD_Chacha20Poly1305_Simd256_encrypt( + uint8_t *output, + uint8_t *tag, + uint8_t *input, + uint32_t input_len, + uint8_t *data, + uint32_t data_len, + uint8_t *key, + uint8_t *nonce +); + +/** +Decrypt a ciphertext `input` with key `key`. + +The arguments `key`, `nonce`, `data`, and `data_len` are same in encryption/decryption. +Note: Encryption and decryption can be executed in-place, i.e., `input` and `output` can point to the same memory. + +If decryption succeeds, the resulting plaintext is stored in `output` and the function returns the success code 0. +If decryption fails, the array `output` remains unchanged and the function returns the error code 1. + +@param output Pointer to `input_len` bytes of memory where the message is written to. +@param input Pointer to `input_len` bytes of memory where the ciphertext is read from. +@param input_len Length of the ciphertext. +@param data Pointer to `data_len` bytes of memory where the associated data is read from. +@param data_len Length of the associated data. +@param key Pointer to 32 bytes of memory where the AEAD key is read from. +@param nonce Pointer to 12 bytes of memory where the AEAD nonce is read from. +@param tag Pointer to 16 bytes of memory where the mac is read from. + +@returns 0 on succeess; 1 on failure. +*/ +uint32_t +Hacl_AEAD_Chacha20Poly1305_Simd256_decrypt( + uint8_t *output, + uint8_t *input, + uint32_t input_len, + uint8_t *data, + uint32_t data_len, + uint8_t *key, + uint8_t *nonce, + uint8_t *tag +); + +#if defined(__cplusplus) +} +#endif + +#define __Hacl_AEAD_Chacha20Poly1305_Simd256_H_DEFINED +#endif diff --git a/include/Hacl_Chacha20Poly1305_128.h b/include/Hacl_Chacha20Poly1305_128.h deleted file mode 100644 index 630fab93..00000000 --- a/include/Hacl_Chacha20Poly1305_128.h +++ /dev/null @@ -1,107 +0,0 @@ -/* MIT License - * - * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation - * Copyright (c) 2022-2023 HACL* Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - - -#ifndef __Hacl_Chacha20Poly1305_128_H -#define __Hacl_Chacha20Poly1305_128_H - -#if defined(__cplusplus) -extern "C" { -#endif - -#include -#include "krml/internal/types.h" -#include "krml/lowstar_endianness.h" -#include "krml/internal/target.h" - -#include "Hacl_Poly1305_128.h" -#include "Hacl_Chacha20_Vec128.h" - -/** -Encrypt a message `m` with key `k`. - -The arguments `k`, `n`, `aadlen`, and `aad` are same in encryption/decryption. -Note: Encryption and decryption can be executed in-place, i.e., `m` and `cipher` can point to the same memory. - -@param k Pointer to 32 bytes of memory where the AEAD key is read from. -@param n Pointer to 12 bytes of memory where the AEAD nonce is read from. -@param aadlen Length of the associated data. -@param aad Pointer to `aadlen` bytes of memory where the associated data is read from. - -@param mlen Length of the message. -@param m Pointer to `mlen` bytes of memory where the message is read from. -@param cipher Pointer to `mlen` bytes of memory where the ciphertext is written to. -@param mac Pointer to 16 bytes of memory where the mac is written to. -*/ -void -Hacl_Chacha20Poly1305_128_aead_encrypt( - uint8_t *k, - uint8_t *n, - uint32_t aadlen, - uint8_t *aad, - uint32_t mlen, - uint8_t *m, - uint8_t *cipher, - uint8_t *mac -); - -/** -Decrypt a ciphertext `cipher` with key `k`. - -The arguments `k`, `n`, `aadlen`, and `aad` are same in encryption/decryption. -Note: Encryption and decryption can be executed in-place, i.e., `m` and `cipher` can point to the same memory. - -If decryption succeeds, the resulting plaintext is stored in `m` and the function returns the success code 0. -If decryption fails, the array `m` remains unchanged and the function returns the error code 1. - -@param k Pointer to 32 bytes of memory where the AEAD key is read from. -@param n Pointer to 12 bytes of memory where the AEAD nonce is read from. -@param aadlen Length of the associated data. -@param aad Pointer to `aadlen` bytes of memory where the associated data is read from. - -@param mlen Length of the ciphertext. -@param m Pointer to `mlen` bytes of memory where the message is written to. -@param cipher Pointer to `mlen` bytes of memory where the ciphertext is read from. -@param mac Pointer to 16 bytes of memory where the mac is read from. - -@returns 0 on succeess; 1 on failure. -*/ -uint32_t -Hacl_Chacha20Poly1305_128_aead_decrypt( - uint8_t *k, - uint8_t *n, - uint32_t aadlen, - uint8_t *aad, - uint32_t mlen, - uint8_t *m, - uint8_t *cipher, - uint8_t *mac -); - -#if defined(__cplusplus) -} -#endif - -#define __Hacl_Chacha20Poly1305_128_H_DEFINED -#endif diff --git a/include/Hacl_Chacha20Poly1305_256.h b/include/Hacl_Chacha20Poly1305_256.h deleted file mode 100644 index ff0f2e60..00000000 --- a/include/Hacl_Chacha20Poly1305_256.h +++ /dev/null @@ -1,107 +0,0 @@ -/* MIT License - * - * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation - * Copyright (c) 2022-2023 HACL* Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - - -#ifndef __Hacl_Chacha20Poly1305_256_H -#define __Hacl_Chacha20Poly1305_256_H - -#if defined(__cplusplus) -extern "C" { -#endif - -#include -#include "krml/internal/types.h" -#include "krml/lowstar_endianness.h" -#include "krml/internal/target.h" - -#include "Hacl_Poly1305_256.h" -#include "Hacl_Chacha20_Vec256.h" - -/** -Encrypt a message `m` with key `k`. - -The arguments `k`, `n`, `aadlen`, and `aad` are same in encryption/decryption. -Note: Encryption and decryption can be executed in-place, i.e., `m` and `cipher` can point to the same memory. - -@param k Pointer to 32 bytes of memory where the AEAD key is read from. -@param n Pointer to 12 bytes of memory where the AEAD nonce is read from. -@param aadlen Length of the associated data. -@param aad Pointer to `aadlen` bytes of memory where the associated data is read from. - -@param mlen Length of the message. -@param m Pointer to `mlen` bytes of memory where the message is read from. -@param cipher Pointer to `mlen` bytes of memory where the ciphertext is written to. -@param mac Pointer to 16 bytes of memory where the mac is written to. -*/ -void -Hacl_Chacha20Poly1305_256_aead_encrypt( - uint8_t *k, - uint8_t *n, - uint32_t aadlen, - uint8_t *aad, - uint32_t mlen, - uint8_t *m, - uint8_t *cipher, - uint8_t *mac -); - -/** -Decrypt a ciphertext `cipher` with key `k`. - -The arguments `k`, `n`, `aadlen`, and `aad` are same in encryption/decryption. -Note: Encryption and decryption can be executed in-place, i.e., `m` and `cipher` can point to the same memory. - -If decryption succeeds, the resulting plaintext is stored in `m` and the function returns the success code 0. -If decryption fails, the array `m` remains unchanged and the function returns the error code 1. - -@param k Pointer to 32 bytes of memory where the AEAD key is read from. -@param n Pointer to 12 bytes of memory where the AEAD nonce is read from. -@param aadlen Length of the associated data. -@param aad Pointer to `aadlen` bytes of memory where the associated data is read from. - -@param mlen Length of the ciphertext. -@param m Pointer to `mlen` bytes of memory where the message is written to. -@param cipher Pointer to `mlen` bytes of memory where the ciphertext is read from. -@param mac Pointer to 16 bytes of memory where the mac is read from. - -@returns 0 on succeess; 1 on failure. -*/ -uint32_t -Hacl_Chacha20Poly1305_256_aead_decrypt( - uint8_t *k, - uint8_t *n, - uint32_t aadlen, - uint8_t *aad, - uint32_t mlen, - uint8_t *m, - uint8_t *cipher, - uint8_t *mac -); - -#if defined(__cplusplus) -} -#endif - -#define __Hacl_Chacha20Poly1305_256_H_DEFINED -#endif diff --git a/include/Hacl_Chacha20Poly1305_32.h b/include/Hacl_Chacha20Poly1305_32.h deleted file mode 100644 index 624e29fb..00000000 --- a/include/Hacl_Chacha20Poly1305_32.h +++ /dev/null @@ -1,107 +0,0 @@ -/* MIT License - * - * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation - * Copyright (c) 2022-2023 HACL* Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - - -#ifndef __Hacl_Chacha20Poly1305_32_H -#define __Hacl_Chacha20Poly1305_32_H - -#if defined(__cplusplus) -extern "C" { -#endif - -#include -#include "krml/internal/types.h" -#include "krml/lowstar_endianness.h" -#include "krml/internal/target.h" - -#include "Hacl_Poly1305_32.h" -#include "Hacl_Chacha20.h" - -/** -Encrypt a message `m` with key `k`. - -The arguments `k`, `n`, `aadlen`, and `aad` are same in encryption/decryption. -Note: Encryption and decryption can be executed in-place, i.e., `m` and `cipher` can point to the same memory. - -@param k Pointer to 32 bytes of memory where the AEAD key is read from. -@param n Pointer to 12 bytes of memory where the AEAD nonce is read from. -@param aadlen Length of the associated data. -@param aad Pointer to `aadlen` bytes of memory where the associated data is read from. - -@param mlen Length of the message. -@param m Pointer to `mlen` bytes of memory where the message is read from. -@param cipher Pointer to `mlen` bytes of memory where the ciphertext is written to. -@param mac Pointer to 16 bytes of memory where the mac is written to. -*/ -void -Hacl_Chacha20Poly1305_32_aead_encrypt( - uint8_t *k, - uint8_t *n, - uint32_t aadlen, - uint8_t *aad, - uint32_t mlen, - uint8_t *m, - uint8_t *cipher, - uint8_t *mac -); - -/** -Decrypt a ciphertext `cipher` with key `k`. - -The arguments `k`, `n`, `aadlen`, and `aad` are same in encryption/decryption. -Note: Encryption and decryption can be executed in-place, i.e., `m` and `cipher` can point to the same memory. - -If decryption succeeds, the resulting plaintext is stored in `m` and the function returns the success code 0. -If decryption fails, the array `m` remains unchanged and the function returns the error code 1. - -@param k Pointer to 32 bytes of memory where the AEAD key is read from. -@param n Pointer to 12 bytes of memory where the AEAD nonce is read from. -@param aadlen Length of the associated data. -@param aad Pointer to `aadlen` bytes of memory where the associated data is read from. - -@param mlen Length of the ciphertext. -@param m Pointer to `mlen` bytes of memory where the message is written to. -@param cipher Pointer to `mlen` bytes of memory where the ciphertext is read from. -@param mac Pointer to 16 bytes of memory where the mac is read from. - -@returns 0 on succeess; 1 on failure. -*/ -uint32_t -Hacl_Chacha20Poly1305_32_aead_decrypt( - uint8_t *k, - uint8_t *n, - uint32_t aadlen, - uint8_t *aad, - uint32_t mlen, - uint8_t *m, - uint8_t *cipher, - uint8_t *mac -); - -#if defined(__cplusplus) -} -#endif - -#define __Hacl_Chacha20Poly1305_32_H_DEFINED -#endif diff --git a/include/Hacl_HMAC.h b/include/Hacl_HMAC.h index 84dbedf5..e1dc04f2 100644 --- a/include/Hacl_HMAC.h +++ b/include/Hacl_HMAC.h @@ -37,7 +37,8 @@ extern "C" { #include "Hacl_Krmllib.h" #include "Hacl_Hash_SHA2.h" -#include "Hacl_Hash_Blake2.h" +#include "Hacl_Hash_Blake2s.h" +#include "Hacl_Hash_Blake2b.h" /** Write the HMAC-SHA-1 MAC of a message (`data`) by using a key (`key`) into `dst`. @@ -46,7 +47,7 @@ The key can be any length and will be hashed if it is longer and padded if it is `dst` must point to 20 bytes of memory. */ void -Hacl_HMAC_legacy_compute_sha1( +Hacl_HMAC_compute_sha1( uint8_t *dst, uint8_t *key, uint32_t key_len, diff --git a/include/Hacl_HMAC_Blake2b_256.h b/include/Hacl_HMAC_Blake2b_256.h index e94ba05f..d8f3e9e1 100644 --- a/include/Hacl_HMAC_Blake2b_256.h +++ b/include/Hacl_HMAC_Blake2b_256.h @@ -36,7 +36,7 @@ extern "C" { #include "krml/internal/target.h" #include "Hacl_Krmllib.h" -#include "Hacl_Hash_Blake2b_256.h" +#include "Hacl_Hash_Blake2b_Simd256.h" /** Write the HMAC-BLAKE2b MAC of a message (`data`) by using a key (`key`) into `dst`. diff --git a/include/Hacl_HMAC_Blake2s_128.h b/include/Hacl_HMAC_Blake2s_128.h index 7f20343e..5ff79038 100644 --- a/include/Hacl_HMAC_Blake2s_128.h +++ b/include/Hacl_HMAC_Blake2s_128.h @@ -35,7 +35,7 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -#include "Hacl_Hash_Blake2s_128.h" +#include "Hacl_Hash_Blake2s_Simd128.h" /** Write the HMAC-BLAKE2s MAC of a message (`data`) by using a key (`key`) into `dst`. diff --git a/include/Hacl_HPKE_Curve51_CP128_SHA256.h b/include/Hacl_HPKE_Curve51_CP128_SHA256.h index a768df6b..a46db470 100644 --- a/include/Hacl_HPKE_Curve51_CP128_SHA256.h +++ b/include/Hacl_HPKE_Curve51_CP128_SHA256.h @@ -38,7 +38,7 @@ extern "C" { #include "Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE.h" #include "Hacl_HKDF.h" #include "Hacl_Curve25519_51.h" -#include "Hacl_Chacha20Poly1305_128.h" +#include "Hacl_AEAD_Chacha20Poly1305_Simd128.h" uint32_t Hacl_HPKE_Curve51_CP128_SHA256_setupBaseS( diff --git a/include/Hacl_HPKE_Curve51_CP128_SHA512.h b/include/Hacl_HPKE_Curve51_CP128_SHA512.h index a4388707..89091754 100644 --- a/include/Hacl_HPKE_Curve51_CP128_SHA512.h +++ b/include/Hacl_HPKE_Curve51_CP128_SHA512.h @@ -38,7 +38,7 @@ extern "C" { #include "Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE.h" #include "Hacl_HKDF.h" #include "Hacl_Curve25519_51.h" -#include "Hacl_Chacha20Poly1305_128.h" +#include "Hacl_AEAD_Chacha20Poly1305_Simd128.h" uint32_t Hacl_HPKE_Curve51_CP128_SHA512_setupBaseS( diff --git a/include/Hacl_HPKE_Curve51_CP256_SHA256.h b/include/Hacl_HPKE_Curve51_CP256_SHA256.h index 37b26f6a..83ba2adb 100644 --- a/include/Hacl_HPKE_Curve51_CP256_SHA256.h +++ b/include/Hacl_HPKE_Curve51_CP256_SHA256.h @@ -38,7 +38,7 @@ extern "C" { #include "Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE.h" #include "Hacl_HKDF.h" #include "Hacl_Curve25519_51.h" -#include "Hacl_Chacha20Poly1305_256.h" +#include "Hacl_AEAD_Chacha20Poly1305_Simd256.h" uint32_t Hacl_HPKE_Curve51_CP256_SHA256_setupBaseS( diff --git a/include/Hacl_HPKE_Curve51_CP256_SHA512.h b/include/Hacl_HPKE_Curve51_CP256_SHA512.h index f7240a95..1a796ab7 100644 --- a/include/Hacl_HPKE_Curve51_CP256_SHA512.h +++ b/include/Hacl_HPKE_Curve51_CP256_SHA512.h @@ -38,7 +38,7 @@ extern "C" { #include "Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE.h" #include "Hacl_HKDF.h" #include "Hacl_Curve25519_51.h" -#include "Hacl_Chacha20Poly1305_256.h" +#include "Hacl_AEAD_Chacha20Poly1305_Simd256.h" uint32_t Hacl_HPKE_Curve51_CP256_SHA512_setupBaseS( diff --git a/include/Hacl_HPKE_Curve51_CP32_SHA256.h b/include/Hacl_HPKE_Curve51_CP32_SHA256.h index e48242e6..d249ba05 100644 --- a/include/Hacl_HPKE_Curve51_CP32_SHA256.h +++ b/include/Hacl_HPKE_Curve51_CP32_SHA256.h @@ -38,7 +38,7 @@ extern "C" { #include "Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE.h" #include "Hacl_HKDF.h" #include "Hacl_Curve25519_51.h" -#include "Hacl_Chacha20Poly1305_32.h" +#include "Hacl_AEAD_Chacha20Poly1305.h" uint32_t Hacl_HPKE_Curve51_CP32_SHA256_setupBaseS( diff --git a/include/Hacl_HPKE_Curve51_CP32_SHA512.h b/include/Hacl_HPKE_Curve51_CP32_SHA512.h index 057f8769..ddc00da3 100644 --- a/include/Hacl_HPKE_Curve51_CP32_SHA512.h +++ b/include/Hacl_HPKE_Curve51_CP32_SHA512.h @@ -38,7 +38,7 @@ extern "C" { #include "Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE.h" #include "Hacl_HKDF.h" #include "Hacl_Curve25519_51.h" -#include "Hacl_Chacha20Poly1305_32.h" +#include "Hacl_AEAD_Chacha20Poly1305.h" uint32_t Hacl_HPKE_Curve51_CP32_SHA512_setupBaseS( diff --git a/include/Hacl_HPKE_Curve64_CP128_SHA256.h b/include/Hacl_HPKE_Curve64_CP128_SHA256.h index 1694a123..fda63e52 100644 --- a/include/Hacl_HPKE_Curve64_CP128_SHA256.h +++ b/include/Hacl_HPKE_Curve64_CP128_SHA256.h @@ -38,7 +38,7 @@ extern "C" { #include "Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE.h" #include "Hacl_HKDF.h" #include "Hacl_Curve25519_64.h" -#include "Hacl_Chacha20Poly1305_128.h" +#include "Hacl_AEAD_Chacha20Poly1305_Simd128.h" uint32_t Hacl_HPKE_Curve64_CP128_SHA256_setupBaseS( diff --git a/include/Hacl_HPKE_Curve64_CP128_SHA512.h b/include/Hacl_HPKE_Curve64_CP128_SHA512.h index 23f52f25..c8b06ca8 100644 --- a/include/Hacl_HPKE_Curve64_CP128_SHA512.h +++ b/include/Hacl_HPKE_Curve64_CP128_SHA512.h @@ -38,7 +38,7 @@ extern "C" { #include "Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE.h" #include "Hacl_HKDF.h" #include "Hacl_Curve25519_64.h" -#include "Hacl_Chacha20Poly1305_128.h" +#include "Hacl_AEAD_Chacha20Poly1305_Simd128.h" uint32_t Hacl_HPKE_Curve64_CP128_SHA512_setupBaseS( diff --git a/include/Hacl_HPKE_Curve64_CP256_SHA256.h b/include/Hacl_HPKE_Curve64_CP256_SHA256.h index 33d471bc..2da8dbcf 100644 --- a/include/Hacl_HPKE_Curve64_CP256_SHA256.h +++ b/include/Hacl_HPKE_Curve64_CP256_SHA256.h @@ -38,7 +38,7 @@ extern "C" { #include "Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE.h" #include "Hacl_HKDF.h" #include "Hacl_Curve25519_64.h" -#include "Hacl_Chacha20Poly1305_256.h" +#include "Hacl_AEAD_Chacha20Poly1305_Simd256.h" uint32_t Hacl_HPKE_Curve64_CP256_SHA256_setupBaseS( diff --git a/include/Hacl_HPKE_Curve64_CP256_SHA512.h b/include/Hacl_HPKE_Curve64_CP256_SHA512.h index d59c1ee4..87d919e1 100644 --- a/include/Hacl_HPKE_Curve64_CP256_SHA512.h +++ b/include/Hacl_HPKE_Curve64_CP256_SHA512.h @@ -38,7 +38,7 @@ extern "C" { #include "Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE.h" #include "Hacl_HKDF.h" #include "Hacl_Curve25519_64.h" -#include "Hacl_Chacha20Poly1305_256.h" +#include "Hacl_AEAD_Chacha20Poly1305_Simd256.h" uint32_t Hacl_HPKE_Curve64_CP256_SHA512_setupBaseS( diff --git a/include/Hacl_HPKE_Curve64_CP32_SHA256.h b/include/Hacl_HPKE_Curve64_CP32_SHA256.h index 5aaa07e1..bd4b9b59 100644 --- a/include/Hacl_HPKE_Curve64_CP32_SHA256.h +++ b/include/Hacl_HPKE_Curve64_CP32_SHA256.h @@ -38,7 +38,7 @@ extern "C" { #include "Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE.h" #include "Hacl_HKDF.h" #include "Hacl_Curve25519_64.h" -#include "Hacl_Chacha20Poly1305_32.h" +#include "Hacl_AEAD_Chacha20Poly1305.h" uint32_t Hacl_HPKE_Curve64_CP32_SHA256_setupBaseS( diff --git a/include/Hacl_HPKE_Curve64_CP32_SHA512.h b/include/Hacl_HPKE_Curve64_CP32_SHA512.h index 594000f2..0d2bb8f0 100644 --- a/include/Hacl_HPKE_Curve64_CP32_SHA512.h +++ b/include/Hacl_HPKE_Curve64_CP32_SHA512.h @@ -38,7 +38,7 @@ extern "C" { #include "Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE.h" #include "Hacl_HKDF.h" #include "Hacl_Curve25519_64.h" -#include "Hacl_Chacha20Poly1305_32.h" +#include "Hacl_AEAD_Chacha20Poly1305.h" uint32_t Hacl_HPKE_Curve64_CP32_SHA512_setupBaseS( diff --git a/include/Hacl_HPKE_P256_CP128_SHA256.h b/include/Hacl_HPKE_P256_CP128_SHA256.h index 613fef83..c76a100d 100644 --- a/include/Hacl_HPKE_P256_CP128_SHA256.h +++ b/include/Hacl_HPKE_P256_CP128_SHA256.h @@ -37,7 +37,7 @@ extern "C" { #include "Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE.h" #include "Hacl_HKDF.h" -#include "Hacl_Chacha20Poly1305_128.h" +#include "Hacl_AEAD_Chacha20Poly1305_Simd128.h" uint32_t Hacl_HPKE_P256_CP128_SHA256_setupBaseS( diff --git a/include/Hacl_HPKE_P256_CP256_SHA256.h b/include/Hacl_HPKE_P256_CP256_SHA256.h index 6e74b1db..4a33eb8a 100644 --- a/include/Hacl_HPKE_P256_CP256_SHA256.h +++ b/include/Hacl_HPKE_P256_CP256_SHA256.h @@ -37,7 +37,7 @@ extern "C" { #include "Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE.h" #include "Hacl_HKDF.h" -#include "Hacl_Chacha20Poly1305_256.h" +#include "Hacl_AEAD_Chacha20Poly1305_Simd256.h" uint32_t Hacl_HPKE_P256_CP256_SHA256_setupBaseS( diff --git a/include/Hacl_HPKE_P256_CP32_SHA256.h b/include/Hacl_HPKE_P256_CP32_SHA256.h index 1f8679d4..2818abed 100644 --- a/include/Hacl_HPKE_P256_CP32_SHA256.h +++ b/include/Hacl_HPKE_P256_CP32_SHA256.h @@ -37,7 +37,7 @@ extern "C" { #include "Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE.h" #include "Hacl_HKDF.h" -#include "Hacl_Chacha20Poly1305_32.h" +#include "Hacl_AEAD_Chacha20Poly1305.h" uint32_t Hacl_HPKE_P256_CP32_SHA256_setupBaseS( diff --git a/include/Hacl_Hash_Blake2.h b/include/Hacl_Hash_Blake2.h deleted file mode 100644 index 3ee29015..00000000 --- a/include/Hacl_Hash_Blake2.h +++ /dev/null @@ -1,155 +0,0 @@ -/* MIT License - * - * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation - * Copyright (c) 2022-2023 HACL* Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - - -#ifndef __Hacl_Hash_Blake2_H -#define __Hacl_Hash_Blake2_H - -#if defined(__cplusplus) -extern "C" { -#endif - -#include -#include "krml/internal/types.h" -#include "krml/lowstar_endianness.h" -#include "krml/internal/target.h" - -#include "Hacl_Krmllib.h" - -void Hacl_Blake2b_32_blake2b_init(uint64_t *hash, uint32_t kk, uint32_t nn); - -void -Hacl_Blake2b_32_blake2b_update_key( - uint64_t *wv, - uint64_t *hash, - uint32_t kk, - uint8_t *k, - uint32_t ll -); - -void -Hacl_Blake2b_32_blake2b_update_multi( - uint32_t len, - uint64_t *wv, - uint64_t *hash, - FStar_UInt128_uint128 prev, - uint8_t *blocks, - uint32_t nb -); - -void -Hacl_Blake2b_32_blake2b_update_last( - uint32_t len, - uint64_t *wv, - uint64_t *hash, - FStar_UInt128_uint128 prev, - uint32_t rem, - uint8_t *d -); - -void Hacl_Blake2b_32_blake2b_finish(uint32_t nn, uint8_t *output, uint64_t *hash); - -/** -Write the BLAKE2b digest of message `d` using key `k` into `output`. - -@param nn Length of the to-be-generated digest with 1 <= `nn` <= 64. -@param output Pointer to `nn` bytes of memory where the digest is written to. -@param ll Length of the input message. -@param d Pointer to `ll` bytes of memory where the input message is read from. -@param kk Length of the key. Can be 0. -@param k Pointer to `kk` bytes of memory where the key is read from. -*/ -void -Hacl_Blake2b_32_blake2b( - uint32_t nn, - uint8_t *output, - uint32_t ll, - uint8_t *d, - uint32_t kk, - uint8_t *k -); - -uint64_t *Hacl_Blake2b_32_blake2b_malloc(void); - -void Hacl_Blake2s_32_blake2s_init(uint32_t *hash, uint32_t kk, uint32_t nn); - -void -Hacl_Blake2s_32_blake2s_update_key( - uint32_t *wv, - uint32_t *hash, - uint32_t kk, - uint8_t *k, - uint32_t ll -); - -void -Hacl_Blake2s_32_blake2s_update_multi( - uint32_t len, - uint32_t *wv, - uint32_t *hash, - uint64_t prev, - uint8_t *blocks, - uint32_t nb -); - -void -Hacl_Blake2s_32_blake2s_update_last( - uint32_t len, - uint32_t *wv, - uint32_t *hash, - uint64_t prev, - uint32_t rem, - uint8_t *d -); - -void Hacl_Blake2s_32_blake2s_finish(uint32_t nn, uint8_t *output, uint32_t *hash); - -/** -Write the BLAKE2s digest of message `d` using key `k` into `output`. - -@param nn Length of to-be-generated digest with 1 <= `nn` <= 32. -@param output Pointer to `nn` bytes of memory where the digest is written to. -@param ll Length of the input message. -@param d Pointer to `ll` bytes of memory where the input message is read from. -@param kk Length of the key. Can be 0. -@param k Pointer to `kk` bytes of memory where the key is read from. -*/ -void -Hacl_Blake2s_32_blake2s( - uint32_t nn, - uint8_t *output, - uint32_t ll, - uint8_t *d, - uint32_t kk, - uint8_t *k -); - -uint32_t *Hacl_Blake2s_32_blake2s_malloc(void); - -#if defined(__cplusplus) -} -#endif - -#define __Hacl_Hash_Blake2_H_DEFINED -#endif diff --git a/include/Hacl_Streaming_Blake2b_256.h b/include/Hacl_Hash_Blake2b.h similarity index 56% rename from include/Hacl_Streaming_Blake2b_256.h rename to include/Hacl_Hash_Blake2b.h index 20e42d7c..414574f9 100644 --- a/include/Hacl_Streaming_Blake2b_256.h +++ b/include/Hacl_Hash_Blake2b.h @@ -23,8 +23,8 @@ */ -#ifndef __Hacl_Streaming_Blake2b_256_H -#define __Hacl_Streaming_Blake2b_256_H +#ifndef __Hacl_Hash_Blake2b_H +#define __Hacl_Hash_Blake2b_H #if defined(__cplusplus) extern "C" { @@ -37,67 +37,71 @@ extern "C" { #include "Hacl_Streaming_Types.h" #include "Hacl_Krmllib.h" -#include "Hacl_Hash_Blake2b_256.h" -typedef struct Hacl_Streaming_Blake2b_256_blake2b_256_block_state_s +typedef struct Hacl_Hash_Blake2b_block_state_t_s { - Lib_IntVector_Intrinsics_vec256 *fst; - Lib_IntVector_Intrinsics_vec256 *snd; + uint64_t *fst; + uint64_t *snd; } -Hacl_Streaming_Blake2b_256_blake2b_256_block_state; +Hacl_Hash_Blake2b_block_state_t; -typedef struct Hacl_Streaming_Blake2b_256_blake2b_256_state_s +typedef struct Hacl_Hash_Blake2b_state_t_s { - Hacl_Streaming_Blake2b_256_blake2b_256_block_state block_state; + Hacl_Hash_Blake2b_block_state_t block_state; uint8_t *buf; uint64_t total_len; } -Hacl_Streaming_Blake2b_256_blake2b_256_state; +Hacl_Hash_Blake2b_state_t; /** State allocation function when there is no key */ -Hacl_Streaming_Blake2b_256_blake2b_256_state -*Hacl_Streaming_Blake2b_256_blake2b_256_no_key_create_in(void); +Hacl_Hash_Blake2b_state_t *Hacl_Hash_Blake2b_malloc(void); /** - (Re-)initialization function when there is no key + Re-initialization function when there is no key */ -void -Hacl_Streaming_Blake2b_256_blake2b_256_no_key_init( - Hacl_Streaming_Blake2b_256_blake2b_256_state *s -); +void Hacl_Hash_Blake2b_reset(Hacl_Hash_Blake2b_state_t *state); /** Update function when there is no key; 0 = success, 1 = max length exceeded */ Hacl_Streaming_Types_error_code -Hacl_Streaming_Blake2b_256_blake2b_256_no_key_update( - Hacl_Streaming_Blake2b_256_blake2b_256_state *p, - uint8_t *data, - uint32_t len -); +Hacl_Hash_Blake2b_update(Hacl_Hash_Blake2b_state_t *state, uint8_t *chunk, uint32_t chunk_len); /** Finish function when there is no key */ -void -Hacl_Streaming_Blake2b_256_blake2b_256_no_key_finish( - Hacl_Streaming_Blake2b_256_blake2b_256_state *p, - uint8_t *dst -); +void Hacl_Hash_Blake2b_digest(Hacl_Hash_Blake2b_state_t *state, uint8_t *output); /** Free state function when there is no key */ +void Hacl_Hash_Blake2b_free(Hacl_Hash_Blake2b_state_t *state); + +/** +Write the BLAKE2b digest of message `input` using key `key` into `output`. + +@param output Pointer to `output_len` bytes of memory where the digest is written to. +@param output_len Length of the to-be-generated digest with 1 <= `output_len` <= 64. +@param input Pointer to `input_len` bytes of memory where the input message is read from. +@param input_len Length of the input message. +@param key Pointer to `key_len` bytes of memory where the key is read from. +@param key_len Length of the key. Can be 0. +*/ void -Hacl_Streaming_Blake2b_256_blake2b_256_no_key_free( - Hacl_Streaming_Blake2b_256_blake2b_256_state *s +Hacl_Hash_Blake2b_hash_with_key( + uint8_t *output, + uint32_t output_len, + uint8_t *input, + uint32_t input_len, + uint8_t *key, + uint32_t key_len ); #if defined(__cplusplus) } #endif -#define __Hacl_Streaming_Blake2b_256_H_DEFINED +#define __Hacl_Hash_Blake2b_H_DEFINED #endif diff --git a/include/Hacl_Hash_Blake2b_Simd256.h b/include/Hacl_Hash_Blake2b_Simd256.h new file mode 100644 index 00000000..adddce66 --- /dev/null +++ b/include/Hacl_Hash_Blake2b_Simd256.h @@ -0,0 +1,113 @@ +/* MIT License + * + * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation + * Copyright (c) 2022-2023 HACL* Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + + +#ifndef __Hacl_Hash_Blake2b_Simd256_H +#define __Hacl_Hash_Blake2b_Simd256_H + +#if defined(__cplusplus) +extern "C" { +#endif + +#include +#include "krml/internal/types.h" +#include "krml/lowstar_endianness.h" +#include "krml/internal/target.h" + +#include "Hacl_Streaming_Types.h" +#include "Hacl_Krmllib.h" +#include "libintvector.h" + +typedef struct Hacl_Hash_Blake2b_Simd256_block_state_t_s +{ + Lib_IntVector_Intrinsics_vec256 *fst; + Lib_IntVector_Intrinsics_vec256 *snd; +} +Hacl_Hash_Blake2b_Simd256_block_state_t; + +typedef struct Hacl_Hash_Blake2b_Simd256_state_t_s +{ + Hacl_Hash_Blake2b_Simd256_block_state_t block_state; + uint8_t *buf; + uint64_t total_len; +} +Hacl_Hash_Blake2b_Simd256_state_t; + +/** + State allocation function when there is no key +*/ +Hacl_Hash_Blake2b_Simd256_state_t *Hacl_Hash_Blake2b_Simd256_malloc(void); + +/** + Re-initialization function when there is no key +*/ +void Hacl_Hash_Blake2b_Simd256_reset(Hacl_Hash_Blake2b_Simd256_state_t *state); + +/** + Update function when there is no key; 0 = success, 1 = max length exceeded +*/ +Hacl_Streaming_Types_error_code +Hacl_Hash_Blake2b_Simd256_update( + Hacl_Hash_Blake2b_Simd256_state_t *state, + uint8_t *chunk, + uint32_t chunk_len +); + +/** + Finish function when there is no key +*/ +void +Hacl_Hash_Blake2b_Simd256_digest(Hacl_Hash_Blake2b_Simd256_state_t *state, uint8_t *output); + +/** + Free state function when there is no key +*/ +void Hacl_Hash_Blake2b_Simd256_free(Hacl_Hash_Blake2b_Simd256_state_t *state); + +/** +Write the BLAKE2b digest of message `input` using key `key` into `output`. + +@param output Pointer to `output_len` bytes of memory where the digest is written to. +@param output_len Length of the to-be-generated digest with 1 <= `output_len` <= 64. +@param input Pointer to `input_len` bytes of memory where the input message is read from. +@param input_len Length of the input message. +@param key Pointer to `key_len` bytes of memory where the key is read from. +@param key_len Length of the key. Can be 0. +*/ +void +Hacl_Hash_Blake2b_Simd256_hash_with_key( + uint8_t *output, + uint32_t output_len, + uint8_t *input, + uint32_t input_len, + uint8_t *key, + uint32_t key_len +); + +#if defined(__cplusplus) +} +#endif + +#define __Hacl_Hash_Blake2b_Simd256_H_DEFINED +#endif diff --git a/include/Hacl_Streaming_Blake2s_128.h b/include/Hacl_Hash_Blake2s.h similarity index 56% rename from include/Hacl_Streaming_Blake2s_128.h rename to include/Hacl_Hash_Blake2s.h index 60e209ff..2c0d7c5b 100644 --- a/include/Hacl_Streaming_Blake2s_128.h +++ b/include/Hacl_Hash_Blake2s.h @@ -23,8 +23,8 @@ */ -#ifndef __Hacl_Streaming_Blake2s_128_H -#define __Hacl_Streaming_Blake2s_128_H +#ifndef __Hacl_Hash_Blake2s_H +#define __Hacl_Hash_Blake2s_H #if defined(__cplusplus) extern "C" { @@ -36,67 +36,71 @@ extern "C" { #include "krml/internal/target.h" #include "Hacl_Streaming_Types.h" -#include "Hacl_Hash_Blake2s_128.h" -typedef struct Hacl_Streaming_Blake2s_128_blake2s_128_block_state_s +typedef struct Hacl_Hash_Blake2s_block_state_t_s { - Lib_IntVector_Intrinsics_vec128 *fst; - Lib_IntVector_Intrinsics_vec128 *snd; + uint32_t *fst; + uint32_t *snd; } -Hacl_Streaming_Blake2s_128_blake2s_128_block_state; +Hacl_Hash_Blake2s_block_state_t; -typedef struct Hacl_Streaming_Blake2s_128_blake2s_128_state_s +typedef struct Hacl_Hash_Blake2s_state_t_s { - Hacl_Streaming_Blake2s_128_blake2s_128_block_state block_state; + Hacl_Hash_Blake2s_block_state_t block_state; uint8_t *buf; uint64_t total_len; } -Hacl_Streaming_Blake2s_128_blake2s_128_state; +Hacl_Hash_Blake2s_state_t; /** State allocation function when there is no key */ -Hacl_Streaming_Blake2s_128_blake2s_128_state -*Hacl_Streaming_Blake2s_128_blake2s_128_no_key_create_in(void); +Hacl_Hash_Blake2s_state_t *Hacl_Hash_Blake2s_malloc(void); /** - (Re-)initialization function when there is no key + Re-initialization function when there is no key */ -void -Hacl_Streaming_Blake2s_128_blake2s_128_no_key_init( - Hacl_Streaming_Blake2s_128_blake2s_128_state *s -); +void Hacl_Hash_Blake2s_reset(Hacl_Hash_Blake2s_state_t *state); /** Update function when there is no key; 0 = success, 1 = max length exceeded */ Hacl_Streaming_Types_error_code -Hacl_Streaming_Blake2s_128_blake2s_128_no_key_update( - Hacl_Streaming_Blake2s_128_blake2s_128_state *p, - uint8_t *data, - uint32_t len -); +Hacl_Hash_Blake2s_update(Hacl_Hash_Blake2s_state_t *state, uint8_t *chunk, uint32_t chunk_len); /** Finish function when there is no key */ -void -Hacl_Streaming_Blake2s_128_blake2s_128_no_key_finish( - Hacl_Streaming_Blake2s_128_blake2s_128_state *p, - uint8_t *dst -); +void Hacl_Hash_Blake2s_digest(Hacl_Hash_Blake2s_state_t *state, uint8_t *output); /** Free state function when there is no key */ +void Hacl_Hash_Blake2s_free(Hacl_Hash_Blake2s_state_t *state); + +/** +Write the BLAKE2s digest of message `input` using key `key` into `output`. + +@param output Pointer to `output_len` bytes of memory where the digest is written to. +@param output_len Length of the to-be-generated digest with 1 <= `output_len` <= 32. +@param input Pointer to `input_len` bytes of memory where the input message is read from. +@param input_len Length of the input message. +@param key Pointer to `key_len` bytes of memory where the key is read from. +@param key_len Length of the key. Can be 0. +*/ void -Hacl_Streaming_Blake2s_128_blake2s_128_no_key_free( - Hacl_Streaming_Blake2s_128_blake2s_128_state *s +Hacl_Hash_Blake2s_hash_with_key( + uint8_t *output, + uint32_t output_len, + uint8_t *input, + uint32_t input_len, + uint8_t *key, + uint32_t key_len ); #if defined(__cplusplus) } #endif -#define __Hacl_Streaming_Blake2s_128_H_DEFINED +#define __Hacl_Hash_Blake2s_H_DEFINED #endif diff --git a/include/Hacl_Hash_Blake2s_Simd128.h b/include/Hacl_Hash_Blake2s_Simd128.h new file mode 100644 index 00000000..6484005e --- /dev/null +++ b/include/Hacl_Hash_Blake2s_Simd128.h @@ -0,0 +1,112 @@ +/* MIT License + * + * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation + * Copyright (c) 2022-2023 HACL* Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + + +#ifndef __Hacl_Hash_Blake2s_Simd128_H +#define __Hacl_Hash_Blake2s_Simd128_H + +#if defined(__cplusplus) +extern "C" { +#endif + +#include +#include "krml/internal/types.h" +#include "krml/lowstar_endianness.h" +#include "krml/internal/target.h" + +#include "Hacl_Streaming_Types.h" +#include "libintvector.h" + +typedef struct Hacl_Hash_Blake2s_Simd128_block_state_t_s +{ + Lib_IntVector_Intrinsics_vec128 *fst; + Lib_IntVector_Intrinsics_vec128 *snd; +} +Hacl_Hash_Blake2s_Simd128_block_state_t; + +typedef struct Hacl_Hash_Blake2s_Simd128_state_t_s +{ + Hacl_Hash_Blake2s_Simd128_block_state_t block_state; + uint8_t *buf; + uint64_t total_len; +} +Hacl_Hash_Blake2s_Simd128_state_t; + +/** + State allocation function when there is no key +*/ +Hacl_Hash_Blake2s_Simd128_state_t *Hacl_Hash_Blake2s_Simd128_malloc(void); + +/** + Re-initialization function when there is no key +*/ +void Hacl_Hash_Blake2s_Simd128_reset(Hacl_Hash_Blake2s_Simd128_state_t *state); + +/** + Update function when there is no key; 0 = success, 1 = max length exceeded +*/ +Hacl_Streaming_Types_error_code +Hacl_Hash_Blake2s_Simd128_update( + Hacl_Hash_Blake2s_Simd128_state_t *state, + uint8_t *chunk, + uint32_t chunk_len +); + +/** + Finish function when there is no key +*/ +void +Hacl_Hash_Blake2s_Simd128_digest(Hacl_Hash_Blake2s_Simd128_state_t *state, uint8_t *output); + +/** + Free state function when there is no key +*/ +void Hacl_Hash_Blake2s_Simd128_free(Hacl_Hash_Blake2s_Simd128_state_t *state); + +/** +Write the BLAKE2s digest of message `input` using key `key` into `output`. + +@param output Pointer to `output_len` bytes of memory where the digest is written to. +@param output_len Length of the to-be-generated digest with 1 <= `output_len` <= 32. +@param input Pointer to `input_len` bytes of memory where the input message is read from. +@param input_len Length of the input message. +@param key Pointer to `key_len` bytes of memory where the key is read from. +@param key_len Length of the key. Can be 0. +*/ +void +Hacl_Hash_Blake2s_Simd128_hash_with_key( + uint8_t *output, + uint32_t output_len, + uint8_t *input, + uint32_t input_len, + uint8_t *key, + uint32_t key_len +); + +#if defined(__cplusplus) +} +#endif + +#define __Hacl_Hash_Blake2s_Simd128_H_DEFINED +#endif diff --git a/include/Hacl_Hash_MD5.h b/include/Hacl_Hash_MD5.h index dd4c75e0..db93d7d6 100644 --- a/include/Hacl_Hash_MD5.h +++ b/include/Hacl_Hash_MD5.h @@ -37,25 +37,25 @@ extern "C" { #include "Hacl_Streaming_Types.h" -typedef Hacl_Streaming_MD_state_32 Hacl_Streaming_MD5_state; +typedef Hacl_Streaming_MD_state_32 Hacl_Hash_MD5_state_t; -Hacl_Streaming_MD_state_32 *Hacl_Streaming_MD5_legacy_create_in(void); +Hacl_Streaming_MD_state_32 *Hacl_Hash_MD5_malloc(void); -void Hacl_Streaming_MD5_legacy_init(Hacl_Streaming_MD_state_32 *s); +void Hacl_Hash_MD5_reset(Hacl_Streaming_MD_state_32 *state); /** 0 = success, 1 = max length exceeded */ Hacl_Streaming_Types_error_code -Hacl_Streaming_MD5_legacy_update(Hacl_Streaming_MD_state_32 *p, uint8_t *data, uint32_t len); +Hacl_Hash_MD5_update(Hacl_Streaming_MD_state_32 *state, uint8_t *chunk, uint32_t chunk_len); -void Hacl_Streaming_MD5_legacy_finish(Hacl_Streaming_MD_state_32 *p, uint8_t *dst); +void Hacl_Hash_MD5_digest(Hacl_Streaming_MD_state_32 *state, uint8_t *output); -void Hacl_Streaming_MD5_legacy_free(Hacl_Streaming_MD_state_32 *s); +void Hacl_Hash_MD5_free(Hacl_Streaming_MD_state_32 *state); -Hacl_Streaming_MD_state_32 *Hacl_Streaming_MD5_legacy_copy(Hacl_Streaming_MD_state_32 *s0); +Hacl_Streaming_MD_state_32 *Hacl_Hash_MD5_copy(Hacl_Streaming_MD_state_32 *state); -void Hacl_Streaming_MD5_legacy_hash(uint8_t *input, uint32_t input_len, uint8_t *dst); +void Hacl_Hash_MD5_hash(uint8_t *output, uint8_t *input, uint32_t input_len); #if defined(__cplusplus) } diff --git a/include/Hacl_Hash_SHA1.h b/include/Hacl_Hash_SHA1.h index 2737b20f..19045440 100644 --- a/include/Hacl_Hash_SHA1.h +++ b/include/Hacl_Hash_SHA1.h @@ -37,25 +37,25 @@ extern "C" { #include "Hacl_Streaming_Types.h" -typedef Hacl_Streaming_MD_state_32 Hacl_Streaming_SHA1_state; +typedef Hacl_Streaming_MD_state_32 Hacl_Hash_SHA1_state_t; -Hacl_Streaming_MD_state_32 *Hacl_Streaming_SHA1_legacy_create_in(void); +Hacl_Streaming_MD_state_32 *Hacl_Hash_SHA1_malloc(void); -void Hacl_Streaming_SHA1_legacy_init(Hacl_Streaming_MD_state_32 *s); +void Hacl_Hash_SHA1_reset(Hacl_Streaming_MD_state_32 *state); /** 0 = success, 1 = max length exceeded */ Hacl_Streaming_Types_error_code -Hacl_Streaming_SHA1_legacy_update(Hacl_Streaming_MD_state_32 *p, uint8_t *data, uint32_t len); +Hacl_Hash_SHA1_update(Hacl_Streaming_MD_state_32 *state, uint8_t *chunk, uint32_t chunk_len); -void Hacl_Streaming_SHA1_legacy_finish(Hacl_Streaming_MD_state_32 *p, uint8_t *dst); +void Hacl_Hash_SHA1_digest(Hacl_Streaming_MD_state_32 *state, uint8_t *output); -void Hacl_Streaming_SHA1_legacy_free(Hacl_Streaming_MD_state_32 *s); +void Hacl_Hash_SHA1_free(Hacl_Streaming_MD_state_32 *state); -Hacl_Streaming_MD_state_32 *Hacl_Streaming_SHA1_legacy_copy(Hacl_Streaming_MD_state_32 *s0); +Hacl_Streaming_MD_state_32 *Hacl_Hash_SHA1_copy(Hacl_Streaming_MD_state_32 *state); -void Hacl_Streaming_SHA1_legacy_hash(uint8_t *input, uint32_t input_len, uint8_t *dst); +void Hacl_Hash_SHA1_hash(uint8_t *output, uint8_t *input, uint32_t input_len); #if defined(__cplusplus) } diff --git a/include/Hacl_Hash_SHA2.h b/include/Hacl_Hash_SHA2.h index 8f98d878..d17eab94 100644 --- a/include/Hacl_Hash_SHA2.h +++ b/include/Hacl_Hash_SHA2.h @@ -38,19 +38,19 @@ extern "C" { #include "Hacl_Streaming_Types.h" #include "Hacl_Krmllib.h" -typedef Hacl_Streaming_MD_state_32 Hacl_Streaming_SHA2_state_sha2_224; +typedef Hacl_Streaming_MD_state_32 Hacl_Hash_SHA2_state_t_224; -typedef Hacl_Streaming_MD_state_32 Hacl_Streaming_SHA2_state_sha2_256; +typedef Hacl_Streaming_MD_state_32 Hacl_Hash_SHA2_state_t_256; -typedef Hacl_Streaming_MD_state_64 Hacl_Streaming_SHA2_state_sha2_384; +typedef Hacl_Streaming_MD_state_64 Hacl_Hash_SHA2_state_t_384; -typedef Hacl_Streaming_MD_state_64 Hacl_Streaming_SHA2_state_sha2_512; +typedef Hacl_Streaming_MD_state_64 Hacl_Hash_SHA2_state_t_512; /** Allocate initial state for the SHA2_256 hash. The state is to be freed by calling `free_256`. */ -Hacl_Streaming_MD_state_32 *Hacl_Streaming_SHA2_create_in_256(void); +Hacl_Streaming_MD_state_32 *Hacl_Hash_SHA2_malloc_256(void); /** Copies the state passed as argument into a newly allocated state (deep copy). @@ -58,73 +58,73 @@ The state is to be freed by calling `free_256`. Cloning the state this way is useful, for instance, if your control-flow diverges and you need to feed more (different) data into the hash in each branch. */ -Hacl_Streaming_MD_state_32 *Hacl_Streaming_SHA2_copy_256(Hacl_Streaming_MD_state_32 *s0); +Hacl_Streaming_MD_state_32 *Hacl_Hash_SHA2_copy_256(Hacl_Streaming_MD_state_32 *state); /** Reset an existing state to the initial hash state with empty data. */ -void Hacl_Streaming_SHA2_init_256(Hacl_Streaming_MD_state_32 *s); +void Hacl_Hash_SHA2_reset_256(Hacl_Streaming_MD_state_32 *state); /** Feed an arbitrary amount of data into the hash. This function returns 0 for success, or 1 if the combined length of all of the data passed to `update_256` -(since the last call to `init_256`) exceeds 2^61-1 bytes. +(since the last call to `reset_256`) exceeds 2^61-1 bytes. This function is identical to the update function for SHA2_224. */ Hacl_Streaming_Types_error_code -Hacl_Streaming_SHA2_update_256( - Hacl_Streaming_MD_state_32 *p, +Hacl_Hash_SHA2_update_256( + Hacl_Streaming_MD_state_32 *state, uint8_t *input, uint32_t input_len ); /** -Write the resulting hash into `dst`, an array of 32 bytes. The state remains -valid after a call to `finish_256`, meaning the user may feed more data into -the hash via `update_256`. (The finish_256 function operates on an internal copy of +Write the resulting hash into `output`, an array of 32 bytes. The state remains +valid after a call to `digest_256`, meaning the user may feed more data into +the hash via `update_256`. (The digest_256 function operates on an internal copy of the state and therefore does not invalidate the client-held state `p`.) */ -void Hacl_Streaming_SHA2_finish_256(Hacl_Streaming_MD_state_32 *p, uint8_t *dst); +void Hacl_Hash_SHA2_digest_256(Hacl_Streaming_MD_state_32 *state, uint8_t *output); /** -Free a state allocated with `create_in_256`. +Free a state allocated with `malloc_256`. This function is identical to the free function for SHA2_224. */ -void Hacl_Streaming_SHA2_free_256(Hacl_Streaming_MD_state_32 *s); +void Hacl_Hash_SHA2_free_256(Hacl_Streaming_MD_state_32 *state); /** -Hash `input`, of len `input_len`, into `dst`, an array of 32 bytes. +Hash `input`, of len `input_len`, into `output`, an array of 32 bytes. */ -void Hacl_Streaming_SHA2_hash_256(uint8_t *input, uint32_t input_len, uint8_t *dst); +void Hacl_Hash_SHA2_hash_256(uint8_t *output, uint8_t *input, uint32_t input_len); -Hacl_Streaming_MD_state_32 *Hacl_Streaming_SHA2_create_in_224(void); +Hacl_Streaming_MD_state_32 *Hacl_Hash_SHA2_malloc_224(void); -void Hacl_Streaming_SHA2_init_224(Hacl_Streaming_MD_state_32 *s); +void Hacl_Hash_SHA2_reset_224(Hacl_Streaming_MD_state_32 *state); Hacl_Streaming_Types_error_code -Hacl_Streaming_SHA2_update_224( - Hacl_Streaming_MD_state_32 *p, +Hacl_Hash_SHA2_update_224( + Hacl_Streaming_MD_state_32 *state, uint8_t *input, uint32_t input_len ); /** -Write the resulting hash into `dst`, an array of 28 bytes. The state remains -valid after a call to `finish_224`, meaning the user may feed more data into +Write the resulting hash into `output`, an array of 28 bytes. The state remains +valid after a call to `digest_224`, meaning the user may feed more data into the hash via `update_224`. */ -void Hacl_Streaming_SHA2_finish_224(Hacl_Streaming_MD_state_32 *p, uint8_t *dst); +void Hacl_Hash_SHA2_digest_224(Hacl_Streaming_MD_state_32 *state, uint8_t *output); -void Hacl_Streaming_SHA2_free_224(Hacl_Streaming_MD_state_32 *p); +void Hacl_Hash_SHA2_free_224(Hacl_Streaming_MD_state_32 *state); /** -Hash `input`, of len `input_len`, into `dst`, an array of 28 bytes. +Hash `input`, of len `input_len`, into `output`, an array of 28 bytes. */ -void Hacl_Streaming_SHA2_hash_224(uint8_t *input, uint32_t input_len, uint8_t *dst); +void Hacl_Hash_SHA2_hash_224(uint8_t *output, uint8_t *input, uint32_t input_len); -Hacl_Streaming_MD_state_64 *Hacl_Streaming_SHA2_create_in_512(void); +Hacl_Streaming_MD_state_64 *Hacl_Hash_SHA2_malloc_512(void); /** Copies the state passed as argument into a newly allocated state (deep copy). @@ -132,68 +132,68 @@ The state is to be freed by calling `free_512`. Cloning the state this way is useful, for instance, if your control-flow diverges and you need to feed more (different) data into the hash in each branch. */ -Hacl_Streaming_MD_state_64 *Hacl_Streaming_SHA2_copy_512(Hacl_Streaming_MD_state_64 *s0); +Hacl_Streaming_MD_state_64 *Hacl_Hash_SHA2_copy_512(Hacl_Streaming_MD_state_64 *state); -void Hacl_Streaming_SHA2_init_512(Hacl_Streaming_MD_state_64 *s); +void Hacl_Hash_SHA2_reset_512(Hacl_Streaming_MD_state_64 *state); /** Feed an arbitrary amount of data into the hash. This function returns 0 for success, or 1 if the combined length of all of the data passed to `update_512` -(since the last call to `init_512`) exceeds 2^125-1 bytes. +(since the last call to `reset_512`) exceeds 2^125-1 bytes. This function is identical to the update function for SHA2_384. */ Hacl_Streaming_Types_error_code -Hacl_Streaming_SHA2_update_512( - Hacl_Streaming_MD_state_64 *p, +Hacl_Hash_SHA2_update_512( + Hacl_Streaming_MD_state_64 *state, uint8_t *input, uint32_t input_len ); /** -Write the resulting hash into `dst`, an array of 64 bytes. The state remains -valid after a call to `finish_512`, meaning the user may feed more data into -the hash via `update_512`. (The finish_512 function operates on an internal copy of +Write the resulting hash into `output`, an array of 64 bytes. The state remains +valid after a call to `digest_512`, meaning the user may feed more data into +the hash via `update_512`. (The digest_512 function operates on an internal copy of the state and therefore does not invalidate the client-held state `p`.) */ -void Hacl_Streaming_SHA2_finish_512(Hacl_Streaming_MD_state_64 *p, uint8_t *dst); +void Hacl_Hash_SHA2_digest_512(Hacl_Streaming_MD_state_64 *state, uint8_t *output); /** -Free a state allocated with `create_in_512`. +Free a state allocated with `malloc_512`. This function is identical to the free function for SHA2_384. */ -void Hacl_Streaming_SHA2_free_512(Hacl_Streaming_MD_state_64 *s); +void Hacl_Hash_SHA2_free_512(Hacl_Streaming_MD_state_64 *state); /** -Hash `input`, of len `input_len`, into `dst`, an array of 64 bytes. +Hash `input`, of len `input_len`, into `output`, an array of 64 bytes. */ -void Hacl_Streaming_SHA2_hash_512(uint8_t *input, uint32_t input_len, uint8_t *dst); +void Hacl_Hash_SHA2_hash_512(uint8_t *output, uint8_t *input, uint32_t input_len); -Hacl_Streaming_MD_state_64 *Hacl_Streaming_SHA2_create_in_384(void); +Hacl_Streaming_MD_state_64 *Hacl_Hash_SHA2_malloc_384(void); -void Hacl_Streaming_SHA2_init_384(Hacl_Streaming_MD_state_64 *s); +void Hacl_Hash_SHA2_reset_384(Hacl_Streaming_MD_state_64 *state); Hacl_Streaming_Types_error_code -Hacl_Streaming_SHA2_update_384( - Hacl_Streaming_MD_state_64 *p, +Hacl_Hash_SHA2_update_384( + Hacl_Streaming_MD_state_64 *state, uint8_t *input, uint32_t input_len ); /** -Write the resulting hash into `dst`, an array of 48 bytes. The state remains -valid after a call to `finish_384`, meaning the user may feed more data into +Write the resulting hash into `output`, an array of 48 bytes. The state remains +valid after a call to `digest_384`, meaning the user may feed more data into the hash via `update_384`. */ -void Hacl_Streaming_SHA2_finish_384(Hacl_Streaming_MD_state_64 *p, uint8_t *dst); +void Hacl_Hash_SHA2_digest_384(Hacl_Streaming_MD_state_64 *state, uint8_t *output); -void Hacl_Streaming_SHA2_free_384(Hacl_Streaming_MD_state_64 *p); +void Hacl_Hash_SHA2_free_384(Hacl_Streaming_MD_state_64 *state); /** -Hash `input`, of len `input_len`, into `dst`, an array of 48 bytes. +Hash `input`, of len `input_len`, into `output`, an array of 48 bytes. */ -void Hacl_Streaming_SHA2_hash_384(uint8_t *input, uint32_t input_len, uint8_t *dst); +void Hacl_Hash_SHA2_hash_384(uint8_t *output, uint8_t *input, uint32_t input_len); #if defined(__cplusplus) } diff --git a/include/Hacl_Hash_SHA3.h b/include/Hacl_Hash_SHA3.h index e2f5ff06..e09f8745 100644 --- a/include/Hacl_Hash_SHA3.h +++ b/include/Hacl_Hash_SHA3.h @@ -37,48 +37,48 @@ extern "C" { #include "Hacl_Streaming_Types.h" -typedef struct Hacl_Streaming_Keccak_hash_buf_s +typedef struct Hacl_Hash_SHA3_hash_buf_s { Spec_Hash_Definitions_hash_alg fst; uint64_t *snd; } -Hacl_Streaming_Keccak_hash_buf; +Hacl_Hash_SHA3_hash_buf; -typedef struct Hacl_Streaming_Keccak_state_s +typedef struct Hacl_Hash_SHA3_state_t_s { - Hacl_Streaming_Keccak_hash_buf block_state; + Hacl_Hash_SHA3_hash_buf block_state; uint8_t *buf; uint64_t total_len; } -Hacl_Streaming_Keccak_state; +Hacl_Hash_SHA3_state_t; -Spec_Hash_Definitions_hash_alg Hacl_Streaming_Keccak_get_alg(Hacl_Streaming_Keccak_state *s); +Spec_Hash_Definitions_hash_alg Hacl_Hash_SHA3_get_alg(Hacl_Hash_SHA3_state_t *s); -Hacl_Streaming_Keccak_state *Hacl_Streaming_Keccak_malloc(Spec_Hash_Definitions_hash_alg a); +Hacl_Hash_SHA3_state_t *Hacl_Hash_SHA3_malloc(Spec_Hash_Definitions_hash_alg a); -void Hacl_Streaming_Keccak_free(Hacl_Streaming_Keccak_state *s); +void Hacl_Hash_SHA3_free(Hacl_Hash_SHA3_state_t *state); -Hacl_Streaming_Keccak_state *Hacl_Streaming_Keccak_copy(Hacl_Streaming_Keccak_state *s0); +Hacl_Hash_SHA3_state_t *Hacl_Hash_SHA3_copy(Hacl_Hash_SHA3_state_t *state); -void Hacl_Streaming_Keccak_reset(Hacl_Streaming_Keccak_state *s); +void Hacl_Hash_SHA3_reset(Hacl_Hash_SHA3_state_t *state); Hacl_Streaming_Types_error_code -Hacl_Streaming_Keccak_update(Hacl_Streaming_Keccak_state *p, uint8_t *data, uint32_t len); +Hacl_Hash_SHA3_update(Hacl_Hash_SHA3_state_t *state, uint8_t *chunk, uint32_t chunk_len); Hacl_Streaming_Types_error_code -Hacl_Streaming_Keccak_finish(Hacl_Streaming_Keccak_state *s, uint8_t *dst); +Hacl_Hash_SHA3_digest(Hacl_Hash_SHA3_state_t *state, uint8_t *output); Hacl_Streaming_Types_error_code -Hacl_Streaming_Keccak_squeeze(Hacl_Streaming_Keccak_state *s, uint8_t *dst, uint32_t l); +Hacl_Hash_SHA3_squeeze(Hacl_Hash_SHA3_state_t *s, uint8_t *dst, uint32_t l); -uint32_t Hacl_Streaming_Keccak_block_len(Hacl_Streaming_Keccak_state *s); +uint32_t Hacl_Hash_SHA3_block_len(Hacl_Hash_SHA3_state_t *s); -uint32_t Hacl_Streaming_Keccak_hash_len(Hacl_Streaming_Keccak_state *s); +uint32_t Hacl_Hash_SHA3_hash_len(Hacl_Hash_SHA3_state_t *s); -bool Hacl_Streaming_Keccak_is_shake(Hacl_Streaming_Keccak_state *s); +bool Hacl_Hash_SHA3_is_shake(Hacl_Hash_SHA3_state_t *s); void -Hacl_SHA3_shake128_hacl( +Hacl_Hash_SHA3_shake128_hacl( uint32_t inputByteLen, uint8_t *input, uint32_t outputByteLen, @@ -86,25 +86,25 @@ Hacl_SHA3_shake128_hacl( ); void -Hacl_SHA3_shake256_hacl( +Hacl_Hash_SHA3_shake256_hacl( uint32_t inputByteLen, uint8_t *input, uint32_t outputByteLen, uint8_t *output ); -void Hacl_SHA3_sha3_224(uint32_t inputByteLen, uint8_t *input, uint8_t *output); +void Hacl_Hash_SHA3_sha3_224(uint8_t *output, uint8_t *input, uint32_t input_len); -void Hacl_SHA3_sha3_256(uint32_t inputByteLen, uint8_t *input, uint8_t *output); +void Hacl_Hash_SHA3_sha3_256(uint8_t *output, uint8_t *input, uint32_t input_len); -void Hacl_SHA3_sha3_384(uint32_t inputByteLen, uint8_t *input, uint8_t *output); +void Hacl_Hash_SHA3_sha3_384(uint8_t *output, uint8_t *input, uint32_t input_len); -void Hacl_SHA3_sha3_512(uint32_t inputByteLen, uint8_t *input, uint8_t *output); +void Hacl_Hash_SHA3_sha3_512(uint8_t *output, uint8_t *input, uint32_t input_len); -void Hacl_Impl_SHA3_absorb_inner(uint32_t rateInBytes, uint8_t *block, uint64_t *s); +void Hacl_Hash_SHA3_absorb_inner(uint32_t rateInBytes, uint8_t *block, uint64_t *s); void -Hacl_Impl_SHA3_squeeze( +Hacl_Hash_SHA3_squeeze0( uint64_t *s, uint32_t rateInBytes, uint32_t outputByteLen, @@ -112,7 +112,7 @@ Hacl_Impl_SHA3_squeeze( ); void -Hacl_Impl_SHA3_keccak( +Hacl_Hash_SHA3_keccak( uint32_t rate, uint32_t capacity, uint32_t inputByteLen, diff --git a/include/Hacl_IntTypes_Intrinsics.h b/include/Hacl_IntTypes_Intrinsics.h index e2a193e9..c816b046 100644 --- a/include/Hacl_IntTypes_Intrinsics.h +++ b/include/Hacl_IntTypes_Intrinsics.h @@ -41,7 +41,7 @@ static inline uint32_t Hacl_IntTypes_Intrinsics_add_carry_u32(uint32_t cin, uint32_t x, uint32_t y, uint32_t *r) { uint64_t res = (uint64_t)x + (uint64_t)cin + (uint64_t)y; - uint32_t c = (uint32_t)(res >> (uint32_t)32U); + uint32_t c = (uint32_t)(res >> 32U); r[0U] = (uint32_t)res; return c; } @@ -50,7 +50,7 @@ static inline uint32_t Hacl_IntTypes_Intrinsics_sub_borrow_u32(uint32_t cin, uint32_t x, uint32_t y, uint32_t *r) { uint64_t res = (uint64_t)x - (uint64_t)y - (uint64_t)cin; - uint32_t c = (uint32_t)(res >> (uint32_t)32U) & (uint32_t)1U; + uint32_t c = (uint32_t)(res >> 32U) & 1U; r[0U] = (uint32_t)res; return c; } @@ -59,8 +59,7 @@ static inline uint64_t Hacl_IntTypes_Intrinsics_add_carry_u64(uint64_t cin, uint64_t x, uint64_t y, uint64_t *r) { uint64_t res = x + cin + y; - uint64_t - c = (~FStar_UInt64_gte_mask(res, x) | (FStar_UInt64_eq_mask(res, x) & cin)) & (uint64_t)1U; + uint64_t c = (~FStar_UInt64_gte_mask(res, x) | (FStar_UInt64_eq_mask(res, x) & cin)) & 1ULL; r[0U] = res; return c; } @@ -73,7 +72,7 @@ Hacl_IntTypes_Intrinsics_sub_borrow_u64(uint64_t cin, uint64_t x, uint64_t y, ui c = ((FStar_UInt64_gte_mask(res, x) & ~FStar_UInt64_eq_mask(res, x)) | (FStar_UInt64_eq_mask(res, x) & cin)) - & (uint64_t)1U; + & 1ULL; r[0U] = res; return c; } diff --git a/include/Hacl_IntTypes_Intrinsics_128.h b/include/Hacl_IntTypes_Intrinsics_128.h index aa843a6c..d3008969 100644 --- a/include/Hacl_IntTypes_Intrinsics_128.h +++ b/include/Hacl_IntTypes_Intrinsics_128.h @@ -45,7 +45,7 @@ Hacl_IntTypes_Intrinsics_128_add_carry_u64(uint64_t cin, uint64_t x, uint64_t y, FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_uint64_to_uint128(x), FStar_UInt128_uint64_to_uint128(cin)), FStar_UInt128_uint64_to_uint128(y)); - uint64_t c = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(res, (uint32_t)64U)); + uint64_t c = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(res, 64U)); r[0U] = FStar_UInt128_uint128_to_uint64(res); return c; } @@ -58,10 +58,7 @@ Hacl_IntTypes_Intrinsics_128_sub_borrow_u64(uint64_t cin, uint64_t x, uint64_t y FStar_UInt128_sub_mod(FStar_UInt128_sub_mod(FStar_UInt128_uint64_to_uint128(x), FStar_UInt128_uint64_to_uint128(y)), FStar_UInt128_uint64_to_uint128(cin)); - uint64_t - c = - FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(res, (uint32_t)64U)) - & (uint64_t)1U; + uint64_t c = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(res, 64U)) & 1ULL; r[0U] = FStar_UInt128_uint128_to_uint64(res); return c; } diff --git a/include/msvc/Hacl_Streaming_Poly1305_32.h b/include/Hacl_MAC_Poly1305.h similarity index 67% rename from include/msvc/Hacl_Streaming_Poly1305_32.h rename to include/Hacl_MAC_Poly1305.h index 88d1a513..95ac4be2 100644 --- a/include/msvc/Hacl_Streaming_Poly1305_32.h +++ b/include/Hacl_MAC_Poly1305.h @@ -23,8 +23,8 @@ */ -#ifndef __Hacl_Streaming_Poly1305_32_H -#define __Hacl_Streaming_Poly1305_32_H +#ifndef __Hacl_MAC_Poly1305_H +#define __Hacl_MAC_Poly1305_H #if defined(__cplusplus) extern "C" { @@ -36,43 +36,36 @@ extern "C" { #include "krml/internal/target.h" #include "Hacl_Streaming_Types.h" -#include "Hacl_Poly1305_32.h" +#include "Hacl_Krmllib.h" -typedef struct Hacl_Streaming_Poly1305_32_poly1305_32_state_s +typedef struct Hacl_MAC_Poly1305_state_t_s { uint64_t *block_state; uint8_t *buf; uint64_t total_len; uint8_t *p_key; } -Hacl_Streaming_Poly1305_32_poly1305_32_state; +Hacl_MAC_Poly1305_state_t; -Hacl_Streaming_Poly1305_32_poly1305_32_state *Hacl_Streaming_Poly1305_32_create_in(uint8_t *k); +Hacl_MAC_Poly1305_state_t *Hacl_MAC_Poly1305_malloc(uint8_t *key); -void -Hacl_Streaming_Poly1305_32_init(uint8_t *k, Hacl_Streaming_Poly1305_32_poly1305_32_state *s); +void Hacl_MAC_Poly1305_reset(Hacl_MAC_Poly1305_state_t *state, uint8_t *key); /** 0 = success, 1 = max length exceeded */ Hacl_Streaming_Types_error_code -Hacl_Streaming_Poly1305_32_update( - Hacl_Streaming_Poly1305_32_poly1305_32_state *p, - uint8_t *data, - uint32_t len -); +Hacl_MAC_Poly1305_update(Hacl_MAC_Poly1305_state_t *state, uint8_t *chunk, uint32_t chunk_len); -void -Hacl_Streaming_Poly1305_32_finish( - Hacl_Streaming_Poly1305_32_poly1305_32_state *p, - uint8_t *dst -); +void Hacl_MAC_Poly1305_digest(Hacl_MAC_Poly1305_state_t *state, uint8_t *output); -void Hacl_Streaming_Poly1305_32_free(Hacl_Streaming_Poly1305_32_poly1305_32_state *s); +void Hacl_MAC_Poly1305_free(Hacl_MAC_Poly1305_state_t *state); + +void Hacl_MAC_Poly1305_mac(uint8_t *output, uint8_t *input, uint32_t input_len, uint8_t *key); #if defined(__cplusplus) } #endif -#define __Hacl_Streaming_Poly1305_32_H_DEFINED +#define __Hacl_MAC_Poly1305_H_DEFINED #endif diff --git a/include/Hacl_Streaming_Poly1305_128.h b/include/Hacl_MAC_Poly1305_Simd128.h similarity index 67% rename from include/Hacl_Streaming_Poly1305_128.h rename to include/Hacl_MAC_Poly1305_Simd128.h index d6299052..9b69ebd4 100644 --- a/include/Hacl_Streaming_Poly1305_128.h +++ b/include/Hacl_MAC_Poly1305_Simd128.h @@ -23,8 +23,8 @@ */ -#ifndef __Hacl_Streaming_Poly1305_128_H -#define __Hacl_Streaming_Poly1305_128_H +#ifndef __Hacl_MAC_Poly1305_Simd128_H +#define __Hacl_MAC_Poly1305_Simd128_H #if defined(__cplusplus) extern "C" { @@ -36,44 +36,47 @@ extern "C" { #include "krml/internal/target.h" #include "Hacl_Streaming_Types.h" -#include "Hacl_Poly1305_128.h" +#include "libintvector.h" -typedef struct Hacl_Streaming_Poly1305_128_poly1305_128_state_s +typedef struct Hacl_MAC_Poly1305_Simd128_state_t_s { Lib_IntVector_Intrinsics_vec128 *block_state; uint8_t *buf; uint64_t total_len; uint8_t *p_key; } -Hacl_Streaming_Poly1305_128_poly1305_128_state; +Hacl_MAC_Poly1305_Simd128_state_t; -Hacl_Streaming_Poly1305_128_poly1305_128_state -*Hacl_Streaming_Poly1305_128_create_in(uint8_t *k); +Hacl_MAC_Poly1305_Simd128_state_t *Hacl_MAC_Poly1305_Simd128_malloc(uint8_t *key); -void -Hacl_Streaming_Poly1305_128_init(uint8_t *k, Hacl_Streaming_Poly1305_128_poly1305_128_state *s); +void Hacl_MAC_Poly1305_Simd128_reset(Hacl_MAC_Poly1305_Simd128_state_t *state, uint8_t *key); /** 0 = success, 1 = max length exceeded */ Hacl_Streaming_Types_error_code -Hacl_Streaming_Poly1305_128_update( - Hacl_Streaming_Poly1305_128_poly1305_128_state *p, - uint8_t *data, - uint32_t len +Hacl_MAC_Poly1305_Simd128_update( + Hacl_MAC_Poly1305_Simd128_state_t *state, + uint8_t *chunk, + uint32_t chunk_len ); void -Hacl_Streaming_Poly1305_128_finish( - Hacl_Streaming_Poly1305_128_poly1305_128_state *p, - uint8_t *dst -); +Hacl_MAC_Poly1305_Simd128_digest(Hacl_MAC_Poly1305_Simd128_state_t *state, uint8_t *output); + +void Hacl_MAC_Poly1305_Simd128_free(Hacl_MAC_Poly1305_Simd128_state_t *state); -void Hacl_Streaming_Poly1305_128_free(Hacl_Streaming_Poly1305_128_poly1305_128_state *s); +void +Hacl_MAC_Poly1305_Simd128_mac( + uint8_t *output, + uint8_t *input, + uint32_t input_len, + uint8_t *key +); #if defined(__cplusplus) } #endif -#define __Hacl_Streaming_Poly1305_128_H_DEFINED +#define __Hacl_MAC_Poly1305_Simd128_H_DEFINED #endif diff --git a/include/msvc/Hacl_Streaming_Poly1305_256.h b/include/Hacl_MAC_Poly1305_Simd256.h similarity index 67% rename from include/msvc/Hacl_Streaming_Poly1305_256.h rename to include/Hacl_MAC_Poly1305_Simd256.h index 689b837b..89f4a104 100644 --- a/include/msvc/Hacl_Streaming_Poly1305_256.h +++ b/include/Hacl_MAC_Poly1305_Simd256.h @@ -23,8 +23,8 @@ */ -#ifndef __Hacl_Streaming_Poly1305_256_H -#define __Hacl_Streaming_Poly1305_256_H +#ifndef __Hacl_MAC_Poly1305_Simd256_H +#define __Hacl_MAC_Poly1305_Simd256_H #if defined(__cplusplus) extern "C" { @@ -36,44 +36,47 @@ extern "C" { #include "krml/internal/target.h" #include "Hacl_Streaming_Types.h" -#include "Hacl_Poly1305_256.h" +#include "libintvector.h" -typedef struct Hacl_Streaming_Poly1305_256_poly1305_256_state_s +typedef struct Hacl_MAC_Poly1305_Simd256_state_t_s { Lib_IntVector_Intrinsics_vec256 *block_state; uint8_t *buf; uint64_t total_len; uint8_t *p_key; } -Hacl_Streaming_Poly1305_256_poly1305_256_state; +Hacl_MAC_Poly1305_Simd256_state_t; -Hacl_Streaming_Poly1305_256_poly1305_256_state -*Hacl_Streaming_Poly1305_256_create_in(uint8_t *k); +Hacl_MAC_Poly1305_Simd256_state_t *Hacl_MAC_Poly1305_Simd256_malloc(uint8_t *key); -void -Hacl_Streaming_Poly1305_256_init(uint8_t *k, Hacl_Streaming_Poly1305_256_poly1305_256_state *s); +void Hacl_MAC_Poly1305_Simd256_reset(Hacl_MAC_Poly1305_Simd256_state_t *state, uint8_t *key); /** 0 = success, 1 = max length exceeded */ Hacl_Streaming_Types_error_code -Hacl_Streaming_Poly1305_256_update( - Hacl_Streaming_Poly1305_256_poly1305_256_state *p, - uint8_t *data, - uint32_t len +Hacl_MAC_Poly1305_Simd256_update( + Hacl_MAC_Poly1305_Simd256_state_t *state, + uint8_t *chunk, + uint32_t chunk_len ); void -Hacl_Streaming_Poly1305_256_finish( - Hacl_Streaming_Poly1305_256_poly1305_256_state *p, - uint8_t *dst -); +Hacl_MAC_Poly1305_Simd256_digest(Hacl_MAC_Poly1305_Simd256_state_t *state, uint8_t *output); + +void Hacl_MAC_Poly1305_Simd256_free(Hacl_MAC_Poly1305_Simd256_state_t *state); -void Hacl_Streaming_Poly1305_256_free(Hacl_Streaming_Poly1305_256_poly1305_256_state *s); +void +Hacl_MAC_Poly1305_Simd256_mac( + uint8_t *output, + uint8_t *input, + uint32_t input_len, + uint8_t *key +); #if defined(__cplusplus) } #endif -#define __Hacl_Streaming_Poly1305_256_H_DEFINED +#define __Hacl_MAC_Poly1305_Simd256_H_DEFINED #endif diff --git a/include/Hacl_NaCl.h b/include/Hacl_NaCl.h index b7e91a4b..a3ca6804 100644 --- a/include/Hacl_NaCl.h +++ b/include/Hacl_NaCl.h @@ -36,7 +36,7 @@ extern "C" { #include "krml/internal/target.h" #include "Hacl_Salsa20.h" -#include "Hacl_Poly1305_32.h" +#include "Hacl_MAC_Poly1305.h" #include "Hacl_Curve25519_51.h" /** diff --git a/include/Hacl_Poly1305_256.h b/include/Hacl_Poly1305_256.h deleted file mode 100644 index 9d1ae8c3..00000000 --- a/include/Hacl_Poly1305_256.h +++ /dev/null @@ -1,67 +0,0 @@ -/* MIT License - * - * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation - * Copyright (c) 2022-2023 HACL* Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - - -#ifndef __Hacl_Poly1305_256_H -#define __Hacl_Poly1305_256_H - -#if defined(__cplusplus) -extern "C" { -#endif - -#include -#include "krml/internal/types.h" -#include "krml/lowstar_endianness.h" -#include "krml/internal/target.h" - -#include "libintvector.h" - -typedef Lib_IntVector_Intrinsics_vec256 *Hacl_Poly1305_256_poly1305_ctx; - -void Hacl_Poly1305_256_poly1305_init(Lib_IntVector_Intrinsics_vec256 *ctx, uint8_t *key); - -void Hacl_Poly1305_256_poly1305_update1(Lib_IntVector_Intrinsics_vec256 *ctx, uint8_t *text); - -void -Hacl_Poly1305_256_poly1305_update( - Lib_IntVector_Intrinsics_vec256 *ctx, - uint32_t len, - uint8_t *text -); - -void -Hacl_Poly1305_256_poly1305_finish( - uint8_t *tag, - uint8_t *key, - Lib_IntVector_Intrinsics_vec256 *ctx -); - -void Hacl_Poly1305_256_poly1305_mac(uint8_t *tag, uint32_t len, uint8_t *text, uint8_t *key); - -#if defined(__cplusplus) -} -#endif - -#define __Hacl_Poly1305_256_H_DEFINED -#endif diff --git a/include/Hacl_Poly1305_32.h b/include/Hacl_Poly1305_32.h deleted file mode 100644 index f3233b90..00000000 --- a/include/Hacl_Poly1305_32.h +++ /dev/null @@ -1,57 +0,0 @@ -/* MIT License - * - * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation - * Copyright (c) 2022-2023 HACL* Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - - -#ifndef __Hacl_Poly1305_32_H -#define __Hacl_Poly1305_32_H - -#if defined(__cplusplus) -extern "C" { -#endif - -#include -#include "krml/internal/types.h" -#include "krml/lowstar_endianness.h" -#include "krml/internal/target.h" - -#include "Hacl_Krmllib.h" - -typedef uint64_t *Hacl_Poly1305_32_poly1305_ctx; - -void Hacl_Poly1305_32_poly1305_init(uint64_t *ctx, uint8_t *key); - -void Hacl_Poly1305_32_poly1305_update1(uint64_t *ctx, uint8_t *text); - -void Hacl_Poly1305_32_poly1305_update(uint64_t *ctx, uint32_t len, uint8_t *text); - -void Hacl_Poly1305_32_poly1305_finish(uint8_t *tag, uint8_t *key, uint64_t *ctx); - -void Hacl_Poly1305_32_poly1305_mac(uint8_t *tag, uint32_t len, uint8_t *text, uint8_t *key); - -#if defined(__cplusplus) -} -#endif - -#define __Hacl_Poly1305_32_H_DEFINED -#endif diff --git a/include/Hacl_Streaming_Blake2.h b/include/Hacl_Streaming_Blake2.h deleted file mode 100644 index bfb05e4f..00000000 --- a/include/Hacl_Streaming_Blake2.h +++ /dev/null @@ -1,147 +0,0 @@ -/* MIT License - * - * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation - * Copyright (c) 2022-2023 HACL* Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - - -#ifndef __Hacl_Streaming_Blake2_H -#define __Hacl_Streaming_Blake2_H - -#if defined(__cplusplus) -extern "C" { -#endif - -#include -#include "krml/internal/types.h" -#include "krml/lowstar_endianness.h" -#include "krml/internal/target.h" - -#include "Hacl_Streaming_Types.h" -#include "Hacl_Krmllib.h" -#include "Hacl_Hash_Blake2.h" - -typedef struct Hacl_Streaming_Blake2_blake2s_32_block_state_s -{ - uint32_t *fst; - uint32_t *snd; -} -Hacl_Streaming_Blake2_blake2s_32_block_state; - -typedef struct Hacl_Streaming_Blake2_blake2b_32_block_state_s -{ - uint64_t *fst; - uint64_t *snd; -} -Hacl_Streaming_Blake2_blake2b_32_block_state; - -typedef struct Hacl_Streaming_Blake2_blake2s_32_state_s -{ - Hacl_Streaming_Blake2_blake2s_32_block_state block_state; - uint8_t *buf; - uint64_t total_len; -} -Hacl_Streaming_Blake2_blake2s_32_state; - -typedef struct Hacl_Streaming_Blake2_blake2b_32_state_s -{ - Hacl_Streaming_Blake2_blake2b_32_block_state block_state; - uint8_t *buf; - uint64_t total_len; -} -Hacl_Streaming_Blake2_blake2b_32_state; - -/** - State allocation function when there is no key -*/ -Hacl_Streaming_Blake2_blake2s_32_state -*Hacl_Streaming_Blake2_blake2s_32_no_key_create_in(void); - -/** - (Re-)initialization function when there is no key -*/ -void Hacl_Streaming_Blake2_blake2s_32_no_key_init(Hacl_Streaming_Blake2_blake2s_32_state *s1); - -/** - Update function when there is no key; 0 = success, 1 = max length exceeded -*/ -Hacl_Streaming_Types_error_code -Hacl_Streaming_Blake2_blake2s_32_no_key_update( - Hacl_Streaming_Blake2_blake2s_32_state *p, - uint8_t *data, - uint32_t len -); - -/** - Finish function when there is no key -*/ -void -Hacl_Streaming_Blake2_blake2s_32_no_key_finish( - Hacl_Streaming_Blake2_blake2s_32_state *p, - uint8_t *dst -); - -/** - Free state function when there is no key -*/ -void Hacl_Streaming_Blake2_blake2s_32_no_key_free(Hacl_Streaming_Blake2_blake2s_32_state *s1); - -/** - State allocation function when there is no key -*/ -Hacl_Streaming_Blake2_blake2b_32_state -*Hacl_Streaming_Blake2_blake2b_32_no_key_create_in(void); - -/** - (Re)-initialization function when there is no key -*/ -void Hacl_Streaming_Blake2_blake2b_32_no_key_init(Hacl_Streaming_Blake2_blake2b_32_state *s1); - -/** - Update function when there is no key; 0 = success, 1 = max length exceeded -*/ -Hacl_Streaming_Types_error_code -Hacl_Streaming_Blake2_blake2b_32_no_key_update( - Hacl_Streaming_Blake2_blake2b_32_state *p, - uint8_t *data, - uint32_t len -); - -/** - Finish function when there is no key -*/ -void -Hacl_Streaming_Blake2_blake2b_32_no_key_finish( - Hacl_Streaming_Blake2_blake2b_32_state *p, - uint8_t *dst -); - -/** - Free state function when there is no key -*/ -void Hacl_Streaming_Blake2_blake2b_32_no_key_free(Hacl_Streaming_Blake2_blake2b_32_state *s1); - -#if defined(__cplusplus) -} -#endif - -#define __Hacl_Streaming_Blake2_H_DEFINED -#endif diff --git a/include/internal/EverCrypt_HMAC.h b/include/internal/EverCrypt_HMAC.h index 02986e6c..debea462 100644 --- a/include/internal/EverCrypt_HMAC.h +++ b/include/internal/EverCrypt_HMAC.h @@ -38,7 +38,9 @@ extern "C" { #include "internal/Hacl_Krmllib.h" #include "internal/Hacl_Hash_SHA2.h" #include "internal/Hacl_Hash_SHA1.h" -#include "internal/Hacl_Hash_Blake2.h" +#include "internal/Hacl_Hash_Blake2s.h" +#include "internal/Hacl_Hash_Blake2b.h" +#include "internal/Hacl_HMAC.h" #include "internal/EverCrypt_Hash.h" #include "../EverCrypt_HMAC.h" diff --git a/include/internal/EverCrypt_Hash.h b/include/internal/EverCrypt_Hash.h index c9417677..cd706161 100644 --- a/include/internal/EverCrypt_Hash.h +++ b/include/internal/EverCrypt_Hash.h @@ -41,11 +41,15 @@ extern "C" { #include "internal/Hacl_Hash_SHA2.h" #include "internal/Hacl_Hash_SHA1.h" #include "internal/Hacl_Hash_MD5.h" +#include "internal/Hacl_Hash_Blake2s_Simd128.h" +#include "internal/Hacl_Hash_Blake2s.h" +#include "internal/Hacl_Hash_Blake2b_Simd256.h" +#include "internal/Hacl_Hash_Blake2b.h" #include "../EverCrypt_Hash.h" void EverCrypt_Hash_update_multi_256(uint32_t *s, uint8_t *blocks, uint32_t n); -void EverCrypt_Hash_Incremental_hash_256(uint8_t *input, uint32_t input_len, uint8_t *dst); +void EverCrypt_Hash_Incremental_hash_256(uint8_t *output, uint8_t *input, uint32_t input_len); #if defined(__cplusplus) } diff --git a/include/internal/Hacl_Bignum.h b/include/internal/Hacl_Bignum.h index 901a8dad..4b31236d 100644 --- a/include/internal/Hacl_Bignum.h +++ b/include/internal/Hacl_Bignum.h @@ -124,15 +124,6 @@ Hacl_Bignum_Montgomery_bn_precomp_r2_mod_n_u32( uint32_t *res ); -void -Hacl_Bignum_Montgomery_bn_mont_reduction_u32( - uint32_t len, - uint32_t *n, - uint32_t nInv, - uint32_t *c, - uint32_t *res -); - void Hacl_Bignum_Montgomery_bn_to_mont_u32( uint32_t len, @@ -181,15 +172,6 @@ Hacl_Bignum_Montgomery_bn_precomp_r2_mod_n_u64( uint64_t *res ); -void -Hacl_Bignum_Montgomery_bn_mont_reduction_u64( - uint32_t len, - uint64_t *n, - uint64_t nInv, - uint64_t *c, - uint64_t *res -); - void Hacl_Bignum_Montgomery_bn_to_mont_u64( uint32_t len, @@ -228,6 +210,24 @@ Hacl_Bignum_Montgomery_bn_mont_sqr_u64( uint64_t *resM ); +void +Hacl_Bignum_AlmostMontgomery_bn_almost_mont_reduction_u32( + uint32_t len, + uint32_t *n, + uint32_t nInv, + uint32_t *c, + uint32_t *res +); + +void +Hacl_Bignum_AlmostMontgomery_bn_almost_mont_reduction_u64( + uint32_t len, + uint64_t *n, + uint64_t nInv, + uint64_t *c, + uint64_t *res +); + uint32_t Hacl_Bignum_Exponentiation_bn_check_mod_exp_u32( uint32_t len, diff --git a/include/internal/Hacl_Bignum25519_51.h b/include/internal/Hacl_Bignum25519_51.h index 25a10503..4678f8a0 100644 --- a/include/internal/Hacl_Bignum25519_51.h +++ b/include/internal/Hacl_Bignum25519_51.h @@ -69,11 +69,11 @@ static inline void Hacl_Impl_Curve25519_Field51_fsub(uint64_t *out, uint64_t *f1 uint64_t f23 = f2[3U]; uint64_t f14 = f1[4U]; uint64_t f24 = f2[4U]; - out[0U] = f10 + (uint64_t)0x3fffffffffff68U - f20; - out[1U] = f11 + (uint64_t)0x3ffffffffffff8U - f21; - out[2U] = f12 + (uint64_t)0x3ffffffffffff8U - f22; - out[3U] = f13 + (uint64_t)0x3ffffffffffff8U - f23; - out[4U] = f14 + (uint64_t)0x3ffffffffffff8U - f24; + out[0U] = f10 + 0x3fffffffffff68ULL - f20; + out[1U] = f11 + 0x3ffffffffffff8ULL - f21; + out[2U] = f12 + 0x3ffffffffffff8ULL - f22; + out[3U] = f13 + 0x3ffffffffffff8ULL - f23; + out[4U] = f14 + 0x3ffffffffffff8ULL - f24; } static inline void @@ -84,7 +84,7 @@ Hacl_Impl_Curve25519_Field51_fmul( FStar_UInt128_uint128 *uu___ ) { - KRML_HOST_IGNORE(uu___); + KRML_MAYBE_UNUSED_VAR(uu___); uint64_t f10 = f1[0U]; uint64_t f11 = f1[1U]; uint64_t f12 = f1[2U]; @@ -95,10 +95,10 @@ Hacl_Impl_Curve25519_Field51_fmul( uint64_t f22 = f2[2U]; uint64_t f23 = f2[3U]; uint64_t f24 = f2[4U]; - uint64_t tmp1 = f21 * (uint64_t)19U; - uint64_t tmp2 = f22 * (uint64_t)19U; - uint64_t tmp3 = f23 * (uint64_t)19U; - uint64_t tmp4 = f24 * (uint64_t)19U; + uint64_t tmp1 = f21 * 19ULL; + uint64_t tmp2 = f22 * 19ULL; + uint64_t tmp3 = f23 * 19ULL; + uint64_t tmp4 = f24 * 19ULL; FStar_UInt128_uint128 o00 = FStar_UInt128_mul_wide(f10, f20); FStar_UInt128_uint128 o10 = FStar_UInt128_mul_wide(f10, f21); FStar_UInt128_uint128 o20 = FStar_UInt128_mul_wide(f10, f22); @@ -129,25 +129,24 @@ Hacl_Impl_Curve25519_Field51_fmul( FStar_UInt128_uint128 tmp_w2 = o24; FStar_UInt128_uint128 tmp_w3 = o34; FStar_UInt128_uint128 tmp_w4 = o44; - FStar_UInt128_uint128 - l_ = FStar_UInt128_add(tmp_w0, FStar_UInt128_uint64_to_uint128((uint64_t)0U)); - uint64_t tmp01 = FStar_UInt128_uint128_to_uint64(l_) & (uint64_t)0x7ffffffffffffU; - uint64_t c0 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_, (uint32_t)51U)); + FStar_UInt128_uint128 l_ = FStar_UInt128_add(tmp_w0, FStar_UInt128_uint64_to_uint128(0ULL)); + uint64_t tmp01 = FStar_UInt128_uint128_to_uint64(l_) & 0x7ffffffffffffULL; + uint64_t c0 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_, 51U)); FStar_UInt128_uint128 l_0 = FStar_UInt128_add(tmp_w1, FStar_UInt128_uint64_to_uint128(c0)); - uint64_t tmp11 = FStar_UInt128_uint128_to_uint64(l_0) & (uint64_t)0x7ffffffffffffU; - uint64_t c1 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_0, (uint32_t)51U)); + uint64_t tmp11 = FStar_UInt128_uint128_to_uint64(l_0) & 0x7ffffffffffffULL; + uint64_t c1 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_0, 51U)); FStar_UInt128_uint128 l_1 = FStar_UInt128_add(tmp_w2, FStar_UInt128_uint64_to_uint128(c1)); - uint64_t tmp21 = FStar_UInt128_uint128_to_uint64(l_1) & (uint64_t)0x7ffffffffffffU; - uint64_t c2 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_1, (uint32_t)51U)); + uint64_t tmp21 = FStar_UInt128_uint128_to_uint64(l_1) & 0x7ffffffffffffULL; + uint64_t c2 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_1, 51U)); FStar_UInt128_uint128 l_2 = FStar_UInt128_add(tmp_w3, FStar_UInt128_uint64_to_uint128(c2)); - uint64_t tmp31 = FStar_UInt128_uint128_to_uint64(l_2) & (uint64_t)0x7ffffffffffffU; - uint64_t c3 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_2, (uint32_t)51U)); + uint64_t tmp31 = FStar_UInt128_uint128_to_uint64(l_2) & 0x7ffffffffffffULL; + uint64_t c3 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_2, 51U)); FStar_UInt128_uint128 l_3 = FStar_UInt128_add(tmp_w4, FStar_UInt128_uint64_to_uint128(c3)); - uint64_t tmp41 = FStar_UInt128_uint128_to_uint64(l_3) & (uint64_t)0x7ffffffffffffU; - uint64_t c4 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_3, (uint32_t)51U)); - uint64_t l_4 = tmp01 + c4 * (uint64_t)19U; - uint64_t tmp0_ = l_4 & (uint64_t)0x7ffffffffffffU; - uint64_t c5 = l_4 >> (uint32_t)51U; + uint64_t tmp41 = FStar_UInt128_uint128_to_uint64(l_3) & 0x7ffffffffffffULL; + uint64_t c4 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_3, 51U)); + uint64_t l_4 = tmp01 + c4 * 19ULL; + uint64_t tmp0_ = l_4 & 0x7ffffffffffffULL; + uint64_t c5 = l_4 >> 51U; uint64_t o0 = tmp0_; uint64_t o1 = tmp11 + c5; uint64_t o2 = tmp21; @@ -168,7 +167,7 @@ Hacl_Impl_Curve25519_Field51_fmul2( FStar_UInt128_uint128 *uu___ ) { - KRML_HOST_IGNORE(uu___); + KRML_MAYBE_UNUSED_VAR(uu___); uint64_t f10 = f1[0U]; uint64_t f11 = f1[1U]; uint64_t f12 = f1[2U]; @@ -189,14 +188,14 @@ Hacl_Impl_Curve25519_Field51_fmul2( uint64_t f42 = f2[7U]; uint64_t f43 = f2[8U]; uint64_t f44 = f2[9U]; - uint64_t tmp11 = f21 * (uint64_t)19U; - uint64_t tmp12 = f22 * (uint64_t)19U; - uint64_t tmp13 = f23 * (uint64_t)19U; - uint64_t tmp14 = f24 * (uint64_t)19U; - uint64_t tmp21 = f41 * (uint64_t)19U; - uint64_t tmp22 = f42 * (uint64_t)19U; - uint64_t tmp23 = f43 * (uint64_t)19U; - uint64_t tmp24 = f44 * (uint64_t)19U; + uint64_t tmp11 = f21 * 19ULL; + uint64_t tmp12 = f22 * 19ULL; + uint64_t tmp13 = f23 * 19ULL; + uint64_t tmp14 = f24 * 19ULL; + uint64_t tmp21 = f41 * 19ULL; + uint64_t tmp22 = f42 * 19ULL; + uint64_t tmp23 = f43 * 19ULL; + uint64_t tmp24 = f44 * 19ULL; FStar_UInt128_uint128 o00 = FStar_UInt128_mul_wide(f10, f20); FStar_UInt128_uint128 o15 = FStar_UInt128_mul_wide(f10, f21); FStar_UInt128_uint128 o25 = FStar_UInt128_mul_wide(f10, f22); @@ -257,49 +256,47 @@ Hacl_Impl_Curve25519_Field51_fmul2( FStar_UInt128_uint128 tmp_w22 = o241; FStar_UInt128_uint128 tmp_w23 = o34; FStar_UInt128_uint128 tmp_w24 = o44; - FStar_UInt128_uint128 - l_ = FStar_UInt128_add(tmp_w10, FStar_UInt128_uint64_to_uint128((uint64_t)0U)); - uint64_t tmp00 = FStar_UInt128_uint128_to_uint64(l_) & (uint64_t)0x7ffffffffffffU; - uint64_t c00 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_, (uint32_t)51U)); + FStar_UInt128_uint128 l_ = FStar_UInt128_add(tmp_w10, FStar_UInt128_uint64_to_uint128(0ULL)); + uint64_t tmp00 = FStar_UInt128_uint128_to_uint64(l_) & 0x7ffffffffffffULL; + uint64_t c00 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_, 51U)); FStar_UInt128_uint128 l_0 = FStar_UInt128_add(tmp_w11, FStar_UInt128_uint64_to_uint128(c00)); - uint64_t tmp10 = FStar_UInt128_uint128_to_uint64(l_0) & (uint64_t)0x7ffffffffffffU; - uint64_t c10 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_0, (uint32_t)51U)); + uint64_t tmp10 = FStar_UInt128_uint128_to_uint64(l_0) & 0x7ffffffffffffULL; + uint64_t c10 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_0, 51U)); FStar_UInt128_uint128 l_1 = FStar_UInt128_add(tmp_w12, FStar_UInt128_uint64_to_uint128(c10)); - uint64_t tmp20 = FStar_UInt128_uint128_to_uint64(l_1) & (uint64_t)0x7ffffffffffffU; - uint64_t c20 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_1, (uint32_t)51U)); + uint64_t tmp20 = FStar_UInt128_uint128_to_uint64(l_1) & 0x7ffffffffffffULL; + uint64_t c20 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_1, 51U)); FStar_UInt128_uint128 l_2 = FStar_UInt128_add(tmp_w13, FStar_UInt128_uint64_to_uint128(c20)); - uint64_t tmp30 = FStar_UInt128_uint128_to_uint64(l_2) & (uint64_t)0x7ffffffffffffU; - uint64_t c30 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_2, (uint32_t)51U)); + uint64_t tmp30 = FStar_UInt128_uint128_to_uint64(l_2) & 0x7ffffffffffffULL; + uint64_t c30 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_2, 51U)); FStar_UInt128_uint128 l_3 = FStar_UInt128_add(tmp_w14, FStar_UInt128_uint64_to_uint128(c30)); - uint64_t tmp40 = FStar_UInt128_uint128_to_uint64(l_3) & (uint64_t)0x7ffffffffffffU; - uint64_t c40 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_3, (uint32_t)51U)); - uint64_t l_4 = tmp00 + c40 * (uint64_t)19U; - uint64_t tmp0_ = l_4 & (uint64_t)0x7ffffffffffffU; - uint64_t c50 = l_4 >> (uint32_t)51U; + uint64_t tmp40 = FStar_UInt128_uint128_to_uint64(l_3) & 0x7ffffffffffffULL; + uint64_t c40 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_3, 51U)); + uint64_t l_4 = tmp00 + c40 * 19ULL; + uint64_t tmp0_ = l_4 & 0x7ffffffffffffULL; + uint64_t c50 = l_4 >> 51U; uint64_t o100 = tmp0_; uint64_t o112 = tmp10 + c50; uint64_t o122 = tmp20; uint64_t o132 = tmp30; uint64_t o142 = tmp40; - FStar_UInt128_uint128 - l_5 = FStar_UInt128_add(tmp_w20, FStar_UInt128_uint64_to_uint128((uint64_t)0U)); - uint64_t tmp0 = FStar_UInt128_uint128_to_uint64(l_5) & (uint64_t)0x7ffffffffffffU; - uint64_t c0 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_5, (uint32_t)51U)); + FStar_UInt128_uint128 l_5 = FStar_UInt128_add(tmp_w20, FStar_UInt128_uint64_to_uint128(0ULL)); + uint64_t tmp0 = FStar_UInt128_uint128_to_uint64(l_5) & 0x7ffffffffffffULL; + uint64_t c0 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_5, 51U)); FStar_UInt128_uint128 l_6 = FStar_UInt128_add(tmp_w21, FStar_UInt128_uint64_to_uint128(c0)); - uint64_t tmp1 = FStar_UInt128_uint128_to_uint64(l_6) & (uint64_t)0x7ffffffffffffU; - uint64_t c1 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_6, (uint32_t)51U)); + uint64_t tmp1 = FStar_UInt128_uint128_to_uint64(l_6) & 0x7ffffffffffffULL; + uint64_t c1 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_6, 51U)); FStar_UInt128_uint128 l_7 = FStar_UInt128_add(tmp_w22, FStar_UInt128_uint64_to_uint128(c1)); - uint64_t tmp2 = FStar_UInt128_uint128_to_uint64(l_7) & (uint64_t)0x7ffffffffffffU; - uint64_t c2 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_7, (uint32_t)51U)); + uint64_t tmp2 = FStar_UInt128_uint128_to_uint64(l_7) & 0x7ffffffffffffULL; + uint64_t c2 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_7, 51U)); FStar_UInt128_uint128 l_8 = FStar_UInt128_add(tmp_w23, FStar_UInt128_uint64_to_uint128(c2)); - uint64_t tmp3 = FStar_UInt128_uint128_to_uint64(l_8) & (uint64_t)0x7ffffffffffffU; - uint64_t c3 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_8, (uint32_t)51U)); + uint64_t tmp3 = FStar_UInt128_uint128_to_uint64(l_8) & 0x7ffffffffffffULL; + uint64_t c3 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_8, 51U)); FStar_UInt128_uint128 l_9 = FStar_UInt128_add(tmp_w24, FStar_UInt128_uint64_to_uint128(c3)); - uint64_t tmp4 = FStar_UInt128_uint128_to_uint64(l_9) & (uint64_t)0x7ffffffffffffU; - uint64_t c4 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_9, (uint32_t)51U)); - uint64_t l_10 = tmp0 + c4 * (uint64_t)19U; - uint64_t tmp0_0 = l_10 & (uint64_t)0x7ffffffffffffU; - uint64_t c5 = l_10 >> (uint32_t)51U; + uint64_t tmp4 = FStar_UInt128_uint128_to_uint64(l_9) & 0x7ffffffffffffULL; + uint64_t c4 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_9, 51U)); + uint64_t l_10 = tmp0 + c4 * 19ULL; + uint64_t tmp0_0 = l_10 & 0x7ffffffffffffULL; + uint64_t c5 = l_10 >> 51U; uint64_t o200 = tmp0_0; uint64_t o212 = tmp1 + c5; uint64_t o222 = tmp2; @@ -339,25 +336,24 @@ static inline void Hacl_Impl_Curve25519_Field51_fmul1(uint64_t *out, uint64_t *f FStar_UInt128_uint128 tmp_w2 = FStar_UInt128_mul_wide(f2, f12); FStar_UInt128_uint128 tmp_w3 = FStar_UInt128_mul_wide(f2, f13); FStar_UInt128_uint128 tmp_w4 = FStar_UInt128_mul_wide(f2, f14); - FStar_UInt128_uint128 - l_ = FStar_UInt128_add(tmp_w0, FStar_UInt128_uint64_to_uint128((uint64_t)0U)); - uint64_t tmp0 = FStar_UInt128_uint128_to_uint64(l_) & (uint64_t)0x7ffffffffffffU; - uint64_t c0 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_, (uint32_t)51U)); + FStar_UInt128_uint128 l_ = FStar_UInt128_add(tmp_w0, FStar_UInt128_uint64_to_uint128(0ULL)); + uint64_t tmp0 = FStar_UInt128_uint128_to_uint64(l_) & 0x7ffffffffffffULL; + uint64_t c0 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_, 51U)); FStar_UInt128_uint128 l_0 = FStar_UInt128_add(tmp_w1, FStar_UInt128_uint64_to_uint128(c0)); - uint64_t tmp1 = FStar_UInt128_uint128_to_uint64(l_0) & (uint64_t)0x7ffffffffffffU; - uint64_t c1 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_0, (uint32_t)51U)); + uint64_t tmp1 = FStar_UInt128_uint128_to_uint64(l_0) & 0x7ffffffffffffULL; + uint64_t c1 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_0, 51U)); FStar_UInt128_uint128 l_1 = FStar_UInt128_add(tmp_w2, FStar_UInt128_uint64_to_uint128(c1)); - uint64_t tmp2 = FStar_UInt128_uint128_to_uint64(l_1) & (uint64_t)0x7ffffffffffffU; - uint64_t c2 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_1, (uint32_t)51U)); + uint64_t tmp2 = FStar_UInt128_uint128_to_uint64(l_1) & 0x7ffffffffffffULL; + uint64_t c2 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_1, 51U)); FStar_UInt128_uint128 l_2 = FStar_UInt128_add(tmp_w3, FStar_UInt128_uint64_to_uint128(c2)); - uint64_t tmp3 = FStar_UInt128_uint128_to_uint64(l_2) & (uint64_t)0x7ffffffffffffU; - uint64_t c3 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_2, (uint32_t)51U)); + uint64_t tmp3 = FStar_UInt128_uint128_to_uint64(l_2) & 0x7ffffffffffffULL; + uint64_t c3 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_2, 51U)); FStar_UInt128_uint128 l_3 = FStar_UInt128_add(tmp_w4, FStar_UInt128_uint64_to_uint128(c3)); - uint64_t tmp4 = FStar_UInt128_uint128_to_uint64(l_3) & (uint64_t)0x7ffffffffffffU; - uint64_t c4 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_3, (uint32_t)51U)); - uint64_t l_4 = tmp0 + c4 * (uint64_t)19U; - uint64_t tmp0_ = l_4 & (uint64_t)0x7ffffffffffffU; - uint64_t c5 = l_4 >> (uint32_t)51U; + uint64_t tmp4 = FStar_UInt128_uint128_to_uint64(l_3) & 0x7ffffffffffffULL; + uint64_t c4 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_3, 51U)); + uint64_t l_4 = tmp0 + c4 * 19ULL; + uint64_t tmp0_ = l_4 & 0x7ffffffffffffULL; + uint64_t c5 = l_4 >> 51U; uint64_t o0 = tmp0_; uint64_t o1 = tmp1 + c5; uint64_t o2 = tmp2; @@ -373,18 +369,18 @@ static inline void Hacl_Impl_Curve25519_Field51_fmul1(uint64_t *out, uint64_t *f static inline void Hacl_Impl_Curve25519_Field51_fsqr(uint64_t *out, uint64_t *f, FStar_UInt128_uint128 *uu___) { - KRML_HOST_IGNORE(uu___); + KRML_MAYBE_UNUSED_VAR(uu___); uint64_t f0 = f[0U]; uint64_t f1 = f[1U]; uint64_t f2 = f[2U]; uint64_t f3 = f[3U]; uint64_t f4 = f[4U]; - uint64_t d0 = (uint64_t)2U * f0; - uint64_t d1 = (uint64_t)2U * f1; - uint64_t d2 = (uint64_t)38U * f2; - uint64_t d3 = (uint64_t)19U * f3; - uint64_t d419 = (uint64_t)19U * f4; - uint64_t d4 = (uint64_t)2U * d419; + uint64_t d0 = 2ULL * f0; + uint64_t d1 = 2ULL * f1; + uint64_t d2 = 38ULL * f2; + uint64_t d3 = 19ULL * f3; + uint64_t d419 = 19ULL * f4; + uint64_t d4 = 2ULL * d419; FStar_UInt128_uint128 s0 = FStar_UInt128_add(FStar_UInt128_add(FStar_UInt128_mul_wide(f0, f0), @@ -415,25 +411,24 @@ Hacl_Impl_Curve25519_Field51_fsqr(uint64_t *out, uint64_t *f, FStar_UInt128_uint FStar_UInt128_uint128 o20 = s2; FStar_UInt128_uint128 o30 = s3; FStar_UInt128_uint128 o40 = s4; - FStar_UInt128_uint128 - l_ = FStar_UInt128_add(o00, FStar_UInt128_uint64_to_uint128((uint64_t)0U)); - uint64_t tmp0 = FStar_UInt128_uint128_to_uint64(l_) & (uint64_t)0x7ffffffffffffU; - uint64_t c0 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_, (uint32_t)51U)); + FStar_UInt128_uint128 l_ = FStar_UInt128_add(o00, FStar_UInt128_uint64_to_uint128(0ULL)); + uint64_t tmp0 = FStar_UInt128_uint128_to_uint64(l_) & 0x7ffffffffffffULL; + uint64_t c0 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_, 51U)); FStar_UInt128_uint128 l_0 = FStar_UInt128_add(o10, FStar_UInt128_uint64_to_uint128(c0)); - uint64_t tmp1 = FStar_UInt128_uint128_to_uint64(l_0) & (uint64_t)0x7ffffffffffffU; - uint64_t c1 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_0, (uint32_t)51U)); + uint64_t tmp1 = FStar_UInt128_uint128_to_uint64(l_0) & 0x7ffffffffffffULL; + uint64_t c1 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_0, 51U)); FStar_UInt128_uint128 l_1 = FStar_UInt128_add(o20, FStar_UInt128_uint64_to_uint128(c1)); - uint64_t tmp2 = FStar_UInt128_uint128_to_uint64(l_1) & (uint64_t)0x7ffffffffffffU; - uint64_t c2 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_1, (uint32_t)51U)); + uint64_t tmp2 = FStar_UInt128_uint128_to_uint64(l_1) & 0x7ffffffffffffULL; + uint64_t c2 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_1, 51U)); FStar_UInt128_uint128 l_2 = FStar_UInt128_add(o30, FStar_UInt128_uint64_to_uint128(c2)); - uint64_t tmp3 = FStar_UInt128_uint128_to_uint64(l_2) & (uint64_t)0x7ffffffffffffU; - uint64_t c3 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_2, (uint32_t)51U)); + uint64_t tmp3 = FStar_UInt128_uint128_to_uint64(l_2) & 0x7ffffffffffffULL; + uint64_t c3 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_2, 51U)); FStar_UInt128_uint128 l_3 = FStar_UInt128_add(o40, FStar_UInt128_uint64_to_uint128(c3)); - uint64_t tmp4 = FStar_UInt128_uint128_to_uint64(l_3) & (uint64_t)0x7ffffffffffffU; - uint64_t c4 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_3, (uint32_t)51U)); - uint64_t l_4 = tmp0 + c4 * (uint64_t)19U; - uint64_t tmp0_ = l_4 & (uint64_t)0x7ffffffffffffU; - uint64_t c5 = l_4 >> (uint32_t)51U; + uint64_t tmp4 = FStar_UInt128_uint128_to_uint64(l_3) & 0x7ffffffffffffULL; + uint64_t c4 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_3, 51U)); + uint64_t l_4 = tmp0 + c4 * 19ULL; + uint64_t tmp0_ = l_4 & 0x7ffffffffffffULL; + uint64_t c5 = l_4 >> 51U; uint64_t o0 = tmp0_; uint64_t o1 = tmp1 + c5; uint64_t o2 = tmp2; @@ -449,7 +444,7 @@ Hacl_Impl_Curve25519_Field51_fsqr(uint64_t *out, uint64_t *f, FStar_UInt128_uint static inline void Hacl_Impl_Curve25519_Field51_fsqr2(uint64_t *out, uint64_t *f, FStar_UInt128_uint128 *uu___) { - KRML_HOST_IGNORE(uu___); + KRML_MAYBE_UNUSED_VAR(uu___); uint64_t f10 = f[0U]; uint64_t f11 = f[1U]; uint64_t f12 = f[2U]; @@ -460,12 +455,12 @@ Hacl_Impl_Curve25519_Field51_fsqr2(uint64_t *out, uint64_t *f, FStar_UInt128_uin uint64_t f22 = f[7U]; uint64_t f23 = f[8U]; uint64_t f24 = f[9U]; - uint64_t d00 = (uint64_t)2U * f10; - uint64_t d10 = (uint64_t)2U * f11; - uint64_t d20 = (uint64_t)38U * f12; - uint64_t d30 = (uint64_t)19U * f13; - uint64_t d4190 = (uint64_t)19U * f14; - uint64_t d40 = (uint64_t)2U * d4190; + uint64_t d00 = 2ULL * f10; + uint64_t d10 = 2ULL * f11; + uint64_t d20 = 38ULL * f12; + uint64_t d30 = 19ULL * f13; + uint64_t d4190 = 19ULL * f14; + uint64_t d40 = 2ULL * d4190; FStar_UInt128_uint128 s00 = FStar_UInt128_add(FStar_UInt128_add(FStar_UInt128_mul_wide(f10, f10), @@ -496,12 +491,12 @@ Hacl_Impl_Curve25519_Field51_fsqr2(uint64_t *out, uint64_t *f, FStar_UInt128_uin FStar_UInt128_uint128 o120 = s20; FStar_UInt128_uint128 o130 = s30; FStar_UInt128_uint128 o140 = s40; - uint64_t d0 = (uint64_t)2U * f20; - uint64_t d1 = (uint64_t)2U * f21; - uint64_t d2 = (uint64_t)38U * f22; - uint64_t d3 = (uint64_t)19U * f23; - uint64_t d419 = (uint64_t)19U * f24; - uint64_t d4 = (uint64_t)2U * d419; + uint64_t d0 = 2ULL * f20; + uint64_t d1 = 2ULL * f21; + uint64_t d2 = 38ULL * f22; + uint64_t d3 = 19ULL * f23; + uint64_t d419 = 19ULL * f24; + uint64_t d4 = 2ULL * d419; FStar_UInt128_uint128 s0 = FStar_UInt128_add(FStar_UInt128_add(FStar_UInt128_mul_wide(f20, f20), @@ -532,49 +527,47 @@ Hacl_Impl_Curve25519_Field51_fsqr2(uint64_t *out, uint64_t *f, FStar_UInt128_uin FStar_UInt128_uint128 o220 = s2; FStar_UInt128_uint128 o230 = s3; FStar_UInt128_uint128 o240 = s4; - FStar_UInt128_uint128 - l_ = FStar_UInt128_add(o100, FStar_UInt128_uint64_to_uint128((uint64_t)0U)); - uint64_t tmp00 = FStar_UInt128_uint128_to_uint64(l_) & (uint64_t)0x7ffffffffffffU; - uint64_t c00 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_, (uint32_t)51U)); + FStar_UInt128_uint128 l_ = FStar_UInt128_add(o100, FStar_UInt128_uint64_to_uint128(0ULL)); + uint64_t tmp00 = FStar_UInt128_uint128_to_uint64(l_) & 0x7ffffffffffffULL; + uint64_t c00 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_, 51U)); FStar_UInt128_uint128 l_0 = FStar_UInt128_add(o110, FStar_UInt128_uint64_to_uint128(c00)); - uint64_t tmp10 = FStar_UInt128_uint128_to_uint64(l_0) & (uint64_t)0x7ffffffffffffU; - uint64_t c10 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_0, (uint32_t)51U)); + uint64_t tmp10 = FStar_UInt128_uint128_to_uint64(l_0) & 0x7ffffffffffffULL; + uint64_t c10 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_0, 51U)); FStar_UInt128_uint128 l_1 = FStar_UInt128_add(o120, FStar_UInt128_uint64_to_uint128(c10)); - uint64_t tmp20 = FStar_UInt128_uint128_to_uint64(l_1) & (uint64_t)0x7ffffffffffffU; - uint64_t c20 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_1, (uint32_t)51U)); + uint64_t tmp20 = FStar_UInt128_uint128_to_uint64(l_1) & 0x7ffffffffffffULL; + uint64_t c20 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_1, 51U)); FStar_UInt128_uint128 l_2 = FStar_UInt128_add(o130, FStar_UInt128_uint64_to_uint128(c20)); - uint64_t tmp30 = FStar_UInt128_uint128_to_uint64(l_2) & (uint64_t)0x7ffffffffffffU; - uint64_t c30 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_2, (uint32_t)51U)); + uint64_t tmp30 = FStar_UInt128_uint128_to_uint64(l_2) & 0x7ffffffffffffULL; + uint64_t c30 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_2, 51U)); FStar_UInt128_uint128 l_3 = FStar_UInt128_add(o140, FStar_UInt128_uint64_to_uint128(c30)); - uint64_t tmp40 = FStar_UInt128_uint128_to_uint64(l_3) & (uint64_t)0x7ffffffffffffU; - uint64_t c40 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_3, (uint32_t)51U)); - uint64_t l_4 = tmp00 + c40 * (uint64_t)19U; - uint64_t tmp0_ = l_4 & (uint64_t)0x7ffffffffffffU; - uint64_t c50 = l_4 >> (uint32_t)51U; + uint64_t tmp40 = FStar_UInt128_uint128_to_uint64(l_3) & 0x7ffffffffffffULL; + uint64_t c40 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_3, 51U)); + uint64_t l_4 = tmp00 + c40 * 19ULL; + uint64_t tmp0_ = l_4 & 0x7ffffffffffffULL; + uint64_t c50 = l_4 >> 51U; uint64_t o101 = tmp0_; uint64_t o111 = tmp10 + c50; uint64_t o121 = tmp20; uint64_t o131 = tmp30; uint64_t o141 = tmp40; - FStar_UInt128_uint128 - l_5 = FStar_UInt128_add(o200, FStar_UInt128_uint64_to_uint128((uint64_t)0U)); - uint64_t tmp0 = FStar_UInt128_uint128_to_uint64(l_5) & (uint64_t)0x7ffffffffffffU; - uint64_t c0 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_5, (uint32_t)51U)); + FStar_UInt128_uint128 l_5 = FStar_UInt128_add(o200, FStar_UInt128_uint64_to_uint128(0ULL)); + uint64_t tmp0 = FStar_UInt128_uint128_to_uint64(l_5) & 0x7ffffffffffffULL; + uint64_t c0 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_5, 51U)); FStar_UInt128_uint128 l_6 = FStar_UInt128_add(o210, FStar_UInt128_uint64_to_uint128(c0)); - uint64_t tmp1 = FStar_UInt128_uint128_to_uint64(l_6) & (uint64_t)0x7ffffffffffffU; - uint64_t c1 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_6, (uint32_t)51U)); + uint64_t tmp1 = FStar_UInt128_uint128_to_uint64(l_6) & 0x7ffffffffffffULL; + uint64_t c1 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_6, 51U)); FStar_UInt128_uint128 l_7 = FStar_UInt128_add(o220, FStar_UInt128_uint64_to_uint128(c1)); - uint64_t tmp2 = FStar_UInt128_uint128_to_uint64(l_7) & (uint64_t)0x7ffffffffffffU; - uint64_t c2 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_7, (uint32_t)51U)); + uint64_t tmp2 = FStar_UInt128_uint128_to_uint64(l_7) & 0x7ffffffffffffULL; + uint64_t c2 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_7, 51U)); FStar_UInt128_uint128 l_8 = FStar_UInt128_add(o230, FStar_UInt128_uint64_to_uint128(c2)); - uint64_t tmp3 = FStar_UInt128_uint128_to_uint64(l_8) & (uint64_t)0x7ffffffffffffU; - uint64_t c3 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_8, (uint32_t)51U)); + uint64_t tmp3 = FStar_UInt128_uint128_to_uint64(l_8) & 0x7ffffffffffffULL; + uint64_t c3 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_8, 51U)); FStar_UInt128_uint128 l_9 = FStar_UInt128_add(o240, FStar_UInt128_uint64_to_uint128(c3)); - uint64_t tmp4 = FStar_UInt128_uint128_to_uint64(l_9) & (uint64_t)0x7ffffffffffffU; - uint64_t c4 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_9, (uint32_t)51U)); - uint64_t l_10 = tmp0 + c4 * (uint64_t)19U; - uint64_t tmp0_0 = l_10 & (uint64_t)0x7ffffffffffffU; - uint64_t c5 = l_10 >> (uint32_t)51U; + uint64_t tmp4 = FStar_UInt128_uint128_to_uint64(l_9) & 0x7ffffffffffffULL; + uint64_t c4 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_9, 51U)); + uint64_t l_10 = tmp0 + c4 * 19ULL; + uint64_t tmp0_0 = l_10 & 0x7ffffffffffffULL; + uint64_t c5 = l_10 >> 51U; uint64_t o201 = tmp0_0; uint64_t o211 = tmp1 + c5; uint64_t o221 = tmp2; @@ -609,49 +602,49 @@ static inline void Hacl_Impl_Curve25519_Field51_store_felem(uint64_t *u64s, uint uint64_t f2 = f[2U]; uint64_t f3 = f[3U]; uint64_t f4 = f[4U]; - uint64_t l_ = f0 + (uint64_t)0U; - uint64_t tmp0 = l_ & (uint64_t)0x7ffffffffffffU; - uint64_t c0 = l_ >> (uint32_t)51U; + uint64_t l_ = f0 + 0ULL; + uint64_t tmp0 = l_ & 0x7ffffffffffffULL; + uint64_t c0 = l_ >> 51U; uint64_t l_0 = f1 + c0; - uint64_t tmp1 = l_0 & (uint64_t)0x7ffffffffffffU; - uint64_t c1 = l_0 >> (uint32_t)51U; + uint64_t tmp1 = l_0 & 0x7ffffffffffffULL; + uint64_t c1 = l_0 >> 51U; uint64_t l_1 = f2 + c1; - uint64_t tmp2 = l_1 & (uint64_t)0x7ffffffffffffU; - uint64_t c2 = l_1 >> (uint32_t)51U; + uint64_t tmp2 = l_1 & 0x7ffffffffffffULL; + uint64_t c2 = l_1 >> 51U; uint64_t l_2 = f3 + c2; - uint64_t tmp3 = l_2 & (uint64_t)0x7ffffffffffffU; - uint64_t c3 = l_2 >> (uint32_t)51U; + uint64_t tmp3 = l_2 & 0x7ffffffffffffULL; + uint64_t c3 = l_2 >> 51U; uint64_t l_3 = f4 + c3; - uint64_t tmp4 = l_3 & (uint64_t)0x7ffffffffffffU; - uint64_t c4 = l_3 >> (uint32_t)51U; - uint64_t l_4 = tmp0 + c4 * (uint64_t)19U; - uint64_t tmp0_ = l_4 & (uint64_t)0x7ffffffffffffU; - uint64_t c5 = l_4 >> (uint32_t)51U; + uint64_t tmp4 = l_3 & 0x7ffffffffffffULL; + uint64_t c4 = l_3 >> 51U; + uint64_t l_4 = tmp0 + c4 * 19ULL; + uint64_t tmp0_ = l_4 & 0x7ffffffffffffULL; + uint64_t c5 = l_4 >> 51U; uint64_t f01 = tmp0_; uint64_t f11 = tmp1 + c5; uint64_t f21 = tmp2; uint64_t f31 = tmp3; uint64_t f41 = tmp4; - uint64_t m0 = FStar_UInt64_gte_mask(f01, (uint64_t)0x7ffffffffffedU); - uint64_t m1 = FStar_UInt64_eq_mask(f11, (uint64_t)0x7ffffffffffffU); - uint64_t m2 = FStar_UInt64_eq_mask(f21, (uint64_t)0x7ffffffffffffU); - uint64_t m3 = FStar_UInt64_eq_mask(f31, (uint64_t)0x7ffffffffffffU); - uint64_t m4 = FStar_UInt64_eq_mask(f41, (uint64_t)0x7ffffffffffffU); + uint64_t m0 = FStar_UInt64_gte_mask(f01, 0x7ffffffffffedULL); + uint64_t m1 = FStar_UInt64_eq_mask(f11, 0x7ffffffffffffULL); + uint64_t m2 = FStar_UInt64_eq_mask(f21, 0x7ffffffffffffULL); + uint64_t m3 = FStar_UInt64_eq_mask(f31, 0x7ffffffffffffULL); + uint64_t m4 = FStar_UInt64_eq_mask(f41, 0x7ffffffffffffULL); uint64_t mask = (((m0 & m1) & m2) & m3) & m4; - uint64_t f0_ = f01 - (mask & (uint64_t)0x7ffffffffffedU); - uint64_t f1_ = f11 - (mask & (uint64_t)0x7ffffffffffffU); - uint64_t f2_ = f21 - (mask & (uint64_t)0x7ffffffffffffU); - uint64_t f3_ = f31 - (mask & (uint64_t)0x7ffffffffffffU); - uint64_t f4_ = f41 - (mask & (uint64_t)0x7ffffffffffffU); + uint64_t f0_ = f01 - (mask & 0x7ffffffffffedULL); + uint64_t f1_ = f11 - (mask & 0x7ffffffffffffULL); + uint64_t f2_ = f21 - (mask & 0x7ffffffffffffULL); + uint64_t f3_ = f31 - (mask & 0x7ffffffffffffULL); + uint64_t f4_ = f41 - (mask & 0x7ffffffffffffULL); uint64_t f02 = f0_; uint64_t f12 = f1_; uint64_t f22 = f2_; uint64_t f32 = f3_; uint64_t f42 = f4_; - uint64_t o00 = f02 | f12 << (uint32_t)51U; - uint64_t o10 = f12 >> (uint32_t)13U | f22 << (uint32_t)38U; - uint64_t o20 = f22 >> (uint32_t)26U | f32 << (uint32_t)25U; - uint64_t o30 = f32 >> (uint32_t)39U | f42 << (uint32_t)12U; + uint64_t o00 = f02 | f12 << 51U; + uint64_t o10 = f12 >> 13U | f22 << 38U; + uint64_t o20 = f22 >> 26U | f32 << 25U; + uint64_t o30 = f32 >> 39U | f42 << 12U; uint64_t o0 = o00; uint64_t o1 = o10; uint64_t o2 = o20; @@ -665,11 +658,11 @@ static inline void Hacl_Impl_Curve25519_Field51_store_felem(uint64_t *u64s, uint static inline void Hacl_Impl_Curve25519_Field51_cswap2(uint64_t bit, uint64_t *p1, uint64_t *p2) { - uint64_t mask = (uint64_t)0U - bit; + uint64_t mask = 0ULL - bit; KRML_MAYBE_FOR10(i, - (uint32_t)0U, - (uint32_t)10U, - (uint32_t)1U, + 0U, + 10U, + 1U, uint64_t dummy = mask & (p1[i] ^ p2[i]); p1[i] = p1[i] ^ dummy; p2[i] = p2[i] ^ dummy;); diff --git a/include/internal/Hacl_Bignum_Base.h b/include/internal/Hacl_Bignum_Base.h index 2cfb0066..f2e282f4 100644 --- a/include/internal/Hacl_Bignum_Base.h +++ b/include/internal/Hacl_Bignum_Base.h @@ -45,7 +45,7 @@ Hacl_Bignum_Base_mul_wide_add2_u32(uint32_t a, uint32_t b, uint32_t c_in, uint32 uint32_t out0 = out[0U]; uint64_t res = (uint64_t)a * (uint64_t)b + (uint64_t)c_in + (uint64_t)out0; out[0U] = (uint32_t)res; - return (uint32_t)(res >> (uint32_t)32U); + return (uint32_t)(res >> 32U); } static inline uint64_t @@ -58,22 +58,22 @@ Hacl_Bignum_Base_mul_wide_add2_u64(uint64_t a, uint64_t b, uint64_t c_in, uint64 FStar_UInt128_uint64_to_uint128(c_in)), FStar_UInt128_uint64_to_uint128(out0)); out[0U] = FStar_UInt128_uint128_to_uint64(res); - return FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(res, (uint32_t)64U)); + return FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(res, 64U)); } static inline void Hacl_Bignum_Convert_bn_from_bytes_be_uint64(uint32_t len, uint8_t *b, uint64_t *res) { - uint32_t bnLen = (len - (uint32_t)1U) / (uint32_t)8U + (uint32_t)1U; - uint32_t tmpLen = (uint32_t)8U * bnLen; + uint32_t bnLen = (len - 1U) / 8U + 1U; + uint32_t tmpLen = 8U * bnLen; KRML_CHECK_SIZE(sizeof (uint8_t), tmpLen); uint8_t tmp[tmpLen]; memset(tmp, 0U, tmpLen * sizeof (uint8_t)); memcpy(tmp + tmpLen - len, b, len * sizeof (uint8_t)); - for (uint32_t i = (uint32_t)0U; i < bnLen; i++) + for (uint32_t i = 0U; i < bnLen; i++) { uint64_t *os = res; - uint64_t u = load64_be(tmp + (bnLen - i - (uint32_t)1U) * (uint32_t)8U); + uint64_t u = load64_be(tmp + (bnLen - i - 1U) * 8U); uint64_t x = u; os[i] = x; } @@ -82,24 +82,24 @@ Hacl_Bignum_Convert_bn_from_bytes_be_uint64(uint32_t len, uint8_t *b, uint64_t * static inline void Hacl_Bignum_Convert_bn_to_bytes_be_uint64(uint32_t len, uint64_t *b, uint8_t *res) { - uint32_t bnLen = (len - (uint32_t)1U) / (uint32_t)8U + (uint32_t)1U; - uint32_t tmpLen = (uint32_t)8U * bnLen; + uint32_t bnLen = (len - 1U) / 8U + 1U; + uint32_t tmpLen = 8U * bnLen; KRML_CHECK_SIZE(sizeof (uint8_t), tmpLen); uint8_t tmp[tmpLen]; memset(tmp, 0U, tmpLen * sizeof (uint8_t)); - for (uint32_t i = (uint32_t)0U; i < bnLen; i++) + for (uint32_t i = 0U; i < bnLen; i++) { - store64_be(tmp + i * (uint32_t)8U, b[bnLen - i - (uint32_t)1U]); + store64_be(tmp + i * 8U, b[bnLen - i - 1U]); } memcpy(res, tmp + tmpLen - len, len * sizeof (uint8_t)); } static inline uint32_t Hacl_Bignum_Lib_bn_get_top_index_u32(uint32_t len, uint32_t *b) { - uint32_t priv = (uint32_t)0U; - for (uint32_t i = (uint32_t)0U; i < len; i++) + uint32_t priv = 0U; + for (uint32_t i = 0U; i < len; i++) { - uint32_t mask = FStar_UInt32_eq_mask(b[i], (uint32_t)0U); + uint32_t mask = FStar_UInt32_eq_mask(b[i], 0U); priv = (mask & priv) | (~mask & i); } return priv; @@ -107,10 +107,10 @@ static inline uint32_t Hacl_Bignum_Lib_bn_get_top_index_u32(uint32_t len, uint32 static inline uint64_t Hacl_Bignum_Lib_bn_get_top_index_u64(uint32_t len, uint64_t *b) { - uint64_t priv = (uint64_t)0U; - for (uint32_t i = (uint32_t)0U; i < len; i++) + uint64_t priv = 0ULL; + for (uint32_t i = 0U; i < len; i++) { - uint64_t mask = FStar_UInt64_eq_mask(b[i], (uint64_t)0U); + uint64_t mask = FStar_UInt64_eq_mask(b[i], 0ULL); priv = (mask & priv) | (~mask & (uint64_t)i); } return priv; @@ -119,63 +119,63 @@ static inline uint64_t Hacl_Bignum_Lib_bn_get_top_index_u64(uint32_t len, uint64 static inline uint32_t Hacl_Bignum_Lib_bn_get_bits_u32(uint32_t len, uint32_t *b, uint32_t i, uint32_t l) { - uint32_t i1 = i / (uint32_t)32U; - uint32_t j = i % (uint32_t)32U; + uint32_t i1 = i / 32U; + uint32_t j = i % 32U; uint32_t p1 = b[i1] >> j; uint32_t ite; - if (i1 + (uint32_t)1U < len && (uint32_t)0U < j) + if (i1 + 1U < len && 0U < j) { - ite = p1 | b[i1 + (uint32_t)1U] << ((uint32_t)32U - j); + ite = p1 | b[i1 + 1U] << (32U - j); } else { ite = p1; } - return ite & (((uint32_t)1U << l) - (uint32_t)1U); + return ite & ((1U << l) - 1U); } static inline uint64_t Hacl_Bignum_Lib_bn_get_bits_u64(uint32_t len, uint64_t *b, uint32_t i, uint32_t l) { - uint32_t i1 = i / (uint32_t)64U; - uint32_t j = i % (uint32_t)64U; + uint32_t i1 = i / 64U; + uint32_t j = i % 64U; uint64_t p1 = b[i1] >> j; uint64_t ite; - if (i1 + (uint32_t)1U < len && (uint32_t)0U < j) + if (i1 + 1U < len && 0U < j) { - ite = p1 | b[i1 + (uint32_t)1U] << ((uint32_t)64U - j); + ite = p1 | b[i1 + 1U] << (64U - j); } else { ite = p1; } - return ite & (((uint64_t)1U << l) - (uint64_t)1U); + return ite & ((1ULL << l) - 1ULL); } static inline uint32_t Hacl_Bignum_Addition_bn_sub_eq_len_u32(uint32_t aLen, uint32_t *a, uint32_t *b, uint32_t *res) { - uint32_t c = (uint32_t)0U; - for (uint32_t i = (uint32_t)0U; i < aLen / (uint32_t)4U; i++) + uint32_t c = 0U; + for (uint32_t i = 0U; i < aLen / 4U; i++) { - uint32_t t1 = a[(uint32_t)4U * i]; - uint32_t t20 = b[(uint32_t)4U * i]; - uint32_t *res_i0 = res + (uint32_t)4U * i; + uint32_t t1 = a[4U * i]; + uint32_t t20 = b[4U * i]; + uint32_t *res_i0 = res + 4U * i; c = Lib_IntTypes_Intrinsics_sub_borrow_u32(c, t1, t20, res_i0); - uint32_t t10 = a[(uint32_t)4U * i + (uint32_t)1U]; - uint32_t t21 = b[(uint32_t)4U * i + (uint32_t)1U]; - uint32_t *res_i1 = res + (uint32_t)4U * i + (uint32_t)1U; + uint32_t t10 = a[4U * i + 1U]; + uint32_t t21 = b[4U * i + 1U]; + uint32_t *res_i1 = res + 4U * i + 1U; c = Lib_IntTypes_Intrinsics_sub_borrow_u32(c, t10, t21, res_i1); - uint32_t t11 = a[(uint32_t)4U * i + (uint32_t)2U]; - uint32_t t22 = b[(uint32_t)4U * i + (uint32_t)2U]; - uint32_t *res_i2 = res + (uint32_t)4U * i + (uint32_t)2U; + uint32_t t11 = a[4U * i + 2U]; + uint32_t t22 = b[4U * i + 2U]; + uint32_t *res_i2 = res + 4U * i + 2U; c = Lib_IntTypes_Intrinsics_sub_borrow_u32(c, t11, t22, res_i2); - uint32_t t12 = a[(uint32_t)4U * i + (uint32_t)3U]; - uint32_t t2 = b[(uint32_t)4U * i + (uint32_t)3U]; - uint32_t *res_i = res + (uint32_t)4U * i + (uint32_t)3U; + uint32_t t12 = a[4U * i + 3U]; + uint32_t t2 = b[4U * i + 3U]; + uint32_t *res_i = res + 4U * i + 3U; c = Lib_IntTypes_Intrinsics_sub_borrow_u32(c, t12, t2, res_i); } - for (uint32_t i = aLen / (uint32_t)4U * (uint32_t)4U; i < aLen; i++) + for (uint32_t i = aLen / 4U * 4U; i < aLen; i++) { uint32_t t1 = a[i]; uint32_t t2 = b[i]; @@ -188,27 +188,27 @@ Hacl_Bignum_Addition_bn_sub_eq_len_u32(uint32_t aLen, uint32_t *a, uint32_t *b, static inline uint64_t Hacl_Bignum_Addition_bn_sub_eq_len_u64(uint32_t aLen, uint64_t *a, uint64_t *b, uint64_t *res) { - uint64_t c = (uint64_t)0U; - for (uint32_t i = (uint32_t)0U; i < aLen / (uint32_t)4U; i++) + uint64_t c = 0ULL; + for (uint32_t i = 0U; i < aLen / 4U; i++) { - uint64_t t1 = a[(uint32_t)4U * i]; - uint64_t t20 = b[(uint32_t)4U * i]; - uint64_t *res_i0 = res + (uint32_t)4U * i; + uint64_t t1 = a[4U * i]; + uint64_t t20 = b[4U * i]; + uint64_t *res_i0 = res + 4U * i; c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t1, t20, res_i0); - uint64_t t10 = a[(uint32_t)4U * i + (uint32_t)1U]; - uint64_t t21 = b[(uint32_t)4U * i + (uint32_t)1U]; - uint64_t *res_i1 = res + (uint32_t)4U * i + (uint32_t)1U; + uint64_t t10 = a[4U * i + 1U]; + uint64_t t21 = b[4U * i + 1U]; + uint64_t *res_i1 = res + 4U * i + 1U; c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t10, t21, res_i1); - uint64_t t11 = a[(uint32_t)4U * i + (uint32_t)2U]; - uint64_t t22 = b[(uint32_t)4U * i + (uint32_t)2U]; - uint64_t *res_i2 = res + (uint32_t)4U * i + (uint32_t)2U; + uint64_t t11 = a[4U * i + 2U]; + uint64_t t22 = b[4U * i + 2U]; + uint64_t *res_i2 = res + 4U * i + 2U; c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t11, t22, res_i2); - uint64_t t12 = a[(uint32_t)4U * i + (uint32_t)3U]; - uint64_t t2 = b[(uint32_t)4U * i + (uint32_t)3U]; - uint64_t *res_i = res + (uint32_t)4U * i + (uint32_t)3U; + uint64_t t12 = a[4U * i + 3U]; + uint64_t t2 = b[4U * i + 3U]; + uint64_t *res_i = res + 4U * i + 3U; c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t12, t2, res_i); } - for (uint32_t i = aLen / (uint32_t)4U * (uint32_t)4U; i < aLen; i++) + for (uint32_t i = aLen / 4U * 4U; i < aLen; i++) { uint64_t t1 = a[i]; uint64_t t2 = b[i]; @@ -221,27 +221,27 @@ Hacl_Bignum_Addition_bn_sub_eq_len_u64(uint32_t aLen, uint64_t *a, uint64_t *b, static inline uint32_t Hacl_Bignum_Addition_bn_add_eq_len_u32(uint32_t aLen, uint32_t *a, uint32_t *b, uint32_t *res) { - uint32_t c = (uint32_t)0U; - for (uint32_t i = (uint32_t)0U; i < aLen / (uint32_t)4U; i++) + uint32_t c = 0U; + for (uint32_t i = 0U; i < aLen / 4U; i++) { - uint32_t t1 = a[(uint32_t)4U * i]; - uint32_t t20 = b[(uint32_t)4U * i]; - uint32_t *res_i0 = res + (uint32_t)4U * i; + uint32_t t1 = a[4U * i]; + uint32_t t20 = b[4U * i]; + uint32_t *res_i0 = res + 4U * i; c = Lib_IntTypes_Intrinsics_add_carry_u32(c, t1, t20, res_i0); - uint32_t t10 = a[(uint32_t)4U * i + (uint32_t)1U]; - uint32_t t21 = b[(uint32_t)4U * i + (uint32_t)1U]; - uint32_t *res_i1 = res + (uint32_t)4U * i + (uint32_t)1U; + uint32_t t10 = a[4U * i + 1U]; + uint32_t t21 = b[4U * i + 1U]; + uint32_t *res_i1 = res + 4U * i + 1U; c = Lib_IntTypes_Intrinsics_add_carry_u32(c, t10, t21, res_i1); - uint32_t t11 = a[(uint32_t)4U * i + (uint32_t)2U]; - uint32_t t22 = b[(uint32_t)4U * i + (uint32_t)2U]; - uint32_t *res_i2 = res + (uint32_t)4U * i + (uint32_t)2U; + uint32_t t11 = a[4U * i + 2U]; + uint32_t t22 = b[4U * i + 2U]; + uint32_t *res_i2 = res + 4U * i + 2U; c = Lib_IntTypes_Intrinsics_add_carry_u32(c, t11, t22, res_i2); - uint32_t t12 = a[(uint32_t)4U * i + (uint32_t)3U]; - uint32_t t2 = b[(uint32_t)4U * i + (uint32_t)3U]; - uint32_t *res_i = res + (uint32_t)4U * i + (uint32_t)3U; + uint32_t t12 = a[4U * i + 3U]; + uint32_t t2 = b[4U * i + 3U]; + uint32_t *res_i = res + 4U * i + 3U; c = Lib_IntTypes_Intrinsics_add_carry_u32(c, t12, t2, res_i); } - for (uint32_t i = aLen / (uint32_t)4U * (uint32_t)4U; i < aLen; i++) + for (uint32_t i = aLen / 4U * 4U; i < aLen; i++) { uint32_t t1 = a[i]; uint32_t t2 = b[i]; @@ -254,27 +254,27 @@ Hacl_Bignum_Addition_bn_add_eq_len_u32(uint32_t aLen, uint32_t *a, uint32_t *b, static inline uint64_t Hacl_Bignum_Addition_bn_add_eq_len_u64(uint32_t aLen, uint64_t *a, uint64_t *b, uint64_t *res) { - uint64_t c = (uint64_t)0U; - for (uint32_t i = (uint32_t)0U; i < aLen / (uint32_t)4U; i++) + uint64_t c = 0ULL; + for (uint32_t i = 0U; i < aLen / 4U; i++) { - uint64_t t1 = a[(uint32_t)4U * i]; - uint64_t t20 = b[(uint32_t)4U * i]; - uint64_t *res_i0 = res + (uint32_t)4U * i; + uint64_t t1 = a[4U * i]; + uint64_t t20 = b[4U * i]; + uint64_t *res_i0 = res + 4U * i; c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t1, t20, res_i0); - uint64_t t10 = a[(uint32_t)4U * i + (uint32_t)1U]; - uint64_t t21 = b[(uint32_t)4U * i + (uint32_t)1U]; - uint64_t *res_i1 = res + (uint32_t)4U * i + (uint32_t)1U; + uint64_t t10 = a[4U * i + 1U]; + uint64_t t21 = b[4U * i + 1U]; + uint64_t *res_i1 = res + 4U * i + 1U; c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t10, t21, res_i1); - uint64_t t11 = a[(uint32_t)4U * i + (uint32_t)2U]; - uint64_t t22 = b[(uint32_t)4U * i + (uint32_t)2U]; - uint64_t *res_i2 = res + (uint32_t)4U * i + (uint32_t)2U; + uint64_t t11 = a[4U * i + 2U]; + uint64_t t22 = b[4U * i + 2U]; + uint64_t *res_i2 = res + 4U * i + 2U; c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t11, t22, res_i2); - uint64_t t12 = a[(uint32_t)4U * i + (uint32_t)3U]; - uint64_t t2 = b[(uint32_t)4U * i + (uint32_t)3U]; - uint64_t *res_i = res + (uint32_t)4U * i + (uint32_t)3U; + uint64_t t12 = a[4U * i + 3U]; + uint64_t t2 = b[4U * i + 3U]; + uint64_t *res_i = res + 4U * i + 3U; c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t12, t2, res_i); } - for (uint32_t i = aLen / (uint32_t)4U * (uint32_t)4U; i < aLen; i++) + for (uint32_t i = aLen / 4U * 4U; i < aLen; i++) { uint64_t t1 = a[i]; uint64_t t2 = b[i]; @@ -294,27 +294,27 @@ Hacl_Bignum_Multiplication_bn_mul_u32( ) { memset(res, 0U, (aLen + bLen) * sizeof (uint32_t)); - for (uint32_t i0 = (uint32_t)0U; i0 < bLen; i0++) + for (uint32_t i0 = 0U; i0 < bLen; i0++) { uint32_t bj = b[i0]; uint32_t *res_j = res + i0; - uint32_t c = (uint32_t)0U; - for (uint32_t i = (uint32_t)0U; i < aLen / (uint32_t)4U; i++) + uint32_t c = 0U; + for (uint32_t i = 0U; i < aLen / 4U; i++) { - uint32_t a_i = a[(uint32_t)4U * i]; - uint32_t *res_i0 = res_j + (uint32_t)4U * i; + uint32_t a_i = a[4U * i]; + uint32_t *res_i0 = res_j + 4U * i; c = Hacl_Bignum_Base_mul_wide_add2_u32(a_i, bj, c, res_i0); - uint32_t a_i0 = a[(uint32_t)4U * i + (uint32_t)1U]; - uint32_t *res_i1 = res_j + (uint32_t)4U * i + (uint32_t)1U; + uint32_t a_i0 = a[4U * i + 1U]; + uint32_t *res_i1 = res_j + 4U * i + 1U; c = Hacl_Bignum_Base_mul_wide_add2_u32(a_i0, bj, c, res_i1); - uint32_t a_i1 = a[(uint32_t)4U * i + (uint32_t)2U]; - uint32_t *res_i2 = res_j + (uint32_t)4U * i + (uint32_t)2U; + uint32_t a_i1 = a[4U * i + 2U]; + uint32_t *res_i2 = res_j + 4U * i + 2U; c = Hacl_Bignum_Base_mul_wide_add2_u32(a_i1, bj, c, res_i2); - uint32_t a_i2 = a[(uint32_t)4U * i + (uint32_t)3U]; - uint32_t *res_i = res_j + (uint32_t)4U * i + (uint32_t)3U; + uint32_t a_i2 = a[4U * i + 3U]; + uint32_t *res_i = res_j + 4U * i + 3U; c = Hacl_Bignum_Base_mul_wide_add2_u32(a_i2, bj, c, res_i); } - for (uint32_t i = aLen / (uint32_t)4U * (uint32_t)4U; i < aLen; i++) + for (uint32_t i = aLen / 4U * 4U; i < aLen; i++) { uint32_t a_i = a[i]; uint32_t *res_i = res_j + i; @@ -335,27 +335,27 @@ Hacl_Bignum_Multiplication_bn_mul_u64( ) { memset(res, 0U, (aLen + bLen) * sizeof (uint64_t)); - for (uint32_t i0 = (uint32_t)0U; i0 < bLen; i0++) + for (uint32_t i0 = 0U; i0 < bLen; i0++) { uint64_t bj = b[i0]; uint64_t *res_j = res + i0; - uint64_t c = (uint64_t)0U; - for (uint32_t i = (uint32_t)0U; i < aLen / (uint32_t)4U; i++) + uint64_t c = 0ULL; + for (uint32_t i = 0U; i < aLen / 4U; i++) { - uint64_t a_i = a[(uint32_t)4U * i]; - uint64_t *res_i0 = res_j + (uint32_t)4U * i; + uint64_t a_i = a[4U * i]; + uint64_t *res_i0 = res_j + 4U * i; c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i, bj, c, res_i0); - uint64_t a_i0 = a[(uint32_t)4U * i + (uint32_t)1U]; - uint64_t *res_i1 = res_j + (uint32_t)4U * i + (uint32_t)1U; + uint64_t a_i0 = a[4U * i + 1U]; + uint64_t *res_i1 = res_j + 4U * i + 1U; c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i0, bj, c, res_i1); - uint64_t a_i1 = a[(uint32_t)4U * i + (uint32_t)2U]; - uint64_t *res_i2 = res_j + (uint32_t)4U * i + (uint32_t)2U; + uint64_t a_i1 = a[4U * i + 2U]; + uint64_t *res_i2 = res_j + 4U * i + 2U; c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i1, bj, c, res_i2); - uint64_t a_i2 = a[(uint32_t)4U * i + (uint32_t)3U]; - uint64_t *res_i = res_j + (uint32_t)4U * i + (uint32_t)3U; + uint64_t a_i2 = a[4U * i + 3U]; + uint64_t *res_i = res_j + 4U * i + 3U; c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i2, bj, c, res_i); } - for (uint32_t i = aLen / (uint32_t)4U * (uint32_t)4U; i < aLen; i++) + for (uint32_t i = aLen / 4U * 4U; i < aLen; i++) { uint64_t a_i = a[i]; uint64_t *res_i = res_j + i; @@ -370,28 +370,28 @@ static inline void Hacl_Bignum_Multiplication_bn_sqr_u32(uint32_t aLen, uint32_t *a, uint32_t *res) { memset(res, 0U, (aLen + aLen) * sizeof (uint32_t)); - for (uint32_t i0 = (uint32_t)0U; i0 < aLen; i0++) + for (uint32_t i0 = 0U; i0 < aLen; i0++) { uint32_t *ab = a; uint32_t a_j = a[i0]; uint32_t *res_j = res + i0; - uint32_t c = (uint32_t)0U; - for (uint32_t i = (uint32_t)0U; i < i0 / (uint32_t)4U; i++) + uint32_t c = 0U; + for (uint32_t i = 0U; i < i0 / 4U; i++) { - uint32_t a_i = ab[(uint32_t)4U * i]; - uint32_t *res_i0 = res_j + (uint32_t)4U * i; + uint32_t a_i = ab[4U * i]; + uint32_t *res_i0 = res_j + 4U * i; c = Hacl_Bignum_Base_mul_wide_add2_u32(a_i, a_j, c, res_i0); - uint32_t a_i0 = ab[(uint32_t)4U * i + (uint32_t)1U]; - uint32_t *res_i1 = res_j + (uint32_t)4U * i + (uint32_t)1U; + uint32_t a_i0 = ab[4U * i + 1U]; + uint32_t *res_i1 = res_j + 4U * i + 1U; c = Hacl_Bignum_Base_mul_wide_add2_u32(a_i0, a_j, c, res_i1); - uint32_t a_i1 = ab[(uint32_t)4U * i + (uint32_t)2U]; - uint32_t *res_i2 = res_j + (uint32_t)4U * i + (uint32_t)2U; + uint32_t a_i1 = ab[4U * i + 2U]; + uint32_t *res_i2 = res_j + 4U * i + 2U; c = Hacl_Bignum_Base_mul_wide_add2_u32(a_i1, a_j, c, res_i2); - uint32_t a_i2 = ab[(uint32_t)4U * i + (uint32_t)3U]; - uint32_t *res_i = res_j + (uint32_t)4U * i + (uint32_t)3U; + uint32_t a_i2 = ab[4U * i + 3U]; + uint32_t *res_i = res_j + 4U * i + 3U; c = Hacl_Bignum_Base_mul_wide_add2_u32(a_i2, a_j, c, res_i); } - for (uint32_t i = i0 / (uint32_t)4U * (uint32_t)4U; i < i0; i++) + for (uint32_t i = i0 / 4U * 4U; i < i0; i++) { uint32_t a_i = ab[i]; uint32_t *res_i = res_j + i; @@ -401,48 +401,48 @@ Hacl_Bignum_Multiplication_bn_sqr_u32(uint32_t aLen, uint32_t *a, uint32_t *res) res[i0 + i0] = r; } uint32_t c0 = Hacl_Bignum_Addition_bn_add_eq_len_u32(aLen + aLen, res, res, res); - KRML_HOST_IGNORE(c0); + KRML_MAYBE_UNUSED_VAR(c0); KRML_CHECK_SIZE(sizeof (uint32_t), aLen + aLen); uint32_t tmp[aLen + aLen]; memset(tmp, 0U, (aLen + aLen) * sizeof (uint32_t)); - for (uint32_t i = (uint32_t)0U; i < aLen; i++) + for (uint32_t i = 0U; i < aLen; i++) { uint64_t res1 = (uint64_t)a[i] * (uint64_t)a[i]; - uint32_t hi = (uint32_t)(res1 >> (uint32_t)32U); + uint32_t hi = (uint32_t)(res1 >> 32U); uint32_t lo = (uint32_t)res1; - tmp[(uint32_t)2U * i] = lo; - tmp[(uint32_t)2U * i + (uint32_t)1U] = hi; + tmp[2U * i] = lo; + tmp[2U * i + 1U] = hi; } uint32_t c1 = Hacl_Bignum_Addition_bn_add_eq_len_u32(aLen + aLen, res, tmp, res); - KRML_HOST_IGNORE(c1); + KRML_MAYBE_UNUSED_VAR(c1); } static inline void Hacl_Bignum_Multiplication_bn_sqr_u64(uint32_t aLen, uint64_t *a, uint64_t *res) { memset(res, 0U, (aLen + aLen) * sizeof (uint64_t)); - for (uint32_t i0 = (uint32_t)0U; i0 < aLen; i0++) + for (uint32_t i0 = 0U; i0 < aLen; i0++) { uint64_t *ab = a; uint64_t a_j = a[i0]; uint64_t *res_j = res + i0; - uint64_t c = (uint64_t)0U; - for (uint32_t i = (uint32_t)0U; i < i0 / (uint32_t)4U; i++) + uint64_t c = 0ULL; + for (uint32_t i = 0U; i < i0 / 4U; i++) { - uint64_t a_i = ab[(uint32_t)4U * i]; - uint64_t *res_i0 = res_j + (uint32_t)4U * i; + uint64_t a_i = ab[4U * i]; + uint64_t *res_i0 = res_j + 4U * i; c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i, a_j, c, res_i0); - uint64_t a_i0 = ab[(uint32_t)4U * i + (uint32_t)1U]; - uint64_t *res_i1 = res_j + (uint32_t)4U * i + (uint32_t)1U; + uint64_t a_i0 = ab[4U * i + 1U]; + uint64_t *res_i1 = res_j + 4U * i + 1U; c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i0, a_j, c, res_i1); - uint64_t a_i1 = ab[(uint32_t)4U * i + (uint32_t)2U]; - uint64_t *res_i2 = res_j + (uint32_t)4U * i + (uint32_t)2U; + uint64_t a_i1 = ab[4U * i + 2U]; + uint64_t *res_i2 = res_j + 4U * i + 2U; c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i1, a_j, c, res_i2); - uint64_t a_i2 = ab[(uint32_t)4U * i + (uint32_t)3U]; - uint64_t *res_i = res_j + (uint32_t)4U * i + (uint32_t)3U; + uint64_t a_i2 = ab[4U * i + 3U]; + uint64_t *res_i = res_j + 4U * i + 3U; c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i2, a_j, c, res_i); } - for (uint32_t i = i0 / (uint32_t)4U * (uint32_t)4U; i < i0; i++) + for (uint32_t i = i0 / 4U * 4U; i < i0; i++) { uint64_t a_i = ab[i]; uint64_t *res_i = res_j + i; @@ -452,20 +452,20 @@ Hacl_Bignum_Multiplication_bn_sqr_u64(uint32_t aLen, uint64_t *a, uint64_t *res) res[i0 + i0] = r; } uint64_t c0 = Hacl_Bignum_Addition_bn_add_eq_len_u64(aLen + aLen, res, res, res); - KRML_HOST_IGNORE(c0); + KRML_MAYBE_UNUSED_VAR(c0); KRML_CHECK_SIZE(sizeof (uint64_t), aLen + aLen); uint64_t tmp[aLen + aLen]; memset(tmp, 0U, (aLen + aLen) * sizeof (uint64_t)); - for (uint32_t i = (uint32_t)0U; i < aLen; i++) + for (uint32_t i = 0U; i < aLen; i++) { FStar_UInt128_uint128 res1 = FStar_UInt128_mul_wide(a[i], a[i]); - uint64_t hi = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(res1, (uint32_t)64U)); + uint64_t hi = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(res1, 64U)); uint64_t lo = FStar_UInt128_uint128_to_uint64(res1); - tmp[(uint32_t)2U * i] = lo; - tmp[(uint32_t)2U * i + (uint32_t)1U] = hi; + tmp[2U * i] = lo; + tmp[2U * i + 1U] = hi; } uint64_t c1 = Hacl_Bignum_Addition_bn_add_eq_len_u64(aLen + aLen, res, tmp, res); - KRML_HOST_IGNORE(c1); + KRML_MAYBE_UNUSED_VAR(c1); } #if defined(__cplusplus) diff --git a/include/internal/Hacl_Bignum_K256.h b/include/internal/Hacl_Bignum_K256.h index 59aff176..fe72fffe 100644 --- a/include/internal/Hacl_Bignum_K256.h +++ b/include/internal/Hacl_Bignum_K256.h @@ -45,13 +45,7 @@ static inline bool Hacl_K256_Field_is_felem_zero_vartime(uint64_t *f) uint64_t f2 = f[2U]; uint64_t f3 = f[3U]; uint64_t f4 = f[4U]; - return - f0 - == (uint64_t)0U - && f1 == (uint64_t)0U - && f2 == (uint64_t)0U - && f3 == (uint64_t)0U - && f4 == (uint64_t)0U; + return f0 == 0ULL && f1 == 0ULL && f2 == 0ULL && f3 == 0ULL && f4 == 0ULL; } static inline bool Hacl_K256_Field_is_felem_eq_vartime(uint64_t *f1, uint64_t *f2) @@ -76,42 +70,42 @@ static inline bool Hacl_K256_Field_is_felem_lt_prime_minus_order_vartime(uint64_ uint64_t f2 = f[2U]; uint64_t f3 = f[3U]; uint64_t f4 = f[4U]; - if (f4 > (uint64_t)0U) + if (f4 > 0ULL) { return false; } - if (f3 > (uint64_t)0U) + if (f3 > 0ULL) { return false; } - if (f2 < (uint64_t)0x1455123U) + if (f2 < 0x1455123ULL) { return true; } - if (f2 > (uint64_t)0x1455123U) + if (f2 > 0x1455123ULL) { return false; } - if (f1 < (uint64_t)0x1950b75fc4402U) + if (f1 < 0x1950b75fc4402ULL) { return true; } - if (f1 > (uint64_t)0x1950b75fc4402U) + if (f1 > 0x1950b75fc4402ULL) { return false; } - return f0 < (uint64_t)0xda1722fc9baeeU; + return f0 < 0xda1722fc9baeeULL; } static inline void Hacl_K256_Field_load_felem(uint64_t *f, uint8_t *b) { uint64_t tmp[4U] = { 0U }; KRML_MAYBE_FOR4(i, - (uint32_t)0U, - (uint32_t)4U, - (uint32_t)1U, + 0U, + 4U, + 1U, uint64_t *os = tmp; - uint8_t *bj = b + i * (uint32_t)8U; + uint8_t *bj = b + i * 8U; uint64_t u = load64_be(bj); uint64_t r = u; uint64_t x = r; @@ -120,11 +114,11 @@ static inline void Hacl_K256_Field_load_felem(uint64_t *f, uint8_t *b) uint64_t s1 = tmp[2U]; uint64_t s2 = tmp[1U]; uint64_t s3 = tmp[0U]; - uint64_t f00 = s0 & (uint64_t)0xfffffffffffffU; - uint64_t f10 = s0 >> (uint32_t)52U | (s1 & (uint64_t)0xffffffffffU) << (uint32_t)12U; - uint64_t f20 = s1 >> (uint32_t)40U | (s2 & (uint64_t)0xfffffffU) << (uint32_t)24U; - uint64_t f30 = s2 >> (uint32_t)28U | (s3 & (uint64_t)0xffffU) << (uint32_t)36U; - uint64_t f40 = s3 >> (uint32_t)16U; + uint64_t f00 = s0 & 0xfffffffffffffULL; + uint64_t f10 = s0 >> 52U | (s1 & 0xffffffffffULL) << 12U; + uint64_t f20 = s1 >> 40U | (s2 & 0xfffffffULL) << 24U; + uint64_t f30 = s2 >> 28U | (s3 & 0xffffULL) << 36U; + uint64_t f40 = s3 >> 16U; uint64_t f0 = f00; uint64_t f1 = f10; uint64_t f2 = f20; @@ -148,11 +142,11 @@ static inline bool Hacl_K256_Field_load_felem_lt_prime_vartime(uint64_t *f, uint bool is_ge_p = f0 - >= (uint64_t)0xffffefffffc2fU - && f1 == (uint64_t)0xfffffffffffffU - && f2 == (uint64_t)0xfffffffffffffU - && f3 == (uint64_t)0xfffffffffffffU - && f4 == (uint64_t)0xffffffffffffU; + >= 0xffffefffffc2fULL + && f1 == 0xfffffffffffffULL + && f2 == 0xfffffffffffffULL + && f3 == 0xfffffffffffffULL + && f4 == 0xffffffffffffULL; return !is_ge_p; } @@ -164,10 +158,10 @@ static inline void Hacl_K256_Field_store_felem(uint8_t *b, uint64_t *f) uint64_t f20 = f[2U]; uint64_t f30 = f[3U]; uint64_t f4 = f[4U]; - uint64_t o0 = f00 | f10 << (uint32_t)52U; - uint64_t o1 = f10 >> (uint32_t)12U | f20 << (uint32_t)40U; - uint64_t o2 = f20 >> (uint32_t)24U | f30 << (uint32_t)28U; - uint64_t o3 = f30 >> (uint32_t)36U | f4 << (uint32_t)16U; + uint64_t o0 = f00 | f10 << 52U; + uint64_t o1 = f10 >> 12U | f20 << 40U; + uint64_t o2 = f20 >> 24U | f30 << 28U; + uint64_t o3 = f30 >> 36U | f4 << 16U; uint64_t f0 = o0; uint64_t f1 = o1; uint64_t f2 = o2; @@ -176,11 +170,7 @@ static inline void Hacl_K256_Field_store_felem(uint8_t *b, uint64_t *f) tmp[1U] = f2; tmp[2U] = f1; tmp[3U] = f0; - KRML_MAYBE_FOR4(i, - (uint32_t)0U, - (uint32_t)4U, - (uint32_t)1U, - store64_be(b + i * (uint32_t)8U, tmp[i]);); + KRML_MAYBE_FOR4(i, 0U, 4U, 1U, store64_be(b + i * 8U, tmp[i]);); } static inline void Hacl_K256_Field_fmul_small_num(uint64_t *out, uint64_t *f, uint64_t num) @@ -248,11 +238,11 @@ static inline void Hacl_K256_Field_fsub(uint64_t *out, uint64_t *f1, uint64_t *f uint64_t b2 = f2[2U]; uint64_t b3 = f2[3U]; uint64_t b4 = f2[4U]; - uint64_t r00 = (uint64_t)9007190664804446U * x - b0; - uint64_t r10 = (uint64_t)9007199254740990U * x - b1; - uint64_t r20 = (uint64_t)9007199254740990U * x - b2; - uint64_t r30 = (uint64_t)9007199254740990U * x - b3; - uint64_t r40 = (uint64_t)562949953421310U * x - b4; + uint64_t r00 = 9007190664804446ULL * x - b0; + uint64_t r10 = 9007199254740990ULL * x - b1; + uint64_t r20 = 9007199254740990ULL * x - b2; + uint64_t r30 = 9007199254740990ULL * x - b3; + uint64_t r40 = 562949953421310ULL * x - b4; uint64_t r0 = r00; uint64_t r1 = r10; uint64_t r2 = r20; @@ -287,7 +277,7 @@ static inline void Hacl_K256_Field_fmul(uint64_t *out, uint64_t *f1, uint64_t *f uint64_t b2 = f2[2U]; uint64_t b3 = f2[3U]; uint64_t b4 = f2[4U]; - uint64_t r = (uint64_t)0x1000003D10U; + uint64_t r = 0x1000003D10ULL; FStar_UInt128_uint128 d0 = FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_mul_wide(a0, @@ -298,9 +288,9 @@ static inline void Hacl_K256_Field_fmul(uint64_t *out, uint64_t *f1, uint64_t *f FStar_UInt128_uint128 c0 = FStar_UInt128_mul_wide(a4, b4); FStar_UInt128_uint128 d1 = FStar_UInt128_add_mod(d0, FStar_UInt128_mul_wide(r, FStar_UInt128_uint128_to_uint64(c0))); - uint64_t c1 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(c0, (uint32_t)64U)); - uint64_t t3 = FStar_UInt128_uint128_to_uint64(d1) & (uint64_t)0xfffffffffffffU; - FStar_UInt128_uint128 d2 = FStar_UInt128_shift_right(d1, (uint32_t)52U); + uint64_t c1 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(c0, 64U)); + uint64_t t3 = FStar_UInt128_uint128_to_uint64(d1) & 0xfffffffffffffULL; + FStar_UInt128_uint128 d2 = FStar_UInt128_shift_right(d1, 52U); FStar_UInt128_uint128 d3 = FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_add_mod(d2, @@ -309,12 +299,11 @@ static inline void Hacl_K256_Field_fmul(uint64_t *out, uint64_t *f1, uint64_t *f FStar_UInt128_mul_wide(a2, b2)), FStar_UInt128_mul_wide(a3, b1)), FStar_UInt128_mul_wide(a4, b0)); - FStar_UInt128_uint128 - d4 = FStar_UInt128_add_mod(d3, FStar_UInt128_mul_wide(r << (uint32_t)12U, c1)); - uint64_t t4 = FStar_UInt128_uint128_to_uint64(d4) & (uint64_t)0xfffffffffffffU; - FStar_UInt128_uint128 d5 = FStar_UInt128_shift_right(d4, (uint32_t)52U); - uint64_t tx = t4 >> (uint32_t)48U; - uint64_t t4_ = t4 & (uint64_t)0xffffffffffffU; + FStar_UInt128_uint128 d4 = FStar_UInt128_add_mod(d3, FStar_UInt128_mul_wide(r << 12U, c1)); + uint64_t t4 = FStar_UInt128_uint128_to_uint64(d4) & 0xfffffffffffffULL; + FStar_UInt128_uint128 d5 = FStar_UInt128_shift_right(d4, 52U); + uint64_t tx = t4 >> 48U; + uint64_t t4_ = t4 & 0xffffffffffffULL; FStar_UInt128_uint128 c2 = FStar_UInt128_mul_wide(a0, b0); FStar_UInt128_uint128 d6 = @@ -323,13 +312,12 @@ static inline void Hacl_K256_Field_fmul(uint64_t *out, uint64_t *f1, uint64_t *f FStar_UInt128_mul_wide(a2, b3)), FStar_UInt128_mul_wide(a3, b2)), FStar_UInt128_mul_wide(a4, b1)); - uint64_t u0 = FStar_UInt128_uint128_to_uint64(d6) & (uint64_t)0xfffffffffffffU; - FStar_UInt128_uint128 d7 = FStar_UInt128_shift_right(d6, (uint32_t)52U); - uint64_t u0_ = tx | u0 << (uint32_t)4U; - FStar_UInt128_uint128 - c3 = FStar_UInt128_add_mod(c2, FStar_UInt128_mul_wide(u0_, r >> (uint32_t)4U)); - uint64_t r0 = FStar_UInt128_uint128_to_uint64(c3) & (uint64_t)0xfffffffffffffU; - FStar_UInt128_uint128 c4 = FStar_UInt128_shift_right(c3, (uint32_t)52U); + uint64_t u0 = FStar_UInt128_uint128_to_uint64(d6) & 0xfffffffffffffULL; + FStar_UInt128_uint128 d7 = FStar_UInt128_shift_right(d6, 52U); + uint64_t u0_ = tx | u0 << 4U; + FStar_UInt128_uint128 c3 = FStar_UInt128_add_mod(c2, FStar_UInt128_mul_wide(u0_, r >> 4U)); + uint64_t r0 = FStar_UInt128_uint128_to_uint64(c3) & 0xfffffffffffffULL; + FStar_UInt128_uint128 c4 = FStar_UInt128_shift_right(c3, 52U); FStar_UInt128_uint128 c5 = FStar_UInt128_add_mod(FStar_UInt128_add_mod(c4, FStar_UInt128_mul_wide(a0, b1)), @@ -343,10 +331,10 @@ static inline void Hacl_K256_Field_fmul(uint64_t *out, uint64_t *f1, uint64_t *f FStar_UInt128_uint128 c6 = FStar_UInt128_add_mod(c5, - FStar_UInt128_mul_wide(FStar_UInt128_uint128_to_uint64(d8) & (uint64_t)0xfffffffffffffU, r)); - FStar_UInt128_uint128 d9 = FStar_UInt128_shift_right(d8, (uint32_t)52U); - uint64_t r1 = FStar_UInt128_uint128_to_uint64(c6) & (uint64_t)0xfffffffffffffU; - FStar_UInt128_uint128 c7 = FStar_UInt128_shift_right(c6, (uint32_t)52U); + FStar_UInt128_mul_wide(FStar_UInt128_uint128_to_uint64(d8) & 0xfffffffffffffULL, r)); + FStar_UInt128_uint128 d9 = FStar_UInt128_shift_right(d8, 52U); + uint64_t r1 = FStar_UInt128_uint128_to_uint64(c6) & 0xfffffffffffffULL; + FStar_UInt128_uint128 c7 = FStar_UInt128_shift_right(c6, 52U); FStar_UInt128_uint128 c8 = FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_add_mod(c7, @@ -359,16 +347,15 @@ static inline void Hacl_K256_Field_fmul(uint64_t *out, uint64_t *f1, uint64_t *f FStar_UInt128_mul_wide(a4, b3)); FStar_UInt128_uint128 c9 = FStar_UInt128_add_mod(c8, FStar_UInt128_mul_wide(r, FStar_UInt128_uint128_to_uint64(d10))); - uint64_t d11 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(d10, (uint32_t)64U)); - uint64_t r2 = FStar_UInt128_uint128_to_uint64(c9) & (uint64_t)0xfffffffffffffU; - FStar_UInt128_uint128 c10 = FStar_UInt128_shift_right(c9, (uint32_t)52U); + uint64_t d11 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(d10, 64U)); + uint64_t r2 = FStar_UInt128_uint128_to_uint64(c9) & 0xfffffffffffffULL; + FStar_UInt128_uint128 c10 = FStar_UInt128_shift_right(c9, 52U); FStar_UInt128_uint128 c11 = - FStar_UInt128_add_mod(FStar_UInt128_add_mod(c10, - FStar_UInt128_mul_wide(r << (uint32_t)12U, d11)), + FStar_UInt128_add_mod(FStar_UInt128_add_mod(c10, FStar_UInt128_mul_wide(r << 12U, d11)), FStar_UInt128_uint64_to_uint128(t3)); - uint64_t r3 = FStar_UInt128_uint128_to_uint64(c11) & (uint64_t)0xfffffffffffffU; - uint64_t c12 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(c11, (uint32_t)52U)); + uint64_t r3 = FStar_UInt128_uint128_to_uint64(c11) & 0xfffffffffffffULL; + uint64_t c12 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(c11, 52U)); uint64_t r4 = c12 + t4_; uint64_t f0 = r0; uint64_t f11 = r1; @@ -389,43 +376,41 @@ static inline void Hacl_K256_Field_fsqr(uint64_t *out, uint64_t *f) uint64_t a2 = f[2U]; uint64_t a3 = f[3U]; uint64_t a4 = f[4U]; - uint64_t r = (uint64_t)0x1000003D10U; + uint64_t r = 0x1000003D10ULL; FStar_UInt128_uint128 d0 = - FStar_UInt128_add_mod(FStar_UInt128_mul_wide(a0 * (uint64_t)2U, a3), - FStar_UInt128_mul_wide(a1 * (uint64_t)2U, a2)); + FStar_UInt128_add_mod(FStar_UInt128_mul_wide(a0 * 2ULL, a3), + FStar_UInt128_mul_wide(a1 * 2ULL, a2)); FStar_UInt128_uint128 c0 = FStar_UInt128_mul_wide(a4, a4); FStar_UInt128_uint128 d1 = FStar_UInt128_add_mod(d0, FStar_UInt128_mul_wide(r, FStar_UInt128_uint128_to_uint64(c0))); - uint64_t c1 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(c0, (uint32_t)64U)); - uint64_t t3 = FStar_UInt128_uint128_to_uint64(d1) & (uint64_t)0xfffffffffffffU; - FStar_UInt128_uint128 d2 = FStar_UInt128_shift_right(d1, (uint32_t)52U); - uint64_t a41 = a4 * (uint64_t)2U; + uint64_t c1 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(c0, 64U)); + uint64_t t3 = FStar_UInt128_uint128_to_uint64(d1) & 0xfffffffffffffULL; + FStar_UInt128_uint128 d2 = FStar_UInt128_shift_right(d1, 52U); + uint64_t a41 = a4 * 2ULL; FStar_UInt128_uint128 d3 = FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_add_mod(d2, FStar_UInt128_mul_wide(a0, a41)), - FStar_UInt128_mul_wide(a1 * (uint64_t)2U, a3)), + FStar_UInt128_mul_wide(a1 * 2ULL, a3)), FStar_UInt128_mul_wide(a2, a2)); - FStar_UInt128_uint128 - d4 = FStar_UInt128_add_mod(d3, FStar_UInt128_mul_wide(r << (uint32_t)12U, c1)); - uint64_t t4 = FStar_UInt128_uint128_to_uint64(d4) & (uint64_t)0xfffffffffffffU; - FStar_UInt128_uint128 d5 = FStar_UInt128_shift_right(d4, (uint32_t)52U); - uint64_t tx = t4 >> (uint32_t)48U; - uint64_t t4_ = t4 & (uint64_t)0xffffffffffffU; + FStar_UInt128_uint128 d4 = FStar_UInt128_add_mod(d3, FStar_UInt128_mul_wide(r << 12U, c1)); + uint64_t t4 = FStar_UInt128_uint128_to_uint64(d4) & 0xfffffffffffffULL; + FStar_UInt128_uint128 d5 = FStar_UInt128_shift_right(d4, 52U); + uint64_t tx = t4 >> 48U; + uint64_t t4_ = t4 & 0xffffffffffffULL; FStar_UInt128_uint128 c2 = FStar_UInt128_mul_wide(a0, a0); FStar_UInt128_uint128 d6 = FStar_UInt128_add_mod(FStar_UInt128_add_mod(d5, FStar_UInt128_mul_wide(a1, a41)), - FStar_UInt128_mul_wide(a2 * (uint64_t)2U, a3)); - uint64_t u0 = FStar_UInt128_uint128_to_uint64(d6) & (uint64_t)0xfffffffffffffU; - FStar_UInt128_uint128 d7 = FStar_UInt128_shift_right(d6, (uint32_t)52U); - uint64_t u0_ = tx | u0 << (uint32_t)4U; - FStar_UInt128_uint128 - c3 = FStar_UInt128_add_mod(c2, FStar_UInt128_mul_wide(u0_, r >> (uint32_t)4U)); - uint64_t r0 = FStar_UInt128_uint128_to_uint64(c3) & (uint64_t)0xfffffffffffffU; - FStar_UInt128_uint128 c4 = FStar_UInt128_shift_right(c3, (uint32_t)52U); - uint64_t a01 = a0 * (uint64_t)2U; + FStar_UInt128_mul_wide(a2 * 2ULL, a3)); + uint64_t u0 = FStar_UInt128_uint128_to_uint64(d6) & 0xfffffffffffffULL; + FStar_UInt128_uint128 d7 = FStar_UInt128_shift_right(d6, 52U); + uint64_t u0_ = tx | u0 << 4U; + FStar_UInt128_uint128 c3 = FStar_UInt128_add_mod(c2, FStar_UInt128_mul_wide(u0_, r >> 4U)); + uint64_t r0 = FStar_UInt128_uint128_to_uint64(c3) & 0xfffffffffffffULL; + FStar_UInt128_uint128 c4 = FStar_UInt128_shift_right(c3, 52U); + uint64_t a01 = a0 * 2ULL; FStar_UInt128_uint128 c5 = FStar_UInt128_add_mod(c4, FStar_UInt128_mul_wide(a01, a1)); FStar_UInt128_uint128 d8 = @@ -434,10 +419,10 @@ static inline void Hacl_K256_Field_fsqr(uint64_t *out, uint64_t *f) FStar_UInt128_uint128 c6 = FStar_UInt128_add_mod(c5, - FStar_UInt128_mul_wide(FStar_UInt128_uint128_to_uint64(d8) & (uint64_t)0xfffffffffffffU, r)); - FStar_UInt128_uint128 d9 = FStar_UInt128_shift_right(d8, (uint32_t)52U); - uint64_t r1 = FStar_UInt128_uint128_to_uint64(c6) & (uint64_t)0xfffffffffffffU; - FStar_UInt128_uint128 c7 = FStar_UInt128_shift_right(c6, (uint32_t)52U); + FStar_UInt128_mul_wide(FStar_UInt128_uint128_to_uint64(d8) & 0xfffffffffffffULL, r)); + FStar_UInt128_uint128 d9 = FStar_UInt128_shift_right(d8, 52U); + uint64_t r1 = FStar_UInt128_uint128_to_uint64(c6) & 0xfffffffffffffULL; + FStar_UInt128_uint128 c7 = FStar_UInt128_shift_right(c6, 52U); FStar_UInt128_uint128 c8 = FStar_UInt128_add_mod(FStar_UInt128_add_mod(c7, FStar_UInt128_mul_wide(a01, a2)), @@ -445,16 +430,15 @@ static inline void Hacl_K256_Field_fsqr(uint64_t *out, uint64_t *f) FStar_UInt128_uint128 d10 = FStar_UInt128_add_mod(d9, FStar_UInt128_mul_wide(a3, a41)); FStar_UInt128_uint128 c9 = FStar_UInt128_add_mod(c8, FStar_UInt128_mul_wide(r, FStar_UInt128_uint128_to_uint64(d10))); - uint64_t d11 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(d10, (uint32_t)64U)); - uint64_t r2 = FStar_UInt128_uint128_to_uint64(c9) & (uint64_t)0xfffffffffffffU; - FStar_UInt128_uint128 c10 = FStar_UInt128_shift_right(c9, (uint32_t)52U); + uint64_t d11 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(d10, 64U)); + uint64_t r2 = FStar_UInt128_uint128_to_uint64(c9) & 0xfffffffffffffULL; + FStar_UInt128_uint128 c10 = FStar_UInt128_shift_right(c9, 52U); FStar_UInt128_uint128 c11 = - FStar_UInt128_add_mod(FStar_UInt128_add_mod(c10, - FStar_UInt128_mul_wide(r << (uint32_t)12U, d11)), + FStar_UInt128_add_mod(FStar_UInt128_add_mod(c10, FStar_UInt128_mul_wide(r << 12U, d11)), FStar_UInt128_uint64_to_uint128(t3)); - uint64_t r3 = FStar_UInt128_uint128_to_uint64(c11) & (uint64_t)0xfffffffffffffU; - uint64_t c12 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(c11, (uint32_t)52U)); + uint64_t r3 = FStar_UInt128_uint128_to_uint64(c11) & 0xfffffffffffffULL; + uint64_t c12 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(c11, 52U)); uint64_t r4 = c12 + t4_; uint64_t f0 = r0; uint64_t f1 = r1; @@ -475,23 +459,23 @@ static inline void Hacl_K256_Field_fnormalize_weak(uint64_t *out, uint64_t *f) uint64_t t2 = f[2U]; uint64_t t3 = f[3U]; uint64_t t4 = f[4U]; - uint64_t x0 = t4 >> (uint32_t)48U; - uint64_t t410 = t4 & (uint64_t)0xffffffffffffU; + uint64_t x0 = t4 >> 48U; + uint64_t t410 = t4 & 0xffffffffffffULL; uint64_t x = x0; uint64_t t01 = t0; uint64_t t11 = t1; uint64_t t21 = t2; uint64_t t31 = t3; uint64_t t41 = t410; - uint64_t t02 = t01 + x * (uint64_t)0x1000003D1U; - uint64_t t12 = t11 + (t02 >> (uint32_t)52U); - uint64_t t03 = t02 & (uint64_t)0xfffffffffffffU; - uint64_t t22 = t21 + (t12 >> (uint32_t)52U); - uint64_t t13 = t12 & (uint64_t)0xfffffffffffffU; - uint64_t t32 = t31 + (t22 >> (uint32_t)52U); - uint64_t t23 = t22 & (uint64_t)0xfffffffffffffU; - uint64_t t42 = t41 + (t32 >> (uint32_t)52U); - uint64_t t33 = t32 & (uint64_t)0xfffffffffffffU; + uint64_t t02 = t01 + x * 0x1000003D1ULL; + uint64_t t12 = t11 + (t02 >> 52U); + uint64_t t03 = t02 & 0xfffffffffffffULL; + uint64_t t22 = t21 + (t12 >> 52U); + uint64_t t13 = t12 & 0xfffffffffffffULL; + uint64_t t32 = t31 + (t22 >> 52U); + uint64_t t23 = t22 & 0xfffffffffffffULL; + uint64_t t42 = t41 + (t32 >> 52U); + uint64_t t33 = t32 & 0xfffffffffffffULL; uint64_t f0 = t03; uint64_t f1 = t13; uint64_t f2 = t23; @@ -511,59 +495,59 @@ static inline void Hacl_K256_Field_fnormalize(uint64_t *out, uint64_t *f) uint64_t f20 = f[2U]; uint64_t f30 = f[3U]; uint64_t f40 = f[4U]; - uint64_t x0 = f40 >> (uint32_t)48U; - uint64_t t40 = f40 & (uint64_t)0xffffffffffffU; + uint64_t x0 = f40 >> 48U; + uint64_t t40 = f40 & 0xffffffffffffULL; uint64_t x1 = x0; uint64_t t00 = f00; uint64_t t10 = f10; uint64_t t20 = f20; uint64_t t30 = f30; uint64_t t42 = t40; - uint64_t t01 = t00 + x1 * (uint64_t)0x1000003D1U; - uint64_t t110 = t10 + (t01 >> (uint32_t)52U); - uint64_t t020 = t01 & (uint64_t)0xfffffffffffffU; - uint64_t t210 = t20 + (t110 >> (uint32_t)52U); - uint64_t t120 = t110 & (uint64_t)0xfffffffffffffU; - uint64_t t310 = t30 + (t210 >> (uint32_t)52U); - uint64_t t220 = t210 & (uint64_t)0xfffffffffffffU; - uint64_t t410 = t42 + (t310 >> (uint32_t)52U); - uint64_t t320 = t310 & (uint64_t)0xfffffffffffffU; + uint64_t t01 = t00 + x1 * 0x1000003D1ULL; + uint64_t t110 = t10 + (t01 >> 52U); + uint64_t t020 = t01 & 0xfffffffffffffULL; + uint64_t t210 = t20 + (t110 >> 52U); + uint64_t t120 = t110 & 0xfffffffffffffULL; + uint64_t t310 = t30 + (t210 >> 52U); + uint64_t t220 = t210 & 0xfffffffffffffULL; + uint64_t t410 = t42 + (t310 >> 52U); + uint64_t t320 = t310 & 0xfffffffffffffULL; uint64_t t0 = t020; uint64_t t1 = t120; uint64_t t2 = t220; uint64_t t3 = t320; uint64_t t4 = t410; - uint64_t x2 = t4 >> (uint32_t)48U; - uint64_t t411 = t4 & (uint64_t)0xffffffffffffU; + uint64_t x2 = t4 >> 48U; + uint64_t t411 = t4 & 0xffffffffffffULL; uint64_t x = x2; uint64_t r0 = t0; uint64_t r1 = t1; uint64_t r2 = t2; uint64_t r3 = t3; uint64_t r4 = t411; - uint64_t m4 = FStar_UInt64_eq_mask(r4, (uint64_t)0xffffffffffffU); - uint64_t m3 = FStar_UInt64_eq_mask(r3, (uint64_t)0xfffffffffffffU); - uint64_t m2 = FStar_UInt64_eq_mask(r2, (uint64_t)0xfffffffffffffU); - uint64_t m1 = FStar_UInt64_eq_mask(r1, (uint64_t)0xfffffffffffffU); - uint64_t m0 = FStar_UInt64_gte_mask(r0, (uint64_t)0xffffefffffc2fU); + uint64_t m4 = FStar_UInt64_eq_mask(r4, 0xffffffffffffULL); + uint64_t m3 = FStar_UInt64_eq_mask(r3, 0xfffffffffffffULL); + uint64_t m2 = FStar_UInt64_eq_mask(r2, 0xfffffffffffffULL); + uint64_t m1 = FStar_UInt64_eq_mask(r1, 0xfffffffffffffULL); + uint64_t m0 = FStar_UInt64_gte_mask(r0, 0xffffefffffc2fULL); uint64_t is_ge_p_m = (((m0 & m1) & m2) & m3) & m4; - uint64_t m_to_one = is_ge_p_m & (uint64_t)1U; + uint64_t m_to_one = is_ge_p_m & 1ULL; uint64_t x10 = m_to_one | x; - uint64_t t010 = r0 + x10 * (uint64_t)0x1000003D1U; - uint64_t t11 = r1 + (t010 >> (uint32_t)52U); - uint64_t t02 = t010 & (uint64_t)0xfffffffffffffU; - uint64_t t21 = r2 + (t11 >> (uint32_t)52U); - uint64_t t12 = t11 & (uint64_t)0xfffffffffffffU; - uint64_t t31 = r3 + (t21 >> (uint32_t)52U); - uint64_t t22 = t21 & (uint64_t)0xfffffffffffffU; - uint64_t t41 = r4 + (t31 >> (uint32_t)52U); - uint64_t t32 = t31 & (uint64_t)0xfffffffffffffU; + uint64_t t010 = r0 + x10 * 0x1000003D1ULL; + uint64_t t11 = r1 + (t010 >> 52U); + uint64_t t02 = t010 & 0xfffffffffffffULL; + uint64_t t21 = r2 + (t11 >> 52U); + uint64_t t12 = t11 & 0xfffffffffffffULL; + uint64_t t31 = r3 + (t21 >> 52U); + uint64_t t22 = t21 & 0xfffffffffffffULL; + uint64_t t41 = r4 + (t31 >> 52U); + uint64_t t32 = t31 & 0xfffffffffffffULL; uint64_t s0 = t02; uint64_t s1 = t12; uint64_t s2 = t22; uint64_t s3 = t32; uint64_t s4 = t41; - uint64_t t412 = s4 & (uint64_t)0xffffffffffffU; + uint64_t t412 = s4 & 0xffffffffffffULL; uint64_t k0 = s0; uint64_t k1 = s1; uint64_t k2 = s2; @@ -590,11 +574,11 @@ static inline void Hacl_K256_Field_fnegate_conditional_vartime(uint64_t *f, bool uint64_t a2 = f[2U]; uint64_t a3 = f[3U]; uint64_t a4 = f[4U]; - uint64_t r0 = (uint64_t)9007190664804446U - a0; - uint64_t r1 = (uint64_t)9007199254740990U - a1; - uint64_t r2 = (uint64_t)9007199254740990U - a2; - uint64_t r3 = (uint64_t)9007199254740990U - a3; - uint64_t r4 = (uint64_t)562949953421310U - a4; + uint64_t r0 = 9007190664804446ULL - a0; + uint64_t r1 = 9007199254740990ULL - a1; + uint64_t r2 = 9007199254740990ULL - a2; + uint64_t r3 = 9007199254740990ULL - a3; + uint64_t r4 = 562949953421310ULL - a4; uint64_t f0 = r0; uint64_t f1 = r1; uint64_t f2 = r2; @@ -612,7 +596,7 @@ static inline void Hacl_K256_Field_fnegate_conditional_vartime(uint64_t *f, bool static inline void Hacl_Impl_K256_Finv_fsquare_times_in_place(uint64_t *out, uint32_t b) { - for (uint32_t i = (uint32_t)0U; i < b; i++) + for (uint32_t i = 0U; i < b; i++) { Hacl_K256_Field_fsqr(out, out); } @@ -620,8 +604,8 @@ static inline void Hacl_Impl_K256_Finv_fsquare_times_in_place(uint64_t *out, uin static inline void Hacl_Impl_K256_Finv_fsquare_times(uint64_t *out, uint64_t *a, uint32_t b) { - memcpy(out, a, (uint32_t)5U * sizeof (uint64_t)); - for (uint32_t i = (uint32_t)0U; i < b; i++) + memcpy(out, a, 5U * sizeof (uint64_t)); + for (uint32_t i = 0U; i < b; i++) { Hacl_K256_Field_fsqr(out, out); } @@ -633,29 +617,29 @@ static inline void Hacl_Impl_K256_Finv_fexp_223_23(uint64_t *out, uint64_t *x2, uint64_t x22[5U] = { 0U }; uint64_t x44[5U] = { 0U }; uint64_t x88[5U] = { 0U }; - Hacl_Impl_K256_Finv_fsquare_times(x2, f, (uint32_t)1U); + Hacl_Impl_K256_Finv_fsquare_times(x2, f, 1U); Hacl_K256_Field_fmul(x2, x2, f); - Hacl_Impl_K256_Finv_fsquare_times(x3, x2, (uint32_t)1U); + Hacl_Impl_K256_Finv_fsquare_times(x3, x2, 1U); Hacl_K256_Field_fmul(x3, x3, f); - Hacl_Impl_K256_Finv_fsquare_times(out, x3, (uint32_t)3U); + Hacl_Impl_K256_Finv_fsquare_times(out, x3, 3U); Hacl_K256_Field_fmul(out, out, x3); - Hacl_Impl_K256_Finv_fsquare_times_in_place(out, (uint32_t)3U); + Hacl_Impl_K256_Finv_fsquare_times_in_place(out, 3U); Hacl_K256_Field_fmul(out, out, x3); - Hacl_Impl_K256_Finv_fsquare_times_in_place(out, (uint32_t)2U); + Hacl_Impl_K256_Finv_fsquare_times_in_place(out, 2U); Hacl_K256_Field_fmul(out, out, x2); - Hacl_Impl_K256_Finv_fsquare_times(x22, out, (uint32_t)11U); + Hacl_Impl_K256_Finv_fsquare_times(x22, out, 11U); Hacl_K256_Field_fmul(x22, x22, out); - Hacl_Impl_K256_Finv_fsquare_times(x44, x22, (uint32_t)22U); + Hacl_Impl_K256_Finv_fsquare_times(x44, x22, 22U); Hacl_K256_Field_fmul(x44, x44, x22); - Hacl_Impl_K256_Finv_fsquare_times(x88, x44, (uint32_t)44U); + Hacl_Impl_K256_Finv_fsquare_times(x88, x44, 44U); Hacl_K256_Field_fmul(x88, x88, x44); - Hacl_Impl_K256_Finv_fsquare_times(out, x88, (uint32_t)88U); + Hacl_Impl_K256_Finv_fsquare_times(out, x88, 88U); Hacl_K256_Field_fmul(out, out, x88); - Hacl_Impl_K256_Finv_fsquare_times_in_place(out, (uint32_t)44U); + Hacl_Impl_K256_Finv_fsquare_times_in_place(out, 44U); Hacl_K256_Field_fmul(out, out, x44); - Hacl_Impl_K256_Finv_fsquare_times_in_place(out, (uint32_t)3U); + Hacl_Impl_K256_Finv_fsquare_times_in_place(out, 3U); Hacl_K256_Field_fmul(out, out, x3); - Hacl_Impl_K256_Finv_fsquare_times_in_place(out, (uint32_t)23U); + Hacl_Impl_K256_Finv_fsquare_times_in_place(out, 23U); Hacl_K256_Field_fmul(out, out, x22); } @@ -663,11 +647,11 @@ static inline void Hacl_Impl_K256_Finv_finv(uint64_t *out, uint64_t *f) { uint64_t x2[5U] = { 0U }; Hacl_Impl_K256_Finv_fexp_223_23(out, x2, f); - Hacl_Impl_K256_Finv_fsquare_times_in_place(out, (uint32_t)5U); + Hacl_Impl_K256_Finv_fsquare_times_in_place(out, 5U); Hacl_K256_Field_fmul(out, out, f); - Hacl_Impl_K256_Finv_fsquare_times_in_place(out, (uint32_t)3U); + Hacl_Impl_K256_Finv_fsquare_times_in_place(out, 3U); Hacl_K256_Field_fmul(out, out, x2); - Hacl_Impl_K256_Finv_fsquare_times_in_place(out, (uint32_t)2U); + Hacl_Impl_K256_Finv_fsquare_times_in_place(out, 2U); Hacl_K256_Field_fmul(out, out, f); } @@ -675,9 +659,9 @@ static inline void Hacl_Impl_K256_Finv_fsqrt(uint64_t *out, uint64_t *f) { uint64_t x2[5U] = { 0U }; Hacl_Impl_K256_Finv_fexp_223_23(out, x2, f); - Hacl_Impl_K256_Finv_fsquare_times_in_place(out, (uint32_t)6U); + Hacl_Impl_K256_Finv_fsquare_times_in_place(out, 6U); Hacl_K256_Field_fmul(out, out, x2); - Hacl_Impl_K256_Finv_fsquare_times_in_place(out, (uint32_t)2U); + Hacl_Impl_K256_Finv_fsquare_times_in_place(out, 2U); } #if defined(__cplusplus) diff --git a/include/internal/Hacl_Ed25519_PrecompTable.h b/include/internal/Hacl_Ed25519_PrecompTable.h index 77d2244c..a20cd912 100644 --- a/include/internal/Hacl_Ed25519_PrecompTable.h +++ b/include/internal/Hacl_Ed25519_PrecompTable.h @@ -39,655 +39,491 @@ static const uint64_t Hacl_Ed25519_PrecompTable_precomp_basepoint_table_w4[320U] = { - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)1738742601995546U, (uint64_t)1146398526822698U, - (uint64_t)2070867633025821U, (uint64_t)562264141797630U, (uint64_t)587772402128613U, - (uint64_t)1801439850948184U, (uint64_t)1351079888211148U, (uint64_t)450359962737049U, - (uint64_t)900719925474099U, (uint64_t)1801439850948198U, (uint64_t)1U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1841354044333475U, - (uint64_t)16398895984059U, (uint64_t)755974180946558U, (uint64_t)900171276175154U, - (uint64_t)1821297809914039U, (uint64_t)1661154287933054U, (uint64_t)284530020860578U, - (uint64_t)1390261174866914U, (uint64_t)1524110943907984U, (uint64_t)1045603498418422U, - (uint64_t)928651508580478U, (uint64_t)1383326941296346U, (uint64_t)961937908925785U, - (uint64_t)80455759693706U, (uint64_t)904734540352947U, (uint64_t)1507481815385608U, - (uint64_t)2223447444246085U, (uint64_t)1083941587175919U, (uint64_t)2059929906842505U, - (uint64_t)1581435440146976U, (uint64_t)782730187692425U, (uint64_t)9928394897574U, - (uint64_t)1539449519985236U, (uint64_t)1923587931078510U, (uint64_t)552919286076056U, - (uint64_t)376925408065760U, (uint64_t)447320488831784U, (uint64_t)1362918338468019U, - (uint64_t)1470031896696846U, (uint64_t)2189796996539902U, (uint64_t)1337552949959847U, - (uint64_t)1762287177775726U, (uint64_t)237994495816815U, (uint64_t)1277840395970544U, - (uint64_t)543972849007241U, (uint64_t)1224692671618814U, (uint64_t)162359533289271U, - (uint64_t)282240927125249U, (uint64_t)586909166382289U, (uint64_t)17726488197838U, - (uint64_t)377014554985659U, (uint64_t)1433835303052512U, (uint64_t)702061469493692U, - (uint64_t)1142253108318154U, (uint64_t)318297794307551U, (uint64_t)954362646308543U, - (uint64_t)517363881452320U, (uint64_t)1868013482130416U, (uint64_t)262562472373260U, - (uint64_t)902232853249919U, (uint64_t)2107343057055746U, (uint64_t)462368348619024U, - (uint64_t)1893758677092974U, (uint64_t)2177729767846389U, (uint64_t)2168532543559143U, - (uint64_t)443867094639821U, (uint64_t)730169342581022U, (uint64_t)1564589016879755U, - (uint64_t)51218195700649U, (uint64_t)76684578423745U, (uint64_t)560266272480743U, - (uint64_t)922517457707697U, (uint64_t)2066645939860874U, (uint64_t)1318277348414638U, - (uint64_t)1576726809084003U, (uint64_t)1817337608563665U, (uint64_t)1874240939237666U, - (uint64_t)754733726333910U, (uint64_t)97085310406474U, (uint64_t)751148364309235U, - (uint64_t)1622159695715187U, (uint64_t)1444098819684916U, (uint64_t)130920805558089U, - (uint64_t)1260449179085308U, (uint64_t)1860021740768461U, (uint64_t)110052860348509U, - (uint64_t)193830891643810U, (uint64_t)164148413933881U, (uint64_t)180017794795332U, - (uint64_t)1523506525254651U, (uint64_t)465981629225956U, (uint64_t)559733514964572U, - (uint64_t)1279624874416974U, (uint64_t)2026642326892306U, (uint64_t)1425156829982409U, - (uint64_t)2160936383793147U, (uint64_t)1061870624975247U, (uint64_t)2023497043036941U, - (uint64_t)117942212883190U, (uint64_t)490339622800774U, (uint64_t)1729931303146295U, - (uint64_t)422305932971074U, (uint64_t)529103152793096U, (uint64_t)1211973233775992U, - (uint64_t)721364955929681U, (uint64_t)1497674430438813U, (uint64_t)342545521275073U, - (uint64_t)2102107575279372U, (uint64_t)2108462244669966U, (uint64_t)1382582406064082U, - (uint64_t)2206396818383323U, (uint64_t)2109093268641147U, (uint64_t)10809845110983U, - (uint64_t)1605176920880099U, (uint64_t)744640650753946U, (uint64_t)1712758897518129U, - (uint64_t)373410811281809U, (uint64_t)648838265800209U, (uint64_t)813058095530999U, - (uint64_t)513987632620169U, (uint64_t)465516160703329U, (uint64_t)2136322186126330U, - (uint64_t)1979645899422932U, (uint64_t)1197131006470786U, (uint64_t)1467836664863979U, - (uint64_t)1340751381374628U, (uint64_t)1810066212667962U, (uint64_t)1009933588225499U, - (uint64_t)1106129188080873U, (uint64_t)1388980405213901U, (uint64_t)533719246598044U, - (uint64_t)1169435803073277U, (uint64_t)198920999285821U, (uint64_t)487492330629854U, - (uint64_t)1807093008537778U, (uint64_t)1540899012923865U, (uint64_t)2075080271659867U, - (uint64_t)1527990806921523U, (uint64_t)1323728742908002U, (uint64_t)1568595959608205U, - (uint64_t)1388032187497212U, (uint64_t)2026968840050568U, (uint64_t)1396591153295755U, - (uint64_t)820416950170901U, (uint64_t)520060313205582U, (uint64_t)2016404325094901U, - (uint64_t)1584709677868520U, (uint64_t)272161374469956U, (uint64_t)1567188603996816U, - (uint64_t)1986160530078221U, (uint64_t)553930264324589U, (uint64_t)1058426729027503U, - (uint64_t)8762762886675U, (uint64_t)2216098143382988U, (uint64_t)1835145266889223U, - (uint64_t)1712936431558441U, (uint64_t)1017009937844974U, (uint64_t)585361667812740U, - (uint64_t)2114711541628181U, (uint64_t)2238729632971439U, (uint64_t)121257546253072U, - (uint64_t)847154149018345U, (uint64_t)211972965476684U, (uint64_t)287499084460129U, - (uint64_t)2098247259180197U, (uint64_t)839070411583329U, (uint64_t)339551619574372U, - (uint64_t)1432951287640743U, (uint64_t)526481249498942U, (uint64_t)931991661905195U, - (uint64_t)1884279965674487U, (uint64_t)200486405604411U, (uint64_t)364173020594788U, - (uint64_t)518034455936955U, (uint64_t)1085564703965501U, (uint64_t)16030410467927U, - (uint64_t)604865933167613U, (uint64_t)1695298441093964U, (uint64_t)498856548116159U, - (uint64_t)2193030062787034U, (uint64_t)1706339802964179U, (uint64_t)1721199073493888U, - (uint64_t)820740951039755U, (uint64_t)1216053436896834U, (uint64_t)23954895815139U, - (uint64_t)1662515208920491U, (uint64_t)1705443427511899U, (uint64_t)1957928899570365U, - (uint64_t)1189636258255725U, (uint64_t)1795695471103809U, (uint64_t)1691191297654118U, - (uint64_t)282402585374360U, (uint64_t)460405330264832U, (uint64_t)63765529445733U, - (uint64_t)469763447404473U, (uint64_t)733607089694996U, (uint64_t)685410420186959U, - (uint64_t)1096682630419738U, (uint64_t)1162548510542362U, (uint64_t)1020949526456676U, - (uint64_t)1211660396870573U, (uint64_t)613126398222696U, (uint64_t)1117829165843251U, - (uint64_t)742432540886650U, (uint64_t)1483755088010658U, (uint64_t)942392007134474U, - (uint64_t)1447834130944107U, (uint64_t)489368274863410U, (uint64_t)23192985544898U, - (uint64_t)648442406146160U, (uint64_t)785438843373876U, (uint64_t)249464684645238U, - (uint64_t)170494608205618U, (uint64_t)335112827260550U, (uint64_t)1462050123162735U, - (uint64_t)1084803668439016U, (uint64_t)853459233600325U, (uint64_t)215777728187495U, - (uint64_t)1965759433526974U, (uint64_t)1349482894446537U, (uint64_t)694163317612871U, - (uint64_t)860536766165036U, (uint64_t)1178788094084321U, (uint64_t)1652739626626996U, - (uint64_t)2115723946388185U, (uint64_t)1577204379094664U, (uint64_t)1083882859023240U, - (uint64_t)1768759143381635U, (uint64_t)1737180992507258U, (uint64_t)246054513922239U, - (uint64_t)577253134087234U, (uint64_t)356340280578042U, (uint64_t)1638917769925142U, - (uint64_t)223550348130103U, (uint64_t)470592666638765U, (uint64_t)22663573966996U, - (uint64_t)596552461152400U, (uint64_t)364143537069499U, (uint64_t)3942119457699U, - (uint64_t)107951982889287U, (uint64_t)1843471406713209U, (uint64_t)1625773041610986U, - (uint64_t)1466141092501702U, (uint64_t)1043024095021271U, (uint64_t)310429964047508U, - (uint64_t)98559121500372U, (uint64_t)152746933782868U, (uint64_t)259407205078261U, - (uint64_t)828123093322585U, (uint64_t)1576847274280091U, (uint64_t)1170871375757302U, - (uint64_t)1588856194642775U, (uint64_t)984767822341977U, (uint64_t)1141497997993760U, - (uint64_t)809325345150796U, (uint64_t)1879837728202511U, (uint64_t)201340910657893U, - (uint64_t)1079157558888483U, (uint64_t)1052373448588065U, (uint64_t)1732036202501778U, - (uint64_t)2105292670328445U, (uint64_t)679751387312402U, (uint64_t)1679682144926229U, - (uint64_t)1695823455818780U, (uint64_t)498852317075849U, (uint64_t)1786555067788433U, - (uint64_t)1670727545779425U, (uint64_t)117945875433544U, (uint64_t)407939139781844U, - (uint64_t)854632120023778U, (uint64_t)1413383148360437U, (uint64_t)286030901733673U, - (uint64_t)1207361858071196U, (uint64_t)461340408181417U, (uint64_t)1096919590360164U, - (uint64_t)1837594897475685U, (uint64_t)533755561544165U, (uint64_t)1638688042247712U, - (uint64_t)1431653684793005U, (uint64_t)1036458538873559U, (uint64_t)390822120341779U, - (uint64_t)1920929837111618U, (uint64_t)543426740024168U, (uint64_t)645751357799929U, - (uint64_t)2245025632994463U, (uint64_t)1550778638076452U, (uint64_t)223738153459949U, - (uint64_t)1337209385492033U, (uint64_t)1276967236456531U, (uint64_t)1463815821063071U, - (uint64_t)2070620870191473U, (uint64_t)1199170709413753U, (uint64_t)273230877394166U, - (uint64_t)1873264887608046U, (uint64_t)890877152910775U + 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, + 0ULL, 0ULL, 0ULL, 0ULL, 1738742601995546ULL, 1146398526822698ULL, 2070867633025821ULL, + 562264141797630ULL, 587772402128613ULL, 1801439850948184ULL, 1351079888211148ULL, + 450359962737049ULL, 900719925474099ULL, 1801439850948198ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, + 1841354044333475ULL, 16398895984059ULL, 755974180946558ULL, 900171276175154ULL, + 1821297809914039ULL, 1661154287933054ULL, 284530020860578ULL, 1390261174866914ULL, + 1524110943907984ULL, 1045603498418422ULL, 928651508580478ULL, 1383326941296346ULL, + 961937908925785ULL, 80455759693706ULL, 904734540352947ULL, 1507481815385608ULL, + 2223447444246085ULL, 1083941587175919ULL, 2059929906842505ULL, 1581435440146976ULL, + 782730187692425ULL, 9928394897574ULL, 1539449519985236ULL, 1923587931078510ULL, + 552919286076056ULL, 376925408065760ULL, 447320488831784ULL, 1362918338468019ULL, + 1470031896696846ULL, 2189796996539902ULL, 1337552949959847ULL, 1762287177775726ULL, + 237994495816815ULL, 1277840395970544ULL, 543972849007241ULL, 1224692671618814ULL, + 162359533289271ULL, 282240927125249ULL, 586909166382289ULL, 17726488197838ULL, + 377014554985659ULL, 1433835303052512ULL, 702061469493692ULL, 1142253108318154ULL, + 318297794307551ULL, 954362646308543ULL, 517363881452320ULL, 1868013482130416ULL, + 262562472373260ULL, 902232853249919ULL, 2107343057055746ULL, 462368348619024ULL, + 1893758677092974ULL, 2177729767846389ULL, 2168532543559143ULL, 443867094639821ULL, + 730169342581022ULL, 1564589016879755ULL, 51218195700649ULL, 76684578423745ULL, + 560266272480743ULL, 922517457707697ULL, 2066645939860874ULL, 1318277348414638ULL, + 1576726809084003ULL, 1817337608563665ULL, 1874240939237666ULL, 754733726333910ULL, + 97085310406474ULL, 751148364309235ULL, 1622159695715187ULL, 1444098819684916ULL, + 130920805558089ULL, 1260449179085308ULL, 1860021740768461ULL, 110052860348509ULL, + 193830891643810ULL, 164148413933881ULL, 180017794795332ULL, 1523506525254651ULL, + 465981629225956ULL, 559733514964572ULL, 1279624874416974ULL, 2026642326892306ULL, + 1425156829982409ULL, 2160936383793147ULL, 1061870624975247ULL, 2023497043036941ULL, + 117942212883190ULL, 490339622800774ULL, 1729931303146295ULL, 422305932971074ULL, + 529103152793096ULL, 1211973233775992ULL, 721364955929681ULL, 1497674430438813ULL, + 342545521275073ULL, 2102107575279372ULL, 2108462244669966ULL, 1382582406064082ULL, + 2206396818383323ULL, 2109093268641147ULL, 10809845110983ULL, 1605176920880099ULL, + 744640650753946ULL, 1712758897518129ULL, 373410811281809ULL, 648838265800209ULL, + 813058095530999ULL, 513987632620169ULL, 465516160703329ULL, 2136322186126330ULL, + 1979645899422932ULL, 1197131006470786ULL, 1467836664863979ULL, 1340751381374628ULL, + 1810066212667962ULL, 1009933588225499ULL, 1106129188080873ULL, 1388980405213901ULL, + 533719246598044ULL, 1169435803073277ULL, 198920999285821ULL, 487492330629854ULL, + 1807093008537778ULL, 1540899012923865ULL, 2075080271659867ULL, 1527990806921523ULL, + 1323728742908002ULL, 1568595959608205ULL, 1388032187497212ULL, 2026968840050568ULL, + 1396591153295755ULL, 820416950170901ULL, 520060313205582ULL, 2016404325094901ULL, + 1584709677868520ULL, 272161374469956ULL, 1567188603996816ULL, 1986160530078221ULL, + 553930264324589ULL, 1058426729027503ULL, 8762762886675ULL, 2216098143382988ULL, + 1835145266889223ULL, 1712936431558441ULL, 1017009937844974ULL, 585361667812740ULL, + 2114711541628181ULL, 2238729632971439ULL, 121257546253072ULL, 847154149018345ULL, + 211972965476684ULL, 287499084460129ULL, 2098247259180197ULL, 839070411583329ULL, + 339551619574372ULL, 1432951287640743ULL, 526481249498942ULL, 931991661905195ULL, + 1884279965674487ULL, 200486405604411ULL, 364173020594788ULL, 518034455936955ULL, + 1085564703965501ULL, 16030410467927ULL, 604865933167613ULL, 1695298441093964ULL, + 498856548116159ULL, 2193030062787034ULL, 1706339802964179ULL, 1721199073493888ULL, + 820740951039755ULL, 1216053436896834ULL, 23954895815139ULL, 1662515208920491ULL, + 1705443427511899ULL, 1957928899570365ULL, 1189636258255725ULL, 1795695471103809ULL, + 1691191297654118ULL, 282402585374360ULL, 460405330264832ULL, 63765529445733ULL, + 469763447404473ULL, 733607089694996ULL, 685410420186959ULL, 1096682630419738ULL, + 1162548510542362ULL, 1020949526456676ULL, 1211660396870573ULL, 613126398222696ULL, + 1117829165843251ULL, 742432540886650ULL, 1483755088010658ULL, 942392007134474ULL, + 1447834130944107ULL, 489368274863410ULL, 23192985544898ULL, 648442406146160ULL, + 785438843373876ULL, 249464684645238ULL, 170494608205618ULL, 335112827260550ULL, + 1462050123162735ULL, 1084803668439016ULL, 853459233600325ULL, 215777728187495ULL, + 1965759433526974ULL, 1349482894446537ULL, 694163317612871ULL, 860536766165036ULL, + 1178788094084321ULL, 1652739626626996ULL, 2115723946388185ULL, 1577204379094664ULL, + 1083882859023240ULL, 1768759143381635ULL, 1737180992507258ULL, 246054513922239ULL, + 577253134087234ULL, 356340280578042ULL, 1638917769925142ULL, 223550348130103ULL, + 470592666638765ULL, 22663573966996ULL, 596552461152400ULL, 364143537069499ULL, 3942119457699ULL, + 107951982889287ULL, 1843471406713209ULL, 1625773041610986ULL, 1466141092501702ULL, + 1043024095021271ULL, 310429964047508ULL, 98559121500372ULL, 152746933782868ULL, + 259407205078261ULL, 828123093322585ULL, 1576847274280091ULL, 1170871375757302ULL, + 1588856194642775ULL, 984767822341977ULL, 1141497997993760ULL, 809325345150796ULL, + 1879837728202511ULL, 201340910657893ULL, 1079157558888483ULL, 1052373448588065ULL, + 1732036202501778ULL, 2105292670328445ULL, 679751387312402ULL, 1679682144926229ULL, + 1695823455818780ULL, 498852317075849ULL, 1786555067788433ULL, 1670727545779425ULL, + 117945875433544ULL, 407939139781844ULL, 854632120023778ULL, 1413383148360437ULL, + 286030901733673ULL, 1207361858071196ULL, 461340408181417ULL, 1096919590360164ULL, + 1837594897475685ULL, 533755561544165ULL, 1638688042247712ULL, 1431653684793005ULL, + 1036458538873559ULL, 390822120341779ULL, 1920929837111618ULL, 543426740024168ULL, + 645751357799929ULL, 2245025632994463ULL, 1550778638076452ULL, 223738153459949ULL, + 1337209385492033ULL, 1276967236456531ULL, 1463815821063071ULL, 2070620870191473ULL, + 1199170709413753ULL, 273230877394166ULL, 1873264887608046ULL, 890877152910775ULL }; static const uint64_t Hacl_Ed25519_PrecompTable_precomp_g_pow2_64_table_w4[320U] = { - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)13559344787725U, (uint64_t)2051621493703448U, - (uint64_t)1947659315640708U, (uint64_t)626856790370168U, (uint64_t)1592804284034836U, - (uint64_t)1781728767459187U, (uint64_t)278818420518009U, (uint64_t)2038030359908351U, - (uint64_t)910625973862690U, (uint64_t)471887343142239U, (uint64_t)1298543306606048U, - (uint64_t)794147365642417U, (uint64_t)129968992326749U, (uint64_t)523140861678572U, - (uint64_t)1166419653909231U, (uint64_t)2009637196928390U, (uint64_t)1288020222395193U, - (uint64_t)1007046974985829U, (uint64_t)208981102651386U, (uint64_t)2074009315253380U, - (uint64_t)1564056062071967U, (uint64_t)276822668750618U, (uint64_t)206621292512572U, - (uint64_t)470304361809269U, (uint64_t)895215438398493U, (uint64_t)1527859053868686U, - (uint64_t)1624967223409369U, (uint64_t)811821865979736U, (uint64_t)350450534838340U, - (uint64_t)219143807921807U, (uint64_t)507994540371254U, (uint64_t)986513794574720U, - (uint64_t)1142661369967121U, (uint64_t)621278293399257U, (uint64_t)556189161519781U, - (uint64_t)351964007865066U, (uint64_t)2011573453777822U, (uint64_t)1367125527151537U, - (uint64_t)1691316722438196U, (uint64_t)731328817345164U, (uint64_t)1284781192709232U, - (uint64_t)478439299539269U, (uint64_t)204842178076429U, (uint64_t)2085125369913651U, - (uint64_t)1980773492792985U, (uint64_t)1480264409524940U, (uint64_t)688389585376233U, - (uint64_t)612962643526972U, (uint64_t)165595382536676U, (uint64_t)1850300069212263U, - (uint64_t)1176357203491551U, (uint64_t)1880164984292321U, (uint64_t)10786153104736U, - (uint64_t)1242293560510203U, (uint64_t)1358399951884084U, (uint64_t)1901358796610357U, - (uint64_t)1385092558795806U, (uint64_t)1734893785311348U, (uint64_t)2046201851951191U, - (uint64_t)1233811309557352U, (uint64_t)1531160168656129U, (uint64_t)1543287181303358U, - (uint64_t)516121446374119U, (uint64_t)723422668089935U, (uint64_t)1228176774959679U, - (uint64_t)1598014722726267U, (uint64_t)1630810326658412U, (uint64_t)1343833067463760U, - (uint64_t)1024397964362099U, (uint64_t)1157142161346781U, (uint64_t)56422174971792U, - (uint64_t)544901687297092U, (uint64_t)1291559028869009U, (uint64_t)1336918672345120U, - (uint64_t)1390874603281353U, (uint64_t)1127199512010904U, (uint64_t)992644979940964U, - (uint64_t)1035213479783573U, (uint64_t)36043651196100U, (uint64_t)1220961519321221U, - (uint64_t)1348190007756977U, (uint64_t)579420200329088U, (uint64_t)1703819961008985U, - (uint64_t)1993919213460047U, (uint64_t)2225080008232251U, (uint64_t)392785893702372U, - (uint64_t)464312521482632U, (uint64_t)1224525362116057U, (uint64_t)810394248933036U, - (uint64_t)932513521649107U, (uint64_t)592314953488703U, (uint64_t)586334603791548U, - (uint64_t)1310888126096549U, (uint64_t)650842674074281U, (uint64_t)1596447001791059U, - (uint64_t)2086767406328284U, (uint64_t)1866377645879940U, (uint64_t)1721604362642743U, - (uint64_t)738502322566890U, (uint64_t)1851901097729689U, (uint64_t)1158347571686914U, - (uint64_t)2023626733470827U, (uint64_t)329625404653699U, (uint64_t)563555875598551U, - (uint64_t)516554588079177U, (uint64_t)1134688306104598U, (uint64_t)186301198420809U, - (uint64_t)1339952213563300U, (uint64_t)643605614625891U, (uint64_t)1947505332718043U, - (uint64_t)1722071694852824U, (uint64_t)601679570440694U, (uint64_t)1821275721236351U, - (uint64_t)1808307842870389U, (uint64_t)1654165204015635U, (uint64_t)1457334100715245U, - (uint64_t)217784948678349U, (uint64_t)1820622417674817U, (uint64_t)1946121178444661U, - (uint64_t)597980757799332U, (uint64_t)1745271227710764U, (uint64_t)2010952890941980U, - (uint64_t)339811849696648U, (uint64_t)1066120666993872U, (uint64_t)261276166508990U, - (uint64_t)323098645774553U, (uint64_t)207454744271283U, (uint64_t)941448672977675U, - (uint64_t)71890920544375U, (uint64_t)840849789313357U, (uint64_t)1223996070717926U, - (uint64_t)196832550853408U, (uint64_t)115986818309231U, (uint64_t)1586171527267675U, - (uint64_t)1666169080973450U, (uint64_t)1456454731176365U, (uint64_t)44467854369003U, - (uint64_t)2149656190691480U, (uint64_t)283446383597589U, (uint64_t)2040542647729974U, - (uint64_t)305705593840224U, (uint64_t)475315822269791U, (uint64_t)648133452550632U, - (uint64_t)169218658835720U, (uint64_t)24960052338251U, (uint64_t)938907951346766U, - (uint64_t)425970950490510U, (uint64_t)1037622011013183U, (uint64_t)1026882082708180U, - (uint64_t)1635699409504916U, (uint64_t)1644776942870488U, (uint64_t)2151820331175914U, - (uint64_t)824120674069819U, (uint64_t)835744976610113U, (uint64_t)1991271032313190U, - (uint64_t)96507354724855U, (uint64_t)400645405133260U, (uint64_t)343728076650825U, - (uint64_t)1151585441385566U, (uint64_t)1403339955333520U, (uint64_t)230186314139774U, - (uint64_t)1736248861506714U, (uint64_t)1010804378904572U, (uint64_t)1394932289845636U, - (uint64_t)1901351256960852U, (uint64_t)2187471430089807U, (uint64_t)1003853262342670U, - (uint64_t)1327743396767461U, (uint64_t)1465160415991740U, (uint64_t)366625359144534U, - (uint64_t)1534791405247604U, (uint64_t)1790905930250187U, (uint64_t)1255484115292738U, - (uint64_t)2223291365520443U, (uint64_t)210967717407408U, (uint64_t)26722916813442U, - (uint64_t)1919574361907910U, (uint64_t)468825088280256U, (uint64_t)2230011775946070U, - (uint64_t)1628365642214479U, (uint64_t)568871869234932U, (uint64_t)1066987968780488U, - (uint64_t)1692242903745558U, (uint64_t)1678903997328589U, (uint64_t)214262165888021U, - (uint64_t)1929686748607204U, (uint64_t)1790138967989670U, (uint64_t)1790261616022076U, - (uint64_t)1559824537553112U, (uint64_t)1230364591311358U, (uint64_t)147531939886346U, - (uint64_t)1528207085815487U, (uint64_t)477957922927292U, (uint64_t)285670243881618U, - (uint64_t)264430080123332U, (uint64_t)1163108160028611U, (uint64_t)373201522147371U, - (uint64_t)34903775270979U, (uint64_t)1750870048600662U, (uint64_t)1319328308741084U, - (uint64_t)1547548634278984U, (uint64_t)1691259592202927U, (uint64_t)2247758037259814U, - (uint64_t)329611399953677U, (uint64_t)1385555496268877U, (uint64_t)2242438354031066U, - (uint64_t)1329523854843632U, (uint64_t)399895373846055U, (uint64_t)678005703193452U, - (uint64_t)1496357700997771U, (uint64_t)71909969781942U, (uint64_t)1515391418612349U, - (uint64_t)470110837888178U, (uint64_t)1981307309417466U, (uint64_t)1259888737412276U, - (uint64_t)669991710228712U, (uint64_t)1048546834514303U, (uint64_t)1678323291295512U, - (uint64_t)2172033978088071U, (uint64_t)1529278455500556U, (uint64_t)901984601941894U, - (uint64_t)780867622403807U, (uint64_t)550105677282793U, (uint64_t)975860231176136U, - (uint64_t)525188281689178U, (uint64_t)49966114807992U, (uint64_t)1776449263836645U, - (uint64_t)267851776380338U, (uint64_t)2225969494054620U, (uint64_t)2016794225789822U, - (uint64_t)1186108678266608U, (uint64_t)1023083271408882U, (uint64_t)1119289418565906U, - (uint64_t)1248185897348801U, (uint64_t)1846081539082697U, (uint64_t)23756429626075U, - (uint64_t)1441999021105403U, (uint64_t)724497586552825U, (uint64_t)1287761623605379U, - (uint64_t)685303359654224U, (uint64_t)2217156930690570U, (uint64_t)163769288918347U, - (uint64_t)1098423278284094U, (uint64_t)1391470723006008U, (uint64_t)570700152353516U, - (uint64_t)744804507262556U, (uint64_t)2200464788609495U, (uint64_t)624141899161992U, - (uint64_t)2249570166275684U, (uint64_t)378706441983561U, (uint64_t)122486379999375U, - (uint64_t)430741162798924U, (uint64_t)113847463452574U, (uint64_t)266250457840685U, - (uint64_t)2120743625072743U, (uint64_t)222186221043927U, (uint64_t)1964290018305582U, - (uint64_t)1435278008132477U, (uint64_t)1670867456663734U, (uint64_t)2009989552599079U, - (uint64_t)1348024113448744U, (uint64_t)1158423886300455U, (uint64_t)1356467152691569U, - (uint64_t)306943042363674U, (uint64_t)926879628664255U, (uint64_t)1349295689598324U, - (uint64_t)725558330071205U, (uint64_t)536569987519948U, (uint64_t)116436990335366U, - (uint64_t)1551888573800376U, (uint64_t)2044698345945451U, (uint64_t)104279940291311U, - (uint64_t)251526570943220U, (uint64_t)754735828122925U, (uint64_t)33448073576361U, - (uint64_t)994605876754543U, (uint64_t)546007584022006U, (uint64_t)2217332798409487U, - (uint64_t)706477052561591U, (uint64_t)131174619428653U, (uint64_t)2148698284087243U, - (uint64_t)239290486205186U, (uint64_t)2161325796952184U, (uint64_t)1713452845607994U, - (uint64_t)1297861562938913U, (uint64_t)1779539876828514U, (uint64_t)1926559018603871U, - (uint64_t)296485747893968U, (uint64_t)1859208206640686U, (uint64_t)538513979002718U, - (uint64_t)103998826506137U, (uint64_t)2025375396538469U, (uint64_t)1370680785701206U, - (uint64_t)1698557311253840U, (uint64_t)1411096399076595U, (uint64_t)2132580530813677U, - (uint64_t)2071564345845035U, (uint64_t)498581428556735U, (uint64_t)1136010486691371U, - (uint64_t)1927619356993146U + 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, + 0ULL, 0ULL, 0ULL, 0ULL, 13559344787725ULL, 2051621493703448ULL, 1947659315640708ULL, + 626856790370168ULL, 1592804284034836ULL, 1781728767459187ULL, 278818420518009ULL, + 2038030359908351ULL, 910625973862690ULL, 471887343142239ULL, 1298543306606048ULL, + 794147365642417ULL, 129968992326749ULL, 523140861678572ULL, 1166419653909231ULL, + 2009637196928390ULL, 1288020222395193ULL, 1007046974985829ULL, 208981102651386ULL, + 2074009315253380ULL, 1564056062071967ULL, 276822668750618ULL, 206621292512572ULL, + 470304361809269ULL, 895215438398493ULL, 1527859053868686ULL, 1624967223409369ULL, + 811821865979736ULL, 350450534838340ULL, 219143807921807ULL, 507994540371254ULL, + 986513794574720ULL, 1142661369967121ULL, 621278293399257ULL, 556189161519781ULL, + 351964007865066ULL, 2011573453777822ULL, 1367125527151537ULL, 1691316722438196ULL, + 731328817345164ULL, 1284781192709232ULL, 478439299539269ULL, 204842178076429ULL, + 2085125369913651ULL, 1980773492792985ULL, 1480264409524940ULL, 688389585376233ULL, + 612962643526972ULL, 165595382536676ULL, 1850300069212263ULL, 1176357203491551ULL, + 1880164984292321ULL, 10786153104736ULL, 1242293560510203ULL, 1358399951884084ULL, + 1901358796610357ULL, 1385092558795806ULL, 1734893785311348ULL, 2046201851951191ULL, + 1233811309557352ULL, 1531160168656129ULL, 1543287181303358ULL, 516121446374119ULL, + 723422668089935ULL, 1228176774959679ULL, 1598014722726267ULL, 1630810326658412ULL, + 1343833067463760ULL, 1024397964362099ULL, 1157142161346781ULL, 56422174971792ULL, + 544901687297092ULL, 1291559028869009ULL, 1336918672345120ULL, 1390874603281353ULL, + 1127199512010904ULL, 992644979940964ULL, 1035213479783573ULL, 36043651196100ULL, + 1220961519321221ULL, 1348190007756977ULL, 579420200329088ULL, 1703819961008985ULL, + 1993919213460047ULL, 2225080008232251ULL, 392785893702372ULL, 464312521482632ULL, + 1224525362116057ULL, 810394248933036ULL, 932513521649107ULL, 592314953488703ULL, + 586334603791548ULL, 1310888126096549ULL, 650842674074281ULL, 1596447001791059ULL, + 2086767406328284ULL, 1866377645879940ULL, 1721604362642743ULL, 738502322566890ULL, + 1851901097729689ULL, 1158347571686914ULL, 2023626733470827ULL, 329625404653699ULL, + 563555875598551ULL, 516554588079177ULL, 1134688306104598ULL, 186301198420809ULL, + 1339952213563300ULL, 643605614625891ULL, 1947505332718043ULL, 1722071694852824ULL, + 601679570440694ULL, 1821275721236351ULL, 1808307842870389ULL, 1654165204015635ULL, + 1457334100715245ULL, 217784948678349ULL, 1820622417674817ULL, 1946121178444661ULL, + 597980757799332ULL, 1745271227710764ULL, 2010952890941980ULL, 339811849696648ULL, + 1066120666993872ULL, 261276166508990ULL, 323098645774553ULL, 207454744271283ULL, + 941448672977675ULL, 71890920544375ULL, 840849789313357ULL, 1223996070717926ULL, + 196832550853408ULL, 115986818309231ULL, 1586171527267675ULL, 1666169080973450ULL, + 1456454731176365ULL, 44467854369003ULL, 2149656190691480ULL, 283446383597589ULL, + 2040542647729974ULL, 305705593840224ULL, 475315822269791ULL, 648133452550632ULL, + 169218658835720ULL, 24960052338251ULL, 938907951346766ULL, 425970950490510ULL, + 1037622011013183ULL, 1026882082708180ULL, 1635699409504916ULL, 1644776942870488ULL, + 2151820331175914ULL, 824120674069819ULL, 835744976610113ULL, 1991271032313190ULL, + 96507354724855ULL, 400645405133260ULL, 343728076650825ULL, 1151585441385566ULL, + 1403339955333520ULL, 230186314139774ULL, 1736248861506714ULL, 1010804378904572ULL, + 1394932289845636ULL, 1901351256960852ULL, 2187471430089807ULL, 1003853262342670ULL, + 1327743396767461ULL, 1465160415991740ULL, 366625359144534ULL, 1534791405247604ULL, + 1790905930250187ULL, 1255484115292738ULL, 2223291365520443ULL, 210967717407408ULL, + 26722916813442ULL, 1919574361907910ULL, 468825088280256ULL, 2230011775946070ULL, + 1628365642214479ULL, 568871869234932ULL, 1066987968780488ULL, 1692242903745558ULL, + 1678903997328589ULL, 214262165888021ULL, 1929686748607204ULL, 1790138967989670ULL, + 1790261616022076ULL, 1559824537553112ULL, 1230364591311358ULL, 147531939886346ULL, + 1528207085815487ULL, 477957922927292ULL, 285670243881618ULL, 264430080123332ULL, + 1163108160028611ULL, 373201522147371ULL, 34903775270979ULL, 1750870048600662ULL, + 1319328308741084ULL, 1547548634278984ULL, 1691259592202927ULL, 2247758037259814ULL, + 329611399953677ULL, 1385555496268877ULL, 2242438354031066ULL, 1329523854843632ULL, + 399895373846055ULL, 678005703193452ULL, 1496357700997771ULL, 71909969781942ULL, + 1515391418612349ULL, 470110837888178ULL, 1981307309417466ULL, 1259888737412276ULL, + 669991710228712ULL, 1048546834514303ULL, 1678323291295512ULL, 2172033978088071ULL, + 1529278455500556ULL, 901984601941894ULL, 780867622403807ULL, 550105677282793ULL, + 975860231176136ULL, 525188281689178ULL, 49966114807992ULL, 1776449263836645ULL, + 267851776380338ULL, 2225969494054620ULL, 2016794225789822ULL, 1186108678266608ULL, + 1023083271408882ULL, 1119289418565906ULL, 1248185897348801ULL, 1846081539082697ULL, + 23756429626075ULL, 1441999021105403ULL, 724497586552825ULL, 1287761623605379ULL, + 685303359654224ULL, 2217156930690570ULL, 163769288918347ULL, 1098423278284094ULL, + 1391470723006008ULL, 570700152353516ULL, 744804507262556ULL, 2200464788609495ULL, + 624141899161992ULL, 2249570166275684ULL, 378706441983561ULL, 122486379999375ULL, + 430741162798924ULL, 113847463452574ULL, 266250457840685ULL, 2120743625072743ULL, + 222186221043927ULL, 1964290018305582ULL, 1435278008132477ULL, 1670867456663734ULL, + 2009989552599079ULL, 1348024113448744ULL, 1158423886300455ULL, 1356467152691569ULL, + 306943042363674ULL, 926879628664255ULL, 1349295689598324ULL, 725558330071205ULL, + 536569987519948ULL, 116436990335366ULL, 1551888573800376ULL, 2044698345945451ULL, + 104279940291311ULL, 251526570943220ULL, 754735828122925ULL, 33448073576361ULL, + 994605876754543ULL, 546007584022006ULL, 2217332798409487ULL, 706477052561591ULL, + 131174619428653ULL, 2148698284087243ULL, 239290486205186ULL, 2161325796952184ULL, + 1713452845607994ULL, 1297861562938913ULL, 1779539876828514ULL, 1926559018603871ULL, + 296485747893968ULL, 1859208206640686ULL, 538513979002718ULL, 103998826506137ULL, + 2025375396538469ULL, 1370680785701206ULL, 1698557311253840ULL, 1411096399076595ULL, + 2132580530813677ULL, 2071564345845035ULL, 498581428556735ULL, 1136010486691371ULL, + 1927619356993146ULL }; static const uint64_t Hacl_Ed25519_PrecompTable_precomp_g_pow2_128_table_w4[320U] = { - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)557549315715710U, (uint64_t)196756086293855U, - (uint64_t)846062225082495U, (uint64_t)1865068224838092U, (uint64_t)991112090754908U, - (uint64_t)522916421512828U, (uint64_t)2098523346722375U, (uint64_t)1135633221747012U, - (uint64_t)858420432114866U, (uint64_t)186358544306082U, (uint64_t)1044420411868480U, - (uint64_t)2080052304349321U, (uint64_t)557301814716724U, (uint64_t)1305130257814057U, - (uint64_t)2126012765451197U, (uint64_t)1441004402875101U, (uint64_t)353948968859203U, - (uint64_t)470765987164835U, (uint64_t)1507675957683570U, (uint64_t)1086650358745097U, - (uint64_t)1911913434398388U, (uint64_t)66086091117182U, (uint64_t)1137511952425971U, - (uint64_t)36958263512141U, (uint64_t)2193310025325256U, (uint64_t)1085191426269045U, - (uint64_t)1232148267909446U, (uint64_t)1449894406170117U, (uint64_t)1241416717139557U, - (uint64_t)1940876999212868U, (uint64_t)829758415918121U, (uint64_t)309608450373449U, - (uint64_t)2228398547683851U, (uint64_t)1580623271960188U, (uint64_t)1675601502456740U, - (uint64_t)1360363115493548U, (uint64_t)1098397313096815U, (uint64_t)1809255384359797U, - (uint64_t)1458261916834384U, (uint64_t)210682545649705U, (uint64_t)1606836641068115U, - (uint64_t)1230478270405318U, (uint64_t)1843192771547802U, (uint64_t)1794596343564051U, - (uint64_t)229060710252162U, (uint64_t)2169742775467181U, (uint64_t)701467067318072U, - (uint64_t)696018499035555U, (uint64_t)521051885339807U, (uint64_t)158329567901874U, - (uint64_t)740426481832143U, (uint64_t)1369811177301441U, (uint64_t)503351589084015U, - (uint64_t)1781114827942261U, (uint64_t)1650493549693035U, (uint64_t)2174562418345156U, - (uint64_t)456517194809244U, (uint64_t)2052761522121179U, (uint64_t)2233342271123682U, - (uint64_t)1445872925177435U, (uint64_t)1131882576902813U, (uint64_t)220765848055241U, - (uint64_t)1280259961403769U, (uint64_t)1581497080160712U, (uint64_t)1477441080108824U, - (uint64_t)218428165202767U, (uint64_t)1970598141278907U, (uint64_t)643366736173069U, - (uint64_t)2167909426804014U, (uint64_t)834993711408259U, (uint64_t)1922437166463212U, - (uint64_t)1900036281472252U, (uint64_t)513794844386304U, (uint64_t)1297904164900114U, - (uint64_t)1147626295373268U, (uint64_t)1910101606251299U, (uint64_t)182933838633381U, - (uint64_t)806229530787362U, (uint64_t)155511666433200U, (uint64_t)290522463375462U, - (uint64_t)534373523491751U, (uint64_t)1302938814480515U, (uint64_t)1664979184120445U, - (uint64_t)304235649499423U, (uint64_t)339284524318609U, (uint64_t)1881717946973483U, - (uint64_t)1670802286833842U, (uint64_t)2223637120675737U, (uint64_t)135818919485814U, - (uint64_t)1144856572842792U, (uint64_t)2234981613434386U, (uint64_t)963917024969826U, - (uint64_t)402275378284993U, (uint64_t)141532417412170U, (uint64_t)921537468739387U, - (uint64_t)963905069722607U, (uint64_t)1405442890733358U, (uint64_t)1567763927164655U, - (uint64_t)1664776329195930U, (uint64_t)2095924165508507U, (uint64_t)994243110271379U, - (uint64_t)1243925610609353U, (uint64_t)1029845815569727U, (uint64_t)1001968867985629U, - (uint64_t)170368934002484U, (uint64_t)1100906131583801U, (uint64_t)1825190326449569U, - (uint64_t)1462285121182096U, (uint64_t)1545240767016377U, (uint64_t)797859025652273U, - (uint64_t)1062758326657530U, (uint64_t)1125600735118266U, (uint64_t)739325756774527U, - (uint64_t)1420144485966996U, (uint64_t)1915492743426702U, (uint64_t)752968196344993U, - (uint64_t)882156396938351U, (uint64_t)1909097048763227U, (uint64_t)849058590685611U, - (uint64_t)840754951388500U, (uint64_t)1832926948808323U, (uint64_t)2023317100075297U, - (uint64_t)322382745442827U, (uint64_t)1569741341737601U, (uint64_t)1678986113194987U, - (uint64_t)757598994581938U, (uint64_t)29678659580705U, (uint64_t)1239680935977986U, - (uint64_t)1509239427168474U, (uint64_t)1055981929287006U, (uint64_t)1894085471158693U, - (uint64_t)916486225488490U, (uint64_t)642168890366120U, (uint64_t)300453362620010U, - (uint64_t)1858797242721481U, (uint64_t)2077989823177130U, (uint64_t)510228455273334U, - (uint64_t)1473284798689270U, (uint64_t)5173934574301U, (uint64_t)765285232030050U, - (uint64_t)1007154707631065U, (uint64_t)1862128712885972U, (uint64_t)168873464821340U, - (uint64_t)1967853269759318U, (uint64_t)1489896018263031U, (uint64_t)592451806166369U, - (uint64_t)1242298565603883U, (uint64_t)1838918921339058U, (uint64_t)697532763910695U, - (uint64_t)294335466239059U, (uint64_t)135687058387449U, (uint64_t)2133734403874176U, - (uint64_t)2121911143127699U, (uint64_t)20222476737364U, (uint64_t)1200824626476747U, - (uint64_t)1397731736540791U, (uint64_t)702378430231418U, (uint64_t)59059527640068U, - (uint64_t)460992547183981U, (uint64_t)1016125857842765U, (uint64_t)1273530839608957U, - (uint64_t)96724128829301U, (uint64_t)1313433042425233U, (uint64_t)3543822857227U, - (uint64_t)761975685357118U, (uint64_t)110417360745248U, (uint64_t)1079634164577663U, - (uint64_t)2044574510020457U, (uint64_t)338709058603120U, (uint64_t)94541336042799U, - (uint64_t)127963233585039U, (uint64_t)94427896272258U, (uint64_t)1143501979342182U, - (uint64_t)1217958006212230U, (uint64_t)2153887831492134U, (uint64_t)1519219513255575U, - (uint64_t)251793195454181U, (uint64_t)392517349345200U, (uint64_t)1507033011868881U, - (uint64_t)2208494254670752U, (uint64_t)1364389582694359U, (uint64_t)2214069430728063U, - (uint64_t)1272814257105752U, (uint64_t)741450148906352U, (uint64_t)1105776675555685U, - (uint64_t)824447222014984U, (uint64_t)528745219306376U, (uint64_t)589427609121575U, - (uint64_t)1501786838809155U, (uint64_t)379067373073147U, (uint64_t)184909476589356U, - (uint64_t)1346887560616185U, (uint64_t)1932023742314082U, (uint64_t)1633302311869264U, - (uint64_t)1685314821133069U, (uint64_t)1836610282047884U, (uint64_t)1595571594397150U, - (uint64_t)615441688872198U, (uint64_t)1926435616702564U, (uint64_t)235632180396480U, - (uint64_t)1051918343571810U, (uint64_t)2150570051687050U, (uint64_t)879198845408738U, - (uint64_t)1443966275205464U, (uint64_t)481362545245088U, (uint64_t)512807443532642U, - (uint64_t)641147578283480U, (uint64_t)1594276116945596U, (uint64_t)1844812743300602U, - (uint64_t)2044559316019485U, (uint64_t)202620777969020U, (uint64_t)852992984136302U, - (uint64_t)1500869642692910U, (uint64_t)1085216217052457U, (uint64_t)1736294372259758U, - (uint64_t)2009666354486552U, (uint64_t)1262389020715248U, (uint64_t)1166527705256867U, - (uint64_t)1409917450806036U, (uint64_t)1705819160057637U, (uint64_t)1116901782584378U, - (uint64_t)1278460472285473U, (uint64_t)257879811360157U, (uint64_t)40314007176886U, - (uint64_t)701309846749639U, (uint64_t)1380457676672777U, (uint64_t)631519782380272U, - (uint64_t)1196339573466793U, (uint64_t)955537708940017U, (uint64_t)532725633381530U, - (uint64_t)641190593731833U, (uint64_t)7214357153807U, (uint64_t)481922072107983U, - (uint64_t)1634886189207352U, (uint64_t)1247659758261633U, (uint64_t)1655809614786430U, - (uint64_t)43105797900223U, (uint64_t)76205809912607U, (uint64_t)1936575107455823U, - (uint64_t)1107927314642236U, (uint64_t)2199986333469333U, (uint64_t)802974829322510U, - (uint64_t)718173128143482U, (uint64_t)539385184235615U, (uint64_t)2075693785611221U, - (uint64_t)953281147333690U, (uint64_t)1623571637172587U, (uint64_t)655274535022250U, - (uint64_t)1568078078819021U, (uint64_t)101142125049712U, (uint64_t)1488441673350881U, - (uint64_t)1457969561944515U, (uint64_t)1492622544287712U, (uint64_t)2041460689280803U, - (uint64_t)1961848091392887U, (uint64_t)461003520846938U, (uint64_t)934728060399807U, - (uint64_t)117723291519705U, (uint64_t)1027773762863526U, (uint64_t)56765304991567U, - (uint64_t)2184028379550479U, (uint64_t)1768767711894030U, (uint64_t)1304432068983172U, - (uint64_t)498080974452325U, (uint64_t)2134905654858163U, (uint64_t)1446137427202647U, - (uint64_t)551613831549590U, (uint64_t)680288767054205U, (uint64_t)1278113339140386U, - (uint64_t)378149431842614U, (uint64_t)80520494426960U, (uint64_t)2080985256348782U, - (uint64_t)673432591799820U, (uint64_t)739189463724560U, (uint64_t)1847191452197509U, - (uint64_t)527737312871602U, (uint64_t)477609358840073U, (uint64_t)1891633072677946U, - (uint64_t)1841456828278466U, (uint64_t)2242502936489002U, (uint64_t)524791829362709U, - (uint64_t)276648168514036U, (uint64_t)991706903257619U, (uint64_t)512580228297906U, - (uint64_t)1216855104975946U, (uint64_t)67030930303149U, (uint64_t)769593945208213U, - (uint64_t)2048873385103577U, (uint64_t)455635274123107U, (uint64_t)2077404927176696U, - (uint64_t)1803539634652306U, (uint64_t)1837579953843417U, (uint64_t)1564240068662828U, - (uint64_t)1964310918970435U, (uint64_t)832822906252492U, (uint64_t)1516044634195010U, - (uint64_t)770571447506889U, (uint64_t)602215152486818U, (uint64_t)1760828333136947U, - (uint64_t)730156776030376U + 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, + 0ULL, 0ULL, 0ULL, 0ULL, 557549315715710ULL, 196756086293855ULL, 846062225082495ULL, + 1865068224838092ULL, 991112090754908ULL, 522916421512828ULL, 2098523346722375ULL, + 1135633221747012ULL, 858420432114866ULL, 186358544306082ULL, 1044420411868480ULL, + 2080052304349321ULL, 557301814716724ULL, 1305130257814057ULL, 2126012765451197ULL, + 1441004402875101ULL, 353948968859203ULL, 470765987164835ULL, 1507675957683570ULL, + 1086650358745097ULL, 1911913434398388ULL, 66086091117182ULL, 1137511952425971ULL, + 36958263512141ULL, 2193310025325256ULL, 1085191426269045ULL, 1232148267909446ULL, + 1449894406170117ULL, 1241416717139557ULL, 1940876999212868ULL, 829758415918121ULL, + 309608450373449ULL, 2228398547683851ULL, 1580623271960188ULL, 1675601502456740ULL, + 1360363115493548ULL, 1098397313096815ULL, 1809255384359797ULL, 1458261916834384ULL, + 210682545649705ULL, 1606836641068115ULL, 1230478270405318ULL, 1843192771547802ULL, + 1794596343564051ULL, 229060710252162ULL, 2169742775467181ULL, 701467067318072ULL, + 696018499035555ULL, 521051885339807ULL, 158329567901874ULL, 740426481832143ULL, + 1369811177301441ULL, 503351589084015ULL, 1781114827942261ULL, 1650493549693035ULL, + 2174562418345156ULL, 456517194809244ULL, 2052761522121179ULL, 2233342271123682ULL, + 1445872925177435ULL, 1131882576902813ULL, 220765848055241ULL, 1280259961403769ULL, + 1581497080160712ULL, 1477441080108824ULL, 218428165202767ULL, 1970598141278907ULL, + 643366736173069ULL, 2167909426804014ULL, 834993711408259ULL, 1922437166463212ULL, + 1900036281472252ULL, 513794844386304ULL, 1297904164900114ULL, 1147626295373268ULL, + 1910101606251299ULL, 182933838633381ULL, 806229530787362ULL, 155511666433200ULL, + 290522463375462ULL, 534373523491751ULL, 1302938814480515ULL, 1664979184120445ULL, + 304235649499423ULL, 339284524318609ULL, 1881717946973483ULL, 1670802286833842ULL, + 2223637120675737ULL, 135818919485814ULL, 1144856572842792ULL, 2234981613434386ULL, + 963917024969826ULL, 402275378284993ULL, 141532417412170ULL, 921537468739387ULL, + 963905069722607ULL, 1405442890733358ULL, 1567763927164655ULL, 1664776329195930ULL, + 2095924165508507ULL, 994243110271379ULL, 1243925610609353ULL, 1029845815569727ULL, + 1001968867985629ULL, 170368934002484ULL, 1100906131583801ULL, 1825190326449569ULL, + 1462285121182096ULL, 1545240767016377ULL, 797859025652273ULL, 1062758326657530ULL, + 1125600735118266ULL, 739325756774527ULL, 1420144485966996ULL, 1915492743426702ULL, + 752968196344993ULL, 882156396938351ULL, 1909097048763227ULL, 849058590685611ULL, + 840754951388500ULL, 1832926948808323ULL, 2023317100075297ULL, 322382745442827ULL, + 1569741341737601ULL, 1678986113194987ULL, 757598994581938ULL, 29678659580705ULL, + 1239680935977986ULL, 1509239427168474ULL, 1055981929287006ULL, 1894085471158693ULL, + 916486225488490ULL, 642168890366120ULL, 300453362620010ULL, 1858797242721481ULL, + 2077989823177130ULL, 510228455273334ULL, 1473284798689270ULL, 5173934574301ULL, + 765285232030050ULL, 1007154707631065ULL, 1862128712885972ULL, 168873464821340ULL, + 1967853269759318ULL, 1489896018263031ULL, 592451806166369ULL, 1242298565603883ULL, + 1838918921339058ULL, 697532763910695ULL, 294335466239059ULL, 135687058387449ULL, + 2133734403874176ULL, 2121911143127699ULL, 20222476737364ULL, 1200824626476747ULL, + 1397731736540791ULL, 702378430231418ULL, 59059527640068ULL, 460992547183981ULL, + 1016125857842765ULL, 1273530839608957ULL, 96724128829301ULL, 1313433042425233ULL, + 3543822857227ULL, 761975685357118ULL, 110417360745248ULL, 1079634164577663ULL, + 2044574510020457ULL, 338709058603120ULL, 94541336042799ULL, 127963233585039ULL, + 94427896272258ULL, 1143501979342182ULL, 1217958006212230ULL, 2153887831492134ULL, + 1519219513255575ULL, 251793195454181ULL, 392517349345200ULL, 1507033011868881ULL, + 2208494254670752ULL, 1364389582694359ULL, 2214069430728063ULL, 1272814257105752ULL, + 741450148906352ULL, 1105776675555685ULL, 824447222014984ULL, 528745219306376ULL, + 589427609121575ULL, 1501786838809155ULL, 379067373073147ULL, 184909476589356ULL, + 1346887560616185ULL, 1932023742314082ULL, 1633302311869264ULL, 1685314821133069ULL, + 1836610282047884ULL, 1595571594397150ULL, 615441688872198ULL, 1926435616702564ULL, + 235632180396480ULL, 1051918343571810ULL, 2150570051687050ULL, 879198845408738ULL, + 1443966275205464ULL, 481362545245088ULL, 512807443532642ULL, 641147578283480ULL, + 1594276116945596ULL, 1844812743300602ULL, 2044559316019485ULL, 202620777969020ULL, + 852992984136302ULL, 1500869642692910ULL, 1085216217052457ULL, 1736294372259758ULL, + 2009666354486552ULL, 1262389020715248ULL, 1166527705256867ULL, 1409917450806036ULL, + 1705819160057637ULL, 1116901782584378ULL, 1278460472285473ULL, 257879811360157ULL, + 40314007176886ULL, 701309846749639ULL, 1380457676672777ULL, 631519782380272ULL, + 1196339573466793ULL, 955537708940017ULL, 532725633381530ULL, 641190593731833ULL, + 7214357153807ULL, 481922072107983ULL, 1634886189207352ULL, 1247659758261633ULL, + 1655809614786430ULL, 43105797900223ULL, 76205809912607ULL, 1936575107455823ULL, + 1107927314642236ULL, 2199986333469333ULL, 802974829322510ULL, 718173128143482ULL, + 539385184235615ULL, 2075693785611221ULL, 953281147333690ULL, 1623571637172587ULL, + 655274535022250ULL, 1568078078819021ULL, 101142125049712ULL, 1488441673350881ULL, + 1457969561944515ULL, 1492622544287712ULL, 2041460689280803ULL, 1961848091392887ULL, + 461003520846938ULL, 934728060399807ULL, 117723291519705ULL, 1027773762863526ULL, + 56765304991567ULL, 2184028379550479ULL, 1768767711894030ULL, 1304432068983172ULL, + 498080974452325ULL, 2134905654858163ULL, 1446137427202647ULL, 551613831549590ULL, + 680288767054205ULL, 1278113339140386ULL, 378149431842614ULL, 80520494426960ULL, + 2080985256348782ULL, 673432591799820ULL, 739189463724560ULL, 1847191452197509ULL, + 527737312871602ULL, 477609358840073ULL, 1891633072677946ULL, 1841456828278466ULL, + 2242502936489002ULL, 524791829362709ULL, 276648168514036ULL, 991706903257619ULL, + 512580228297906ULL, 1216855104975946ULL, 67030930303149ULL, 769593945208213ULL, + 2048873385103577ULL, 455635274123107ULL, 2077404927176696ULL, 1803539634652306ULL, + 1837579953843417ULL, 1564240068662828ULL, 1964310918970435ULL, 832822906252492ULL, + 1516044634195010ULL, 770571447506889ULL, 602215152486818ULL, 1760828333136947ULL, + 730156776030376ULL }; static const uint64_t Hacl_Ed25519_PrecompTable_precomp_g_pow2_192_table_w4[320U] = { - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)1129953239743101U, (uint64_t)1240339163956160U, - (uint64_t)61002583352401U, (uint64_t)2017604552196030U, (uint64_t)1576867829229863U, - (uint64_t)1508654942849389U, (uint64_t)270111619664077U, (uint64_t)1253097517254054U, - (uint64_t)721798270973250U, (uint64_t)161923365415298U, (uint64_t)828530877526011U, - (uint64_t)1494851059386763U, (uint64_t)662034171193976U, (uint64_t)1315349646974670U, - (uint64_t)2199229517308806U, (uint64_t)497078277852673U, (uint64_t)1310507715989956U, - (uint64_t)1881315714002105U, (uint64_t)2214039404983803U, (uint64_t)1331036420272667U, - (uint64_t)296286697520787U, (uint64_t)1179367922639127U, (uint64_t)25348441419697U, - (uint64_t)2200984961703188U, (uint64_t)150893128908291U, (uint64_t)1978614888570852U, - (uint64_t)1539657347172046U, (uint64_t)553810196523619U, (uint64_t)246017573977646U, - (uint64_t)1440448985385485U, (uint64_t)346049108099981U, (uint64_t)601166606218546U, - (uint64_t)855822004151713U, (uint64_t)1957521326383188U, (uint64_t)1114240380430887U, - (uint64_t)1349639675122048U, (uint64_t)957375954499040U, (uint64_t)111551795360136U, - (uint64_t)618586733648988U, (uint64_t)490708840688866U, (uint64_t)1267002049697314U, - (uint64_t)1130723224930028U, (uint64_t)215603029480828U, (uint64_t)1277138555414710U, - (uint64_t)1556750324971322U, (uint64_t)1407903521793741U, (uint64_t)1836836546590749U, - (uint64_t)576500297444199U, (uint64_t)2074707599091135U, (uint64_t)1826239864380012U, - (uint64_t)1935365705983312U, (uint64_t)239501825683682U, (uint64_t)1594236669034980U, - (uint64_t)1283078975055301U, (uint64_t)856745636255925U, (uint64_t)1342128647959981U, - (uint64_t)945216428379689U, (uint64_t)938746202496410U, (uint64_t)105775123333919U, - (uint64_t)1379852610117266U, (uint64_t)1770216827500275U, (uint64_t)1016017267535704U, - (uint64_t)1902885522469532U, (uint64_t)994184703730489U, (uint64_t)2227487538793763U, - (uint64_t)53155967096055U, (uint64_t)1264120808114350U, (uint64_t)1334928769376729U, - (uint64_t)393911808079997U, (uint64_t)826229239481845U, (uint64_t)1827903006733192U, - (uint64_t)1449283706008465U, (uint64_t)1258040415217849U, (uint64_t)1641484112868370U, - (uint64_t)1140150841968176U, (uint64_t)391113338021313U, (uint64_t)162138667815833U, - (uint64_t)742204396566060U, (uint64_t)110709233440557U, (uint64_t)90179377432917U, - (uint64_t)530511949644489U, (uint64_t)911568635552279U, (uint64_t)135869304780166U, - (uint64_t)617719999563692U, (uint64_t)1802525001631319U, (uint64_t)1836394639510490U, - (uint64_t)1862739456475085U, (uint64_t)1378284444664288U, (uint64_t)1617882529391756U, - (uint64_t)876124429891172U, (uint64_t)1147654641445091U, (uint64_t)1476943370400542U, - (uint64_t)688601222759067U, (uint64_t)2120281968990205U, (uint64_t)1387113236912611U, - (uint64_t)2125245820685788U, (uint64_t)1030674016350092U, (uint64_t)1594684598654247U, - (uint64_t)1165939511879820U, (uint64_t)271499323244173U, (uint64_t)546587254515484U, - (uint64_t)945603425742936U, (uint64_t)1242252568170226U, (uint64_t)561598728058142U, - (uint64_t)604827091794712U, (uint64_t)19869753585186U, (uint64_t)565367744708915U, - (uint64_t)536755754533603U, (uint64_t)1767258313589487U, (uint64_t)907952975936127U, - (uint64_t)292851652613937U, (uint64_t)163573546237963U, (uint64_t)837601408384564U, - (uint64_t)591996990118301U, (uint64_t)2126051747693057U, (uint64_t)182247548824566U, - (uint64_t)908369044122868U, (uint64_t)1335442699947273U, (uint64_t)2234292296528612U, - (uint64_t)689537529333034U, (uint64_t)2174778663790714U, (uint64_t)1011407643592667U, - (uint64_t)1856130618715473U, (uint64_t)1557437221651741U, (uint64_t)2250285407006102U, - (uint64_t)1412384213410827U, (uint64_t)1428042038612456U, (uint64_t)962709733973660U, - (uint64_t)313995703125919U, (uint64_t)1844969155869325U, (uint64_t)787716782673657U, - (uint64_t)622504542173478U, (uint64_t)930119043384654U, (uint64_t)2128870043952488U, - (uint64_t)537781531479523U, (uint64_t)1556666269904940U, (uint64_t)417333635741346U, - (uint64_t)1986743846438415U, (uint64_t)877620478041197U, (uint64_t)2205624582983829U, - (uint64_t)595260668884488U, (uint64_t)2025159350373157U, (uint64_t)2091659716088235U, - (uint64_t)1423634716596391U, (uint64_t)653686638634080U, (uint64_t)1972388399989956U, - (uint64_t)795575741798014U, (uint64_t)889240107997846U, (uint64_t)1446156876910732U, - (uint64_t)1028507012221776U, (uint64_t)1071697574586478U, (uint64_t)1689630411899691U, - (uint64_t)604092816502174U, (uint64_t)1909917373896122U, (uint64_t)1602544877643837U, - (uint64_t)1227177032923867U, (uint64_t)62684197535630U, (uint64_t)186146290753883U, - (uint64_t)414449055316766U, (uint64_t)1560555880866750U, (uint64_t)157579947096755U, - (uint64_t)230526795502384U, (uint64_t)1197673369665894U, (uint64_t)593779215869037U, - (uint64_t)214638834474097U, (uint64_t)1796344443484478U, (uint64_t)493550548257317U, - (uint64_t)1628442824033694U, (uint64_t)1410811655893495U, (uint64_t)1009361960995171U, - (uint64_t)604736219740352U, (uint64_t)392445928555351U, (uint64_t)1254295770295706U, - (uint64_t)1958074535046128U, (uint64_t)508699942241019U, (uint64_t)739405911261325U, - (uint64_t)1678760393882409U, (uint64_t)517763708545996U, (uint64_t)640040257898722U, - (uint64_t)384966810872913U, (uint64_t)407454748380128U, (uint64_t)152604679407451U, - (uint64_t)185102854927662U, (uint64_t)1448175503649595U, (uint64_t)100328519208674U, - (uint64_t)1153263667012830U, (uint64_t)1643926437586490U, (uint64_t)609632142834154U, - (uint64_t)980984004749261U, (uint64_t)855290732258779U, (uint64_t)2186022163021506U, - (uint64_t)1254052618626070U, (uint64_t)1850030517182611U, (uint64_t)162348933090207U, - (uint64_t)1948712273679932U, (uint64_t)1331832516262191U, (uint64_t)1219400369175863U, - (uint64_t)89689036937483U, (uint64_t)1554886057235815U, (uint64_t)1520047528432789U, - (uint64_t)81263957652811U, (uint64_t)146612464257008U, (uint64_t)2207945627164163U, - (uint64_t)919846660682546U, (uint64_t)1925694087906686U, (uint64_t)2102027292388012U, - (uint64_t)887992003198635U, (uint64_t)1817924871537027U, (uint64_t)746660005584342U, - (uint64_t)753757153275525U, (uint64_t)91394270908699U, (uint64_t)511837226544151U, - (uint64_t)736341543649373U, (uint64_t)1256371121466367U, (uint64_t)1977778299551813U, - (uint64_t)817915174462263U, (uint64_t)1602323381418035U, (uint64_t)190035164572930U, - (uint64_t)603796401391181U, (uint64_t)2152666873671669U, (uint64_t)1813900316324112U, - (uint64_t)1292622433358041U, (uint64_t)888439870199892U, (uint64_t)978918155071994U, - (uint64_t)534184417909805U, (uint64_t)466460084317313U, (uint64_t)1275223140288685U, - (uint64_t)786407043883517U, (uint64_t)1620520623925754U, (uint64_t)1753625021290269U, - (uint64_t)751937175104525U, (uint64_t)905301961820613U, (uint64_t)697059847245437U, - (uint64_t)584919033981144U, (uint64_t)1272165506533156U, (uint64_t)1532180021450866U, - (uint64_t)1901407354005301U, (uint64_t)1421319720492586U, (uint64_t)2179081609765456U, - (uint64_t)2193253156667632U, (uint64_t)1080248329608584U, (uint64_t)2158422436462066U, - (uint64_t)759167597017850U, (uint64_t)545759071151285U, (uint64_t)641600428493698U, - (uint64_t)943791424499848U, (uint64_t)469571542427864U, (uint64_t)951117845222467U, - (uint64_t)1780538594373407U, (uint64_t)614611122040309U, (uint64_t)1354826131886963U, - (uint64_t)221898131992340U, (uint64_t)1145699723916219U, (uint64_t)798735379961769U, - (uint64_t)1843560518208287U, (uint64_t)1424523160161545U, (uint64_t)205549016574779U, - (uint64_t)2239491587362749U, (uint64_t)1918363582399888U, (uint64_t)1292183072788455U, - (uint64_t)1783513123192567U, (uint64_t)1584027954317205U, (uint64_t)1890421443925740U, - (uint64_t)1718459319874929U, (uint64_t)1522091040748809U, (uint64_t)399467600667219U, - (uint64_t)1870973059066576U, (uint64_t)287514433150348U, (uint64_t)1397845311152885U, - (uint64_t)1880440629872863U, (uint64_t)709302939340341U, (uint64_t)1813571361109209U, - (uint64_t)86598795876860U, (uint64_t)1146964554310612U, (uint64_t)1590956584862432U, - (uint64_t)2097004628155559U, (uint64_t)656227622102390U, (uint64_t)1808500445541891U, - (uint64_t)958336726523135U, (uint64_t)2007604569465975U, (uint64_t)313504950390997U, - (uint64_t)1399686004953620U, (uint64_t)1759732788465234U, (uint64_t)1562539721055836U, - (uint64_t)1575722765016293U, (uint64_t)793318366641259U, (uint64_t)443876859384887U, - (uint64_t)547308921989704U, (uint64_t)636698687503328U, (uint64_t)2179175835287340U, - (uint64_t)498333551718258U, (uint64_t)932248760026176U, (uint64_t)1612395686304653U, - (uint64_t)2179774103745626U, (uint64_t)1359658123541018U, (uint64_t)171488501802442U, - (uint64_t)1625034951791350U, (uint64_t)520196922773633U, (uint64_t)1873787546341877U, - (uint64_t)303457823885368U + 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, + 0ULL, 0ULL, 0ULL, 0ULL, 1129953239743101ULL, 1240339163956160ULL, 61002583352401ULL, + 2017604552196030ULL, 1576867829229863ULL, 1508654942849389ULL, 270111619664077ULL, + 1253097517254054ULL, 721798270973250ULL, 161923365415298ULL, 828530877526011ULL, + 1494851059386763ULL, 662034171193976ULL, 1315349646974670ULL, 2199229517308806ULL, + 497078277852673ULL, 1310507715989956ULL, 1881315714002105ULL, 2214039404983803ULL, + 1331036420272667ULL, 296286697520787ULL, 1179367922639127ULL, 25348441419697ULL, + 2200984961703188ULL, 150893128908291ULL, 1978614888570852ULL, 1539657347172046ULL, + 553810196523619ULL, 246017573977646ULL, 1440448985385485ULL, 346049108099981ULL, + 601166606218546ULL, 855822004151713ULL, 1957521326383188ULL, 1114240380430887ULL, + 1349639675122048ULL, 957375954499040ULL, 111551795360136ULL, 618586733648988ULL, + 490708840688866ULL, 1267002049697314ULL, 1130723224930028ULL, 215603029480828ULL, + 1277138555414710ULL, 1556750324971322ULL, 1407903521793741ULL, 1836836546590749ULL, + 576500297444199ULL, 2074707599091135ULL, 1826239864380012ULL, 1935365705983312ULL, + 239501825683682ULL, 1594236669034980ULL, 1283078975055301ULL, 856745636255925ULL, + 1342128647959981ULL, 945216428379689ULL, 938746202496410ULL, 105775123333919ULL, + 1379852610117266ULL, 1770216827500275ULL, 1016017267535704ULL, 1902885522469532ULL, + 994184703730489ULL, 2227487538793763ULL, 53155967096055ULL, 1264120808114350ULL, + 1334928769376729ULL, 393911808079997ULL, 826229239481845ULL, 1827903006733192ULL, + 1449283706008465ULL, 1258040415217849ULL, 1641484112868370ULL, 1140150841968176ULL, + 391113338021313ULL, 162138667815833ULL, 742204396566060ULL, 110709233440557ULL, + 90179377432917ULL, 530511949644489ULL, 911568635552279ULL, 135869304780166ULL, + 617719999563692ULL, 1802525001631319ULL, 1836394639510490ULL, 1862739456475085ULL, + 1378284444664288ULL, 1617882529391756ULL, 876124429891172ULL, 1147654641445091ULL, + 1476943370400542ULL, 688601222759067ULL, 2120281968990205ULL, 1387113236912611ULL, + 2125245820685788ULL, 1030674016350092ULL, 1594684598654247ULL, 1165939511879820ULL, + 271499323244173ULL, 546587254515484ULL, 945603425742936ULL, 1242252568170226ULL, + 561598728058142ULL, 604827091794712ULL, 19869753585186ULL, 565367744708915ULL, + 536755754533603ULL, 1767258313589487ULL, 907952975936127ULL, 292851652613937ULL, + 163573546237963ULL, 837601408384564ULL, 591996990118301ULL, 2126051747693057ULL, + 182247548824566ULL, 908369044122868ULL, 1335442699947273ULL, 2234292296528612ULL, + 689537529333034ULL, 2174778663790714ULL, 1011407643592667ULL, 1856130618715473ULL, + 1557437221651741ULL, 2250285407006102ULL, 1412384213410827ULL, 1428042038612456ULL, + 962709733973660ULL, 313995703125919ULL, 1844969155869325ULL, 787716782673657ULL, + 622504542173478ULL, 930119043384654ULL, 2128870043952488ULL, 537781531479523ULL, + 1556666269904940ULL, 417333635741346ULL, 1986743846438415ULL, 877620478041197ULL, + 2205624582983829ULL, 595260668884488ULL, 2025159350373157ULL, 2091659716088235ULL, + 1423634716596391ULL, 653686638634080ULL, 1972388399989956ULL, 795575741798014ULL, + 889240107997846ULL, 1446156876910732ULL, 1028507012221776ULL, 1071697574586478ULL, + 1689630411899691ULL, 604092816502174ULL, 1909917373896122ULL, 1602544877643837ULL, + 1227177032923867ULL, 62684197535630ULL, 186146290753883ULL, 414449055316766ULL, + 1560555880866750ULL, 157579947096755ULL, 230526795502384ULL, 1197673369665894ULL, + 593779215869037ULL, 214638834474097ULL, 1796344443484478ULL, 493550548257317ULL, + 1628442824033694ULL, 1410811655893495ULL, 1009361960995171ULL, 604736219740352ULL, + 392445928555351ULL, 1254295770295706ULL, 1958074535046128ULL, 508699942241019ULL, + 739405911261325ULL, 1678760393882409ULL, 517763708545996ULL, 640040257898722ULL, + 384966810872913ULL, 407454748380128ULL, 152604679407451ULL, 185102854927662ULL, + 1448175503649595ULL, 100328519208674ULL, 1153263667012830ULL, 1643926437586490ULL, + 609632142834154ULL, 980984004749261ULL, 855290732258779ULL, 2186022163021506ULL, + 1254052618626070ULL, 1850030517182611ULL, 162348933090207ULL, 1948712273679932ULL, + 1331832516262191ULL, 1219400369175863ULL, 89689036937483ULL, 1554886057235815ULL, + 1520047528432789ULL, 81263957652811ULL, 146612464257008ULL, 2207945627164163ULL, + 919846660682546ULL, 1925694087906686ULL, 2102027292388012ULL, 887992003198635ULL, + 1817924871537027ULL, 746660005584342ULL, 753757153275525ULL, 91394270908699ULL, + 511837226544151ULL, 736341543649373ULL, 1256371121466367ULL, 1977778299551813ULL, + 817915174462263ULL, 1602323381418035ULL, 190035164572930ULL, 603796401391181ULL, + 2152666873671669ULL, 1813900316324112ULL, 1292622433358041ULL, 888439870199892ULL, + 978918155071994ULL, 534184417909805ULL, 466460084317313ULL, 1275223140288685ULL, + 786407043883517ULL, 1620520623925754ULL, 1753625021290269ULL, 751937175104525ULL, + 905301961820613ULL, 697059847245437ULL, 584919033981144ULL, 1272165506533156ULL, + 1532180021450866ULL, 1901407354005301ULL, 1421319720492586ULL, 2179081609765456ULL, + 2193253156667632ULL, 1080248329608584ULL, 2158422436462066ULL, 759167597017850ULL, + 545759071151285ULL, 641600428493698ULL, 943791424499848ULL, 469571542427864ULL, + 951117845222467ULL, 1780538594373407ULL, 614611122040309ULL, 1354826131886963ULL, + 221898131992340ULL, 1145699723916219ULL, 798735379961769ULL, 1843560518208287ULL, + 1424523160161545ULL, 205549016574779ULL, 2239491587362749ULL, 1918363582399888ULL, + 1292183072788455ULL, 1783513123192567ULL, 1584027954317205ULL, 1890421443925740ULL, + 1718459319874929ULL, 1522091040748809ULL, 399467600667219ULL, 1870973059066576ULL, + 287514433150348ULL, 1397845311152885ULL, 1880440629872863ULL, 709302939340341ULL, + 1813571361109209ULL, 86598795876860ULL, 1146964554310612ULL, 1590956584862432ULL, + 2097004628155559ULL, 656227622102390ULL, 1808500445541891ULL, 958336726523135ULL, + 2007604569465975ULL, 313504950390997ULL, 1399686004953620ULL, 1759732788465234ULL, + 1562539721055836ULL, 1575722765016293ULL, 793318366641259ULL, 443876859384887ULL, + 547308921989704ULL, 636698687503328ULL, 2179175835287340ULL, 498333551718258ULL, + 932248760026176ULL, 1612395686304653ULL, 2179774103745626ULL, 1359658123541018ULL, + 171488501802442ULL, 1625034951791350ULL, 520196922773633ULL, 1873787546341877ULL, + 303457823885368ULL }; static const uint64_t Hacl_Ed25519_PrecompTable_precomp_basepoint_table_w5[640U] = { - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)1738742601995546U, (uint64_t)1146398526822698U, - (uint64_t)2070867633025821U, (uint64_t)562264141797630U, (uint64_t)587772402128613U, - (uint64_t)1801439850948184U, (uint64_t)1351079888211148U, (uint64_t)450359962737049U, - (uint64_t)900719925474099U, (uint64_t)1801439850948198U, (uint64_t)1U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1841354044333475U, - (uint64_t)16398895984059U, (uint64_t)755974180946558U, (uint64_t)900171276175154U, - (uint64_t)1821297809914039U, (uint64_t)1661154287933054U, (uint64_t)284530020860578U, - (uint64_t)1390261174866914U, (uint64_t)1524110943907984U, (uint64_t)1045603498418422U, - (uint64_t)928651508580478U, (uint64_t)1383326941296346U, (uint64_t)961937908925785U, - (uint64_t)80455759693706U, (uint64_t)904734540352947U, (uint64_t)1507481815385608U, - (uint64_t)2223447444246085U, (uint64_t)1083941587175919U, (uint64_t)2059929906842505U, - (uint64_t)1581435440146976U, (uint64_t)782730187692425U, (uint64_t)9928394897574U, - (uint64_t)1539449519985236U, (uint64_t)1923587931078510U, (uint64_t)552919286076056U, - (uint64_t)376925408065760U, (uint64_t)447320488831784U, (uint64_t)1362918338468019U, - (uint64_t)1470031896696846U, (uint64_t)2189796996539902U, (uint64_t)1337552949959847U, - (uint64_t)1762287177775726U, (uint64_t)237994495816815U, (uint64_t)1277840395970544U, - (uint64_t)543972849007241U, (uint64_t)1224692671618814U, (uint64_t)162359533289271U, - (uint64_t)282240927125249U, (uint64_t)586909166382289U, (uint64_t)17726488197838U, - (uint64_t)377014554985659U, (uint64_t)1433835303052512U, (uint64_t)702061469493692U, - (uint64_t)1142253108318154U, (uint64_t)318297794307551U, (uint64_t)954362646308543U, - (uint64_t)517363881452320U, (uint64_t)1868013482130416U, (uint64_t)262562472373260U, - (uint64_t)902232853249919U, (uint64_t)2107343057055746U, (uint64_t)462368348619024U, - (uint64_t)1893758677092974U, (uint64_t)2177729767846389U, (uint64_t)2168532543559143U, - (uint64_t)443867094639821U, (uint64_t)730169342581022U, (uint64_t)1564589016879755U, - (uint64_t)51218195700649U, (uint64_t)76684578423745U, (uint64_t)560266272480743U, - (uint64_t)922517457707697U, (uint64_t)2066645939860874U, (uint64_t)1318277348414638U, - (uint64_t)1576726809084003U, (uint64_t)1817337608563665U, (uint64_t)1874240939237666U, - (uint64_t)754733726333910U, (uint64_t)97085310406474U, (uint64_t)751148364309235U, - (uint64_t)1622159695715187U, (uint64_t)1444098819684916U, (uint64_t)130920805558089U, - (uint64_t)1260449179085308U, (uint64_t)1860021740768461U, (uint64_t)110052860348509U, - (uint64_t)193830891643810U, (uint64_t)164148413933881U, (uint64_t)180017794795332U, - (uint64_t)1523506525254651U, (uint64_t)465981629225956U, (uint64_t)559733514964572U, - (uint64_t)1279624874416974U, (uint64_t)2026642326892306U, (uint64_t)1425156829982409U, - (uint64_t)2160936383793147U, (uint64_t)1061870624975247U, (uint64_t)2023497043036941U, - (uint64_t)117942212883190U, (uint64_t)490339622800774U, (uint64_t)1729931303146295U, - (uint64_t)422305932971074U, (uint64_t)529103152793096U, (uint64_t)1211973233775992U, - (uint64_t)721364955929681U, (uint64_t)1497674430438813U, (uint64_t)342545521275073U, - (uint64_t)2102107575279372U, (uint64_t)2108462244669966U, (uint64_t)1382582406064082U, - (uint64_t)2206396818383323U, (uint64_t)2109093268641147U, (uint64_t)10809845110983U, - (uint64_t)1605176920880099U, (uint64_t)744640650753946U, (uint64_t)1712758897518129U, - (uint64_t)373410811281809U, (uint64_t)648838265800209U, (uint64_t)813058095530999U, - (uint64_t)513987632620169U, (uint64_t)465516160703329U, (uint64_t)2136322186126330U, - (uint64_t)1979645899422932U, (uint64_t)1197131006470786U, (uint64_t)1467836664863979U, - (uint64_t)1340751381374628U, (uint64_t)1810066212667962U, (uint64_t)1009933588225499U, - (uint64_t)1106129188080873U, (uint64_t)1388980405213901U, (uint64_t)533719246598044U, - (uint64_t)1169435803073277U, (uint64_t)198920999285821U, (uint64_t)487492330629854U, - (uint64_t)1807093008537778U, (uint64_t)1540899012923865U, (uint64_t)2075080271659867U, - (uint64_t)1527990806921523U, (uint64_t)1323728742908002U, (uint64_t)1568595959608205U, - (uint64_t)1388032187497212U, (uint64_t)2026968840050568U, (uint64_t)1396591153295755U, - (uint64_t)820416950170901U, (uint64_t)520060313205582U, (uint64_t)2016404325094901U, - (uint64_t)1584709677868520U, (uint64_t)272161374469956U, (uint64_t)1567188603996816U, - (uint64_t)1986160530078221U, (uint64_t)553930264324589U, (uint64_t)1058426729027503U, - (uint64_t)8762762886675U, (uint64_t)2216098143382988U, (uint64_t)1835145266889223U, - (uint64_t)1712936431558441U, (uint64_t)1017009937844974U, (uint64_t)585361667812740U, - (uint64_t)2114711541628181U, (uint64_t)2238729632971439U, (uint64_t)121257546253072U, - (uint64_t)847154149018345U, (uint64_t)211972965476684U, (uint64_t)287499084460129U, - (uint64_t)2098247259180197U, (uint64_t)839070411583329U, (uint64_t)339551619574372U, - (uint64_t)1432951287640743U, (uint64_t)526481249498942U, (uint64_t)931991661905195U, - (uint64_t)1884279965674487U, (uint64_t)200486405604411U, (uint64_t)364173020594788U, - (uint64_t)518034455936955U, (uint64_t)1085564703965501U, (uint64_t)16030410467927U, - (uint64_t)604865933167613U, (uint64_t)1695298441093964U, (uint64_t)498856548116159U, - (uint64_t)2193030062787034U, (uint64_t)1706339802964179U, (uint64_t)1721199073493888U, - (uint64_t)820740951039755U, (uint64_t)1216053436896834U, (uint64_t)23954895815139U, - (uint64_t)1662515208920491U, (uint64_t)1705443427511899U, (uint64_t)1957928899570365U, - (uint64_t)1189636258255725U, (uint64_t)1795695471103809U, (uint64_t)1691191297654118U, - (uint64_t)282402585374360U, (uint64_t)460405330264832U, (uint64_t)63765529445733U, - (uint64_t)469763447404473U, (uint64_t)733607089694996U, (uint64_t)685410420186959U, - (uint64_t)1096682630419738U, (uint64_t)1162548510542362U, (uint64_t)1020949526456676U, - (uint64_t)1211660396870573U, (uint64_t)613126398222696U, (uint64_t)1117829165843251U, - (uint64_t)742432540886650U, (uint64_t)1483755088010658U, (uint64_t)942392007134474U, - (uint64_t)1447834130944107U, (uint64_t)489368274863410U, (uint64_t)23192985544898U, - (uint64_t)648442406146160U, (uint64_t)785438843373876U, (uint64_t)249464684645238U, - (uint64_t)170494608205618U, (uint64_t)335112827260550U, (uint64_t)1462050123162735U, - (uint64_t)1084803668439016U, (uint64_t)853459233600325U, (uint64_t)215777728187495U, - (uint64_t)1965759433526974U, (uint64_t)1349482894446537U, (uint64_t)694163317612871U, - (uint64_t)860536766165036U, (uint64_t)1178788094084321U, (uint64_t)1652739626626996U, - (uint64_t)2115723946388185U, (uint64_t)1577204379094664U, (uint64_t)1083882859023240U, - (uint64_t)1768759143381635U, (uint64_t)1737180992507258U, (uint64_t)246054513922239U, - (uint64_t)577253134087234U, (uint64_t)356340280578042U, (uint64_t)1638917769925142U, - (uint64_t)223550348130103U, (uint64_t)470592666638765U, (uint64_t)22663573966996U, - (uint64_t)596552461152400U, (uint64_t)364143537069499U, (uint64_t)3942119457699U, - (uint64_t)107951982889287U, (uint64_t)1843471406713209U, (uint64_t)1625773041610986U, - (uint64_t)1466141092501702U, (uint64_t)1043024095021271U, (uint64_t)310429964047508U, - (uint64_t)98559121500372U, (uint64_t)152746933782868U, (uint64_t)259407205078261U, - (uint64_t)828123093322585U, (uint64_t)1576847274280091U, (uint64_t)1170871375757302U, - (uint64_t)1588856194642775U, (uint64_t)984767822341977U, (uint64_t)1141497997993760U, - (uint64_t)809325345150796U, (uint64_t)1879837728202511U, (uint64_t)201340910657893U, - (uint64_t)1079157558888483U, (uint64_t)1052373448588065U, (uint64_t)1732036202501778U, - (uint64_t)2105292670328445U, (uint64_t)679751387312402U, (uint64_t)1679682144926229U, - (uint64_t)1695823455818780U, (uint64_t)498852317075849U, (uint64_t)1786555067788433U, - (uint64_t)1670727545779425U, (uint64_t)117945875433544U, (uint64_t)407939139781844U, - (uint64_t)854632120023778U, (uint64_t)1413383148360437U, (uint64_t)286030901733673U, - (uint64_t)1207361858071196U, (uint64_t)461340408181417U, (uint64_t)1096919590360164U, - (uint64_t)1837594897475685U, (uint64_t)533755561544165U, (uint64_t)1638688042247712U, - (uint64_t)1431653684793005U, (uint64_t)1036458538873559U, (uint64_t)390822120341779U, - (uint64_t)1920929837111618U, (uint64_t)543426740024168U, (uint64_t)645751357799929U, - (uint64_t)2245025632994463U, (uint64_t)1550778638076452U, (uint64_t)223738153459949U, - (uint64_t)1337209385492033U, (uint64_t)1276967236456531U, (uint64_t)1463815821063071U, - (uint64_t)2070620870191473U, (uint64_t)1199170709413753U, (uint64_t)273230877394166U, - (uint64_t)1873264887608046U, (uint64_t)890877152910775U, (uint64_t)983226445635730U, - (uint64_t)44873798519521U, (uint64_t)697147127512130U, (uint64_t)961631038239304U, - (uint64_t)709966160696826U, (uint64_t)1706677689540366U, (uint64_t)502782733796035U, - (uint64_t)812545535346033U, (uint64_t)1693622521296452U, (uint64_t)1955813093002510U, - (uint64_t)1259937612881362U, (uint64_t)1873032503803559U, (uint64_t)1140330566016428U, - (uint64_t)1675726082440190U, (uint64_t)60029928909786U, (uint64_t)170335608866763U, - (uint64_t)766444312315022U, (uint64_t)2025049511434113U, (uint64_t)2200845622430647U, - (uint64_t)1201269851450408U, (uint64_t)590071752404907U, (uint64_t)1400995030286946U, - (uint64_t)2152637413853822U, (uint64_t)2108495473841983U, (uint64_t)3855406710349U, - (uint64_t)1726137673168580U, (uint64_t)51004317200100U, (uint64_t)1749082328586939U, - (uint64_t)1704088976144558U, (uint64_t)1977318954775118U, (uint64_t)2062602253162400U, - (uint64_t)948062503217479U, (uint64_t)361953965048030U, (uint64_t)1528264887238440U, - (uint64_t)62582552172290U, (uint64_t)2241602163389280U, (uint64_t)156385388121765U, - (uint64_t)2124100319761492U, (uint64_t)388928050571382U, (uint64_t)1556123596922727U, - (uint64_t)979310669812384U, (uint64_t)113043855206104U, (uint64_t)2023223924825469U, - (uint64_t)643651703263034U, (uint64_t)2234446903655540U, (uint64_t)1577241261424997U, - (uint64_t)860253174523845U, (uint64_t)1691026473082448U, (uint64_t)1091672764933872U, - (uint64_t)1957463109756365U, (uint64_t)530699502660193U, (uint64_t)349587141723569U, - (uint64_t)674661681919563U, (uint64_t)1633727303856240U, (uint64_t)708909037922144U, - (uint64_t)2160722508518119U, (uint64_t)1302188051602540U, (uint64_t)976114603845777U, - (uint64_t)120004758721939U, (uint64_t)1681630708873780U, (uint64_t)622274095069244U, - (uint64_t)1822346309016698U, (uint64_t)1100921177951904U, (uint64_t)2216952659181677U, - (uint64_t)1844020550362490U, (uint64_t)1976451368365774U, (uint64_t)1321101422068822U, - (uint64_t)1189859436282668U, (uint64_t)2008801879735257U, (uint64_t)2219413454333565U, - (uint64_t)424288774231098U, (uint64_t)359793146977912U, (uint64_t)270293357948703U, - (uint64_t)587226003677000U, (uint64_t)1482071926139945U, (uint64_t)1419630774650359U, - (uint64_t)1104739070570175U, (uint64_t)1662129023224130U, (uint64_t)1609203612533411U, - (uint64_t)1250932720691980U, (uint64_t)95215711818495U, (uint64_t)498746909028150U, - (uint64_t)158151296991874U, (uint64_t)1201379988527734U, (uint64_t)561599945143989U, - (uint64_t)2211577425617888U, (uint64_t)2166577612206324U, (uint64_t)1057590354233512U, - (uint64_t)1968123280416769U, (uint64_t)1316586165401313U, (uint64_t)762728164447634U, - (uint64_t)2045395244316047U, (uint64_t)1531796898725716U, (uint64_t)315385971670425U, - (uint64_t)1109421039396756U, (uint64_t)2183635256408562U, (uint64_t)1896751252659461U, - (uint64_t)840236037179080U, (uint64_t)796245792277211U, (uint64_t)508345890111193U, - (uint64_t)1275386465287222U, (uint64_t)513560822858784U, (uint64_t)1784735733120313U, - (uint64_t)1346467478899695U, (uint64_t)601125231208417U, (uint64_t)701076661112726U, - (uint64_t)1841998436455089U, (uint64_t)1156768600940434U, (uint64_t)1967853462343221U, - (uint64_t)2178318463061452U, (uint64_t)481885520752741U, (uint64_t)675262828640945U, - (uint64_t)1033539418596582U, (uint64_t)1743329872635846U, (uint64_t)159322641251283U, - (uint64_t)1573076470127113U, (uint64_t)954827619308195U, (uint64_t)778834750662635U, - (uint64_t)619912782122617U, (uint64_t)515681498488209U, (uint64_t)1675866144246843U, - (uint64_t)811716020969981U, (uint64_t)1125515272217398U, (uint64_t)1398917918287342U, - (uint64_t)1301680949183175U, (uint64_t)726474739583734U, (uint64_t)587246193475200U, - (uint64_t)1096581582611864U, (uint64_t)1469911826213486U, (uint64_t)1990099711206364U, - (uint64_t)1256496099816508U, (uint64_t)2019924615195672U, (uint64_t)1251232456707555U, - (uint64_t)2042971196009755U, (uint64_t)214061878479265U, (uint64_t)115385726395472U, - (uint64_t)1677875239524132U, (uint64_t)756888883383540U, (uint64_t)1153862117756233U, - (uint64_t)503391530851096U, (uint64_t)946070017477513U, (uint64_t)1878319040542579U, - (uint64_t)1101349418586920U, (uint64_t)793245696431613U, (uint64_t)397920495357645U, - (uint64_t)2174023872951112U, (uint64_t)1517867915189593U, (uint64_t)1829855041462995U, - (uint64_t)1046709983503619U, (uint64_t)424081940711857U, (uint64_t)2112438073094647U, - (uint64_t)1504338467349861U, (uint64_t)2244574127374532U, (uint64_t)2136937537441911U, - (uint64_t)1741150838990304U, (uint64_t)25894628400571U, (uint64_t)512213526781178U, - (uint64_t)1168384260796379U, (uint64_t)1424607682379833U, (uint64_t)938677789731564U, - (uint64_t)872882241891896U, (uint64_t)1713199397007700U, (uint64_t)1410496326218359U, - (uint64_t)854379752407031U, (uint64_t)465141611727634U, (uint64_t)315176937037857U, - (uint64_t)1020115054571233U, (uint64_t)1856290111077229U, (uint64_t)2028366269898204U, - (uint64_t)1432980880307543U, (uint64_t)469932710425448U, (uint64_t)581165267592247U, - (uint64_t)496399148156603U, (uint64_t)2063435226705903U, (uint64_t)2116841086237705U, - (uint64_t)498272567217048U, (uint64_t)1829438076967906U, (uint64_t)1573925801278491U, - (uint64_t)460763576329867U, (uint64_t)1705264723728225U, (uint64_t)999514866082412U, - (uint64_t)29635061779362U, (uint64_t)1884233592281020U, (uint64_t)1449755591461338U, - (uint64_t)42579292783222U, (uint64_t)1869504355369200U, (uint64_t)495506004805251U, - (uint64_t)264073104888427U, (uint64_t)2088880861028612U, (uint64_t)104646456386576U, - (uint64_t)1258445191399967U, (uint64_t)1348736801545799U, (uint64_t)2068276361286613U, - (uint64_t)884897216646374U, (uint64_t)922387476801376U, (uint64_t)1043886580402805U, - (uint64_t)1240883498470831U, (uint64_t)1601554651937110U, (uint64_t)804382935289482U, - (uint64_t)512379564477239U, (uint64_t)1466384519077032U, (uint64_t)1280698500238386U, - (uint64_t)211303836685749U, (uint64_t)2081725624793803U, (uint64_t)545247644516879U, - (uint64_t)215313359330384U, (uint64_t)286479751145614U, (uint64_t)2213650281751636U, - (uint64_t)2164927945999874U, (uint64_t)2072162991540882U, (uint64_t)1443769115444779U, - (uint64_t)1581473274363095U, (uint64_t)434633875922699U, (uint64_t)340456055781599U, - (uint64_t)373043091080189U, (uint64_t)839476566531776U, (uint64_t)1856706858509978U, - (uint64_t)931616224909153U, (uint64_t)1888181317414065U, (uint64_t)213654322650262U, - (uint64_t)1161078103416244U, (uint64_t)1822042328851513U, (uint64_t)915817709028812U, - (uint64_t)1828297056698188U, (uint64_t)1212017130909403U, (uint64_t)60258343247333U, - (uint64_t)342085800008230U, (uint64_t)930240559508270U, (uint64_t)1549884999174952U, - (uint64_t)809895264249462U, (uint64_t)184726257947682U, (uint64_t)1157065433504828U, - (uint64_t)1209999630381477U, (uint64_t)999920399374391U, (uint64_t)1714770150788163U, - (uint64_t)2026130985413228U, (uint64_t)506776632883140U, (uint64_t)1349042668246528U, - (uint64_t)1937232292976967U, (uint64_t)942302637530730U, (uint64_t)160211904766226U, - (uint64_t)1042724500438571U, (uint64_t)212454865139142U, (uint64_t)244104425172642U, - (uint64_t)1376990622387496U, (uint64_t)76126752421227U, (uint64_t)1027540886376422U, - (uint64_t)1912210655133026U, (uint64_t)13410411589575U, (uint64_t)1475856708587773U, - (uint64_t)615563352691682U, (uint64_t)1446629324872644U, (uint64_t)1683670301784014U, - (uint64_t)1049873327197127U, (uint64_t)1826401704084838U, (uint64_t)2032577048760775U, - (uint64_t)1922203607878853U, (uint64_t)836708788764806U, (uint64_t)2193084654695012U, - (uint64_t)1342923183256659U, (uint64_t)849356986294271U, (uint64_t)1228863973965618U, - (uint64_t)94886161081867U, (uint64_t)1423288430204892U, (uint64_t)2016167528707016U, - (uint64_t)1633187660972877U, (uint64_t)1550621242301752U, (uint64_t)340630244512994U, - (uint64_t)2103577710806901U, (uint64_t)221625016538931U, (uint64_t)421544147350960U, - (uint64_t)580428704555156U, (uint64_t)1479831381265617U, (uint64_t)518057926544698U, - (uint64_t)955027348790630U, (uint64_t)1326749172561598U, (uint64_t)1118304625755967U, - (uint64_t)1994005916095176U, (uint64_t)1799757332780663U, (uint64_t)751343129396941U, - (uint64_t)1468672898746144U, (uint64_t)1451689964451386U, (uint64_t)755070293921171U, - (uint64_t)904857405877052U, (uint64_t)1276087530766984U, (uint64_t)403986562858511U, - (uint64_t)1530661255035337U, (uint64_t)1644972908910502U, (uint64_t)1370170080438957U, - (uint64_t)139839536695744U, (uint64_t)909930462436512U, (uint64_t)1899999215356933U, - (uint64_t)635992381064566U, (uint64_t)788740975837654U, (uint64_t)224241231493695U, - (uint64_t)1267090030199302U, (uint64_t)998908061660139U, (uint64_t)1784537499699278U, - (uint64_t)859195370018706U, (uint64_t)1953966091439379U, (uint64_t)2189271820076010U, - (uint64_t)2039067059943978U, (uint64_t)1526694380855202U, (uint64_t)2040321513194941U, - (uint64_t)329922071218689U, (uint64_t)1953032256401326U, (uint64_t)989631424403521U, - (uint64_t)328825014934242U, (uint64_t)9407151397696U, (uint64_t)63551373671268U, - (uint64_t)1624728632895792U, (uint64_t)1608324920739262U, (uint64_t)1178239350351945U, - (uint64_t)1198077399579702U, (uint64_t)277620088676229U, (uint64_t)1775359437312528U, - (uint64_t)1653558177737477U, (uint64_t)1652066043408850U, (uint64_t)1063359889686622U, - (uint64_t)1975063804860653U + 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, + 0ULL, 0ULL, 0ULL, 0ULL, 1738742601995546ULL, 1146398526822698ULL, 2070867633025821ULL, + 562264141797630ULL, 587772402128613ULL, 1801439850948184ULL, 1351079888211148ULL, + 450359962737049ULL, 900719925474099ULL, 1801439850948198ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, + 1841354044333475ULL, 16398895984059ULL, 755974180946558ULL, 900171276175154ULL, + 1821297809914039ULL, 1661154287933054ULL, 284530020860578ULL, 1390261174866914ULL, + 1524110943907984ULL, 1045603498418422ULL, 928651508580478ULL, 1383326941296346ULL, + 961937908925785ULL, 80455759693706ULL, 904734540352947ULL, 1507481815385608ULL, + 2223447444246085ULL, 1083941587175919ULL, 2059929906842505ULL, 1581435440146976ULL, + 782730187692425ULL, 9928394897574ULL, 1539449519985236ULL, 1923587931078510ULL, + 552919286076056ULL, 376925408065760ULL, 447320488831784ULL, 1362918338468019ULL, + 1470031896696846ULL, 2189796996539902ULL, 1337552949959847ULL, 1762287177775726ULL, + 237994495816815ULL, 1277840395970544ULL, 543972849007241ULL, 1224692671618814ULL, + 162359533289271ULL, 282240927125249ULL, 586909166382289ULL, 17726488197838ULL, + 377014554985659ULL, 1433835303052512ULL, 702061469493692ULL, 1142253108318154ULL, + 318297794307551ULL, 954362646308543ULL, 517363881452320ULL, 1868013482130416ULL, + 262562472373260ULL, 902232853249919ULL, 2107343057055746ULL, 462368348619024ULL, + 1893758677092974ULL, 2177729767846389ULL, 2168532543559143ULL, 443867094639821ULL, + 730169342581022ULL, 1564589016879755ULL, 51218195700649ULL, 76684578423745ULL, + 560266272480743ULL, 922517457707697ULL, 2066645939860874ULL, 1318277348414638ULL, + 1576726809084003ULL, 1817337608563665ULL, 1874240939237666ULL, 754733726333910ULL, + 97085310406474ULL, 751148364309235ULL, 1622159695715187ULL, 1444098819684916ULL, + 130920805558089ULL, 1260449179085308ULL, 1860021740768461ULL, 110052860348509ULL, + 193830891643810ULL, 164148413933881ULL, 180017794795332ULL, 1523506525254651ULL, + 465981629225956ULL, 559733514964572ULL, 1279624874416974ULL, 2026642326892306ULL, + 1425156829982409ULL, 2160936383793147ULL, 1061870624975247ULL, 2023497043036941ULL, + 117942212883190ULL, 490339622800774ULL, 1729931303146295ULL, 422305932971074ULL, + 529103152793096ULL, 1211973233775992ULL, 721364955929681ULL, 1497674430438813ULL, + 342545521275073ULL, 2102107575279372ULL, 2108462244669966ULL, 1382582406064082ULL, + 2206396818383323ULL, 2109093268641147ULL, 10809845110983ULL, 1605176920880099ULL, + 744640650753946ULL, 1712758897518129ULL, 373410811281809ULL, 648838265800209ULL, + 813058095530999ULL, 513987632620169ULL, 465516160703329ULL, 2136322186126330ULL, + 1979645899422932ULL, 1197131006470786ULL, 1467836664863979ULL, 1340751381374628ULL, + 1810066212667962ULL, 1009933588225499ULL, 1106129188080873ULL, 1388980405213901ULL, + 533719246598044ULL, 1169435803073277ULL, 198920999285821ULL, 487492330629854ULL, + 1807093008537778ULL, 1540899012923865ULL, 2075080271659867ULL, 1527990806921523ULL, + 1323728742908002ULL, 1568595959608205ULL, 1388032187497212ULL, 2026968840050568ULL, + 1396591153295755ULL, 820416950170901ULL, 520060313205582ULL, 2016404325094901ULL, + 1584709677868520ULL, 272161374469956ULL, 1567188603996816ULL, 1986160530078221ULL, + 553930264324589ULL, 1058426729027503ULL, 8762762886675ULL, 2216098143382988ULL, + 1835145266889223ULL, 1712936431558441ULL, 1017009937844974ULL, 585361667812740ULL, + 2114711541628181ULL, 2238729632971439ULL, 121257546253072ULL, 847154149018345ULL, + 211972965476684ULL, 287499084460129ULL, 2098247259180197ULL, 839070411583329ULL, + 339551619574372ULL, 1432951287640743ULL, 526481249498942ULL, 931991661905195ULL, + 1884279965674487ULL, 200486405604411ULL, 364173020594788ULL, 518034455936955ULL, + 1085564703965501ULL, 16030410467927ULL, 604865933167613ULL, 1695298441093964ULL, + 498856548116159ULL, 2193030062787034ULL, 1706339802964179ULL, 1721199073493888ULL, + 820740951039755ULL, 1216053436896834ULL, 23954895815139ULL, 1662515208920491ULL, + 1705443427511899ULL, 1957928899570365ULL, 1189636258255725ULL, 1795695471103809ULL, + 1691191297654118ULL, 282402585374360ULL, 460405330264832ULL, 63765529445733ULL, + 469763447404473ULL, 733607089694996ULL, 685410420186959ULL, 1096682630419738ULL, + 1162548510542362ULL, 1020949526456676ULL, 1211660396870573ULL, 613126398222696ULL, + 1117829165843251ULL, 742432540886650ULL, 1483755088010658ULL, 942392007134474ULL, + 1447834130944107ULL, 489368274863410ULL, 23192985544898ULL, 648442406146160ULL, + 785438843373876ULL, 249464684645238ULL, 170494608205618ULL, 335112827260550ULL, + 1462050123162735ULL, 1084803668439016ULL, 853459233600325ULL, 215777728187495ULL, + 1965759433526974ULL, 1349482894446537ULL, 694163317612871ULL, 860536766165036ULL, + 1178788094084321ULL, 1652739626626996ULL, 2115723946388185ULL, 1577204379094664ULL, + 1083882859023240ULL, 1768759143381635ULL, 1737180992507258ULL, 246054513922239ULL, + 577253134087234ULL, 356340280578042ULL, 1638917769925142ULL, 223550348130103ULL, + 470592666638765ULL, 22663573966996ULL, 596552461152400ULL, 364143537069499ULL, 3942119457699ULL, + 107951982889287ULL, 1843471406713209ULL, 1625773041610986ULL, 1466141092501702ULL, + 1043024095021271ULL, 310429964047508ULL, 98559121500372ULL, 152746933782868ULL, + 259407205078261ULL, 828123093322585ULL, 1576847274280091ULL, 1170871375757302ULL, + 1588856194642775ULL, 984767822341977ULL, 1141497997993760ULL, 809325345150796ULL, + 1879837728202511ULL, 201340910657893ULL, 1079157558888483ULL, 1052373448588065ULL, + 1732036202501778ULL, 2105292670328445ULL, 679751387312402ULL, 1679682144926229ULL, + 1695823455818780ULL, 498852317075849ULL, 1786555067788433ULL, 1670727545779425ULL, + 117945875433544ULL, 407939139781844ULL, 854632120023778ULL, 1413383148360437ULL, + 286030901733673ULL, 1207361858071196ULL, 461340408181417ULL, 1096919590360164ULL, + 1837594897475685ULL, 533755561544165ULL, 1638688042247712ULL, 1431653684793005ULL, + 1036458538873559ULL, 390822120341779ULL, 1920929837111618ULL, 543426740024168ULL, + 645751357799929ULL, 2245025632994463ULL, 1550778638076452ULL, 223738153459949ULL, + 1337209385492033ULL, 1276967236456531ULL, 1463815821063071ULL, 2070620870191473ULL, + 1199170709413753ULL, 273230877394166ULL, 1873264887608046ULL, 890877152910775ULL, + 983226445635730ULL, 44873798519521ULL, 697147127512130ULL, 961631038239304ULL, + 709966160696826ULL, 1706677689540366ULL, 502782733796035ULL, 812545535346033ULL, + 1693622521296452ULL, 1955813093002510ULL, 1259937612881362ULL, 1873032503803559ULL, + 1140330566016428ULL, 1675726082440190ULL, 60029928909786ULL, 170335608866763ULL, + 766444312315022ULL, 2025049511434113ULL, 2200845622430647ULL, 1201269851450408ULL, + 590071752404907ULL, 1400995030286946ULL, 2152637413853822ULL, 2108495473841983ULL, + 3855406710349ULL, 1726137673168580ULL, 51004317200100ULL, 1749082328586939ULL, + 1704088976144558ULL, 1977318954775118ULL, 2062602253162400ULL, 948062503217479ULL, + 361953965048030ULL, 1528264887238440ULL, 62582552172290ULL, 2241602163389280ULL, + 156385388121765ULL, 2124100319761492ULL, 388928050571382ULL, 1556123596922727ULL, + 979310669812384ULL, 113043855206104ULL, 2023223924825469ULL, 643651703263034ULL, + 2234446903655540ULL, 1577241261424997ULL, 860253174523845ULL, 1691026473082448ULL, + 1091672764933872ULL, 1957463109756365ULL, 530699502660193ULL, 349587141723569ULL, + 674661681919563ULL, 1633727303856240ULL, 708909037922144ULL, 2160722508518119ULL, + 1302188051602540ULL, 976114603845777ULL, 120004758721939ULL, 1681630708873780ULL, + 622274095069244ULL, 1822346309016698ULL, 1100921177951904ULL, 2216952659181677ULL, + 1844020550362490ULL, 1976451368365774ULL, 1321101422068822ULL, 1189859436282668ULL, + 2008801879735257ULL, 2219413454333565ULL, 424288774231098ULL, 359793146977912ULL, + 270293357948703ULL, 587226003677000ULL, 1482071926139945ULL, 1419630774650359ULL, + 1104739070570175ULL, 1662129023224130ULL, 1609203612533411ULL, 1250932720691980ULL, + 95215711818495ULL, 498746909028150ULL, 158151296991874ULL, 1201379988527734ULL, + 561599945143989ULL, 2211577425617888ULL, 2166577612206324ULL, 1057590354233512ULL, + 1968123280416769ULL, 1316586165401313ULL, 762728164447634ULL, 2045395244316047ULL, + 1531796898725716ULL, 315385971670425ULL, 1109421039396756ULL, 2183635256408562ULL, + 1896751252659461ULL, 840236037179080ULL, 796245792277211ULL, 508345890111193ULL, + 1275386465287222ULL, 513560822858784ULL, 1784735733120313ULL, 1346467478899695ULL, + 601125231208417ULL, 701076661112726ULL, 1841998436455089ULL, 1156768600940434ULL, + 1967853462343221ULL, 2178318463061452ULL, 481885520752741ULL, 675262828640945ULL, + 1033539418596582ULL, 1743329872635846ULL, 159322641251283ULL, 1573076470127113ULL, + 954827619308195ULL, 778834750662635ULL, 619912782122617ULL, 515681498488209ULL, + 1675866144246843ULL, 811716020969981ULL, 1125515272217398ULL, 1398917918287342ULL, + 1301680949183175ULL, 726474739583734ULL, 587246193475200ULL, 1096581582611864ULL, + 1469911826213486ULL, 1990099711206364ULL, 1256496099816508ULL, 2019924615195672ULL, + 1251232456707555ULL, 2042971196009755ULL, 214061878479265ULL, 115385726395472ULL, + 1677875239524132ULL, 756888883383540ULL, 1153862117756233ULL, 503391530851096ULL, + 946070017477513ULL, 1878319040542579ULL, 1101349418586920ULL, 793245696431613ULL, + 397920495357645ULL, 2174023872951112ULL, 1517867915189593ULL, 1829855041462995ULL, + 1046709983503619ULL, 424081940711857ULL, 2112438073094647ULL, 1504338467349861ULL, + 2244574127374532ULL, 2136937537441911ULL, 1741150838990304ULL, 25894628400571ULL, + 512213526781178ULL, 1168384260796379ULL, 1424607682379833ULL, 938677789731564ULL, + 872882241891896ULL, 1713199397007700ULL, 1410496326218359ULL, 854379752407031ULL, + 465141611727634ULL, 315176937037857ULL, 1020115054571233ULL, 1856290111077229ULL, + 2028366269898204ULL, 1432980880307543ULL, 469932710425448ULL, 581165267592247ULL, + 496399148156603ULL, 2063435226705903ULL, 2116841086237705ULL, 498272567217048ULL, + 1829438076967906ULL, 1573925801278491ULL, 460763576329867ULL, 1705264723728225ULL, + 999514866082412ULL, 29635061779362ULL, 1884233592281020ULL, 1449755591461338ULL, + 42579292783222ULL, 1869504355369200ULL, 495506004805251ULL, 264073104888427ULL, + 2088880861028612ULL, 104646456386576ULL, 1258445191399967ULL, 1348736801545799ULL, + 2068276361286613ULL, 884897216646374ULL, 922387476801376ULL, 1043886580402805ULL, + 1240883498470831ULL, 1601554651937110ULL, 804382935289482ULL, 512379564477239ULL, + 1466384519077032ULL, 1280698500238386ULL, 211303836685749ULL, 2081725624793803ULL, + 545247644516879ULL, 215313359330384ULL, 286479751145614ULL, 2213650281751636ULL, + 2164927945999874ULL, 2072162991540882ULL, 1443769115444779ULL, 1581473274363095ULL, + 434633875922699ULL, 340456055781599ULL, 373043091080189ULL, 839476566531776ULL, + 1856706858509978ULL, 931616224909153ULL, 1888181317414065ULL, 213654322650262ULL, + 1161078103416244ULL, 1822042328851513ULL, 915817709028812ULL, 1828297056698188ULL, + 1212017130909403ULL, 60258343247333ULL, 342085800008230ULL, 930240559508270ULL, + 1549884999174952ULL, 809895264249462ULL, 184726257947682ULL, 1157065433504828ULL, + 1209999630381477ULL, 999920399374391ULL, 1714770150788163ULL, 2026130985413228ULL, + 506776632883140ULL, 1349042668246528ULL, 1937232292976967ULL, 942302637530730ULL, + 160211904766226ULL, 1042724500438571ULL, 212454865139142ULL, 244104425172642ULL, + 1376990622387496ULL, 76126752421227ULL, 1027540886376422ULL, 1912210655133026ULL, + 13410411589575ULL, 1475856708587773ULL, 615563352691682ULL, 1446629324872644ULL, + 1683670301784014ULL, 1049873327197127ULL, 1826401704084838ULL, 2032577048760775ULL, + 1922203607878853ULL, 836708788764806ULL, 2193084654695012ULL, 1342923183256659ULL, + 849356986294271ULL, 1228863973965618ULL, 94886161081867ULL, 1423288430204892ULL, + 2016167528707016ULL, 1633187660972877ULL, 1550621242301752ULL, 340630244512994ULL, + 2103577710806901ULL, 221625016538931ULL, 421544147350960ULL, 580428704555156ULL, + 1479831381265617ULL, 518057926544698ULL, 955027348790630ULL, 1326749172561598ULL, + 1118304625755967ULL, 1994005916095176ULL, 1799757332780663ULL, 751343129396941ULL, + 1468672898746144ULL, 1451689964451386ULL, 755070293921171ULL, 904857405877052ULL, + 1276087530766984ULL, 403986562858511ULL, 1530661255035337ULL, 1644972908910502ULL, + 1370170080438957ULL, 139839536695744ULL, 909930462436512ULL, 1899999215356933ULL, + 635992381064566ULL, 788740975837654ULL, 224241231493695ULL, 1267090030199302ULL, + 998908061660139ULL, 1784537499699278ULL, 859195370018706ULL, 1953966091439379ULL, + 2189271820076010ULL, 2039067059943978ULL, 1526694380855202ULL, 2040321513194941ULL, + 329922071218689ULL, 1953032256401326ULL, 989631424403521ULL, 328825014934242ULL, + 9407151397696ULL, 63551373671268ULL, 1624728632895792ULL, 1608324920739262ULL, + 1178239350351945ULL, 1198077399579702ULL, 277620088676229ULL, 1775359437312528ULL, + 1653558177737477ULL, 1652066043408850ULL, 1063359889686622ULL, 1975063804860653ULL }; #if defined(__cplusplus) diff --git a/include/internal/Hacl_Frodo_KEM.h b/include/internal/Hacl_Frodo_KEM.h index 5d8f2a85..a4e2f62a 100644 --- a/include/internal/Hacl_Frodo_KEM.h +++ b/include/internal/Hacl_Frodo_KEM.h @@ -55,22 +55,22 @@ Hacl_Keccak_shake128_4x( uint8_t *output3 ) { - Hacl_SHA3_shake128_hacl(input_len, input0, output_len, output0); - Hacl_SHA3_shake128_hacl(input_len, input1, output_len, output1); - Hacl_SHA3_shake128_hacl(input_len, input2, output_len, output2); - Hacl_SHA3_shake128_hacl(input_len, input3, output_len, output3); + Hacl_Hash_SHA3_shake128_hacl(input_len, input0, output_len, output0); + Hacl_Hash_SHA3_shake128_hacl(input_len, input1, output_len, output1); + Hacl_Hash_SHA3_shake128_hacl(input_len, input2, output_len, output2); + Hacl_Hash_SHA3_shake128_hacl(input_len, input3, output_len, output3); } static inline void Hacl_Impl_Matrix_mod_pow2(uint32_t n1, uint32_t n2, uint32_t logq, uint16_t *a) { - if (logq < (uint32_t)16U) + if (logq < 16U) { - for (uint32_t i0 = (uint32_t)0U; i0 < n1; i0++) + for (uint32_t i0 = 0U; i0 < n1; i0++) { - for (uint32_t i = (uint32_t)0U; i < n2; i++) + for (uint32_t i = 0U; i < n2; i++) { - a[i0 * n2 + i] = a[i0 * n2 + i] & (((uint16_t)1U << logq) - (uint16_t)1U); + a[i0 * n2 + i] = (uint32_t)a[i0 * n2 + i] & ((1U << logq) - 1U); } } return; @@ -80,11 +80,11 @@ Hacl_Impl_Matrix_mod_pow2(uint32_t n1, uint32_t n2, uint32_t logq, uint16_t *a) static inline void Hacl_Impl_Matrix_matrix_add(uint32_t n1, uint32_t n2, uint16_t *a, uint16_t *b) { - for (uint32_t i0 = (uint32_t)0U; i0 < n1; i0++) + for (uint32_t i0 = 0U; i0 < n1; i0++) { - for (uint32_t i = (uint32_t)0U; i < n2; i++) + for (uint32_t i = 0U; i < n2; i++) { - a[i0 * n2 + i] = a[i0 * n2 + i] + b[i0 * n2 + i]; + a[i0 * n2 + i] = (uint32_t)a[i0 * n2 + i] + (uint32_t)b[i0 * n2 + i]; } } } @@ -92,11 +92,11 @@ Hacl_Impl_Matrix_matrix_add(uint32_t n1, uint32_t n2, uint16_t *a, uint16_t *b) static inline void Hacl_Impl_Matrix_matrix_sub(uint32_t n1, uint32_t n2, uint16_t *a, uint16_t *b) { - for (uint32_t i0 = (uint32_t)0U; i0 < n1; i0++) + for (uint32_t i0 = 0U; i0 < n1; i0++) { - for (uint32_t i = (uint32_t)0U; i < n2; i++) + for (uint32_t i = 0U; i < n2; i++) { - b[i0 * n2 + i] = a[i0 * n2 + i] - b[i0 * n2 + i]; + b[i0 * n2 + i] = (uint32_t)a[i0 * n2 + i] - (uint32_t)b[i0 * n2 + i]; } } } @@ -111,17 +111,17 @@ Hacl_Impl_Matrix_matrix_mul( uint16_t *c ) { - for (uint32_t i0 = (uint32_t)0U; i0 < n1; i0++) + for (uint32_t i0 = 0U; i0 < n1; i0++) { - for (uint32_t i1 = (uint32_t)0U; i1 < n3; i1++) + for (uint32_t i1 = 0U; i1 < n3; i1++) { - uint16_t res = (uint16_t)0U; - for (uint32_t i = (uint32_t)0U; i < n2; i++) + uint16_t res = 0U; + for (uint32_t i = 0U; i < n2; i++) { uint16_t aij = a[i0 * n2 + i]; uint16_t bjk = b[i * n3 + i1]; uint16_t res0 = res; - res = res0 + aij * bjk; + res = (uint32_t)res0 + (uint32_t)aij * (uint32_t)bjk; } c[i0 * n3 + i1] = res; } @@ -138,17 +138,17 @@ Hacl_Impl_Matrix_matrix_mul_s( uint16_t *c ) { - for (uint32_t i0 = (uint32_t)0U; i0 < n1; i0++) + for (uint32_t i0 = 0U; i0 < n1; i0++) { - for (uint32_t i1 = (uint32_t)0U; i1 < n3; i1++) + for (uint32_t i1 = 0U; i1 < n3; i1++) { - uint16_t res = (uint16_t)0U; - for (uint32_t i = (uint32_t)0U; i < n2; i++) + uint16_t res = 0U; + for (uint32_t i = 0U; i < n2; i++) { uint16_t aij = a[i0 * n2 + i]; uint16_t bjk = b[i1 * n2 + i]; uint16_t res0 = res; - res = res0 + aij * bjk; + res = (uint32_t)res0 + (uint32_t)aij * (uint32_t)bjk; } c[i0 * n3 + i1] = res; } @@ -158,11 +158,11 @@ Hacl_Impl_Matrix_matrix_mul_s( static inline uint16_t Hacl_Impl_Matrix_matrix_eq(uint32_t n1, uint32_t n2, uint16_t *a, uint16_t *b) { - uint16_t res = (uint16_t)0xFFFFU; - for (uint32_t i = (uint32_t)0U; i < n1 * n2; i++) + uint16_t res = 0xFFFFU; + for (uint32_t i = 0U; i < n1 * n2; i++) { uint16_t uu____0 = FStar_UInt16_eq_mask(a[i], b[i]); - res = uu____0 & res; + res = (uint32_t)uu____0 & (uint32_t)res; } uint16_t r = res; return r; @@ -171,19 +171,19 @@ Hacl_Impl_Matrix_matrix_eq(uint32_t n1, uint32_t n2, uint16_t *a, uint16_t *b) static inline void Hacl_Impl_Matrix_matrix_to_lbytes(uint32_t n1, uint32_t n2, uint16_t *m, uint8_t *res) { - for (uint32_t i = (uint32_t)0U; i < n1 * n2; i++) + for (uint32_t i = 0U; i < n1 * n2; i++) { - store16_le(res + (uint32_t)2U * i, m[i]); + store16_le(res + 2U * i, m[i]); } } static inline void Hacl_Impl_Matrix_matrix_from_lbytes(uint32_t n1, uint32_t n2, uint8_t *b, uint16_t *res) { - for (uint32_t i = (uint32_t)0U; i < n1 * n2; i++) + for (uint32_t i = 0U; i < n1 * n2; i++) { uint16_t *os = res; - uint16_t u = load16_le(b + (uint32_t)2U * i); + uint16_t u = load16_le(b + 2U * i); uint16_t x = u; os[i] = x; } @@ -192,53 +192,53 @@ Hacl_Impl_Matrix_matrix_from_lbytes(uint32_t n1, uint32_t n2, uint8_t *b, uint16 static inline void Hacl_Impl_Frodo_Gen_frodo_gen_matrix_shake_4x(uint32_t n, uint8_t *seed, uint16_t *res) { - KRML_CHECK_SIZE(sizeof (uint8_t), (uint32_t)8U * n); - uint8_t r[(uint32_t)8U * n]; - memset(r, 0U, (uint32_t)8U * n * sizeof (uint8_t)); + KRML_CHECK_SIZE(sizeof (uint8_t), 8U * n); + uint8_t r[8U * n]; + memset(r, 0U, 8U * n * sizeof (uint8_t)); uint8_t tmp_seed[72U] = { 0U }; - memcpy(tmp_seed + (uint32_t)2U, seed, (uint32_t)16U * sizeof (uint8_t)); - memcpy(tmp_seed + (uint32_t)20U, seed, (uint32_t)16U * sizeof (uint8_t)); - memcpy(tmp_seed + (uint32_t)38U, seed, (uint32_t)16U * sizeof (uint8_t)); - memcpy(tmp_seed + (uint32_t)56U, seed, (uint32_t)16U * sizeof (uint8_t)); + memcpy(tmp_seed + 2U, seed, 16U * sizeof (uint8_t)); + memcpy(tmp_seed + 20U, seed, 16U * sizeof (uint8_t)); + memcpy(tmp_seed + 38U, seed, 16U * sizeof (uint8_t)); + memcpy(tmp_seed + 56U, seed, 16U * sizeof (uint8_t)); memset(res, 0U, n * n * sizeof (uint16_t)); - for (uint32_t i = (uint32_t)0U; i < n / (uint32_t)4U; i++) + for (uint32_t i = 0U; i < n / 4U; i++) { - uint8_t *r0 = r + (uint32_t)0U * n; - uint8_t *r1 = r + (uint32_t)2U * n; - uint8_t *r2 = r + (uint32_t)4U * n; - uint8_t *r3 = r + (uint32_t)6U * n; + uint8_t *r0 = r + 0U * n; + uint8_t *r1 = r + 2U * n; + uint8_t *r2 = r + 4U * n; + uint8_t *r3 = r + 6U * n; uint8_t *tmp_seed0 = tmp_seed; - uint8_t *tmp_seed1 = tmp_seed + (uint32_t)18U; - uint8_t *tmp_seed2 = tmp_seed + (uint32_t)36U; - uint8_t *tmp_seed3 = tmp_seed + (uint32_t)54U; - store16_le(tmp_seed0, (uint16_t)((uint32_t)4U * i + (uint32_t)0U)); - store16_le(tmp_seed1, (uint16_t)((uint32_t)4U * i + (uint32_t)1U)); - store16_le(tmp_seed2, (uint16_t)((uint32_t)4U * i + (uint32_t)2U)); - store16_le(tmp_seed3, (uint16_t)((uint32_t)4U * i + (uint32_t)3U)); - Hacl_Keccak_shake128_4x((uint32_t)18U, + uint8_t *tmp_seed1 = tmp_seed + 18U; + uint8_t *tmp_seed2 = tmp_seed + 36U; + uint8_t *tmp_seed3 = tmp_seed + 54U; + store16_le(tmp_seed0, (uint16_t)(4U * i + 0U)); + store16_le(tmp_seed1, (uint16_t)(4U * i + 1U)); + store16_le(tmp_seed2, (uint16_t)(4U * i + 2U)); + store16_le(tmp_seed3, (uint16_t)(4U * i + 3U)); + Hacl_Keccak_shake128_4x(18U, tmp_seed0, tmp_seed1, tmp_seed2, tmp_seed3, - (uint32_t)2U * n, + 2U * n, r0, r1, r2, r3); - for (uint32_t i0 = (uint32_t)0U; i0 < n; i0++) + for (uint32_t i0 = 0U; i0 < n; i0++) { - uint8_t *resij0 = r0 + i0 * (uint32_t)2U; - uint8_t *resij1 = r1 + i0 * (uint32_t)2U; - uint8_t *resij2 = r2 + i0 * (uint32_t)2U; - uint8_t *resij3 = r3 + i0 * (uint32_t)2U; + uint8_t *resij0 = r0 + i0 * 2U; + uint8_t *resij1 = r1 + i0 * 2U; + uint8_t *resij2 = r2 + i0 * 2U; + uint8_t *resij3 = r3 + i0 * 2U; uint16_t u = load16_le(resij0); - res[((uint32_t)4U * i + (uint32_t)0U) * n + i0] = u; + res[(4U * i + 0U) * n + i0] = u; uint16_t u0 = load16_le(resij1); - res[((uint32_t)4U * i + (uint32_t)1U) * n + i0] = u0; + res[(4U * i + 1U) * n + i0] = u0; uint16_t u1 = load16_le(resij2); - res[((uint32_t)4U * i + (uint32_t)2U) * n + i0] = u1; + res[(4U * i + 2U) * n + i0] = u1; uint16_t u2 = load16_le(resij3); - res[((uint32_t)4U * i + (uint32_t)3U) * n + i0] = u2; + res[(4U * i + 3U) * n + i0] = u2; } } } @@ -270,27 +270,19 @@ static const uint16_t Hacl_Impl_Frodo_Params_cdf_table640[13U] = { - (uint16_t)4643U, (uint16_t)13363U, (uint16_t)20579U, (uint16_t)25843U, (uint16_t)29227U, - (uint16_t)31145U, (uint16_t)32103U, (uint16_t)32525U, (uint16_t)32689U, (uint16_t)32745U, - (uint16_t)32762U, (uint16_t)32766U, (uint16_t)32767U + 4643U, 13363U, 20579U, 25843U, 29227U, 31145U, 32103U, 32525U, 32689U, 32745U, 32762U, 32766U, + 32767U }; static const uint16_t Hacl_Impl_Frodo_Params_cdf_table976[11U] = - { - (uint16_t)5638U, (uint16_t)15915U, (uint16_t)23689U, (uint16_t)28571U, (uint16_t)31116U, - (uint16_t)32217U, (uint16_t)32613U, (uint16_t)32731U, (uint16_t)32760U, (uint16_t)32766U, - (uint16_t)32767U - }; + { 5638U, 15915U, 23689U, 28571U, 31116U, 32217U, 32613U, 32731U, 32760U, 32766U, 32767U }; static const uint16_t Hacl_Impl_Frodo_Params_cdf_table1344[7U] = - { - (uint16_t)9142U, (uint16_t)23462U, (uint16_t)30338U, (uint16_t)32361U, (uint16_t)32725U, - (uint16_t)32765U, (uint16_t)32767U - }; + { 9142U, 23462U, 30338U, 32361U, 32725U, 32765U, 32767U }; static inline void Hacl_Impl_Frodo_Sample_frodo_sample_matrix64( @@ -301,26 +293,26 @@ Hacl_Impl_Frodo_Sample_frodo_sample_matrix64( ) { memset(res, 0U, n1 * n2 * sizeof (uint16_t)); - for (uint32_t i0 = (uint32_t)0U; i0 < n1; i0++) + for (uint32_t i0 = 0U; i0 < n1; i0++) { - for (uint32_t i1 = (uint32_t)0U; i1 < n2; i1++) + for (uint32_t i1 = 0U; i1 < n2; i1++) { - uint8_t *resij = r + (uint32_t)2U * (n2 * i0 + i1); + uint8_t *resij = r + 2U * (n2 * i0 + i1); uint16_t u = load16_le(resij); uint16_t uu____0 = u; - uint16_t prnd = uu____0 >> (uint32_t)1U; - uint16_t sign = uu____0 & (uint16_t)1U; - uint16_t sample = (uint16_t)0U; - uint32_t bound = (uint32_t)12U; - for (uint32_t i = (uint32_t)0U; i < bound; i++) + uint16_t prnd = (uint32_t)uu____0 >> 1U; + uint16_t sign = (uint32_t)uu____0 & 1U; + uint16_t sample = 0U; + uint32_t bound = 12U; + for (uint32_t i = 0U; i < bound; i++) { uint16_t sample0 = sample; uint16_t ti = Hacl_Impl_Frodo_Params_cdf_table640[i]; - uint16_t samplei = (uint16_t)(uint32_t)(ti - prnd) >> (uint32_t)15U; - sample = samplei + sample0; + uint16_t samplei = (uint32_t)(uint16_t)(uint32_t)((uint32_t)ti - (uint32_t)prnd) >> 15U; + sample = (uint32_t)samplei + (uint32_t)sample0; } uint16_t sample0 = sample; - res[i0 * n2 + i1] = ((~sign + (uint16_t)1U) ^ sample0) + sign; + res[i0 * n2 + i1] = (((uint32_t)~sign + 1U) ^ (uint32_t)sample0) + (uint32_t)sign; } } } @@ -334,26 +326,26 @@ Hacl_Impl_Frodo_Sample_frodo_sample_matrix640( ) { memset(res, 0U, n1 * n2 * sizeof (uint16_t)); - for (uint32_t i0 = (uint32_t)0U; i0 < n1; i0++) + for (uint32_t i0 = 0U; i0 < n1; i0++) { - for (uint32_t i1 = (uint32_t)0U; i1 < n2; i1++) + for (uint32_t i1 = 0U; i1 < n2; i1++) { - uint8_t *resij = r + (uint32_t)2U * (n2 * i0 + i1); + uint8_t *resij = r + 2U * (n2 * i0 + i1); uint16_t u = load16_le(resij); uint16_t uu____0 = u; - uint16_t prnd = uu____0 >> (uint32_t)1U; - uint16_t sign = uu____0 & (uint16_t)1U; - uint16_t sample = (uint16_t)0U; - uint32_t bound = (uint32_t)12U; - for (uint32_t i = (uint32_t)0U; i < bound; i++) + uint16_t prnd = (uint32_t)uu____0 >> 1U; + uint16_t sign = (uint32_t)uu____0 & 1U; + uint16_t sample = 0U; + uint32_t bound = 12U; + for (uint32_t i = 0U; i < bound; i++) { uint16_t sample0 = sample; uint16_t ti = Hacl_Impl_Frodo_Params_cdf_table640[i]; - uint16_t samplei = (uint16_t)(uint32_t)(ti - prnd) >> (uint32_t)15U; - sample = samplei + sample0; + uint16_t samplei = (uint32_t)(uint16_t)(uint32_t)((uint32_t)ti - (uint32_t)prnd) >> 15U; + sample = (uint32_t)samplei + (uint32_t)sample0; } uint16_t sample0 = sample; - res[i0 * n2 + i1] = ((~sign + (uint16_t)1U) ^ sample0) + sign; + res[i0 * n2 + i1] = (((uint32_t)~sign + 1U) ^ (uint32_t)sample0) + (uint32_t)sign; } } } @@ -367,26 +359,26 @@ Hacl_Impl_Frodo_Sample_frodo_sample_matrix976( ) { memset(res, 0U, n1 * n2 * sizeof (uint16_t)); - for (uint32_t i0 = (uint32_t)0U; i0 < n1; i0++) + for (uint32_t i0 = 0U; i0 < n1; i0++) { - for (uint32_t i1 = (uint32_t)0U; i1 < n2; i1++) + for (uint32_t i1 = 0U; i1 < n2; i1++) { - uint8_t *resij = r + (uint32_t)2U * (n2 * i0 + i1); + uint8_t *resij = r + 2U * (n2 * i0 + i1); uint16_t u = load16_le(resij); uint16_t uu____0 = u; - uint16_t prnd = uu____0 >> (uint32_t)1U; - uint16_t sign = uu____0 & (uint16_t)1U; - uint16_t sample = (uint16_t)0U; - uint32_t bound = (uint32_t)10U; - for (uint32_t i = (uint32_t)0U; i < bound; i++) + uint16_t prnd = (uint32_t)uu____0 >> 1U; + uint16_t sign = (uint32_t)uu____0 & 1U; + uint16_t sample = 0U; + uint32_t bound = 10U; + for (uint32_t i = 0U; i < bound; i++) { uint16_t sample0 = sample; uint16_t ti = Hacl_Impl_Frodo_Params_cdf_table976[i]; - uint16_t samplei = (uint16_t)(uint32_t)(ti - prnd) >> (uint32_t)15U; - sample = samplei + sample0; + uint16_t samplei = (uint32_t)(uint16_t)(uint32_t)((uint32_t)ti - (uint32_t)prnd) >> 15U; + sample = (uint32_t)samplei + (uint32_t)sample0; } uint16_t sample0 = sample; - res[i0 * n2 + i1] = ((~sign + (uint16_t)1U) ^ sample0) + sign; + res[i0 * n2 + i1] = (((uint32_t)~sign + 1U) ^ (uint32_t)sample0) + (uint32_t)sign; } } } @@ -400,26 +392,26 @@ Hacl_Impl_Frodo_Sample_frodo_sample_matrix1344( ) { memset(res, 0U, n1 * n2 * sizeof (uint16_t)); - for (uint32_t i0 = (uint32_t)0U; i0 < n1; i0++) + for (uint32_t i0 = 0U; i0 < n1; i0++) { - for (uint32_t i1 = (uint32_t)0U; i1 < n2; i1++) + for (uint32_t i1 = 0U; i1 < n2; i1++) { - uint8_t *resij = r + (uint32_t)2U * (n2 * i0 + i1); + uint8_t *resij = r + 2U * (n2 * i0 + i1); uint16_t u = load16_le(resij); uint16_t uu____0 = u; - uint16_t prnd = uu____0 >> (uint32_t)1U; - uint16_t sign = uu____0 & (uint16_t)1U; - uint16_t sample = (uint16_t)0U; - uint32_t bound = (uint32_t)6U; - for (uint32_t i = (uint32_t)0U; i < bound; i++) + uint16_t prnd = (uint32_t)uu____0 >> 1U; + uint16_t sign = (uint32_t)uu____0 & 1U; + uint16_t sample = 0U; + uint32_t bound = 6U; + for (uint32_t i = 0U; i < bound; i++) { uint16_t sample0 = sample; uint16_t ti = Hacl_Impl_Frodo_Params_cdf_table1344[i]; - uint16_t samplei = (uint16_t)(uint32_t)(ti - prnd) >> (uint32_t)15U; - sample = samplei + sample0; + uint16_t samplei = (uint32_t)(uint16_t)(uint32_t)((uint32_t)ti - (uint32_t)prnd) >> 15U; + sample = (uint32_t)samplei + (uint32_t)sample0; } uint16_t sample0 = sample; - res[i0 * n2 + i1] = ((~sign + (uint16_t)1U) ^ sample0) + sign; + res[i0 * n2 + i1] = (((uint32_t)~sign + 1U) ^ (uint32_t)sample0) + (uint32_t)sign; } } } @@ -435,39 +427,34 @@ Hacl_Impl_Frodo_Pack_frodo_pack( uint8_t *res ) { - uint32_t n = n1 * n2 / (uint32_t)8U; - for (uint32_t i = (uint32_t)0U; i < n; i++) + uint32_t n = n1 * n2 / 8U; + for (uint32_t i = 0U; i < n; i++) { - uint16_t *a1 = a + (uint32_t)8U * i; + uint16_t *a1 = a + 8U * i; uint8_t *r = res + d * i; - uint16_t maskd = (uint16_t)((uint32_t)1U << d) - (uint16_t)1U; + uint16_t maskd = (uint32_t)(uint16_t)(1U << d) - 1U; uint8_t v16[16U] = { 0U }; - uint16_t a0 = a1[0U] & maskd; - uint16_t a11 = a1[1U] & maskd; - uint16_t a2 = a1[2U] & maskd; - uint16_t a3 = a1[3U] & maskd; - uint16_t a4 = a1[4U] & maskd; - uint16_t a5 = a1[5U] & maskd; - uint16_t a6 = a1[6U] & maskd; - uint16_t a7 = a1[7U] & maskd; + uint16_t a0 = (uint32_t)a1[0U] & (uint32_t)maskd; + uint16_t a11 = (uint32_t)a1[1U] & (uint32_t)maskd; + uint16_t a2 = (uint32_t)a1[2U] & (uint32_t)maskd; + uint16_t a3 = (uint32_t)a1[3U] & (uint32_t)maskd; + uint16_t a4 = (uint32_t)a1[4U] & (uint32_t)maskd; + uint16_t a5 = (uint32_t)a1[5U] & (uint32_t)maskd; + uint16_t a6 = (uint32_t)a1[6U] & (uint32_t)maskd; + uint16_t a7 = (uint32_t)a1[7U] & (uint32_t)maskd; FStar_UInt128_uint128 templong = FStar_UInt128_logor(FStar_UInt128_logor(FStar_UInt128_logor(FStar_UInt128_logor(FStar_UInt128_logor(FStar_UInt128_logor(FStar_UInt128_logor(FStar_UInt128_shift_left(FStar_UInt128_uint64_to_uint128((uint64_t)a0), - (uint32_t)7U * d), - FStar_UInt128_shift_left(FStar_UInt128_uint64_to_uint128((uint64_t)a11), - (uint32_t)6U * d)), - FStar_UInt128_shift_left(FStar_UInt128_uint64_to_uint128((uint64_t)a2), - (uint32_t)5U * d)), - FStar_UInt128_shift_left(FStar_UInt128_uint64_to_uint128((uint64_t)a3), - (uint32_t)4U * d)), - FStar_UInt128_shift_left(FStar_UInt128_uint64_to_uint128((uint64_t)a4), - (uint32_t)3U * d)), - FStar_UInt128_shift_left(FStar_UInt128_uint64_to_uint128((uint64_t)a5), - (uint32_t)2U * d)), - FStar_UInt128_shift_left(FStar_UInt128_uint64_to_uint128((uint64_t)a6), (uint32_t)1U * d)), - FStar_UInt128_shift_left(FStar_UInt128_uint64_to_uint128((uint64_t)a7), (uint32_t)0U * d)); + 7U * d), + FStar_UInt128_shift_left(FStar_UInt128_uint64_to_uint128((uint64_t)a11), 6U * d)), + FStar_UInt128_shift_left(FStar_UInt128_uint64_to_uint128((uint64_t)a2), 5U * d)), + FStar_UInt128_shift_left(FStar_UInt128_uint64_to_uint128((uint64_t)a3), 4U * d)), + FStar_UInt128_shift_left(FStar_UInt128_uint64_to_uint128((uint64_t)a4), 3U * d)), + FStar_UInt128_shift_left(FStar_UInt128_uint64_to_uint128((uint64_t)a5), 2U * d)), + FStar_UInt128_shift_left(FStar_UInt128_uint64_to_uint128((uint64_t)a6), 1U * d)), + FStar_UInt128_shift_left(FStar_UInt128_uint64_to_uint128((uint64_t)a7), 0U * d)); store128_be(v16, templong); - uint8_t *src = v16 + (uint32_t)16U - d; + uint8_t *src = v16 + 16U - d; memcpy(r, src, d * sizeof (uint8_t)); } } @@ -481,48 +468,48 @@ Hacl_Impl_Frodo_Pack_frodo_unpack( uint16_t *res ) { - uint32_t n = n1 * n2 / (uint32_t)8U; - for (uint32_t i = (uint32_t)0U; i < n; i++) + uint32_t n = n1 * n2 / 8U; + for (uint32_t i = 0U; i < n; i++) { uint8_t *b1 = b + d * i; - uint16_t *r = res + (uint32_t)8U * i; - uint16_t maskd = (uint16_t)((uint32_t)1U << d) - (uint16_t)1U; + uint16_t *r = res + 8U * i; + uint16_t maskd = (uint32_t)(uint16_t)(1U << d) - 1U; uint8_t src[16U] = { 0U }; - memcpy(src + (uint32_t)16U - d, b1, d * sizeof (uint8_t)); + memcpy(src + 16U - d, b1, d * sizeof (uint8_t)); FStar_UInt128_uint128 u = load128_be(src); FStar_UInt128_uint128 templong = u; r[0U] = - (uint16_t)FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(templong, - (uint32_t)7U * d)) - & maskd; + (uint32_t)(uint16_t)FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(templong, + 7U * d)) + & (uint32_t)maskd; r[1U] = - (uint16_t)FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(templong, - (uint32_t)6U * d)) - & maskd; + (uint32_t)(uint16_t)FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(templong, + 6U * d)) + & (uint32_t)maskd; r[2U] = - (uint16_t)FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(templong, - (uint32_t)5U * d)) - & maskd; + (uint32_t)(uint16_t)FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(templong, + 5U * d)) + & (uint32_t)maskd; r[3U] = - (uint16_t)FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(templong, - (uint32_t)4U * d)) - & maskd; + (uint32_t)(uint16_t)FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(templong, + 4U * d)) + & (uint32_t)maskd; r[4U] = - (uint16_t)FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(templong, - (uint32_t)3U * d)) - & maskd; + (uint32_t)(uint16_t)FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(templong, + 3U * d)) + & (uint32_t)maskd; r[5U] = - (uint16_t)FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(templong, - (uint32_t)2U * d)) - & maskd; + (uint32_t)(uint16_t)FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(templong, + 2U * d)) + & (uint32_t)maskd; r[6U] = - (uint16_t)FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(templong, - (uint32_t)1U * d)) - & maskd; + (uint32_t)(uint16_t)FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(templong, + 1U * d)) + & (uint32_t)maskd; r[7U] = - (uint16_t)FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(templong, - (uint32_t)0U * d)) - & maskd; + (uint32_t)(uint16_t)FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(templong, + 0U * d)) + & (uint32_t)maskd; } } @@ -535,7 +522,7 @@ Hacl_Impl_Frodo_Encode_frodo_key_encode( uint16_t *res ) { - for (uint32_t i0 = (uint32_t)0U; i0 < n; i0++) + for (uint32_t i0 = 0U; i0 < n; i0++) { uint8_t v8[8U] = { 0U }; uint8_t *chunk = a + i0 * b; @@ -544,11 +531,11 @@ Hacl_Impl_Frodo_Encode_frodo_key_encode( uint64_t x = u; uint64_t x0 = x; KRML_MAYBE_FOR8(i, - (uint32_t)0U, - (uint32_t)8U, - (uint32_t)1U, - uint64_t rk = x0 >> b * i & (((uint64_t)1U << b) - (uint64_t)1U); - res[i0 * n + i] = (uint16_t)rk << (logq - b);); + 0U, + 8U, + 1U, + uint64_t rk = x0 >> b * i & ((1ULL << b) - 1ULL); + res[i0 * n + i] = (uint32_t)(uint16_t)rk << (logq - b);); } } @@ -561,16 +548,16 @@ Hacl_Impl_Frodo_Encode_frodo_key_decode( uint8_t *res ) { - for (uint32_t i0 = (uint32_t)0U; i0 < n; i0++) + for (uint32_t i0 = 0U; i0 < n; i0++) { - uint64_t templong = (uint64_t)0U; + uint64_t templong = 0ULL; KRML_MAYBE_FOR8(i, - (uint32_t)0U, - (uint32_t)8U, - (uint32_t)1U, + 0U, + 8U, + 1U, uint16_t aik = a[i0 * n + i]; - uint16_t res1 = (aik + ((uint16_t)1U << (logq - b - (uint32_t)1U))) >> (logq - b); - templong = templong | (uint64_t)(res1 & (((uint16_t)1U << b) - (uint16_t)1U)) << b * i;); + uint16_t res1 = (((uint32_t)aik + (1U << (logq - b - 1U))) & 0xFFFFU) >> (logq - b); + templong = templong | (uint64_t)((uint32_t)res1 & ((1U << b) - 1U)) << b * i;); uint64_t templong0 = templong; uint8_t v8[8U] = { 0U }; store64_le(v8, templong0); diff --git a/include/msvc/internal/Hacl_Hash_Blake2.h b/include/internal/Hacl_HMAC.h similarity index 82% rename from include/msvc/internal/Hacl_Hash_Blake2.h rename to include/internal/Hacl_HMAC.h index 8f308bd9..ad344c4c 100644 --- a/include/msvc/internal/Hacl_Hash_Blake2.h +++ b/include/internal/Hacl_HMAC.h @@ -23,8 +23,8 @@ */ -#ifndef __internal_Hacl_Hash_Blake2_H -#define __internal_Hacl_Hash_Blake2_H +#ifndef __internal_Hacl_HMAC_H +#define __internal_Hacl_HMAC_H #if defined(__cplusplus) extern "C" { @@ -35,8 +35,12 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -#include "internal/Hacl_Impl_Blake2_Constants.h" -#include "../Hacl_Hash_Blake2.h" +#include "internal/Hacl_Krmllib.h" +#include "internal/Hacl_Hash_SHA2.h" +#include "internal/Hacl_Hash_SHA1.h" +#include "internal/Hacl_Hash_Blake2s.h" +#include "internal/Hacl_Hash_Blake2b.h" +#include "../Hacl_HMAC.h" typedef struct K___uint32_t_uint32_t_s { @@ -49,5 +53,5 @@ K___uint32_t_uint32_t; } #endif -#define __internal_Hacl_Hash_Blake2_H_DEFINED +#define __internal_Hacl_HMAC_H_DEFINED #endif diff --git a/include/internal/Hacl_Hash_Blake2b.h b/include/internal/Hacl_Hash_Blake2b.h new file mode 100644 index 00000000..21689d60 --- /dev/null +++ b/include/internal/Hacl_Hash_Blake2b.h @@ -0,0 +1,70 @@ +/* MIT License + * + * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation + * Copyright (c) 2022-2023 HACL* Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + + +#ifndef __internal_Hacl_Hash_Blake2b_H +#define __internal_Hacl_Hash_Blake2b_H + +#if defined(__cplusplus) +extern "C" { +#endif + +#include +#include "krml/internal/types.h" +#include "krml/lowstar_endianness.h" +#include "krml/internal/target.h" + +#include "internal/Hacl_Impl_Blake2_Constants.h" +#include "../Hacl_Hash_Blake2b.h" + +void Hacl_Hash_Blake2b_init(uint64_t *hash, uint32_t kk, uint32_t nn); + +void +Hacl_Hash_Blake2b_update_multi( + uint32_t len, + uint64_t *wv, + uint64_t *hash, + FStar_UInt128_uint128 prev, + uint8_t *blocks, + uint32_t nb +); + +void +Hacl_Hash_Blake2b_update_last( + uint32_t len, + uint64_t *wv, + uint64_t *hash, + FStar_UInt128_uint128 prev, + uint32_t rem, + uint8_t *d +); + +void Hacl_Hash_Blake2b_finish(uint32_t nn, uint8_t *output, uint64_t *hash); + +#if defined(__cplusplus) +} +#endif + +#define __internal_Hacl_Hash_Blake2b_H_DEFINED +#endif diff --git a/include/Hacl_Hash_Blake2b_256.h b/include/internal/Hacl_Hash_Blake2b_Simd256.h similarity index 61% rename from include/Hacl_Hash_Blake2b_256.h rename to include/internal/Hacl_Hash_Blake2b_Simd256.h index 2379fd75..4cc07869 100644 --- a/include/Hacl_Hash_Blake2b_256.h +++ b/include/internal/Hacl_Hash_Blake2b_Simd256.h @@ -23,8 +23,8 @@ */ -#ifndef __Hacl_Hash_Blake2b_256_H -#define __Hacl_Hash_Blake2b_256_H +#ifndef __internal_Hacl_Hash_Blake2b_Simd256_H +#define __internal_Hacl_Hash_Blake2b_Simd256_H #if defined(__cplusplus) extern "C" { @@ -35,23 +35,15 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -#include "Hacl_Krmllib.h" +#include "internal/Hacl_Impl_Blake2_Constants.h" +#include "../Hacl_Hash_Blake2b_Simd256.h" #include "libintvector.h" void -Hacl_Blake2b_256_blake2b_init(Lib_IntVector_Intrinsics_vec256 *hash, uint32_t kk, uint32_t nn); +Hacl_Hash_Blake2b_Simd256_init(Lib_IntVector_Intrinsics_vec256 *hash, uint32_t kk, uint32_t nn); void -Hacl_Blake2b_256_blake2b_update_key( - Lib_IntVector_Intrinsics_vec256 *wv, - Lib_IntVector_Intrinsics_vec256 *hash, - uint32_t kk, - uint8_t *k, - uint32_t ll -); - -void -Hacl_Blake2b_256_blake2b_update_multi( +Hacl_Hash_Blake2b_Simd256_update_multi( uint32_t len, Lib_IntVector_Intrinsics_vec256 *wv, Lib_IntVector_Intrinsics_vec256 *hash, @@ -61,7 +53,7 @@ Hacl_Blake2b_256_blake2b_update_multi( ); void -Hacl_Blake2b_256_blake2b_update_last( +Hacl_Hash_Blake2b_Simd256_update_last( uint32_t len, Lib_IntVector_Intrinsics_vec256 *wv, Lib_IntVector_Intrinsics_vec256 *hash, @@ -71,49 +63,29 @@ Hacl_Blake2b_256_blake2b_update_last( ); void -Hacl_Blake2b_256_blake2b_finish( +Hacl_Hash_Blake2b_Simd256_finish( uint32_t nn, uint8_t *output, Lib_IntVector_Intrinsics_vec256 *hash ); -/** -Write the BLAKE2b digest of message `d` using key `k` into `output`. - -@param nn Length of the to-be-generated digest with 1 <= `nn` <= 64. -@param output Pointer to `nn` bytes of memory where the digest is written to. -@param ll Length of the input message. -@param d Pointer to `ll` bytes of memory where the input message is read from. -@param kk Length of the key. Can be 0. -@param k Pointer to `kk` bytes of memory where the key is read from. -*/ -void -Hacl_Blake2b_256_blake2b( - uint32_t nn, - uint8_t *output, - uint32_t ll, - uint8_t *d, - uint32_t kk, - uint8_t *k -); - void -Hacl_Blake2b_256_load_state256b_from_state32( +Hacl_Hash_Blake2b_Simd256_load_state256b_from_state32( Lib_IntVector_Intrinsics_vec256 *st, uint64_t *st32 ); void -Hacl_Blake2b_256_store_state256b_to_state32( +Hacl_Hash_Blake2b_Simd256_store_state256b_to_state32( uint64_t *st32, Lib_IntVector_Intrinsics_vec256 *st ); -Lib_IntVector_Intrinsics_vec256 *Hacl_Blake2b_256_blake2b_malloc(void); +Lib_IntVector_Intrinsics_vec256 *Hacl_Hash_Blake2b_Simd256_malloc_with_key(void); #if defined(__cplusplus) } #endif -#define __Hacl_Hash_Blake2b_256_H_DEFINED +#define __internal_Hacl_Hash_Blake2b_Simd256_H_DEFINED #endif diff --git a/include/internal/Hacl_Hash_Blake2s.h b/include/internal/Hacl_Hash_Blake2s.h new file mode 100644 index 00000000..f814aa95 --- /dev/null +++ b/include/internal/Hacl_Hash_Blake2s.h @@ -0,0 +1,70 @@ +/* MIT License + * + * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation + * Copyright (c) 2022-2023 HACL* Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + + +#ifndef __internal_Hacl_Hash_Blake2s_H +#define __internal_Hacl_Hash_Blake2s_H + +#if defined(__cplusplus) +extern "C" { +#endif + +#include +#include "krml/internal/types.h" +#include "krml/lowstar_endianness.h" +#include "krml/internal/target.h" + +#include "internal/Hacl_Impl_Blake2_Constants.h" +#include "../Hacl_Hash_Blake2s.h" + +void Hacl_Hash_Blake2s_init(uint32_t *hash, uint32_t kk, uint32_t nn); + +void +Hacl_Hash_Blake2s_update_multi( + uint32_t len, + uint32_t *wv, + uint32_t *hash, + uint64_t prev, + uint8_t *blocks, + uint32_t nb +); + +void +Hacl_Hash_Blake2s_update_last( + uint32_t len, + uint32_t *wv, + uint32_t *hash, + uint64_t prev, + uint32_t rem, + uint8_t *d +); + +void Hacl_Hash_Blake2s_finish(uint32_t nn, uint8_t *output, uint32_t *hash); + +#if defined(__cplusplus) +} +#endif + +#define __internal_Hacl_Hash_Blake2s_H_DEFINED +#endif diff --git a/include/msvc/Hacl_Hash_Blake2s_128.h b/include/internal/Hacl_Hash_Blake2s_Simd128.h similarity index 61% rename from include/msvc/Hacl_Hash_Blake2s_128.h rename to include/internal/Hacl_Hash_Blake2s_Simd128.h index 2af827cd..0589aec5 100644 --- a/include/msvc/Hacl_Hash_Blake2s_128.h +++ b/include/internal/Hacl_Hash_Blake2s_Simd128.h @@ -23,8 +23,8 @@ */ -#ifndef __Hacl_Hash_Blake2s_128_H -#define __Hacl_Hash_Blake2s_128_H +#ifndef __internal_Hacl_Hash_Blake2s_Simd128_H +#define __internal_Hacl_Hash_Blake2s_Simd128_H #if defined(__cplusplus) extern "C" { @@ -35,22 +35,15 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" +#include "internal/Hacl_Impl_Blake2_Constants.h" +#include "../Hacl_Hash_Blake2s_Simd128.h" #include "libintvector.h" void -Hacl_Blake2s_128_blake2s_init(Lib_IntVector_Intrinsics_vec128 *hash, uint32_t kk, uint32_t nn); +Hacl_Hash_Blake2s_Simd128_init(Lib_IntVector_Intrinsics_vec128 *hash, uint32_t kk, uint32_t nn); void -Hacl_Blake2s_128_blake2s_update_key( - Lib_IntVector_Intrinsics_vec128 *wv, - Lib_IntVector_Intrinsics_vec128 *hash, - uint32_t kk, - uint8_t *k, - uint32_t ll -); - -void -Hacl_Blake2s_128_blake2s_update_multi( +Hacl_Hash_Blake2s_Simd128_update_multi( uint32_t len, Lib_IntVector_Intrinsics_vec128 *wv, Lib_IntVector_Intrinsics_vec128 *hash, @@ -60,7 +53,7 @@ Hacl_Blake2s_128_blake2s_update_multi( ); void -Hacl_Blake2s_128_blake2s_update_last( +Hacl_Hash_Blake2s_Simd128_update_last( uint32_t len, Lib_IntVector_Intrinsics_vec128 *wv, Lib_IntVector_Intrinsics_vec128 *hash, @@ -70,49 +63,29 @@ Hacl_Blake2s_128_blake2s_update_last( ); void -Hacl_Blake2s_128_blake2s_finish( +Hacl_Hash_Blake2s_Simd128_finish( uint32_t nn, uint8_t *output, Lib_IntVector_Intrinsics_vec128 *hash ); -/** -Write the BLAKE2s digest of message `d` using key `k` into `output`. - -@param nn Length of to-be-generated digest with 1 <= `nn` <= 32. -@param output Pointer to `nn` bytes of memory where the digest is written to. -@param ll Length of the input message. -@param d Pointer to `ll` bytes of memory where the input message is read from. -@param kk Length of the key. Can be 0. -@param k Pointer to `kk` bytes of memory where the key is read from. -*/ -void -Hacl_Blake2s_128_blake2s( - uint32_t nn, - uint8_t *output, - uint32_t ll, - uint8_t *d, - uint32_t kk, - uint8_t *k -); - void -Hacl_Blake2s_128_store_state128s_to_state32( +Hacl_Hash_Blake2s_Simd128_store_state128s_to_state32( uint32_t *st32, Lib_IntVector_Intrinsics_vec128 *st ); void -Hacl_Blake2s_128_load_state128s_from_state32( +Hacl_Hash_Blake2s_Simd128_load_state128s_from_state32( Lib_IntVector_Intrinsics_vec128 *st, uint32_t *st32 ); -Lib_IntVector_Intrinsics_vec128 *Hacl_Blake2s_128_blake2s_malloc(void); +Lib_IntVector_Intrinsics_vec128 *Hacl_Hash_Blake2s_Simd128_malloc_with_key(void); #if defined(__cplusplus) } #endif -#define __Hacl_Hash_Blake2s_128_H_DEFINED +#define __internal_Hacl_Hash_Blake2s_Simd128_H_DEFINED #endif diff --git a/include/internal/Hacl_Hash_MD5.h b/include/internal/Hacl_Hash_MD5.h index 7fd567f3..dd77aaf1 100644 --- a/include/internal/Hacl_Hash_MD5.h +++ b/include/internal/Hacl_Hash_MD5.h @@ -37,21 +37,16 @@ extern "C" { #include "../Hacl_Hash_MD5.h" -void Hacl_Hash_Core_MD5_legacy_init(uint32_t *s); +void Hacl_Hash_MD5_init(uint32_t *s); -void Hacl_Hash_Core_MD5_legacy_finish(uint32_t *s, uint8_t *dst); +void Hacl_Hash_MD5_finish(uint32_t *s, uint8_t *dst); -void Hacl_Hash_MD5_legacy_update_multi(uint32_t *s, uint8_t *blocks, uint32_t n_blocks); +void Hacl_Hash_MD5_update_multi(uint32_t *s, uint8_t *blocks, uint32_t n_blocks); void -Hacl_Hash_MD5_legacy_update_last( - uint32_t *s, - uint64_t prev_len, - uint8_t *input, - uint32_t input_len -); - -void Hacl_Hash_MD5_legacy_hash(uint8_t *input, uint32_t input_len, uint8_t *dst); +Hacl_Hash_MD5_update_last(uint32_t *s, uint64_t prev_len, uint8_t *input, uint32_t input_len); + +void Hacl_Hash_MD5_hash_oneshot(uint8_t *output, uint8_t *input, uint32_t input_len); #if defined(__cplusplus) } diff --git a/include/internal/Hacl_Hash_SHA1.h b/include/internal/Hacl_Hash_SHA1.h index 72cf492c..ed53be55 100644 --- a/include/internal/Hacl_Hash_SHA1.h +++ b/include/internal/Hacl_Hash_SHA1.h @@ -37,21 +37,16 @@ extern "C" { #include "../Hacl_Hash_SHA1.h" -void Hacl_Hash_Core_SHA1_legacy_init(uint32_t *s); +void Hacl_Hash_SHA1_init(uint32_t *s); -void Hacl_Hash_Core_SHA1_legacy_finish(uint32_t *s, uint8_t *dst); +void Hacl_Hash_SHA1_finish(uint32_t *s, uint8_t *dst); -void Hacl_Hash_SHA1_legacy_update_multi(uint32_t *s, uint8_t *blocks, uint32_t n_blocks); +void Hacl_Hash_SHA1_update_multi(uint32_t *s, uint8_t *blocks, uint32_t n_blocks); void -Hacl_Hash_SHA1_legacy_update_last( - uint32_t *s, - uint64_t prev_len, - uint8_t *input, - uint32_t input_len -); - -void Hacl_Hash_SHA1_legacy_hash(uint8_t *input, uint32_t input_len, uint8_t *dst); +Hacl_Hash_SHA1_update_last(uint32_t *s, uint64_t prev_len, uint8_t *input, uint32_t input_len); + +void Hacl_Hash_SHA1_hash_oneshot(uint8_t *output, uint8_t *input, uint32_t input_len); #if defined(__cplusplus) } diff --git a/include/internal/Hacl_Hash_SHA2.h b/include/internal/Hacl_Hash_SHA2.h index bbffdc50..7dade3f3 100644 --- a/include/internal/Hacl_Hash_SHA2.h +++ b/include/internal/Hacl_Hash_SHA2.h @@ -40,141 +40,121 @@ extern "C" { static const uint32_t -Hacl_Impl_SHA2_Generic_h224[8U] = +Hacl_Hash_SHA2_h224[8U] = { - (uint32_t)0xc1059ed8U, (uint32_t)0x367cd507U, (uint32_t)0x3070dd17U, (uint32_t)0xf70e5939U, - (uint32_t)0xffc00b31U, (uint32_t)0x68581511U, (uint32_t)0x64f98fa7U, (uint32_t)0xbefa4fa4U + 0xc1059ed8U, 0x367cd507U, 0x3070dd17U, 0xf70e5939U, 0xffc00b31U, 0x68581511U, 0x64f98fa7U, + 0xbefa4fa4U }; static const uint32_t -Hacl_Impl_SHA2_Generic_h256[8U] = +Hacl_Hash_SHA2_h256[8U] = { - (uint32_t)0x6a09e667U, (uint32_t)0xbb67ae85U, (uint32_t)0x3c6ef372U, (uint32_t)0xa54ff53aU, - (uint32_t)0x510e527fU, (uint32_t)0x9b05688cU, (uint32_t)0x1f83d9abU, (uint32_t)0x5be0cd19U + 0x6a09e667U, 0xbb67ae85U, 0x3c6ef372U, 0xa54ff53aU, 0x510e527fU, 0x9b05688cU, 0x1f83d9abU, + 0x5be0cd19U }; static const uint64_t -Hacl_Impl_SHA2_Generic_h384[8U] = +Hacl_Hash_SHA2_h384[8U] = { - (uint64_t)0xcbbb9d5dc1059ed8U, (uint64_t)0x629a292a367cd507U, (uint64_t)0x9159015a3070dd17U, - (uint64_t)0x152fecd8f70e5939U, (uint64_t)0x67332667ffc00b31U, (uint64_t)0x8eb44a8768581511U, - (uint64_t)0xdb0c2e0d64f98fa7U, (uint64_t)0x47b5481dbefa4fa4U + 0xcbbb9d5dc1059ed8ULL, 0x629a292a367cd507ULL, 0x9159015a3070dd17ULL, 0x152fecd8f70e5939ULL, + 0x67332667ffc00b31ULL, 0x8eb44a8768581511ULL, 0xdb0c2e0d64f98fa7ULL, 0x47b5481dbefa4fa4ULL }; static const uint64_t -Hacl_Impl_SHA2_Generic_h512[8U] = +Hacl_Hash_SHA2_h512[8U] = { - (uint64_t)0x6a09e667f3bcc908U, (uint64_t)0xbb67ae8584caa73bU, (uint64_t)0x3c6ef372fe94f82bU, - (uint64_t)0xa54ff53a5f1d36f1U, (uint64_t)0x510e527fade682d1U, (uint64_t)0x9b05688c2b3e6c1fU, - (uint64_t)0x1f83d9abfb41bd6bU, (uint64_t)0x5be0cd19137e2179U + 0x6a09e667f3bcc908ULL, 0xbb67ae8584caa73bULL, 0x3c6ef372fe94f82bULL, 0xa54ff53a5f1d36f1ULL, + 0x510e527fade682d1ULL, 0x9b05688c2b3e6c1fULL, 0x1f83d9abfb41bd6bULL, 0x5be0cd19137e2179ULL }; static const uint32_t -Hacl_Impl_SHA2_Generic_k224_256[64U] = +Hacl_Hash_SHA2_k224_256[64U] = { - (uint32_t)0x428a2f98U, (uint32_t)0x71374491U, (uint32_t)0xb5c0fbcfU, (uint32_t)0xe9b5dba5U, - (uint32_t)0x3956c25bU, (uint32_t)0x59f111f1U, (uint32_t)0x923f82a4U, (uint32_t)0xab1c5ed5U, - (uint32_t)0xd807aa98U, (uint32_t)0x12835b01U, (uint32_t)0x243185beU, (uint32_t)0x550c7dc3U, - (uint32_t)0x72be5d74U, (uint32_t)0x80deb1feU, (uint32_t)0x9bdc06a7U, (uint32_t)0xc19bf174U, - (uint32_t)0xe49b69c1U, (uint32_t)0xefbe4786U, (uint32_t)0x0fc19dc6U, (uint32_t)0x240ca1ccU, - (uint32_t)0x2de92c6fU, (uint32_t)0x4a7484aaU, (uint32_t)0x5cb0a9dcU, (uint32_t)0x76f988daU, - (uint32_t)0x983e5152U, (uint32_t)0xa831c66dU, (uint32_t)0xb00327c8U, (uint32_t)0xbf597fc7U, - (uint32_t)0xc6e00bf3U, (uint32_t)0xd5a79147U, (uint32_t)0x06ca6351U, (uint32_t)0x14292967U, - (uint32_t)0x27b70a85U, (uint32_t)0x2e1b2138U, (uint32_t)0x4d2c6dfcU, (uint32_t)0x53380d13U, - (uint32_t)0x650a7354U, (uint32_t)0x766a0abbU, (uint32_t)0x81c2c92eU, (uint32_t)0x92722c85U, - (uint32_t)0xa2bfe8a1U, (uint32_t)0xa81a664bU, (uint32_t)0xc24b8b70U, (uint32_t)0xc76c51a3U, - (uint32_t)0xd192e819U, (uint32_t)0xd6990624U, (uint32_t)0xf40e3585U, (uint32_t)0x106aa070U, - (uint32_t)0x19a4c116U, (uint32_t)0x1e376c08U, (uint32_t)0x2748774cU, (uint32_t)0x34b0bcb5U, - (uint32_t)0x391c0cb3U, (uint32_t)0x4ed8aa4aU, (uint32_t)0x5b9cca4fU, (uint32_t)0x682e6ff3U, - (uint32_t)0x748f82eeU, (uint32_t)0x78a5636fU, (uint32_t)0x84c87814U, (uint32_t)0x8cc70208U, - (uint32_t)0x90befffaU, (uint32_t)0xa4506cebU, (uint32_t)0xbef9a3f7U, (uint32_t)0xc67178f2U + 0x428a2f98U, 0x71374491U, 0xb5c0fbcfU, 0xe9b5dba5U, 0x3956c25bU, 0x59f111f1U, 0x923f82a4U, + 0xab1c5ed5U, 0xd807aa98U, 0x12835b01U, 0x243185beU, 0x550c7dc3U, 0x72be5d74U, 0x80deb1feU, + 0x9bdc06a7U, 0xc19bf174U, 0xe49b69c1U, 0xefbe4786U, 0x0fc19dc6U, 0x240ca1ccU, 0x2de92c6fU, + 0x4a7484aaU, 0x5cb0a9dcU, 0x76f988daU, 0x983e5152U, 0xa831c66dU, 0xb00327c8U, 0xbf597fc7U, + 0xc6e00bf3U, 0xd5a79147U, 0x06ca6351U, 0x14292967U, 0x27b70a85U, 0x2e1b2138U, 0x4d2c6dfcU, + 0x53380d13U, 0x650a7354U, 0x766a0abbU, 0x81c2c92eU, 0x92722c85U, 0xa2bfe8a1U, 0xa81a664bU, + 0xc24b8b70U, 0xc76c51a3U, 0xd192e819U, 0xd6990624U, 0xf40e3585U, 0x106aa070U, 0x19a4c116U, + 0x1e376c08U, 0x2748774cU, 0x34b0bcb5U, 0x391c0cb3U, 0x4ed8aa4aU, 0x5b9cca4fU, 0x682e6ff3U, + 0x748f82eeU, 0x78a5636fU, 0x84c87814U, 0x8cc70208U, 0x90befffaU, 0xa4506cebU, 0xbef9a3f7U, + 0xc67178f2U }; static const uint64_t -Hacl_Impl_SHA2_Generic_k384_512[80U] = +Hacl_Hash_SHA2_k384_512[80U] = { - (uint64_t)0x428a2f98d728ae22U, (uint64_t)0x7137449123ef65cdU, (uint64_t)0xb5c0fbcfec4d3b2fU, - (uint64_t)0xe9b5dba58189dbbcU, (uint64_t)0x3956c25bf348b538U, (uint64_t)0x59f111f1b605d019U, - (uint64_t)0x923f82a4af194f9bU, (uint64_t)0xab1c5ed5da6d8118U, (uint64_t)0xd807aa98a3030242U, - (uint64_t)0x12835b0145706fbeU, (uint64_t)0x243185be4ee4b28cU, (uint64_t)0x550c7dc3d5ffb4e2U, - (uint64_t)0x72be5d74f27b896fU, (uint64_t)0x80deb1fe3b1696b1U, (uint64_t)0x9bdc06a725c71235U, - (uint64_t)0xc19bf174cf692694U, (uint64_t)0xe49b69c19ef14ad2U, (uint64_t)0xefbe4786384f25e3U, - (uint64_t)0x0fc19dc68b8cd5b5U, (uint64_t)0x240ca1cc77ac9c65U, (uint64_t)0x2de92c6f592b0275U, - (uint64_t)0x4a7484aa6ea6e483U, (uint64_t)0x5cb0a9dcbd41fbd4U, (uint64_t)0x76f988da831153b5U, - (uint64_t)0x983e5152ee66dfabU, (uint64_t)0xa831c66d2db43210U, (uint64_t)0xb00327c898fb213fU, - (uint64_t)0xbf597fc7beef0ee4U, (uint64_t)0xc6e00bf33da88fc2U, (uint64_t)0xd5a79147930aa725U, - (uint64_t)0x06ca6351e003826fU, (uint64_t)0x142929670a0e6e70U, (uint64_t)0x27b70a8546d22ffcU, - (uint64_t)0x2e1b21385c26c926U, (uint64_t)0x4d2c6dfc5ac42aedU, (uint64_t)0x53380d139d95b3dfU, - (uint64_t)0x650a73548baf63deU, (uint64_t)0x766a0abb3c77b2a8U, (uint64_t)0x81c2c92e47edaee6U, - (uint64_t)0x92722c851482353bU, (uint64_t)0xa2bfe8a14cf10364U, (uint64_t)0xa81a664bbc423001U, - (uint64_t)0xc24b8b70d0f89791U, (uint64_t)0xc76c51a30654be30U, (uint64_t)0xd192e819d6ef5218U, - (uint64_t)0xd69906245565a910U, (uint64_t)0xf40e35855771202aU, (uint64_t)0x106aa07032bbd1b8U, - (uint64_t)0x19a4c116b8d2d0c8U, (uint64_t)0x1e376c085141ab53U, (uint64_t)0x2748774cdf8eeb99U, - (uint64_t)0x34b0bcb5e19b48a8U, (uint64_t)0x391c0cb3c5c95a63U, (uint64_t)0x4ed8aa4ae3418acbU, - (uint64_t)0x5b9cca4f7763e373U, (uint64_t)0x682e6ff3d6b2b8a3U, (uint64_t)0x748f82ee5defb2fcU, - (uint64_t)0x78a5636f43172f60U, (uint64_t)0x84c87814a1f0ab72U, (uint64_t)0x8cc702081a6439ecU, - (uint64_t)0x90befffa23631e28U, (uint64_t)0xa4506cebde82bde9U, (uint64_t)0xbef9a3f7b2c67915U, - (uint64_t)0xc67178f2e372532bU, (uint64_t)0xca273eceea26619cU, (uint64_t)0xd186b8c721c0c207U, - (uint64_t)0xeada7dd6cde0eb1eU, (uint64_t)0xf57d4f7fee6ed178U, (uint64_t)0x06f067aa72176fbaU, - (uint64_t)0x0a637dc5a2c898a6U, (uint64_t)0x113f9804bef90daeU, (uint64_t)0x1b710b35131c471bU, - (uint64_t)0x28db77f523047d84U, (uint64_t)0x32caab7b40c72493U, (uint64_t)0x3c9ebe0a15c9bebcU, - (uint64_t)0x431d67c49c100d4cU, (uint64_t)0x4cc5d4becb3e42b6U, (uint64_t)0x597f299cfc657e2aU, - (uint64_t)0x5fcb6fab3ad6faecU, (uint64_t)0x6c44198c4a475817U + 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, 0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL, + 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL, 0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL, + 0xd807aa98a3030242ULL, 0x12835b0145706fbeULL, 0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL, + 0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL, 0x9bdc06a725c71235ULL, 0xc19bf174cf692694ULL, + 0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL, 0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL, + 0x2de92c6f592b0275ULL, 0x4a7484aa6ea6e483ULL, 0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL, + 0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL, 0xb00327c898fb213fULL, 0xbf597fc7beef0ee4ULL, + 0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL, 0x06ca6351e003826fULL, 0x142929670a0e6e70ULL, + 0x27b70a8546d22ffcULL, 0x2e1b21385c26c926ULL, 0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL, + 0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL, 0x81c2c92e47edaee6ULL, 0x92722c851482353bULL, + 0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL, 0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL, + 0xd192e819d6ef5218ULL, 0xd69906245565a910ULL, 0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL, + 0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL, 0x2748774cdf8eeb99ULL, 0x34b0bcb5e19b48a8ULL, + 0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL, 0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL, + 0x748f82ee5defb2fcULL, 0x78a5636f43172f60ULL, 0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL, + 0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL, 0xbef9a3f7b2c67915ULL, 0xc67178f2e372532bULL, + 0xca273eceea26619cULL, 0xd186b8c721c0c207ULL, 0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL, + 0x06f067aa72176fbaULL, 0x0a637dc5a2c898a6ULL, 0x113f9804bef90daeULL, 0x1b710b35131c471bULL, + 0x28db77f523047d84ULL, 0x32caab7b40c72493ULL, 0x3c9ebe0a15c9bebcULL, 0x431d67c49c100d4cULL, + 0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL, 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL }; -void Hacl_SHA2_Scalar32_sha256_init(uint32_t *hash); +void Hacl_Hash_SHA2_sha256_init(uint32_t *hash); -void Hacl_SHA2_Scalar32_sha256_update_nblocks(uint32_t len, uint8_t *b, uint32_t *st); +void Hacl_Hash_SHA2_sha256_update_nblocks(uint32_t len, uint8_t *b, uint32_t *st); void -Hacl_SHA2_Scalar32_sha256_update_last( - uint64_t totlen, - uint32_t len, - uint8_t *b, - uint32_t *hash -); +Hacl_Hash_SHA2_sha256_update_last(uint64_t totlen, uint32_t len, uint8_t *b, uint32_t *hash); -void Hacl_SHA2_Scalar32_sha256_finish(uint32_t *st, uint8_t *h); +void Hacl_Hash_SHA2_sha256_finish(uint32_t *st, uint8_t *h); -void Hacl_SHA2_Scalar32_sha224_init(uint32_t *hash); +void Hacl_Hash_SHA2_sha224_init(uint32_t *hash); void -Hacl_SHA2_Scalar32_sha224_update_last(uint64_t totlen, uint32_t len, uint8_t *b, uint32_t *st); +Hacl_Hash_SHA2_sha224_update_last(uint64_t totlen, uint32_t len, uint8_t *b, uint32_t *st); -void Hacl_SHA2_Scalar32_sha224_finish(uint32_t *st, uint8_t *h); +void Hacl_Hash_SHA2_sha224_finish(uint32_t *st, uint8_t *h); -void Hacl_SHA2_Scalar32_sha512_init(uint64_t *hash); +void Hacl_Hash_SHA2_sha512_init(uint64_t *hash); -void Hacl_SHA2_Scalar32_sha512_update_nblocks(uint32_t len, uint8_t *b, uint64_t *st); +void Hacl_Hash_SHA2_sha512_update_nblocks(uint32_t len, uint8_t *b, uint64_t *st); void -Hacl_SHA2_Scalar32_sha512_update_last( +Hacl_Hash_SHA2_sha512_update_last( FStar_UInt128_uint128 totlen, uint32_t len, uint8_t *b, uint64_t *hash ); -void Hacl_SHA2_Scalar32_sha512_finish(uint64_t *st, uint8_t *h); +void Hacl_Hash_SHA2_sha512_finish(uint64_t *st, uint8_t *h); -void Hacl_SHA2_Scalar32_sha384_init(uint64_t *hash); +void Hacl_Hash_SHA2_sha384_init(uint64_t *hash); -void Hacl_SHA2_Scalar32_sha384_update_nblocks(uint32_t len, uint8_t *b, uint64_t *st); +void Hacl_Hash_SHA2_sha384_update_nblocks(uint32_t len, uint8_t *b, uint64_t *st); void -Hacl_SHA2_Scalar32_sha384_update_last( +Hacl_Hash_SHA2_sha384_update_last( FStar_UInt128_uint128 totlen, uint32_t len, uint8_t *b, uint64_t *st ); -void Hacl_SHA2_Scalar32_sha384_finish(uint64_t *st, uint8_t *h); +void Hacl_Hash_SHA2_sha384_finish(uint64_t *st, uint8_t *h); #if defined(__cplusplus) } diff --git a/include/internal/Hacl_Hash_SHA3.h b/include/internal/Hacl_Hash_SHA3.h index 6f53d37c..1c8129fb 100644 --- a/include/internal/Hacl_Hash_SHA3.h +++ b/include/internal/Hacl_Hash_SHA3.h @@ -53,9 +53,9 @@ Hacl_Hash_SHA3_update_last_sha3( uint32_t input_len ); -void Hacl_Impl_SHA3_state_permute(uint64_t *s); +void Hacl_Hash_SHA3_state_permute(uint64_t *s); -void Hacl_Impl_SHA3_loadState(uint32_t rateInBytes, uint8_t *input, uint64_t *s); +void Hacl_Hash_SHA3_loadState(uint32_t rateInBytes, uint8_t *input, uint64_t *s); #if defined(__cplusplus) } diff --git a/include/internal/Hacl_Impl_Blake2_Constants.h b/include/internal/Hacl_Impl_Blake2_Constants.h index 185317ba..aedc2486 100644 --- a/include/internal/Hacl_Impl_Blake2_Constants.h +++ b/include/internal/Hacl_Impl_Blake2_Constants.h @@ -37,52 +37,32 @@ extern "C" { static const uint32_t -Hacl_Impl_Blake2_Constants_sigmaTable[160U] = +Hacl_Hash_Blake2s_sigmaTable[160U] = { - (uint32_t)0U, (uint32_t)1U, (uint32_t)2U, (uint32_t)3U, (uint32_t)4U, (uint32_t)5U, - (uint32_t)6U, (uint32_t)7U, (uint32_t)8U, (uint32_t)9U, (uint32_t)10U, (uint32_t)11U, - (uint32_t)12U, (uint32_t)13U, (uint32_t)14U, (uint32_t)15U, (uint32_t)14U, (uint32_t)10U, - (uint32_t)4U, (uint32_t)8U, (uint32_t)9U, (uint32_t)15U, (uint32_t)13U, (uint32_t)6U, - (uint32_t)1U, (uint32_t)12U, (uint32_t)0U, (uint32_t)2U, (uint32_t)11U, (uint32_t)7U, - (uint32_t)5U, (uint32_t)3U, (uint32_t)11U, (uint32_t)8U, (uint32_t)12U, (uint32_t)0U, - (uint32_t)5U, (uint32_t)2U, (uint32_t)15U, (uint32_t)13U, (uint32_t)10U, (uint32_t)14U, - (uint32_t)3U, (uint32_t)6U, (uint32_t)7U, (uint32_t)1U, (uint32_t)9U, (uint32_t)4U, - (uint32_t)7U, (uint32_t)9U, (uint32_t)3U, (uint32_t)1U, (uint32_t)13U, (uint32_t)12U, - (uint32_t)11U, (uint32_t)14U, (uint32_t)2U, (uint32_t)6U, (uint32_t)5U, (uint32_t)10U, - (uint32_t)4U, (uint32_t)0U, (uint32_t)15U, (uint32_t)8U, (uint32_t)9U, (uint32_t)0U, - (uint32_t)5U, (uint32_t)7U, (uint32_t)2U, (uint32_t)4U, (uint32_t)10U, (uint32_t)15U, - (uint32_t)14U, (uint32_t)1U, (uint32_t)11U, (uint32_t)12U, (uint32_t)6U, (uint32_t)8U, - (uint32_t)3U, (uint32_t)13U, (uint32_t)2U, (uint32_t)12U, (uint32_t)6U, (uint32_t)10U, - (uint32_t)0U, (uint32_t)11U, (uint32_t)8U, (uint32_t)3U, (uint32_t)4U, (uint32_t)13U, - (uint32_t)7U, (uint32_t)5U, (uint32_t)15U, (uint32_t)14U, (uint32_t)1U, (uint32_t)9U, - (uint32_t)12U, (uint32_t)5U, (uint32_t)1U, (uint32_t)15U, (uint32_t)14U, (uint32_t)13U, - (uint32_t)4U, (uint32_t)10U, (uint32_t)0U, (uint32_t)7U, (uint32_t)6U, (uint32_t)3U, - (uint32_t)9U, (uint32_t)2U, (uint32_t)8U, (uint32_t)11U, (uint32_t)13U, (uint32_t)11U, - (uint32_t)7U, (uint32_t)14U, (uint32_t)12U, (uint32_t)1U, (uint32_t)3U, (uint32_t)9U, - (uint32_t)5U, (uint32_t)0U, (uint32_t)15U, (uint32_t)4U, (uint32_t)8U, (uint32_t)6U, - (uint32_t)2U, (uint32_t)10U, (uint32_t)6U, (uint32_t)15U, (uint32_t)14U, (uint32_t)9U, - (uint32_t)11U, (uint32_t)3U, (uint32_t)0U, (uint32_t)8U, (uint32_t)12U, (uint32_t)2U, - (uint32_t)13U, (uint32_t)7U, (uint32_t)1U, (uint32_t)4U, (uint32_t)10U, (uint32_t)5U, - (uint32_t)10U, (uint32_t)2U, (uint32_t)8U, (uint32_t)4U, (uint32_t)7U, (uint32_t)6U, - (uint32_t)1U, (uint32_t)5U, (uint32_t)15U, (uint32_t)11U, (uint32_t)9U, (uint32_t)14U, - (uint32_t)3U, (uint32_t)12U, (uint32_t)13U + 0U, 1U, 2U, 3U, 4U, 5U, 6U, 7U, 8U, 9U, 10U, 11U, 12U, 13U, 14U, 15U, 14U, 10U, 4U, 8U, 9U, 15U, + 13U, 6U, 1U, 12U, 0U, 2U, 11U, 7U, 5U, 3U, 11U, 8U, 12U, 0U, 5U, 2U, 15U, 13U, 10U, 14U, 3U, 6U, + 7U, 1U, 9U, 4U, 7U, 9U, 3U, 1U, 13U, 12U, 11U, 14U, 2U, 6U, 5U, 10U, 4U, 0U, 15U, 8U, 9U, 0U, + 5U, 7U, 2U, 4U, 10U, 15U, 14U, 1U, 11U, 12U, 6U, 8U, 3U, 13U, 2U, 12U, 6U, 10U, 0U, 11U, 8U, 3U, + 4U, 13U, 7U, 5U, 15U, 14U, 1U, 9U, 12U, 5U, 1U, 15U, 14U, 13U, 4U, 10U, 0U, 7U, 6U, 3U, 9U, 2U, + 8U, 11U, 13U, 11U, 7U, 14U, 12U, 1U, 3U, 9U, 5U, 0U, 15U, 4U, 8U, 6U, 2U, 10U, 6U, 15U, 14U, 9U, + 11U, 3U, 0U, 8U, 12U, 2U, 13U, 7U, 1U, 4U, 10U, 5U, 10U, 2U, 8U, 4U, 7U, 6U, 1U, 5U, 15U, 11U, + 9U, 14U, 3U, 12U, 13U }; static const uint32_t -Hacl_Impl_Blake2_Constants_ivTable_S[8U] = +Hacl_Hash_Blake2s_ivTable_S[8U] = { - (uint32_t)0x6A09E667U, (uint32_t)0xBB67AE85U, (uint32_t)0x3C6EF372U, (uint32_t)0xA54FF53AU, - (uint32_t)0x510E527FU, (uint32_t)0x9B05688CU, (uint32_t)0x1F83D9ABU, (uint32_t)0x5BE0CD19U + 0x6A09E667U, 0xBB67AE85U, 0x3C6EF372U, 0xA54FF53AU, 0x510E527FU, 0x9B05688CU, 0x1F83D9ABU, + 0x5BE0CD19U }; static const uint64_t -Hacl_Impl_Blake2_Constants_ivTable_B[8U] = +Hacl_Hash_Blake2s_ivTable_B[8U] = { - (uint64_t)0x6A09E667F3BCC908U, (uint64_t)0xBB67AE8584CAA73BU, (uint64_t)0x3C6EF372FE94F82BU, - (uint64_t)0xA54FF53A5F1D36F1U, (uint64_t)0x510E527FADE682D1U, (uint64_t)0x9B05688C2B3E6C1FU, - (uint64_t)0x1F83D9ABFB41BD6BU, (uint64_t)0x5BE0CD19137E2179U + 0x6A09E667F3BCC908ULL, 0xBB67AE8584CAA73BULL, 0x3C6EF372FE94F82BULL, 0xA54FF53A5F1D36F1ULL, + 0x510E527FADE682D1ULL, 0x9B05688C2B3E6C1FULL, 0x1F83D9ABFB41BD6BULL, 0x5BE0CD19137E2179ULL }; #if defined(__cplusplus) diff --git a/include/internal/Hacl_Impl_FFDHE_Constants.h b/include/internal/Hacl_Impl_FFDHE_Constants.h index c746c411..80cbdd52 100644 --- a/include/internal/Hacl_Impl_FFDHE_Constants.h +++ b/include/internal/Hacl_Impl_FFDHE_Constants.h @@ -35,528 +35,265 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -static const uint8_t Hacl_Impl_FFDHE_Constants_ffdhe_g2[1U] = { (uint8_t)0x02U }; +static const uint8_t Hacl_Impl_FFDHE_Constants_ffdhe_g2[1U] = { 0x02U }; static const uint8_t Hacl_Impl_FFDHE_Constants_ffdhe_p2048[256U] = { - (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, - (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xADU, (uint8_t)0xF8U, (uint8_t)0x54U, (uint8_t)0x58U, - (uint8_t)0xA2U, (uint8_t)0xBBU, (uint8_t)0x4AU, (uint8_t)0x9AU, (uint8_t)0xAFU, (uint8_t)0xDCU, - (uint8_t)0x56U, (uint8_t)0x20U, (uint8_t)0x27U, (uint8_t)0x3DU, (uint8_t)0x3CU, (uint8_t)0xF1U, - (uint8_t)0xD8U, (uint8_t)0xB9U, (uint8_t)0xC5U, (uint8_t)0x83U, (uint8_t)0xCEU, (uint8_t)0x2DU, - (uint8_t)0x36U, (uint8_t)0x95U, (uint8_t)0xA9U, (uint8_t)0xE1U, (uint8_t)0x36U, (uint8_t)0x41U, - (uint8_t)0x14U, (uint8_t)0x64U, (uint8_t)0x33U, (uint8_t)0xFBU, (uint8_t)0xCCU, (uint8_t)0x93U, - (uint8_t)0x9DU, (uint8_t)0xCEU, (uint8_t)0x24U, (uint8_t)0x9BU, (uint8_t)0x3EU, (uint8_t)0xF9U, - (uint8_t)0x7DU, (uint8_t)0x2FU, (uint8_t)0xE3U, (uint8_t)0x63U, (uint8_t)0x63U, (uint8_t)0x0CU, - (uint8_t)0x75U, (uint8_t)0xD8U, (uint8_t)0xF6U, (uint8_t)0x81U, (uint8_t)0xB2U, (uint8_t)0x02U, - (uint8_t)0xAEU, (uint8_t)0xC4U, (uint8_t)0x61U, (uint8_t)0x7AU, (uint8_t)0xD3U, (uint8_t)0xDFU, - (uint8_t)0x1EU, (uint8_t)0xD5U, (uint8_t)0xD5U, (uint8_t)0xFDU, (uint8_t)0x65U, (uint8_t)0x61U, - (uint8_t)0x24U, (uint8_t)0x33U, (uint8_t)0xF5U, (uint8_t)0x1FU, (uint8_t)0x5FU, (uint8_t)0x06U, - (uint8_t)0x6EU, (uint8_t)0xD0U, (uint8_t)0x85U, (uint8_t)0x63U, (uint8_t)0x65U, (uint8_t)0x55U, - (uint8_t)0x3DU, (uint8_t)0xEDU, (uint8_t)0x1AU, (uint8_t)0xF3U, (uint8_t)0xB5U, (uint8_t)0x57U, - (uint8_t)0x13U, (uint8_t)0x5EU, (uint8_t)0x7FU, (uint8_t)0x57U, (uint8_t)0xC9U, (uint8_t)0x35U, - (uint8_t)0x98U, (uint8_t)0x4FU, (uint8_t)0x0CU, (uint8_t)0x70U, (uint8_t)0xE0U, (uint8_t)0xE6U, - (uint8_t)0x8BU, (uint8_t)0x77U, (uint8_t)0xE2U, (uint8_t)0xA6U, (uint8_t)0x89U, (uint8_t)0xDAU, - (uint8_t)0xF3U, (uint8_t)0xEFU, (uint8_t)0xE8U, (uint8_t)0x72U, (uint8_t)0x1DU, (uint8_t)0xF1U, - (uint8_t)0x58U, (uint8_t)0xA1U, (uint8_t)0x36U, (uint8_t)0xADU, (uint8_t)0xE7U, (uint8_t)0x35U, - (uint8_t)0x30U, (uint8_t)0xACU, (uint8_t)0xCAU, (uint8_t)0x4FU, (uint8_t)0x48U, (uint8_t)0x3AU, - (uint8_t)0x79U, (uint8_t)0x7AU, (uint8_t)0xBCU, (uint8_t)0x0AU, (uint8_t)0xB1U, (uint8_t)0x82U, - (uint8_t)0xB3U, (uint8_t)0x24U, (uint8_t)0xFBU, (uint8_t)0x61U, (uint8_t)0xD1U, (uint8_t)0x08U, - (uint8_t)0xA9U, (uint8_t)0x4BU, (uint8_t)0xB2U, (uint8_t)0xC8U, (uint8_t)0xE3U, (uint8_t)0xFBU, - (uint8_t)0xB9U, (uint8_t)0x6AU, (uint8_t)0xDAU, (uint8_t)0xB7U, (uint8_t)0x60U, (uint8_t)0xD7U, - (uint8_t)0xF4U, (uint8_t)0x68U, (uint8_t)0x1DU, (uint8_t)0x4FU, (uint8_t)0x42U, (uint8_t)0xA3U, - (uint8_t)0xDEU, (uint8_t)0x39U, (uint8_t)0x4DU, (uint8_t)0xF4U, (uint8_t)0xAEU, (uint8_t)0x56U, - (uint8_t)0xEDU, (uint8_t)0xE7U, (uint8_t)0x63U, (uint8_t)0x72U, (uint8_t)0xBBU, (uint8_t)0x19U, - (uint8_t)0x0BU, (uint8_t)0x07U, (uint8_t)0xA7U, (uint8_t)0xC8U, (uint8_t)0xEEU, (uint8_t)0x0AU, - (uint8_t)0x6DU, (uint8_t)0x70U, (uint8_t)0x9EU, (uint8_t)0x02U, (uint8_t)0xFCU, (uint8_t)0xE1U, - (uint8_t)0xCDU, (uint8_t)0xF7U, (uint8_t)0xE2U, (uint8_t)0xECU, (uint8_t)0xC0U, (uint8_t)0x34U, - (uint8_t)0x04U, (uint8_t)0xCDU, (uint8_t)0x28U, (uint8_t)0x34U, (uint8_t)0x2FU, (uint8_t)0x61U, - (uint8_t)0x91U, (uint8_t)0x72U, (uint8_t)0xFEU, (uint8_t)0x9CU, (uint8_t)0xE9U, (uint8_t)0x85U, - (uint8_t)0x83U, (uint8_t)0xFFU, (uint8_t)0x8EU, (uint8_t)0x4FU, (uint8_t)0x12U, (uint8_t)0x32U, - (uint8_t)0xEEU, (uint8_t)0xF2U, (uint8_t)0x81U, (uint8_t)0x83U, (uint8_t)0xC3U, (uint8_t)0xFEU, - (uint8_t)0x3BU, (uint8_t)0x1BU, (uint8_t)0x4CU, (uint8_t)0x6FU, (uint8_t)0xADU, (uint8_t)0x73U, - (uint8_t)0x3BU, (uint8_t)0xB5U, (uint8_t)0xFCU, (uint8_t)0xBCU, (uint8_t)0x2EU, (uint8_t)0xC2U, - (uint8_t)0x20U, (uint8_t)0x05U, (uint8_t)0xC5U, (uint8_t)0x8EU, (uint8_t)0xF1U, (uint8_t)0x83U, - (uint8_t)0x7DU, (uint8_t)0x16U, (uint8_t)0x83U, (uint8_t)0xB2U, (uint8_t)0xC6U, (uint8_t)0xF3U, - (uint8_t)0x4AU, (uint8_t)0x26U, (uint8_t)0xC1U, (uint8_t)0xB2U, (uint8_t)0xEFU, (uint8_t)0xFAU, - (uint8_t)0x88U, (uint8_t)0x6BU, (uint8_t)0x42U, (uint8_t)0x38U, (uint8_t)0x61U, (uint8_t)0x28U, - (uint8_t)0x5CU, (uint8_t)0x97U, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, - (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU + 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xADU, 0xF8U, 0x54U, 0x58U, 0xA2U, + 0xBBU, 0x4AU, 0x9AU, 0xAFU, 0xDCU, 0x56U, 0x20U, 0x27U, 0x3DU, 0x3CU, 0xF1U, 0xD8U, 0xB9U, + 0xC5U, 0x83U, 0xCEU, 0x2DU, 0x36U, 0x95U, 0xA9U, 0xE1U, 0x36U, 0x41U, 0x14U, 0x64U, 0x33U, + 0xFBU, 0xCCU, 0x93U, 0x9DU, 0xCEU, 0x24U, 0x9BU, 0x3EU, 0xF9U, 0x7DU, 0x2FU, 0xE3U, 0x63U, + 0x63U, 0x0CU, 0x75U, 0xD8U, 0xF6U, 0x81U, 0xB2U, 0x02U, 0xAEU, 0xC4U, 0x61U, 0x7AU, 0xD3U, + 0xDFU, 0x1EU, 0xD5U, 0xD5U, 0xFDU, 0x65U, 0x61U, 0x24U, 0x33U, 0xF5U, 0x1FU, 0x5FU, 0x06U, + 0x6EU, 0xD0U, 0x85U, 0x63U, 0x65U, 0x55U, 0x3DU, 0xEDU, 0x1AU, 0xF3U, 0xB5U, 0x57U, 0x13U, + 0x5EU, 0x7FU, 0x57U, 0xC9U, 0x35U, 0x98U, 0x4FU, 0x0CU, 0x70U, 0xE0U, 0xE6U, 0x8BU, 0x77U, + 0xE2U, 0xA6U, 0x89U, 0xDAU, 0xF3U, 0xEFU, 0xE8U, 0x72U, 0x1DU, 0xF1U, 0x58U, 0xA1U, 0x36U, + 0xADU, 0xE7U, 0x35U, 0x30U, 0xACU, 0xCAU, 0x4FU, 0x48U, 0x3AU, 0x79U, 0x7AU, 0xBCU, 0x0AU, + 0xB1U, 0x82U, 0xB3U, 0x24U, 0xFBU, 0x61U, 0xD1U, 0x08U, 0xA9U, 0x4BU, 0xB2U, 0xC8U, 0xE3U, + 0xFBU, 0xB9U, 0x6AU, 0xDAU, 0xB7U, 0x60U, 0xD7U, 0xF4U, 0x68U, 0x1DU, 0x4FU, 0x42U, 0xA3U, + 0xDEU, 0x39U, 0x4DU, 0xF4U, 0xAEU, 0x56U, 0xEDU, 0xE7U, 0x63U, 0x72U, 0xBBU, 0x19U, 0x0BU, + 0x07U, 0xA7U, 0xC8U, 0xEEU, 0x0AU, 0x6DU, 0x70U, 0x9EU, 0x02U, 0xFCU, 0xE1U, 0xCDU, 0xF7U, + 0xE2U, 0xECU, 0xC0U, 0x34U, 0x04U, 0xCDU, 0x28U, 0x34U, 0x2FU, 0x61U, 0x91U, 0x72U, 0xFEU, + 0x9CU, 0xE9U, 0x85U, 0x83U, 0xFFU, 0x8EU, 0x4FU, 0x12U, 0x32U, 0xEEU, 0xF2U, 0x81U, 0x83U, + 0xC3U, 0xFEU, 0x3BU, 0x1BU, 0x4CU, 0x6FU, 0xADU, 0x73U, 0x3BU, 0xB5U, 0xFCU, 0xBCU, 0x2EU, + 0xC2U, 0x20U, 0x05U, 0xC5U, 0x8EU, 0xF1U, 0x83U, 0x7DU, 0x16U, 0x83U, 0xB2U, 0xC6U, 0xF3U, + 0x4AU, 0x26U, 0xC1U, 0xB2U, 0xEFU, 0xFAU, 0x88U, 0x6BU, 0x42U, 0x38U, 0x61U, 0x28U, 0x5CU, + 0x97U, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU }; static const uint8_t Hacl_Impl_FFDHE_Constants_ffdhe_p3072[384U] = { - (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, - (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xADU, (uint8_t)0xF8U, (uint8_t)0x54U, (uint8_t)0x58U, - (uint8_t)0xA2U, (uint8_t)0xBBU, (uint8_t)0x4AU, (uint8_t)0x9AU, (uint8_t)0xAFU, (uint8_t)0xDCU, - (uint8_t)0x56U, (uint8_t)0x20U, (uint8_t)0x27U, (uint8_t)0x3DU, (uint8_t)0x3CU, (uint8_t)0xF1U, - (uint8_t)0xD8U, (uint8_t)0xB9U, (uint8_t)0xC5U, (uint8_t)0x83U, (uint8_t)0xCEU, (uint8_t)0x2DU, - (uint8_t)0x36U, (uint8_t)0x95U, (uint8_t)0xA9U, (uint8_t)0xE1U, (uint8_t)0x36U, (uint8_t)0x41U, - (uint8_t)0x14U, (uint8_t)0x64U, (uint8_t)0x33U, (uint8_t)0xFBU, (uint8_t)0xCCU, (uint8_t)0x93U, - (uint8_t)0x9DU, (uint8_t)0xCEU, (uint8_t)0x24U, (uint8_t)0x9BU, (uint8_t)0x3EU, (uint8_t)0xF9U, - (uint8_t)0x7DU, (uint8_t)0x2FU, (uint8_t)0xE3U, (uint8_t)0x63U, (uint8_t)0x63U, (uint8_t)0x0CU, - (uint8_t)0x75U, (uint8_t)0xD8U, (uint8_t)0xF6U, (uint8_t)0x81U, (uint8_t)0xB2U, (uint8_t)0x02U, - (uint8_t)0xAEU, (uint8_t)0xC4U, (uint8_t)0x61U, (uint8_t)0x7AU, (uint8_t)0xD3U, (uint8_t)0xDFU, - (uint8_t)0x1EU, (uint8_t)0xD5U, (uint8_t)0xD5U, (uint8_t)0xFDU, (uint8_t)0x65U, (uint8_t)0x61U, - (uint8_t)0x24U, (uint8_t)0x33U, (uint8_t)0xF5U, (uint8_t)0x1FU, (uint8_t)0x5FU, (uint8_t)0x06U, - (uint8_t)0x6EU, (uint8_t)0xD0U, (uint8_t)0x85U, (uint8_t)0x63U, (uint8_t)0x65U, (uint8_t)0x55U, - (uint8_t)0x3DU, (uint8_t)0xEDU, (uint8_t)0x1AU, (uint8_t)0xF3U, (uint8_t)0xB5U, (uint8_t)0x57U, - (uint8_t)0x13U, (uint8_t)0x5EU, (uint8_t)0x7FU, (uint8_t)0x57U, (uint8_t)0xC9U, (uint8_t)0x35U, - (uint8_t)0x98U, (uint8_t)0x4FU, (uint8_t)0x0CU, (uint8_t)0x70U, (uint8_t)0xE0U, (uint8_t)0xE6U, - (uint8_t)0x8BU, (uint8_t)0x77U, (uint8_t)0xE2U, (uint8_t)0xA6U, (uint8_t)0x89U, (uint8_t)0xDAU, - (uint8_t)0xF3U, (uint8_t)0xEFU, (uint8_t)0xE8U, (uint8_t)0x72U, (uint8_t)0x1DU, (uint8_t)0xF1U, - (uint8_t)0x58U, (uint8_t)0xA1U, (uint8_t)0x36U, (uint8_t)0xADU, (uint8_t)0xE7U, (uint8_t)0x35U, - (uint8_t)0x30U, (uint8_t)0xACU, (uint8_t)0xCAU, (uint8_t)0x4FU, (uint8_t)0x48U, (uint8_t)0x3AU, - (uint8_t)0x79U, (uint8_t)0x7AU, (uint8_t)0xBCU, (uint8_t)0x0AU, (uint8_t)0xB1U, (uint8_t)0x82U, - (uint8_t)0xB3U, (uint8_t)0x24U, (uint8_t)0xFBU, (uint8_t)0x61U, (uint8_t)0xD1U, (uint8_t)0x08U, - (uint8_t)0xA9U, (uint8_t)0x4BU, (uint8_t)0xB2U, (uint8_t)0xC8U, (uint8_t)0xE3U, (uint8_t)0xFBU, - (uint8_t)0xB9U, (uint8_t)0x6AU, (uint8_t)0xDAU, (uint8_t)0xB7U, (uint8_t)0x60U, (uint8_t)0xD7U, - (uint8_t)0xF4U, (uint8_t)0x68U, (uint8_t)0x1DU, (uint8_t)0x4FU, (uint8_t)0x42U, (uint8_t)0xA3U, - (uint8_t)0xDEU, (uint8_t)0x39U, (uint8_t)0x4DU, (uint8_t)0xF4U, (uint8_t)0xAEU, (uint8_t)0x56U, - (uint8_t)0xEDU, (uint8_t)0xE7U, (uint8_t)0x63U, (uint8_t)0x72U, (uint8_t)0xBBU, (uint8_t)0x19U, - (uint8_t)0x0BU, (uint8_t)0x07U, (uint8_t)0xA7U, (uint8_t)0xC8U, (uint8_t)0xEEU, (uint8_t)0x0AU, - (uint8_t)0x6DU, (uint8_t)0x70U, (uint8_t)0x9EU, (uint8_t)0x02U, (uint8_t)0xFCU, (uint8_t)0xE1U, - (uint8_t)0xCDU, (uint8_t)0xF7U, (uint8_t)0xE2U, (uint8_t)0xECU, (uint8_t)0xC0U, (uint8_t)0x34U, - (uint8_t)0x04U, (uint8_t)0xCDU, (uint8_t)0x28U, (uint8_t)0x34U, (uint8_t)0x2FU, (uint8_t)0x61U, - (uint8_t)0x91U, (uint8_t)0x72U, (uint8_t)0xFEU, (uint8_t)0x9CU, (uint8_t)0xE9U, (uint8_t)0x85U, - (uint8_t)0x83U, (uint8_t)0xFFU, (uint8_t)0x8EU, (uint8_t)0x4FU, (uint8_t)0x12U, (uint8_t)0x32U, - (uint8_t)0xEEU, (uint8_t)0xF2U, (uint8_t)0x81U, (uint8_t)0x83U, (uint8_t)0xC3U, (uint8_t)0xFEU, - (uint8_t)0x3BU, (uint8_t)0x1BU, (uint8_t)0x4CU, (uint8_t)0x6FU, (uint8_t)0xADU, (uint8_t)0x73U, - (uint8_t)0x3BU, (uint8_t)0xB5U, (uint8_t)0xFCU, (uint8_t)0xBCU, (uint8_t)0x2EU, (uint8_t)0xC2U, - (uint8_t)0x20U, (uint8_t)0x05U, (uint8_t)0xC5U, (uint8_t)0x8EU, (uint8_t)0xF1U, (uint8_t)0x83U, - (uint8_t)0x7DU, (uint8_t)0x16U, (uint8_t)0x83U, (uint8_t)0xB2U, (uint8_t)0xC6U, (uint8_t)0xF3U, - (uint8_t)0x4AU, (uint8_t)0x26U, (uint8_t)0xC1U, (uint8_t)0xB2U, (uint8_t)0xEFU, (uint8_t)0xFAU, - (uint8_t)0x88U, (uint8_t)0x6BU, (uint8_t)0x42U, (uint8_t)0x38U, (uint8_t)0x61U, (uint8_t)0x1FU, - (uint8_t)0xCFU, (uint8_t)0xDCU, (uint8_t)0xDEU, (uint8_t)0x35U, (uint8_t)0x5BU, (uint8_t)0x3BU, - (uint8_t)0x65U, (uint8_t)0x19U, (uint8_t)0x03U, (uint8_t)0x5BU, (uint8_t)0xBCU, (uint8_t)0x34U, - (uint8_t)0xF4U, (uint8_t)0xDEU, (uint8_t)0xF9U, (uint8_t)0x9CU, (uint8_t)0x02U, (uint8_t)0x38U, - (uint8_t)0x61U, (uint8_t)0xB4U, (uint8_t)0x6FU, (uint8_t)0xC9U, (uint8_t)0xD6U, (uint8_t)0xE6U, - (uint8_t)0xC9U, (uint8_t)0x07U, (uint8_t)0x7AU, (uint8_t)0xD9U, (uint8_t)0x1DU, (uint8_t)0x26U, - (uint8_t)0x91U, (uint8_t)0xF7U, (uint8_t)0xF7U, (uint8_t)0xEEU, (uint8_t)0x59U, (uint8_t)0x8CU, - (uint8_t)0xB0U, (uint8_t)0xFAU, (uint8_t)0xC1U, (uint8_t)0x86U, (uint8_t)0xD9U, (uint8_t)0x1CU, - (uint8_t)0xAEU, (uint8_t)0xFEU, (uint8_t)0x13U, (uint8_t)0x09U, (uint8_t)0x85U, (uint8_t)0x13U, - (uint8_t)0x92U, (uint8_t)0x70U, (uint8_t)0xB4U, (uint8_t)0x13U, (uint8_t)0x0CU, (uint8_t)0x93U, - (uint8_t)0xBCU, (uint8_t)0x43U, (uint8_t)0x79U, (uint8_t)0x44U, (uint8_t)0xF4U, (uint8_t)0xFDU, - (uint8_t)0x44U, (uint8_t)0x52U, (uint8_t)0xE2U, (uint8_t)0xD7U, (uint8_t)0x4DU, (uint8_t)0xD3U, - (uint8_t)0x64U, (uint8_t)0xF2U, (uint8_t)0xE2U, (uint8_t)0x1EU, (uint8_t)0x71U, (uint8_t)0xF5U, - (uint8_t)0x4BU, (uint8_t)0xFFU, (uint8_t)0x5CU, (uint8_t)0xAEU, (uint8_t)0x82U, (uint8_t)0xABU, - (uint8_t)0x9CU, (uint8_t)0x9DU, (uint8_t)0xF6U, (uint8_t)0x9EU, (uint8_t)0xE8U, (uint8_t)0x6DU, - (uint8_t)0x2BU, (uint8_t)0xC5U, (uint8_t)0x22U, (uint8_t)0x36U, (uint8_t)0x3AU, (uint8_t)0x0DU, - (uint8_t)0xABU, (uint8_t)0xC5U, (uint8_t)0x21U, (uint8_t)0x97U, (uint8_t)0x9BU, (uint8_t)0x0DU, - (uint8_t)0xEAU, (uint8_t)0xDAU, (uint8_t)0x1DU, (uint8_t)0xBFU, (uint8_t)0x9AU, (uint8_t)0x42U, - (uint8_t)0xD5U, (uint8_t)0xC4U, (uint8_t)0x48U, (uint8_t)0x4EU, (uint8_t)0x0AU, (uint8_t)0xBCU, - (uint8_t)0xD0U, (uint8_t)0x6BU, (uint8_t)0xFAU, (uint8_t)0x53U, (uint8_t)0xDDU, (uint8_t)0xEFU, - (uint8_t)0x3CU, (uint8_t)0x1BU, (uint8_t)0x20U, (uint8_t)0xEEU, (uint8_t)0x3FU, (uint8_t)0xD5U, - (uint8_t)0x9DU, (uint8_t)0x7CU, (uint8_t)0x25U, (uint8_t)0xE4U, (uint8_t)0x1DU, (uint8_t)0x2BU, - (uint8_t)0x66U, (uint8_t)0xC6U, (uint8_t)0x2EU, (uint8_t)0x37U, (uint8_t)0xFFU, (uint8_t)0xFFU, - (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU + 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xADU, 0xF8U, 0x54U, 0x58U, 0xA2U, + 0xBBU, 0x4AU, 0x9AU, 0xAFU, 0xDCU, 0x56U, 0x20U, 0x27U, 0x3DU, 0x3CU, 0xF1U, 0xD8U, 0xB9U, + 0xC5U, 0x83U, 0xCEU, 0x2DU, 0x36U, 0x95U, 0xA9U, 0xE1U, 0x36U, 0x41U, 0x14U, 0x64U, 0x33U, + 0xFBU, 0xCCU, 0x93U, 0x9DU, 0xCEU, 0x24U, 0x9BU, 0x3EU, 0xF9U, 0x7DU, 0x2FU, 0xE3U, 0x63U, + 0x63U, 0x0CU, 0x75U, 0xD8U, 0xF6U, 0x81U, 0xB2U, 0x02U, 0xAEU, 0xC4U, 0x61U, 0x7AU, 0xD3U, + 0xDFU, 0x1EU, 0xD5U, 0xD5U, 0xFDU, 0x65U, 0x61U, 0x24U, 0x33U, 0xF5U, 0x1FU, 0x5FU, 0x06U, + 0x6EU, 0xD0U, 0x85U, 0x63U, 0x65U, 0x55U, 0x3DU, 0xEDU, 0x1AU, 0xF3U, 0xB5U, 0x57U, 0x13U, + 0x5EU, 0x7FU, 0x57U, 0xC9U, 0x35U, 0x98U, 0x4FU, 0x0CU, 0x70U, 0xE0U, 0xE6U, 0x8BU, 0x77U, + 0xE2U, 0xA6U, 0x89U, 0xDAU, 0xF3U, 0xEFU, 0xE8U, 0x72U, 0x1DU, 0xF1U, 0x58U, 0xA1U, 0x36U, + 0xADU, 0xE7U, 0x35U, 0x30U, 0xACU, 0xCAU, 0x4FU, 0x48U, 0x3AU, 0x79U, 0x7AU, 0xBCU, 0x0AU, + 0xB1U, 0x82U, 0xB3U, 0x24U, 0xFBU, 0x61U, 0xD1U, 0x08U, 0xA9U, 0x4BU, 0xB2U, 0xC8U, 0xE3U, + 0xFBU, 0xB9U, 0x6AU, 0xDAU, 0xB7U, 0x60U, 0xD7U, 0xF4U, 0x68U, 0x1DU, 0x4FU, 0x42U, 0xA3U, + 0xDEU, 0x39U, 0x4DU, 0xF4U, 0xAEU, 0x56U, 0xEDU, 0xE7U, 0x63U, 0x72U, 0xBBU, 0x19U, 0x0BU, + 0x07U, 0xA7U, 0xC8U, 0xEEU, 0x0AU, 0x6DU, 0x70U, 0x9EU, 0x02U, 0xFCU, 0xE1U, 0xCDU, 0xF7U, + 0xE2U, 0xECU, 0xC0U, 0x34U, 0x04U, 0xCDU, 0x28U, 0x34U, 0x2FU, 0x61U, 0x91U, 0x72U, 0xFEU, + 0x9CU, 0xE9U, 0x85U, 0x83U, 0xFFU, 0x8EU, 0x4FU, 0x12U, 0x32U, 0xEEU, 0xF2U, 0x81U, 0x83U, + 0xC3U, 0xFEU, 0x3BU, 0x1BU, 0x4CU, 0x6FU, 0xADU, 0x73U, 0x3BU, 0xB5U, 0xFCU, 0xBCU, 0x2EU, + 0xC2U, 0x20U, 0x05U, 0xC5U, 0x8EU, 0xF1U, 0x83U, 0x7DU, 0x16U, 0x83U, 0xB2U, 0xC6U, 0xF3U, + 0x4AU, 0x26U, 0xC1U, 0xB2U, 0xEFU, 0xFAU, 0x88U, 0x6BU, 0x42U, 0x38U, 0x61U, 0x1FU, 0xCFU, + 0xDCU, 0xDEU, 0x35U, 0x5BU, 0x3BU, 0x65U, 0x19U, 0x03U, 0x5BU, 0xBCU, 0x34U, 0xF4U, 0xDEU, + 0xF9U, 0x9CU, 0x02U, 0x38U, 0x61U, 0xB4U, 0x6FU, 0xC9U, 0xD6U, 0xE6U, 0xC9U, 0x07U, 0x7AU, + 0xD9U, 0x1DU, 0x26U, 0x91U, 0xF7U, 0xF7U, 0xEEU, 0x59U, 0x8CU, 0xB0U, 0xFAU, 0xC1U, 0x86U, + 0xD9U, 0x1CU, 0xAEU, 0xFEU, 0x13U, 0x09U, 0x85U, 0x13U, 0x92U, 0x70U, 0xB4U, 0x13U, 0x0CU, + 0x93U, 0xBCU, 0x43U, 0x79U, 0x44U, 0xF4U, 0xFDU, 0x44U, 0x52U, 0xE2U, 0xD7U, 0x4DU, 0xD3U, + 0x64U, 0xF2U, 0xE2U, 0x1EU, 0x71U, 0xF5U, 0x4BU, 0xFFU, 0x5CU, 0xAEU, 0x82U, 0xABU, 0x9CU, + 0x9DU, 0xF6U, 0x9EU, 0xE8U, 0x6DU, 0x2BU, 0xC5U, 0x22U, 0x36U, 0x3AU, 0x0DU, 0xABU, 0xC5U, + 0x21U, 0x97U, 0x9BU, 0x0DU, 0xEAU, 0xDAU, 0x1DU, 0xBFU, 0x9AU, 0x42U, 0xD5U, 0xC4U, 0x48U, + 0x4EU, 0x0AU, 0xBCU, 0xD0U, 0x6BU, 0xFAU, 0x53U, 0xDDU, 0xEFU, 0x3CU, 0x1BU, 0x20U, 0xEEU, + 0x3FU, 0xD5U, 0x9DU, 0x7CU, 0x25U, 0xE4U, 0x1DU, 0x2BU, 0x66U, 0xC6U, 0x2EU, 0x37U, 0xFFU, + 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU }; static const uint8_t Hacl_Impl_FFDHE_Constants_ffdhe_p4096[512U] = { - (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, - (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xADU, (uint8_t)0xF8U, (uint8_t)0x54U, (uint8_t)0x58U, - (uint8_t)0xA2U, (uint8_t)0xBBU, (uint8_t)0x4AU, (uint8_t)0x9AU, (uint8_t)0xAFU, (uint8_t)0xDCU, - (uint8_t)0x56U, (uint8_t)0x20U, (uint8_t)0x27U, (uint8_t)0x3DU, (uint8_t)0x3CU, (uint8_t)0xF1U, - (uint8_t)0xD8U, (uint8_t)0xB9U, (uint8_t)0xC5U, (uint8_t)0x83U, (uint8_t)0xCEU, (uint8_t)0x2DU, - (uint8_t)0x36U, (uint8_t)0x95U, (uint8_t)0xA9U, (uint8_t)0xE1U, (uint8_t)0x36U, (uint8_t)0x41U, - (uint8_t)0x14U, (uint8_t)0x64U, (uint8_t)0x33U, (uint8_t)0xFBU, (uint8_t)0xCCU, (uint8_t)0x93U, - (uint8_t)0x9DU, (uint8_t)0xCEU, (uint8_t)0x24U, (uint8_t)0x9BU, (uint8_t)0x3EU, (uint8_t)0xF9U, - (uint8_t)0x7DU, (uint8_t)0x2FU, (uint8_t)0xE3U, (uint8_t)0x63U, (uint8_t)0x63U, (uint8_t)0x0CU, - (uint8_t)0x75U, (uint8_t)0xD8U, (uint8_t)0xF6U, (uint8_t)0x81U, (uint8_t)0xB2U, (uint8_t)0x02U, - (uint8_t)0xAEU, (uint8_t)0xC4U, (uint8_t)0x61U, (uint8_t)0x7AU, (uint8_t)0xD3U, (uint8_t)0xDFU, - (uint8_t)0x1EU, (uint8_t)0xD5U, (uint8_t)0xD5U, (uint8_t)0xFDU, (uint8_t)0x65U, (uint8_t)0x61U, - (uint8_t)0x24U, (uint8_t)0x33U, (uint8_t)0xF5U, (uint8_t)0x1FU, (uint8_t)0x5FU, (uint8_t)0x06U, - (uint8_t)0x6EU, (uint8_t)0xD0U, (uint8_t)0x85U, (uint8_t)0x63U, (uint8_t)0x65U, (uint8_t)0x55U, - (uint8_t)0x3DU, (uint8_t)0xEDU, (uint8_t)0x1AU, (uint8_t)0xF3U, (uint8_t)0xB5U, (uint8_t)0x57U, - (uint8_t)0x13U, (uint8_t)0x5EU, (uint8_t)0x7FU, (uint8_t)0x57U, (uint8_t)0xC9U, (uint8_t)0x35U, - (uint8_t)0x98U, (uint8_t)0x4FU, (uint8_t)0x0CU, (uint8_t)0x70U, (uint8_t)0xE0U, (uint8_t)0xE6U, - (uint8_t)0x8BU, (uint8_t)0x77U, (uint8_t)0xE2U, (uint8_t)0xA6U, (uint8_t)0x89U, (uint8_t)0xDAU, - (uint8_t)0xF3U, (uint8_t)0xEFU, (uint8_t)0xE8U, (uint8_t)0x72U, (uint8_t)0x1DU, (uint8_t)0xF1U, - (uint8_t)0x58U, (uint8_t)0xA1U, (uint8_t)0x36U, (uint8_t)0xADU, (uint8_t)0xE7U, (uint8_t)0x35U, - (uint8_t)0x30U, (uint8_t)0xACU, (uint8_t)0xCAU, (uint8_t)0x4FU, (uint8_t)0x48U, (uint8_t)0x3AU, - (uint8_t)0x79U, (uint8_t)0x7AU, (uint8_t)0xBCU, (uint8_t)0x0AU, (uint8_t)0xB1U, (uint8_t)0x82U, - (uint8_t)0xB3U, (uint8_t)0x24U, (uint8_t)0xFBU, (uint8_t)0x61U, (uint8_t)0xD1U, (uint8_t)0x08U, - (uint8_t)0xA9U, (uint8_t)0x4BU, (uint8_t)0xB2U, (uint8_t)0xC8U, (uint8_t)0xE3U, (uint8_t)0xFBU, - (uint8_t)0xB9U, (uint8_t)0x6AU, (uint8_t)0xDAU, (uint8_t)0xB7U, (uint8_t)0x60U, (uint8_t)0xD7U, - (uint8_t)0xF4U, (uint8_t)0x68U, (uint8_t)0x1DU, (uint8_t)0x4FU, (uint8_t)0x42U, (uint8_t)0xA3U, - (uint8_t)0xDEU, (uint8_t)0x39U, (uint8_t)0x4DU, (uint8_t)0xF4U, (uint8_t)0xAEU, (uint8_t)0x56U, - (uint8_t)0xEDU, (uint8_t)0xE7U, (uint8_t)0x63U, (uint8_t)0x72U, (uint8_t)0xBBU, (uint8_t)0x19U, - (uint8_t)0x0BU, (uint8_t)0x07U, (uint8_t)0xA7U, (uint8_t)0xC8U, (uint8_t)0xEEU, (uint8_t)0x0AU, - (uint8_t)0x6DU, (uint8_t)0x70U, (uint8_t)0x9EU, (uint8_t)0x02U, (uint8_t)0xFCU, (uint8_t)0xE1U, - (uint8_t)0xCDU, (uint8_t)0xF7U, (uint8_t)0xE2U, (uint8_t)0xECU, (uint8_t)0xC0U, (uint8_t)0x34U, - (uint8_t)0x04U, (uint8_t)0xCDU, (uint8_t)0x28U, (uint8_t)0x34U, (uint8_t)0x2FU, (uint8_t)0x61U, - (uint8_t)0x91U, (uint8_t)0x72U, (uint8_t)0xFEU, (uint8_t)0x9CU, (uint8_t)0xE9U, (uint8_t)0x85U, - (uint8_t)0x83U, (uint8_t)0xFFU, (uint8_t)0x8EU, (uint8_t)0x4FU, (uint8_t)0x12U, (uint8_t)0x32U, - (uint8_t)0xEEU, (uint8_t)0xF2U, (uint8_t)0x81U, (uint8_t)0x83U, (uint8_t)0xC3U, (uint8_t)0xFEU, - (uint8_t)0x3BU, (uint8_t)0x1BU, (uint8_t)0x4CU, (uint8_t)0x6FU, (uint8_t)0xADU, (uint8_t)0x73U, - (uint8_t)0x3BU, (uint8_t)0xB5U, (uint8_t)0xFCU, (uint8_t)0xBCU, (uint8_t)0x2EU, (uint8_t)0xC2U, - (uint8_t)0x20U, (uint8_t)0x05U, (uint8_t)0xC5U, (uint8_t)0x8EU, (uint8_t)0xF1U, (uint8_t)0x83U, - (uint8_t)0x7DU, (uint8_t)0x16U, (uint8_t)0x83U, (uint8_t)0xB2U, (uint8_t)0xC6U, (uint8_t)0xF3U, - (uint8_t)0x4AU, (uint8_t)0x26U, (uint8_t)0xC1U, (uint8_t)0xB2U, (uint8_t)0xEFU, (uint8_t)0xFAU, - (uint8_t)0x88U, (uint8_t)0x6BU, (uint8_t)0x42U, (uint8_t)0x38U, (uint8_t)0x61U, (uint8_t)0x1FU, - (uint8_t)0xCFU, (uint8_t)0xDCU, (uint8_t)0xDEU, (uint8_t)0x35U, (uint8_t)0x5BU, (uint8_t)0x3BU, - (uint8_t)0x65U, (uint8_t)0x19U, (uint8_t)0x03U, (uint8_t)0x5BU, (uint8_t)0xBCU, (uint8_t)0x34U, - (uint8_t)0xF4U, (uint8_t)0xDEU, (uint8_t)0xF9U, (uint8_t)0x9CU, (uint8_t)0x02U, (uint8_t)0x38U, - (uint8_t)0x61U, (uint8_t)0xB4U, (uint8_t)0x6FU, (uint8_t)0xC9U, (uint8_t)0xD6U, (uint8_t)0xE6U, - (uint8_t)0xC9U, (uint8_t)0x07U, (uint8_t)0x7AU, (uint8_t)0xD9U, (uint8_t)0x1DU, (uint8_t)0x26U, - (uint8_t)0x91U, (uint8_t)0xF7U, (uint8_t)0xF7U, (uint8_t)0xEEU, (uint8_t)0x59U, (uint8_t)0x8CU, - (uint8_t)0xB0U, (uint8_t)0xFAU, (uint8_t)0xC1U, (uint8_t)0x86U, (uint8_t)0xD9U, (uint8_t)0x1CU, - (uint8_t)0xAEU, (uint8_t)0xFEU, (uint8_t)0x13U, (uint8_t)0x09U, (uint8_t)0x85U, (uint8_t)0x13U, - (uint8_t)0x92U, (uint8_t)0x70U, (uint8_t)0xB4U, (uint8_t)0x13U, (uint8_t)0x0CU, (uint8_t)0x93U, - (uint8_t)0xBCU, (uint8_t)0x43U, (uint8_t)0x79U, (uint8_t)0x44U, (uint8_t)0xF4U, (uint8_t)0xFDU, - (uint8_t)0x44U, (uint8_t)0x52U, (uint8_t)0xE2U, (uint8_t)0xD7U, (uint8_t)0x4DU, (uint8_t)0xD3U, - (uint8_t)0x64U, (uint8_t)0xF2U, (uint8_t)0xE2U, (uint8_t)0x1EU, (uint8_t)0x71U, (uint8_t)0xF5U, - (uint8_t)0x4BU, (uint8_t)0xFFU, (uint8_t)0x5CU, (uint8_t)0xAEU, (uint8_t)0x82U, (uint8_t)0xABU, - (uint8_t)0x9CU, (uint8_t)0x9DU, (uint8_t)0xF6U, (uint8_t)0x9EU, (uint8_t)0xE8U, (uint8_t)0x6DU, - (uint8_t)0x2BU, (uint8_t)0xC5U, (uint8_t)0x22U, (uint8_t)0x36U, (uint8_t)0x3AU, (uint8_t)0x0DU, - (uint8_t)0xABU, (uint8_t)0xC5U, (uint8_t)0x21U, (uint8_t)0x97U, (uint8_t)0x9BU, (uint8_t)0x0DU, - (uint8_t)0xEAU, (uint8_t)0xDAU, (uint8_t)0x1DU, (uint8_t)0xBFU, (uint8_t)0x9AU, (uint8_t)0x42U, - (uint8_t)0xD5U, (uint8_t)0xC4U, (uint8_t)0x48U, (uint8_t)0x4EU, (uint8_t)0x0AU, (uint8_t)0xBCU, - (uint8_t)0xD0U, (uint8_t)0x6BU, (uint8_t)0xFAU, (uint8_t)0x53U, (uint8_t)0xDDU, (uint8_t)0xEFU, - (uint8_t)0x3CU, (uint8_t)0x1BU, (uint8_t)0x20U, (uint8_t)0xEEU, (uint8_t)0x3FU, (uint8_t)0xD5U, - (uint8_t)0x9DU, (uint8_t)0x7CU, (uint8_t)0x25U, (uint8_t)0xE4U, (uint8_t)0x1DU, (uint8_t)0x2BU, - (uint8_t)0x66U, (uint8_t)0x9EU, (uint8_t)0x1EU, (uint8_t)0xF1U, (uint8_t)0x6EU, (uint8_t)0x6FU, - (uint8_t)0x52U, (uint8_t)0xC3U, (uint8_t)0x16U, (uint8_t)0x4DU, (uint8_t)0xF4U, (uint8_t)0xFBU, - (uint8_t)0x79U, (uint8_t)0x30U, (uint8_t)0xE9U, (uint8_t)0xE4U, (uint8_t)0xE5U, (uint8_t)0x88U, - (uint8_t)0x57U, (uint8_t)0xB6U, (uint8_t)0xACU, (uint8_t)0x7DU, (uint8_t)0x5FU, (uint8_t)0x42U, - (uint8_t)0xD6U, (uint8_t)0x9FU, (uint8_t)0x6DU, (uint8_t)0x18U, (uint8_t)0x77U, (uint8_t)0x63U, - (uint8_t)0xCFU, (uint8_t)0x1DU, (uint8_t)0x55U, (uint8_t)0x03U, (uint8_t)0x40U, (uint8_t)0x04U, - (uint8_t)0x87U, (uint8_t)0xF5U, (uint8_t)0x5BU, (uint8_t)0xA5U, (uint8_t)0x7EU, (uint8_t)0x31U, - (uint8_t)0xCCU, (uint8_t)0x7AU, (uint8_t)0x71U, (uint8_t)0x35U, (uint8_t)0xC8U, (uint8_t)0x86U, - (uint8_t)0xEFU, (uint8_t)0xB4U, (uint8_t)0x31U, (uint8_t)0x8AU, (uint8_t)0xEDU, (uint8_t)0x6AU, - (uint8_t)0x1EU, (uint8_t)0x01U, (uint8_t)0x2DU, (uint8_t)0x9EU, (uint8_t)0x68U, (uint8_t)0x32U, - (uint8_t)0xA9U, (uint8_t)0x07U, (uint8_t)0x60U, (uint8_t)0x0AU, (uint8_t)0x91U, (uint8_t)0x81U, - (uint8_t)0x30U, (uint8_t)0xC4U, (uint8_t)0x6DU, (uint8_t)0xC7U, (uint8_t)0x78U, (uint8_t)0xF9U, - (uint8_t)0x71U, (uint8_t)0xADU, (uint8_t)0x00U, (uint8_t)0x38U, (uint8_t)0x09U, (uint8_t)0x29U, - (uint8_t)0x99U, (uint8_t)0xA3U, (uint8_t)0x33U, (uint8_t)0xCBU, (uint8_t)0x8BU, (uint8_t)0x7AU, - (uint8_t)0x1AU, (uint8_t)0x1DU, (uint8_t)0xB9U, (uint8_t)0x3DU, (uint8_t)0x71U, (uint8_t)0x40U, - (uint8_t)0x00U, (uint8_t)0x3CU, (uint8_t)0x2AU, (uint8_t)0x4EU, (uint8_t)0xCEU, (uint8_t)0xA9U, - (uint8_t)0xF9U, (uint8_t)0x8DU, (uint8_t)0x0AU, (uint8_t)0xCCU, (uint8_t)0x0AU, (uint8_t)0x82U, - (uint8_t)0x91U, (uint8_t)0xCDU, (uint8_t)0xCEU, (uint8_t)0xC9U, (uint8_t)0x7DU, (uint8_t)0xCFU, - (uint8_t)0x8EU, (uint8_t)0xC9U, (uint8_t)0xB5U, (uint8_t)0x5AU, (uint8_t)0x7FU, (uint8_t)0x88U, - (uint8_t)0xA4U, (uint8_t)0x6BU, (uint8_t)0x4DU, (uint8_t)0xB5U, (uint8_t)0xA8U, (uint8_t)0x51U, - (uint8_t)0xF4U, (uint8_t)0x41U, (uint8_t)0x82U, (uint8_t)0xE1U, (uint8_t)0xC6U, (uint8_t)0x8AU, - (uint8_t)0x00U, (uint8_t)0x7EU, (uint8_t)0x5EU, (uint8_t)0x65U, (uint8_t)0x5FU, (uint8_t)0x6AU, - (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, - (uint8_t)0xFFU, (uint8_t)0xFFU + 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xADU, 0xF8U, 0x54U, 0x58U, 0xA2U, + 0xBBU, 0x4AU, 0x9AU, 0xAFU, 0xDCU, 0x56U, 0x20U, 0x27U, 0x3DU, 0x3CU, 0xF1U, 0xD8U, 0xB9U, + 0xC5U, 0x83U, 0xCEU, 0x2DU, 0x36U, 0x95U, 0xA9U, 0xE1U, 0x36U, 0x41U, 0x14U, 0x64U, 0x33U, + 0xFBU, 0xCCU, 0x93U, 0x9DU, 0xCEU, 0x24U, 0x9BU, 0x3EU, 0xF9U, 0x7DU, 0x2FU, 0xE3U, 0x63U, + 0x63U, 0x0CU, 0x75U, 0xD8U, 0xF6U, 0x81U, 0xB2U, 0x02U, 0xAEU, 0xC4U, 0x61U, 0x7AU, 0xD3U, + 0xDFU, 0x1EU, 0xD5U, 0xD5U, 0xFDU, 0x65U, 0x61U, 0x24U, 0x33U, 0xF5U, 0x1FU, 0x5FU, 0x06U, + 0x6EU, 0xD0U, 0x85U, 0x63U, 0x65U, 0x55U, 0x3DU, 0xEDU, 0x1AU, 0xF3U, 0xB5U, 0x57U, 0x13U, + 0x5EU, 0x7FU, 0x57U, 0xC9U, 0x35U, 0x98U, 0x4FU, 0x0CU, 0x70U, 0xE0U, 0xE6U, 0x8BU, 0x77U, + 0xE2U, 0xA6U, 0x89U, 0xDAU, 0xF3U, 0xEFU, 0xE8U, 0x72U, 0x1DU, 0xF1U, 0x58U, 0xA1U, 0x36U, + 0xADU, 0xE7U, 0x35U, 0x30U, 0xACU, 0xCAU, 0x4FU, 0x48U, 0x3AU, 0x79U, 0x7AU, 0xBCU, 0x0AU, + 0xB1U, 0x82U, 0xB3U, 0x24U, 0xFBU, 0x61U, 0xD1U, 0x08U, 0xA9U, 0x4BU, 0xB2U, 0xC8U, 0xE3U, + 0xFBU, 0xB9U, 0x6AU, 0xDAU, 0xB7U, 0x60U, 0xD7U, 0xF4U, 0x68U, 0x1DU, 0x4FU, 0x42U, 0xA3U, + 0xDEU, 0x39U, 0x4DU, 0xF4U, 0xAEU, 0x56U, 0xEDU, 0xE7U, 0x63U, 0x72U, 0xBBU, 0x19U, 0x0BU, + 0x07U, 0xA7U, 0xC8U, 0xEEU, 0x0AU, 0x6DU, 0x70U, 0x9EU, 0x02U, 0xFCU, 0xE1U, 0xCDU, 0xF7U, + 0xE2U, 0xECU, 0xC0U, 0x34U, 0x04U, 0xCDU, 0x28U, 0x34U, 0x2FU, 0x61U, 0x91U, 0x72U, 0xFEU, + 0x9CU, 0xE9U, 0x85U, 0x83U, 0xFFU, 0x8EU, 0x4FU, 0x12U, 0x32U, 0xEEU, 0xF2U, 0x81U, 0x83U, + 0xC3U, 0xFEU, 0x3BU, 0x1BU, 0x4CU, 0x6FU, 0xADU, 0x73U, 0x3BU, 0xB5U, 0xFCU, 0xBCU, 0x2EU, + 0xC2U, 0x20U, 0x05U, 0xC5U, 0x8EU, 0xF1U, 0x83U, 0x7DU, 0x16U, 0x83U, 0xB2U, 0xC6U, 0xF3U, + 0x4AU, 0x26U, 0xC1U, 0xB2U, 0xEFU, 0xFAU, 0x88U, 0x6BU, 0x42U, 0x38U, 0x61U, 0x1FU, 0xCFU, + 0xDCU, 0xDEU, 0x35U, 0x5BU, 0x3BU, 0x65U, 0x19U, 0x03U, 0x5BU, 0xBCU, 0x34U, 0xF4U, 0xDEU, + 0xF9U, 0x9CU, 0x02U, 0x38U, 0x61U, 0xB4U, 0x6FU, 0xC9U, 0xD6U, 0xE6U, 0xC9U, 0x07U, 0x7AU, + 0xD9U, 0x1DU, 0x26U, 0x91U, 0xF7U, 0xF7U, 0xEEU, 0x59U, 0x8CU, 0xB0U, 0xFAU, 0xC1U, 0x86U, + 0xD9U, 0x1CU, 0xAEU, 0xFEU, 0x13U, 0x09U, 0x85U, 0x13U, 0x92U, 0x70U, 0xB4U, 0x13U, 0x0CU, + 0x93U, 0xBCU, 0x43U, 0x79U, 0x44U, 0xF4U, 0xFDU, 0x44U, 0x52U, 0xE2U, 0xD7U, 0x4DU, 0xD3U, + 0x64U, 0xF2U, 0xE2U, 0x1EU, 0x71U, 0xF5U, 0x4BU, 0xFFU, 0x5CU, 0xAEU, 0x82U, 0xABU, 0x9CU, + 0x9DU, 0xF6U, 0x9EU, 0xE8U, 0x6DU, 0x2BU, 0xC5U, 0x22U, 0x36U, 0x3AU, 0x0DU, 0xABU, 0xC5U, + 0x21U, 0x97U, 0x9BU, 0x0DU, 0xEAU, 0xDAU, 0x1DU, 0xBFU, 0x9AU, 0x42U, 0xD5U, 0xC4U, 0x48U, + 0x4EU, 0x0AU, 0xBCU, 0xD0U, 0x6BU, 0xFAU, 0x53U, 0xDDU, 0xEFU, 0x3CU, 0x1BU, 0x20U, 0xEEU, + 0x3FU, 0xD5U, 0x9DU, 0x7CU, 0x25U, 0xE4U, 0x1DU, 0x2BU, 0x66U, 0x9EU, 0x1EU, 0xF1U, 0x6EU, + 0x6FU, 0x52U, 0xC3U, 0x16U, 0x4DU, 0xF4U, 0xFBU, 0x79U, 0x30U, 0xE9U, 0xE4U, 0xE5U, 0x88U, + 0x57U, 0xB6U, 0xACU, 0x7DU, 0x5FU, 0x42U, 0xD6U, 0x9FU, 0x6DU, 0x18U, 0x77U, 0x63U, 0xCFU, + 0x1DU, 0x55U, 0x03U, 0x40U, 0x04U, 0x87U, 0xF5U, 0x5BU, 0xA5U, 0x7EU, 0x31U, 0xCCU, 0x7AU, + 0x71U, 0x35U, 0xC8U, 0x86U, 0xEFU, 0xB4U, 0x31U, 0x8AU, 0xEDU, 0x6AU, 0x1EU, 0x01U, 0x2DU, + 0x9EU, 0x68U, 0x32U, 0xA9U, 0x07U, 0x60U, 0x0AU, 0x91U, 0x81U, 0x30U, 0xC4U, 0x6DU, 0xC7U, + 0x78U, 0xF9U, 0x71U, 0xADU, 0x00U, 0x38U, 0x09U, 0x29U, 0x99U, 0xA3U, 0x33U, 0xCBU, 0x8BU, + 0x7AU, 0x1AU, 0x1DU, 0xB9U, 0x3DU, 0x71U, 0x40U, 0x00U, 0x3CU, 0x2AU, 0x4EU, 0xCEU, 0xA9U, + 0xF9U, 0x8DU, 0x0AU, 0xCCU, 0x0AU, 0x82U, 0x91U, 0xCDU, 0xCEU, 0xC9U, 0x7DU, 0xCFU, 0x8EU, + 0xC9U, 0xB5U, 0x5AU, 0x7FU, 0x88U, 0xA4U, 0x6BU, 0x4DU, 0xB5U, 0xA8U, 0x51U, 0xF4U, 0x41U, + 0x82U, 0xE1U, 0xC6U, 0x8AU, 0x00U, 0x7EU, 0x5EU, 0x65U, 0x5FU, 0x6AU, 0xFFU, 0xFFU, 0xFFU, + 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU }; static const uint8_t Hacl_Impl_FFDHE_Constants_ffdhe_p6144[768U] = { - (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, - (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xADU, (uint8_t)0xF8U, (uint8_t)0x54U, (uint8_t)0x58U, - (uint8_t)0xA2U, (uint8_t)0xBBU, (uint8_t)0x4AU, (uint8_t)0x9AU, (uint8_t)0xAFU, (uint8_t)0xDCU, - (uint8_t)0x56U, (uint8_t)0x20U, (uint8_t)0x27U, (uint8_t)0x3DU, (uint8_t)0x3CU, (uint8_t)0xF1U, - (uint8_t)0xD8U, (uint8_t)0xB9U, (uint8_t)0xC5U, (uint8_t)0x83U, (uint8_t)0xCEU, (uint8_t)0x2DU, - (uint8_t)0x36U, (uint8_t)0x95U, (uint8_t)0xA9U, (uint8_t)0xE1U, (uint8_t)0x36U, (uint8_t)0x41U, - (uint8_t)0x14U, (uint8_t)0x64U, (uint8_t)0x33U, (uint8_t)0xFBU, (uint8_t)0xCCU, (uint8_t)0x93U, - (uint8_t)0x9DU, (uint8_t)0xCEU, (uint8_t)0x24U, (uint8_t)0x9BU, (uint8_t)0x3EU, (uint8_t)0xF9U, - (uint8_t)0x7DU, (uint8_t)0x2FU, (uint8_t)0xE3U, (uint8_t)0x63U, (uint8_t)0x63U, (uint8_t)0x0CU, - (uint8_t)0x75U, (uint8_t)0xD8U, (uint8_t)0xF6U, (uint8_t)0x81U, (uint8_t)0xB2U, (uint8_t)0x02U, - (uint8_t)0xAEU, (uint8_t)0xC4U, (uint8_t)0x61U, (uint8_t)0x7AU, (uint8_t)0xD3U, (uint8_t)0xDFU, - (uint8_t)0x1EU, (uint8_t)0xD5U, (uint8_t)0xD5U, (uint8_t)0xFDU, (uint8_t)0x65U, (uint8_t)0x61U, - (uint8_t)0x24U, (uint8_t)0x33U, (uint8_t)0xF5U, (uint8_t)0x1FU, (uint8_t)0x5FU, (uint8_t)0x06U, - (uint8_t)0x6EU, (uint8_t)0xD0U, (uint8_t)0x85U, (uint8_t)0x63U, (uint8_t)0x65U, (uint8_t)0x55U, - (uint8_t)0x3DU, (uint8_t)0xEDU, (uint8_t)0x1AU, (uint8_t)0xF3U, (uint8_t)0xB5U, (uint8_t)0x57U, - (uint8_t)0x13U, (uint8_t)0x5EU, (uint8_t)0x7FU, (uint8_t)0x57U, (uint8_t)0xC9U, (uint8_t)0x35U, - (uint8_t)0x98U, (uint8_t)0x4FU, (uint8_t)0x0CU, (uint8_t)0x70U, (uint8_t)0xE0U, (uint8_t)0xE6U, - (uint8_t)0x8BU, (uint8_t)0x77U, (uint8_t)0xE2U, (uint8_t)0xA6U, (uint8_t)0x89U, (uint8_t)0xDAU, - (uint8_t)0xF3U, (uint8_t)0xEFU, (uint8_t)0xE8U, (uint8_t)0x72U, (uint8_t)0x1DU, (uint8_t)0xF1U, - (uint8_t)0x58U, (uint8_t)0xA1U, (uint8_t)0x36U, (uint8_t)0xADU, (uint8_t)0xE7U, (uint8_t)0x35U, - (uint8_t)0x30U, (uint8_t)0xACU, (uint8_t)0xCAU, (uint8_t)0x4FU, (uint8_t)0x48U, (uint8_t)0x3AU, - (uint8_t)0x79U, (uint8_t)0x7AU, (uint8_t)0xBCU, (uint8_t)0x0AU, (uint8_t)0xB1U, (uint8_t)0x82U, - (uint8_t)0xB3U, (uint8_t)0x24U, (uint8_t)0xFBU, (uint8_t)0x61U, (uint8_t)0xD1U, (uint8_t)0x08U, - (uint8_t)0xA9U, (uint8_t)0x4BU, (uint8_t)0xB2U, (uint8_t)0xC8U, (uint8_t)0xE3U, (uint8_t)0xFBU, - (uint8_t)0xB9U, (uint8_t)0x6AU, (uint8_t)0xDAU, (uint8_t)0xB7U, (uint8_t)0x60U, (uint8_t)0xD7U, - (uint8_t)0xF4U, (uint8_t)0x68U, (uint8_t)0x1DU, (uint8_t)0x4FU, (uint8_t)0x42U, (uint8_t)0xA3U, - (uint8_t)0xDEU, (uint8_t)0x39U, (uint8_t)0x4DU, (uint8_t)0xF4U, (uint8_t)0xAEU, (uint8_t)0x56U, - (uint8_t)0xEDU, (uint8_t)0xE7U, (uint8_t)0x63U, (uint8_t)0x72U, (uint8_t)0xBBU, (uint8_t)0x19U, - (uint8_t)0x0BU, (uint8_t)0x07U, (uint8_t)0xA7U, (uint8_t)0xC8U, (uint8_t)0xEEU, (uint8_t)0x0AU, - (uint8_t)0x6DU, (uint8_t)0x70U, (uint8_t)0x9EU, (uint8_t)0x02U, (uint8_t)0xFCU, (uint8_t)0xE1U, - (uint8_t)0xCDU, (uint8_t)0xF7U, (uint8_t)0xE2U, (uint8_t)0xECU, (uint8_t)0xC0U, (uint8_t)0x34U, - (uint8_t)0x04U, (uint8_t)0xCDU, (uint8_t)0x28U, (uint8_t)0x34U, (uint8_t)0x2FU, (uint8_t)0x61U, - (uint8_t)0x91U, (uint8_t)0x72U, (uint8_t)0xFEU, (uint8_t)0x9CU, (uint8_t)0xE9U, (uint8_t)0x85U, - (uint8_t)0x83U, (uint8_t)0xFFU, (uint8_t)0x8EU, (uint8_t)0x4FU, (uint8_t)0x12U, (uint8_t)0x32U, - (uint8_t)0xEEU, (uint8_t)0xF2U, (uint8_t)0x81U, (uint8_t)0x83U, (uint8_t)0xC3U, (uint8_t)0xFEU, - (uint8_t)0x3BU, (uint8_t)0x1BU, (uint8_t)0x4CU, (uint8_t)0x6FU, (uint8_t)0xADU, (uint8_t)0x73U, - (uint8_t)0x3BU, (uint8_t)0xB5U, (uint8_t)0xFCU, (uint8_t)0xBCU, (uint8_t)0x2EU, (uint8_t)0xC2U, - (uint8_t)0x20U, (uint8_t)0x05U, (uint8_t)0xC5U, (uint8_t)0x8EU, (uint8_t)0xF1U, (uint8_t)0x83U, - (uint8_t)0x7DU, (uint8_t)0x16U, (uint8_t)0x83U, (uint8_t)0xB2U, (uint8_t)0xC6U, (uint8_t)0xF3U, - (uint8_t)0x4AU, (uint8_t)0x26U, (uint8_t)0xC1U, (uint8_t)0xB2U, (uint8_t)0xEFU, (uint8_t)0xFAU, - (uint8_t)0x88U, (uint8_t)0x6BU, (uint8_t)0x42U, (uint8_t)0x38U, (uint8_t)0x61U, (uint8_t)0x1FU, - (uint8_t)0xCFU, (uint8_t)0xDCU, (uint8_t)0xDEU, (uint8_t)0x35U, (uint8_t)0x5BU, (uint8_t)0x3BU, - (uint8_t)0x65U, (uint8_t)0x19U, (uint8_t)0x03U, (uint8_t)0x5BU, (uint8_t)0xBCU, (uint8_t)0x34U, - (uint8_t)0xF4U, (uint8_t)0xDEU, (uint8_t)0xF9U, (uint8_t)0x9CU, (uint8_t)0x02U, (uint8_t)0x38U, - (uint8_t)0x61U, (uint8_t)0xB4U, (uint8_t)0x6FU, (uint8_t)0xC9U, (uint8_t)0xD6U, (uint8_t)0xE6U, - (uint8_t)0xC9U, (uint8_t)0x07U, (uint8_t)0x7AU, (uint8_t)0xD9U, (uint8_t)0x1DU, (uint8_t)0x26U, - (uint8_t)0x91U, (uint8_t)0xF7U, (uint8_t)0xF7U, (uint8_t)0xEEU, (uint8_t)0x59U, (uint8_t)0x8CU, - (uint8_t)0xB0U, (uint8_t)0xFAU, (uint8_t)0xC1U, (uint8_t)0x86U, (uint8_t)0xD9U, (uint8_t)0x1CU, - (uint8_t)0xAEU, (uint8_t)0xFEU, (uint8_t)0x13U, (uint8_t)0x09U, (uint8_t)0x85U, (uint8_t)0x13U, - (uint8_t)0x92U, (uint8_t)0x70U, (uint8_t)0xB4U, (uint8_t)0x13U, (uint8_t)0x0CU, (uint8_t)0x93U, - (uint8_t)0xBCU, (uint8_t)0x43U, (uint8_t)0x79U, (uint8_t)0x44U, (uint8_t)0xF4U, (uint8_t)0xFDU, - (uint8_t)0x44U, (uint8_t)0x52U, (uint8_t)0xE2U, (uint8_t)0xD7U, (uint8_t)0x4DU, (uint8_t)0xD3U, - (uint8_t)0x64U, (uint8_t)0xF2U, (uint8_t)0xE2U, (uint8_t)0x1EU, (uint8_t)0x71U, (uint8_t)0xF5U, - (uint8_t)0x4BU, (uint8_t)0xFFU, (uint8_t)0x5CU, (uint8_t)0xAEU, (uint8_t)0x82U, (uint8_t)0xABU, - (uint8_t)0x9CU, (uint8_t)0x9DU, (uint8_t)0xF6U, (uint8_t)0x9EU, (uint8_t)0xE8U, (uint8_t)0x6DU, - (uint8_t)0x2BU, (uint8_t)0xC5U, (uint8_t)0x22U, (uint8_t)0x36U, (uint8_t)0x3AU, (uint8_t)0x0DU, - (uint8_t)0xABU, (uint8_t)0xC5U, (uint8_t)0x21U, (uint8_t)0x97U, (uint8_t)0x9BU, (uint8_t)0x0DU, - (uint8_t)0xEAU, (uint8_t)0xDAU, (uint8_t)0x1DU, (uint8_t)0xBFU, (uint8_t)0x9AU, (uint8_t)0x42U, - (uint8_t)0xD5U, (uint8_t)0xC4U, (uint8_t)0x48U, (uint8_t)0x4EU, (uint8_t)0x0AU, (uint8_t)0xBCU, - (uint8_t)0xD0U, (uint8_t)0x6BU, (uint8_t)0xFAU, (uint8_t)0x53U, (uint8_t)0xDDU, (uint8_t)0xEFU, - (uint8_t)0x3CU, (uint8_t)0x1BU, (uint8_t)0x20U, (uint8_t)0xEEU, (uint8_t)0x3FU, (uint8_t)0xD5U, - (uint8_t)0x9DU, (uint8_t)0x7CU, (uint8_t)0x25U, (uint8_t)0xE4U, (uint8_t)0x1DU, (uint8_t)0x2BU, - (uint8_t)0x66U, (uint8_t)0x9EU, (uint8_t)0x1EU, (uint8_t)0xF1U, (uint8_t)0x6EU, (uint8_t)0x6FU, - (uint8_t)0x52U, (uint8_t)0xC3U, (uint8_t)0x16U, (uint8_t)0x4DU, (uint8_t)0xF4U, (uint8_t)0xFBU, - (uint8_t)0x79U, (uint8_t)0x30U, (uint8_t)0xE9U, (uint8_t)0xE4U, (uint8_t)0xE5U, (uint8_t)0x88U, - (uint8_t)0x57U, (uint8_t)0xB6U, (uint8_t)0xACU, (uint8_t)0x7DU, (uint8_t)0x5FU, (uint8_t)0x42U, - (uint8_t)0xD6U, (uint8_t)0x9FU, (uint8_t)0x6DU, (uint8_t)0x18U, (uint8_t)0x77U, (uint8_t)0x63U, - (uint8_t)0xCFU, (uint8_t)0x1DU, (uint8_t)0x55U, (uint8_t)0x03U, (uint8_t)0x40U, (uint8_t)0x04U, - (uint8_t)0x87U, (uint8_t)0xF5U, (uint8_t)0x5BU, (uint8_t)0xA5U, (uint8_t)0x7EU, (uint8_t)0x31U, - (uint8_t)0xCCU, (uint8_t)0x7AU, (uint8_t)0x71U, (uint8_t)0x35U, (uint8_t)0xC8U, (uint8_t)0x86U, - (uint8_t)0xEFU, (uint8_t)0xB4U, (uint8_t)0x31U, (uint8_t)0x8AU, (uint8_t)0xEDU, (uint8_t)0x6AU, - (uint8_t)0x1EU, (uint8_t)0x01U, (uint8_t)0x2DU, (uint8_t)0x9EU, (uint8_t)0x68U, (uint8_t)0x32U, - (uint8_t)0xA9U, (uint8_t)0x07U, (uint8_t)0x60U, (uint8_t)0x0AU, (uint8_t)0x91U, (uint8_t)0x81U, - (uint8_t)0x30U, (uint8_t)0xC4U, (uint8_t)0x6DU, (uint8_t)0xC7U, (uint8_t)0x78U, (uint8_t)0xF9U, - (uint8_t)0x71U, (uint8_t)0xADU, (uint8_t)0x00U, (uint8_t)0x38U, (uint8_t)0x09U, (uint8_t)0x29U, - (uint8_t)0x99U, (uint8_t)0xA3U, (uint8_t)0x33U, (uint8_t)0xCBU, (uint8_t)0x8BU, (uint8_t)0x7AU, - (uint8_t)0x1AU, (uint8_t)0x1DU, (uint8_t)0xB9U, (uint8_t)0x3DU, (uint8_t)0x71U, (uint8_t)0x40U, - (uint8_t)0x00U, (uint8_t)0x3CU, (uint8_t)0x2AU, (uint8_t)0x4EU, (uint8_t)0xCEU, (uint8_t)0xA9U, - (uint8_t)0xF9U, (uint8_t)0x8DU, (uint8_t)0x0AU, (uint8_t)0xCCU, (uint8_t)0x0AU, (uint8_t)0x82U, - (uint8_t)0x91U, (uint8_t)0xCDU, (uint8_t)0xCEU, (uint8_t)0xC9U, (uint8_t)0x7DU, (uint8_t)0xCFU, - (uint8_t)0x8EU, (uint8_t)0xC9U, (uint8_t)0xB5U, (uint8_t)0x5AU, (uint8_t)0x7FU, (uint8_t)0x88U, - (uint8_t)0xA4U, (uint8_t)0x6BU, (uint8_t)0x4DU, (uint8_t)0xB5U, (uint8_t)0xA8U, (uint8_t)0x51U, - (uint8_t)0xF4U, (uint8_t)0x41U, (uint8_t)0x82U, (uint8_t)0xE1U, (uint8_t)0xC6U, (uint8_t)0x8AU, - (uint8_t)0x00U, (uint8_t)0x7EU, (uint8_t)0x5EU, (uint8_t)0x0DU, (uint8_t)0xD9U, (uint8_t)0x02U, - (uint8_t)0x0BU, (uint8_t)0xFDU, (uint8_t)0x64U, (uint8_t)0xB6U, (uint8_t)0x45U, (uint8_t)0x03U, - (uint8_t)0x6CU, (uint8_t)0x7AU, (uint8_t)0x4EU, (uint8_t)0x67U, (uint8_t)0x7DU, (uint8_t)0x2CU, - (uint8_t)0x38U, (uint8_t)0x53U, (uint8_t)0x2AU, (uint8_t)0x3AU, (uint8_t)0x23U, (uint8_t)0xBAU, - (uint8_t)0x44U, (uint8_t)0x42U, (uint8_t)0xCAU, (uint8_t)0xF5U, (uint8_t)0x3EU, (uint8_t)0xA6U, - (uint8_t)0x3BU, (uint8_t)0xB4U, (uint8_t)0x54U, (uint8_t)0x32U, (uint8_t)0x9BU, (uint8_t)0x76U, - (uint8_t)0x24U, (uint8_t)0xC8U, (uint8_t)0x91U, (uint8_t)0x7BU, (uint8_t)0xDDU, (uint8_t)0x64U, - (uint8_t)0xB1U, (uint8_t)0xC0U, (uint8_t)0xFDU, (uint8_t)0x4CU, (uint8_t)0xB3U, (uint8_t)0x8EU, - (uint8_t)0x8CU, (uint8_t)0x33U, (uint8_t)0x4CU, (uint8_t)0x70U, (uint8_t)0x1CU, (uint8_t)0x3AU, - (uint8_t)0xCDU, (uint8_t)0xADU, (uint8_t)0x06U, (uint8_t)0x57U, (uint8_t)0xFCU, (uint8_t)0xCFU, - (uint8_t)0xECU, (uint8_t)0x71U, (uint8_t)0x9BU, (uint8_t)0x1FU, (uint8_t)0x5CU, (uint8_t)0x3EU, - (uint8_t)0x4EU, (uint8_t)0x46U, (uint8_t)0x04U, (uint8_t)0x1FU, (uint8_t)0x38U, (uint8_t)0x81U, - (uint8_t)0x47U, (uint8_t)0xFBU, (uint8_t)0x4CU, (uint8_t)0xFDU, (uint8_t)0xB4U, (uint8_t)0x77U, - (uint8_t)0xA5U, (uint8_t)0x24U, (uint8_t)0x71U, (uint8_t)0xF7U, (uint8_t)0xA9U, (uint8_t)0xA9U, - (uint8_t)0x69U, (uint8_t)0x10U, (uint8_t)0xB8U, (uint8_t)0x55U, (uint8_t)0x32U, (uint8_t)0x2EU, - (uint8_t)0xDBU, (uint8_t)0x63U, (uint8_t)0x40U, (uint8_t)0xD8U, (uint8_t)0xA0U, (uint8_t)0x0EU, - (uint8_t)0xF0U, (uint8_t)0x92U, (uint8_t)0x35U, (uint8_t)0x05U, (uint8_t)0x11U, (uint8_t)0xE3U, - (uint8_t)0x0AU, (uint8_t)0xBEU, (uint8_t)0xC1U, (uint8_t)0xFFU, (uint8_t)0xF9U, (uint8_t)0xE3U, - (uint8_t)0xA2U, (uint8_t)0x6EU, (uint8_t)0x7FU, (uint8_t)0xB2U, (uint8_t)0x9FU, (uint8_t)0x8CU, - (uint8_t)0x18U, (uint8_t)0x30U, (uint8_t)0x23U, (uint8_t)0xC3U, (uint8_t)0x58U, (uint8_t)0x7EU, - (uint8_t)0x38U, (uint8_t)0xDAU, (uint8_t)0x00U, (uint8_t)0x77U, (uint8_t)0xD9U, (uint8_t)0xB4U, - (uint8_t)0x76U, (uint8_t)0x3EU, (uint8_t)0x4EU, (uint8_t)0x4BU, (uint8_t)0x94U, (uint8_t)0xB2U, - (uint8_t)0xBBU, (uint8_t)0xC1U, (uint8_t)0x94U, (uint8_t)0xC6U, (uint8_t)0x65U, (uint8_t)0x1EU, - (uint8_t)0x77U, (uint8_t)0xCAU, (uint8_t)0xF9U, (uint8_t)0x92U, (uint8_t)0xEEU, (uint8_t)0xAAU, - (uint8_t)0xC0U, (uint8_t)0x23U, (uint8_t)0x2AU, (uint8_t)0x28U, (uint8_t)0x1BU, (uint8_t)0xF6U, - (uint8_t)0xB3U, (uint8_t)0xA7U, (uint8_t)0x39U, (uint8_t)0xC1U, (uint8_t)0x22U, (uint8_t)0x61U, - (uint8_t)0x16U, (uint8_t)0x82U, (uint8_t)0x0AU, (uint8_t)0xE8U, (uint8_t)0xDBU, (uint8_t)0x58U, - (uint8_t)0x47U, (uint8_t)0xA6U, (uint8_t)0x7CU, (uint8_t)0xBEU, (uint8_t)0xF9U, (uint8_t)0xC9U, - (uint8_t)0x09U, (uint8_t)0x1BU, (uint8_t)0x46U, (uint8_t)0x2DU, (uint8_t)0x53U, (uint8_t)0x8CU, - (uint8_t)0xD7U, (uint8_t)0x2BU, (uint8_t)0x03U, (uint8_t)0x74U, (uint8_t)0x6AU, (uint8_t)0xE7U, - (uint8_t)0x7FU, (uint8_t)0x5EU, (uint8_t)0x62U, (uint8_t)0x29U, (uint8_t)0x2CU, (uint8_t)0x31U, - (uint8_t)0x15U, (uint8_t)0x62U, (uint8_t)0xA8U, (uint8_t)0x46U, (uint8_t)0x50U, (uint8_t)0x5DU, - (uint8_t)0xC8U, (uint8_t)0x2DU, (uint8_t)0xB8U, (uint8_t)0x54U, (uint8_t)0x33U, (uint8_t)0x8AU, - (uint8_t)0xE4U, (uint8_t)0x9FU, (uint8_t)0x52U, (uint8_t)0x35U, (uint8_t)0xC9U, (uint8_t)0x5BU, - (uint8_t)0x91U, (uint8_t)0x17U, (uint8_t)0x8CU, (uint8_t)0xCFU, (uint8_t)0x2DU, (uint8_t)0xD5U, - (uint8_t)0xCAU, (uint8_t)0xCEU, (uint8_t)0xF4U, (uint8_t)0x03U, (uint8_t)0xECU, (uint8_t)0x9DU, - (uint8_t)0x18U, (uint8_t)0x10U, (uint8_t)0xC6U, (uint8_t)0x27U, (uint8_t)0x2BU, (uint8_t)0x04U, - (uint8_t)0x5BU, (uint8_t)0x3BU, (uint8_t)0x71U, (uint8_t)0xF9U, (uint8_t)0xDCU, (uint8_t)0x6BU, - (uint8_t)0x80U, (uint8_t)0xD6U, (uint8_t)0x3FU, (uint8_t)0xDDU, (uint8_t)0x4AU, (uint8_t)0x8EU, - (uint8_t)0x9AU, (uint8_t)0xDBU, (uint8_t)0x1EU, (uint8_t)0x69U, (uint8_t)0x62U, (uint8_t)0xA6U, - (uint8_t)0x95U, (uint8_t)0x26U, (uint8_t)0xD4U, (uint8_t)0x31U, (uint8_t)0x61U, (uint8_t)0xC1U, - (uint8_t)0xA4U, (uint8_t)0x1DU, (uint8_t)0x57U, (uint8_t)0x0DU, (uint8_t)0x79U, (uint8_t)0x38U, - (uint8_t)0xDAU, (uint8_t)0xD4U, (uint8_t)0xA4U, (uint8_t)0x0EU, (uint8_t)0x32U, (uint8_t)0x9CU, - (uint8_t)0xD0U, (uint8_t)0xE4U, (uint8_t)0x0EU, (uint8_t)0x65U, (uint8_t)0xFFU, (uint8_t)0xFFU, - (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU + 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xADU, 0xF8U, 0x54U, 0x58U, 0xA2U, + 0xBBU, 0x4AU, 0x9AU, 0xAFU, 0xDCU, 0x56U, 0x20U, 0x27U, 0x3DU, 0x3CU, 0xF1U, 0xD8U, 0xB9U, + 0xC5U, 0x83U, 0xCEU, 0x2DU, 0x36U, 0x95U, 0xA9U, 0xE1U, 0x36U, 0x41U, 0x14U, 0x64U, 0x33U, + 0xFBU, 0xCCU, 0x93U, 0x9DU, 0xCEU, 0x24U, 0x9BU, 0x3EU, 0xF9U, 0x7DU, 0x2FU, 0xE3U, 0x63U, + 0x63U, 0x0CU, 0x75U, 0xD8U, 0xF6U, 0x81U, 0xB2U, 0x02U, 0xAEU, 0xC4U, 0x61U, 0x7AU, 0xD3U, + 0xDFU, 0x1EU, 0xD5U, 0xD5U, 0xFDU, 0x65U, 0x61U, 0x24U, 0x33U, 0xF5U, 0x1FU, 0x5FU, 0x06U, + 0x6EU, 0xD0U, 0x85U, 0x63U, 0x65U, 0x55U, 0x3DU, 0xEDU, 0x1AU, 0xF3U, 0xB5U, 0x57U, 0x13U, + 0x5EU, 0x7FU, 0x57U, 0xC9U, 0x35U, 0x98U, 0x4FU, 0x0CU, 0x70U, 0xE0U, 0xE6U, 0x8BU, 0x77U, + 0xE2U, 0xA6U, 0x89U, 0xDAU, 0xF3U, 0xEFU, 0xE8U, 0x72U, 0x1DU, 0xF1U, 0x58U, 0xA1U, 0x36U, + 0xADU, 0xE7U, 0x35U, 0x30U, 0xACU, 0xCAU, 0x4FU, 0x48U, 0x3AU, 0x79U, 0x7AU, 0xBCU, 0x0AU, + 0xB1U, 0x82U, 0xB3U, 0x24U, 0xFBU, 0x61U, 0xD1U, 0x08U, 0xA9U, 0x4BU, 0xB2U, 0xC8U, 0xE3U, + 0xFBU, 0xB9U, 0x6AU, 0xDAU, 0xB7U, 0x60U, 0xD7U, 0xF4U, 0x68U, 0x1DU, 0x4FU, 0x42U, 0xA3U, + 0xDEU, 0x39U, 0x4DU, 0xF4U, 0xAEU, 0x56U, 0xEDU, 0xE7U, 0x63U, 0x72U, 0xBBU, 0x19U, 0x0BU, + 0x07U, 0xA7U, 0xC8U, 0xEEU, 0x0AU, 0x6DU, 0x70U, 0x9EU, 0x02U, 0xFCU, 0xE1U, 0xCDU, 0xF7U, + 0xE2U, 0xECU, 0xC0U, 0x34U, 0x04U, 0xCDU, 0x28U, 0x34U, 0x2FU, 0x61U, 0x91U, 0x72U, 0xFEU, + 0x9CU, 0xE9U, 0x85U, 0x83U, 0xFFU, 0x8EU, 0x4FU, 0x12U, 0x32U, 0xEEU, 0xF2U, 0x81U, 0x83U, + 0xC3U, 0xFEU, 0x3BU, 0x1BU, 0x4CU, 0x6FU, 0xADU, 0x73U, 0x3BU, 0xB5U, 0xFCU, 0xBCU, 0x2EU, + 0xC2U, 0x20U, 0x05U, 0xC5U, 0x8EU, 0xF1U, 0x83U, 0x7DU, 0x16U, 0x83U, 0xB2U, 0xC6U, 0xF3U, + 0x4AU, 0x26U, 0xC1U, 0xB2U, 0xEFU, 0xFAU, 0x88U, 0x6BU, 0x42U, 0x38U, 0x61U, 0x1FU, 0xCFU, + 0xDCU, 0xDEU, 0x35U, 0x5BU, 0x3BU, 0x65U, 0x19U, 0x03U, 0x5BU, 0xBCU, 0x34U, 0xF4U, 0xDEU, + 0xF9U, 0x9CU, 0x02U, 0x38U, 0x61U, 0xB4U, 0x6FU, 0xC9U, 0xD6U, 0xE6U, 0xC9U, 0x07U, 0x7AU, + 0xD9U, 0x1DU, 0x26U, 0x91U, 0xF7U, 0xF7U, 0xEEU, 0x59U, 0x8CU, 0xB0U, 0xFAU, 0xC1U, 0x86U, + 0xD9U, 0x1CU, 0xAEU, 0xFEU, 0x13U, 0x09U, 0x85U, 0x13U, 0x92U, 0x70U, 0xB4U, 0x13U, 0x0CU, + 0x93U, 0xBCU, 0x43U, 0x79U, 0x44U, 0xF4U, 0xFDU, 0x44U, 0x52U, 0xE2U, 0xD7U, 0x4DU, 0xD3U, + 0x64U, 0xF2U, 0xE2U, 0x1EU, 0x71U, 0xF5U, 0x4BU, 0xFFU, 0x5CU, 0xAEU, 0x82U, 0xABU, 0x9CU, + 0x9DU, 0xF6U, 0x9EU, 0xE8U, 0x6DU, 0x2BU, 0xC5U, 0x22U, 0x36U, 0x3AU, 0x0DU, 0xABU, 0xC5U, + 0x21U, 0x97U, 0x9BU, 0x0DU, 0xEAU, 0xDAU, 0x1DU, 0xBFU, 0x9AU, 0x42U, 0xD5U, 0xC4U, 0x48U, + 0x4EU, 0x0AU, 0xBCU, 0xD0U, 0x6BU, 0xFAU, 0x53U, 0xDDU, 0xEFU, 0x3CU, 0x1BU, 0x20U, 0xEEU, + 0x3FU, 0xD5U, 0x9DU, 0x7CU, 0x25U, 0xE4U, 0x1DU, 0x2BU, 0x66U, 0x9EU, 0x1EU, 0xF1U, 0x6EU, + 0x6FU, 0x52U, 0xC3U, 0x16U, 0x4DU, 0xF4U, 0xFBU, 0x79U, 0x30U, 0xE9U, 0xE4U, 0xE5U, 0x88U, + 0x57U, 0xB6U, 0xACU, 0x7DU, 0x5FU, 0x42U, 0xD6U, 0x9FU, 0x6DU, 0x18U, 0x77U, 0x63U, 0xCFU, + 0x1DU, 0x55U, 0x03U, 0x40U, 0x04U, 0x87U, 0xF5U, 0x5BU, 0xA5U, 0x7EU, 0x31U, 0xCCU, 0x7AU, + 0x71U, 0x35U, 0xC8U, 0x86U, 0xEFU, 0xB4U, 0x31U, 0x8AU, 0xEDU, 0x6AU, 0x1EU, 0x01U, 0x2DU, + 0x9EU, 0x68U, 0x32U, 0xA9U, 0x07U, 0x60U, 0x0AU, 0x91U, 0x81U, 0x30U, 0xC4U, 0x6DU, 0xC7U, + 0x78U, 0xF9U, 0x71U, 0xADU, 0x00U, 0x38U, 0x09U, 0x29U, 0x99U, 0xA3U, 0x33U, 0xCBU, 0x8BU, + 0x7AU, 0x1AU, 0x1DU, 0xB9U, 0x3DU, 0x71U, 0x40U, 0x00U, 0x3CU, 0x2AU, 0x4EU, 0xCEU, 0xA9U, + 0xF9U, 0x8DU, 0x0AU, 0xCCU, 0x0AU, 0x82U, 0x91U, 0xCDU, 0xCEU, 0xC9U, 0x7DU, 0xCFU, 0x8EU, + 0xC9U, 0xB5U, 0x5AU, 0x7FU, 0x88U, 0xA4U, 0x6BU, 0x4DU, 0xB5U, 0xA8U, 0x51U, 0xF4U, 0x41U, + 0x82U, 0xE1U, 0xC6U, 0x8AU, 0x00U, 0x7EU, 0x5EU, 0x0DU, 0xD9U, 0x02U, 0x0BU, 0xFDU, 0x64U, + 0xB6U, 0x45U, 0x03U, 0x6CU, 0x7AU, 0x4EU, 0x67U, 0x7DU, 0x2CU, 0x38U, 0x53U, 0x2AU, 0x3AU, + 0x23U, 0xBAU, 0x44U, 0x42U, 0xCAU, 0xF5U, 0x3EU, 0xA6U, 0x3BU, 0xB4U, 0x54U, 0x32U, 0x9BU, + 0x76U, 0x24U, 0xC8U, 0x91U, 0x7BU, 0xDDU, 0x64U, 0xB1U, 0xC0U, 0xFDU, 0x4CU, 0xB3U, 0x8EU, + 0x8CU, 0x33U, 0x4CU, 0x70U, 0x1CU, 0x3AU, 0xCDU, 0xADU, 0x06U, 0x57U, 0xFCU, 0xCFU, 0xECU, + 0x71U, 0x9BU, 0x1FU, 0x5CU, 0x3EU, 0x4EU, 0x46U, 0x04U, 0x1FU, 0x38U, 0x81U, 0x47U, 0xFBU, + 0x4CU, 0xFDU, 0xB4U, 0x77U, 0xA5U, 0x24U, 0x71U, 0xF7U, 0xA9U, 0xA9U, 0x69U, 0x10U, 0xB8U, + 0x55U, 0x32U, 0x2EU, 0xDBU, 0x63U, 0x40U, 0xD8U, 0xA0U, 0x0EU, 0xF0U, 0x92U, 0x35U, 0x05U, + 0x11U, 0xE3U, 0x0AU, 0xBEU, 0xC1U, 0xFFU, 0xF9U, 0xE3U, 0xA2U, 0x6EU, 0x7FU, 0xB2U, 0x9FU, + 0x8CU, 0x18U, 0x30U, 0x23U, 0xC3U, 0x58U, 0x7EU, 0x38U, 0xDAU, 0x00U, 0x77U, 0xD9U, 0xB4U, + 0x76U, 0x3EU, 0x4EU, 0x4BU, 0x94U, 0xB2U, 0xBBU, 0xC1U, 0x94U, 0xC6U, 0x65U, 0x1EU, 0x77U, + 0xCAU, 0xF9U, 0x92U, 0xEEU, 0xAAU, 0xC0U, 0x23U, 0x2AU, 0x28U, 0x1BU, 0xF6U, 0xB3U, 0xA7U, + 0x39U, 0xC1U, 0x22U, 0x61U, 0x16U, 0x82U, 0x0AU, 0xE8U, 0xDBU, 0x58U, 0x47U, 0xA6U, 0x7CU, + 0xBEU, 0xF9U, 0xC9U, 0x09U, 0x1BU, 0x46U, 0x2DU, 0x53U, 0x8CU, 0xD7U, 0x2BU, 0x03U, 0x74U, + 0x6AU, 0xE7U, 0x7FU, 0x5EU, 0x62U, 0x29U, 0x2CU, 0x31U, 0x15U, 0x62U, 0xA8U, 0x46U, 0x50U, + 0x5DU, 0xC8U, 0x2DU, 0xB8U, 0x54U, 0x33U, 0x8AU, 0xE4U, 0x9FU, 0x52U, 0x35U, 0xC9U, 0x5BU, + 0x91U, 0x17U, 0x8CU, 0xCFU, 0x2DU, 0xD5U, 0xCAU, 0xCEU, 0xF4U, 0x03U, 0xECU, 0x9DU, 0x18U, + 0x10U, 0xC6U, 0x27U, 0x2BU, 0x04U, 0x5BU, 0x3BU, 0x71U, 0xF9U, 0xDCU, 0x6BU, 0x80U, 0xD6U, + 0x3FU, 0xDDU, 0x4AU, 0x8EU, 0x9AU, 0xDBU, 0x1EU, 0x69U, 0x62U, 0xA6U, 0x95U, 0x26U, 0xD4U, + 0x31U, 0x61U, 0xC1U, 0xA4U, 0x1DU, 0x57U, 0x0DU, 0x79U, 0x38U, 0xDAU, 0xD4U, 0xA4U, 0x0EU, + 0x32U, 0x9CU, 0xD0U, 0xE4U, 0x0EU, 0x65U, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, + 0xFFU }; static const uint8_t Hacl_Impl_FFDHE_Constants_ffdhe_p8192[1024U] = { - (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, - (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xADU, (uint8_t)0xF8U, (uint8_t)0x54U, (uint8_t)0x58U, - (uint8_t)0xA2U, (uint8_t)0xBBU, (uint8_t)0x4AU, (uint8_t)0x9AU, (uint8_t)0xAFU, (uint8_t)0xDCU, - (uint8_t)0x56U, (uint8_t)0x20U, (uint8_t)0x27U, (uint8_t)0x3DU, (uint8_t)0x3CU, (uint8_t)0xF1U, - (uint8_t)0xD8U, (uint8_t)0xB9U, (uint8_t)0xC5U, (uint8_t)0x83U, (uint8_t)0xCEU, (uint8_t)0x2DU, - (uint8_t)0x36U, (uint8_t)0x95U, (uint8_t)0xA9U, (uint8_t)0xE1U, (uint8_t)0x36U, (uint8_t)0x41U, - (uint8_t)0x14U, (uint8_t)0x64U, (uint8_t)0x33U, (uint8_t)0xFBU, (uint8_t)0xCCU, (uint8_t)0x93U, - (uint8_t)0x9DU, (uint8_t)0xCEU, (uint8_t)0x24U, (uint8_t)0x9BU, (uint8_t)0x3EU, (uint8_t)0xF9U, - (uint8_t)0x7DU, (uint8_t)0x2FU, (uint8_t)0xE3U, (uint8_t)0x63U, (uint8_t)0x63U, (uint8_t)0x0CU, - (uint8_t)0x75U, (uint8_t)0xD8U, (uint8_t)0xF6U, (uint8_t)0x81U, (uint8_t)0xB2U, (uint8_t)0x02U, - (uint8_t)0xAEU, (uint8_t)0xC4U, (uint8_t)0x61U, (uint8_t)0x7AU, (uint8_t)0xD3U, (uint8_t)0xDFU, - (uint8_t)0x1EU, (uint8_t)0xD5U, (uint8_t)0xD5U, (uint8_t)0xFDU, (uint8_t)0x65U, (uint8_t)0x61U, - (uint8_t)0x24U, (uint8_t)0x33U, (uint8_t)0xF5U, (uint8_t)0x1FU, (uint8_t)0x5FU, (uint8_t)0x06U, - (uint8_t)0x6EU, (uint8_t)0xD0U, (uint8_t)0x85U, (uint8_t)0x63U, (uint8_t)0x65U, (uint8_t)0x55U, - (uint8_t)0x3DU, (uint8_t)0xEDU, (uint8_t)0x1AU, (uint8_t)0xF3U, (uint8_t)0xB5U, (uint8_t)0x57U, - (uint8_t)0x13U, (uint8_t)0x5EU, (uint8_t)0x7FU, (uint8_t)0x57U, (uint8_t)0xC9U, (uint8_t)0x35U, - (uint8_t)0x98U, (uint8_t)0x4FU, (uint8_t)0x0CU, (uint8_t)0x70U, (uint8_t)0xE0U, (uint8_t)0xE6U, - (uint8_t)0x8BU, (uint8_t)0x77U, (uint8_t)0xE2U, (uint8_t)0xA6U, (uint8_t)0x89U, (uint8_t)0xDAU, - (uint8_t)0xF3U, (uint8_t)0xEFU, (uint8_t)0xE8U, (uint8_t)0x72U, (uint8_t)0x1DU, (uint8_t)0xF1U, - (uint8_t)0x58U, (uint8_t)0xA1U, (uint8_t)0x36U, (uint8_t)0xADU, (uint8_t)0xE7U, (uint8_t)0x35U, - (uint8_t)0x30U, (uint8_t)0xACU, (uint8_t)0xCAU, (uint8_t)0x4FU, (uint8_t)0x48U, (uint8_t)0x3AU, - (uint8_t)0x79U, (uint8_t)0x7AU, (uint8_t)0xBCU, (uint8_t)0x0AU, (uint8_t)0xB1U, (uint8_t)0x82U, - (uint8_t)0xB3U, (uint8_t)0x24U, (uint8_t)0xFBU, (uint8_t)0x61U, (uint8_t)0xD1U, (uint8_t)0x08U, - (uint8_t)0xA9U, (uint8_t)0x4BU, (uint8_t)0xB2U, (uint8_t)0xC8U, (uint8_t)0xE3U, (uint8_t)0xFBU, - (uint8_t)0xB9U, (uint8_t)0x6AU, (uint8_t)0xDAU, (uint8_t)0xB7U, (uint8_t)0x60U, (uint8_t)0xD7U, - (uint8_t)0xF4U, (uint8_t)0x68U, (uint8_t)0x1DU, (uint8_t)0x4FU, (uint8_t)0x42U, (uint8_t)0xA3U, - (uint8_t)0xDEU, (uint8_t)0x39U, (uint8_t)0x4DU, (uint8_t)0xF4U, (uint8_t)0xAEU, (uint8_t)0x56U, - (uint8_t)0xEDU, (uint8_t)0xE7U, (uint8_t)0x63U, (uint8_t)0x72U, (uint8_t)0xBBU, (uint8_t)0x19U, - (uint8_t)0x0BU, (uint8_t)0x07U, (uint8_t)0xA7U, (uint8_t)0xC8U, (uint8_t)0xEEU, (uint8_t)0x0AU, - (uint8_t)0x6DU, (uint8_t)0x70U, (uint8_t)0x9EU, (uint8_t)0x02U, (uint8_t)0xFCU, (uint8_t)0xE1U, - (uint8_t)0xCDU, (uint8_t)0xF7U, (uint8_t)0xE2U, (uint8_t)0xECU, (uint8_t)0xC0U, (uint8_t)0x34U, - (uint8_t)0x04U, (uint8_t)0xCDU, (uint8_t)0x28U, (uint8_t)0x34U, (uint8_t)0x2FU, (uint8_t)0x61U, - (uint8_t)0x91U, (uint8_t)0x72U, (uint8_t)0xFEU, (uint8_t)0x9CU, (uint8_t)0xE9U, (uint8_t)0x85U, - (uint8_t)0x83U, (uint8_t)0xFFU, (uint8_t)0x8EU, (uint8_t)0x4FU, (uint8_t)0x12U, (uint8_t)0x32U, - (uint8_t)0xEEU, (uint8_t)0xF2U, (uint8_t)0x81U, (uint8_t)0x83U, (uint8_t)0xC3U, (uint8_t)0xFEU, - (uint8_t)0x3BU, (uint8_t)0x1BU, (uint8_t)0x4CU, (uint8_t)0x6FU, (uint8_t)0xADU, (uint8_t)0x73U, - (uint8_t)0x3BU, (uint8_t)0xB5U, (uint8_t)0xFCU, (uint8_t)0xBCU, (uint8_t)0x2EU, (uint8_t)0xC2U, - (uint8_t)0x20U, (uint8_t)0x05U, (uint8_t)0xC5U, (uint8_t)0x8EU, (uint8_t)0xF1U, (uint8_t)0x83U, - (uint8_t)0x7DU, (uint8_t)0x16U, (uint8_t)0x83U, (uint8_t)0xB2U, (uint8_t)0xC6U, (uint8_t)0xF3U, - (uint8_t)0x4AU, (uint8_t)0x26U, (uint8_t)0xC1U, (uint8_t)0xB2U, (uint8_t)0xEFU, (uint8_t)0xFAU, - (uint8_t)0x88U, (uint8_t)0x6BU, (uint8_t)0x42U, (uint8_t)0x38U, (uint8_t)0x61U, (uint8_t)0x1FU, - (uint8_t)0xCFU, (uint8_t)0xDCU, (uint8_t)0xDEU, (uint8_t)0x35U, (uint8_t)0x5BU, (uint8_t)0x3BU, - (uint8_t)0x65U, (uint8_t)0x19U, (uint8_t)0x03U, (uint8_t)0x5BU, (uint8_t)0xBCU, (uint8_t)0x34U, - (uint8_t)0xF4U, (uint8_t)0xDEU, (uint8_t)0xF9U, (uint8_t)0x9CU, (uint8_t)0x02U, (uint8_t)0x38U, - (uint8_t)0x61U, (uint8_t)0xB4U, (uint8_t)0x6FU, (uint8_t)0xC9U, (uint8_t)0xD6U, (uint8_t)0xE6U, - (uint8_t)0xC9U, (uint8_t)0x07U, (uint8_t)0x7AU, (uint8_t)0xD9U, (uint8_t)0x1DU, (uint8_t)0x26U, - (uint8_t)0x91U, (uint8_t)0xF7U, (uint8_t)0xF7U, (uint8_t)0xEEU, (uint8_t)0x59U, (uint8_t)0x8CU, - (uint8_t)0xB0U, (uint8_t)0xFAU, (uint8_t)0xC1U, (uint8_t)0x86U, (uint8_t)0xD9U, (uint8_t)0x1CU, - (uint8_t)0xAEU, (uint8_t)0xFEU, (uint8_t)0x13U, (uint8_t)0x09U, (uint8_t)0x85U, (uint8_t)0x13U, - (uint8_t)0x92U, (uint8_t)0x70U, (uint8_t)0xB4U, (uint8_t)0x13U, (uint8_t)0x0CU, (uint8_t)0x93U, - (uint8_t)0xBCU, (uint8_t)0x43U, (uint8_t)0x79U, (uint8_t)0x44U, (uint8_t)0xF4U, (uint8_t)0xFDU, - (uint8_t)0x44U, (uint8_t)0x52U, (uint8_t)0xE2U, (uint8_t)0xD7U, (uint8_t)0x4DU, (uint8_t)0xD3U, - (uint8_t)0x64U, (uint8_t)0xF2U, (uint8_t)0xE2U, (uint8_t)0x1EU, (uint8_t)0x71U, (uint8_t)0xF5U, - (uint8_t)0x4BU, (uint8_t)0xFFU, (uint8_t)0x5CU, (uint8_t)0xAEU, (uint8_t)0x82U, (uint8_t)0xABU, - (uint8_t)0x9CU, (uint8_t)0x9DU, (uint8_t)0xF6U, (uint8_t)0x9EU, (uint8_t)0xE8U, (uint8_t)0x6DU, - (uint8_t)0x2BU, (uint8_t)0xC5U, (uint8_t)0x22U, (uint8_t)0x36U, (uint8_t)0x3AU, (uint8_t)0x0DU, - (uint8_t)0xABU, (uint8_t)0xC5U, (uint8_t)0x21U, (uint8_t)0x97U, (uint8_t)0x9BU, (uint8_t)0x0DU, - (uint8_t)0xEAU, (uint8_t)0xDAU, (uint8_t)0x1DU, (uint8_t)0xBFU, (uint8_t)0x9AU, (uint8_t)0x42U, - (uint8_t)0xD5U, (uint8_t)0xC4U, (uint8_t)0x48U, (uint8_t)0x4EU, (uint8_t)0x0AU, (uint8_t)0xBCU, - (uint8_t)0xD0U, (uint8_t)0x6BU, (uint8_t)0xFAU, (uint8_t)0x53U, (uint8_t)0xDDU, (uint8_t)0xEFU, - (uint8_t)0x3CU, (uint8_t)0x1BU, (uint8_t)0x20U, (uint8_t)0xEEU, (uint8_t)0x3FU, (uint8_t)0xD5U, - (uint8_t)0x9DU, (uint8_t)0x7CU, (uint8_t)0x25U, (uint8_t)0xE4U, (uint8_t)0x1DU, (uint8_t)0x2BU, - (uint8_t)0x66U, (uint8_t)0x9EU, (uint8_t)0x1EU, (uint8_t)0xF1U, (uint8_t)0x6EU, (uint8_t)0x6FU, - (uint8_t)0x52U, (uint8_t)0xC3U, (uint8_t)0x16U, (uint8_t)0x4DU, (uint8_t)0xF4U, (uint8_t)0xFBU, - (uint8_t)0x79U, (uint8_t)0x30U, (uint8_t)0xE9U, (uint8_t)0xE4U, (uint8_t)0xE5U, (uint8_t)0x88U, - (uint8_t)0x57U, (uint8_t)0xB6U, (uint8_t)0xACU, (uint8_t)0x7DU, (uint8_t)0x5FU, (uint8_t)0x42U, - (uint8_t)0xD6U, (uint8_t)0x9FU, (uint8_t)0x6DU, (uint8_t)0x18U, (uint8_t)0x77U, (uint8_t)0x63U, - (uint8_t)0xCFU, (uint8_t)0x1DU, (uint8_t)0x55U, (uint8_t)0x03U, (uint8_t)0x40U, (uint8_t)0x04U, - (uint8_t)0x87U, (uint8_t)0xF5U, (uint8_t)0x5BU, (uint8_t)0xA5U, (uint8_t)0x7EU, (uint8_t)0x31U, - (uint8_t)0xCCU, (uint8_t)0x7AU, (uint8_t)0x71U, (uint8_t)0x35U, (uint8_t)0xC8U, (uint8_t)0x86U, - (uint8_t)0xEFU, (uint8_t)0xB4U, (uint8_t)0x31U, (uint8_t)0x8AU, (uint8_t)0xEDU, (uint8_t)0x6AU, - (uint8_t)0x1EU, (uint8_t)0x01U, (uint8_t)0x2DU, (uint8_t)0x9EU, (uint8_t)0x68U, (uint8_t)0x32U, - (uint8_t)0xA9U, (uint8_t)0x07U, (uint8_t)0x60U, (uint8_t)0x0AU, (uint8_t)0x91U, (uint8_t)0x81U, - (uint8_t)0x30U, (uint8_t)0xC4U, (uint8_t)0x6DU, (uint8_t)0xC7U, (uint8_t)0x78U, (uint8_t)0xF9U, - (uint8_t)0x71U, (uint8_t)0xADU, (uint8_t)0x00U, (uint8_t)0x38U, (uint8_t)0x09U, (uint8_t)0x29U, - (uint8_t)0x99U, (uint8_t)0xA3U, (uint8_t)0x33U, (uint8_t)0xCBU, (uint8_t)0x8BU, (uint8_t)0x7AU, - (uint8_t)0x1AU, (uint8_t)0x1DU, (uint8_t)0xB9U, (uint8_t)0x3DU, (uint8_t)0x71U, (uint8_t)0x40U, - (uint8_t)0x00U, (uint8_t)0x3CU, (uint8_t)0x2AU, (uint8_t)0x4EU, (uint8_t)0xCEU, (uint8_t)0xA9U, - (uint8_t)0xF9U, (uint8_t)0x8DU, (uint8_t)0x0AU, (uint8_t)0xCCU, (uint8_t)0x0AU, (uint8_t)0x82U, - (uint8_t)0x91U, (uint8_t)0xCDU, (uint8_t)0xCEU, (uint8_t)0xC9U, (uint8_t)0x7DU, (uint8_t)0xCFU, - (uint8_t)0x8EU, (uint8_t)0xC9U, (uint8_t)0xB5U, (uint8_t)0x5AU, (uint8_t)0x7FU, (uint8_t)0x88U, - (uint8_t)0xA4U, (uint8_t)0x6BU, (uint8_t)0x4DU, (uint8_t)0xB5U, (uint8_t)0xA8U, (uint8_t)0x51U, - (uint8_t)0xF4U, (uint8_t)0x41U, (uint8_t)0x82U, (uint8_t)0xE1U, (uint8_t)0xC6U, (uint8_t)0x8AU, - (uint8_t)0x00U, (uint8_t)0x7EU, (uint8_t)0x5EU, (uint8_t)0x0DU, (uint8_t)0xD9U, (uint8_t)0x02U, - (uint8_t)0x0BU, (uint8_t)0xFDU, (uint8_t)0x64U, (uint8_t)0xB6U, (uint8_t)0x45U, (uint8_t)0x03U, - (uint8_t)0x6CU, (uint8_t)0x7AU, (uint8_t)0x4EU, (uint8_t)0x67U, (uint8_t)0x7DU, (uint8_t)0x2CU, - (uint8_t)0x38U, (uint8_t)0x53U, (uint8_t)0x2AU, (uint8_t)0x3AU, (uint8_t)0x23U, (uint8_t)0xBAU, - (uint8_t)0x44U, (uint8_t)0x42U, (uint8_t)0xCAU, (uint8_t)0xF5U, (uint8_t)0x3EU, (uint8_t)0xA6U, - (uint8_t)0x3BU, (uint8_t)0xB4U, (uint8_t)0x54U, (uint8_t)0x32U, (uint8_t)0x9BU, (uint8_t)0x76U, - (uint8_t)0x24U, (uint8_t)0xC8U, (uint8_t)0x91U, (uint8_t)0x7BU, (uint8_t)0xDDU, (uint8_t)0x64U, - (uint8_t)0xB1U, (uint8_t)0xC0U, (uint8_t)0xFDU, (uint8_t)0x4CU, (uint8_t)0xB3U, (uint8_t)0x8EU, - (uint8_t)0x8CU, (uint8_t)0x33U, (uint8_t)0x4CU, (uint8_t)0x70U, (uint8_t)0x1CU, (uint8_t)0x3AU, - (uint8_t)0xCDU, (uint8_t)0xADU, (uint8_t)0x06U, (uint8_t)0x57U, (uint8_t)0xFCU, (uint8_t)0xCFU, - (uint8_t)0xECU, (uint8_t)0x71U, (uint8_t)0x9BU, (uint8_t)0x1FU, (uint8_t)0x5CU, (uint8_t)0x3EU, - (uint8_t)0x4EU, (uint8_t)0x46U, (uint8_t)0x04U, (uint8_t)0x1FU, (uint8_t)0x38U, (uint8_t)0x81U, - (uint8_t)0x47U, (uint8_t)0xFBU, (uint8_t)0x4CU, (uint8_t)0xFDU, (uint8_t)0xB4U, (uint8_t)0x77U, - (uint8_t)0xA5U, (uint8_t)0x24U, (uint8_t)0x71U, (uint8_t)0xF7U, (uint8_t)0xA9U, (uint8_t)0xA9U, - (uint8_t)0x69U, (uint8_t)0x10U, (uint8_t)0xB8U, (uint8_t)0x55U, (uint8_t)0x32U, (uint8_t)0x2EU, - (uint8_t)0xDBU, (uint8_t)0x63U, (uint8_t)0x40U, (uint8_t)0xD8U, (uint8_t)0xA0U, (uint8_t)0x0EU, - (uint8_t)0xF0U, (uint8_t)0x92U, (uint8_t)0x35U, (uint8_t)0x05U, (uint8_t)0x11U, (uint8_t)0xE3U, - (uint8_t)0x0AU, (uint8_t)0xBEU, (uint8_t)0xC1U, (uint8_t)0xFFU, (uint8_t)0xF9U, (uint8_t)0xE3U, - (uint8_t)0xA2U, (uint8_t)0x6EU, (uint8_t)0x7FU, (uint8_t)0xB2U, (uint8_t)0x9FU, (uint8_t)0x8CU, - (uint8_t)0x18U, (uint8_t)0x30U, (uint8_t)0x23U, (uint8_t)0xC3U, (uint8_t)0x58U, (uint8_t)0x7EU, - (uint8_t)0x38U, (uint8_t)0xDAU, (uint8_t)0x00U, (uint8_t)0x77U, (uint8_t)0xD9U, (uint8_t)0xB4U, - (uint8_t)0x76U, (uint8_t)0x3EU, (uint8_t)0x4EU, (uint8_t)0x4BU, (uint8_t)0x94U, (uint8_t)0xB2U, - (uint8_t)0xBBU, (uint8_t)0xC1U, (uint8_t)0x94U, (uint8_t)0xC6U, (uint8_t)0x65U, (uint8_t)0x1EU, - (uint8_t)0x77U, (uint8_t)0xCAU, (uint8_t)0xF9U, (uint8_t)0x92U, (uint8_t)0xEEU, (uint8_t)0xAAU, - (uint8_t)0xC0U, (uint8_t)0x23U, (uint8_t)0x2AU, (uint8_t)0x28U, (uint8_t)0x1BU, (uint8_t)0xF6U, - (uint8_t)0xB3U, (uint8_t)0xA7U, (uint8_t)0x39U, (uint8_t)0xC1U, (uint8_t)0x22U, (uint8_t)0x61U, - (uint8_t)0x16U, (uint8_t)0x82U, (uint8_t)0x0AU, (uint8_t)0xE8U, (uint8_t)0xDBU, (uint8_t)0x58U, - (uint8_t)0x47U, (uint8_t)0xA6U, (uint8_t)0x7CU, (uint8_t)0xBEU, (uint8_t)0xF9U, (uint8_t)0xC9U, - (uint8_t)0x09U, (uint8_t)0x1BU, (uint8_t)0x46U, (uint8_t)0x2DU, (uint8_t)0x53U, (uint8_t)0x8CU, - (uint8_t)0xD7U, (uint8_t)0x2BU, (uint8_t)0x03U, (uint8_t)0x74U, (uint8_t)0x6AU, (uint8_t)0xE7U, - (uint8_t)0x7FU, (uint8_t)0x5EU, (uint8_t)0x62U, (uint8_t)0x29U, (uint8_t)0x2CU, (uint8_t)0x31U, - (uint8_t)0x15U, (uint8_t)0x62U, (uint8_t)0xA8U, (uint8_t)0x46U, (uint8_t)0x50U, (uint8_t)0x5DU, - (uint8_t)0xC8U, (uint8_t)0x2DU, (uint8_t)0xB8U, (uint8_t)0x54U, (uint8_t)0x33U, (uint8_t)0x8AU, - (uint8_t)0xE4U, (uint8_t)0x9FU, (uint8_t)0x52U, (uint8_t)0x35U, (uint8_t)0xC9U, (uint8_t)0x5BU, - (uint8_t)0x91U, (uint8_t)0x17U, (uint8_t)0x8CU, (uint8_t)0xCFU, (uint8_t)0x2DU, (uint8_t)0xD5U, - (uint8_t)0xCAU, (uint8_t)0xCEU, (uint8_t)0xF4U, (uint8_t)0x03U, (uint8_t)0xECU, (uint8_t)0x9DU, - (uint8_t)0x18U, (uint8_t)0x10U, (uint8_t)0xC6U, (uint8_t)0x27U, (uint8_t)0x2BU, (uint8_t)0x04U, - (uint8_t)0x5BU, (uint8_t)0x3BU, (uint8_t)0x71U, (uint8_t)0xF9U, (uint8_t)0xDCU, (uint8_t)0x6BU, - (uint8_t)0x80U, (uint8_t)0xD6U, (uint8_t)0x3FU, (uint8_t)0xDDU, (uint8_t)0x4AU, (uint8_t)0x8EU, - (uint8_t)0x9AU, (uint8_t)0xDBU, (uint8_t)0x1EU, (uint8_t)0x69U, (uint8_t)0x62U, (uint8_t)0xA6U, - (uint8_t)0x95U, (uint8_t)0x26U, (uint8_t)0xD4U, (uint8_t)0x31U, (uint8_t)0x61U, (uint8_t)0xC1U, - (uint8_t)0xA4U, (uint8_t)0x1DU, (uint8_t)0x57U, (uint8_t)0x0DU, (uint8_t)0x79U, (uint8_t)0x38U, - (uint8_t)0xDAU, (uint8_t)0xD4U, (uint8_t)0xA4U, (uint8_t)0x0EU, (uint8_t)0x32U, (uint8_t)0x9CU, - (uint8_t)0xCFU, (uint8_t)0xF4U, (uint8_t)0x6AU, (uint8_t)0xAAU, (uint8_t)0x36U, (uint8_t)0xADU, - (uint8_t)0x00U, (uint8_t)0x4CU, (uint8_t)0xF6U, (uint8_t)0x00U, (uint8_t)0xC8U, (uint8_t)0x38U, - (uint8_t)0x1EU, (uint8_t)0x42U, (uint8_t)0x5AU, (uint8_t)0x31U, (uint8_t)0xD9U, (uint8_t)0x51U, - (uint8_t)0xAEU, (uint8_t)0x64U, (uint8_t)0xFDU, (uint8_t)0xB2U, (uint8_t)0x3FU, (uint8_t)0xCEU, - (uint8_t)0xC9U, (uint8_t)0x50U, (uint8_t)0x9DU, (uint8_t)0x43U, (uint8_t)0x68U, (uint8_t)0x7FU, - (uint8_t)0xEBU, (uint8_t)0x69U, (uint8_t)0xEDU, (uint8_t)0xD1U, (uint8_t)0xCCU, (uint8_t)0x5EU, - (uint8_t)0x0BU, (uint8_t)0x8CU, (uint8_t)0xC3U, (uint8_t)0xBDU, (uint8_t)0xF6U, (uint8_t)0x4BU, - (uint8_t)0x10U, (uint8_t)0xEFU, (uint8_t)0x86U, (uint8_t)0xB6U, (uint8_t)0x31U, (uint8_t)0x42U, - (uint8_t)0xA3U, (uint8_t)0xABU, (uint8_t)0x88U, (uint8_t)0x29U, (uint8_t)0x55U, (uint8_t)0x5BU, - (uint8_t)0x2FU, (uint8_t)0x74U, (uint8_t)0x7CU, (uint8_t)0x93U, (uint8_t)0x26U, (uint8_t)0x65U, - (uint8_t)0xCBU, (uint8_t)0x2CU, (uint8_t)0x0FU, (uint8_t)0x1CU, (uint8_t)0xC0U, (uint8_t)0x1BU, - (uint8_t)0xD7U, (uint8_t)0x02U, (uint8_t)0x29U, (uint8_t)0x38U, (uint8_t)0x88U, (uint8_t)0x39U, - (uint8_t)0xD2U, (uint8_t)0xAFU, (uint8_t)0x05U, (uint8_t)0xE4U, (uint8_t)0x54U, (uint8_t)0x50U, - (uint8_t)0x4AU, (uint8_t)0xC7U, (uint8_t)0x8BU, (uint8_t)0x75U, (uint8_t)0x82U, (uint8_t)0x82U, - (uint8_t)0x28U, (uint8_t)0x46U, (uint8_t)0xC0U, (uint8_t)0xBAU, (uint8_t)0x35U, (uint8_t)0xC3U, - (uint8_t)0x5FU, (uint8_t)0x5CU, (uint8_t)0x59U, (uint8_t)0x16U, (uint8_t)0x0CU, (uint8_t)0xC0U, - (uint8_t)0x46U, (uint8_t)0xFDU, (uint8_t)0x82U, (uint8_t)0x51U, (uint8_t)0x54U, (uint8_t)0x1FU, - (uint8_t)0xC6U, (uint8_t)0x8CU, (uint8_t)0x9CU, (uint8_t)0x86U, (uint8_t)0xB0U, (uint8_t)0x22U, - (uint8_t)0xBBU, (uint8_t)0x70U, (uint8_t)0x99U, (uint8_t)0x87U, (uint8_t)0x6AU, (uint8_t)0x46U, - (uint8_t)0x0EU, (uint8_t)0x74U, (uint8_t)0x51U, (uint8_t)0xA8U, (uint8_t)0xA9U, (uint8_t)0x31U, - (uint8_t)0x09U, (uint8_t)0x70U, (uint8_t)0x3FU, (uint8_t)0xEEU, (uint8_t)0x1CU, (uint8_t)0x21U, - (uint8_t)0x7EU, (uint8_t)0x6CU, (uint8_t)0x38U, (uint8_t)0x26U, (uint8_t)0xE5U, (uint8_t)0x2CU, - (uint8_t)0x51U, (uint8_t)0xAAU, (uint8_t)0x69U, (uint8_t)0x1EU, (uint8_t)0x0EU, (uint8_t)0x42U, - (uint8_t)0x3CU, (uint8_t)0xFCU, (uint8_t)0x99U, (uint8_t)0xE9U, (uint8_t)0xE3U, (uint8_t)0x16U, - (uint8_t)0x50U, (uint8_t)0xC1U, (uint8_t)0x21U, (uint8_t)0x7BU, (uint8_t)0x62U, (uint8_t)0x48U, - (uint8_t)0x16U, (uint8_t)0xCDU, (uint8_t)0xADU, (uint8_t)0x9AU, (uint8_t)0x95U, (uint8_t)0xF9U, - (uint8_t)0xD5U, (uint8_t)0xB8U, (uint8_t)0x01U, (uint8_t)0x94U, (uint8_t)0x88U, (uint8_t)0xD9U, - (uint8_t)0xC0U, (uint8_t)0xA0U, (uint8_t)0xA1U, (uint8_t)0xFEU, (uint8_t)0x30U, (uint8_t)0x75U, - (uint8_t)0xA5U, (uint8_t)0x77U, (uint8_t)0xE2U, (uint8_t)0x31U, (uint8_t)0x83U, (uint8_t)0xF8U, - (uint8_t)0x1DU, (uint8_t)0x4AU, (uint8_t)0x3FU, (uint8_t)0x2FU, (uint8_t)0xA4U, (uint8_t)0x57U, - (uint8_t)0x1EU, (uint8_t)0xFCU, (uint8_t)0x8CU, (uint8_t)0xE0U, (uint8_t)0xBAU, (uint8_t)0x8AU, - (uint8_t)0x4FU, (uint8_t)0xE8U, (uint8_t)0xB6U, (uint8_t)0x85U, (uint8_t)0x5DU, (uint8_t)0xFEU, - (uint8_t)0x72U, (uint8_t)0xB0U, (uint8_t)0xA6U, (uint8_t)0x6EU, (uint8_t)0xDEU, (uint8_t)0xD2U, - (uint8_t)0xFBU, (uint8_t)0xABU, (uint8_t)0xFBU, (uint8_t)0xE5U, (uint8_t)0x8AU, (uint8_t)0x30U, - (uint8_t)0xFAU, (uint8_t)0xFAU, (uint8_t)0xBEU, (uint8_t)0x1CU, (uint8_t)0x5DU, (uint8_t)0x71U, - (uint8_t)0xA8U, (uint8_t)0x7EU, (uint8_t)0x2FU, (uint8_t)0x74U, (uint8_t)0x1EU, (uint8_t)0xF8U, - (uint8_t)0xC1U, (uint8_t)0xFEU, (uint8_t)0x86U, (uint8_t)0xFEU, (uint8_t)0xA6U, (uint8_t)0xBBU, - (uint8_t)0xFDU, (uint8_t)0xE5U, (uint8_t)0x30U, (uint8_t)0x67U, (uint8_t)0x7FU, (uint8_t)0x0DU, - (uint8_t)0x97U, (uint8_t)0xD1U, (uint8_t)0x1DU, (uint8_t)0x49U, (uint8_t)0xF7U, (uint8_t)0xA8U, - (uint8_t)0x44U, (uint8_t)0x3DU, (uint8_t)0x08U, (uint8_t)0x22U, (uint8_t)0xE5U, (uint8_t)0x06U, - (uint8_t)0xA9U, (uint8_t)0xF4U, (uint8_t)0x61U, (uint8_t)0x4EU, (uint8_t)0x01U, (uint8_t)0x1EU, - (uint8_t)0x2AU, (uint8_t)0x94U, (uint8_t)0x83U, (uint8_t)0x8FU, (uint8_t)0xF8U, (uint8_t)0x8CU, - (uint8_t)0xD6U, (uint8_t)0x8CU, (uint8_t)0x8BU, (uint8_t)0xB7U, (uint8_t)0xC5U, (uint8_t)0xC6U, - (uint8_t)0x42U, (uint8_t)0x4CU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, - (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU + 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xADU, 0xF8U, 0x54U, 0x58U, 0xA2U, + 0xBBU, 0x4AU, 0x9AU, 0xAFU, 0xDCU, 0x56U, 0x20U, 0x27U, 0x3DU, 0x3CU, 0xF1U, 0xD8U, 0xB9U, + 0xC5U, 0x83U, 0xCEU, 0x2DU, 0x36U, 0x95U, 0xA9U, 0xE1U, 0x36U, 0x41U, 0x14U, 0x64U, 0x33U, + 0xFBU, 0xCCU, 0x93U, 0x9DU, 0xCEU, 0x24U, 0x9BU, 0x3EU, 0xF9U, 0x7DU, 0x2FU, 0xE3U, 0x63U, + 0x63U, 0x0CU, 0x75U, 0xD8U, 0xF6U, 0x81U, 0xB2U, 0x02U, 0xAEU, 0xC4U, 0x61U, 0x7AU, 0xD3U, + 0xDFU, 0x1EU, 0xD5U, 0xD5U, 0xFDU, 0x65U, 0x61U, 0x24U, 0x33U, 0xF5U, 0x1FU, 0x5FU, 0x06U, + 0x6EU, 0xD0U, 0x85U, 0x63U, 0x65U, 0x55U, 0x3DU, 0xEDU, 0x1AU, 0xF3U, 0xB5U, 0x57U, 0x13U, + 0x5EU, 0x7FU, 0x57U, 0xC9U, 0x35U, 0x98U, 0x4FU, 0x0CU, 0x70U, 0xE0U, 0xE6U, 0x8BU, 0x77U, + 0xE2U, 0xA6U, 0x89U, 0xDAU, 0xF3U, 0xEFU, 0xE8U, 0x72U, 0x1DU, 0xF1U, 0x58U, 0xA1U, 0x36U, + 0xADU, 0xE7U, 0x35U, 0x30U, 0xACU, 0xCAU, 0x4FU, 0x48U, 0x3AU, 0x79U, 0x7AU, 0xBCU, 0x0AU, + 0xB1U, 0x82U, 0xB3U, 0x24U, 0xFBU, 0x61U, 0xD1U, 0x08U, 0xA9U, 0x4BU, 0xB2U, 0xC8U, 0xE3U, + 0xFBU, 0xB9U, 0x6AU, 0xDAU, 0xB7U, 0x60U, 0xD7U, 0xF4U, 0x68U, 0x1DU, 0x4FU, 0x42U, 0xA3U, + 0xDEU, 0x39U, 0x4DU, 0xF4U, 0xAEU, 0x56U, 0xEDU, 0xE7U, 0x63U, 0x72U, 0xBBU, 0x19U, 0x0BU, + 0x07U, 0xA7U, 0xC8U, 0xEEU, 0x0AU, 0x6DU, 0x70U, 0x9EU, 0x02U, 0xFCU, 0xE1U, 0xCDU, 0xF7U, + 0xE2U, 0xECU, 0xC0U, 0x34U, 0x04U, 0xCDU, 0x28U, 0x34U, 0x2FU, 0x61U, 0x91U, 0x72U, 0xFEU, + 0x9CU, 0xE9U, 0x85U, 0x83U, 0xFFU, 0x8EU, 0x4FU, 0x12U, 0x32U, 0xEEU, 0xF2U, 0x81U, 0x83U, + 0xC3U, 0xFEU, 0x3BU, 0x1BU, 0x4CU, 0x6FU, 0xADU, 0x73U, 0x3BU, 0xB5U, 0xFCU, 0xBCU, 0x2EU, + 0xC2U, 0x20U, 0x05U, 0xC5U, 0x8EU, 0xF1U, 0x83U, 0x7DU, 0x16U, 0x83U, 0xB2U, 0xC6U, 0xF3U, + 0x4AU, 0x26U, 0xC1U, 0xB2U, 0xEFU, 0xFAU, 0x88U, 0x6BU, 0x42U, 0x38U, 0x61U, 0x1FU, 0xCFU, + 0xDCU, 0xDEU, 0x35U, 0x5BU, 0x3BU, 0x65U, 0x19U, 0x03U, 0x5BU, 0xBCU, 0x34U, 0xF4U, 0xDEU, + 0xF9U, 0x9CU, 0x02U, 0x38U, 0x61U, 0xB4U, 0x6FU, 0xC9U, 0xD6U, 0xE6U, 0xC9U, 0x07U, 0x7AU, + 0xD9U, 0x1DU, 0x26U, 0x91U, 0xF7U, 0xF7U, 0xEEU, 0x59U, 0x8CU, 0xB0U, 0xFAU, 0xC1U, 0x86U, + 0xD9U, 0x1CU, 0xAEU, 0xFEU, 0x13U, 0x09U, 0x85U, 0x13U, 0x92U, 0x70U, 0xB4U, 0x13U, 0x0CU, + 0x93U, 0xBCU, 0x43U, 0x79U, 0x44U, 0xF4U, 0xFDU, 0x44U, 0x52U, 0xE2U, 0xD7U, 0x4DU, 0xD3U, + 0x64U, 0xF2U, 0xE2U, 0x1EU, 0x71U, 0xF5U, 0x4BU, 0xFFU, 0x5CU, 0xAEU, 0x82U, 0xABU, 0x9CU, + 0x9DU, 0xF6U, 0x9EU, 0xE8U, 0x6DU, 0x2BU, 0xC5U, 0x22U, 0x36U, 0x3AU, 0x0DU, 0xABU, 0xC5U, + 0x21U, 0x97U, 0x9BU, 0x0DU, 0xEAU, 0xDAU, 0x1DU, 0xBFU, 0x9AU, 0x42U, 0xD5U, 0xC4U, 0x48U, + 0x4EU, 0x0AU, 0xBCU, 0xD0U, 0x6BU, 0xFAU, 0x53U, 0xDDU, 0xEFU, 0x3CU, 0x1BU, 0x20U, 0xEEU, + 0x3FU, 0xD5U, 0x9DU, 0x7CU, 0x25U, 0xE4U, 0x1DU, 0x2BU, 0x66U, 0x9EU, 0x1EU, 0xF1U, 0x6EU, + 0x6FU, 0x52U, 0xC3U, 0x16U, 0x4DU, 0xF4U, 0xFBU, 0x79U, 0x30U, 0xE9U, 0xE4U, 0xE5U, 0x88U, + 0x57U, 0xB6U, 0xACU, 0x7DU, 0x5FU, 0x42U, 0xD6U, 0x9FU, 0x6DU, 0x18U, 0x77U, 0x63U, 0xCFU, + 0x1DU, 0x55U, 0x03U, 0x40U, 0x04U, 0x87U, 0xF5U, 0x5BU, 0xA5U, 0x7EU, 0x31U, 0xCCU, 0x7AU, + 0x71U, 0x35U, 0xC8U, 0x86U, 0xEFU, 0xB4U, 0x31U, 0x8AU, 0xEDU, 0x6AU, 0x1EU, 0x01U, 0x2DU, + 0x9EU, 0x68U, 0x32U, 0xA9U, 0x07U, 0x60U, 0x0AU, 0x91U, 0x81U, 0x30U, 0xC4U, 0x6DU, 0xC7U, + 0x78U, 0xF9U, 0x71U, 0xADU, 0x00U, 0x38U, 0x09U, 0x29U, 0x99U, 0xA3U, 0x33U, 0xCBU, 0x8BU, + 0x7AU, 0x1AU, 0x1DU, 0xB9U, 0x3DU, 0x71U, 0x40U, 0x00U, 0x3CU, 0x2AU, 0x4EU, 0xCEU, 0xA9U, + 0xF9U, 0x8DU, 0x0AU, 0xCCU, 0x0AU, 0x82U, 0x91U, 0xCDU, 0xCEU, 0xC9U, 0x7DU, 0xCFU, 0x8EU, + 0xC9U, 0xB5U, 0x5AU, 0x7FU, 0x88U, 0xA4U, 0x6BU, 0x4DU, 0xB5U, 0xA8U, 0x51U, 0xF4U, 0x41U, + 0x82U, 0xE1U, 0xC6U, 0x8AU, 0x00U, 0x7EU, 0x5EU, 0x0DU, 0xD9U, 0x02U, 0x0BU, 0xFDU, 0x64U, + 0xB6U, 0x45U, 0x03U, 0x6CU, 0x7AU, 0x4EU, 0x67U, 0x7DU, 0x2CU, 0x38U, 0x53U, 0x2AU, 0x3AU, + 0x23U, 0xBAU, 0x44U, 0x42U, 0xCAU, 0xF5U, 0x3EU, 0xA6U, 0x3BU, 0xB4U, 0x54U, 0x32U, 0x9BU, + 0x76U, 0x24U, 0xC8U, 0x91U, 0x7BU, 0xDDU, 0x64U, 0xB1U, 0xC0U, 0xFDU, 0x4CU, 0xB3U, 0x8EU, + 0x8CU, 0x33U, 0x4CU, 0x70U, 0x1CU, 0x3AU, 0xCDU, 0xADU, 0x06U, 0x57U, 0xFCU, 0xCFU, 0xECU, + 0x71U, 0x9BU, 0x1FU, 0x5CU, 0x3EU, 0x4EU, 0x46U, 0x04U, 0x1FU, 0x38U, 0x81U, 0x47U, 0xFBU, + 0x4CU, 0xFDU, 0xB4U, 0x77U, 0xA5U, 0x24U, 0x71U, 0xF7U, 0xA9U, 0xA9U, 0x69U, 0x10U, 0xB8U, + 0x55U, 0x32U, 0x2EU, 0xDBU, 0x63U, 0x40U, 0xD8U, 0xA0U, 0x0EU, 0xF0U, 0x92U, 0x35U, 0x05U, + 0x11U, 0xE3U, 0x0AU, 0xBEU, 0xC1U, 0xFFU, 0xF9U, 0xE3U, 0xA2U, 0x6EU, 0x7FU, 0xB2U, 0x9FU, + 0x8CU, 0x18U, 0x30U, 0x23U, 0xC3U, 0x58U, 0x7EU, 0x38U, 0xDAU, 0x00U, 0x77U, 0xD9U, 0xB4U, + 0x76U, 0x3EU, 0x4EU, 0x4BU, 0x94U, 0xB2U, 0xBBU, 0xC1U, 0x94U, 0xC6U, 0x65U, 0x1EU, 0x77U, + 0xCAU, 0xF9U, 0x92U, 0xEEU, 0xAAU, 0xC0U, 0x23U, 0x2AU, 0x28U, 0x1BU, 0xF6U, 0xB3U, 0xA7U, + 0x39U, 0xC1U, 0x22U, 0x61U, 0x16U, 0x82U, 0x0AU, 0xE8U, 0xDBU, 0x58U, 0x47U, 0xA6U, 0x7CU, + 0xBEU, 0xF9U, 0xC9U, 0x09U, 0x1BU, 0x46U, 0x2DU, 0x53U, 0x8CU, 0xD7U, 0x2BU, 0x03U, 0x74U, + 0x6AU, 0xE7U, 0x7FU, 0x5EU, 0x62U, 0x29U, 0x2CU, 0x31U, 0x15U, 0x62U, 0xA8U, 0x46U, 0x50U, + 0x5DU, 0xC8U, 0x2DU, 0xB8U, 0x54U, 0x33U, 0x8AU, 0xE4U, 0x9FU, 0x52U, 0x35U, 0xC9U, 0x5BU, + 0x91U, 0x17U, 0x8CU, 0xCFU, 0x2DU, 0xD5U, 0xCAU, 0xCEU, 0xF4U, 0x03U, 0xECU, 0x9DU, 0x18U, + 0x10U, 0xC6U, 0x27U, 0x2BU, 0x04U, 0x5BU, 0x3BU, 0x71U, 0xF9U, 0xDCU, 0x6BU, 0x80U, 0xD6U, + 0x3FU, 0xDDU, 0x4AU, 0x8EU, 0x9AU, 0xDBU, 0x1EU, 0x69U, 0x62U, 0xA6U, 0x95U, 0x26U, 0xD4U, + 0x31U, 0x61U, 0xC1U, 0xA4U, 0x1DU, 0x57U, 0x0DU, 0x79U, 0x38U, 0xDAU, 0xD4U, 0xA4U, 0x0EU, + 0x32U, 0x9CU, 0xCFU, 0xF4U, 0x6AU, 0xAAU, 0x36U, 0xADU, 0x00U, 0x4CU, 0xF6U, 0x00U, 0xC8U, + 0x38U, 0x1EU, 0x42U, 0x5AU, 0x31U, 0xD9U, 0x51U, 0xAEU, 0x64U, 0xFDU, 0xB2U, 0x3FU, 0xCEU, + 0xC9U, 0x50U, 0x9DU, 0x43U, 0x68U, 0x7FU, 0xEBU, 0x69U, 0xEDU, 0xD1U, 0xCCU, 0x5EU, 0x0BU, + 0x8CU, 0xC3U, 0xBDU, 0xF6U, 0x4BU, 0x10U, 0xEFU, 0x86U, 0xB6U, 0x31U, 0x42U, 0xA3U, 0xABU, + 0x88U, 0x29U, 0x55U, 0x5BU, 0x2FU, 0x74U, 0x7CU, 0x93U, 0x26U, 0x65U, 0xCBU, 0x2CU, 0x0FU, + 0x1CU, 0xC0U, 0x1BU, 0xD7U, 0x02U, 0x29U, 0x38U, 0x88U, 0x39U, 0xD2U, 0xAFU, 0x05U, 0xE4U, + 0x54U, 0x50U, 0x4AU, 0xC7U, 0x8BU, 0x75U, 0x82U, 0x82U, 0x28U, 0x46U, 0xC0U, 0xBAU, 0x35U, + 0xC3U, 0x5FU, 0x5CU, 0x59U, 0x16U, 0x0CU, 0xC0U, 0x46U, 0xFDU, 0x82U, 0x51U, 0x54U, 0x1FU, + 0xC6U, 0x8CU, 0x9CU, 0x86U, 0xB0U, 0x22U, 0xBBU, 0x70U, 0x99U, 0x87U, 0x6AU, 0x46U, 0x0EU, + 0x74U, 0x51U, 0xA8U, 0xA9U, 0x31U, 0x09U, 0x70U, 0x3FU, 0xEEU, 0x1CU, 0x21U, 0x7EU, 0x6CU, + 0x38U, 0x26U, 0xE5U, 0x2CU, 0x51U, 0xAAU, 0x69U, 0x1EU, 0x0EU, 0x42U, 0x3CU, 0xFCU, 0x99U, + 0xE9U, 0xE3U, 0x16U, 0x50U, 0xC1U, 0x21U, 0x7BU, 0x62U, 0x48U, 0x16U, 0xCDU, 0xADU, 0x9AU, + 0x95U, 0xF9U, 0xD5U, 0xB8U, 0x01U, 0x94U, 0x88U, 0xD9U, 0xC0U, 0xA0U, 0xA1U, 0xFEU, 0x30U, + 0x75U, 0xA5U, 0x77U, 0xE2U, 0x31U, 0x83U, 0xF8U, 0x1DU, 0x4AU, 0x3FU, 0x2FU, 0xA4U, 0x57U, + 0x1EU, 0xFCU, 0x8CU, 0xE0U, 0xBAU, 0x8AU, 0x4FU, 0xE8U, 0xB6U, 0x85U, 0x5DU, 0xFEU, 0x72U, + 0xB0U, 0xA6U, 0x6EU, 0xDEU, 0xD2U, 0xFBU, 0xABU, 0xFBU, 0xE5U, 0x8AU, 0x30U, 0xFAU, 0xFAU, + 0xBEU, 0x1CU, 0x5DU, 0x71U, 0xA8U, 0x7EU, 0x2FU, 0x74U, 0x1EU, 0xF8U, 0xC1U, 0xFEU, 0x86U, + 0xFEU, 0xA6U, 0xBBU, 0xFDU, 0xE5U, 0x30U, 0x67U, 0x7FU, 0x0DU, 0x97U, 0xD1U, 0x1DU, 0x49U, + 0xF7U, 0xA8U, 0x44U, 0x3DU, 0x08U, 0x22U, 0xE5U, 0x06U, 0xA9U, 0xF4U, 0x61U, 0x4EU, 0x01U, + 0x1EU, 0x2AU, 0x94U, 0x83U, 0x8FU, 0xF8U, 0x8CU, 0xD6U, 0x8CU, 0x8BU, 0xB7U, 0xC5U, 0xC6U, + 0x42U, 0x4CU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU }; #if defined(__cplusplus) diff --git a/include/internal/Hacl_K256_PrecompTable.h b/include/internal/Hacl_K256_PrecompTable.h index 26bdfa1f..ff15f1c9 100644 --- a/include/internal/Hacl_K256_PrecompTable.h +++ b/include/internal/Hacl_K256_PrecompTable.h @@ -39,498 +39,378 @@ static const uint64_t Hacl_K256_PrecompTable_precomp_basepoint_table_w4[240U] = { - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)705178180786072U, - (uint64_t)3855836460717471U, (uint64_t)4089131105950716U, (uint64_t)3301581525494108U, - (uint64_t)133858670344668U, (uint64_t)2199641648059576U, (uint64_t)1278080618437060U, - (uint64_t)3959378566518708U, (uint64_t)3455034269351872U, (uint64_t)79417610544803U, - (uint64_t)1U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, - (uint64_t)1282049064345544U, (uint64_t)971732600440099U, (uint64_t)1014594595727339U, - (uint64_t)4392159187541980U, (uint64_t)268327875692285U, (uint64_t)2411661712280539U, - (uint64_t)1092576199280126U, (uint64_t)4328619610718051U, (uint64_t)3535440816471627U, - (uint64_t)95182251488556U, (uint64_t)1893725512243753U, (uint64_t)3619861457111820U, - (uint64_t)879374960417905U, (uint64_t)2868056058129113U, (uint64_t)273195291893682U, - (uint64_t)2044797305960112U, (uint64_t)2357106853933780U, (uint64_t)3563112438336058U, - (uint64_t)2430811541762558U, (uint64_t)106443809495428U, (uint64_t)2231357633909668U, - (uint64_t)3641705835951936U, (uint64_t)80642569314189U, (uint64_t)2254841882373268U, - (uint64_t)149848031966573U, (uint64_t)2304615661367764U, (uint64_t)2410957403736446U, - (uint64_t)2712754805859804U, (uint64_t)2440183877540536U, (uint64_t)99784623895865U, - (uint64_t)3667773127482758U, (uint64_t)1354899394473308U, (uint64_t)3636602998800808U, - (uint64_t)2709296679846364U, (uint64_t)7253362091963U, (uint64_t)3585950735562744U, - (uint64_t)935775991758415U, (uint64_t)4108078106735201U, (uint64_t)556081800336307U, - (uint64_t)229585977163057U, (uint64_t)4055594186679801U, (uint64_t)1767681004944933U, - (uint64_t)1432634922083242U, (uint64_t)534935602949197U, (uint64_t)251753159522567U, - (uint64_t)2846474078499321U, (uint64_t)4488649590348702U, (uint64_t)2437476916025038U, - (uint64_t)3040577412822874U, (uint64_t)79405234918614U, (uint64_t)3030621226551508U, - (uint64_t)2801117003929806U, (uint64_t)1642927515498422U, (uint64_t)2802725079726297U, - (uint64_t)8472780626107U, (uint64_t)866068070352655U, (uint64_t)188080768545106U, - (uint64_t)2152119998903058U, (uint64_t)3391239985029665U, (uint64_t)23820026013564U, - (uint64_t)2965064154891949U, (uint64_t)1846516097921398U, (uint64_t)4418379948133146U, - (uint64_t)3137755426942400U, (uint64_t)47705291301781U, (uint64_t)4278533051105665U, - (uint64_t)3453643211214931U, (uint64_t)3379734319145156U, (uint64_t)3762442192097039U, - (uint64_t)40243003528694U, (uint64_t)4063448994211201U, (uint64_t)5697015368785U, - (uint64_t)1006545411838613U, (uint64_t)4242291693755210U, (uint64_t)135184629190512U, - (uint64_t)264898689131035U, (uint64_t)611796474823597U, (uint64_t)3255382250029089U, - (uint64_t)3490429246984696U, (uint64_t)236558595864362U, (uint64_t)2055934691551704U, - (uint64_t)1487711670114502U, (uint64_t)1823930698221632U, (uint64_t)2130937287438472U, - (uint64_t)154610053389779U, (uint64_t)2746573287023216U, (uint64_t)2430987262221221U, - (uint64_t)1668741642878689U, (uint64_t)904982541243977U, (uint64_t)56087343124948U, - (uint64_t)393905062353536U, (uint64_t)412681877350188U, (uint64_t)3153602040979977U, - (uint64_t)4466820876224989U, (uint64_t)146579165617857U, (uint64_t)2628741216508991U, - (uint64_t)747994231529806U, (uint64_t)750506569317681U, (uint64_t)1887492790748779U, - (uint64_t)35259008682771U, (uint64_t)2085116434894208U, (uint64_t)543291398921711U, - (uint64_t)1144362007901552U, (uint64_t)679305136036846U, (uint64_t)141090902244489U, - (uint64_t)632480954474859U, (uint64_t)2384513102652591U, (uint64_t)2225529790159790U, - (uint64_t)692258664851625U, (uint64_t)198681843567699U, (uint64_t)2397092587228181U, - (uint64_t)145862822166614U, (uint64_t)196976540479452U, (uint64_t)3321831130141455U, - (uint64_t)69266673089832U, (uint64_t)4469644227342284U, (uint64_t)3899271145504796U, - (uint64_t)1261890974076660U, (uint64_t)525357673886694U, (uint64_t)182135997828583U, - (uint64_t)4292760618810332U, (uint64_t)3404186545541683U, (uint64_t)312297386688768U, - (uint64_t)204377466824608U, (uint64_t)230900767857952U, (uint64_t)3871485172339693U, - (uint64_t)779449329662955U, (uint64_t)978655822464694U, (uint64_t)2278252139594027U, - (uint64_t)104641527040382U, (uint64_t)3528840153625765U, (uint64_t)4484699080275273U, - (uint64_t)1463971951102316U, (uint64_t)4013910812844749U, (uint64_t)228915589433620U, - (uint64_t)1209641433482461U, (uint64_t)4043178788774759U, (uint64_t)3008668238856634U, - (uint64_t)1448425089071412U, (uint64_t)26269719725037U, (uint64_t)3330785027545223U, - (uint64_t)852657975349259U, (uint64_t)227245054466105U, (uint64_t)1534632353984777U, - (uint64_t)207715098574660U, (uint64_t)3209837527352280U, (uint64_t)4051688046309066U, - (uint64_t)3839009590725955U, (uint64_t)1321506437398842U, (uint64_t)68340219159928U, - (uint64_t)1806950276956275U, (uint64_t)3923908055275295U, (uint64_t)743963253393575U, - (uint64_t)42162407478783U, (uint64_t)261334584474610U, (uint64_t)3728224928885214U, - (uint64_t)4004701081842869U, (uint64_t)709043201644674U, (uint64_t)4267294249150171U, - (uint64_t)255540582975025U, (uint64_t)875490593722211U, (uint64_t)796393708218375U, - (uint64_t)14774425627956U, (uint64_t)1500040516752097U, (uint64_t)141076627721678U, - (uint64_t)2634539368480628U, (uint64_t)1106488853550103U, (uint64_t)2346231921151930U, - (uint64_t)897108283954283U, (uint64_t)64616679559843U, (uint64_t)400244949840943U, - (uint64_t)1731263826831733U, (uint64_t)1649996579904651U, (uint64_t)3643693449640761U, - (uint64_t)172543068638991U, (uint64_t)329537981097182U, (uint64_t)2029799860802869U, - (uint64_t)4377737515208862U, (uint64_t)29103311051334U, (uint64_t)265583594111499U, - (uint64_t)3798074876561255U, (uint64_t)184749333259352U, (uint64_t)3117395073661801U, - (uint64_t)3695784565008833U, (uint64_t)64282709896721U, (uint64_t)1618968913246422U, - (uint64_t)3185235128095257U, (uint64_t)3288745068118692U, (uint64_t)1963818603508782U, - (uint64_t)281054350739495U, (uint64_t)1658639050810346U, (uint64_t)3061097601679552U, - (uint64_t)3023781433263746U, (uint64_t)2770283391242475U, (uint64_t)144508864751908U, - (uint64_t)173576288079856U, (uint64_t)46114579547054U, (uint64_t)1679480127300211U, - (uint64_t)1683062051644007U, (uint64_t)117183826129323U, (uint64_t)1894068608117440U, - (uint64_t)3846899838975733U, (uint64_t)4289279019496192U, (uint64_t)176995887914031U, - (uint64_t)78074942938713U, (uint64_t)454207263265292U, (uint64_t)972683614054061U, - (uint64_t)808474205144361U, (uint64_t)942703935951735U, (uint64_t)134460241077887U + 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, + 705178180786072ULL, 3855836460717471ULL, 4089131105950716ULL, 3301581525494108ULL, + 133858670344668ULL, 2199641648059576ULL, 1278080618437060ULL, 3959378566518708ULL, + 3455034269351872ULL, 79417610544803ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1282049064345544ULL, + 971732600440099ULL, 1014594595727339ULL, 4392159187541980ULL, 268327875692285ULL, + 2411661712280539ULL, 1092576199280126ULL, 4328619610718051ULL, 3535440816471627ULL, + 95182251488556ULL, 1893725512243753ULL, 3619861457111820ULL, 879374960417905ULL, + 2868056058129113ULL, 273195291893682ULL, 2044797305960112ULL, 2357106853933780ULL, + 3563112438336058ULL, 2430811541762558ULL, 106443809495428ULL, 2231357633909668ULL, + 3641705835951936ULL, 80642569314189ULL, 2254841882373268ULL, 149848031966573ULL, + 2304615661367764ULL, 2410957403736446ULL, 2712754805859804ULL, 2440183877540536ULL, + 99784623895865ULL, 3667773127482758ULL, 1354899394473308ULL, 3636602998800808ULL, + 2709296679846364ULL, 7253362091963ULL, 3585950735562744ULL, 935775991758415ULL, + 4108078106735201ULL, 556081800336307ULL, 229585977163057ULL, 4055594186679801ULL, + 1767681004944933ULL, 1432634922083242ULL, 534935602949197ULL, 251753159522567ULL, + 2846474078499321ULL, 4488649590348702ULL, 2437476916025038ULL, 3040577412822874ULL, + 79405234918614ULL, 3030621226551508ULL, 2801117003929806ULL, 1642927515498422ULL, + 2802725079726297ULL, 8472780626107ULL, 866068070352655ULL, 188080768545106ULL, + 2152119998903058ULL, 3391239985029665ULL, 23820026013564ULL, 2965064154891949ULL, + 1846516097921398ULL, 4418379948133146ULL, 3137755426942400ULL, 47705291301781ULL, + 4278533051105665ULL, 3453643211214931ULL, 3379734319145156ULL, 3762442192097039ULL, + 40243003528694ULL, 4063448994211201ULL, 5697015368785ULL, 1006545411838613ULL, + 4242291693755210ULL, 135184629190512ULL, 264898689131035ULL, 611796474823597ULL, + 3255382250029089ULL, 3490429246984696ULL, 236558595864362ULL, 2055934691551704ULL, + 1487711670114502ULL, 1823930698221632ULL, 2130937287438472ULL, 154610053389779ULL, + 2746573287023216ULL, 2430987262221221ULL, 1668741642878689ULL, 904982541243977ULL, + 56087343124948ULL, 393905062353536ULL, 412681877350188ULL, 3153602040979977ULL, + 4466820876224989ULL, 146579165617857ULL, 2628741216508991ULL, 747994231529806ULL, + 750506569317681ULL, 1887492790748779ULL, 35259008682771ULL, 2085116434894208ULL, + 543291398921711ULL, 1144362007901552ULL, 679305136036846ULL, 141090902244489ULL, + 632480954474859ULL, 2384513102652591ULL, 2225529790159790ULL, 692258664851625ULL, + 198681843567699ULL, 2397092587228181ULL, 145862822166614ULL, 196976540479452ULL, + 3321831130141455ULL, 69266673089832ULL, 4469644227342284ULL, 3899271145504796ULL, + 1261890974076660ULL, 525357673886694ULL, 182135997828583ULL, 4292760618810332ULL, + 3404186545541683ULL, 312297386688768ULL, 204377466824608ULL, 230900767857952ULL, + 3871485172339693ULL, 779449329662955ULL, 978655822464694ULL, 2278252139594027ULL, + 104641527040382ULL, 3528840153625765ULL, 4484699080275273ULL, 1463971951102316ULL, + 4013910812844749ULL, 228915589433620ULL, 1209641433482461ULL, 4043178788774759ULL, + 3008668238856634ULL, 1448425089071412ULL, 26269719725037ULL, 3330785027545223ULL, + 852657975349259ULL, 227245054466105ULL, 1534632353984777ULL, 207715098574660ULL, + 3209837527352280ULL, 4051688046309066ULL, 3839009590725955ULL, 1321506437398842ULL, + 68340219159928ULL, 1806950276956275ULL, 3923908055275295ULL, 743963253393575ULL, + 42162407478783ULL, 261334584474610ULL, 3728224928885214ULL, 4004701081842869ULL, + 709043201644674ULL, 4267294249150171ULL, 255540582975025ULL, 875490593722211ULL, + 796393708218375ULL, 14774425627956ULL, 1500040516752097ULL, 141076627721678ULL, + 2634539368480628ULL, 1106488853550103ULL, 2346231921151930ULL, 897108283954283ULL, + 64616679559843ULL, 400244949840943ULL, 1731263826831733ULL, 1649996579904651ULL, + 3643693449640761ULL, 172543068638991ULL, 329537981097182ULL, 2029799860802869ULL, + 4377737515208862ULL, 29103311051334ULL, 265583594111499ULL, 3798074876561255ULL, + 184749333259352ULL, 3117395073661801ULL, 3695784565008833ULL, 64282709896721ULL, + 1618968913246422ULL, 3185235128095257ULL, 3288745068118692ULL, 1963818603508782ULL, + 281054350739495ULL, 1658639050810346ULL, 3061097601679552ULL, 3023781433263746ULL, + 2770283391242475ULL, 144508864751908ULL, 173576288079856ULL, 46114579547054ULL, + 1679480127300211ULL, 1683062051644007ULL, 117183826129323ULL, 1894068608117440ULL, + 3846899838975733ULL, 4289279019496192ULL, 176995887914031ULL, 78074942938713ULL, + 454207263265292ULL, 972683614054061ULL, 808474205144361ULL, 942703935951735ULL, + 134460241077887ULL }; static const uint64_t Hacl_K256_PrecompTable_precomp_g_pow2_64_table_w4[240U] = { - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)4496295042185355U, - (uint64_t)3125448202219451U, (uint64_t)1239608518490046U, (uint64_t)2687445637493112U, - (uint64_t)77979604880139U, (uint64_t)3360310474215011U, (uint64_t)1216410458165163U, - (uint64_t)177901593587973U, (uint64_t)3209978938104985U, (uint64_t)118285133003718U, - (uint64_t)434519962075150U, (uint64_t)1114612377498854U, (uint64_t)3488596944003813U, - (uint64_t)450716531072892U, (uint64_t)66044973203836U, (uint64_t)2822827191156652U, - (uint64_t)2417714248626059U, (uint64_t)2173117567943U, (uint64_t)961513119252459U, - (uint64_t)233852556538333U, (uint64_t)3014783730323962U, (uint64_t)2955192634004574U, - (uint64_t)580546524951282U, (uint64_t)2982973948711252U, (uint64_t)226295722018730U, - (uint64_t)26457116218543U, (uint64_t)3401523493637663U, (uint64_t)2597746825024790U, - (uint64_t)1789211180483113U, (uint64_t)155862365823427U, (uint64_t)4056806876632134U, - (uint64_t)1742291745730568U, (uint64_t)3527759000626890U, (uint64_t)3740578471192596U, - (uint64_t)177295097700537U, (uint64_t)1533961415657770U, (uint64_t)4305228982382487U, - (uint64_t)4069090871282711U, (uint64_t)4090877481646667U, (uint64_t)220939617041498U, - (uint64_t)2057548127959588U, (uint64_t)45185623103252U, (uint64_t)2871963270423449U, - (uint64_t)3312974792248749U, (uint64_t)8710601879528U, (uint64_t)570612225194540U, - (uint64_t)2045632925323972U, (uint64_t)1263913878297555U, (uint64_t)1294592284757719U, - (uint64_t)238067747295054U, (uint64_t)1576659948829386U, (uint64_t)2315159636629917U, - (uint64_t)3624867787891655U, (uint64_t)647628266663887U, (uint64_t)75788399640253U, - (uint64_t)710811707847797U, (uint64_t)130020650130128U, (uint64_t)1975045425972589U, - (uint64_t)136351545314094U, (uint64_t)229292031212337U, (uint64_t)1061471455264148U, - (uint64_t)3281312694184822U, (uint64_t)1692442293921797U, (uint64_t)4171008525509513U, - (uint64_t)275424696197549U, (uint64_t)1170296303921965U, (uint64_t)4154092952807735U, - (uint64_t)4371262070870741U, (uint64_t)835769811036496U, (uint64_t)275812646528189U, - (uint64_t)4006745785521764U, (uint64_t)1965172239781114U, (uint64_t)4121055644916429U, - (uint64_t)3578995380229569U, (uint64_t)169798870760022U, (uint64_t)1834234783016431U, - (uint64_t)3186919121688538U, (uint64_t)1894269993170652U, (uint64_t)868603832348691U, - (uint64_t)110978471368876U, (uint64_t)1659296605881532U, (uint64_t)3257830829309297U, - (uint64_t)3381509832701119U, (uint64_t)4016163121121296U, (uint64_t)265240263496294U, - (uint64_t)4411285343933251U, (uint64_t)728746770806400U, (uint64_t)1767819098558739U, - (uint64_t)3002081480892841U, (uint64_t)96312133241935U, (uint64_t)468184501392107U, - (uint64_t)2061529496271208U, (uint64_t)801565111628867U, (uint64_t)3380678576799273U, - (uint64_t)121814978170941U, (uint64_t)3340363319165433U, (uint64_t)2764604325746928U, - (uint64_t)4475755976431968U, (uint64_t)3678073419927081U, (uint64_t)237001357924061U, - (uint64_t)4110487014553450U, (uint64_t)442517757833404U, (uint64_t)3976758767423859U, - (uint64_t)2559863799262476U, (uint64_t)178144664279213U, (uint64_t)2488702171798051U, - (uint64_t)4292079598620208U, (uint64_t)1642918280217329U, (uint64_t)3694920319798108U, - (uint64_t)111735528281657U, (uint64_t)2904433967156033U, (uint64_t)4391518032143166U, - (uint64_t)3018885875516259U, (uint64_t)3730342681447122U, (uint64_t)10320273322750U, - (uint64_t)555845881555519U, (uint64_t)58355404017985U, (uint64_t)379009359053696U, - (uint64_t)450317203955503U, (uint64_t)271063299686173U, (uint64_t)910340241794202U, - (uint64_t)4145234574853890U, (uint64_t)2059755654702755U, (uint64_t)626530377112246U, - (uint64_t)188918989156857U, (uint64_t)3316657461542117U, (uint64_t)778033563170765U, - (uint64_t)3568562306532187U, (uint64_t)2888619469733481U, (uint64_t)4364919962337U, - (uint64_t)4095057288587059U, (uint64_t)2275461355379988U, (uint64_t)1507422995910897U, - (uint64_t)3737691697116252U, (uint64_t)28779913258578U, (uint64_t)131453301647952U, - (uint64_t)3613515597508469U, (uint64_t)2389606941441321U, (uint64_t)2135459302594806U, - (uint64_t)105517262484263U, (uint64_t)2973432939331401U, (uint64_t)3447096622477885U, - (uint64_t)684654106536844U, (uint64_t)2815198316729695U, (uint64_t)280303067216071U, - (uint64_t)1841014812927024U, (uint64_t)1181026273060917U, (uint64_t)4092989148457730U, - (uint64_t)1381045116206278U, (uint64_t)112475725893965U, (uint64_t)2309144740156686U, - (uint64_t)1558825847609352U, (uint64_t)2008068002046292U, (uint64_t)3153511625856423U, - (uint64_t)38469701427673U, (uint64_t)4240572315518056U, (uint64_t)2295170987320580U, - (uint64_t)187734093837094U, (uint64_t)301041528077172U, (uint64_t)234553141005715U, - (uint64_t)4170513699279606U, (uint64_t)1600132848196146U, (uint64_t)3149113064155689U, - (uint64_t)2733255352600949U, (uint64_t)144915931419495U, (uint64_t)1221012073888926U, - (uint64_t)4395668111081710U, (uint64_t)2464799161496070U, (uint64_t)3664256125241313U, - (uint64_t)239705368981290U, (uint64_t)1415181408539490U, (uint64_t)2551836620449074U, - (uint64_t)3003106895689578U, (uint64_t)968947218886924U, (uint64_t)270781532362673U, - (uint64_t)2905980714350372U, (uint64_t)3246927349288975U, (uint64_t)2653377642686974U, - (uint64_t)1577457093418263U, (uint64_t)279488238785848U, (uint64_t)568335962564552U, - (uint64_t)4251365041645758U, (uint64_t)1257832559776007U, (uint64_t)2424022444243863U, - (uint64_t)261166122046343U, (uint64_t)4399874608082116U, (uint64_t)640509987891568U, - (uint64_t)3119706885332220U, (uint64_t)1990185416694007U, (uint64_t)119390098529341U, - (uint64_t)220106534694050U, (uint64_t)937225880034895U, (uint64_t)656288151358882U, - (uint64_t)1766967254772100U, (uint64_t)197900790969750U, (uint64_t)2992539221608875U, - (uint64_t)3960297171111858U, (uint64_t)3499202002925081U, (uint64_t)1103060980924705U, - (uint64_t)13670895919578U, (uint64_t)430132744187721U, (uint64_t)1206771838050953U, - (uint64_t)2474749300167198U, (uint64_t)296299539510780U, (uint64_t)61565517686436U, - (uint64_t)752778559080573U, (uint64_t)3049015829565410U, (uint64_t)3538647632527371U, - (uint64_t)1640473028662032U, (uint64_t)182488721849306U, (uint64_t)1234378482161516U, - (uint64_t)3736205988606381U, (uint64_t)2814216844344487U, (uint64_t)3877249891529557U, - (uint64_t)51681412928433U, (uint64_t)4275336620301239U, (uint64_t)3084074032750651U, - (uint64_t)42732308350456U, (uint64_t)3648603591552229U, (uint64_t)142450621701603U, - (uint64_t)4020045475009854U, (uint64_t)1050293952073054U, (uint64_t)1974773673079851U, - (uint64_t)1815515638724020U, (uint64_t)104845375825434U + 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, + 4496295042185355ULL, 3125448202219451ULL, 1239608518490046ULL, 2687445637493112ULL, + 77979604880139ULL, 3360310474215011ULL, 1216410458165163ULL, 177901593587973ULL, + 3209978938104985ULL, 118285133003718ULL, 434519962075150ULL, 1114612377498854ULL, + 3488596944003813ULL, 450716531072892ULL, 66044973203836ULL, 2822827191156652ULL, + 2417714248626059ULL, 2173117567943ULL, 961513119252459ULL, 233852556538333ULL, + 3014783730323962ULL, 2955192634004574ULL, 580546524951282ULL, 2982973948711252ULL, + 226295722018730ULL, 26457116218543ULL, 3401523493637663ULL, 2597746825024790ULL, + 1789211180483113ULL, 155862365823427ULL, 4056806876632134ULL, 1742291745730568ULL, + 3527759000626890ULL, 3740578471192596ULL, 177295097700537ULL, 1533961415657770ULL, + 4305228982382487ULL, 4069090871282711ULL, 4090877481646667ULL, 220939617041498ULL, + 2057548127959588ULL, 45185623103252ULL, 2871963270423449ULL, 3312974792248749ULL, + 8710601879528ULL, 570612225194540ULL, 2045632925323972ULL, 1263913878297555ULL, + 1294592284757719ULL, 238067747295054ULL, 1576659948829386ULL, 2315159636629917ULL, + 3624867787891655ULL, 647628266663887ULL, 75788399640253ULL, 710811707847797ULL, + 130020650130128ULL, 1975045425972589ULL, 136351545314094ULL, 229292031212337ULL, + 1061471455264148ULL, 3281312694184822ULL, 1692442293921797ULL, 4171008525509513ULL, + 275424696197549ULL, 1170296303921965ULL, 4154092952807735ULL, 4371262070870741ULL, + 835769811036496ULL, 275812646528189ULL, 4006745785521764ULL, 1965172239781114ULL, + 4121055644916429ULL, 3578995380229569ULL, 169798870760022ULL, 1834234783016431ULL, + 3186919121688538ULL, 1894269993170652ULL, 868603832348691ULL, 110978471368876ULL, + 1659296605881532ULL, 3257830829309297ULL, 3381509832701119ULL, 4016163121121296ULL, + 265240263496294ULL, 4411285343933251ULL, 728746770806400ULL, 1767819098558739ULL, + 3002081480892841ULL, 96312133241935ULL, 468184501392107ULL, 2061529496271208ULL, + 801565111628867ULL, 3380678576799273ULL, 121814978170941ULL, 3340363319165433ULL, + 2764604325746928ULL, 4475755976431968ULL, 3678073419927081ULL, 237001357924061ULL, + 4110487014553450ULL, 442517757833404ULL, 3976758767423859ULL, 2559863799262476ULL, + 178144664279213ULL, 2488702171798051ULL, 4292079598620208ULL, 1642918280217329ULL, + 3694920319798108ULL, 111735528281657ULL, 2904433967156033ULL, 4391518032143166ULL, + 3018885875516259ULL, 3730342681447122ULL, 10320273322750ULL, 555845881555519ULL, + 58355404017985ULL, 379009359053696ULL, 450317203955503ULL, 271063299686173ULL, + 910340241794202ULL, 4145234574853890ULL, 2059755654702755ULL, 626530377112246ULL, + 188918989156857ULL, 3316657461542117ULL, 778033563170765ULL, 3568562306532187ULL, + 2888619469733481ULL, 4364919962337ULL, 4095057288587059ULL, 2275461355379988ULL, + 1507422995910897ULL, 3737691697116252ULL, 28779913258578ULL, 131453301647952ULL, + 3613515597508469ULL, 2389606941441321ULL, 2135459302594806ULL, 105517262484263ULL, + 2973432939331401ULL, 3447096622477885ULL, 684654106536844ULL, 2815198316729695ULL, + 280303067216071ULL, 1841014812927024ULL, 1181026273060917ULL, 4092989148457730ULL, + 1381045116206278ULL, 112475725893965ULL, 2309144740156686ULL, 1558825847609352ULL, + 2008068002046292ULL, 3153511625856423ULL, 38469701427673ULL, 4240572315518056ULL, + 2295170987320580ULL, 187734093837094ULL, 301041528077172ULL, 234553141005715ULL, + 4170513699279606ULL, 1600132848196146ULL, 3149113064155689ULL, 2733255352600949ULL, + 144915931419495ULL, 1221012073888926ULL, 4395668111081710ULL, 2464799161496070ULL, + 3664256125241313ULL, 239705368981290ULL, 1415181408539490ULL, 2551836620449074ULL, + 3003106895689578ULL, 968947218886924ULL, 270781532362673ULL, 2905980714350372ULL, + 3246927349288975ULL, 2653377642686974ULL, 1577457093418263ULL, 279488238785848ULL, + 568335962564552ULL, 4251365041645758ULL, 1257832559776007ULL, 2424022444243863ULL, + 261166122046343ULL, 4399874608082116ULL, 640509987891568ULL, 3119706885332220ULL, + 1990185416694007ULL, 119390098529341ULL, 220106534694050ULL, 937225880034895ULL, + 656288151358882ULL, 1766967254772100ULL, 197900790969750ULL, 2992539221608875ULL, + 3960297171111858ULL, 3499202002925081ULL, 1103060980924705ULL, 13670895919578ULL, + 430132744187721ULL, 1206771838050953ULL, 2474749300167198ULL, 296299539510780ULL, + 61565517686436ULL, 752778559080573ULL, 3049015829565410ULL, 3538647632527371ULL, + 1640473028662032ULL, 182488721849306ULL, 1234378482161516ULL, 3736205988606381ULL, + 2814216844344487ULL, 3877249891529557ULL, 51681412928433ULL, 4275336620301239ULL, + 3084074032750651ULL, 42732308350456ULL, 3648603591552229ULL, 142450621701603ULL, + 4020045475009854ULL, 1050293952073054ULL, 1974773673079851ULL, 1815515638724020ULL, + 104845375825434ULL }; static const uint64_t Hacl_K256_PrecompTable_precomp_g_pow2_128_table_w4[240U] = { - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1277614565900951U, - (uint64_t)378671684419493U, (uint64_t)3176260448102880U, (uint64_t)1575691435565077U, - (uint64_t)167304528382180U, (uint64_t)2600787765776588U, (uint64_t)7497946149293U, - (uint64_t)2184272641272202U, (uint64_t)2200235265236628U, (uint64_t)265969268774814U, - (uint64_t)1913228635640715U, (uint64_t)2831959046949342U, (uint64_t)888030405442963U, - (uint64_t)1817092932985033U, (uint64_t)101515844997121U, (uint64_t)3309468394859588U, - (uint64_t)3965334773689948U, (uint64_t)1945272965790738U, (uint64_t)4450939211427964U, - (uint64_t)211349698782702U, (uint64_t)2085160302160079U, (uint64_t)212812506072603U, - (uint64_t)3646122434511764U, (uint64_t)1711405092320514U, (uint64_t)95160920508464U, - (uint64_t)1677683368518073U, (uint64_t)4384656939250953U, (uint64_t)3548591046529893U, - (uint64_t)1683233536091384U, (uint64_t)105919586159941U, (uint64_t)1941416002726455U, - (uint64_t)246264372248216U, (uint64_t)3063044110922228U, (uint64_t)3772292170415825U, - (uint64_t)222933374989815U, (uint64_t)2417211163452935U, (uint64_t)2018230365573200U, - (uint64_t)1985974538911047U, (uint64_t)1387197705332739U, (uint64_t)186400825584956U, - (uint64_t)2469330487750329U, (uint64_t)1291983813301638U, (uint64_t)333416733706302U, - (uint64_t)3413315564261070U, (uint64_t)189444777569683U, (uint64_t)1062005622360420U, - (uint64_t)1800197715938740U, (uint64_t)3693110992551647U, (uint64_t)626990328941945U, - (uint64_t)40998857100520U, (uint64_t)3921983552805085U, (uint64_t)1016632437340656U, - (uint64_t)4016615929950878U, (uint64_t)2682554586771281U, (uint64_t)7043555162389U, - (uint64_t)3333819830676567U, (uint64_t)4120091964944036U, (uint64_t)1960788263484015U, - (uint64_t)1642145656273304U, (uint64_t)252814075789128U, (uint64_t)3085777342821357U, - (uint64_t)4166637997604052U, (uint64_t)1339401689756469U, (uint64_t)845938529607551U, - (uint64_t)223351828189283U, (uint64_t)1148648705186890U, (uint64_t)1230525014760605U, - (uint64_t)1869739475126720U, (uint64_t)4193966261205530U, (uint64_t)175684010336013U, - (uint64_t)4476719358931508U, (uint64_t)4209547487457638U, (uint64_t)2197536411673724U, - (uint64_t)3010838433412303U, (uint64_t)169318997251483U, (uint64_t)49493868302162U, - (uint64_t)3594601099078584U, (uint64_t)3662420905445942U, (uint64_t)3606544932233685U, - (uint64_t)270643652662165U, (uint64_t)180681786228544U, (uint64_t)2095882682308564U, - (uint64_t)813484483841391U, (uint64_t)1622665392824698U, (uint64_t)113821770225137U, - (uint64_t)3075432444115417U, (uint64_t)716502989978722U, (uint64_t)2304779892217245U, - (uint64_t)1760144151770127U, (uint64_t)235719156963938U, (uint64_t)3180013070471143U, - (uint64_t)1331027634540579U, (uint64_t)552273022992392U, (uint64_t)2858693077461887U, - (uint64_t)197914407731510U, (uint64_t)187252310910959U, (uint64_t)4160637171377125U, - (uint64_t)3225059526713298U, (uint64_t)2574558217383978U, (uint64_t)249695600622489U, - (uint64_t)364988742814327U, (uint64_t)4245298536326258U, (uint64_t)1812464706589342U, - (uint64_t)2734857123772998U, (uint64_t)120105577124628U, (uint64_t)160179251271109U, - (uint64_t)3604555733307834U, (uint64_t)150380003195715U, (uint64_t)1574304909935121U, - (uint64_t)142190285600761U, (uint64_t)1835385847725651U, (uint64_t)3168087139615901U, - (uint64_t)3201434861713736U, (uint64_t)741757984537760U, (uint64_t)163585009419543U, - (uint64_t)3837997981109783U, (uint64_t)3771946407870997U, (uint64_t)2867641360295452U, - (uint64_t)3097548691501578U, (uint64_t)124624912142104U, (uint64_t)2729896088769328U, - (uint64_t)1087786827035225U, (uint64_t)3934000813818614U, (uint64_t)1176792318645055U, - (uint64_t)125311882169270U, (uint64_t)3530709439299502U, (uint64_t)1561477829834527U, - (uint64_t)3927894570196761U, (uint64_t)3957765307669212U, (uint64_t)105720519513730U, - (uint64_t)3758969845816997U, (uint64_t)2738320452287300U, (uint64_t)2380753632109507U, - (uint64_t)2762090901149075U, (uint64_t)123455059136515U, (uint64_t)4222807813169807U, - (uint64_t)118064783651432U, (uint64_t)2877694712254934U, (uint64_t)3535027426396448U, - (uint64_t)100175663703417U, (uint64_t)3287921121213155U, (uint64_t)4497246481824206U, - (uint64_t)1960809949007025U, (uint64_t)3236854264159102U, (uint64_t)35028112623717U, - (uint64_t)338838627913273U, (uint64_t)2827531947914645U, (uint64_t)4231826783810670U, - (uint64_t)1082490106100389U, (uint64_t)13267544387448U, (uint64_t)4249975884259105U, - (uint64_t)2844862161652484U, (uint64_t)262742197948971U, (uint64_t)3525653802457116U, - (uint64_t)269963889261701U, (uint64_t)3690062482117102U, (uint64_t)675413453822147U, - (uint64_t)2170937868437574U, (uint64_t)2367632187022010U, (uint64_t)214032802409445U, - (uint64_t)2054007379612477U, (uint64_t)3558050826739009U, (uint64_t)266827184752634U, - (uint64_t)1946520293291195U, (uint64_t)238087872386556U, (uint64_t)490056555385700U, - (uint64_t)794405769357386U, (uint64_t)3886901294859702U, (uint64_t)3120414548626348U, - (uint64_t)84316625221136U, (uint64_t)223073962531835U, (uint64_t)4280846460577631U, - (uint64_t)344296282849308U, (uint64_t)3522116652699457U, (uint64_t)171817232053075U, - (uint64_t)3296636283062273U, (uint64_t)3587303364425579U, (uint64_t)1033485783633331U, - (uint64_t)3686984130812906U, (uint64_t)268290803650477U, (uint64_t)2803988215834467U, - (uint64_t)3821246410529720U, (uint64_t)1077722388925870U, (uint64_t)4187137036866164U, - (uint64_t)104696540795905U, (uint64_t)998770003854764U, (uint64_t)3960768137535019U, - (uint64_t)4293792474919135U, (uint64_t)3251297981727034U, (uint64_t)192479028790101U, - (uint64_t)1175880869349935U, (uint64_t)3506949259311937U, (uint64_t)2161711516160714U, - (uint64_t)2506820922270187U, (uint64_t)131002200661047U, (uint64_t)3532399477339994U, - (uint64_t)2515815721228719U, (uint64_t)4274974119021502U, (uint64_t)265752394510924U, - (uint64_t)163144272153395U, (uint64_t)2824260010502991U, (uint64_t)517077012665142U, - (uint64_t)602987073882924U, (uint64_t)2939630061751780U, (uint64_t)59211609557440U, - (uint64_t)963423614549333U, (uint64_t)495476232754434U, (uint64_t)94274496109103U, - (uint64_t)2245136222990187U, (uint64_t)185414764872288U, (uint64_t)2266067668609289U, - (uint64_t)3873978896235927U, (uint64_t)4428283513152105U, (uint64_t)3881481480259312U, - (uint64_t)207746202010862U, (uint64_t)1609437858011364U, (uint64_t)477585758421515U, - (uint64_t)3850430788664649U, (uint64_t)2682299074459173U, (uint64_t)149439089751274U, - (uint64_t)3665760243877698U, (uint64_t)1356661512658931U, (uint64_t)1675903262368322U, - (uint64_t)3355649228050892U, (uint64_t)99772108898412U + 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, + 1277614565900951ULL, 378671684419493ULL, 3176260448102880ULL, 1575691435565077ULL, + 167304528382180ULL, 2600787765776588ULL, 7497946149293ULL, 2184272641272202ULL, + 2200235265236628ULL, 265969268774814ULL, 1913228635640715ULL, 2831959046949342ULL, + 888030405442963ULL, 1817092932985033ULL, 101515844997121ULL, 3309468394859588ULL, + 3965334773689948ULL, 1945272965790738ULL, 4450939211427964ULL, 211349698782702ULL, + 2085160302160079ULL, 212812506072603ULL, 3646122434511764ULL, 1711405092320514ULL, + 95160920508464ULL, 1677683368518073ULL, 4384656939250953ULL, 3548591046529893ULL, + 1683233536091384ULL, 105919586159941ULL, 1941416002726455ULL, 246264372248216ULL, + 3063044110922228ULL, 3772292170415825ULL, 222933374989815ULL, 2417211163452935ULL, + 2018230365573200ULL, 1985974538911047ULL, 1387197705332739ULL, 186400825584956ULL, + 2469330487750329ULL, 1291983813301638ULL, 333416733706302ULL, 3413315564261070ULL, + 189444777569683ULL, 1062005622360420ULL, 1800197715938740ULL, 3693110992551647ULL, + 626990328941945ULL, 40998857100520ULL, 3921983552805085ULL, 1016632437340656ULL, + 4016615929950878ULL, 2682554586771281ULL, 7043555162389ULL, 3333819830676567ULL, + 4120091964944036ULL, 1960788263484015ULL, 1642145656273304ULL, 252814075789128ULL, + 3085777342821357ULL, 4166637997604052ULL, 1339401689756469ULL, 845938529607551ULL, + 223351828189283ULL, 1148648705186890ULL, 1230525014760605ULL, 1869739475126720ULL, + 4193966261205530ULL, 175684010336013ULL, 4476719358931508ULL, 4209547487457638ULL, + 2197536411673724ULL, 3010838433412303ULL, 169318997251483ULL, 49493868302162ULL, + 3594601099078584ULL, 3662420905445942ULL, 3606544932233685ULL, 270643652662165ULL, + 180681786228544ULL, 2095882682308564ULL, 813484483841391ULL, 1622665392824698ULL, + 113821770225137ULL, 3075432444115417ULL, 716502989978722ULL, 2304779892217245ULL, + 1760144151770127ULL, 235719156963938ULL, 3180013070471143ULL, 1331027634540579ULL, + 552273022992392ULL, 2858693077461887ULL, 197914407731510ULL, 187252310910959ULL, + 4160637171377125ULL, 3225059526713298ULL, 2574558217383978ULL, 249695600622489ULL, + 364988742814327ULL, 4245298536326258ULL, 1812464706589342ULL, 2734857123772998ULL, + 120105577124628ULL, 160179251271109ULL, 3604555733307834ULL, 150380003195715ULL, + 1574304909935121ULL, 142190285600761ULL, 1835385847725651ULL, 3168087139615901ULL, + 3201434861713736ULL, 741757984537760ULL, 163585009419543ULL, 3837997981109783ULL, + 3771946407870997ULL, 2867641360295452ULL, 3097548691501578ULL, 124624912142104ULL, + 2729896088769328ULL, 1087786827035225ULL, 3934000813818614ULL, 1176792318645055ULL, + 125311882169270ULL, 3530709439299502ULL, 1561477829834527ULL, 3927894570196761ULL, + 3957765307669212ULL, 105720519513730ULL, 3758969845816997ULL, 2738320452287300ULL, + 2380753632109507ULL, 2762090901149075ULL, 123455059136515ULL, 4222807813169807ULL, + 118064783651432ULL, 2877694712254934ULL, 3535027426396448ULL, 100175663703417ULL, + 3287921121213155ULL, 4497246481824206ULL, 1960809949007025ULL, 3236854264159102ULL, + 35028112623717ULL, 338838627913273ULL, 2827531947914645ULL, 4231826783810670ULL, + 1082490106100389ULL, 13267544387448ULL, 4249975884259105ULL, 2844862161652484ULL, + 262742197948971ULL, 3525653802457116ULL, 269963889261701ULL, 3690062482117102ULL, + 675413453822147ULL, 2170937868437574ULL, 2367632187022010ULL, 214032802409445ULL, + 2054007379612477ULL, 3558050826739009ULL, 266827184752634ULL, 1946520293291195ULL, + 238087872386556ULL, 490056555385700ULL, 794405769357386ULL, 3886901294859702ULL, + 3120414548626348ULL, 84316625221136ULL, 223073962531835ULL, 4280846460577631ULL, + 344296282849308ULL, 3522116652699457ULL, 171817232053075ULL, 3296636283062273ULL, + 3587303364425579ULL, 1033485783633331ULL, 3686984130812906ULL, 268290803650477ULL, + 2803988215834467ULL, 3821246410529720ULL, 1077722388925870ULL, 4187137036866164ULL, + 104696540795905ULL, 998770003854764ULL, 3960768137535019ULL, 4293792474919135ULL, + 3251297981727034ULL, 192479028790101ULL, 1175880869349935ULL, 3506949259311937ULL, + 2161711516160714ULL, 2506820922270187ULL, 131002200661047ULL, 3532399477339994ULL, + 2515815721228719ULL, 4274974119021502ULL, 265752394510924ULL, 163144272153395ULL, + 2824260010502991ULL, 517077012665142ULL, 602987073882924ULL, 2939630061751780ULL, + 59211609557440ULL, 963423614549333ULL, 495476232754434ULL, 94274496109103ULL, + 2245136222990187ULL, 185414764872288ULL, 2266067668609289ULL, 3873978896235927ULL, + 4428283513152105ULL, 3881481480259312ULL, 207746202010862ULL, 1609437858011364ULL, + 477585758421515ULL, 3850430788664649ULL, 2682299074459173ULL, 149439089751274ULL, + 3665760243877698ULL, 1356661512658931ULL, 1675903262368322ULL, 3355649228050892ULL, + 99772108898412ULL }; static const uint64_t Hacl_K256_PrecompTable_precomp_g_pow2_192_table_w4[240U] = { - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)34056422761564U, - (uint64_t)3315864838337811U, (uint64_t)3797032336888745U, (uint64_t)2580641850480806U, - (uint64_t)208048944042500U, (uint64_t)1233795288689421U, (uint64_t)1048795233382631U, - (uint64_t)646545158071530U, (uint64_t)1816025742137285U, (uint64_t)12245672982162U, - (uint64_t)2119364213800870U, (uint64_t)2034960311715107U, (uint64_t)3172697815804487U, - (uint64_t)4185144850224160U, (uint64_t)2792055915674U, (uint64_t)795534452139321U, - (uint64_t)3647836177838185U, (uint64_t)2681403398797991U, (uint64_t)3149264270306207U, - (uint64_t)278704080615511U, (uint64_t)2752552368344718U, (uint64_t)1363840972378818U, - (uint64_t)1877521512083293U, (uint64_t)1862111388059470U, (uint64_t)36200324115014U, - (uint64_t)4183622899327217U, (uint64_t)747381675363076U, (uint64_t)2772916395314624U, - (uint64_t)833767013119965U, (uint64_t)246274452928088U, (uint64_t)1526238021297781U, - (uint64_t)3327534966022747U, (uint64_t)1169012581910517U, (uint64_t)4430894603030025U, - (uint64_t)149242742442115U, (uint64_t)1002569704307172U, (uint64_t)2763252093432365U, - (uint64_t)3037748497732938U, (uint64_t)2329811173939457U, (uint64_t)270769113180752U, - (uint64_t)4344092461623432U, (uint64_t)892200524589382U, (uint64_t)2511418516713970U, - (uint64_t)103575031265398U, (uint64_t)183736033430252U, (uint64_t)583003071257308U, - (uint64_t)3357167344738425U, (uint64_t)4038099763242651U, (uint64_t)1776250620957255U, - (uint64_t)51334115864192U, (uint64_t)2616405698969611U, (uint64_t)1196364755910565U, - (uint64_t)3135228056210500U, (uint64_t)533729417611761U, (uint64_t)86564351229326U, - (uint64_t)98936129527281U, (uint64_t)4425305036630677U, (uint64_t)2980296390253408U, - (uint64_t)2487091677325739U, (uint64_t)10501977234280U, (uint64_t)1805646499831077U, - (uint64_t)3120615962395477U, (uint64_t)3634629685307533U, (uint64_t)3009632755291436U, - (uint64_t)16794051906523U, (uint64_t)2465481597883214U, (uint64_t)211492787490403U, - (uint64_t)1120942867046103U, (uint64_t)486438308572108U, (uint64_t)76058986271771U, - (uint64_t)2435216584587357U, (uint64_t)3076359381968283U, (uint64_t)1071594491489655U, - (uint64_t)3148707450339154U, (uint64_t)249332205737851U, (uint64_t)4171051176626809U, - (uint64_t)3165176227956388U, (uint64_t)2400901591835233U, (uint64_t)1435783621333022U, - (uint64_t)20312753440321U, (uint64_t)1767293887448005U, (uint64_t)685150647587522U, - (uint64_t)2957187934449906U, (uint64_t)382661319140439U, (uint64_t)177583591139601U, - (uint64_t)2083572648630743U, (uint64_t)1083410277889419U, (uint64_t)4267902097868310U, - (uint64_t)679989918385081U, (uint64_t)123155311554032U, (uint64_t)2830267662472020U, - (uint64_t)4476040509735924U, (uint64_t)526697201585144U, (uint64_t)3465306430573135U, - (uint64_t)2296616218591U, (uint64_t)1270626872734279U, (uint64_t)1049740198790549U, - (uint64_t)4197567214843444U, (uint64_t)1962225231320591U, (uint64_t)186125026796856U, - (uint64_t)737027567341142U, (uint64_t)4364616098174U, (uint64_t)3618884818756660U, - (uint64_t)1236837563717668U, (uint64_t)162873772439548U, (uint64_t)3081542470065122U, - (uint64_t)910331750163991U, (uint64_t)2110498143869827U, (uint64_t)3208473121852657U, - (uint64_t)94687786224509U, (uint64_t)4113309027567819U, (uint64_t)4272179438357536U, - (uint64_t)1857418654076140U, (uint64_t)1672678841741004U, (uint64_t)94482160248411U, - (uint64_t)1928652436799020U, (uint64_t)1750866462381515U, (uint64_t)4048060485672270U, - (uint64_t)4006680581258587U, (uint64_t)14850434761312U, (uint64_t)2828734997081648U, - (uint64_t)1975589525873972U, (uint64_t)3724347738416009U, (uint64_t)597163266689736U, - (uint64_t)14568362978551U, (uint64_t)2203865455839744U, (uint64_t)2237034958890595U, - (uint64_t)1863572986731818U, (uint64_t)2329774560279041U, (uint64_t)245105447642201U, - (uint64_t)2179697447864822U, (uint64_t)1769609498189882U, (uint64_t)1916950746430931U, - (uint64_t)847019613787312U, (uint64_t)163210606565100U, (uint64_t)3658248417400062U, - (uint64_t)717138296045881U, (uint64_t)42531212306121U, (uint64_t)1040915917097532U, - (uint64_t)77364489101310U, (uint64_t)539253504015590U, (uint64_t)732690726289841U, - (uint64_t)3401622034697806U, (uint64_t)2864593278358513U, (uint64_t)142611941887017U, - (uint64_t)536364617506702U, (uint64_t)845071859974284U, (uint64_t)4461787417089721U, - (uint64_t)2633811871939723U, (uint64_t)113619731985610U, (uint64_t)2535870015489566U, - (uint64_t)2146224665077830U, (uint64_t)2593725534662047U, (uint64_t)1332349537449710U, - (uint64_t)153375287068096U, (uint64_t)3689977177165276U, (uint64_t)3631865615314120U, - (uint64_t)184644878348929U, (uint64_t)2220481726602813U, (uint64_t)204002551273091U, - (uint64_t)3022560051766785U, (uint64_t)3125940458001213U, (uint64_t)4258299086906325U, - (uint64_t)1072471915162030U, (uint64_t)2797562724530U, (uint64_t)3974298156223059U, - (uint64_t)1624778551002554U, (uint64_t)3490703864485971U, (uint64_t)2533877484212458U, - (uint64_t)176107782538555U, (uint64_t)4275987398312137U, (uint64_t)4397120757693722U, - (uint64_t)3001292763847390U, (uint64_t)1556490837621310U, (uint64_t)70442953037671U, - (uint64_t)1558915972545974U, (uint64_t)744724505252845U, (uint64_t)2697230204313363U, - (uint64_t)3495671924212144U, (uint64_t)95744296878924U, (uint64_t)1508848630912047U, - (uint64_t)4163599342850968U, (uint64_t)1234988733935901U, (uint64_t)3789722472212706U, - (uint64_t)219522007052022U, (uint64_t)2106597506701262U, (uint64_t)3231115099832239U, - (uint64_t)1296436890593905U, (uint64_t)1016795619587656U, (uint64_t)231150565033388U, - (uint64_t)4205501688458754U, (uint64_t)2271569140386062U, (uint64_t)3421769599058157U, - (uint64_t)4118408853784554U, (uint64_t)276709341465173U, (uint64_t)2681340614854362U, - (uint64_t)2514413365628788U, (uint64_t)62294545067341U, (uint64_t)277610220069365U, - (uint64_t)252463150123799U, (uint64_t)2547353593759399U, (uint64_t)1857438147448607U, - (uint64_t)2964811969681256U, (uint64_t)3303706463835387U, (uint64_t)248936570980853U, - (uint64_t)3208982702478009U, (uint64_t)2518671051730787U, (uint64_t)727433853033835U, - (uint64_t)1290389308223446U, (uint64_t)220742793981035U, (uint64_t)3851225361654709U, - (uint64_t)2307489307934273U, (uint64_t)1151710489948266U, (uint64_t)289775285210516U, - (uint64_t)222685002397295U, (uint64_t)1222117478082108U, (uint64_t)2822029169395728U, - (uint64_t)1172146252219882U, (uint64_t)2626108105510259U, (uint64_t)209803527887167U, - (uint64_t)2718831919953281U, (uint64_t)4348638387588593U, (uint64_t)3761438313263183U, - (uint64_t)13169515318095U, (uint64_t)212893621229476U + 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, + 34056422761564ULL, 3315864838337811ULL, 3797032336888745ULL, 2580641850480806ULL, + 208048944042500ULL, 1233795288689421ULL, 1048795233382631ULL, 646545158071530ULL, + 1816025742137285ULL, 12245672982162ULL, 2119364213800870ULL, 2034960311715107ULL, + 3172697815804487ULL, 4185144850224160ULL, 2792055915674ULL, 795534452139321ULL, + 3647836177838185ULL, 2681403398797991ULL, 3149264270306207ULL, 278704080615511ULL, + 2752552368344718ULL, 1363840972378818ULL, 1877521512083293ULL, 1862111388059470ULL, + 36200324115014ULL, 4183622899327217ULL, 747381675363076ULL, 2772916395314624ULL, + 833767013119965ULL, 246274452928088ULL, 1526238021297781ULL, 3327534966022747ULL, + 1169012581910517ULL, 4430894603030025ULL, 149242742442115ULL, 1002569704307172ULL, + 2763252093432365ULL, 3037748497732938ULL, 2329811173939457ULL, 270769113180752ULL, + 4344092461623432ULL, 892200524589382ULL, 2511418516713970ULL, 103575031265398ULL, + 183736033430252ULL, 583003071257308ULL, 3357167344738425ULL, 4038099763242651ULL, + 1776250620957255ULL, 51334115864192ULL, 2616405698969611ULL, 1196364755910565ULL, + 3135228056210500ULL, 533729417611761ULL, 86564351229326ULL, 98936129527281ULL, + 4425305036630677ULL, 2980296390253408ULL, 2487091677325739ULL, 10501977234280ULL, + 1805646499831077ULL, 3120615962395477ULL, 3634629685307533ULL, 3009632755291436ULL, + 16794051906523ULL, 2465481597883214ULL, 211492787490403ULL, 1120942867046103ULL, + 486438308572108ULL, 76058986271771ULL, 2435216584587357ULL, 3076359381968283ULL, + 1071594491489655ULL, 3148707450339154ULL, 249332205737851ULL, 4171051176626809ULL, + 3165176227956388ULL, 2400901591835233ULL, 1435783621333022ULL, 20312753440321ULL, + 1767293887448005ULL, 685150647587522ULL, 2957187934449906ULL, 382661319140439ULL, + 177583591139601ULL, 2083572648630743ULL, 1083410277889419ULL, 4267902097868310ULL, + 679989918385081ULL, 123155311554032ULL, 2830267662472020ULL, 4476040509735924ULL, + 526697201585144ULL, 3465306430573135ULL, 2296616218591ULL, 1270626872734279ULL, + 1049740198790549ULL, 4197567214843444ULL, 1962225231320591ULL, 186125026796856ULL, + 737027567341142ULL, 4364616098174ULL, 3618884818756660ULL, 1236837563717668ULL, + 162873772439548ULL, 3081542470065122ULL, 910331750163991ULL, 2110498143869827ULL, + 3208473121852657ULL, 94687786224509ULL, 4113309027567819ULL, 4272179438357536ULL, + 1857418654076140ULL, 1672678841741004ULL, 94482160248411ULL, 1928652436799020ULL, + 1750866462381515ULL, 4048060485672270ULL, 4006680581258587ULL, 14850434761312ULL, + 2828734997081648ULL, 1975589525873972ULL, 3724347738416009ULL, 597163266689736ULL, + 14568362978551ULL, 2203865455839744ULL, 2237034958890595ULL, 1863572986731818ULL, + 2329774560279041ULL, 245105447642201ULL, 2179697447864822ULL, 1769609498189882ULL, + 1916950746430931ULL, 847019613787312ULL, 163210606565100ULL, 3658248417400062ULL, + 717138296045881ULL, 42531212306121ULL, 1040915917097532ULL, 77364489101310ULL, + 539253504015590ULL, 732690726289841ULL, 3401622034697806ULL, 2864593278358513ULL, + 142611941887017ULL, 536364617506702ULL, 845071859974284ULL, 4461787417089721ULL, + 2633811871939723ULL, 113619731985610ULL, 2535870015489566ULL, 2146224665077830ULL, + 2593725534662047ULL, 1332349537449710ULL, 153375287068096ULL, 3689977177165276ULL, + 3631865615314120ULL, 184644878348929ULL, 2220481726602813ULL, 204002551273091ULL, + 3022560051766785ULL, 3125940458001213ULL, 4258299086906325ULL, 1072471915162030ULL, + 2797562724530ULL, 3974298156223059ULL, 1624778551002554ULL, 3490703864485971ULL, + 2533877484212458ULL, 176107782538555ULL, 4275987398312137ULL, 4397120757693722ULL, + 3001292763847390ULL, 1556490837621310ULL, 70442953037671ULL, 1558915972545974ULL, + 744724505252845ULL, 2697230204313363ULL, 3495671924212144ULL, 95744296878924ULL, + 1508848630912047ULL, 4163599342850968ULL, 1234988733935901ULL, 3789722472212706ULL, + 219522007052022ULL, 2106597506701262ULL, 3231115099832239ULL, 1296436890593905ULL, + 1016795619587656ULL, 231150565033388ULL, 4205501688458754ULL, 2271569140386062ULL, + 3421769599058157ULL, 4118408853784554ULL, 276709341465173ULL, 2681340614854362ULL, + 2514413365628788ULL, 62294545067341ULL, 277610220069365ULL, 252463150123799ULL, + 2547353593759399ULL, 1857438147448607ULL, 2964811969681256ULL, 3303706463835387ULL, + 248936570980853ULL, 3208982702478009ULL, 2518671051730787ULL, 727433853033835ULL, + 1290389308223446ULL, 220742793981035ULL, 3851225361654709ULL, 2307489307934273ULL, + 1151710489948266ULL, 289775285210516ULL, 222685002397295ULL, 1222117478082108ULL, + 2822029169395728ULL, 1172146252219882ULL, 2626108105510259ULL, 209803527887167ULL, + 2718831919953281ULL, 4348638387588593ULL, 3761438313263183ULL, 13169515318095ULL, + 212893621229476ULL }; static const uint64_t Hacl_K256_PrecompTable_precomp_basepoint_table_w5[480U] = { - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)705178180786072U, - (uint64_t)3855836460717471U, (uint64_t)4089131105950716U, (uint64_t)3301581525494108U, - (uint64_t)133858670344668U, (uint64_t)2199641648059576U, (uint64_t)1278080618437060U, - (uint64_t)3959378566518708U, (uint64_t)3455034269351872U, (uint64_t)79417610544803U, - (uint64_t)1U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, - (uint64_t)1282049064345544U, (uint64_t)971732600440099U, (uint64_t)1014594595727339U, - (uint64_t)4392159187541980U, (uint64_t)268327875692285U, (uint64_t)2411661712280539U, - (uint64_t)1092576199280126U, (uint64_t)4328619610718051U, (uint64_t)3535440816471627U, - (uint64_t)95182251488556U, (uint64_t)1893725512243753U, (uint64_t)3619861457111820U, - (uint64_t)879374960417905U, (uint64_t)2868056058129113U, (uint64_t)273195291893682U, - (uint64_t)2044797305960112U, (uint64_t)2357106853933780U, (uint64_t)3563112438336058U, - (uint64_t)2430811541762558U, (uint64_t)106443809495428U, (uint64_t)2231357633909668U, - (uint64_t)3641705835951936U, (uint64_t)80642569314189U, (uint64_t)2254841882373268U, - (uint64_t)149848031966573U, (uint64_t)2304615661367764U, (uint64_t)2410957403736446U, - (uint64_t)2712754805859804U, (uint64_t)2440183877540536U, (uint64_t)99784623895865U, - (uint64_t)3667773127482758U, (uint64_t)1354899394473308U, (uint64_t)3636602998800808U, - (uint64_t)2709296679846364U, (uint64_t)7253362091963U, (uint64_t)3585950735562744U, - (uint64_t)935775991758415U, (uint64_t)4108078106735201U, (uint64_t)556081800336307U, - (uint64_t)229585977163057U, (uint64_t)4055594186679801U, (uint64_t)1767681004944933U, - (uint64_t)1432634922083242U, (uint64_t)534935602949197U, (uint64_t)251753159522567U, - (uint64_t)2846474078499321U, (uint64_t)4488649590348702U, (uint64_t)2437476916025038U, - (uint64_t)3040577412822874U, (uint64_t)79405234918614U, (uint64_t)3030621226551508U, - (uint64_t)2801117003929806U, (uint64_t)1642927515498422U, (uint64_t)2802725079726297U, - (uint64_t)8472780626107U, (uint64_t)866068070352655U, (uint64_t)188080768545106U, - (uint64_t)2152119998903058U, (uint64_t)3391239985029665U, (uint64_t)23820026013564U, - (uint64_t)2965064154891949U, (uint64_t)1846516097921398U, (uint64_t)4418379948133146U, - (uint64_t)3137755426942400U, (uint64_t)47705291301781U, (uint64_t)4278533051105665U, - (uint64_t)3453643211214931U, (uint64_t)3379734319145156U, (uint64_t)3762442192097039U, - (uint64_t)40243003528694U, (uint64_t)4063448994211201U, (uint64_t)5697015368785U, - (uint64_t)1006545411838613U, (uint64_t)4242291693755210U, (uint64_t)135184629190512U, - (uint64_t)264898689131035U, (uint64_t)611796474823597U, (uint64_t)3255382250029089U, - (uint64_t)3490429246984696U, (uint64_t)236558595864362U, (uint64_t)2055934691551704U, - (uint64_t)1487711670114502U, (uint64_t)1823930698221632U, (uint64_t)2130937287438472U, - (uint64_t)154610053389779U, (uint64_t)2746573287023216U, (uint64_t)2430987262221221U, - (uint64_t)1668741642878689U, (uint64_t)904982541243977U, (uint64_t)56087343124948U, - (uint64_t)393905062353536U, (uint64_t)412681877350188U, (uint64_t)3153602040979977U, - (uint64_t)4466820876224989U, (uint64_t)146579165617857U, (uint64_t)2628741216508991U, - (uint64_t)747994231529806U, (uint64_t)750506569317681U, (uint64_t)1887492790748779U, - (uint64_t)35259008682771U, (uint64_t)2085116434894208U, (uint64_t)543291398921711U, - (uint64_t)1144362007901552U, (uint64_t)679305136036846U, (uint64_t)141090902244489U, - (uint64_t)632480954474859U, (uint64_t)2384513102652591U, (uint64_t)2225529790159790U, - (uint64_t)692258664851625U, (uint64_t)198681843567699U, (uint64_t)2397092587228181U, - (uint64_t)145862822166614U, (uint64_t)196976540479452U, (uint64_t)3321831130141455U, - (uint64_t)69266673089832U, (uint64_t)4469644227342284U, (uint64_t)3899271145504796U, - (uint64_t)1261890974076660U, (uint64_t)525357673886694U, (uint64_t)182135997828583U, - (uint64_t)4292760618810332U, (uint64_t)3404186545541683U, (uint64_t)312297386688768U, - (uint64_t)204377466824608U, (uint64_t)230900767857952U, (uint64_t)3871485172339693U, - (uint64_t)779449329662955U, (uint64_t)978655822464694U, (uint64_t)2278252139594027U, - (uint64_t)104641527040382U, (uint64_t)3528840153625765U, (uint64_t)4484699080275273U, - (uint64_t)1463971951102316U, (uint64_t)4013910812844749U, (uint64_t)228915589433620U, - (uint64_t)1209641433482461U, (uint64_t)4043178788774759U, (uint64_t)3008668238856634U, - (uint64_t)1448425089071412U, (uint64_t)26269719725037U, (uint64_t)3330785027545223U, - (uint64_t)852657975349259U, (uint64_t)227245054466105U, (uint64_t)1534632353984777U, - (uint64_t)207715098574660U, (uint64_t)3209837527352280U, (uint64_t)4051688046309066U, - (uint64_t)3839009590725955U, (uint64_t)1321506437398842U, (uint64_t)68340219159928U, - (uint64_t)1806950276956275U, (uint64_t)3923908055275295U, (uint64_t)743963253393575U, - (uint64_t)42162407478783U, (uint64_t)261334584474610U, (uint64_t)3728224928885214U, - (uint64_t)4004701081842869U, (uint64_t)709043201644674U, (uint64_t)4267294249150171U, - (uint64_t)255540582975025U, (uint64_t)875490593722211U, (uint64_t)796393708218375U, - (uint64_t)14774425627956U, (uint64_t)1500040516752097U, (uint64_t)141076627721678U, - (uint64_t)2634539368480628U, (uint64_t)1106488853550103U, (uint64_t)2346231921151930U, - (uint64_t)897108283954283U, (uint64_t)64616679559843U, (uint64_t)400244949840943U, - (uint64_t)1731263826831733U, (uint64_t)1649996579904651U, (uint64_t)3643693449640761U, - (uint64_t)172543068638991U, (uint64_t)329537981097182U, (uint64_t)2029799860802869U, - (uint64_t)4377737515208862U, (uint64_t)29103311051334U, (uint64_t)265583594111499U, - (uint64_t)3798074876561255U, (uint64_t)184749333259352U, (uint64_t)3117395073661801U, - (uint64_t)3695784565008833U, (uint64_t)64282709896721U, (uint64_t)1618968913246422U, - (uint64_t)3185235128095257U, (uint64_t)3288745068118692U, (uint64_t)1963818603508782U, - (uint64_t)281054350739495U, (uint64_t)1658639050810346U, (uint64_t)3061097601679552U, - (uint64_t)3023781433263746U, (uint64_t)2770283391242475U, (uint64_t)144508864751908U, - (uint64_t)173576288079856U, (uint64_t)46114579547054U, (uint64_t)1679480127300211U, - (uint64_t)1683062051644007U, (uint64_t)117183826129323U, (uint64_t)1894068608117440U, - (uint64_t)3846899838975733U, (uint64_t)4289279019496192U, (uint64_t)176995887914031U, - (uint64_t)78074942938713U, (uint64_t)454207263265292U, (uint64_t)972683614054061U, - (uint64_t)808474205144361U, (uint64_t)942703935951735U, (uint64_t)134460241077887U, - (uint64_t)2104196179349630U, (uint64_t)501632371208418U, (uint64_t)1666838991431177U, - (uint64_t)445606193139838U, (uint64_t)73704603396096U, (uint64_t)3140284774064777U, - (uint64_t)1356066420820179U, (uint64_t)227054159419281U, (uint64_t)1847611229198687U, - (uint64_t)82327838827660U, (uint64_t)3704027573265803U, (uint64_t)1585260489220244U, - (uint64_t)4404647914931933U, (uint64_t)2424649827425515U, (uint64_t)206821944206116U, - (uint64_t)1508635776287972U, (uint64_t)1933584575629676U, (uint64_t)1903635423783032U, - (uint64_t)4193642165165650U, (uint64_t)234321074690644U, (uint64_t)210406774251925U, - (uint64_t)1965845668185599U, (uint64_t)3059839433804731U, (uint64_t)1933300510683631U, - (uint64_t)150696600689211U, (uint64_t)4069293682158567U, (uint64_t)4346344602660044U, - (uint64_t)312200249664561U, (uint64_t)2495020807621840U, (uint64_t)1912707714385U, - (uint64_t)299345978159762U, (uint64_t)1164752722686920U, (uint64_t)225322433710338U, - (uint64_t)3128747381283759U, (uint64_t)275659067815583U, (uint64_t)1489671057429039U, - (uint64_t)1567693343342676U, (uint64_t)921672046098071U, (uint64_t)3707418899384085U, - (uint64_t)54646424931593U, (uint64_t)4026733380127147U, (uint64_t)2933435393699231U, - (uint64_t)3356593659521967U, (uint64_t)3637750749325529U, (uint64_t)232939412379045U, - (uint64_t)2298399636043069U, (uint64_t)270361546063041U, (uint64_t)2523933572551420U, - (uint64_t)3456896091572950U, (uint64_t)185447004732850U, (uint64_t)429322937697821U, - (uint64_t)2579704215668222U, (uint64_t)695065378803349U, (uint64_t)3987916247731243U, - (uint64_t)255159546348233U, (uint64_t)3057777929921282U, (uint64_t)1608970699916312U, - (uint64_t)1902369623063807U, (uint64_t)1413619643652777U, (uint64_t)94983996321227U, - (uint64_t)2832873179548050U, (uint64_t)4335430233622555U, (uint64_t)1559023976028843U, - (uint64_t)3297181988648895U, (uint64_t)100072021232323U, (uint64_t)2124984034109675U, - (uint64_t)4501252835618918U, (uint64_t)2053336899483297U, (uint64_t)638807226463876U, - (uint64_t)278445213600634U, (uint64_t)2311236445660555U, (uint64_t)303317664040012U, - (uint64_t)2659353858089024U, (uint64_t)3598827423980130U, (uint64_t)176059343827873U, - (uint64_t)3891639526275437U, (uint64_t)252823982819463U, (uint64_t)3404823300622345U, - (uint64_t)2758370772497456U, (uint64_t)91397496598783U, (uint64_t)2248661144141892U, - (uint64_t)491087075271969U, (uint64_t)1786344894571315U, (uint64_t)452497694885923U, - (uint64_t)34039628873357U, (uint64_t)2116503165025197U, (uint64_t)4436733709429923U, - (uint64_t)3045800776819238U, (uint64_t)1385518906078375U, (uint64_t)110495603336764U, - (uint64_t)4051447296249587U, (uint64_t)1103557421498625U, (uint64_t)1840785058439622U, - (uint64_t)425322753992314U, (uint64_t)98330046771676U, (uint64_t)365407468686431U, - (uint64_t)2611246859977123U, (uint64_t)3050253933135339U, (uint64_t)1006482220896688U, - (uint64_t)166818196428389U, (uint64_t)3415236093104372U, (uint64_t)1762308883882288U, - (uint64_t)1327828123094558U, (uint64_t)3403946425556706U, (uint64_t)96503464455441U, - (uint64_t)3893015304031471U, (uint64_t)3740839477490397U, (uint64_t)2411470812852231U, - (uint64_t)940927462436211U, (uint64_t)163825285911099U, (uint64_t)1622441495640386U, - (uint64_t)850224095680266U, (uint64_t)76199085900939U, (uint64_t)1941852365144042U, - (uint64_t)140326673652807U, (uint64_t)3161611011249524U, (uint64_t)317297150009965U, - (uint64_t)2145053259340619U, (uint64_t)2180498176457552U, (uint64_t)38457740506224U, - (uint64_t)394174899129468U, (uint64_t)2687474560485245U, (uint64_t)1542175980184516U, - (uint64_t)1628502671124819U, (uint64_t)48477401124385U, (uint64_t)4474181600025082U, - (uint64_t)2142747956365708U, (uint64_t)1638299432475478U, (uint64_t)2005869320353249U, - (uint64_t)112292630760956U, (uint64_t)1887521965171588U, (uint64_t)457587531429696U, - (uint64_t)840994209504042U, (uint64_t)4268060856325798U, (uint64_t)195597993440388U, - (uint64_t)4148484749020338U, (uint64_t)2074885000909672U, (uint64_t)2309839019263165U, - (uint64_t)2087616209681024U, (uint64_t)257214370719966U, (uint64_t)2331363508376581U, - (uint64_t)1233124357504711U, (uint64_t)2849542202650296U, (uint64_t)3790982825325736U, - (uint64_t)13381453503890U, (uint64_t)1665246594531069U, (uint64_t)4165624287443904U, - (uint64_t)3418759698027493U, (uint64_t)2118493255117399U, (uint64_t)136249206366067U, - (uint64_t)4064050233283309U, (uint64_t)1368779887911300U, (uint64_t)4370550759530269U, - (uint64_t)66992990631341U, (uint64_t)84442368922270U, (uint64_t)2139322635321394U, - (uint64_t)2076163483726795U, (uint64_t)657097866349103U, (uint64_t)2095579409488071U, - (uint64_t)226525774791341U, (uint64_t)4445744257665359U, (uint64_t)2035752839278107U, - (uint64_t)1998242662838304U, (uint64_t)1601548415521694U, (uint64_t)151297684296198U, - (uint64_t)1350963039017303U, (uint64_t)2624916349548281U, (uint64_t)2018863259670197U, - (uint64_t)2717274357461290U, (uint64_t)94024796961533U, (uint64_t)711335520409111U, - (uint64_t)4322093765820263U, (uint64_t)2041650358174649U, (uint64_t)3439791603157577U, - (uint64_t)179292018616267U, (uint64_t)2436436921286669U, (uint64_t)3905268797208340U, - (uint64_t)2829194895162985U, (uint64_t)1355175382191543U, (uint64_t)55128779761539U, - (uint64_t)2648428998786922U, (uint64_t)869805912573515U, (uint64_t)3706708942847864U, - (uint64_t)2785288916584667U, (uint64_t)37156862850147U, (uint64_t)1422245336293228U, - (uint64_t)4497066058933021U, (uint64_t)85588912978349U, (uint64_t)2616252221194611U, - (uint64_t)53506393720989U, (uint64_t)3727539190732644U, (uint64_t)872132446545237U, - (uint64_t)933583590986077U, (uint64_t)3794591170581203U, (uint64_t)167875550514069U, - (uint64_t)2267466834993297U, (uint64_t)3072652681756816U, (uint64_t)2108499037430803U, - (uint64_t)1606735192928366U, (uint64_t)72339568815255U, (uint64_t)3258484260684219U, - (uint64_t)3277927277719855U, (uint64_t)2459560373011535U, (uint64_t)1672794293294033U, - (uint64_t)227460934880669U, (uint64_t)3702454405413705U, (uint64_t)106168148441676U, - (uint64_t)1356617643071159U, (uint64_t)3280896569942762U, (uint64_t)142618711614302U, - (uint64_t)4291782740862057U, (uint64_t)4141020884874235U, (uint64_t)3720787221267125U, - (uint64_t)552884940089351U, (uint64_t)174626154407180U, (uint64_t)972071013326540U, - (uint64_t)4458530419931903U, (uint64_t)4435168973822858U, (uint64_t)1902967548748411U, - (uint64_t)53007977605840U, (uint64_t)2453997334323925U, (uint64_t)3653077937283262U, - (uint64_t)850660265046356U, (uint64_t)312721924805450U, (uint64_t)268503679240683U, - (uint64_t)256960167714122U, (uint64_t)1474492507858350U, (uint64_t)2456345526438488U, - (uint64_t)3686029507160255U, (uint64_t)279158933010398U, (uint64_t)3646946293948063U, - (uint64_t)704477527214036U, (uint64_t)3387744169891031U, (uint64_t)3772622670980241U, - (uint64_t)136368897543304U, (uint64_t)3744894052577607U, (uint64_t)1976007214443430U, - (uint64_t)2090045379763451U, (uint64_t)968565474458988U, (uint64_t)234295114806066U + 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, + 705178180786072ULL, 3855836460717471ULL, 4089131105950716ULL, 3301581525494108ULL, + 133858670344668ULL, 2199641648059576ULL, 1278080618437060ULL, 3959378566518708ULL, + 3455034269351872ULL, 79417610544803ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1282049064345544ULL, + 971732600440099ULL, 1014594595727339ULL, 4392159187541980ULL, 268327875692285ULL, + 2411661712280539ULL, 1092576199280126ULL, 4328619610718051ULL, 3535440816471627ULL, + 95182251488556ULL, 1893725512243753ULL, 3619861457111820ULL, 879374960417905ULL, + 2868056058129113ULL, 273195291893682ULL, 2044797305960112ULL, 2357106853933780ULL, + 3563112438336058ULL, 2430811541762558ULL, 106443809495428ULL, 2231357633909668ULL, + 3641705835951936ULL, 80642569314189ULL, 2254841882373268ULL, 149848031966573ULL, + 2304615661367764ULL, 2410957403736446ULL, 2712754805859804ULL, 2440183877540536ULL, + 99784623895865ULL, 3667773127482758ULL, 1354899394473308ULL, 3636602998800808ULL, + 2709296679846364ULL, 7253362091963ULL, 3585950735562744ULL, 935775991758415ULL, + 4108078106735201ULL, 556081800336307ULL, 229585977163057ULL, 4055594186679801ULL, + 1767681004944933ULL, 1432634922083242ULL, 534935602949197ULL, 251753159522567ULL, + 2846474078499321ULL, 4488649590348702ULL, 2437476916025038ULL, 3040577412822874ULL, + 79405234918614ULL, 3030621226551508ULL, 2801117003929806ULL, 1642927515498422ULL, + 2802725079726297ULL, 8472780626107ULL, 866068070352655ULL, 188080768545106ULL, + 2152119998903058ULL, 3391239985029665ULL, 23820026013564ULL, 2965064154891949ULL, + 1846516097921398ULL, 4418379948133146ULL, 3137755426942400ULL, 47705291301781ULL, + 4278533051105665ULL, 3453643211214931ULL, 3379734319145156ULL, 3762442192097039ULL, + 40243003528694ULL, 4063448994211201ULL, 5697015368785ULL, 1006545411838613ULL, + 4242291693755210ULL, 135184629190512ULL, 264898689131035ULL, 611796474823597ULL, + 3255382250029089ULL, 3490429246984696ULL, 236558595864362ULL, 2055934691551704ULL, + 1487711670114502ULL, 1823930698221632ULL, 2130937287438472ULL, 154610053389779ULL, + 2746573287023216ULL, 2430987262221221ULL, 1668741642878689ULL, 904982541243977ULL, + 56087343124948ULL, 393905062353536ULL, 412681877350188ULL, 3153602040979977ULL, + 4466820876224989ULL, 146579165617857ULL, 2628741216508991ULL, 747994231529806ULL, + 750506569317681ULL, 1887492790748779ULL, 35259008682771ULL, 2085116434894208ULL, + 543291398921711ULL, 1144362007901552ULL, 679305136036846ULL, 141090902244489ULL, + 632480954474859ULL, 2384513102652591ULL, 2225529790159790ULL, 692258664851625ULL, + 198681843567699ULL, 2397092587228181ULL, 145862822166614ULL, 196976540479452ULL, + 3321831130141455ULL, 69266673089832ULL, 4469644227342284ULL, 3899271145504796ULL, + 1261890974076660ULL, 525357673886694ULL, 182135997828583ULL, 4292760618810332ULL, + 3404186545541683ULL, 312297386688768ULL, 204377466824608ULL, 230900767857952ULL, + 3871485172339693ULL, 779449329662955ULL, 978655822464694ULL, 2278252139594027ULL, + 104641527040382ULL, 3528840153625765ULL, 4484699080275273ULL, 1463971951102316ULL, + 4013910812844749ULL, 228915589433620ULL, 1209641433482461ULL, 4043178788774759ULL, + 3008668238856634ULL, 1448425089071412ULL, 26269719725037ULL, 3330785027545223ULL, + 852657975349259ULL, 227245054466105ULL, 1534632353984777ULL, 207715098574660ULL, + 3209837527352280ULL, 4051688046309066ULL, 3839009590725955ULL, 1321506437398842ULL, + 68340219159928ULL, 1806950276956275ULL, 3923908055275295ULL, 743963253393575ULL, + 42162407478783ULL, 261334584474610ULL, 3728224928885214ULL, 4004701081842869ULL, + 709043201644674ULL, 4267294249150171ULL, 255540582975025ULL, 875490593722211ULL, + 796393708218375ULL, 14774425627956ULL, 1500040516752097ULL, 141076627721678ULL, + 2634539368480628ULL, 1106488853550103ULL, 2346231921151930ULL, 897108283954283ULL, + 64616679559843ULL, 400244949840943ULL, 1731263826831733ULL, 1649996579904651ULL, + 3643693449640761ULL, 172543068638991ULL, 329537981097182ULL, 2029799860802869ULL, + 4377737515208862ULL, 29103311051334ULL, 265583594111499ULL, 3798074876561255ULL, + 184749333259352ULL, 3117395073661801ULL, 3695784565008833ULL, 64282709896721ULL, + 1618968913246422ULL, 3185235128095257ULL, 3288745068118692ULL, 1963818603508782ULL, + 281054350739495ULL, 1658639050810346ULL, 3061097601679552ULL, 3023781433263746ULL, + 2770283391242475ULL, 144508864751908ULL, 173576288079856ULL, 46114579547054ULL, + 1679480127300211ULL, 1683062051644007ULL, 117183826129323ULL, 1894068608117440ULL, + 3846899838975733ULL, 4289279019496192ULL, 176995887914031ULL, 78074942938713ULL, + 454207263265292ULL, 972683614054061ULL, 808474205144361ULL, 942703935951735ULL, + 134460241077887ULL, 2104196179349630ULL, 501632371208418ULL, 1666838991431177ULL, + 445606193139838ULL, 73704603396096ULL, 3140284774064777ULL, 1356066420820179ULL, + 227054159419281ULL, 1847611229198687ULL, 82327838827660ULL, 3704027573265803ULL, + 1585260489220244ULL, 4404647914931933ULL, 2424649827425515ULL, 206821944206116ULL, + 1508635776287972ULL, 1933584575629676ULL, 1903635423783032ULL, 4193642165165650ULL, + 234321074690644ULL, 210406774251925ULL, 1965845668185599ULL, 3059839433804731ULL, + 1933300510683631ULL, 150696600689211ULL, 4069293682158567ULL, 4346344602660044ULL, + 312200249664561ULL, 2495020807621840ULL, 1912707714385ULL, 299345978159762ULL, + 1164752722686920ULL, 225322433710338ULL, 3128747381283759ULL, 275659067815583ULL, + 1489671057429039ULL, 1567693343342676ULL, 921672046098071ULL, 3707418899384085ULL, + 54646424931593ULL, 4026733380127147ULL, 2933435393699231ULL, 3356593659521967ULL, + 3637750749325529ULL, 232939412379045ULL, 2298399636043069ULL, 270361546063041ULL, + 2523933572551420ULL, 3456896091572950ULL, 185447004732850ULL, 429322937697821ULL, + 2579704215668222ULL, 695065378803349ULL, 3987916247731243ULL, 255159546348233ULL, + 3057777929921282ULL, 1608970699916312ULL, 1902369623063807ULL, 1413619643652777ULL, + 94983996321227ULL, 2832873179548050ULL, 4335430233622555ULL, 1559023976028843ULL, + 3297181988648895ULL, 100072021232323ULL, 2124984034109675ULL, 4501252835618918ULL, + 2053336899483297ULL, 638807226463876ULL, 278445213600634ULL, 2311236445660555ULL, + 303317664040012ULL, 2659353858089024ULL, 3598827423980130ULL, 176059343827873ULL, + 3891639526275437ULL, 252823982819463ULL, 3404823300622345ULL, 2758370772497456ULL, + 91397496598783ULL, 2248661144141892ULL, 491087075271969ULL, 1786344894571315ULL, + 452497694885923ULL, 34039628873357ULL, 2116503165025197ULL, 4436733709429923ULL, + 3045800776819238ULL, 1385518906078375ULL, 110495603336764ULL, 4051447296249587ULL, + 1103557421498625ULL, 1840785058439622ULL, 425322753992314ULL, 98330046771676ULL, + 365407468686431ULL, 2611246859977123ULL, 3050253933135339ULL, 1006482220896688ULL, + 166818196428389ULL, 3415236093104372ULL, 1762308883882288ULL, 1327828123094558ULL, + 3403946425556706ULL, 96503464455441ULL, 3893015304031471ULL, 3740839477490397ULL, + 2411470812852231ULL, 940927462436211ULL, 163825285911099ULL, 1622441495640386ULL, + 850224095680266ULL, 76199085900939ULL, 1941852365144042ULL, 140326673652807ULL, + 3161611011249524ULL, 317297150009965ULL, 2145053259340619ULL, 2180498176457552ULL, + 38457740506224ULL, 394174899129468ULL, 2687474560485245ULL, 1542175980184516ULL, + 1628502671124819ULL, 48477401124385ULL, 4474181600025082ULL, 2142747956365708ULL, + 1638299432475478ULL, 2005869320353249ULL, 112292630760956ULL, 1887521965171588ULL, + 457587531429696ULL, 840994209504042ULL, 4268060856325798ULL, 195597993440388ULL, + 4148484749020338ULL, 2074885000909672ULL, 2309839019263165ULL, 2087616209681024ULL, + 257214370719966ULL, 2331363508376581ULL, 1233124357504711ULL, 2849542202650296ULL, + 3790982825325736ULL, 13381453503890ULL, 1665246594531069ULL, 4165624287443904ULL, + 3418759698027493ULL, 2118493255117399ULL, 136249206366067ULL, 4064050233283309ULL, + 1368779887911300ULL, 4370550759530269ULL, 66992990631341ULL, 84442368922270ULL, + 2139322635321394ULL, 2076163483726795ULL, 657097866349103ULL, 2095579409488071ULL, + 226525774791341ULL, 4445744257665359ULL, 2035752839278107ULL, 1998242662838304ULL, + 1601548415521694ULL, 151297684296198ULL, 1350963039017303ULL, 2624916349548281ULL, + 2018863259670197ULL, 2717274357461290ULL, 94024796961533ULL, 711335520409111ULL, + 4322093765820263ULL, 2041650358174649ULL, 3439791603157577ULL, 179292018616267ULL, + 2436436921286669ULL, 3905268797208340ULL, 2829194895162985ULL, 1355175382191543ULL, + 55128779761539ULL, 2648428998786922ULL, 869805912573515ULL, 3706708942847864ULL, + 2785288916584667ULL, 37156862850147ULL, 1422245336293228ULL, 4497066058933021ULL, + 85588912978349ULL, 2616252221194611ULL, 53506393720989ULL, 3727539190732644ULL, + 872132446545237ULL, 933583590986077ULL, 3794591170581203ULL, 167875550514069ULL, + 2267466834993297ULL, 3072652681756816ULL, 2108499037430803ULL, 1606735192928366ULL, + 72339568815255ULL, 3258484260684219ULL, 3277927277719855ULL, 2459560373011535ULL, + 1672794293294033ULL, 227460934880669ULL, 3702454405413705ULL, 106168148441676ULL, + 1356617643071159ULL, 3280896569942762ULL, 142618711614302ULL, 4291782740862057ULL, + 4141020884874235ULL, 3720787221267125ULL, 552884940089351ULL, 174626154407180ULL, + 972071013326540ULL, 4458530419931903ULL, 4435168973822858ULL, 1902967548748411ULL, + 53007977605840ULL, 2453997334323925ULL, 3653077937283262ULL, 850660265046356ULL, + 312721924805450ULL, 268503679240683ULL, 256960167714122ULL, 1474492507858350ULL, + 2456345526438488ULL, 3686029507160255ULL, 279158933010398ULL, 3646946293948063ULL, + 704477527214036ULL, 3387744169891031ULL, 3772622670980241ULL, 136368897543304ULL, + 3744894052577607ULL, 1976007214443430ULL, 2090045379763451ULL, 968565474458988ULL, + 234295114806066ULL }; #if defined(__cplusplus) diff --git a/include/internal/Hacl_Poly1305_128.h b/include/internal/Hacl_MAC_Poly1305.h similarity index 77% rename from include/internal/Hacl_Poly1305_128.h rename to include/internal/Hacl_MAC_Poly1305.h index b9964714..29e1734a 100644 --- a/include/internal/Hacl_Poly1305_128.h +++ b/include/internal/Hacl_MAC_Poly1305.h @@ -23,8 +23,8 @@ */ -#ifndef __internal_Hacl_Poly1305_128_H -#define __internal_Hacl_Poly1305_128_H +#ifndef __internal_Hacl_MAC_Poly1305_H +#define __internal_Hacl_MAC_Poly1305_H #if defined(__cplusplus) extern "C" { @@ -35,21 +35,15 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -#include "../Hacl_Poly1305_128.h" -#include "libintvector.h" +#include "../Hacl_MAC_Poly1305.h" -void -Hacl_Impl_Poly1305_Field32xN_128_load_acc2(Lib_IntVector_Intrinsics_vec128 *acc, uint8_t *b); +void Hacl_MAC_Poly1305_poly1305_init(uint64_t *ctx, uint8_t *key); -void -Hacl_Impl_Poly1305_Field32xN_128_fmul_r2_normalize( - Lib_IntVector_Intrinsics_vec128 *out, - Lib_IntVector_Intrinsics_vec128 *p -); +void Hacl_MAC_Poly1305_poly1305_finish(uint8_t *tag, uint8_t *key, uint64_t *ctx); #if defined(__cplusplus) } #endif -#define __internal_Hacl_Poly1305_128_H_DEFINED +#define __internal_Hacl_MAC_Poly1305_H_DEFINED #endif diff --git a/include/msvc/internal/Hacl_Poly1305_128.h b/include/internal/Hacl_MAC_Poly1305_Simd128.h similarity index 73% rename from include/msvc/internal/Hacl_Poly1305_128.h rename to include/internal/Hacl_MAC_Poly1305_Simd128.h index b9964714..fe120e43 100644 --- a/include/msvc/internal/Hacl_Poly1305_128.h +++ b/include/internal/Hacl_MAC_Poly1305_Simd128.h @@ -23,8 +23,8 @@ */ -#ifndef __internal_Hacl_Poly1305_128_H -#define __internal_Hacl_Poly1305_128_H +#ifndef __internal_Hacl_MAC_Poly1305_Simd128_H +#define __internal_Hacl_MAC_Poly1305_Simd128_H #if defined(__cplusplus) extern "C" { @@ -35,21 +35,30 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -#include "../Hacl_Poly1305_128.h" +#include "../Hacl_MAC_Poly1305_Simd128.h" #include "libintvector.h" -void -Hacl_Impl_Poly1305_Field32xN_128_load_acc2(Lib_IntVector_Intrinsics_vec128 *acc, uint8_t *b); +void Hacl_MAC_Poly1305_Simd128_load_acc2(Lib_IntVector_Intrinsics_vec128 *acc, uint8_t *b); void -Hacl_Impl_Poly1305_Field32xN_128_fmul_r2_normalize( +Hacl_MAC_Poly1305_Simd128_fmul_r2_normalize( Lib_IntVector_Intrinsics_vec128 *out, Lib_IntVector_Intrinsics_vec128 *p ); +void +Hacl_MAC_Poly1305_Simd128_poly1305_init(Lib_IntVector_Intrinsics_vec128 *ctx, uint8_t *key); + +void +Hacl_MAC_Poly1305_Simd128_poly1305_finish( + uint8_t *tag, + uint8_t *key, + Lib_IntVector_Intrinsics_vec128 *ctx +); + #if defined(__cplusplus) } #endif -#define __internal_Hacl_Poly1305_128_H_DEFINED +#define __internal_Hacl_MAC_Poly1305_Simd128_H_DEFINED #endif diff --git a/include/msvc/internal/Hacl_Poly1305_256.h b/include/internal/Hacl_MAC_Poly1305_Simd256.h similarity index 73% rename from include/msvc/internal/Hacl_Poly1305_256.h rename to include/internal/Hacl_MAC_Poly1305_Simd256.h index 21d78b16..7bf106c1 100644 --- a/include/msvc/internal/Hacl_Poly1305_256.h +++ b/include/internal/Hacl_MAC_Poly1305_Simd256.h @@ -23,8 +23,8 @@ */ -#ifndef __internal_Hacl_Poly1305_256_H -#define __internal_Hacl_Poly1305_256_H +#ifndef __internal_Hacl_MAC_Poly1305_Simd256_H +#define __internal_Hacl_MAC_Poly1305_Simd256_H #if defined(__cplusplus) extern "C" { @@ -35,21 +35,30 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -#include "../Hacl_Poly1305_256.h" +#include "../Hacl_MAC_Poly1305_Simd256.h" #include "libintvector.h" -void -Hacl_Impl_Poly1305_Field32xN_256_load_acc4(Lib_IntVector_Intrinsics_vec256 *acc, uint8_t *b); +void Hacl_MAC_Poly1305_Simd256_load_acc4(Lib_IntVector_Intrinsics_vec256 *acc, uint8_t *b); void -Hacl_Impl_Poly1305_Field32xN_256_fmul_r4_normalize( +Hacl_MAC_Poly1305_Simd256_fmul_r4_normalize( Lib_IntVector_Intrinsics_vec256 *out, Lib_IntVector_Intrinsics_vec256 *p ); +void +Hacl_MAC_Poly1305_Simd256_poly1305_init(Lib_IntVector_Intrinsics_vec256 *ctx, uint8_t *key); + +void +Hacl_MAC_Poly1305_Simd256_poly1305_finish( + uint8_t *tag, + uint8_t *key, + Lib_IntVector_Intrinsics_vec256 *ctx +); + #if defined(__cplusplus) } #endif -#define __internal_Hacl_Poly1305_256_H_DEFINED +#define __internal_Hacl_MAC_Poly1305_Simd256_H_DEFINED #endif diff --git a/include/internal/Hacl_P256_PrecompTable.h b/include/internal/Hacl_P256_PrecompTable.h index f185c2be..c852ef8c 100644 --- a/include/internal/Hacl_P256_PrecompTable.h +++ b/include/internal/Hacl_P256_PrecompTable.h @@ -39,476 +39,360 @@ static const uint64_t Hacl_P256_PrecompTable_precomp_basepoint_table_w4[192U] = { - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, - (uint64_t)18446744069414584320U, (uint64_t)18446744073709551615U, (uint64_t)4294967294U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)8784043285714375740U, - (uint64_t)8483257759279461889U, (uint64_t)8789745728267363600U, (uint64_t)1770019616739251654U, - (uint64_t)15992936863339206154U, (uint64_t)10037038012062884956U, - (uint64_t)15197544864945402661U, (uint64_t)9615747158586711429U, (uint64_t)1U, - (uint64_t)18446744069414584320U, (uint64_t)18446744073709551615U, (uint64_t)4294967294U, - (uint64_t)10634854829044225757U, (uint64_t)351552716085025155U, (uint64_t)10645315080955407736U, - (uint64_t)3609262091244858135U, (uint64_t)15760741698986874125U, - (uint64_t)14936374388219697827U, (uint64_t)15751360096993017895U, - (uint64_t)18012233706239762398U, (uint64_t)1993877568177495041U, - (uint64_t)10345888787846536528U, (uint64_t)7746511691117935375U, - (uint64_t)14517043990409914413U, (uint64_t)14122549297570634151U, - (uint64_t)16934610359517083771U, (uint64_t)5724511325497097418U, (uint64_t)8983432969107448705U, - (uint64_t)2687429970334080245U, (uint64_t)16525396802810050288U, (uint64_t)7602596488871585854U, - (uint64_t)4813919589149203084U, (uint64_t)7680395813780804519U, (uint64_t)6687709583048023590U, - (uint64_t)18086445169104142027U, (uint64_t)9637814708330203929U, - (uint64_t)14785108459960679090U, (uint64_t)3838023279095023581U, (uint64_t)3555615526157830307U, - (uint64_t)5177066488380472871U, (uint64_t)18218186719108038403U, - (uint64_t)16281556341699656105U, (uint64_t)1524227924561461191U, (uint64_t)4148060517641909597U, - (uint64_t)2858290374115363433U, (uint64_t)8942772026334130620U, (uint64_t)3034451298319885113U, - (uint64_t)8447866036736640940U, (uint64_t)11204933433076256578U, - (uint64_t)18333595740249588297U, (uint64_t)8259597024804538246U, (uint64_t)9539734295777539786U, - (uint64_t)9797290423046626413U, (uint64_t)5777303437849646537U, (uint64_t)8739356909899132020U, - (uint64_t)14815960973766782158U, (uint64_t)15286581798204509801U, - (uint64_t)17597362577777019682U, (uint64_t)13259283710820519742U, - (uint64_t)10501322996899164670U, (uint64_t)1221138904338319642U, - (uint64_t)14586685489551951885U, (uint64_t)895326705426031212U, (uint64_t)14398171728560617847U, - (uint64_t)9592550823745097391U, (uint64_t)17240998489162206026U, (uint64_t)8085479283308189196U, - (uint64_t)14844657737893882826U, (uint64_t)15923425394150618234U, - (uint64_t)2997808084773249525U, (uint64_t)494323555453660587U, (uint64_t)1215695327517794764U, - (uint64_t)9476207381098391690U, (uint64_t)7480789678419122995U, (uint64_t)15212230329321082489U, - (uint64_t)436189395349576388U, (uint64_t)17377474396456660834U, (uint64_t)15237013929655017939U, - (uint64_t)11444428846883781676U, (uint64_t)5112749694521428575U, (uint64_t)950829367509872073U, - (uint64_t)17665036182057559519U, (uint64_t)17205133339690002313U, - (uint64_t)16233765170251334549U, (uint64_t)10122775683257972591U, - (uint64_t)3352514236455632420U, (uint64_t)9143148522359954691U, (uint64_t)601191684005658860U, - (uint64_t)13398772186646349998U, (uint64_t)15512696600132928431U, - (uint64_t)9128416073728948653U, (uint64_t)11233051033546138578U, (uint64_t)6769345682610122833U, - (uint64_t)10823233224575054288U, (uint64_t)9997725227559980175U, (uint64_t)6733425642852897415U, - (uint64_t)16302206918151466066U, (uint64_t)1669330822143265921U, (uint64_t)2661645605036546002U, - (uint64_t)17182558479745802165U, (uint64_t)1165082692376932040U, (uint64_t)9470595929011488359U, - (uint64_t)6142147329285324932U, (uint64_t)4829075085998111287U, (uint64_t)10231370681107338930U, - (uint64_t)9591876895322495239U, (uint64_t)10316468561384076618U, - (uint64_t)11592503647238064235U, (uint64_t)13395813606055179632U, (uint64_t)511127033980815508U, - (uint64_t)12434976573147649880U, (uint64_t)3425094795384359127U, (uint64_t)6816971736303023445U, - (uint64_t)15444670609021139344U, (uint64_t)9464349818322082360U, - (uint64_t)16178216413042376883U, (uint64_t)9595540370774317348U, (uint64_t)7229365182662875710U, - (uint64_t)4601177649460012843U, (uint64_t)5455046447382487090U, (uint64_t)10854066421606187521U, - (uint64_t)15913416821879788071U, (uint64_t)2297365362023460173U, (uint64_t)2603252216454941350U, - (uint64_t)6768791943870490934U, (uint64_t)15705936687122754810U, (uint64_t)9537096567546600694U, - (uint64_t)17580538144855035062U, (uint64_t)4496542856965746638U, (uint64_t)8444341625922124942U, - (uint64_t)12191263903636183168U, (uint64_t)17427332907535974165U, - (uint64_t)14307569739254103736U, (uint64_t)13900598742063266169U, - (uint64_t)7176996424355977650U, (uint64_t)5709008170379717479U, (uint64_t)14471312052264549092U, - (uint64_t)1464519909491759867U, (uint64_t)3328154641049602121U, (uint64_t)13020349337171136774U, - (uint64_t)2772166279972051938U, (uint64_t)10854476939425975292U, (uint64_t)1967189930534630940U, - (uint64_t)2802919076529341959U, (uint64_t)14792226094833519208U, - (uint64_t)14675640928566522177U, (uint64_t)14838974364643800837U, - (uint64_t)17631460696099549980U, (uint64_t)17434186275364935469U, - (uint64_t)2665648200587705473U, (uint64_t)13202122464492564051U, (uint64_t)7576287350918073341U, - (uint64_t)2272206013910186424U, (uint64_t)14558761641743937843U, (uint64_t)5675729149929979729U, - (uint64_t)9043135187561613166U, (uint64_t)11750149293830589225U, (uint64_t)740555197954307911U, - (uint64_t)9871738005087190699U, (uint64_t)17178667634283502053U, - (uint64_t)18046255991533013265U, (uint64_t)4458222096988430430U, (uint64_t)8452427758526311627U, - (uint64_t)13825286929656615266U, (uint64_t)13956286357198391218U, - (uint64_t)15875692916799995079U, (uint64_t)10634895319157013920U, - (uint64_t)13230116118036304207U, (uint64_t)8795317393614625606U, (uint64_t)7001710806858862020U, - (uint64_t)7949746088586183478U, (uint64_t)14677556044923602317U, - (uint64_t)11184023437485843904U, (uint64_t)11215864722023085094U, - (uint64_t)6444464081471519014U, (uint64_t)1706241174022415217U, (uint64_t)8243975633057550613U, - (uint64_t)15502902453836085864U, (uint64_t)3799182188594003953U, (uint64_t)3538840175098724094U + 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 18446744069414584320ULL, 18446744073709551615ULL, 4294967294ULL, + 0ULL, 0ULL, 0ULL, 0ULL, 8784043285714375740ULL, 8483257759279461889ULL, 8789745728267363600ULL, + 1770019616739251654ULL, 15992936863339206154ULL, 10037038012062884956ULL, + 15197544864945402661ULL, 9615747158586711429ULL, 1ULL, 18446744069414584320ULL, + 18446744073709551615ULL, 4294967294ULL, 10634854829044225757ULL, 351552716085025155ULL, + 10645315080955407736ULL, 3609262091244858135ULL, 15760741698986874125ULL, + 14936374388219697827ULL, 15751360096993017895ULL, 18012233706239762398ULL, + 1993877568177495041ULL, 10345888787846536528ULL, 7746511691117935375ULL, + 14517043990409914413ULL, 14122549297570634151ULL, 16934610359517083771ULL, + 5724511325497097418ULL, 8983432969107448705ULL, 2687429970334080245ULL, 16525396802810050288ULL, + 7602596488871585854ULL, 4813919589149203084ULL, 7680395813780804519ULL, 6687709583048023590ULL, + 18086445169104142027ULL, 9637814708330203929ULL, 14785108459960679090ULL, + 3838023279095023581ULL, 3555615526157830307ULL, 5177066488380472871ULL, 18218186719108038403ULL, + 16281556341699656105ULL, 1524227924561461191ULL, 4148060517641909597ULL, 2858290374115363433ULL, + 8942772026334130620ULL, 3034451298319885113ULL, 8447866036736640940ULL, 11204933433076256578ULL, + 18333595740249588297ULL, 8259597024804538246ULL, 9539734295777539786ULL, 9797290423046626413ULL, + 5777303437849646537ULL, 8739356909899132020ULL, 14815960973766782158ULL, + 15286581798204509801ULL, 17597362577777019682ULL, 13259283710820519742ULL, + 10501322996899164670ULL, 1221138904338319642ULL, 14586685489551951885ULL, 895326705426031212ULL, + 14398171728560617847ULL, 9592550823745097391ULL, 17240998489162206026ULL, + 8085479283308189196ULL, 14844657737893882826ULL, 15923425394150618234ULL, + 2997808084773249525ULL, 494323555453660587ULL, 1215695327517794764ULL, 9476207381098391690ULL, + 7480789678419122995ULL, 15212230329321082489ULL, 436189395349576388ULL, 17377474396456660834ULL, + 15237013929655017939ULL, 11444428846883781676ULL, 5112749694521428575ULL, 950829367509872073ULL, + 17665036182057559519ULL, 17205133339690002313ULL, 16233765170251334549ULL, + 10122775683257972591ULL, 3352514236455632420ULL, 9143148522359954691ULL, 601191684005658860ULL, + 13398772186646349998ULL, 15512696600132928431ULL, 9128416073728948653ULL, + 11233051033546138578ULL, 6769345682610122833ULL, 10823233224575054288ULL, + 9997725227559980175ULL, 6733425642852897415ULL, 16302206918151466066ULL, 1669330822143265921ULL, + 2661645605036546002ULL, 17182558479745802165ULL, 1165082692376932040ULL, 9470595929011488359ULL, + 6142147329285324932ULL, 4829075085998111287ULL, 10231370681107338930ULL, 9591876895322495239ULL, + 10316468561384076618ULL, 11592503647238064235ULL, 13395813606055179632ULL, + 511127033980815508ULL, 12434976573147649880ULL, 3425094795384359127ULL, 6816971736303023445ULL, + 15444670609021139344ULL, 9464349818322082360ULL, 16178216413042376883ULL, + 9595540370774317348ULL, 7229365182662875710ULL, 4601177649460012843ULL, 5455046447382487090ULL, + 10854066421606187521ULL, 15913416821879788071ULL, 2297365362023460173ULL, + 2603252216454941350ULL, 6768791943870490934ULL, 15705936687122754810ULL, 9537096567546600694ULL, + 17580538144855035062ULL, 4496542856965746638ULL, 8444341625922124942ULL, + 12191263903636183168ULL, 17427332907535974165ULL, 14307569739254103736ULL, + 13900598742063266169ULL, 7176996424355977650ULL, 5709008170379717479ULL, + 14471312052264549092ULL, 1464519909491759867ULL, 3328154641049602121ULL, + 13020349337171136774ULL, 2772166279972051938ULL, 10854476939425975292ULL, + 1967189930534630940ULL, 2802919076529341959ULL, 14792226094833519208ULL, + 14675640928566522177ULL, 14838974364643800837ULL, 17631460696099549980ULL, + 17434186275364935469ULL, 2665648200587705473ULL, 13202122464492564051ULL, + 7576287350918073341ULL, 2272206013910186424ULL, 14558761641743937843ULL, 5675729149929979729ULL, + 9043135187561613166ULL, 11750149293830589225ULL, 740555197954307911ULL, 9871738005087190699ULL, + 17178667634283502053ULL, 18046255991533013265ULL, 4458222096988430430ULL, + 8452427758526311627ULL, 13825286929656615266ULL, 13956286357198391218ULL, + 15875692916799995079ULL, 10634895319157013920ULL, 13230116118036304207ULL, + 8795317393614625606ULL, 7001710806858862020ULL, 7949746088586183478ULL, 14677556044923602317ULL, + 11184023437485843904ULL, 11215864722023085094ULL, 6444464081471519014ULL, + 1706241174022415217ULL, 8243975633057550613ULL, 15502902453836085864ULL, 3799182188594003953ULL, + 3538840175098724094ULL }; static const uint64_t Hacl_P256_PrecompTable_precomp_g_pow2_64_table_w4[192U] = { - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, - (uint64_t)18446744069414584320U, (uint64_t)18446744073709551615U, (uint64_t)4294967294U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1499621593102562565U, - (uint64_t)16692369783039433128U, (uint64_t)15337520135922861848U, - (uint64_t)5455737214495366228U, (uint64_t)17827017231032529600U, - (uint64_t)12413621606240782649U, (uint64_t)2290483008028286132U, - (uint64_t)15752017553340844820U, (uint64_t)4846430910634234874U, - (uint64_t)10861682798464583253U, (uint64_t)15404737222404363049U, (uint64_t)363586619281562022U, - (uint64_t)9866710912401645115U, (uint64_t)1162548847543228595U, (uint64_t)7649967190445130486U, - (uint64_t)5212340432230915749U, (uint64_t)7572620550182916491U, (uint64_t)14876145112448665096U, - (uint64_t)2063227348838176167U, (uint64_t)3519435548295415847U, (uint64_t)8390400282019023103U, - (uint64_t)17666843593163037841U, (uint64_t)9450204148816496323U, (uint64_t)8483374507652916768U, - (uint64_t)6254661047265818424U, (uint64_t)16382127809582285023U, (uint64_t)125359443771153172U, - (uint64_t)1374336701588437897U, (uint64_t)11362596098420127726U, (uint64_t)2101654420738681387U, - (uint64_t)12772780342444840510U, (uint64_t)12546934328908550060U, - (uint64_t)8331880412333790397U, (uint64_t)11687262051473819904U, (uint64_t)8926848496503457587U, - (uint64_t)9603974142010467857U, (uint64_t)13199952163826973175U, (uint64_t)2189856264898797734U, - (uint64_t)11356074861870267226U, (uint64_t)2027714896422561895U, (uint64_t)5261606367808050149U, - (uint64_t)153855954337762312U, (uint64_t)6375919692894573986U, (uint64_t)12364041207536146533U, - (uint64_t)1891896010455057160U, (uint64_t)1568123795087313171U, (uint64_t)18138710056556660101U, - (uint64_t)6004886947510047736U, (uint64_t)4811859325589542932U, (uint64_t)3618763430148954981U, - (uint64_t)11434521746258554122U, (uint64_t)10086341535864049427U, - (uint64_t)8073421629570399570U, (uint64_t)12680586148814729338U, (uint64_t)9619958020761569612U, - (uint64_t)15827203580658384478U, (uint64_t)12832694810937550406U, - (uint64_t)14977975484447400910U, (uint64_t)5478002389061063653U, - (uint64_t)14731136312639060880U, (uint64_t)4317867687275472033U, (uint64_t)6642650962855259884U, - (uint64_t)2514254944289495285U, (uint64_t)14231405641534478436U, (uint64_t)4045448346091518946U, - (uint64_t)8985477013445972471U, (uint64_t)8869039454457032149U, (uint64_t)4356978486208692970U, - (uint64_t)10805288613335538577U, (uint64_t)12832353127812502042U, - (uint64_t)4576590051676547490U, (uint64_t)6728053735138655107U, (uint64_t)17814206719173206184U, - (uint64_t)79790138573994940U, (uint64_t)17920293215101822267U, (uint64_t)13422026625585728864U, - (uint64_t)5018058010492547271U, (uint64_t)110232326023384102U, (uint64_t)10834264070056942976U, - (uint64_t)15222249086119088588U, (uint64_t)15119439519142044997U, - (uint64_t)11655511970063167313U, (uint64_t)1614477029450566107U, (uint64_t)3619322817271059794U, - (uint64_t)9352862040415412867U, (uint64_t)14017522553242747074U, - (uint64_t)13138513643674040327U, (uint64_t)3610195242889455765U, (uint64_t)8371069193996567291U, - (uint64_t)12670227996544662654U, (uint64_t)1205961025092146303U, - (uint64_t)13106709934003962112U, (uint64_t)4350113471327723407U, - (uint64_t)15060941403739680459U, (uint64_t)13639127647823205030U, - (uint64_t)10790943339357725715U, (uint64_t)498760574280648264U, (uint64_t)17922071907832082887U, - (uint64_t)15122670976670152145U, (uint64_t)6275027991110214322U, (uint64_t)7250912847491816402U, - (uint64_t)15206617260142982380U, (uint64_t)3385668313694152877U, - (uint64_t)17522479771766801905U, (uint64_t)2965919117476170655U, (uint64_t)1553238516603269404U, - (uint64_t)5820770015631050991U, (uint64_t)4999445222232605348U, (uint64_t)9245650860833717444U, - (uint64_t)1508811811724230728U, (uint64_t)5190684913765614385U, (uint64_t)15692927070934536166U, - (uint64_t)12981978499190500902U, (uint64_t)5143491963193394698U, (uint64_t)7705698092144084129U, - (uint64_t)581120653055084783U, (uint64_t)13886552864486459714U, (uint64_t)6290301270652587255U, - (uint64_t)8663431529954393128U, (uint64_t)17033405846475472443U, (uint64_t)5206780355442651635U, - (uint64_t)12580364474736467688U, (uint64_t)17934601912005283310U, - (uint64_t)15119491731028933652U, (uint64_t)17848231399859044858U, - (uint64_t)4427673319524919329U, (uint64_t)2673607337074368008U, (uint64_t)14034876464294699949U, - (uint64_t)10938948975420813697U, (uint64_t)15202340615298669183U, - (uint64_t)5496603454069431071U, (uint64_t)2486526142064906845U, (uint64_t)4507882119510526802U, - (uint64_t)13888151172411390059U, (uint64_t)15049027856908071726U, - (uint64_t)9667231543181973158U, (uint64_t)6406671575277563202U, (uint64_t)3395801050331215139U, - (uint64_t)9813607433539108308U, (uint64_t)2681417728820980381U, (uint64_t)18407064643927113994U, - (uint64_t)7707177692113485527U, (uint64_t)14218149384635317074U, (uint64_t)3658668346206375919U, - (uint64_t)15404713991002362166U, (uint64_t)10152074687696195207U, - (uint64_t)10926946599582128139U, (uint64_t)16907298600007085320U, - (uint64_t)16544287219664720279U, (uint64_t)11007075933432813205U, - (uint64_t)8652245965145713599U, (uint64_t)7857626748965990384U, (uint64_t)5602306604520095870U, - (uint64_t)2525139243938658618U, (uint64_t)14405696176872077447U, - (uint64_t)18432270482137885332U, (uint64_t)9913880809120071177U, - (uint64_t)16896141737831216972U, (uint64_t)7484791498211214829U, - (uint64_t)15635259968266497469U, (uint64_t)8495118537612215624U, (uint64_t)4915477980562575356U, - (uint64_t)16453519279754924350U, (uint64_t)14462108244565406969U, - (uint64_t)14837837755237096687U, (uint64_t)14130171078892575346U, - (uint64_t)15423793222528491497U, (uint64_t)5460399262075036084U, - (uint64_t)16085440580308415349U, (uint64_t)26873200736954488U, (uint64_t)5603655807457499550U, - (uint64_t)3342202915871129617U, (uint64_t)1604413932150236626U, (uint64_t)9684226585089458974U, - (uint64_t)1213229904006618539U, (uint64_t)6782978662408837236U, (uint64_t)11197029877749307372U, - (uint64_t)14085968786551657744U, (uint64_t)17352273610494009342U, - (uint64_t)7876582961192434984U + 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 18446744069414584320ULL, 18446744073709551615ULL, 4294967294ULL, + 0ULL, 0ULL, 0ULL, 0ULL, 1499621593102562565ULL, 16692369783039433128ULL, + 15337520135922861848ULL, 5455737214495366228ULL, 17827017231032529600ULL, + 12413621606240782649ULL, 2290483008028286132ULL, 15752017553340844820ULL, + 4846430910634234874ULL, 10861682798464583253ULL, 15404737222404363049ULL, 363586619281562022ULL, + 9866710912401645115ULL, 1162548847543228595ULL, 7649967190445130486ULL, 5212340432230915749ULL, + 7572620550182916491ULL, 14876145112448665096ULL, 2063227348838176167ULL, 3519435548295415847ULL, + 8390400282019023103ULL, 17666843593163037841ULL, 9450204148816496323ULL, 8483374507652916768ULL, + 6254661047265818424ULL, 16382127809582285023ULL, 125359443771153172ULL, 1374336701588437897ULL, + 11362596098420127726ULL, 2101654420738681387ULL, 12772780342444840510ULL, + 12546934328908550060ULL, 8331880412333790397ULL, 11687262051473819904ULL, + 8926848496503457587ULL, 9603974142010467857ULL, 13199952163826973175ULL, 2189856264898797734ULL, + 11356074861870267226ULL, 2027714896422561895ULL, 5261606367808050149ULL, 153855954337762312ULL, + 6375919692894573986ULL, 12364041207536146533ULL, 1891896010455057160ULL, 1568123795087313171ULL, + 18138710056556660101ULL, 6004886947510047736ULL, 4811859325589542932ULL, 3618763430148954981ULL, + 11434521746258554122ULL, 10086341535864049427ULL, 8073421629570399570ULL, + 12680586148814729338ULL, 9619958020761569612ULL, 15827203580658384478ULL, + 12832694810937550406ULL, 14977975484447400910ULL, 5478002389061063653ULL, + 14731136312639060880ULL, 4317867687275472033ULL, 6642650962855259884ULL, 2514254944289495285ULL, + 14231405641534478436ULL, 4045448346091518946ULL, 8985477013445972471ULL, 8869039454457032149ULL, + 4356978486208692970ULL, 10805288613335538577ULL, 12832353127812502042ULL, + 4576590051676547490ULL, 6728053735138655107ULL, 17814206719173206184ULL, 79790138573994940ULL, + 17920293215101822267ULL, 13422026625585728864ULL, 5018058010492547271ULL, 110232326023384102ULL, + 10834264070056942976ULL, 15222249086119088588ULL, 15119439519142044997ULL, + 11655511970063167313ULL, 1614477029450566107ULL, 3619322817271059794ULL, 9352862040415412867ULL, + 14017522553242747074ULL, 13138513643674040327ULL, 3610195242889455765ULL, + 8371069193996567291ULL, 12670227996544662654ULL, 1205961025092146303ULL, + 13106709934003962112ULL, 4350113471327723407ULL, 15060941403739680459ULL, + 13639127647823205030ULL, 10790943339357725715ULL, 498760574280648264ULL, + 17922071907832082887ULL, 15122670976670152145ULL, 6275027991110214322ULL, + 7250912847491816402ULL, 15206617260142982380ULL, 3385668313694152877ULL, + 17522479771766801905ULL, 2965919117476170655ULL, 1553238516603269404ULL, 5820770015631050991ULL, + 4999445222232605348ULL, 9245650860833717444ULL, 1508811811724230728ULL, 5190684913765614385ULL, + 15692927070934536166ULL, 12981978499190500902ULL, 5143491963193394698ULL, + 7705698092144084129ULL, 581120653055084783ULL, 13886552864486459714ULL, 6290301270652587255ULL, + 8663431529954393128ULL, 17033405846475472443ULL, 5206780355442651635ULL, + 12580364474736467688ULL, 17934601912005283310ULL, 15119491731028933652ULL, + 17848231399859044858ULL, 4427673319524919329ULL, 2673607337074368008ULL, + 14034876464294699949ULL, 10938948975420813697ULL, 15202340615298669183ULL, + 5496603454069431071ULL, 2486526142064906845ULL, 4507882119510526802ULL, 13888151172411390059ULL, + 15049027856908071726ULL, 9667231543181973158ULL, 6406671575277563202ULL, 3395801050331215139ULL, + 9813607433539108308ULL, 2681417728820980381ULL, 18407064643927113994ULL, 7707177692113485527ULL, + 14218149384635317074ULL, 3658668346206375919ULL, 15404713991002362166ULL, + 10152074687696195207ULL, 10926946599582128139ULL, 16907298600007085320ULL, + 16544287219664720279ULL, 11007075933432813205ULL, 8652245965145713599ULL, + 7857626748965990384ULL, 5602306604520095870ULL, 2525139243938658618ULL, 14405696176872077447ULL, + 18432270482137885332ULL, 9913880809120071177ULL, 16896141737831216972ULL, + 7484791498211214829ULL, 15635259968266497469ULL, 8495118537612215624ULL, 4915477980562575356ULL, + 16453519279754924350ULL, 14462108244565406969ULL, 14837837755237096687ULL, + 14130171078892575346ULL, 15423793222528491497ULL, 5460399262075036084ULL, + 16085440580308415349ULL, 26873200736954488ULL, 5603655807457499550ULL, 3342202915871129617ULL, + 1604413932150236626ULL, 9684226585089458974ULL, 1213229904006618539ULL, 6782978662408837236ULL, + 11197029877749307372ULL, 14085968786551657744ULL, 17352273610494009342ULL, + 7876582961192434984ULL }; static const uint64_t Hacl_P256_PrecompTable_precomp_g_pow2_128_table_w4[192U] = { - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, - (uint64_t)18446744069414584320U, (uint64_t)18446744073709551615U, (uint64_t)4294967294U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)14619254753077084366U, - (uint64_t)13913835116514008593U, (uint64_t)15060744674088488145U, - (uint64_t)17668414598203068685U, (uint64_t)10761169236902342334U, - (uint64_t)15467027479157446221U, (uint64_t)14989185522423469618U, - (uint64_t)14354539272510107003U, (uint64_t)14298211796392133693U, - (uint64_t)13270323784253711450U, (uint64_t)13380964971965046957U, - (uint64_t)8686204248456909699U, (uint64_t)17434630286744937066U, (uint64_t)1355903775279084720U, - (uint64_t)7554695053550308662U, (uint64_t)11354971222741863570U, (uint64_t)564601613420749879U, - (uint64_t)8466325837259054896U, (uint64_t)10752965181772434263U, - (uint64_t)11405876547368426319U, (uint64_t)13791894568738930940U, - (uint64_t)8230587134406354675U, (uint64_t)12415514098722758608U, - (uint64_t)18414183046995786744U, (uint64_t)15508000368227372870U, - (uint64_t)5781062464627999307U, (uint64_t)15339429052219195590U, - (uint64_t)16038703753810741903U, (uint64_t)9587718938298980714U, (uint64_t)4822658817952386407U, - (uint64_t)1376351024833260660U, (uint64_t)1120174910554766702U, (uint64_t)1730170933262569274U, - (uint64_t)5187428548444533500U, (uint64_t)16242053503368957131U, (uint64_t)3036811119519868279U, - (uint64_t)1760267587958926638U, (uint64_t)170244572981065185U, (uint64_t)8063080791967388171U, - (uint64_t)4824892826607692737U, (uint64_t)16286391083472040552U, - (uint64_t)11945158615253358747U, (uint64_t)14096887760410224200U, - (uint64_t)1613720831904557039U, (uint64_t)14316966673761197523U, - (uint64_t)17411006201485445341U, (uint64_t)8112301506943158801U, (uint64_t)2069889233927989984U, - (uint64_t)10082848378277483927U, (uint64_t)3609691194454404430U, (uint64_t)6110437205371933689U, - (uint64_t)9769135977342231601U, (uint64_t)11977962151783386478U, - (uint64_t)18088718692559983573U, (uint64_t)11741637975753055U, (uint64_t)11110390325701582190U, - (uint64_t)1341402251566067019U, (uint64_t)3028229550849726478U, (uint64_t)10438984083997451310U, - (uint64_t)12730851885100145709U, (uint64_t)11524169532089894189U, - (uint64_t)4523375903229602674U, (uint64_t)2028602258037385622U, (uint64_t)17082839063089388410U, - (uint64_t)6103921364634113167U, (uint64_t)17066180888225306102U, - (uint64_t)11395680486707876195U, (uint64_t)10952892272443345484U, - (uint64_t)8792831960605859401U, (uint64_t)14194485427742325139U, - (uint64_t)15146020821144305250U, (uint64_t)1654766014957123343U, (uint64_t)7955526243090948551U, - (uint64_t)3989277566080493308U, (uint64_t)12229385116397931231U, - (uint64_t)13430548930727025562U, (uint64_t)3434892688179800602U, (uint64_t)8431998794645622027U, - (uint64_t)12132530981596299272U, (uint64_t)2289461608863966999U, - (uint64_t)18345870950201487179U, (uint64_t)13517947207801901576U, - (uint64_t)5213113244172561159U, (uint64_t)17632986594098340879U, (uint64_t)4405251818133148856U, - (uint64_t)11783009269435447793U, (uint64_t)9332138983770046035U, - (uint64_t)12863411548922539505U, (uint64_t)3717030292816178224U, - (uint64_t)10026078446427137374U, (uint64_t)11167295326594317220U, - (uint64_t)12425328773141588668U, (uint64_t)5760335125172049352U, (uint64_t)9016843701117277863U, - (uint64_t)5657892835694680172U, (uint64_t)11025130589305387464U, (uint64_t)1368484957977406173U, - (uint64_t)17361351345281258834U, (uint64_t)1907113641956152700U, - (uint64_t)16439233413531427752U, (uint64_t)5893322296986588932U, - (uint64_t)14000206906171746627U, (uint64_t)14979266987545792900U, - (uint64_t)6926291766898221120U, (uint64_t)7162023296083360752U, (uint64_t)14762747553625382529U, - (uint64_t)12610831658612406849U, (uint64_t)10462926899548715515U, - (uint64_t)4794017723140405312U, (uint64_t)5234438200490163319U, (uint64_t)8019519110339576320U, - (uint64_t)7194604241290530100U, (uint64_t)12626770134810813246U, - (uint64_t)10793074474236419890U, (uint64_t)11323224347913978783U, - (uint64_t)16831128015895380245U, (uint64_t)18323094195124693378U, - (uint64_t)2361097165281567692U, (uint64_t)15755578675014279498U, - (uint64_t)14289876470325854580U, (uint64_t)12856787656093616839U, - (uint64_t)3578928531243900594U, (uint64_t)3847532758790503699U, (uint64_t)8377953190224748743U, - (uint64_t)3314546646092744596U, (uint64_t)800810188859334358U, (uint64_t)4626344124229343596U, - (uint64_t)6620381605850876621U, (uint64_t)11422073570955989527U, - (uint64_t)12676813626484814469U, (uint64_t)16725029886764122240U, - (uint64_t)16648497372773830008U, (uint64_t)9135702594931291048U, - (uint64_t)16080949688826680333U, (uint64_t)11528096561346602947U, - (uint64_t)2632498067099740984U, (uint64_t)11583842699108800714U, (uint64_t)8378404864573610526U, - (uint64_t)1076560261627788534U, (uint64_t)13836015994325032828U, - (uint64_t)11234295937817067909U, (uint64_t)5893659808396722708U, - (uint64_t)11277421142886984364U, (uint64_t)8968549037166726491U, - (uint64_t)14841374331394032822U, (uint64_t)9967344773947889341U, (uint64_t)8799244393578496085U, - (uint64_t)5094686877301601410U, (uint64_t)8780316747074726862U, (uint64_t)9119697306829835718U, - (uint64_t)15381243327921855368U, (uint64_t)2686250164449435196U, - (uint64_t)16466917280442198358U, (uint64_t)13791704489163125216U, - (uint64_t)16955859337117924272U, (uint64_t)17112836394923783642U, - (uint64_t)4639176427338618063U, (uint64_t)16770029310141094964U, - (uint64_t)11049953922966416185U, (uint64_t)12012669590884098968U, - (uint64_t)4859326885929417214U, (uint64_t)896380084392586061U, (uint64_t)7153028362977034008U, - (uint64_t)10540021163316263301U, (uint64_t)9318277998512936585U, - (uint64_t)18344496977694796523U, (uint64_t)11374737400567645494U, - (uint64_t)17158800051138212954U, (uint64_t)18343197867863253153U, - (uint64_t)18204799297967861226U, (uint64_t)15798973531606348828U, - (uint64_t)9870158263408310459U, (uint64_t)17578869832774612627U, (uint64_t)8395748875822696932U, - (uint64_t)15310679007370670872U, (uint64_t)11205576736030808860U, - (uint64_t)10123429210002838967U, (uint64_t)5910544144088393959U, - (uint64_t)14016615653353687369U, (uint64_t)11191676704772957822U + 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 18446744069414584320ULL, 18446744073709551615ULL, 4294967294ULL, + 0ULL, 0ULL, 0ULL, 0ULL, 14619254753077084366ULL, 13913835116514008593ULL, + 15060744674088488145ULL, 17668414598203068685ULL, 10761169236902342334ULL, + 15467027479157446221ULL, 14989185522423469618ULL, 14354539272510107003ULL, + 14298211796392133693ULL, 13270323784253711450ULL, 13380964971965046957ULL, + 8686204248456909699ULL, 17434630286744937066ULL, 1355903775279084720ULL, 7554695053550308662ULL, + 11354971222741863570ULL, 564601613420749879ULL, 8466325837259054896ULL, 10752965181772434263ULL, + 11405876547368426319ULL, 13791894568738930940ULL, 8230587134406354675ULL, + 12415514098722758608ULL, 18414183046995786744ULL, 15508000368227372870ULL, + 5781062464627999307ULL, 15339429052219195590ULL, 16038703753810741903ULL, + 9587718938298980714ULL, 4822658817952386407ULL, 1376351024833260660ULL, 1120174910554766702ULL, + 1730170933262569274ULL, 5187428548444533500ULL, 16242053503368957131ULL, 3036811119519868279ULL, + 1760267587958926638ULL, 170244572981065185ULL, 8063080791967388171ULL, 4824892826607692737ULL, + 16286391083472040552ULL, 11945158615253358747ULL, 14096887760410224200ULL, + 1613720831904557039ULL, 14316966673761197523ULL, 17411006201485445341ULL, + 8112301506943158801ULL, 2069889233927989984ULL, 10082848378277483927ULL, 3609691194454404430ULL, + 6110437205371933689ULL, 9769135977342231601ULL, 11977962151783386478ULL, + 18088718692559983573ULL, 11741637975753055ULL, 11110390325701582190ULL, 1341402251566067019ULL, + 3028229550849726478ULL, 10438984083997451310ULL, 12730851885100145709ULL, + 11524169532089894189ULL, 4523375903229602674ULL, 2028602258037385622ULL, + 17082839063089388410ULL, 6103921364634113167ULL, 17066180888225306102ULL, + 11395680486707876195ULL, 10952892272443345484ULL, 8792831960605859401ULL, + 14194485427742325139ULL, 15146020821144305250ULL, 1654766014957123343ULL, + 7955526243090948551ULL, 3989277566080493308ULL, 12229385116397931231ULL, + 13430548930727025562ULL, 3434892688179800602ULL, 8431998794645622027ULL, + 12132530981596299272ULL, 2289461608863966999ULL, 18345870950201487179ULL, + 13517947207801901576ULL, 5213113244172561159ULL, 17632986594098340879ULL, + 4405251818133148856ULL, 11783009269435447793ULL, 9332138983770046035ULL, + 12863411548922539505ULL, 3717030292816178224ULL, 10026078446427137374ULL, + 11167295326594317220ULL, 12425328773141588668ULL, 5760335125172049352ULL, + 9016843701117277863ULL, 5657892835694680172ULL, 11025130589305387464ULL, 1368484957977406173ULL, + 17361351345281258834ULL, 1907113641956152700ULL, 16439233413531427752ULL, + 5893322296986588932ULL, 14000206906171746627ULL, 14979266987545792900ULL, + 6926291766898221120ULL, 7162023296083360752ULL, 14762747553625382529ULL, + 12610831658612406849ULL, 10462926899548715515ULL, 4794017723140405312ULL, + 5234438200490163319ULL, 8019519110339576320ULL, 7194604241290530100ULL, 12626770134810813246ULL, + 10793074474236419890ULL, 11323224347913978783ULL, 16831128015895380245ULL, + 18323094195124693378ULL, 2361097165281567692ULL, 15755578675014279498ULL, + 14289876470325854580ULL, 12856787656093616839ULL, 3578928531243900594ULL, + 3847532758790503699ULL, 8377953190224748743ULL, 3314546646092744596ULL, 800810188859334358ULL, + 4626344124229343596ULL, 6620381605850876621ULL, 11422073570955989527ULL, + 12676813626484814469ULL, 16725029886764122240ULL, 16648497372773830008ULL, + 9135702594931291048ULL, 16080949688826680333ULL, 11528096561346602947ULL, + 2632498067099740984ULL, 11583842699108800714ULL, 8378404864573610526ULL, 1076560261627788534ULL, + 13836015994325032828ULL, 11234295937817067909ULL, 5893659808396722708ULL, + 11277421142886984364ULL, 8968549037166726491ULL, 14841374331394032822ULL, + 9967344773947889341ULL, 8799244393578496085ULL, 5094686877301601410ULL, 8780316747074726862ULL, + 9119697306829835718ULL, 15381243327921855368ULL, 2686250164449435196ULL, + 16466917280442198358ULL, 13791704489163125216ULL, 16955859337117924272ULL, + 17112836394923783642ULL, 4639176427338618063ULL, 16770029310141094964ULL, + 11049953922966416185ULL, 12012669590884098968ULL, 4859326885929417214ULL, 896380084392586061ULL, + 7153028362977034008ULL, 10540021163316263301ULL, 9318277998512936585ULL, + 18344496977694796523ULL, 11374737400567645494ULL, 17158800051138212954ULL, + 18343197867863253153ULL, 18204799297967861226ULL, 15798973531606348828ULL, + 9870158263408310459ULL, 17578869832774612627ULL, 8395748875822696932ULL, + 15310679007370670872ULL, 11205576736030808860ULL, 10123429210002838967ULL, + 5910544144088393959ULL, 14016615653353687369ULL, 11191676704772957822ULL }; static const uint64_t Hacl_P256_PrecompTable_precomp_g_pow2_192_table_w4[192U] = { - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, - (uint64_t)18446744069414584320U, (uint64_t)18446744073709551615U, (uint64_t)4294967294U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)7870395003430845958U, - (uint64_t)18001862936410067720U, (uint64_t)8006461232116967215U, (uint64_t)5921313779532424762U, - (uint64_t)10702113371959864307U, (uint64_t)8070517410642379879U, (uint64_t)7139806720777708306U, - (uint64_t)8253938546650739833U, (uint64_t)17490482834545705718U, (uint64_t)1065249776797037500U, - (uint64_t)5018258455937968775U, (uint64_t)14100621120178668337U, (uint64_t)8392845221328116213U, - (uint64_t)14630296398338540788U, (uint64_t)4268947906723414372U, (uint64_t)9231207002243517909U, - (uint64_t)14261219637616504262U, (uint64_t)7786881626982345356U, - (uint64_t)11412720751765882139U, (uint64_t)14119585051365330009U, - (uint64_t)15281626286521302128U, (uint64_t)6350171933454266732U, - (uint64_t)16559468304937127866U, (uint64_t)13200760478271693417U, - (uint64_t)6733381546280350776U, (uint64_t)3801404890075189193U, (uint64_t)2741036364686993903U, - (uint64_t)3218612940540174008U, (uint64_t)10894914335165419505U, - (uint64_t)11862941430149998362U, (uint64_t)4223151729402839584U, (uint64_t)2913215088487087887U, - (uint64_t)14562168920104952953U, (uint64_t)2170089393468287453U, - (uint64_t)10520900655016579352U, (uint64_t)7040362608949989273U, (uint64_t)8376510559381705307U, - (uint64_t)9142237200448131532U, (uint64_t)5696859948123854080U, (uint64_t)925422306716081180U, - (uint64_t)11155545953469186421U, (uint64_t)1888208646862572812U, - (uint64_t)11151095998248845721U, (uint64_t)15793503271680275267U, - (uint64_t)7729877044494854851U, (uint64_t)6235134673193032913U, (uint64_t)7364280682182401564U, - (uint64_t)5479679373325519985U, (uint64_t)17966037684582301763U, - (uint64_t)14140891609330279185U, (uint64_t)5814744449740463867U, (uint64_t)5652588426712591652U, - (uint64_t)774745682988690912U, (uint64_t)13228255573220500373U, (uint64_t)11949122068786859397U, - (uint64_t)8021166392900770376U, (uint64_t)7994323710948720063U, (uint64_t)9924618472877849977U, - (uint64_t)17618517523141194266U, (uint64_t)2750424097794401714U, - (uint64_t)15481749570715253207U, (uint64_t)14646964509921760497U, - (uint64_t)1037442848094301355U, (uint64_t)6295995947389299132U, (uint64_t)16915049722317579514U, - (uint64_t)10493877400992990313U, (uint64_t)18391008753060553521U, (uint64_t)483942209623707598U, - (uint64_t)2017775662838016613U, (uint64_t)5933251998459363553U, (uint64_t)11789135019970707407U, - (uint64_t)5484123723153268336U, (uint64_t)13246954648848484954U, (uint64_t)4774374393926023505U, - (uint64_t)14863995618704457336U, (uint64_t)13220153167104973625U, - (uint64_t)5988445485312390826U, (uint64_t)17580359464028944682U, (uint64_t)7297100131969874771U, - (uint64_t)379931507867989375U, (uint64_t)10927113096513421444U, (uint64_t)17688881974428340857U, - (uint64_t)4259872578781463333U, (uint64_t)8573076295966784472U, (uint64_t)16389829450727275032U, - (uint64_t)1667243868963568259U, (uint64_t)17730726848925960919U, - (uint64_t)11408899874569778008U, (uint64_t)3576527582023272268U, - (uint64_t)16492920640224231656U, (uint64_t)7906130545972460130U, - (uint64_t)13878604278207681266U, (uint64_t)41446695125652041U, (uint64_t)8891615271337333503U, - (uint64_t)2594537723613594470U, (uint64_t)7699579176995770924U, (uint64_t)147458463055730655U, - (uint64_t)12120406862739088406U, (uint64_t)12044892493010567063U, - (uint64_t)8554076749615475136U, (uint64_t)1005097692260929999U, (uint64_t)2687202654471188715U, - (uint64_t)9457588752176879209U, (uint64_t)17472884880062444019U, (uint64_t)9792097892056020166U, - (uint64_t)2525246678512797150U, (uint64_t)15958903035313115662U, - (uint64_t)11336038170342247032U, (uint64_t)11560342382835141123U, - (uint64_t)6212009033479929024U, (uint64_t)8214308203775021229U, (uint64_t)8475469210070503698U, - (uint64_t)13287024123485719563U, (uint64_t)12956951963817520723U, - (uint64_t)10693035819908470465U, (uint64_t)11375478788224786725U, - (uint64_t)16934625208487120398U, (uint64_t)10094585729115874495U, - (uint64_t)2763884524395905776U, (uint64_t)13535890148969964883U, - (uint64_t)13514657411765064358U, (uint64_t)9903074440788027562U, - (uint64_t)17324720726421199990U, (uint64_t)2273931039117368789U, (uint64_t)3442641041506157854U, - (uint64_t)1119853641236409612U, (uint64_t)12037070344296077989U, (uint64_t)581736433335671746U, - (uint64_t)6019150647054369174U, (uint64_t)14864096138068789375U, (uint64_t)6652995210998318662U, - (uint64_t)12773883697029175304U, (uint64_t)12751275631451845119U, - (uint64_t)11449095003038250478U, (uint64_t)1025805267334366480U, (uint64_t)2764432500300815015U, - (uint64_t)18274564429002844381U, (uint64_t)10445634195592600351U, - (uint64_t)11814099592837202735U, (uint64_t)5006796893679120289U, (uint64_t)6908397253997261914U, - (uint64_t)13266696965302879279U, (uint64_t)7768715053015037430U, (uint64_t)3569923738654785686U, - (uint64_t)5844853453464857549U, (uint64_t)1837340805629559110U, (uint64_t)1034657624388283114U, - (uint64_t)711244516069456460U, (uint64_t)12519286026957934814U, (uint64_t)2613464944620837619U, - (uint64_t)10003023321338286213U, (uint64_t)7291332092642881376U, (uint64_t)9832199564117004897U, - (uint64_t)3280736694860799890U, (uint64_t)6416452202849179874U, (uint64_t)7326961381798642069U, - (uint64_t)8435688798040635029U, (uint64_t)16630141263910982958U, - (uint64_t)17222635514422533318U, (uint64_t)9482787389178881499U, (uint64_t)836561194658263905U, - (uint64_t)3405319043337616649U, (uint64_t)2786146577568026518U, (uint64_t)7625483685691626321U, - (uint64_t)6728084875304656716U, (uint64_t)1140997959232544268U, (uint64_t)12847384827606303792U, - (uint64_t)1719121337754572070U, (uint64_t)12863589482936438532U, (uint64_t)3880712899640530862U, - (uint64_t)2748456882813671564U, (uint64_t)4775988900044623019U, (uint64_t)8937847374382191162U, - (uint64_t)3767367347172252295U, (uint64_t)13468672401049388646U, - (uint64_t)14359032216842397576U, (uint64_t)2002555958685443975U, - (uint64_t)16488678606651526810U, (uint64_t)11826135409597474760U, - (uint64_t)15296495673182508601U + 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 18446744069414584320ULL, 18446744073709551615ULL, 4294967294ULL, + 0ULL, 0ULL, 0ULL, 0ULL, 7870395003430845958ULL, 18001862936410067720ULL, 8006461232116967215ULL, + 5921313779532424762ULL, 10702113371959864307ULL, 8070517410642379879ULL, 7139806720777708306ULL, + 8253938546650739833ULL, 17490482834545705718ULL, 1065249776797037500ULL, 5018258455937968775ULL, + 14100621120178668337ULL, 8392845221328116213ULL, 14630296398338540788ULL, + 4268947906723414372ULL, 9231207002243517909ULL, 14261219637616504262ULL, 7786881626982345356ULL, + 11412720751765882139ULL, 14119585051365330009ULL, 15281626286521302128ULL, + 6350171933454266732ULL, 16559468304937127866ULL, 13200760478271693417ULL, + 6733381546280350776ULL, 3801404890075189193ULL, 2741036364686993903ULL, 3218612940540174008ULL, + 10894914335165419505ULL, 11862941430149998362ULL, 4223151729402839584ULL, + 2913215088487087887ULL, 14562168920104952953ULL, 2170089393468287453ULL, + 10520900655016579352ULL, 7040362608949989273ULL, 8376510559381705307ULL, 9142237200448131532ULL, + 5696859948123854080ULL, 925422306716081180ULL, 11155545953469186421ULL, 1888208646862572812ULL, + 11151095998248845721ULL, 15793503271680275267ULL, 7729877044494854851ULL, + 6235134673193032913ULL, 7364280682182401564ULL, 5479679373325519985ULL, 17966037684582301763ULL, + 14140891609330279185ULL, 5814744449740463867ULL, 5652588426712591652ULL, 774745682988690912ULL, + 13228255573220500373ULL, 11949122068786859397ULL, 8021166392900770376ULL, + 7994323710948720063ULL, 9924618472877849977ULL, 17618517523141194266ULL, 2750424097794401714ULL, + 15481749570715253207ULL, 14646964509921760497ULL, 1037442848094301355ULL, + 6295995947389299132ULL, 16915049722317579514ULL, 10493877400992990313ULL, + 18391008753060553521ULL, 483942209623707598ULL, 2017775662838016613ULL, 5933251998459363553ULL, + 11789135019970707407ULL, 5484123723153268336ULL, 13246954648848484954ULL, + 4774374393926023505ULL, 14863995618704457336ULL, 13220153167104973625ULL, + 5988445485312390826ULL, 17580359464028944682ULL, 7297100131969874771ULL, 379931507867989375ULL, + 10927113096513421444ULL, 17688881974428340857ULL, 4259872578781463333ULL, + 8573076295966784472ULL, 16389829450727275032ULL, 1667243868963568259ULL, + 17730726848925960919ULL, 11408899874569778008ULL, 3576527582023272268ULL, + 16492920640224231656ULL, 7906130545972460130ULL, 13878604278207681266ULL, 41446695125652041ULL, + 8891615271337333503ULL, 2594537723613594470ULL, 7699579176995770924ULL, 147458463055730655ULL, + 12120406862739088406ULL, 12044892493010567063ULL, 8554076749615475136ULL, + 1005097692260929999ULL, 2687202654471188715ULL, 9457588752176879209ULL, 17472884880062444019ULL, + 9792097892056020166ULL, 2525246678512797150ULL, 15958903035313115662ULL, + 11336038170342247032ULL, 11560342382835141123ULL, 6212009033479929024ULL, + 8214308203775021229ULL, 8475469210070503698ULL, 13287024123485719563ULL, + 12956951963817520723ULL, 10693035819908470465ULL, 11375478788224786725ULL, + 16934625208487120398ULL, 10094585729115874495ULL, 2763884524395905776ULL, + 13535890148969964883ULL, 13514657411765064358ULL, 9903074440788027562ULL, + 17324720726421199990ULL, 2273931039117368789ULL, 3442641041506157854ULL, 1119853641236409612ULL, + 12037070344296077989ULL, 581736433335671746ULL, 6019150647054369174ULL, 14864096138068789375ULL, + 6652995210998318662ULL, 12773883697029175304ULL, 12751275631451845119ULL, + 11449095003038250478ULL, 1025805267334366480ULL, 2764432500300815015ULL, + 18274564429002844381ULL, 10445634195592600351ULL, 11814099592837202735ULL, + 5006796893679120289ULL, 6908397253997261914ULL, 13266696965302879279ULL, 7768715053015037430ULL, + 3569923738654785686ULL, 5844853453464857549ULL, 1837340805629559110ULL, 1034657624388283114ULL, + 711244516069456460ULL, 12519286026957934814ULL, 2613464944620837619ULL, 10003023321338286213ULL, + 7291332092642881376ULL, 9832199564117004897ULL, 3280736694860799890ULL, 6416452202849179874ULL, + 7326961381798642069ULL, 8435688798040635029ULL, 16630141263910982958ULL, + 17222635514422533318ULL, 9482787389178881499ULL, 836561194658263905ULL, 3405319043337616649ULL, + 2786146577568026518ULL, 7625483685691626321ULL, 6728084875304656716ULL, 1140997959232544268ULL, + 12847384827606303792ULL, 1719121337754572070ULL, 12863589482936438532ULL, + 3880712899640530862ULL, 2748456882813671564ULL, 4775988900044623019ULL, 8937847374382191162ULL, + 3767367347172252295ULL, 13468672401049388646ULL, 14359032216842397576ULL, + 2002555958685443975ULL, 16488678606651526810ULL, 11826135409597474760ULL, + 15296495673182508601ULL }; static const uint64_t Hacl_P256_PrecompTable_precomp_basepoint_table_w5[384U] = { - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, - (uint64_t)18446744069414584320U, (uint64_t)18446744073709551615U, (uint64_t)4294967294U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)8784043285714375740U, - (uint64_t)8483257759279461889U, (uint64_t)8789745728267363600U, (uint64_t)1770019616739251654U, - (uint64_t)15992936863339206154U, (uint64_t)10037038012062884956U, - (uint64_t)15197544864945402661U, (uint64_t)9615747158586711429U, (uint64_t)1U, - (uint64_t)18446744069414584320U, (uint64_t)18446744073709551615U, (uint64_t)4294967294U, - (uint64_t)10634854829044225757U, (uint64_t)351552716085025155U, (uint64_t)10645315080955407736U, - (uint64_t)3609262091244858135U, (uint64_t)15760741698986874125U, - (uint64_t)14936374388219697827U, (uint64_t)15751360096993017895U, - (uint64_t)18012233706239762398U, (uint64_t)1993877568177495041U, - (uint64_t)10345888787846536528U, (uint64_t)7746511691117935375U, - (uint64_t)14517043990409914413U, (uint64_t)14122549297570634151U, - (uint64_t)16934610359517083771U, (uint64_t)5724511325497097418U, (uint64_t)8983432969107448705U, - (uint64_t)2687429970334080245U, (uint64_t)16525396802810050288U, (uint64_t)7602596488871585854U, - (uint64_t)4813919589149203084U, (uint64_t)7680395813780804519U, (uint64_t)6687709583048023590U, - (uint64_t)18086445169104142027U, (uint64_t)9637814708330203929U, - (uint64_t)14785108459960679090U, (uint64_t)3838023279095023581U, (uint64_t)3555615526157830307U, - (uint64_t)5177066488380472871U, (uint64_t)18218186719108038403U, - (uint64_t)16281556341699656105U, (uint64_t)1524227924561461191U, (uint64_t)4148060517641909597U, - (uint64_t)2858290374115363433U, (uint64_t)8942772026334130620U, (uint64_t)3034451298319885113U, - (uint64_t)8447866036736640940U, (uint64_t)11204933433076256578U, - (uint64_t)18333595740249588297U, (uint64_t)8259597024804538246U, (uint64_t)9539734295777539786U, - (uint64_t)9797290423046626413U, (uint64_t)5777303437849646537U, (uint64_t)8739356909899132020U, - (uint64_t)14815960973766782158U, (uint64_t)15286581798204509801U, - (uint64_t)17597362577777019682U, (uint64_t)13259283710820519742U, - (uint64_t)10501322996899164670U, (uint64_t)1221138904338319642U, - (uint64_t)14586685489551951885U, (uint64_t)895326705426031212U, (uint64_t)14398171728560617847U, - (uint64_t)9592550823745097391U, (uint64_t)17240998489162206026U, (uint64_t)8085479283308189196U, - (uint64_t)14844657737893882826U, (uint64_t)15923425394150618234U, - (uint64_t)2997808084773249525U, (uint64_t)494323555453660587U, (uint64_t)1215695327517794764U, - (uint64_t)9476207381098391690U, (uint64_t)7480789678419122995U, (uint64_t)15212230329321082489U, - (uint64_t)436189395349576388U, (uint64_t)17377474396456660834U, (uint64_t)15237013929655017939U, - (uint64_t)11444428846883781676U, (uint64_t)5112749694521428575U, (uint64_t)950829367509872073U, - (uint64_t)17665036182057559519U, (uint64_t)17205133339690002313U, - (uint64_t)16233765170251334549U, (uint64_t)10122775683257972591U, - (uint64_t)3352514236455632420U, (uint64_t)9143148522359954691U, (uint64_t)601191684005658860U, - (uint64_t)13398772186646349998U, (uint64_t)15512696600132928431U, - (uint64_t)9128416073728948653U, (uint64_t)11233051033546138578U, (uint64_t)6769345682610122833U, - (uint64_t)10823233224575054288U, (uint64_t)9997725227559980175U, (uint64_t)6733425642852897415U, - (uint64_t)16302206918151466066U, (uint64_t)1669330822143265921U, (uint64_t)2661645605036546002U, - (uint64_t)17182558479745802165U, (uint64_t)1165082692376932040U, (uint64_t)9470595929011488359U, - (uint64_t)6142147329285324932U, (uint64_t)4829075085998111287U, (uint64_t)10231370681107338930U, - (uint64_t)9591876895322495239U, (uint64_t)10316468561384076618U, - (uint64_t)11592503647238064235U, (uint64_t)13395813606055179632U, (uint64_t)511127033980815508U, - (uint64_t)12434976573147649880U, (uint64_t)3425094795384359127U, (uint64_t)6816971736303023445U, - (uint64_t)15444670609021139344U, (uint64_t)9464349818322082360U, - (uint64_t)16178216413042376883U, (uint64_t)9595540370774317348U, (uint64_t)7229365182662875710U, - (uint64_t)4601177649460012843U, (uint64_t)5455046447382487090U, (uint64_t)10854066421606187521U, - (uint64_t)15913416821879788071U, (uint64_t)2297365362023460173U, (uint64_t)2603252216454941350U, - (uint64_t)6768791943870490934U, (uint64_t)15705936687122754810U, (uint64_t)9537096567546600694U, - (uint64_t)17580538144855035062U, (uint64_t)4496542856965746638U, (uint64_t)8444341625922124942U, - (uint64_t)12191263903636183168U, (uint64_t)17427332907535974165U, - (uint64_t)14307569739254103736U, (uint64_t)13900598742063266169U, - (uint64_t)7176996424355977650U, (uint64_t)5709008170379717479U, (uint64_t)14471312052264549092U, - (uint64_t)1464519909491759867U, (uint64_t)3328154641049602121U, (uint64_t)13020349337171136774U, - (uint64_t)2772166279972051938U, (uint64_t)10854476939425975292U, (uint64_t)1967189930534630940U, - (uint64_t)2802919076529341959U, (uint64_t)14792226094833519208U, - (uint64_t)14675640928566522177U, (uint64_t)14838974364643800837U, - (uint64_t)17631460696099549980U, (uint64_t)17434186275364935469U, - (uint64_t)2665648200587705473U, (uint64_t)13202122464492564051U, (uint64_t)7576287350918073341U, - (uint64_t)2272206013910186424U, (uint64_t)14558761641743937843U, (uint64_t)5675729149929979729U, - (uint64_t)9043135187561613166U, (uint64_t)11750149293830589225U, (uint64_t)740555197954307911U, - (uint64_t)9871738005087190699U, (uint64_t)17178667634283502053U, - (uint64_t)18046255991533013265U, (uint64_t)4458222096988430430U, (uint64_t)8452427758526311627U, - (uint64_t)13825286929656615266U, (uint64_t)13956286357198391218U, - (uint64_t)15875692916799995079U, (uint64_t)10634895319157013920U, - (uint64_t)13230116118036304207U, (uint64_t)8795317393614625606U, (uint64_t)7001710806858862020U, - (uint64_t)7949746088586183478U, (uint64_t)14677556044923602317U, - (uint64_t)11184023437485843904U, (uint64_t)11215864722023085094U, - (uint64_t)6444464081471519014U, (uint64_t)1706241174022415217U, (uint64_t)8243975633057550613U, - (uint64_t)15502902453836085864U, (uint64_t)3799182188594003953U, (uint64_t)3538840175098724094U, - (uint64_t)13240193491554624643U, (uint64_t)12365034249541329920U, - (uint64_t)2924326828590977357U, (uint64_t)5687195797140589099U, (uint64_t)16880427227292834531U, - (uint64_t)9691471435758991112U, (uint64_t)16642385273732487288U, - (uint64_t)12173806747523009914U, (uint64_t)13142722756877876849U, - (uint64_t)8370377548305121979U, (uint64_t)17988526053752025426U, (uint64_t)4818750752684100334U, - (uint64_t)5669241919350361655U, (uint64_t)4964810303238518540U, (uint64_t)16709712747671533191U, - (uint64_t)4461414404267448242U, (uint64_t)3971798785139504238U, (uint64_t)6276818948740422136U, - (uint64_t)1426735892164275762U, (uint64_t)7943622674892418919U, (uint64_t)9864274225563929680U, - (uint64_t)57815533745003233U, (uint64_t)10893588105168960233U, (uint64_t)15739162732907069535U, - (uint64_t)3923866849462073470U, (uint64_t)12279826158399226875U, (uint64_t)1533015761334846582U, - (uint64_t)15860156818568437510U, (uint64_t)8252625373831297988U, (uint64_t)9666953804812706358U, - (uint64_t)8767785238646914634U, (uint64_t)14382179044941403551U, - (uint64_t)10401039907264254245U, (uint64_t)8584860003763157350U, (uint64_t)3120462679504470266U, - (uint64_t)8670255778748340069U, (uint64_t)5313789577940369984U, (uint64_t)16977072364454789224U, - (uint64_t)12199578693972188324U, (uint64_t)18211098771672599237U, - (uint64_t)12868831556008795030U, (uint64_t)5310155061431048194U, - (uint64_t)18114153238435112606U, (uint64_t)14482365809278304512U, - (uint64_t)12520721662723001511U, (uint64_t)405943624021143002U, (uint64_t)8146944101507657423U, - (uint64_t)181739317780393495U, (uint64_t)81743892273670099U, (uint64_t)14759561962550473930U, - (uint64_t)4592623849546992939U, (uint64_t)6916440441743449719U, (uint64_t)1304610503530809833U, - (uint64_t)5464930909232486441U, (uint64_t)15414883617496224671U, (uint64_t)8129283345256790U, - (uint64_t)18294252198413739489U, (uint64_t)17394115281884857288U, - (uint64_t)7808348415224731235U, (uint64_t)13195566655747230608U, (uint64_t)8568194219353949094U, - (uint64_t)15329813048672122440U, (uint64_t)9604275495885785744U, (uint64_t)1577712551205219835U, - (uint64_t)15964209008022052790U, (uint64_t)15087297920782098160U, - (uint64_t)3946031512438511898U, (uint64_t)10050061168984440631U, - (uint64_t)11382452014533138316U, (uint64_t)6313670788911952792U, - (uint64_t)12015989229696164014U, (uint64_t)5946702628076168852U, (uint64_t)5219995658774362841U, - (uint64_t)12230141881068377972U, (uint64_t)12361195202673441956U, - (uint64_t)4732862275653856711U, (uint64_t)17221430380805252370U, - (uint64_t)15397525953897375810U, (uint64_t)16557437297239563045U, - (uint64_t)10101683801868971351U, (uint64_t)1402611372245592868U, (uint64_t)1931806383735563658U, - (uint64_t)10991705207471512479U, (uint64_t)861333583207471392U, (uint64_t)15207766844626322355U, - (uint64_t)9224628129811432393U, (uint64_t)3497069567089055613U, (uint64_t)11956632757898590316U, - (uint64_t)8733729372586312960U, (uint64_t)18091521051714930927U, (uint64_t)77582787724373283U, - (uint64_t)9922437373519669237U, (uint64_t)3079321456325704615U, (uint64_t)12171198408512478457U, - (uint64_t)17179130884012147596U, (uint64_t)6839115479620367181U, (uint64_t)4421032569964105406U, - (uint64_t)10353331468657256053U, (uint64_t)17400988720335968824U, - (uint64_t)17138855889417480540U, (uint64_t)4507980080381370611U, - (uint64_t)10703175719793781886U, (uint64_t)12598516658725890426U, - (uint64_t)8353463412173898932U, (uint64_t)17703029389228422404U, (uint64_t)9313111267107226233U, - (uint64_t)5441322942995154196U, (uint64_t)8952817660034465484U, (uint64_t)17571113341183703118U, - (uint64_t)7375087953801067019U, (uint64_t)13381466302076453648U, (uint64_t)3218165271423914596U, - (uint64_t)16956372157249382685U, (uint64_t)509080090049418841U, (uint64_t)13374233893294084913U, - (uint64_t)2988537624204297086U, (uint64_t)4979195832939384620U, (uint64_t)3803931594068976394U, - (uint64_t)10731535883829627646U, (uint64_t)12954845047607194278U, - (uint64_t)10494298062560667399U, (uint64_t)4967351022190213065U, - (uint64_t)13391917938145756456U, (uint64_t)951370484866918160U, (uint64_t)13531334179067685307U, - (uint64_t)12868421357919390599U, (uint64_t)15918857042998130258U, - (uint64_t)17769743831936974016U, (uint64_t)7137921979260368809U, - (uint64_t)12461369180685892062U, (uint64_t)827476514081935199U, (uint64_t)15107282134224767230U, - (uint64_t)10084765752802805748U, (uint64_t)3303739059392464407U, - (uint64_t)17859532612136591428U, (uint64_t)10949414770405040164U, - (uint64_t)12838613589371008785U, (uint64_t)5554397169231540728U, - (uint64_t)18375114572169624408U, (uint64_t)15649286703242390139U, - (uint64_t)2957281557463706877U, (uint64_t)14000350446219393213U, - (uint64_t)14355199721749620351U, (uint64_t)2730856240099299695U, - (uint64_t)17528131000714705752U, (uint64_t)2537498525883536360U, (uint64_t)6121058967084509393U, - (uint64_t)16897667060435514221U, (uint64_t)12367869599571112440U, - (uint64_t)3388831797050807508U, (uint64_t)16791449724090982798U, (uint64_t)2673426123453294928U, - (uint64_t)11369313542384405846U, (uint64_t)15641960333586432634U, - (uint64_t)15080962589658958379U, (uint64_t)7747943772340226569U, (uint64_t)8075023376199159152U, - (uint64_t)8485093027378306528U, (uint64_t)13503706844122243648U, (uint64_t)8401961362938086226U, - (uint64_t)8125426002124226402U, (uint64_t)9005399361407785203U, (uint64_t)6847968030066906634U, - (uint64_t)11934937736309295197U, (uint64_t)5116750888594772351U, (uint64_t)2817039227179245227U, - (uint64_t)17724206901239332980U, (uint64_t)4985702708254058578U, (uint64_t)5786345435756642871U, - (uint64_t)17772527414940936938U, (uint64_t)1201320251272957006U, - (uint64_t)15787430120324348129U, (uint64_t)6305488781359965661U, - (uint64_t)12423900845502858433U, (uint64_t)17485949424202277720U, - (uint64_t)2062237315546855852U, (uint64_t)10353639467860902375U, (uint64_t)2315398490451287299U, - (uint64_t)15394572894814882621U, (uint64_t)232866113801165640U, (uint64_t)7413443736109338926U, - (uint64_t)902719806551551191U, (uint64_t)16568853118619045174U, (uint64_t)14202214862428279177U, - (uint64_t)11719595395278861192U, (uint64_t)5890053236389907647U, (uint64_t)9996196494965833627U, - (uint64_t)12967056942364782577U, (uint64_t)9034128755157395787U, - (uint64_t)17898204904710512655U, (uint64_t)8229373445062993977U, - (uint64_t)13580036169519833644U + 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 18446744069414584320ULL, 18446744073709551615ULL, 4294967294ULL, + 0ULL, 0ULL, 0ULL, 0ULL, 8784043285714375740ULL, 8483257759279461889ULL, 8789745728267363600ULL, + 1770019616739251654ULL, 15992936863339206154ULL, 10037038012062884956ULL, + 15197544864945402661ULL, 9615747158586711429ULL, 1ULL, 18446744069414584320ULL, + 18446744073709551615ULL, 4294967294ULL, 10634854829044225757ULL, 351552716085025155ULL, + 10645315080955407736ULL, 3609262091244858135ULL, 15760741698986874125ULL, + 14936374388219697827ULL, 15751360096993017895ULL, 18012233706239762398ULL, + 1993877568177495041ULL, 10345888787846536528ULL, 7746511691117935375ULL, + 14517043990409914413ULL, 14122549297570634151ULL, 16934610359517083771ULL, + 5724511325497097418ULL, 8983432969107448705ULL, 2687429970334080245ULL, 16525396802810050288ULL, + 7602596488871585854ULL, 4813919589149203084ULL, 7680395813780804519ULL, 6687709583048023590ULL, + 18086445169104142027ULL, 9637814708330203929ULL, 14785108459960679090ULL, + 3838023279095023581ULL, 3555615526157830307ULL, 5177066488380472871ULL, 18218186719108038403ULL, + 16281556341699656105ULL, 1524227924561461191ULL, 4148060517641909597ULL, 2858290374115363433ULL, + 8942772026334130620ULL, 3034451298319885113ULL, 8447866036736640940ULL, 11204933433076256578ULL, + 18333595740249588297ULL, 8259597024804538246ULL, 9539734295777539786ULL, 9797290423046626413ULL, + 5777303437849646537ULL, 8739356909899132020ULL, 14815960973766782158ULL, + 15286581798204509801ULL, 17597362577777019682ULL, 13259283710820519742ULL, + 10501322996899164670ULL, 1221138904338319642ULL, 14586685489551951885ULL, 895326705426031212ULL, + 14398171728560617847ULL, 9592550823745097391ULL, 17240998489162206026ULL, + 8085479283308189196ULL, 14844657737893882826ULL, 15923425394150618234ULL, + 2997808084773249525ULL, 494323555453660587ULL, 1215695327517794764ULL, 9476207381098391690ULL, + 7480789678419122995ULL, 15212230329321082489ULL, 436189395349576388ULL, 17377474396456660834ULL, + 15237013929655017939ULL, 11444428846883781676ULL, 5112749694521428575ULL, 950829367509872073ULL, + 17665036182057559519ULL, 17205133339690002313ULL, 16233765170251334549ULL, + 10122775683257972591ULL, 3352514236455632420ULL, 9143148522359954691ULL, 601191684005658860ULL, + 13398772186646349998ULL, 15512696600132928431ULL, 9128416073728948653ULL, + 11233051033546138578ULL, 6769345682610122833ULL, 10823233224575054288ULL, + 9997725227559980175ULL, 6733425642852897415ULL, 16302206918151466066ULL, 1669330822143265921ULL, + 2661645605036546002ULL, 17182558479745802165ULL, 1165082692376932040ULL, 9470595929011488359ULL, + 6142147329285324932ULL, 4829075085998111287ULL, 10231370681107338930ULL, 9591876895322495239ULL, + 10316468561384076618ULL, 11592503647238064235ULL, 13395813606055179632ULL, + 511127033980815508ULL, 12434976573147649880ULL, 3425094795384359127ULL, 6816971736303023445ULL, + 15444670609021139344ULL, 9464349818322082360ULL, 16178216413042376883ULL, + 9595540370774317348ULL, 7229365182662875710ULL, 4601177649460012843ULL, 5455046447382487090ULL, + 10854066421606187521ULL, 15913416821879788071ULL, 2297365362023460173ULL, + 2603252216454941350ULL, 6768791943870490934ULL, 15705936687122754810ULL, 9537096567546600694ULL, + 17580538144855035062ULL, 4496542856965746638ULL, 8444341625922124942ULL, + 12191263903636183168ULL, 17427332907535974165ULL, 14307569739254103736ULL, + 13900598742063266169ULL, 7176996424355977650ULL, 5709008170379717479ULL, + 14471312052264549092ULL, 1464519909491759867ULL, 3328154641049602121ULL, + 13020349337171136774ULL, 2772166279972051938ULL, 10854476939425975292ULL, + 1967189930534630940ULL, 2802919076529341959ULL, 14792226094833519208ULL, + 14675640928566522177ULL, 14838974364643800837ULL, 17631460696099549980ULL, + 17434186275364935469ULL, 2665648200587705473ULL, 13202122464492564051ULL, + 7576287350918073341ULL, 2272206013910186424ULL, 14558761641743937843ULL, 5675729149929979729ULL, + 9043135187561613166ULL, 11750149293830589225ULL, 740555197954307911ULL, 9871738005087190699ULL, + 17178667634283502053ULL, 18046255991533013265ULL, 4458222096988430430ULL, + 8452427758526311627ULL, 13825286929656615266ULL, 13956286357198391218ULL, + 15875692916799995079ULL, 10634895319157013920ULL, 13230116118036304207ULL, + 8795317393614625606ULL, 7001710806858862020ULL, 7949746088586183478ULL, 14677556044923602317ULL, + 11184023437485843904ULL, 11215864722023085094ULL, 6444464081471519014ULL, + 1706241174022415217ULL, 8243975633057550613ULL, 15502902453836085864ULL, 3799182188594003953ULL, + 3538840175098724094ULL, 13240193491554624643ULL, 12365034249541329920ULL, + 2924326828590977357ULL, 5687195797140589099ULL, 16880427227292834531ULL, 9691471435758991112ULL, + 16642385273732487288ULL, 12173806747523009914ULL, 13142722756877876849ULL, + 8370377548305121979ULL, 17988526053752025426ULL, 4818750752684100334ULL, 5669241919350361655ULL, + 4964810303238518540ULL, 16709712747671533191ULL, 4461414404267448242ULL, 3971798785139504238ULL, + 6276818948740422136ULL, 1426735892164275762ULL, 7943622674892418919ULL, 9864274225563929680ULL, + 57815533745003233ULL, 10893588105168960233ULL, 15739162732907069535ULL, 3923866849462073470ULL, + 12279826158399226875ULL, 1533015761334846582ULL, 15860156818568437510ULL, + 8252625373831297988ULL, 9666953804812706358ULL, 8767785238646914634ULL, 14382179044941403551ULL, + 10401039907264254245ULL, 8584860003763157350ULL, 3120462679504470266ULL, 8670255778748340069ULL, + 5313789577940369984ULL, 16977072364454789224ULL, 12199578693972188324ULL, + 18211098771672599237ULL, 12868831556008795030ULL, 5310155061431048194ULL, + 18114153238435112606ULL, 14482365809278304512ULL, 12520721662723001511ULL, + 405943624021143002ULL, 8146944101507657423ULL, 181739317780393495ULL, 81743892273670099ULL, + 14759561962550473930ULL, 4592623849546992939ULL, 6916440441743449719ULL, 1304610503530809833ULL, + 5464930909232486441ULL, 15414883617496224671ULL, 8129283345256790ULL, 18294252198413739489ULL, + 17394115281884857288ULL, 7808348415224731235ULL, 13195566655747230608ULL, + 8568194219353949094ULL, 15329813048672122440ULL, 9604275495885785744ULL, 1577712551205219835ULL, + 15964209008022052790ULL, 15087297920782098160ULL, 3946031512438511898ULL, + 10050061168984440631ULL, 11382452014533138316ULL, 6313670788911952792ULL, + 12015989229696164014ULL, 5946702628076168852ULL, 5219995658774362841ULL, + 12230141881068377972ULL, 12361195202673441956ULL, 4732862275653856711ULL, + 17221430380805252370ULL, 15397525953897375810ULL, 16557437297239563045ULL, + 10101683801868971351ULL, 1402611372245592868ULL, 1931806383735563658ULL, + 10991705207471512479ULL, 861333583207471392ULL, 15207766844626322355ULL, 9224628129811432393ULL, + 3497069567089055613ULL, 11956632757898590316ULL, 8733729372586312960ULL, + 18091521051714930927ULL, 77582787724373283ULL, 9922437373519669237ULL, 3079321456325704615ULL, + 12171198408512478457ULL, 17179130884012147596ULL, 6839115479620367181ULL, + 4421032569964105406ULL, 10353331468657256053ULL, 17400988720335968824ULL, + 17138855889417480540ULL, 4507980080381370611ULL, 10703175719793781886ULL, + 12598516658725890426ULL, 8353463412173898932ULL, 17703029389228422404ULL, + 9313111267107226233ULL, 5441322942995154196ULL, 8952817660034465484ULL, 17571113341183703118ULL, + 7375087953801067019ULL, 13381466302076453648ULL, 3218165271423914596ULL, + 16956372157249382685ULL, 509080090049418841ULL, 13374233893294084913ULL, 2988537624204297086ULL, + 4979195832939384620ULL, 3803931594068976394ULL, 10731535883829627646ULL, + 12954845047607194278ULL, 10494298062560667399ULL, 4967351022190213065ULL, + 13391917938145756456ULL, 951370484866918160ULL, 13531334179067685307ULL, + 12868421357919390599ULL, 15918857042998130258ULL, 17769743831936974016ULL, + 7137921979260368809ULL, 12461369180685892062ULL, 827476514081935199ULL, 15107282134224767230ULL, + 10084765752802805748ULL, 3303739059392464407ULL, 17859532612136591428ULL, + 10949414770405040164ULL, 12838613589371008785ULL, 5554397169231540728ULL, + 18375114572169624408ULL, 15649286703242390139ULL, 2957281557463706877ULL, + 14000350446219393213ULL, 14355199721749620351ULL, 2730856240099299695ULL, + 17528131000714705752ULL, 2537498525883536360ULL, 6121058967084509393ULL, + 16897667060435514221ULL, 12367869599571112440ULL, 3388831797050807508ULL, + 16791449724090982798ULL, 2673426123453294928ULL, 11369313542384405846ULL, + 15641960333586432634ULL, 15080962589658958379ULL, 7747943772340226569ULL, + 8075023376199159152ULL, 8485093027378306528ULL, 13503706844122243648ULL, 8401961362938086226ULL, + 8125426002124226402ULL, 9005399361407785203ULL, 6847968030066906634ULL, 11934937736309295197ULL, + 5116750888594772351ULL, 2817039227179245227ULL, 17724206901239332980ULL, 4985702708254058578ULL, + 5786345435756642871ULL, 17772527414940936938ULL, 1201320251272957006ULL, + 15787430120324348129ULL, 6305488781359965661ULL, 12423900845502858433ULL, + 17485949424202277720ULL, 2062237315546855852ULL, 10353639467860902375ULL, + 2315398490451287299ULL, 15394572894814882621ULL, 232866113801165640ULL, 7413443736109338926ULL, + 902719806551551191ULL, 16568853118619045174ULL, 14202214862428279177ULL, + 11719595395278861192ULL, 5890053236389907647ULL, 9996196494965833627ULL, + 12967056942364782577ULL, 9034128755157395787ULL, 17898204904710512655ULL, + 8229373445062993977ULL, 13580036169519833644ULL }; #if defined(__cplusplus) diff --git a/include/internal/Hacl_SHA2_Types.h b/include/internal/Hacl_SHA2_Types.h index 1e51a0f1..5a1eb668 100644 --- a/include/internal/Hacl_SHA2_Types.h +++ b/include/internal/Hacl_SHA2_Types.h @@ -35,68 +35,68 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -typedef struct Hacl_Impl_SHA2_Types_uint8_2p_s +typedef struct Hacl_Hash_SHA2_uint8_2p_s { uint8_t *fst; uint8_t *snd; } -Hacl_Impl_SHA2_Types_uint8_2p; +Hacl_Hash_SHA2_uint8_2p; -typedef struct Hacl_Impl_SHA2_Types_uint8_3p_s +typedef struct Hacl_Hash_SHA2_uint8_3p_s { uint8_t *fst; - Hacl_Impl_SHA2_Types_uint8_2p snd; + Hacl_Hash_SHA2_uint8_2p snd; } -Hacl_Impl_SHA2_Types_uint8_3p; +Hacl_Hash_SHA2_uint8_3p; -typedef struct Hacl_Impl_SHA2_Types_uint8_4p_s +typedef struct Hacl_Hash_SHA2_uint8_4p_s { uint8_t *fst; - Hacl_Impl_SHA2_Types_uint8_3p snd; + Hacl_Hash_SHA2_uint8_3p snd; } -Hacl_Impl_SHA2_Types_uint8_4p; +Hacl_Hash_SHA2_uint8_4p; -typedef struct Hacl_Impl_SHA2_Types_uint8_5p_s +typedef struct Hacl_Hash_SHA2_uint8_5p_s { uint8_t *fst; - Hacl_Impl_SHA2_Types_uint8_4p snd; + Hacl_Hash_SHA2_uint8_4p snd; } -Hacl_Impl_SHA2_Types_uint8_5p; +Hacl_Hash_SHA2_uint8_5p; -typedef struct Hacl_Impl_SHA2_Types_uint8_6p_s +typedef struct Hacl_Hash_SHA2_uint8_6p_s { uint8_t *fst; - Hacl_Impl_SHA2_Types_uint8_5p snd; + Hacl_Hash_SHA2_uint8_5p snd; } -Hacl_Impl_SHA2_Types_uint8_6p; +Hacl_Hash_SHA2_uint8_6p; -typedef struct Hacl_Impl_SHA2_Types_uint8_7p_s +typedef struct Hacl_Hash_SHA2_uint8_7p_s { uint8_t *fst; - Hacl_Impl_SHA2_Types_uint8_6p snd; + Hacl_Hash_SHA2_uint8_6p snd; } -Hacl_Impl_SHA2_Types_uint8_7p; +Hacl_Hash_SHA2_uint8_7p; -typedef struct Hacl_Impl_SHA2_Types_uint8_8p_s +typedef struct Hacl_Hash_SHA2_uint8_8p_s { uint8_t *fst; - Hacl_Impl_SHA2_Types_uint8_7p snd; + Hacl_Hash_SHA2_uint8_7p snd; } -Hacl_Impl_SHA2_Types_uint8_8p; +Hacl_Hash_SHA2_uint8_8p; -typedef struct Hacl_Impl_SHA2_Types_uint8_2x4p_s +typedef struct Hacl_Hash_SHA2_uint8_2x4p_s { - Hacl_Impl_SHA2_Types_uint8_4p fst; - Hacl_Impl_SHA2_Types_uint8_4p snd; + Hacl_Hash_SHA2_uint8_4p fst; + Hacl_Hash_SHA2_uint8_4p snd; } -Hacl_Impl_SHA2_Types_uint8_2x4p; +Hacl_Hash_SHA2_uint8_2x4p; -typedef struct Hacl_Impl_SHA2_Types_uint8_2x8p_s +typedef struct Hacl_Hash_SHA2_uint8_2x8p_s { - Hacl_Impl_SHA2_Types_uint8_8p fst; - Hacl_Impl_SHA2_Types_uint8_8p snd; + Hacl_Hash_SHA2_uint8_8p fst; + Hacl_Hash_SHA2_uint8_8p snd; } -Hacl_Impl_SHA2_Types_uint8_2x8p; +Hacl_Hash_SHA2_uint8_2x8p; #if defined(__cplusplus) } diff --git a/include/msvc/EverCrypt_Chacha20Poly1305.h b/include/msvc/EverCrypt_Chacha20Poly1305.h index c3eb2655..bd59e48b 100644 --- a/include/msvc/EverCrypt_Chacha20Poly1305.h +++ b/include/msvc/EverCrypt_Chacha20Poly1305.h @@ -35,9 +35,9 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -#include "Hacl_Chacha20Poly1305_32.h" -#include "Hacl_Chacha20Poly1305_256.h" -#include "Hacl_Chacha20Poly1305_128.h" +#include "Hacl_AEAD_Chacha20Poly1305_Simd256.h" +#include "Hacl_AEAD_Chacha20Poly1305_Simd128.h" +#include "Hacl_AEAD_Chacha20Poly1305.h" #include "EverCrypt_AutoConfig2.h" void diff --git a/include/msvc/EverCrypt_HMAC.h b/include/msvc/EverCrypt_HMAC.h index 6c64a37f..7d1da14d 100644 --- a/include/msvc/EverCrypt_HMAC.h +++ b/include/msvc/EverCrypt_HMAC.h @@ -38,13 +38,14 @@ extern "C" { #include "Hacl_Streaming_Types.h" #include "Hacl_Krmllib.h" #include "Hacl_Hash_SHA2.h" -#include "Hacl_Hash_Blake2.h" +#include "Hacl_Hash_Blake2s.h" +#include "Hacl_Hash_Blake2b.h" bool EverCrypt_HMAC_is_supported_alg(Spec_Hash_Definitions_hash_alg uu___); typedef Spec_Hash_Definitions_hash_alg EverCrypt_HMAC_supported_alg; -extern void (*EverCrypt_HMAC_hash_256)(uint8_t *x0, uint32_t x1, uint8_t *x2); +extern void (*EverCrypt_HMAC_hash_256)(uint8_t *x0, uint8_t *x1, uint32_t x2); void EverCrypt_HMAC_compute( diff --git a/include/msvc/EverCrypt_Hash.h b/include/msvc/EverCrypt_Hash.h index 6791dc27..b35dcf5f 100644 --- a/include/msvc/EverCrypt_Hash.h +++ b/include/msvc/EverCrypt_Hash.h @@ -39,9 +39,10 @@ extern "C" { #include "Hacl_Krmllib.h" #include "Hacl_Hash_SHA3.h" #include "Hacl_Hash_SHA2.h" -#include "Hacl_Hash_Blake2s_128.h" -#include "Hacl_Hash_Blake2b_256.h" -#include "Hacl_Hash_Blake2.h" +#include "Hacl_Hash_Blake2s_Simd128.h" +#include "Hacl_Hash_Blake2s.h" +#include "Hacl_Hash_Blake2b_Simd256.h" +#include "Hacl_Hash_Blake2b.h" #include "EverCrypt_Error.h" #include "EverCrypt_AutoConfig2.h" @@ -49,13 +50,13 @@ typedef struct EverCrypt_Hash_state_s_s EverCrypt_Hash_state_s; uint32_t EverCrypt_Hash_Incremental_hash_len(Spec_Hash_Definitions_hash_alg a); -typedef struct EverCrypt_Hash_Incremental_hash_state_s +typedef struct EverCrypt_Hash_Incremental_state_t_s { EverCrypt_Hash_state_s *block_state; uint8_t *buf; uint64_t total_len; } -EverCrypt_Hash_Incremental_hash_state; +EverCrypt_Hash_Incremental_state_t; /** Allocate initial state for the agile hash. The argument `a` stands for the @@ -63,13 +64,13 @@ choice of algorithm (see Hacl_Spec.h). This API will automatically pick the most efficient implementation, provided you have called EverCrypt_AutoConfig2_init() before. The state is to be freed by calling `free`. */ -EverCrypt_Hash_Incremental_hash_state -*EverCrypt_Hash_Incremental_create_in(Spec_Hash_Definitions_hash_alg a); +EverCrypt_Hash_Incremental_state_t +*EverCrypt_Hash_Incremental_malloc(Spec_Hash_Definitions_hash_alg a); /** Reset an existing state to the initial hash state with empty data. */ -void EverCrypt_Hash_Incremental_init(EverCrypt_Hash_Incremental_hash_state *s); +void EverCrypt_Hash_Incremental_reset(EverCrypt_Hash_Incremental_state_t *state); /** Feed an arbitrary amount of data into the hash. This function returns @@ -80,34 +81,35 @@ algorithm. Both limits are unlikely to be attained in practice. */ EverCrypt_Error_error_code EverCrypt_Hash_Incremental_update( - EverCrypt_Hash_Incremental_hash_state *s, - uint8_t *data, - uint32_t len + EverCrypt_Hash_Incremental_state_t *state, + uint8_t *chunk, + uint32_t chunk_len ); /** Perform a run-time test to determine which algorithm was chosen for the given piece of state. */ Spec_Hash_Definitions_hash_alg -EverCrypt_Hash_Incremental_alg_of_state(EverCrypt_Hash_Incremental_hash_state *s); +EverCrypt_Hash_Incremental_alg_of_state(EverCrypt_Hash_Incremental_state_t *s); /** -Write the resulting hash into `dst`, an array whose length is +Write the resulting hash into `output`, an array whose length is algorithm-specific. You can use the macros defined earlier in this file to allocate a destination buffer of the right length. The state remains valid after -a call to `finish`, meaning the user may feed more data into the hash via +a call to `digest`, meaning the user may feed more data into the hash via `update`. (The finish function operates on an internal copy of the state and therefore does not invalidate the client-held state.) */ -void EverCrypt_Hash_Incremental_finish(EverCrypt_Hash_Incremental_hash_state *s, uint8_t *dst); +void +EverCrypt_Hash_Incremental_digest(EverCrypt_Hash_Incremental_state_t *state, uint8_t *output); /** Free a state previously allocated with `create_in`. */ -void EverCrypt_Hash_Incremental_free(EverCrypt_Hash_Incremental_hash_state *s); +void EverCrypt_Hash_Incremental_free(EverCrypt_Hash_Incremental_state_t *state); /** -Hash `input`, of len `len`, into `dst`, an array whose length is determined by +Hash `input`, of len `input_len`, into `output`, an array whose length is determined by your choice of algorithm `a` (see Hacl_Spec.h). You can use the macros defined earlier in this file to allocate a destination buffer of the right length. This API will automatically pick the most efficient implementation, provided you have @@ -116,34 +118,34 @@ called EverCrypt_AutoConfig2_init() before. void EverCrypt_Hash_Incremental_hash( Spec_Hash_Definitions_hash_alg a, - uint8_t *dst, + uint8_t *output, uint8_t *input, - uint32_t len + uint32_t input_len ); -#define MD5_HASH_LEN ((uint32_t)16U) +#define MD5_HASH_LEN (16U) -#define SHA1_HASH_LEN ((uint32_t)20U) +#define SHA1_HASH_LEN (20U) -#define SHA2_224_HASH_LEN ((uint32_t)28U) +#define SHA2_224_HASH_LEN (28U) -#define SHA2_256_HASH_LEN ((uint32_t)32U) +#define SHA2_256_HASH_LEN (32U) -#define SHA2_384_HASH_LEN ((uint32_t)48U) +#define SHA2_384_HASH_LEN (48U) -#define SHA2_512_HASH_LEN ((uint32_t)64U) +#define SHA2_512_HASH_LEN (64U) -#define SHA3_224_HASH_LEN ((uint32_t)28U) +#define SHA3_224_HASH_LEN (28U) -#define SHA3_256_HASH_LEN ((uint32_t)32U) +#define SHA3_256_HASH_LEN (32U) -#define SHA3_384_HASH_LEN ((uint32_t)48U) +#define SHA3_384_HASH_LEN (48U) -#define SHA3_512_HASH_LEN ((uint32_t)64U) +#define SHA3_512_HASH_LEN (64U) -#define BLAKE2S_HASH_LEN ((uint32_t)32U) +#define BLAKE2S_HASH_LEN (32U) -#define BLAKE2B_HASH_LEN ((uint32_t)64U) +#define BLAKE2B_HASH_LEN (64U) #if defined(__cplusplus) } diff --git a/include/msvc/EverCrypt_Poly1305.h b/include/msvc/EverCrypt_Poly1305.h index 62c00764..fba04059 100644 --- a/include/msvc/EverCrypt_Poly1305.h +++ b/include/msvc/EverCrypt_Poly1305.h @@ -35,12 +35,12 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -#include "Hacl_Poly1305_32.h" -#include "Hacl_Poly1305_256.h" -#include "Hacl_Poly1305_128.h" +#include "Hacl_MAC_Poly1305_Simd256.h" +#include "Hacl_MAC_Poly1305_Simd128.h" +#include "Hacl_MAC_Poly1305.h" #include "EverCrypt_AutoConfig2.h" -void EverCrypt_Poly1305_poly1305(uint8_t *dst, uint8_t *src, uint32_t len, uint8_t *key); +void EverCrypt_Poly1305_mac(uint8_t *output, uint8_t *input, uint32_t input_len, uint8_t *key); #if defined(__cplusplus) } diff --git a/include/msvc/Hacl_AEAD_Chacha20Poly1305.h b/include/msvc/Hacl_AEAD_Chacha20Poly1305.h new file mode 100644 index 00000000..2a8daa75 --- /dev/null +++ b/include/msvc/Hacl_AEAD_Chacha20Poly1305.h @@ -0,0 +1,104 @@ +/* MIT License + * + * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation + * Copyright (c) 2022-2023 HACL* Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + + +#ifndef __Hacl_AEAD_Chacha20Poly1305_H +#define __Hacl_AEAD_Chacha20Poly1305_H + +#if defined(__cplusplus) +extern "C" { +#endif + +#include +#include "krml/internal/types.h" +#include "krml/lowstar_endianness.h" +#include "krml/internal/target.h" + +#include "Hacl_Chacha20.h" + +/** +Encrypt a message `input` with key `key`. + +The arguments `key`, `nonce`, `data`, and `data_len` are same in encryption/decryption. +Note: Encryption and decryption can be executed in-place, i.e., `input` and `output` can point to the same memory. + +@param output Pointer to `input_len` bytes of memory where the ciphertext is written to. +@param tag Pointer to 16 bytes of memory where the mac is written to. +@param input Pointer to `input_len` bytes of memory where the message is read from. +@param input_len Length of the message. +@param data Pointer to `data_len` bytes of memory where the associated data is read from. +@param data_len Length of the associated data. +@param key Pointer to 32 bytes of memory where the AEAD key is read from. +@param nonce Pointer to 12 bytes of memory where the AEAD nonce is read from. +*/ +void +Hacl_AEAD_Chacha20Poly1305_encrypt( + uint8_t *output, + uint8_t *tag, + uint8_t *input, + uint32_t input_len, + uint8_t *data, + uint32_t data_len, + uint8_t *key, + uint8_t *nonce +); + +/** +Decrypt a ciphertext `input` with key `key`. + +The arguments `key`, `nonce`, `data`, and `data_len` are same in encryption/decryption. +Note: Encryption and decryption can be executed in-place, i.e., `output` and `input` can point to the same memory. + +If decryption succeeds, the resulting plaintext is stored in `output` and the function returns the success code 0. +If decryption fails, the array `output` remains unchanged and the function returns the error code 1. + +@param output Pointer to `input_len` bytes of memory where the message is written to. +@param input Pointer to `input_len` bytes of memory where the ciphertext is read from. +@param input_len Length of the ciphertext. +@param data Pointer to `data_len` bytes of memory where the associated data is read from. +@param data_len Length of the associated data. +@param key Pointer to 32 bytes of memory where the AEAD key is read from. +@param nonce Pointer to 12 bytes of memory where the AEAD nonce is read from. +@param tag Pointer to 16 bytes of memory where the mac is read from. + +@returns 0 on succeess; 1 on failure. +*/ +uint32_t +Hacl_AEAD_Chacha20Poly1305_decrypt( + uint8_t *output, + uint8_t *input, + uint32_t input_len, + uint8_t *data, + uint32_t data_len, + uint8_t *key, + uint8_t *nonce, + uint8_t *tag +); + +#if defined(__cplusplus) +} +#endif + +#define __Hacl_AEAD_Chacha20Poly1305_H_DEFINED +#endif diff --git a/include/msvc/Hacl_AEAD_Chacha20Poly1305_Simd128.h b/include/msvc/Hacl_AEAD_Chacha20Poly1305_Simd128.h new file mode 100644 index 00000000..de26c907 --- /dev/null +++ b/include/msvc/Hacl_AEAD_Chacha20Poly1305_Simd128.h @@ -0,0 +1,104 @@ +/* MIT License + * + * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation + * Copyright (c) 2022-2023 HACL* Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + + +#ifndef __Hacl_AEAD_Chacha20Poly1305_Simd128_H +#define __Hacl_AEAD_Chacha20Poly1305_Simd128_H + +#if defined(__cplusplus) +extern "C" { +#endif + +#include +#include "krml/internal/types.h" +#include "krml/lowstar_endianness.h" +#include "krml/internal/target.h" + +#include "Hacl_Chacha20_Vec128.h" + +/** +Encrypt a message `input` with key `key`. + +The arguments `key`, `nonce`, `data`, and `data_len` are same in encryption/decryption. +Note: Encryption and decryption can be executed in-place, i.e., `input` and `output` can point to the same memory. + +@param output Pointer to `input_len` bytes of memory where the ciphertext is written to. +@param tag Pointer to 16 bytes of memory where the mac is written to. +@param input Pointer to `input_len` bytes of memory where the message is read from. +@param input_len Length of the message. +@param data Pointer to `data_len` bytes of memory where the associated data is read from. +@param data_len Length of the associated data. +@param key Pointer to 32 bytes of memory where the AEAD key is read from. +@param nonce Pointer to 12 bytes of memory where the AEAD nonce is read from. +*/ +void +Hacl_AEAD_Chacha20Poly1305_Simd128_encrypt( + uint8_t *output, + uint8_t *tag, + uint8_t *input, + uint32_t input_len, + uint8_t *data, + uint32_t data_len, + uint8_t *key, + uint8_t *nonce +); + +/** +Decrypt a ciphertext `input` with key `key`. + +The arguments `key`, `nonce`, `data`, and `data_len` are same in encryption/decryption. +Note: Encryption and decryption can be executed in-place, i.e., `input` and `output` can point to the same memory. + +If decryption succeeds, the resulting plaintext is stored in `output` and the function returns the success code 0. +If decryption fails, the array `output` remains unchanged and the function returns the error code 1. + +@param output Pointer to `input_len` bytes of memory where the message is written to. +@param input Pointer to `input_len` bytes of memory where the ciphertext is read from. +@param input_len Length of the ciphertext. +@param data Pointer to `data_len` bytes of memory where the associated data is read from. +@param data_len Length of the associated data. +@param key Pointer to 32 bytes of memory where the AEAD key is read from. +@param nonce Pointer to 12 bytes of memory where the AEAD nonce is read from. +@param tag Pointer to 16 bytes of memory where the mac is read from. + +@returns 0 on succeess; 1 on failure. +*/ +uint32_t +Hacl_AEAD_Chacha20Poly1305_Simd128_decrypt( + uint8_t *output, + uint8_t *input, + uint32_t input_len, + uint8_t *data, + uint32_t data_len, + uint8_t *key, + uint8_t *nonce, + uint8_t *tag +); + +#if defined(__cplusplus) +} +#endif + +#define __Hacl_AEAD_Chacha20Poly1305_Simd128_H_DEFINED +#endif diff --git a/include/msvc/Hacl_AEAD_Chacha20Poly1305_Simd256.h b/include/msvc/Hacl_AEAD_Chacha20Poly1305_Simd256.h new file mode 100644 index 00000000..0abcdc59 --- /dev/null +++ b/include/msvc/Hacl_AEAD_Chacha20Poly1305_Simd256.h @@ -0,0 +1,104 @@ +/* MIT License + * + * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation + * Copyright (c) 2022-2023 HACL* Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + + +#ifndef __Hacl_AEAD_Chacha20Poly1305_Simd256_H +#define __Hacl_AEAD_Chacha20Poly1305_Simd256_H + +#if defined(__cplusplus) +extern "C" { +#endif + +#include +#include "krml/internal/types.h" +#include "krml/lowstar_endianness.h" +#include "krml/internal/target.h" + +#include "Hacl_Chacha20_Vec256.h" + +/** +Encrypt a message `input` with key `key`. + +The arguments `key`, `nonce`, `data`, and `data_len` are same in encryption/decryption. +Note: Encryption and decryption can be executed in-place, i.e., `input` and `output` can point to the same memory. + +@param output Pointer to `input_len` bytes of memory where the ciphertext is written to. +@param tag Pointer to 16 bytes of memory where the mac is written to. +@param input Pointer to `input_len` bytes of memory where the message is read from. +@param input_len Length of the message. +@param data Pointer to `data_len` bytes of memory where the associated data is read from. +@param data_len Length of the associated data. +@param key Pointer to 32 bytes of memory where the AEAD key is read from. +@param nonce Pointer to 12 bytes of memory where the AEAD nonce is read from. +*/ +void +Hacl_AEAD_Chacha20Poly1305_Simd256_encrypt( + uint8_t *output, + uint8_t *tag, + uint8_t *input, + uint32_t input_len, + uint8_t *data, + uint32_t data_len, + uint8_t *key, + uint8_t *nonce +); + +/** +Decrypt a ciphertext `input` with key `key`. + +The arguments `key`, `nonce`, `data`, and `data_len` are same in encryption/decryption. +Note: Encryption and decryption can be executed in-place, i.e., `input` and `output` can point to the same memory. + +If decryption succeeds, the resulting plaintext is stored in `output` and the function returns the success code 0. +If decryption fails, the array `output` remains unchanged and the function returns the error code 1. + +@param output Pointer to `input_len` bytes of memory where the message is written to. +@param input Pointer to `input_len` bytes of memory where the ciphertext is read from. +@param input_len Length of the ciphertext. +@param data Pointer to `data_len` bytes of memory where the associated data is read from. +@param data_len Length of the associated data. +@param key Pointer to 32 bytes of memory where the AEAD key is read from. +@param nonce Pointer to 12 bytes of memory where the AEAD nonce is read from. +@param tag Pointer to 16 bytes of memory where the mac is read from. + +@returns 0 on succeess; 1 on failure. +*/ +uint32_t +Hacl_AEAD_Chacha20Poly1305_Simd256_decrypt( + uint8_t *output, + uint8_t *input, + uint32_t input_len, + uint8_t *data, + uint32_t data_len, + uint8_t *key, + uint8_t *nonce, + uint8_t *tag +); + +#if defined(__cplusplus) +} +#endif + +#define __Hacl_AEAD_Chacha20Poly1305_Simd256_H_DEFINED +#endif diff --git a/include/msvc/Hacl_Chacha20Poly1305_128.h b/include/msvc/Hacl_Chacha20Poly1305_128.h deleted file mode 100644 index 630fab93..00000000 --- a/include/msvc/Hacl_Chacha20Poly1305_128.h +++ /dev/null @@ -1,107 +0,0 @@ -/* MIT License - * - * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation - * Copyright (c) 2022-2023 HACL* Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - - -#ifndef __Hacl_Chacha20Poly1305_128_H -#define __Hacl_Chacha20Poly1305_128_H - -#if defined(__cplusplus) -extern "C" { -#endif - -#include -#include "krml/internal/types.h" -#include "krml/lowstar_endianness.h" -#include "krml/internal/target.h" - -#include "Hacl_Poly1305_128.h" -#include "Hacl_Chacha20_Vec128.h" - -/** -Encrypt a message `m` with key `k`. - -The arguments `k`, `n`, `aadlen`, and `aad` are same in encryption/decryption. -Note: Encryption and decryption can be executed in-place, i.e., `m` and `cipher` can point to the same memory. - -@param k Pointer to 32 bytes of memory where the AEAD key is read from. -@param n Pointer to 12 bytes of memory where the AEAD nonce is read from. -@param aadlen Length of the associated data. -@param aad Pointer to `aadlen` bytes of memory where the associated data is read from. - -@param mlen Length of the message. -@param m Pointer to `mlen` bytes of memory where the message is read from. -@param cipher Pointer to `mlen` bytes of memory where the ciphertext is written to. -@param mac Pointer to 16 bytes of memory where the mac is written to. -*/ -void -Hacl_Chacha20Poly1305_128_aead_encrypt( - uint8_t *k, - uint8_t *n, - uint32_t aadlen, - uint8_t *aad, - uint32_t mlen, - uint8_t *m, - uint8_t *cipher, - uint8_t *mac -); - -/** -Decrypt a ciphertext `cipher` with key `k`. - -The arguments `k`, `n`, `aadlen`, and `aad` are same in encryption/decryption. -Note: Encryption and decryption can be executed in-place, i.e., `m` and `cipher` can point to the same memory. - -If decryption succeeds, the resulting plaintext is stored in `m` and the function returns the success code 0. -If decryption fails, the array `m` remains unchanged and the function returns the error code 1. - -@param k Pointer to 32 bytes of memory where the AEAD key is read from. -@param n Pointer to 12 bytes of memory where the AEAD nonce is read from. -@param aadlen Length of the associated data. -@param aad Pointer to `aadlen` bytes of memory where the associated data is read from. - -@param mlen Length of the ciphertext. -@param m Pointer to `mlen` bytes of memory where the message is written to. -@param cipher Pointer to `mlen` bytes of memory where the ciphertext is read from. -@param mac Pointer to 16 bytes of memory where the mac is read from. - -@returns 0 on succeess; 1 on failure. -*/ -uint32_t -Hacl_Chacha20Poly1305_128_aead_decrypt( - uint8_t *k, - uint8_t *n, - uint32_t aadlen, - uint8_t *aad, - uint32_t mlen, - uint8_t *m, - uint8_t *cipher, - uint8_t *mac -); - -#if defined(__cplusplus) -} -#endif - -#define __Hacl_Chacha20Poly1305_128_H_DEFINED -#endif diff --git a/include/msvc/Hacl_Chacha20Poly1305_256.h b/include/msvc/Hacl_Chacha20Poly1305_256.h deleted file mode 100644 index ff0f2e60..00000000 --- a/include/msvc/Hacl_Chacha20Poly1305_256.h +++ /dev/null @@ -1,107 +0,0 @@ -/* MIT License - * - * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation - * Copyright (c) 2022-2023 HACL* Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - - -#ifndef __Hacl_Chacha20Poly1305_256_H -#define __Hacl_Chacha20Poly1305_256_H - -#if defined(__cplusplus) -extern "C" { -#endif - -#include -#include "krml/internal/types.h" -#include "krml/lowstar_endianness.h" -#include "krml/internal/target.h" - -#include "Hacl_Poly1305_256.h" -#include "Hacl_Chacha20_Vec256.h" - -/** -Encrypt a message `m` with key `k`. - -The arguments `k`, `n`, `aadlen`, and `aad` are same in encryption/decryption. -Note: Encryption and decryption can be executed in-place, i.e., `m` and `cipher` can point to the same memory. - -@param k Pointer to 32 bytes of memory where the AEAD key is read from. -@param n Pointer to 12 bytes of memory where the AEAD nonce is read from. -@param aadlen Length of the associated data. -@param aad Pointer to `aadlen` bytes of memory where the associated data is read from. - -@param mlen Length of the message. -@param m Pointer to `mlen` bytes of memory where the message is read from. -@param cipher Pointer to `mlen` bytes of memory where the ciphertext is written to. -@param mac Pointer to 16 bytes of memory where the mac is written to. -*/ -void -Hacl_Chacha20Poly1305_256_aead_encrypt( - uint8_t *k, - uint8_t *n, - uint32_t aadlen, - uint8_t *aad, - uint32_t mlen, - uint8_t *m, - uint8_t *cipher, - uint8_t *mac -); - -/** -Decrypt a ciphertext `cipher` with key `k`. - -The arguments `k`, `n`, `aadlen`, and `aad` are same in encryption/decryption. -Note: Encryption and decryption can be executed in-place, i.e., `m` and `cipher` can point to the same memory. - -If decryption succeeds, the resulting plaintext is stored in `m` and the function returns the success code 0. -If decryption fails, the array `m` remains unchanged and the function returns the error code 1. - -@param k Pointer to 32 bytes of memory where the AEAD key is read from. -@param n Pointer to 12 bytes of memory where the AEAD nonce is read from. -@param aadlen Length of the associated data. -@param aad Pointer to `aadlen` bytes of memory where the associated data is read from. - -@param mlen Length of the ciphertext. -@param m Pointer to `mlen` bytes of memory where the message is written to. -@param cipher Pointer to `mlen` bytes of memory where the ciphertext is read from. -@param mac Pointer to 16 bytes of memory where the mac is read from. - -@returns 0 on succeess; 1 on failure. -*/ -uint32_t -Hacl_Chacha20Poly1305_256_aead_decrypt( - uint8_t *k, - uint8_t *n, - uint32_t aadlen, - uint8_t *aad, - uint32_t mlen, - uint8_t *m, - uint8_t *cipher, - uint8_t *mac -); - -#if defined(__cplusplus) -} -#endif - -#define __Hacl_Chacha20Poly1305_256_H_DEFINED -#endif diff --git a/include/msvc/Hacl_Chacha20Poly1305_32.h b/include/msvc/Hacl_Chacha20Poly1305_32.h deleted file mode 100644 index 624e29fb..00000000 --- a/include/msvc/Hacl_Chacha20Poly1305_32.h +++ /dev/null @@ -1,107 +0,0 @@ -/* MIT License - * - * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation - * Copyright (c) 2022-2023 HACL* Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - - -#ifndef __Hacl_Chacha20Poly1305_32_H -#define __Hacl_Chacha20Poly1305_32_H - -#if defined(__cplusplus) -extern "C" { -#endif - -#include -#include "krml/internal/types.h" -#include "krml/lowstar_endianness.h" -#include "krml/internal/target.h" - -#include "Hacl_Poly1305_32.h" -#include "Hacl_Chacha20.h" - -/** -Encrypt a message `m` with key `k`. - -The arguments `k`, `n`, `aadlen`, and `aad` are same in encryption/decryption. -Note: Encryption and decryption can be executed in-place, i.e., `m` and `cipher` can point to the same memory. - -@param k Pointer to 32 bytes of memory where the AEAD key is read from. -@param n Pointer to 12 bytes of memory where the AEAD nonce is read from. -@param aadlen Length of the associated data. -@param aad Pointer to `aadlen` bytes of memory where the associated data is read from. - -@param mlen Length of the message. -@param m Pointer to `mlen` bytes of memory where the message is read from. -@param cipher Pointer to `mlen` bytes of memory where the ciphertext is written to. -@param mac Pointer to 16 bytes of memory where the mac is written to. -*/ -void -Hacl_Chacha20Poly1305_32_aead_encrypt( - uint8_t *k, - uint8_t *n, - uint32_t aadlen, - uint8_t *aad, - uint32_t mlen, - uint8_t *m, - uint8_t *cipher, - uint8_t *mac -); - -/** -Decrypt a ciphertext `cipher` with key `k`. - -The arguments `k`, `n`, `aadlen`, and `aad` are same in encryption/decryption. -Note: Encryption and decryption can be executed in-place, i.e., `m` and `cipher` can point to the same memory. - -If decryption succeeds, the resulting plaintext is stored in `m` and the function returns the success code 0. -If decryption fails, the array `m` remains unchanged and the function returns the error code 1. - -@param k Pointer to 32 bytes of memory where the AEAD key is read from. -@param n Pointer to 12 bytes of memory where the AEAD nonce is read from. -@param aadlen Length of the associated data. -@param aad Pointer to `aadlen` bytes of memory where the associated data is read from. - -@param mlen Length of the ciphertext. -@param m Pointer to `mlen` bytes of memory where the message is written to. -@param cipher Pointer to `mlen` bytes of memory where the ciphertext is read from. -@param mac Pointer to 16 bytes of memory where the mac is read from. - -@returns 0 on succeess; 1 on failure. -*/ -uint32_t -Hacl_Chacha20Poly1305_32_aead_decrypt( - uint8_t *k, - uint8_t *n, - uint32_t aadlen, - uint8_t *aad, - uint32_t mlen, - uint8_t *m, - uint8_t *cipher, - uint8_t *mac -); - -#if defined(__cplusplus) -} -#endif - -#define __Hacl_Chacha20Poly1305_32_H_DEFINED -#endif diff --git a/include/msvc/Hacl_HMAC.h b/include/msvc/Hacl_HMAC.h index 84dbedf5..e1dc04f2 100644 --- a/include/msvc/Hacl_HMAC.h +++ b/include/msvc/Hacl_HMAC.h @@ -37,7 +37,8 @@ extern "C" { #include "Hacl_Krmllib.h" #include "Hacl_Hash_SHA2.h" -#include "Hacl_Hash_Blake2.h" +#include "Hacl_Hash_Blake2s.h" +#include "Hacl_Hash_Blake2b.h" /** Write the HMAC-SHA-1 MAC of a message (`data`) by using a key (`key`) into `dst`. @@ -46,7 +47,7 @@ The key can be any length and will be hashed if it is longer and padded if it is `dst` must point to 20 bytes of memory. */ void -Hacl_HMAC_legacy_compute_sha1( +Hacl_HMAC_compute_sha1( uint8_t *dst, uint8_t *key, uint32_t key_len, diff --git a/include/msvc/Hacl_HMAC_Blake2b_256.h b/include/msvc/Hacl_HMAC_Blake2b_256.h index e94ba05f..d8f3e9e1 100644 --- a/include/msvc/Hacl_HMAC_Blake2b_256.h +++ b/include/msvc/Hacl_HMAC_Blake2b_256.h @@ -36,7 +36,7 @@ extern "C" { #include "krml/internal/target.h" #include "Hacl_Krmllib.h" -#include "Hacl_Hash_Blake2b_256.h" +#include "Hacl_Hash_Blake2b_Simd256.h" /** Write the HMAC-BLAKE2b MAC of a message (`data`) by using a key (`key`) into `dst`. diff --git a/include/msvc/Hacl_HMAC_Blake2s_128.h b/include/msvc/Hacl_HMAC_Blake2s_128.h index 7f20343e..5ff79038 100644 --- a/include/msvc/Hacl_HMAC_Blake2s_128.h +++ b/include/msvc/Hacl_HMAC_Blake2s_128.h @@ -35,7 +35,7 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -#include "Hacl_Hash_Blake2s_128.h" +#include "Hacl_Hash_Blake2s_Simd128.h" /** Write the HMAC-BLAKE2s MAC of a message (`data`) by using a key (`key`) into `dst`. diff --git a/include/msvc/Hacl_HPKE_Curve51_CP128_SHA256.h b/include/msvc/Hacl_HPKE_Curve51_CP128_SHA256.h index a768df6b..a46db470 100644 --- a/include/msvc/Hacl_HPKE_Curve51_CP128_SHA256.h +++ b/include/msvc/Hacl_HPKE_Curve51_CP128_SHA256.h @@ -38,7 +38,7 @@ extern "C" { #include "Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE.h" #include "Hacl_HKDF.h" #include "Hacl_Curve25519_51.h" -#include "Hacl_Chacha20Poly1305_128.h" +#include "Hacl_AEAD_Chacha20Poly1305_Simd128.h" uint32_t Hacl_HPKE_Curve51_CP128_SHA256_setupBaseS( diff --git a/include/msvc/Hacl_HPKE_Curve51_CP128_SHA512.h b/include/msvc/Hacl_HPKE_Curve51_CP128_SHA512.h index a4388707..89091754 100644 --- a/include/msvc/Hacl_HPKE_Curve51_CP128_SHA512.h +++ b/include/msvc/Hacl_HPKE_Curve51_CP128_SHA512.h @@ -38,7 +38,7 @@ extern "C" { #include "Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE.h" #include "Hacl_HKDF.h" #include "Hacl_Curve25519_51.h" -#include "Hacl_Chacha20Poly1305_128.h" +#include "Hacl_AEAD_Chacha20Poly1305_Simd128.h" uint32_t Hacl_HPKE_Curve51_CP128_SHA512_setupBaseS( diff --git a/include/msvc/Hacl_HPKE_Curve51_CP256_SHA256.h b/include/msvc/Hacl_HPKE_Curve51_CP256_SHA256.h index 37b26f6a..83ba2adb 100644 --- a/include/msvc/Hacl_HPKE_Curve51_CP256_SHA256.h +++ b/include/msvc/Hacl_HPKE_Curve51_CP256_SHA256.h @@ -38,7 +38,7 @@ extern "C" { #include "Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE.h" #include "Hacl_HKDF.h" #include "Hacl_Curve25519_51.h" -#include "Hacl_Chacha20Poly1305_256.h" +#include "Hacl_AEAD_Chacha20Poly1305_Simd256.h" uint32_t Hacl_HPKE_Curve51_CP256_SHA256_setupBaseS( diff --git a/include/msvc/Hacl_HPKE_Curve51_CP256_SHA512.h b/include/msvc/Hacl_HPKE_Curve51_CP256_SHA512.h index f7240a95..1a796ab7 100644 --- a/include/msvc/Hacl_HPKE_Curve51_CP256_SHA512.h +++ b/include/msvc/Hacl_HPKE_Curve51_CP256_SHA512.h @@ -38,7 +38,7 @@ extern "C" { #include "Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE.h" #include "Hacl_HKDF.h" #include "Hacl_Curve25519_51.h" -#include "Hacl_Chacha20Poly1305_256.h" +#include "Hacl_AEAD_Chacha20Poly1305_Simd256.h" uint32_t Hacl_HPKE_Curve51_CP256_SHA512_setupBaseS( diff --git a/include/msvc/Hacl_HPKE_Curve51_CP32_SHA256.h b/include/msvc/Hacl_HPKE_Curve51_CP32_SHA256.h index e48242e6..d249ba05 100644 --- a/include/msvc/Hacl_HPKE_Curve51_CP32_SHA256.h +++ b/include/msvc/Hacl_HPKE_Curve51_CP32_SHA256.h @@ -38,7 +38,7 @@ extern "C" { #include "Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE.h" #include "Hacl_HKDF.h" #include "Hacl_Curve25519_51.h" -#include "Hacl_Chacha20Poly1305_32.h" +#include "Hacl_AEAD_Chacha20Poly1305.h" uint32_t Hacl_HPKE_Curve51_CP32_SHA256_setupBaseS( diff --git a/include/msvc/Hacl_HPKE_Curve51_CP32_SHA512.h b/include/msvc/Hacl_HPKE_Curve51_CP32_SHA512.h index 057f8769..ddc00da3 100644 --- a/include/msvc/Hacl_HPKE_Curve51_CP32_SHA512.h +++ b/include/msvc/Hacl_HPKE_Curve51_CP32_SHA512.h @@ -38,7 +38,7 @@ extern "C" { #include "Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE.h" #include "Hacl_HKDF.h" #include "Hacl_Curve25519_51.h" -#include "Hacl_Chacha20Poly1305_32.h" +#include "Hacl_AEAD_Chacha20Poly1305.h" uint32_t Hacl_HPKE_Curve51_CP32_SHA512_setupBaseS( diff --git a/include/msvc/Hacl_HPKE_Curve64_CP128_SHA256.h b/include/msvc/Hacl_HPKE_Curve64_CP128_SHA256.h index 1694a123..fda63e52 100644 --- a/include/msvc/Hacl_HPKE_Curve64_CP128_SHA256.h +++ b/include/msvc/Hacl_HPKE_Curve64_CP128_SHA256.h @@ -38,7 +38,7 @@ extern "C" { #include "Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE.h" #include "Hacl_HKDF.h" #include "Hacl_Curve25519_64.h" -#include "Hacl_Chacha20Poly1305_128.h" +#include "Hacl_AEAD_Chacha20Poly1305_Simd128.h" uint32_t Hacl_HPKE_Curve64_CP128_SHA256_setupBaseS( diff --git a/include/msvc/Hacl_HPKE_Curve64_CP128_SHA512.h b/include/msvc/Hacl_HPKE_Curve64_CP128_SHA512.h index 23f52f25..c8b06ca8 100644 --- a/include/msvc/Hacl_HPKE_Curve64_CP128_SHA512.h +++ b/include/msvc/Hacl_HPKE_Curve64_CP128_SHA512.h @@ -38,7 +38,7 @@ extern "C" { #include "Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE.h" #include "Hacl_HKDF.h" #include "Hacl_Curve25519_64.h" -#include "Hacl_Chacha20Poly1305_128.h" +#include "Hacl_AEAD_Chacha20Poly1305_Simd128.h" uint32_t Hacl_HPKE_Curve64_CP128_SHA512_setupBaseS( diff --git a/include/msvc/Hacl_HPKE_Curve64_CP256_SHA256.h b/include/msvc/Hacl_HPKE_Curve64_CP256_SHA256.h index 33d471bc..2da8dbcf 100644 --- a/include/msvc/Hacl_HPKE_Curve64_CP256_SHA256.h +++ b/include/msvc/Hacl_HPKE_Curve64_CP256_SHA256.h @@ -38,7 +38,7 @@ extern "C" { #include "Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE.h" #include "Hacl_HKDF.h" #include "Hacl_Curve25519_64.h" -#include "Hacl_Chacha20Poly1305_256.h" +#include "Hacl_AEAD_Chacha20Poly1305_Simd256.h" uint32_t Hacl_HPKE_Curve64_CP256_SHA256_setupBaseS( diff --git a/include/msvc/Hacl_HPKE_Curve64_CP256_SHA512.h b/include/msvc/Hacl_HPKE_Curve64_CP256_SHA512.h index d59c1ee4..87d919e1 100644 --- a/include/msvc/Hacl_HPKE_Curve64_CP256_SHA512.h +++ b/include/msvc/Hacl_HPKE_Curve64_CP256_SHA512.h @@ -38,7 +38,7 @@ extern "C" { #include "Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE.h" #include "Hacl_HKDF.h" #include "Hacl_Curve25519_64.h" -#include "Hacl_Chacha20Poly1305_256.h" +#include "Hacl_AEAD_Chacha20Poly1305_Simd256.h" uint32_t Hacl_HPKE_Curve64_CP256_SHA512_setupBaseS( diff --git a/include/msvc/Hacl_HPKE_Curve64_CP32_SHA256.h b/include/msvc/Hacl_HPKE_Curve64_CP32_SHA256.h index 5aaa07e1..bd4b9b59 100644 --- a/include/msvc/Hacl_HPKE_Curve64_CP32_SHA256.h +++ b/include/msvc/Hacl_HPKE_Curve64_CP32_SHA256.h @@ -38,7 +38,7 @@ extern "C" { #include "Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE.h" #include "Hacl_HKDF.h" #include "Hacl_Curve25519_64.h" -#include "Hacl_Chacha20Poly1305_32.h" +#include "Hacl_AEAD_Chacha20Poly1305.h" uint32_t Hacl_HPKE_Curve64_CP32_SHA256_setupBaseS( diff --git a/include/msvc/Hacl_HPKE_Curve64_CP32_SHA512.h b/include/msvc/Hacl_HPKE_Curve64_CP32_SHA512.h index 594000f2..0d2bb8f0 100644 --- a/include/msvc/Hacl_HPKE_Curve64_CP32_SHA512.h +++ b/include/msvc/Hacl_HPKE_Curve64_CP32_SHA512.h @@ -38,7 +38,7 @@ extern "C" { #include "Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE.h" #include "Hacl_HKDF.h" #include "Hacl_Curve25519_64.h" -#include "Hacl_Chacha20Poly1305_32.h" +#include "Hacl_AEAD_Chacha20Poly1305.h" uint32_t Hacl_HPKE_Curve64_CP32_SHA512_setupBaseS( diff --git a/include/msvc/Hacl_HPKE_P256_CP128_SHA256.h b/include/msvc/Hacl_HPKE_P256_CP128_SHA256.h index 613fef83..c76a100d 100644 --- a/include/msvc/Hacl_HPKE_P256_CP128_SHA256.h +++ b/include/msvc/Hacl_HPKE_P256_CP128_SHA256.h @@ -37,7 +37,7 @@ extern "C" { #include "Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE.h" #include "Hacl_HKDF.h" -#include "Hacl_Chacha20Poly1305_128.h" +#include "Hacl_AEAD_Chacha20Poly1305_Simd128.h" uint32_t Hacl_HPKE_P256_CP128_SHA256_setupBaseS( diff --git a/include/msvc/Hacl_HPKE_P256_CP256_SHA256.h b/include/msvc/Hacl_HPKE_P256_CP256_SHA256.h index 6e74b1db..4a33eb8a 100644 --- a/include/msvc/Hacl_HPKE_P256_CP256_SHA256.h +++ b/include/msvc/Hacl_HPKE_P256_CP256_SHA256.h @@ -37,7 +37,7 @@ extern "C" { #include "Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE.h" #include "Hacl_HKDF.h" -#include "Hacl_Chacha20Poly1305_256.h" +#include "Hacl_AEAD_Chacha20Poly1305_Simd256.h" uint32_t Hacl_HPKE_P256_CP256_SHA256_setupBaseS( diff --git a/include/msvc/Hacl_HPKE_P256_CP32_SHA256.h b/include/msvc/Hacl_HPKE_P256_CP32_SHA256.h index 1f8679d4..2818abed 100644 --- a/include/msvc/Hacl_HPKE_P256_CP32_SHA256.h +++ b/include/msvc/Hacl_HPKE_P256_CP32_SHA256.h @@ -37,7 +37,7 @@ extern "C" { #include "Hacl_HPKE_Interface_Hacl_Impl_HPKE_Hacl_Meta_HPKE.h" #include "Hacl_HKDF.h" -#include "Hacl_Chacha20Poly1305_32.h" +#include "Hacl_AEAD_Chacha20Poly1305.h" uint32_t Hacl_HPKE_P256_CP32_SHA256_setupBaseS( diff --git a/include/msvc/Hacl_Hash_Blake2.h b/include/msvc/Hacl_Hash_Blake2.h deleted file mode 100644 index 3ee29015..00000000 --- a/include/msvc/Hacl_Hash_Blake2.h +++ /dev/null @@ -1,155 +0,0 @@ -/* MIT License - * - * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation - * Copyright (c) 2022-2023 HACL* Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - - -#ifndef __Hacl_Hash_Blake2_H -#define __Hacl_Hash_Blake2_H - -#if defined(__cplusplus) -extern "C" { -#endif - -#include -#include "krml/internal/types.h" -#include "krml/lowstar_endianness.h" -#include "krml/internal/target.h" - -#include "Hacl_Krmllib.h" - -void Hacl_Blake2b_32_blake2b_init(uint64_t *hash, uint32_t kk, uint32_t nn); - -void -Hacl_Blake2b_32_blake2b_update_key( - uint64_t *wv, - uint64_t *hash, - uint32_t kk, - uint8_t *k, - uint32_t ll -); - -void -Hacl_Blake2b_32_blake2b_update_multi( - uint32_t len, - uint64_t *wv, - uint64_t *hash, - FStar_UInt128_uint128 prev, - uint8_t *blocks, - uint32_t nb -); - -void -Hacl_Blake2b_32_blake2b_update_last( - uint32_t len, - uint64_t *wv, - uint64_t *hash, - FStar_UInt128_uint128 prev, - uint32_t rem, - uint8_t *d -); - -void Hacl_Blake2b_32_blake2b_finish(uint32_t nn, uint8_t *output, uint64_t *hash); - -/** -Write the BLAKE2b digest of message `d` using key `k` into `output`. - -@param nn Length of the to-be-generated digest with 1 <= `nn` <= 64. -@param output Pointer to `nn` bytes of memory where the digest is written to. -@param ll Length of the input message. -@param d Pointer to `ll` bytes of memory where the input message is read from. -@param kk Length of the key. Can be 0. -@param k Pointer to `kk` bytes of memory where the key is read from. -*/ -void -Hacl_Blake2b_32_blake2b( - uint32_t nn, - uint8_t *output, - uint32_t ll, - uint8_t *d, - uint32_t kk, - uint8_t *k -); - -uint64_t *Hacl_Blake2b_32_blake2b_malloc(void); - -void Hacl_Blake2s_32_blake2s_init(uint32_t *hash, uint32_t kk, uint32_t nn); - -void -Hacl_Blake2s_32_blake2s_update_key( - uint32_t *wv, - uint32_t *hash, - uint32_t kk, - uint8_t *k, - uint32_t ll -); - -void -Hacl_Blake2s_32_blake2s_update_multi( - uint32_t len, - uint32_t *wv, - uint32_t *hash, - uint64_t prev, - uint8_t *blocks, - uint32_t nb -); - -void -Hacl_Blake2s_32_blake2s_update_last( - uint32_t len, - uint32_t *wv, - uint32_t *hash, - uint64_t prev, - uint32_t rem, - uint8_t *d -); - -void Hacl_Blake2s_32_blake2s_finish(uint32_t nn, uint8_t *output, uint32_t *hash); - -/** -Write the BLAKE2s digest of message `d` using key `k` into `output`. - -@param nn Length of to-be-generated digest with 1 <= `nn` <= 32. -@param output Pointer to `nn` bytes of memory where the digest is written to. -@param ll Length of the input message. -@param d Pointer to `ll` bytes of memory where the input message is read from. -@param kk Length of the key. Can be 0. -@param k Pointer to `kk` bytes of memory where the key is read from. -*/ -void -Hacl_Blake2s_32_blake2s( - uint32_t nn, - uint8_t *output, - uint32_t ll, - uint8_t *d, - uint32_t kk, - uint8_t *k -); - -uint32_t *Hacl_Blake2s_32_blake2s_malloc(void); - -#if defined(__cplusplus) -} -#endif - -#define __Hacl_Hash_Blake2_H_DEFINED -#endif diff --git a/include/msvc/Hacl_Streaming_Blake2b_256.h b/include/msvc/Hacl_Hash_Blake2b.h similarity index 56% rename from include/msvc/Hacl_Streaming_Blake2b_256.h rename to include/msvc/Hacl_Hash_Blake2b.h index 20e42d7c..414574f9 100644 --- a/include/msvc/Hacl_Streaming_Blake2b_256.h +++ b/include/msvc/Hacl_Hash_Blake2b.h @@ -23,8 +23,8 @@ */ -#ifndef __Hacl_Streaming_Blake2b_256_H -#define __Hacl_Streaming_Blake2b_256_H +#ifndef __Hacl_Hash_Blake2b_H +#define __Hacl_Hash_Blake2b_H #if defined(__cplusplus) extern "C" { @@ -37,67 +37,71 @@ extern "C" { #include "Hacl_Streaming_Types.h" #include "Hacl_Krmllib.h" -#include "Hacl_Hash_Blake2b_256.h" -typedef struct Hacl_Streaming_Blake2b_256_blake2b_256_block_state_s +typedef struct Hacl_Hash_Blake2b_block_state_t_s { - Lib_IntVector_Intrinsics_vec256 *fst; - Lib_IntVector_Intrinsics_vec256 *snd; + uint64_t *fst; + uint64_t *snd; } -Hacl_Streaming_Blake2b_256_blake2b_256_block_state; +Hacl_Hash_Blake2b_block_state_t; -typedef struct Hacl_Streaming_Blake2b_256_blake2b_256_state_s +typedef struct Hacl_Hash_Blake2b_state_t_s { - Hacl_Streaming_Blake2b_256_blake2b_256_block_state block_state; + Hacl_Hash_Blake2b_block_state_t block_state; uint8_t *buf; uint64_t total_len; } -Hacl_Streaming_Blake2b_256_blake2b_256_state; +Hacl_Hash_Blake2b_state_t; /** State allocation function when there is no key */ -Hacl_Streaming_Blake2b_256_blake2b_256_state -*Hacl_Streaming_Blake2b_256_blake2b_256_no_key_create_in(void); +Hacl_Hash_Blake2b_state_t *Hacl_Hash_Blake2b_malloc(void); /** - (Re-)initialization function when there is no key + Re-initialization function when there is no key */ -void -Hacl_Streaming_Blake2b_256_blake2b_256_no_key_init( - Hacl_Streaming_Blake2b_256_blake2b_256_state *s -); +void Hacl_Hash_Blake2b_reset(Hacl_Hash_Blake2b_state_t *state); /** Update function when there is no key; 0 = success, 1 = max length exceeded */ Hacl_Streaming_Types_error_code -Hacl_Streaming_Blake2b_256_blake2b_256_no_key_update( - Hacl_Streaming_Blake2b_256_blake2b_256_state *p, - uint8_t *data, - uint32_t len -); +Hacl_Hash_Blake2b_update(Hacl_Hash_Blake2b_state_t *state, uint8_t *chunk, uint32_t chunk_len); /** Finish function when there is no key */ -void -Hacl_Streaming_Blake2b_256_blake2b_256_no_key_finish( - Hacl_Streaming_Blake2b_256_blake2b_256_state *p, - uint8_t *dst -); +void Hacl_Hash_Blake2b_digest(Hacl_Hash_Blake2b_state_t *state, uint8_t *output); /** Free state function when there is no key */ +void Hacl_Hash_Blake2b_free(Hacl_Hash_Blake2b_state_t *state); + +/** +Write the BLAKE2b digest of message `input` using key `key` into `output`. + +@param output Pointer to `output_len` bytes of memory where the digest is written to. +@param output_len Length of the to-be-generated digest with 1 <= `output_len` <= 64. +@param input Pointer to `input_len` bytes of memory where the input message is read from. +@param input_len Length of the input message. +@param key Pointer to `key_len` bytes of memory where the key is read from. +@param key_len Length of the key. Can be 0. +*/ void -Hacl_Streaming_Blake2b_256_blake2b_256_no_key_free( - Hacl_Streaming_Blake2b_256_blake2b_256_state *s +Hacl_Hash_Blake2b_hash_with_key( + uint8_t *output, + uint32_t output_len, + uint8_t *input, + uint32_t input_len, + uint8_t *key, + uint32_t key_len ); #if defined(__cplusplus) } #endif -#define __Hacl_Streaming_Blake2b_256_H_DEFINED +#define __Hacl_Hash_Blake2b_H_DEFINED #endif diff --git a/include/msvc/Hacl_Hash_Blake2b_Simd256.h b/include/msvc/Hacl_Hash_Blake2b_Simd256.h new file mode 100644 index 00000000..adddce66 --- /dev/null +++ b/include/msvc/Hacl_Hash_Blake2b_Simd256.h @@ -0,0 +1,113 @@ +/* MIT License + * + * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation + * Copyright (c) 2022-2023 HACL* Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + + +#ifndef __Hacl_Hash_Blake2b_Simd256_H +#define __Hacl_Hash_Blake2b_Simd256_H + +#if defined(__cplusplus) +extern "C" { +#endif + +#include +#include "krml/internal/types.h" +#include "krml/lowstar_endianness.h" +#include "krml/internal/target.h" + +#include "Hacl_Streaming_Types.h" +#include "Hacl_Krmllib.h" +#include "libintvector.h" + +typedef struct Hacl_Hash_Blake2b_Simd256_block_state_t_s +{ + Lib_IntVector_Intrinsics_vec256 *fst; + Lib_IntVector_Intrinsics_vec256 *snd; +} +Hacl_Hash_Blake2b_Simd256_block_state_t; + +typedef struct Hacl_Hash_Blake2b_Simd256_state_t_s +{ + Hacl_Hash_Blake2b_Simd256_block_state_t block_state; + uint8_t *buf; + uint64_t total_len; +} +Hacl_Hash_Blake2b_Simd256_state_t; + +/** + State allocation function when there is no key +*/ +Hacl_Hash_Blake2b_Simd256_state_t *Hacl_Hash_Blake2b_Simd256_malloc(void); + +/** + Re-initialization function when there is no key +*/ +void Hacl_Hash_Blake2b_Simd256_reset(Hacl_Hash_Blake2b_Simd256_state_t *state); + +/** + Update function when there is no key; 0 = success, 1 = max length exceeded +*/ +Hacl_Streaming_Types_error_code +Hacl_Hash_Blake2b_Simd256_update( + Hacl_Hash_Blake2b_Simd256_state_t *state, + uint8_t *chunk, + uint32_t chunk_len +); + +/** + Finish function when there is no key +*/ +void +Hacl_Hash_Blake2b_Simd256_digest(Hacl_Hash_Blake2b_Simd256_state_t *state, uint8_t *output); + +/** + Free state function when there is no key +*/ +void Hacl_Hash_Blake2b_Simd256_free(Hacl_Hash_Blake2b_Simd256_state_t *state); + +/** +Write the BLAKE2b digest of message `input` using key `key` into `output`. + +@param output Pointer to `output_len` bytes of memory where the digest is written to. +@param output_len Length of the to-be-generated digest with 1 <= `output_len` <= 64. +@param input Pointer to `input_len` bytes of memory where the input message is read from. +@param input_len Length of the input message. +@param key Pointer to `key_len` bytes of memory where the key is read from. +@param key_len Length of the key. Can be 0. +*/ +void +Hacl_Hash_Blake2b_Simd256_hash_with_key( + uint8_t *output, + uint32_t output_len, + uint8_t *input, + uint32_t input_len, + uint8_t *key, + uint32_t key_len +); + +#if defined(__cplusplus) +} +#endif + +#define __Hacl_Hash_Blake2b_Simd256_H_DEFINED +#endif diff --git a/include/msvc/Hacl_Streaming_Blake2s_128.h b/include/msvc/Hacl_Hash_Blake2s.h similarity index 56% rename from include/msvc/Hacl_Streaming_Blake2s_128.h rename to include/msvc/Hacl_Hash_Blake2s.h index 60e209ff..2c0d7c5b 100644 --- a/include/msvc/Hacl_Streaming_Blake2s_128.h +++ b/include/msvc/Hacl_Hash_Blake2s.h @@ -23,8 +23,8 @@ */ -#ifndef __Hacl_Streaming_Blake2s_128_H -#define __Hacl_Streaming_Blake2s_128_H +#ifndef __Hacl_Hash_Blake2s_H +#define __Hacl_Hash_Blake2s_H #if defined(__cplusplus) extern "C" { @@ -36,67 +36,71 @@ extern "C" { #include "krml/internal/target.h" #include "Hacl_Streaming_Types.h" -#include "Hacl_Hash_Blake2s_128.h" -typedef struct Hacl_Streaming_Blake2s_128_blake2s_128_block_state_s +typedef struct Hacl_Hash_Blake2s_block_state_t_s { - Lib_IntVector_Intrinsics_vec128 *fst; - Lib_IntVector_Intrinsics_vec128 *snd; + uint32_t *fst; + uint32_t *snd; } -Hacl_Streaming_Blake2s_128_blake2s_128_block_state; +Hacl_Hash_Blake2s_block_state_t; -typedef struct Hacl_Streaming_Blake2s_128_blake2s_128_state_s +typedef struct Hacl_Hash_Blake2s_state_t_s { - Hacl_Streaming_Blake2s_128_blake2s_128_block_state block_state; + Hacl_Hash_Blake2s_block_state_t block_state; uint8_t *buf; uint64_t total_len; } -Hacl_Streaming_Blake2s_128_blake2s_128_state; +Hacl_Hash_Blake2s_state_t; /** State allocation function when there is no key */ -Hacl_Streaming_Blake2s_128_blake2s_128_state -*Hacl_Streaming_Blake2s_128_blake2s_128_no_key_create_in(void); +Hacl_Hash_Blake2s_state_t *Hacl_Hash_Blake2s_malloc(void); /** - (Re-)initialization function when there is no key + Re-initialization function when there is no key */ -void -Hacl_Streaming_Blake2s_128_blake2s_128_no_key_init( - Hacl_Streaming_Blake2s_128_blake2s_128_state *s -); +void Hacl_Hash_Blake2s_reset(Hacl_Hash_Blake2s_state_t *state); /** Update function when there is no key; 0 = success, 1 = max length exceeded */ Hacl_Streaming_Types_error_code -Hacl_Streaming_Blake2s_128_blake2s_128_no_key_update( - Hacl_Streaming_Blake2s_128_blake2s_128_state *p, - uint8_t *data, - uint32_t len -); +Hacl_Hash_Blake2s_update(Hacl_Hash_Blake2s_state_t *state, uint8_t *chunk, uint32_t chunk_len); /** Finish function when there is no key */ -void -Hacl_Streaming_Blake2s_128_blake2s_128_no_key_finish( - Hacl_Streaming_Blake2s_128_blake2s_128_state *p, - uint8_t *dst -); +void Hacl_Hash_Blake2s_digest(Hacl_Hash_Blake2s_state_t *state, uint8_t *output); /** Free state function when there is no key */ +void Hacl_Hash_Blake2s_free(Hacl_Hash_Blake2s_state_t *state); + +/** +Write the BLAKE2s digest of message `input` using key `key` into `output`. + +@param output Pointer to `output_len` bytes of memory where the digest is written to. +@param output_len Length of the to-be-generated digest with 1 <= `output_len` <= 32. +@param input Pointer to `input_len` bytes of memory where the input message is read from. +@param input_len Length of the input message. +@param key Pointer to `key_len` bytes of memory where the key is read from. +@param key_len Length of the key. Can be 0. +*/ void -Hacl_Streaming_Blake2s_128_blake2s_128_no_key_free( - Hacl_Streaming_Blake2s_128_blake2s_128_state *s +Hacl_Hash_Blake2s_hash_with_key( + uint8_t *output, + uint32_t output_len, + uint8_t *input, + uint32_t input_len, + uint8_t *key, + uint32_t key_len ); #if defined(__cplusplus) } #endif -#define __Hacl_Streaming_Blake2s_128_H_DEFINED +#define __Hacl_Hash_Blake2s_H_DEFINED #endif diff --git a/include/msvc/Hacl_Hash_Blake2s_Simd128.h b/include/msvc/Hacl_Hash_Blake2s_Simd128.h new file mode 100644 index 00000000..6484005e --- /dev/null +++ b/include/msvc/Hacl_Hash_Blake2s_Simd128.h @@ -0,0 +1,112 @@ +/* MIT License + * + * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation + * Copyright (c) 2022-2023 HACL* Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + + +#ifndef __Hacl_Hash_Blake2s_Simd128_H +#define __Hacl_Hash_Blake2s_Simd128_H + +#if defined(__cplusplus) +extern "C" { +#endif + +#include +#include "krml/internal/types.h" +#include "krml/lowstar_endianness.h" +#include "krml/internal/target.h" + +#include "Hacl_Streaming_Types.h" +#include "libintvector.h" + +typedef struct Hacl_Hash_Blake2s_Simd128_block_state_t_s +{ + Lib_IntVector_Intrinsics_vec128 *fst; + Lib_IntVector_Intrinsics_vec128 *snd; +} +Hacl_Hash_Blake2s_Simd128_block_state_t; + +typedef struct Hacl_Hash_Blake2s_Simd128_state_t_s +{ + Hacl_Hash_Blake2s_Simd128_block_state_t block_state; + uint8_t *buf; + uint64_t total_len; +} +Hacl_Hash_Blake2s_Simd128_state_t; + +/** + State allocation function when there is no key +*/ +Hacl_Hash_Blake2s_Simd128_state_t *Hacl_Hash_Blake2s_Simd128_malloc(void); + +/** + Re-initialization function when there is no key +*/ +void Hacl_Hash_Blake2s_Simd128_reset(Hacl_Hash_Blake2s_Simd128_state_t *state); + +/** + Update function when there is no key; 0 = success, 1 = max length exceeded +*/ +Hacl_Streaming_Types_error_code +Hacl_Hash_Blake2s_Simd128_update( + Hacl_Hash_Blake2s_Simd128_state_t *state, + uint8_t *chunk, + uint32_t chunk_len +); + +/** + Finish function when there is no key +*/ +void +Hacl_Hash_Blake2s_Simd128_digest(Hacl_Hash_Blake2s_Simd128_state_t *state, uint8_t *output); + +/** + Free state function when there is no key +*/ +void Hacl_Hash_Blake2s_Simd128_free(Hacl_Hash_Blake2s_Simd128_state_t *state); + +/** +Write the BLAKE2s digest of message `input` using key `key` into `output`. + +@param output Pointer to `output_len` bytes of memory where the digest is written to. +@param output_len Length of the to-be-generated digest with 1 <= `output_len` <= 32. +@param input Pointer to `input_len` bytes of memory where the input message is read from. +@param input_len Length of the input message. +@param key Pointer to `key_len` bytes of memory where the key is read from. +@param key_len Length of the key. Can be 0. +*/ +void +Hacl_Hash_Blake2s_Simd128_hash_with_key( + uint8_t *output, + uint32_t output_len, + uint8_t *input, + uint32_t input_len, + uint8_t *key, + uint32_t key_len +); + +#if defined(__cplusplus) +} +#endif + +#define __Hacl_Hash_Blake2s_Simd128_H_DEFINED +#endif diff --git a/include/msvc/Hacl_Hash_MD5.h b/include/msvc/Hacl_Hash_MD5.h index dd4c75e0..db93d7d6 100644 --- a/include/msvc/Hacl_Hash_MD5.h +++ b/include/msvc/Hacl_Hash_MD5.h @@ -37,25 +37,25 @@ extern "C" { #include "Hacl_Streaming_Types.h" -typedef Hacl_Streaming_MD_state_32 Hacl_Streaming_MD5_state; +typedef Hacl_Streaming_MD_state_32 Hacl_Hash_MD5_state_t; -Hacl_Streaming_MD_state_32 *Hacl_Streaming_MD5_legacy_create_in(void); +Hacl_Streaming_MD_state_32 *Hacl_Hash_MD5_malloc(void); -void Hacl_Streaming_MD5_legacy_init(Hacl_Streaming_MD_state_32 *s); +void Hacl_Hash_MD5_reset(Hacl_Streaming_MD_state_32 *state); /** 0 = success, 1 = max length exceeded */ Hacl_Streaming_Types_error_code -Hacl_Streaming_MD5_legacy_update(Hacl_Streaming_MD_state_32 *p, uint8_t *data, uint32_t len); +Hacl_Hash_MD5_update(Hacl_Streaming_MD_state_32 *state, uint8_t *chunk, uint32_t chunk_len); -void Hacl_Streaming_MD5_legacy_finish(Hacl_Streaming_MD_state_32 *p, uint8_t *dst); +void Hacl_Hash_MD5_digest(Hacl_Streaming_MD_state_32 *state, uint8_t *output); -void Hacl_Streaming_MD5_legacy_free(Hacl_Streaming_MD_state_32 *s); +void Hacl_Hash_MD5_free(Hacl_Streaming_MD_state_32 *state); -Hacl_Streaming_MD_state_32 *Hacl_Streaming_MD5_legacy_copy(Hacl_Streaming_MD_state_32 *s0); +Hacl_Streaming_MD_state_32 *Hacl_Hash_MD5_copy(Hacl_Streaming_MD_state_32 *state); -void Hacl_Streaming_MD5_legacy_hash(uint8_t *input, uint32_t input_len, uint8_t *dst); +void Hacl_Hash_MD5_hash(uint8_t *output, uint8_t *input, uint32_t input_len); #if defined(__cplusplus) } diff --git a/include/msvc/Hacl_Hash_SHA1.h b/include/msvc/Hacl_Hash_SHA1.h index 2737b20f..19045440 100644 --- a/include/msvc/Hacl_Hash_SHA1.h +++ b/include/msvc/Hacl_Hash_SHA1.h @@ -37,25 +37,25 @@ extern "C" { #include "Hacl_Streaming_Types.h" -typedef Hacl_Streaming_MD_state_32 Hacl_Streaming_SHA1_state; +typedef Hacl_Streaming_MD_state_32 Hacl_Hash_SHA1_state_t; -Hacl_Streaming_MD_state_32 *Hacl_Streaming_SHA1_legacy_create_in(void); +Hacl_Streaming_MD_state_32 *Hacl_Hash_SHA1_malloc(void); -void Hacl_Streaming_SHA1_legacy_init(Hacl_Streaming_MD_state_32 *s); +void Hacl_Hash_SHA1_reset(Hacl_Streaming_MD_state_32 *state); /** 0 = success, 1 = max length exceeded */ Hacl_Streaming_Types_error_code -Hacl_Streaming_SHA1_legacy_update(Hacl_Streaming_MD_state_32 *p, uint8_t *data, uint32_t len); +Hacl_Hash_SHA1_update(Hacl_Streaming_MD_state_32 *state, uint8_t *chunk, uint32_t chunk_len); -void Hacl_Streaming_SHA1_legacy_finish(Hacl_Streaming_MD_state_32 *p, uint8_t *dst); +void Hacl_Hash_SHA1_digest(Hacl_Streaming_MD_state_32 *state, uint8_t *output); -void Hacl_Streaming_SHA1_legacy_free(Hacl_Streaming_MD_state_32 *s); +void Hacl_Hash_SHA1_free(Hacl_Streaming_MD_state_32 *state); -Hacl_Streaming_MD_state_32 *Hacl_Streaming_SHA1_legacy_copy(Hacl_Streaming_MD_state_32 *s0); +Hacl_Streaming_MD_state_32 *Hacl_Hash_SHA1_copy(Hacl_Streaming_MD_state_32 *state); -void Hacl_Streaming_SHA1_legacy_hash(uint8_t *input, uint32_t input_len, uint8_t *dst); +void Hacl_Hash_SHA1_hash(uint8_t *output, uint8_t *input, uint32_t input_len); #if defined(__cplusplus) } diff --git a/include/msvc/Hacl_Hash_SHA2.h b/include/msvc/Hacl_Hash_SHA2.h index 8f98d878..d17eab94 100644 --- a/include/msvc/Hacl_Hash_SHA2.h +++ b/include/msvc/Hacl_Hash_SHA2.h @@ -38,19 +38,19 @@ extern "C" { #include "Hacl_Streaming_Types.h" #include "Hacl_Krmllib.h" -typedef Hacl_Streaming_MD_state_32 Hacl_Streaming_SHA2_state_sha2_224; +typedef Hacl_Streaming_MD_state_32 Hacl_Hash_SHA2_state_t_224; -typedef Hacl_Streaming_MD_state_32 Hacl_Streaming_SHA2_state_sha2_256; +typedef Hacl_Streaming_MD_state_32 Hacl_Hash_SHA2_state_t_256; -typedef Hacl_Streaming_MD_state_64 Hacl_Streaming_SHA2_state_sha2_384; +typedef Hacl_Streaming_MD_state_64 Hacl_Hash_SHA2_state_t_384; -typedef Hacl_Streaming_MD_state_64 Hacl_Streaming_SHA2_state_sha2_512; +typedef Hacl_Streaming_MD_state_64 Hacl_Hash_SHA2_state_t_512; /** Allocate initial state for the SHA2_256 hash. The state is to be freed by calling `free_256`. */ -Hacl_Streaming_MD_state_32 *Hacl_Streaming_SHA2_create_in_256(void); +Hacl_Streaming_MD_state_32 *Hacl_Hash_SHA2_malloc_256(void); /** Copies the state passed as argument into a newly allocated state (deep copy). @@ -58,73 +58,73 @@ The state is to be freed by calling `free_256`. Cloning the state this way is useful, for instance, if your control-flow diverges and you need to feed more (different) data into the hash in each branch. */ -Hacl_Streaming_MD_state_32 *Hacl_Streaming_SHA2_copy_256(Hacl_Streaming_MD_state_32 *s0); +Hacl_Streaming_MD_state_32 *Hacl_Hash_SHA2_copy_256(Hacl_Streaming_MD_state_32 *state); /** Reset an existing state to the initial hash state with empty data. */ -void Hacl_Streaming_SHA2_init_256(Hacl_Streaming_MD_state_32 *s); +void Hacl_Hash_SHA2_reset_256(Hacl_Streaming_MD_state_32 *state); /** Feed an arbitrary amount of data into the hash. This function returns 0 for success, or 1 if the combined length of all of the data passed to `update_256` -(since the last call to `init_256`) exceeds 2^61-1 bytes. +(since the last call to `reset_256`) exceeds 2^61-1 bytes. This function is identical to the update function for SHA2_224. */ Hacl_Streaming_Types_error_code -Hacl_Streaming_SHA2_update_256( - Hacl_Streaming_MD_state_32 *p, +Hacl_Hash_SHA2_update_256( + Hacl_Streaming_MD_state_32 *state, uint8_t *input, uint32_t input_len ); /** -Write the resulting hash into `dst`, an array of 32 bytes. The state remains -valid after a call to `finish_256`, meaning the user may feed more data into -the hash via `update_256`. (The finish_256 function operates on an internal copy of +Write the resulting hash into `output`, an array of 32 bytes. The state remains +valid after a call to `digest_256`, meaning the user may feed more data into +the hash via `update_256`. (The digest_256 function operates on an internal copy of the state and therefore does not invalidate the client-held state `p`.) */ -void Hacl_Streaming_SHA2_finish_256(Hacl_Streaming_MD_state_32 *p, uint8_t *dst); +void Hacl_Hash_SHA2_digest_256(Hacl_Streaming_MD_state_32 *state, uint8_t *output); /** -Free a state allocated with `create_in_256`. +Free a state allocated with `malloc_256`. This function is identical to the free function for SHA2_224. */ -void Hacl_Streaming_SHA2_free_256(Hacl_Streaming_MD_state_32 *s); +void Hacl_Hash_SHA2_free_256(Hacl_Streaming_MD_state_32 *state); /** -Hash `input`, of len `input_len`, into `dst`, an array of 32 bytes. +Hash `input`, of len `input_len`, into `output`, an array of 32 bytes. */ -void Hacl_Streaming_SHA2_hash_256(uint8_t *input, uint32_t input_len, uint8_t *dst); +void Hacl_Hash_SHA2_hash_256(uint8_t *output, uint8_t *input, uint32_t input_len); -Hacl_Streaming_MD_state_32 *Hacl_Streaming_SHA2_create_in_224(void); +Hacl_Streaming_MD_state_32 *Hacl_Hash_SHA2_malloc_224(void); -void Hacl_Streaming_SHA2_init_224(Hacl_Streaming_MD_state_32 *s); +void Hacl_Hash_SHA2_reset_224(Hacl_Streaming_MD_state_32 *state); Hacl_Streaming_Types_error_code -Hacl_Streaming_SHA2_update_224( - Hacl_Streaming_MD_state_32 *p, +Hacl_Hash_SHA2_update_224( + Hacl_Streaming_MD_state_32 *state, uint8_t *input, uint32_t input_len ); /** -Write the resulting hash into `dst`, an array of 28 bytes. The state remains -valid after a call to `finish_224`, meaning the user may feed more data into +Write the resulting hash into `output`, an array of 28 bytes. The state remains +valid after a call to `digest_224`, meaning the user may feed more data into the hash via `update_224`. */ -void Hacl_Streaming_SHA2_finish_224(Hacl_Streaming_MD_state_32 *p, uint8_t *dst); +void Hacl_Hash_SHA2_digest_224(Hacl_Streaming_MD_state_32 *state, uint8_t *output); -void Hacl_Streaming_SHA2_free_224(Hacl_Streaming_MD_state_32 *p); +void Hacl_Hash_SHA2_free_224(Hacl_Streaming_MD_state_32 *state); /** -Hash `input`, of len `input_len`, into `dst`, an array of 28 bytes. +Hash `input`, of len `input_len`, into `output`, an array of 28 bytes. */ -void Hacl_Streaming_SHA2_hash_224(uint8_t *input, uint32_t input_len, uint8_t *dst); +void Hacl_Hash_SHA2_hash_224(uint8_t *output, uint8_t *input, uint32_t input_len); -Hacl_Streaming_MD_state_64 *Hacl_Streaming_SHA2_create_in_512(void); +Hacl_Streaming_MD_state_64 *Hacl_Hash_SHA2_malloc_512(void); /** Copies the state passed as argument into a newly allocated state (deep copy). @@ -132,68 +132,68 @@ The state is to be freed by calling `free_512`. Cloning the state this way is useful, for instance, if your control-flow diverges and you need to feed more (different) data into the hash in each branch. */ -Hacl_Streaming_MD_state_64 *Hacl_Streaming_SHA2_copy_512(Hacl_Streaming_MD_state_64 *s0); +Hacl_Streaming_MD_state_64 *Hacl_Hash_SHA2_copy_512(Hacl_Streaming_MD_state_64 *state); -void Hacl_Streaming_SHA2_init_512(Hacl_Streaming_MD_state_64 *s); +void Hacl_Hash_SHA2_reset_512(Hacl_Streaming_MD_state_64 *state); /** Feed an arbitrary amount of data into the hash. This function returns 0 for success, or 1 if the combined length of all of the data passed to `update_512` -(since the last call to `init_512`) exceeds 2^125-1 bytes. +(since the last call to `reset_512`) exceeds 2^125-1 bytes. This function is identical to the update function for SHA2_384. */ Hacl_Streaming_Types_error_code -Hacl_Streaming_SHA2_update_512( - Hacl_Streaming_MD_state_64 *p, +Hacl_Hash_SHA2_update_512( + Hacl_Streaming_MD_state_64 *state, uint8_t *input, uint32_t input_len ); /** -Write the resulting hash into `dst`, an array of 64 bytes. The state remains -valid after a call to `finish_512`, meaning the user may feed more data into -the hash via `update_512`. (The finish_512 function operates on an internal copy of +Write the resulting hash into `output`, an array of 64 bytes. The state remains +valid after a call to `digest_512`, meaning the user may feed more data into +the hash via `update_512`. (The digest_512 function operates on an internal copy of the state and therefore does not invalidate the client-held state `p`.) */ -void Hacl_Streaming_SHA2_finish_512(Hacl_Streaming_MD_state_64 *p, uint8_t *dst); +void Hacl_Hash_SHA2_digest_512(Hacl_Streaming_MD_state_64 *state, uint8_t *output); /** -Free a state allocated with `create_in_512`. +Free a state allocated with `malloc_512`. This function is identical to the free function for SHA2_384. */ -void Hacl_Streaming_SHA2_free_512(Hacl_Streaming_MD_state_64 *s); +void Hacl_Hash_SHA2_free_512(Hacl_Streaming_MD_state_64 *state); /** -Hash `input`, of len `input_len`, into `dst`, an array of 64 bytes. +Hash `input`, of len `input_len`, into `output`, an array of 64 bytes. */ -void Hacl_Streaming_SHA2_hash_512(uint8_t *input, uint32_t input_len, uint8_t *dst); +void Hacl_Hash_SHA2_hash_512(uint8_t *output, uint8_t *input, uint32_t input_len); -Hacl_Streaming_MD_state_64 *Hacl_Streaming_SHA2_create_in_384(void); +Hacl_Streaming_MD_state_64 *Hacl_Hash_SHA2_malloc_384(void); -void Hacl_Streaming_SHA2_init_384(Hacl_Streaming_MD_state_64 *s); +void Hacl_Hash_SHA2_reset_384(Hacl_Streaming_MD_state_64 *state); Hacl_Streaming_Types_error_code -Hacl_Streaming_SHA2_update_384( - Hacl_Streaming_MD_state_64 *p, +Hacl_Hash_SHA2_update_384( + Hacl_Streaming_MD_state_64 *state, uint8_t *input, uint32_t input_len ); /** -Write the resulting hash into `dst`, an array of 48 bytes. The state remains -valid after a call to `finish_384`, meaning the user may feed more data into +Write the resulting hash into `output`, an array of 48 bytes. The state remains +valid after a call to `digest_384`, meaning the user may feed more data into the hash via `update_384`. */ -void Hacl_Streaming_SHA2_finish_384(Hacl_Streaming_MD_state_64 *p, uint8_t *dst); +void Hacl_Hash_SHA2_digest_384(Hacl_Streaming_MD_state_64 *state, uint8_t *output); -void Hacl_Streaming_SHA2_free_384(Hacl_Streaming_MD_state_64 *p); +void Hacl_Hash_SHA2_free_384(Hacl_Streaming_MD_state_64 *state); /** -Hash `input`, of len `input_len`, into `dst`, an array of 48 bytes. +Hash `input`, of len `input_len`, into `output`, an array of 48 bytes. */ -void Hacl_Streaming_SHA2_hash_384(uint8_t *input, uint32_t input_len, uint8_t *dst); +void Hacl_Hash_SHA2_hash_384(uint8_t *output, uint8_t *input, uint32_t input_len); #if defined(__cplusplus) } diff --git a/include/msvc/Hacl_Hash_SHA3.h b/include/msvc/Hacl_Hash_SHA3.h index e2f5ff06..e09f8745 100644 --- a/include/msvc/Hacl_Hash_SHA3.h +++ b/include/msvc/Hacl_Hash_SHA3.h @@ -37,48 +37,48 @@ extern "C" { #include "Hacl_Streaming_Types.h" -typedef struct Hacl_Streaming_Keccak_hash_buf_s +typedef struct Hacl_Hash_SHA3_hash_buf_s { Spec_Hash_Definitions_hash_alg fst; uint64_t *snd; } -Hacl_Streaming_Keccak_hash_buf; +Hacl_Hash_SHA3_hash_buf; -typedef struct Hacl_Streaming_Keccak_state_s +typedef struct Hacl_Hash_SHA3_state_t_s { - Hacl_Streaming_Keccak_hash_buf block_state; + Hacl_Hash_SHA3_hash_buf block_state; uint8_t *buf; uint64_t total_len; } -Hacl_Streaming_Keccak_state; +Hacl_Hash_SHA3_state_t; -Spec_Hash_Definitions_hash_alg Hacl_Streaming_Keccak_get_alg(Hacl_Streaming_Keccak_state *s); +Spec_Hash_Definitions_hash_alg Hacl_Hash_SHA3_get_alg(Hacl_Hash_SHA3_state_t *s); -Hacl_Streaming_Keccak_state *Hacl_Streaming_Keccak_malloc(Spec_Hash_Definitions_hash_alg a); +Hacl_Hash_SHA3_state_t *Hacl_Hash_SHA3_malloc(Spec_Hash_Definitions_hash_alg a); -void Hacl_Streaming_Keccak_free(Hacl_Streaming_Keccak_state *s); +void Hacl_Hash_SHA3_free(Hacl_Hash_SHA3_state_t *state); -Hacl_Streaming_Keccak_state *Hacl_Streaming_Keccak_copy(Hacl_Streaming_Keccak_state *s0); +Hacl_Hash_SHA3_state_t *Hacl_Hash_SHA3_copy(Hacl_Hash_SHA3_state_t *state); -void Hacl_Streaming_Keccak_reset(Hacl_Streaming_Keccak_state *s); +void Hacl_Hash_SHA3_reset(Hacl_Hash_SHA3_state_t *state); Hacl_Streaming_Types_error_code -Hacl_Streaming_Keccak_update(Hacl_Streaming_Keccak_state *p, uint8_t *data, uint32_t len); +Hacl_Hash_SHA3_update(Hacl_Hash_SHA3_state_t *state, uint8_t *chunk, uint32_t chunk_len); Hacl_Streaming_Types_error_code -Hacl_Streaming_Keccak_finish(Hacl_Streaming_Keccak_state *s, uint8_t *dst); +Hacl_Hash_SHA3_digest(Hacl_Hash_SHA3_state_t *state, uint8_t *output); Hacl_Streaming_Types_error_code -Hacl_Streaming_Keccak_squeeze(Hacl_Streaming_Keccak_state *s, uint8_t *dst, uint32_t l); +Hacl_Hash_SHA3_squeeze(Hacl_Hash_SHA3_state_t *s, uint8_t *dst, uint32_t l); -uint32_t Hacl_Streaming_Keccak_block_len(Hacl_Streaming_Keccak_state *s); +uint32_t Hacl_Hash_SHA3_block_len(Hacl_Hash_SHA3_state_t *s); -uint32_t Hacl_Streaming_Keccak_hash_len(Hacl_Streaming_Keccak_state *s); +uint32_t Hacl_Hash_SHA3_hash_len(Hacl_Hash_SHA3_state_t *s); -bool Hacl_Streaming_Keccak_is_shake(Hacl_Streaming_Keccak_state *s); +bool Hacl_Hash_SHA3_is_shake(Hacl_Hash_SHA3_state_t *s); void -Hacl_SHA3_shake128_hacl( +Hacl_Hash_SHA3_shake128_hacl( uint32_t inputByteLen, uint8_t *input, uint32_t outputByteLen, @@ -86,25 +86,25 @@ Hacl_SHA3_shake128_hacl( ); void -Hacl_SHA3_shake256_hacl( +Hacl_Hash_SHA3_shake256_hacl( uint32_t inputByteLen, uint8_t *input, uint32_t outputByteLen, uint8_t *output ); -void Hacl_SHA3_sha3_224(uint32_t inputByteLen, uint8_t *input, uint8_t *output); +void Hacl_Hash_SHA3_sha3_224(uint8_t *output, uint8_t *input, uint32_t input_len); -void Hacl_SHA3_sha3_256(uint32_t inputByteLen, uint8_t *input, uint8_t *output); +void Hacl_Hash_SHA3_sha3_256(uint8_t *output, uint8_t *input, uint32_t input_len); -void Hacl_SHA3_sha3_384(uint32_t inputByteLen, uint8_t *input, uint8_t *output); +void Hacl_Hash_SHA3_sha3_384(uint8_t *output, uint8_t *input, uint32_t input_len); -void Hacl_SHA3_sha3_512(uint32_t inputByteLen, uint8_t *input, uint8_t *output); +void Hacl_Hash_SHA3_sha3_512(uint8_t *output, uint8_t *input, uint32_t input_len); -void Hacl_Impl_SHA3_absorb_inner(uint32_t rateInBytes, uint8_t *block, uint64_t *s); +void Hacl_Hash_SHA3_absorb_inner(uint32_t rateInBytes, uint8_t *block, uint64_t *s); void -Hacl_Impl_SHA3_squeeze( +Hacl_Hash_SHA3_squeeze0( uint64_t *s, uint32_t rateInBytes, uint32_t outputByteLen, @@ -112,7 +112,7 @@ Hacl_Impl_SHA3_squeeze( ); void -Hacl_Impl_SHA3_keccak( +Hacl_Hash_SHA3_keccak( uint32_t rate, uint32_t capacity, uint32_t inputByteLen, diff --git a/include/msvc/Hacl_IntTypes_Intrinsics.h b/include/msvc/Hacl_IntTypes_Intrinsics.h index e2a193e9..c816b046 100644 --- a/include/msvc/Hacl_IntTypes_Intrinsics.h +++ b/include/msvc/Hacl_IntTypes_Intrinsics.h @@ -41,7 +41,7 @@ static inline uint32_t Hacl_IntTypes_Intrinsics_add_carry_u32(uint32_t cin, uint32_t x, uint32_t y, uint32_t *r) { uint64_t res = (uint64_t)x + (uint64_t)cin + (uint64_t)y; - uint32_t c = (uint32_t)(res >> (uint32_t)32U); + uint32_t c = (uint32_t)(res >> 32U); r[0U] = (uint32_t)res; return c; } @@ -50,7 +50,7 @@ static inline uint32_t Hacl_IntTypes_Intrinsics_sub_borrow_u32(uint32_t cin, uint32_t x, uint32_t y, uint32_t *r) { uint64_t res = (uint64_t)x - (uint64_t)y - (uint64_t)cin; - uint32_t c = (uint32_t)(res >> (uint32_t)32U) & (uint32_t)1U; + uint32_t c = (uint32_t)(res >> 32U) & 1U; r[0U] = (uint32_t)res; return c; } @@ -59,8 +59,7 @@ static inline uint64_t Hacl_IntTypes_Intrinsics_add_carry_u64(uint64_t cin, uint64_t x, uint64_t y, uint64_t *r) { uint64_t res = x + cin + y; - uint64_t - c = (~FStar_UInt64_gte_mask(res, x) | (FStar_UInt64_eq_mask(res, x) & cin)) & (uint64_t)1U; + uint64_t c = (~FStar_UInt64_gte_mask(res, x) | (FStar_UInt64_eq_mask(res, x) & cin)) & 1ULL; r[0U] = res; return c; } @@ -73,7 +72,7 @@ Hacl_IntTypes_Intrinsics_sub_borrow_u64(uint64_t cin, uint64_t x, uint64_t y, ui c = ((FStar_UInt64_gte_mask(res, x) & ~FStar_UInt64_eq_mask(res, x)) | (FStar_UInt64_eq_mask(res, x) & cin)) - & (uint64_t)1U; + & 1ULL; r[0U] = res; return c; } diff --git a/include/msvc/Hacl_IntTypes_Intrinsics_128.h b/include/msvc/Hacl_IntTypes_Intrinsics_128.h index aa843a6c..d3008969 100644 --- a/include/msvc/Hacl_IntTypes_Intrinsics_128.h +++ b/include/msvc/Hacl_IntTypes_Intrinsics_128.h @@ -45,7 +45,7 @@ Hacl_IntTypes_Intrinsics_128_add_carry_u64(uint64_t cin, uint64_t x, uint64_t y, FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_uint64_to_uint128(x), FStar_UInt128_uint64_to_uint128(cin)), FStar_UInt128_uint64_to_uint128(y)); - uint64_t c = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(res, (uint32_t)64U)); + uint64_t c = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(res, 64U)); r[0U] = FStar_UInt128_uint128_to_uint64(res); return c; } @@ -58,10 +58,7 @@ Hacl_IntTypes_Intrinsics_128_sub_borrow_u64(uint64_t cin, uint64_t x, uint64_t y FStar_UInt128_sub_mod(FStar_UInt128_sub_mod(FStar_UInt128_uint64_to_uint128(x), FStar_UInt128_uint64_to_uint128(y)), FStar_UInt128_uint64_to_uint128(cin)); - uint64_t - c = - FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(res, (uint32_t)64U)) - & (uint64_t)1U; + uint64_t c = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(res, 64U)) & 1ULL; r[0U] = FStar_UInt128_uint128_to_uint64(res); return c; } diff --git a/include/Hacl_Streaming_Poly1305_32.h b/include/msvc/Hacl_MAC_Poly1305.h similarity index 67% rename from include/Hacl_Streaming_Poly1305_32.h rename to include/msvc/Hacl_MAC_Poly1305.h index 88d1a513..95ac4be2 100644 --- a/include/Hacl_Streaming_Poly1305_32.h +++ b/include/msvc/Hacl_MAC_Poly1305.h @@ -23,8 +23,8 @@ */ -#ifndef __Hacl_Streaming_Poly1305_32_H -#define __Hacl_Streaming_Poly1305_32_H +#ifndef __Hacl_MAC_Poly1305_H +#define __Hacl_MAC_Poly1305_H #if defined(__cplusplus) extern "C" { @@ -36,43 +36,36 @@ extern "C" { #include "krml/internal/target.h" #include "Hacl_Streaming_Types.h" -#include "Hacl_Poly1305_32.h" +#include "Hacl_Krmllib.h" -typedef struct Hacl_Streaming_Poly1305_32_poly1305_32_state_s +typedef struct Hacl_MAC_Poly1305_state_t_s { uint64_t *block_state; uint8_t *buf; uint64_t total_len; uint8_t *p_key; } -Hacl_Streaming_Poly1305_32_poly1305_32_state; +Hacl_MAC_Poly1305_state_t; -Hacl_Streaming_Poly1305_32_poly1305_32_state *Hacl_Streaming_Poly1305_32_create_in(uint8_t *k); +Hacl_MAC_Poly1305_state_t *Hacl_MAC_Poly1305_malloc(uint8_t *key); -void -Hacl_Streaming_Poly1305_32_init(uint8_t *k, Hacl_Streaming_Poly1305_32_poly1305_32_state *s); +void Hacl_MAC_Poly1305_reset(Hacl_MAC_Poly1305_state_t *state, uint8_t *key); /** 0 = success, 1 = max length exceeded */ Hacl_Streaming_Types_error_code -Hacl_Streaming_Poly1305_32_update( - Hacl_Streaming_Poly1305_32_poly1305_32_state *p, - uint8_t *data, - uint32_t len -); +Hacl_MAC_Poly1305_update(Hacl_MAC_Poly1305_state_t *state, uint8_t *chunk, uint32_t chunk_len); -void -Hacl_Streaming_Poly1305_32_finish( - Hacl_Streaming_Poly1305_32_poly1305_32_state *p, - uint8_t *dst -); +void Hacl_MAC_Poly1305_digest(Hacl_MAC_Poly1305_state_t *state, uint8_t *output); -void Hacl_Streaming_Poly1305_32_free(Hacl_Streaming_Poly1305_32_poly1305_32_state *s); +void Hacl_MAC_Poly1305_free(Hacl_MAC_Poly1305_state_t *state); + +void Hacl_MAC_Poly1305_mac(uint8_t *output, uint8_t *input, uint32_t input_len, uint8_t *key); #if defined(__cplusplus) } #endif -#define __Hacl_Streaming_Poly1305_32_H_DEFINED +#define __Hacl_MAC_Poly1305_H_DEFINED #endif diff --git a/include/msvc/Hacl_Streaming_Poly1305_128.h b/include/msvc/Hacl_MAC_Poly1305_Simd128.h similarity index 67% rename from include/msvc/Hacl_Streaming_Poly1305_128.h rename to include/msvc/Hacl_MAC_Poly1305_Simd128.h index d6299052..9b69ebd4 100644 --- a/include/msvc/Hacl_Streaming_Poly1305_128.h +++ b/include/msvc/Hacl_MAC_Poly1305_Simd128.h @@ -23,8 +23,8 @@ */ -#ifndef __Hacl_Streaming_Poly1305_128_H -#define __Hacl_Streaming_Poly1305_128_H +#ifndef __Hacl_MAC_Poly1305_Simd128_H +#define __Hacl_MAC_Poly1305_Simd128_H #if defined(__cplusplus) extern "C" { @@ -36,44 +36,47 @@ extern "C" { #include "krml/internal/target.h" #include "Hacl_Streaming_Types.h" -#include "Hacl_Poly1305_128.h" +#include "libintvector.h" -typedef struct Hacl_Streaming_Poly1305_128_poly1305_128_state_s +typedef struct Hacl_MAC_Poly1305_Simd128_state_t_s { Lib_IntVector_Intrinsics_vec128 *block_state; uint8_t *buf; uint64_t total_len; uint8_t *p_key; } -Hacl_Streaming_Poly1305_128_poly1305_128_state; +Hacl_MAC_Poly1305_Simd128_state_t; -Hacl_Streaming_Poly1305_128_poly1305_128_state -*Hacl_Streaming_Poly1305_128_create_in(uint8_t *k); +Hacl_MAC_Poly1305_Simd128_state_t *Hacl_MAC_Poly1305_Simd128_malloc(uint8_t *key); -void -Hacl_Streaming_Poly1305_128_init(uint8_t *k, Hacl_Streaming_Poly1305_128_poly1305_128_state *s); +void Hacl_MAC_Poly1305_Simd128_reset(Hacl_MAC_Poly1305_Simd128_state_t *state, uint8_t *key); /** 0 = success, 1 = max length exceeded */ Hacl_Streaming_Types_error_code -Hacl_Streaming_Poly1305_128_update( - Hacl_Streaming_Poly1305_128_poly1305_128_state *p, - uint8_t *data, - uint32_t len +Hacl_MAC_Poly1305_Simd128_update( + Hacl_MAC_Poly1305_Simd128_state_t *state, + uint8_t *chunk, + uint32_t chunk_len ); void -Hacl_Streaming_Poly1305_128_finish( - Hacl_Streaming_Poly1305_128_poly1305_128_state *p, - uint8_t *dst -); +Hacl_MAC_Poly1305_Simd128_digest(Hacl_MAC_Poly1305_Simd128_state_t *state, uint8_t *output); + +void Hacl_MAC_Poly1305_Simd128_free(Hacl_MAC_Poly1305_Simd128_state_t *state); -void Hacl_Streaming_Poly1305_128_free(Hacl_Streaming_Poly1305_128_poly1305_128_state *s); +void +Hacl_MAC_Poly1305_Simd128_mac( + uint8_t *output, + uint8_t *input, + uint32_t input_len, + uint8_t *key +); #if defined(__cplusplus) } #endif -#define __Hacl_Streaming_Poly1305_128_H_DEFINED +#define __Hacl_MAC_Poly1305_Simd128_H_DEFINED #endif diff --git a/include/Hacl_Streaming_Poly1305_256.h b/include/msvc/Hacl_MAC_Poly1305_Simd256.h similarity index 67% rename from include/Hacl_Streaming_Poly1305_256.h rename to include/msvc/Hacl_MAC_Poly1305_Simd256.h index 689b837b..89f4a104 100644 --- a/include/Hacl_Streaming_Poly1305_256.h +++ b/include/msvc/Hacl_MAC_Poly1305_Simd256.h @@ -23,8 +23,8 @@ */ -#ifndef __Hacl_Streaming_Poly1305_256_H -#define __Hacl_Streaming_Poly1305_256_H +#ifndef __Hacl_MAC_Poly1305_Simd256_H +#define __Hacl_MAC_Poly1305_Simd256_H #if defined(__cplusplus) extern "C" { @@ -36,44 +36,47 @@ extern "C" { #include "krml/internal/target.h" #include "Hacl_Streaming_Types.h" -#include "Hacl_Poly1305_256.h" +#include "libintvector.h" -typedef struct Hacl_Streaming_Poly1305_256_poly1305_256_state_s +typedef struct Hacl_MAC_Poly1305_Simd256_state_t_s { Lib_IntVector_Intrinsics_vec256 *block_state; uint8_t *buf; uint64_t total_len; uint8_t *p_key; } -Hacl_Streaming_Poly1305_256_poly1305_256_state; +Hacl_MAC_Poly1305_Simd256_state_t; -Hacl_Streaming_Poly1305_256_poly1305_256_state -*Hacl_Streaming_Poly1305_256_create_in(uint8_t *k); +Hacl_MAC_Poly1305_Simd256_state_t *Hacl_MAC_Poly1305_Simd256_malloc(uint8_t *key); -void -Hacl_Streaming_Poly1305_256_init(uint8_t *k, Hacl_Streaming_Poly1305_256_poly1305_256_state *s); +void Hacl_MAC_Poly1305_Simd256_reset(Hacl_MAC_Poly1305_Simd256_state_t *state, uint8_t *key); /** 0 = success, 1 = max length exceeded */ Hacl_Streaming_Types_error_code -Hacl_Streaming_Poly1305_256_update( - Hacl_Streaming_Poly1305_256_poly1305_256_state *p, - uint8_t *data, - uint32_t len +Hacl_MAC_Poly1305_Simd256_update( + Hacl_MAC_Poly1305_Simd256_state_t *state, + uint8_t *chunk, + uint32_t chunk_len ); void -Hacl_Streaming_Poly1305_256_finish( - Hacl_Streaming_Poly1305_256_poly1305_256_state *p, - uint8_t *dst -); +Hacl_MAC_Poly1305_Simd256_digest(Hacl_MAC_Poly1305_Simd256_state_t *state, uint8_t *output); + +void Hacl_MAC_Poly1305_Simd256_free(Hacl_MAC_Poly1305_Simd256_state_t *state); -void Hacl_Streaming_Poly1305_256_free(Hacl_Streaming_Poly1305_256_poly1305_256_state *s); +void +Hacl_MAC_Poly1305_Simd256_mac( + uint8_t *output, + uint8_t *input, + uint32_t input_len, + uint8_t *key +); #if defined(__cplusplus) } #endif -#define __Hacl_Streaming_Poly1305_256_H_DEFINED +#define __Hacl_MAC_Poly1305_Simd256_H_DEFINED #endif diff --git a/include/msvc/Hacl_NaCl.h b/include/msvc/Hacl_NaCl.h index b7e91a4b..a3ca6804 100644 --- a/include/msvc/Hacl_NaCl.h +++ b/include/msvc/Hacl_NaCl.h @@ -36,7 +36,7 @@ extern "C" { #include "krml/internal/target.h" #include "Hacl_Salsa20.h" -#include "Hacl_Poly1305_32.h" +#include "Hacl_MAC_Poly1305.h" #include "Hacl_Curve25519_51.h" /** diff --git a/include/msvc/Hacl_Poly1305_128.h b/include/msvc/Hacl_Poly1305_128.h deleted file mode 100644 index 834d4a8a..00000000 --- a/include/msvc/Hacl_Poly1305_128.h +++ /dev/null @@ -1,67 +0,0 @@ -/* MIT License - * - * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation - * Copyright (c) 2022-2023 HACL* Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - - -#ifndef __Hacl_Poly1305_128_H -#define __Hacl_Poly1305_128_H - -#if defined(__cplusplus) -extern "C" { -#endif - -#include -#include "krml/internal/types.h" -#include "krml/lowstar_endianness.h" -#include "krml/internal/target.h" - -#include "libintvector.h" - -typedef Lib_IntVector_Intrinsics_vec128 *Hacl_Poly1305_128_poly1305_ctx; - -void Hacl_Poly1305_128_poly1305_init(Lib_IntVector_Intrinsics_vec128 *ctx, uint8_t *key); - -void Hacl_Poly1305_128_poly1305_update1(Lib_IntVector_Intrinsics_vec128 *ctx, uint8_t *text); - -void -Hacl_Poly1305_128_poly1305_update( - Lib_IntVector_Intrinsics_vec128 *ctx, - uint32_t len, - uint8_t *text -); - -void -Hacl_Poly1305_128_poly1305_finish( - uint8_t *tag, - uint8_t *key, - Lib_IntVector_Intrinsics_vec128 *ctx -); - -void Hacl_Poly1305_128_poly1305_mac(uint8_t *tag, uint32_t len, uint8_t *text, uint8_t *key); - -#if defined(__cplusplus) -} -#endif - -#define __Hacl_Poly1305_128_H_DEFINED -#endif diff --git a/include/msvc/Hacl_Poly1305_32.h b/include/msvc/Hacl_Poly1305_32.h deleted file mode 100644 index f3233b90..00000000 --- a/include/msvc/Hacl_Poly1305_32.h +++ /dev/null @@ -1,57 +0,0 @@ -/* MIT License - * - * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation - * Copyright (c) 2022-2023 HACL* Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - - -#ifndef __Hacl_Poly1305_32_H -#define __Hacl_Poly1305_32_H - -#if defined(__cplusplus) -extern "C" { -#endif - -#include -#include "krml/internal/types.h" -#include "krml/lowstar_endianness.h" -#include "krml/internal/target.h" - -#include "Hacl_Krmllib.h" - -typedef uint64_t *Hacl_Poly1305_32_poly1305_ctx; - -void Hacl_Poly1305_32_poly1305_init(uint64_t *ctx, uint8_t *key); - -void Hacl_Poly1305_32_poly1305_update1(uint64_t *ctx, uint8_t *text); - -void Hacl_Poly1305_32_poly1305_update(uint64_t *ctx, uint32_t len, uint8_t *text); - -void Hacl_Poly1305_32_poly1305_finish(uint8_t *tag, uint8_t *key, uint64_t *ctx); - -void Hacl_Poly1305_32_poly1305_mac(uint8_t *tag, uint32_t len, uint8_t *text, uint8_t *key); - -#if defined(__cplusplus) -} -#endif - -#define __Hacl_Poly1305_32_H_DEFINED -#endif diff --git a/include/msvc/Hacl_Streaming_Blake2.h b/include/msvc/Hacl_Streaming_Blake2.h deleted file mode 100644 index bfb05e4f..00000000 --- a/include/msvc/Hacl_Streaming_Blake2.h +++ /dev/null @@ -1,147 +0,0 @@ -/* MIT License - * - * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation - * Copyright (c) 2022-2023 HACL* Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - - -#ifndef __Hacl_Streaming_Blake2_H -#define __Hacl_Streaming_Blake2_H - -#if defined(__cplusplus) -extern "C" { -#endif - -#include -#include "krml/internal/types.h" -#include "krml/lowstar_endianness.h" -#include "krml/internal/target.h" - -#include "Hacl_Streaming_Types.h" -#include "Hacl_Krmllib.h" -#include "Hacl_Hash_Blake2.h" - -typedef struct Hacl_Streaming_Blake2_blake2s_32_block_state_s -{ - uint32_t *fst; - uint32_t *snd; -} -Hacl_Streaming_Blake2_blake2s_32_block_state; - -typedef struct Hacl_Streaming_Blake2_blake2b_32_block_state_s -{ - uint64_t *fst; - uint64_t *snd; -} -Hacl_Streaming_Blake2_blake2b_32_block_state; - -typedef struct Hacl_Streaming_Blake2_blake2s_32_state_s -{ - Hacl_Streaming_Blake2_blake2s_32_block_state block_state; - uint8_t *buf; - uint64_t total_len; -} -Hacl_Streaming_Blake2_blake2s_32_state; - -typedef struct Hacl_Streaming_Blake2_blake2b_32_state_s -{ - Hacl_Streaming_Blake2_blake2b_32_block_state block_state; - uint8_t *buf; - uint64_t total_len; -} -Hacl_Streaming_Blake2_blake2b_32_state; - -/** - State allocation function when there is no key -*/ -Hacl_Streaming_Blake2_blake2s_32_state -*Hacl_Streaming_Blake2_blake2s_32_no_key_create_in(void); - -/** - (Re-)initialization function when there is no key -*/ -void Hacl_Streaming_Blake2_blake2s_32_no_key_init(Hacl_Streaming_Blake2_blake2s_32_state *s1); - -/** - Update function when there is no key; 0 = success, 1 = max length exceeded -*/ -Hacl_Streaming_Types_error_code -Hacl_Streaming_Blake2_blake2s_32_no_key_update( - Hacl_Streaming_Blake2_blake2s_32_state *p, - uint8_t *data, - uint32_t len -); - -/** - Finish function when there is no key -*/ -void -Hacl_Streaming_Blake2_blake2s_32_no_key_finish( - Hacl_Streaming_Blake2_blake2s_32_state *p, - uint8_t *dst -); - -/** - Free state function when there is no key -*/ -void Hacl_Streaming_Blake2_blake2s_32_no_key_free(Hacl_Streaming_Blake2_blake2s_32_state *s1); - -/** - State allocation function when there is no key -*/ -Hacl_Streaming_Blake2_blake2b_32_state -*Hacl_Streaming_Blake2_blake2b_32_no_key_create_in(void); - -/** - (Re)-initialization function when there is no key -*/ -void Hacl_Streaming_Blake2_blake2b_32_no_key_init(Hacl_Streaming_Blake2_blake2b_32_state *s1); - -/** - Update function when there is no key; 0 = success, 1 = max length exceeded -*/ -Hacl_Streaming_Types_error_code -Hacl_Streaming_Blake2_blake2b_32_no_key_update( - Hacl_Streaming_Blake2_blake2b_32_state *p, - uint8_t *data, - uint32_t len -); - -/** - Finish function when there is no key -*/ -void -Hacl_Streaming_Blake2_blake2b_32_no_key_finish( - Hacl_Streaming_Blake2_blake2b_32_state *p, - uint8_t *dst -); - -/** - Free state function when there is no key -*/ -void Hacl_Streaming_Blake2_blake2b_32_no_key_free(Hacl_Streaming_Blake2_blake2b_32_state *s1); - -#if defined(__cplusplus) -} -#endif - -#define __Hacl_Streaming_Blake2_H_DEFINED -#endif diff --git a/include/msvc/internal/EverCrypt_HMAC.h b/include/msvc/internal/EverCrypt_HMAC.h index 02986e6c..debea462 100644 --- a/include/msvc/internal/EverCrypt_HMAC.h +++ b/include/msvc/internal/EverCrypt_HMAC.h @@ -38,7 +38,9 @@ extern "C" { #include "internal/Hacl_Krmllib.h" #include "internal/Hacl_Hash_SHA2.h" #include "internal/Hacl_Hash_SHA1.h" -#include "internal/Hacl_Hash_Blake2.h" +#include "internal/Hacl_Hash_Blake2s.h" +#include "internal/Hacl_Hash_Blake2b.h" +#include "internal/Hacl_HMAC.h" #include "internal/EverCrypt_Hash.h" #include "../EverCrypt_HMAC.h" diff --git a/include/msvc/internal/EverCrypt_Hash.h b/include/msvc/internal/EverCrypt_Hash.h index c9417677..cd706161 100644 --- a/include/msvc/internal/EverCrypt_Hash.h +++ b/include/msvc/internal/EverCrypt_Hash.h @@ -41,11 +41,15 @@ extern "C" { #include "internal/Hacl_Hash_SHA2.h" #include "internal/Hacl_Hash_SHA1.h" #include "internal/Hacl_Hash_MD5.h" +#include "internal/Hacl_Hash_Blake2s_Simd128.h" +#include "internal/Hacl_Hash_Blake2s.h" +#include "internal/Hacl_Hash_Blake2b_Simd256.h" +#include "internal/Hacl_Hash_Blake2b.h" #include "../EverCrypt_Hash.h" void EverCrypt_Hash_update_multi_256(uint32_t *s, uint8_t *blocks, uint32_t n); -void EverCrypt_Hash_Incremental_hash_256(uint8_t *input, uint32_t input_len, uint8_t *dst); +void EverCrypt_Hash_Incremental_hash_256(uint8_t *output, uint8_t *input, uint32_t input_len); #if defined(__cplusplus) } diff --git a/include/msvc/internal/Hacl_Bignum.h b/include/msvc/internal/Hacl_Bignum.h index 901a8dad..4b31236d 100644 --- a/include/msvc/internal/Hacl_Bignum.h +++ b/include/msvc/internal/Hacl_Bignum.h @@ -124,15 +124,6 @@ Hacl_Bignum_Montgomery_bn_precomp_r2_mod_n_u32( uint32_t *res ); -void -Hacl_Bignum_Montgomery_bn_mont_reduction_u32( - uint32_t len, - uint32_t *n, - uint32_t nInv, - uint32_t *c, - uint32_t *res -); - void Hacl_Bignum_Montgomery_bn_to_mont_u32( uint32_t len, @@ -181,15 +172,6 @@ Hacl_Bignum_Montgomery_bn_precomp_r2_mod_n_u64( uint64_t *res ); -void -Hacl_Bignum_Montgomery_bn_mont_reduction_u64( - uint32_t len, - uint64_t *n, - uint64_t nInv, - uint64_t *c, - uint64_t *res -); - void Hacl_Bignum_Montgomery_bn_to_mont_u64( uint32_t len, @@ -228,6 +210,24 @@ Hacl_Bignum_Montgomery_bn_mont_sqr_u64( uint64_t *resM ); +void +Hacl_Bignum_AlmostMontgomery_bn_almost_mont_reduction_u32( + uint32_t len, + uint32_t *n, + uint32_t nInv, + uint32_t *c, + uint32_t *res +); + +void +Hacl_Bignum_AlmostMontgomery_bn_almost_mont_reduction_u64( + uint32_t len, + uint64_t *n, + uint64_t nInv, + uint64_t *c, + uint64_t *res +); + uint32_t Hacl_Bignum_Exponentiation_bn_check_mod_exp_u32( uint32_t len, diff --git a/include/msvc/internal/Hacl_Bignum25519_51.h b/include/msvc/internal/Hacl_Bignum25519_51.h index 25a10503..4678f8a0 100644 --- a/include/msvc/internal/Hacl_Bignum25519_51.h +++ b/include/msvc/internal/Hacl_Bignum25519_51.h @@ -69,11 +69,11 @@ static inline void Hacl_Impl_Curve25519_Field51_fsub(uint64_t *out, uint64_t *f1 uint64_t f23 = f2[3U]; uint64_t f14 = f1[4U]; uint64_t f24 = f2[4U]; - out[0U] = f10 + (uint64_t)0x3fffffffffff68U - f20; - out[1U] = f11 + (uint64_t)0x3ffffffffffff8U - f21; - out[2U] = f12 + (uint64_t)0x3ffffffffffff8U - f22; - out[3U] = f13 + (uint64_t)0x3ffffffffffff8U - f23; - out[4U] = f14 + (uint64_t)0x3ffffffffffff8U - f24; + out[0U] = f10 + 0x3fffffffffff68ULL - f20; + out[1U] = f11 + 0x3ffffffffffff8ULL - f21; + out[2U] = f12 + 0x3ffffffffffff8ULL - f22; + out[3U] = f13 + 0x3ffffffffffff8ULL - f23; + out[4U] = f14 + 0x3ffffffffffff8ULL - f24; } static inline void @@ -84,7 +84,7 @@ Hacl_Impl_Curve25519_Field51_fmul( FStar_UInt128_uint128 *uu___ ) { - KRML_HOST_IGNORE(uu___); + KRML_MAYBE_UNUSED_VAR(uu___); uint64_t f10 = f1[0U]; uint64_t f11 = f1[1U]; uint64_t f12 = f1[2U]; @@ -95,10 +95,10 @@ Hacl_Impl_Curve25519_Field51_fmul( uint64_t f22 = f2[2U]; uint64_t f23 = f2[3U]; uint64_t f24 = f2[4U]; - uint64_t tmp1 = f21 * (uint64_t)19U; - uint64_t tmp2 = f22 * (uint64_t)19U; - uint64_t tmp3 = f23 * (uint64_t)19U; - uint64_t tmp4 = f24 * (uint64_t)19U; + uint64_t tmp1 = f21 * 19ULL; + uint64_t tmp2 = f22 * 19ULL; + uint64_t tmp3 = f23 * 19ULL; + uint64_t tmp4 = f24 * 19ULL; FStar_UInt128_uint128 o00 = FStar_UInt128_mul_wide(f10, f20); FStar_UInt128_uint128 o10 = FStar_UInt128_mul_wide(f10, f21); FStar_UInt128_uint128 o20 = FStar_UInt128_mul_wide(f10, f22); @@ -129,25 +129,24 @@ Hacl_Impl_Curve25519_Field51_fmul( FStar_UInt128_uint128 tmp_w2 = o24; FStar_UInt128_uint128 tmp_w3 = o34; FStar_UInt128_uint128 tmp_w4 = o44; - FStar_UInt128_uint128 - l_ = FStar_UInt128_add(tmp_w0, FStar_UInt128_uint64_to_uint128((uint64_t)0U)); - uint64_t tmp01 = FStar_UInt128_uint128_to_uint64(l_) & (uint64_t)0x7ffffffffffffU; - uint64_t c0 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_, (uint32_t)51U)); + FStar_UInt128_uint128 l_ = FStar_UInt128_add(tmp_w0, FStar_UInt128_uint64_to_uint128(0ULL)); + uint64_t tmp01 = FStar_UInt128_uint128_to_uint64(l_) & 0x7ffffffffffffULL; + uint64_t c0 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_, 51U)); FStar_UInt128_uint128 l_0 = FStar_UInt128_add(tmp_w1, FStar_UInt128_uint64_to_uint128(c0)); - uint64_t tmp11 = FStar_UInt128_uint128_to_uint64(l_0) & (uint64_t)0x7ffffffffffffU; - uint64_t c1 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_0, (uint32_t)51U)); + uint64_t tmp11 = FStar_UInt128_uint128_to_uint64(l_0) & 0x7ffffffffffffULL; + uint64_t c1 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_0, 51U)); FStar_UInt128_uint128 l_1 = FStar_UInt128_add(tmp_w2, FStar_UInt128_uint64_to_uint128(c1)); - uint64_t tmp21 = FStar_UInt128_uint128_to_uint64(l_1) & (uint64_t)0x7ffffffffffffU; - uint64_t c2 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_1, (uint32_t)51U)); + uint64_t tmp21 = FStar_UInt128_uint128_to_uint64(l_1) & 0x7ffffffffffffULL; + uint64_t c2 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_1, 51U)); FStar_UInt128_uint128 l_2 = FStar_UInt128_add(tmp_w3, FStar_UInt128_uint64_to_uint128(c2)); - uint64_t tmp31 = FStar_UInt128_uint128_to_uint64(l_2) & (uint64_t)0x7ffffffffffffU; - uint64_t c3 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_2, (uint32_t)51U)); + uint64_t tmp31 = FStar_UInt128_uint128_to_uint64(l_2) & 0x7ffffffffffffULL; + uint64_t c3 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_2, 51U)); FStar_UInt128_uint128 l_3 = FStar_UInt128_add(tmp_w4, FStar_UInt128_uint64_to_uint128(c3)); - uint64_t tmp41 = FStar_UInt128_uint128_to_uint64(l_3) & (uint64_t)0x7ffffffffffffU; - uint64_t c4 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_3, (uint32_t)51U)); - uint64_t l_4 = tmp01 + c4 * (uint64_t)19U; - uint64_t tmp0_ = l_4 & (uint64_t)0x7ffffffffffffU; - uint64_t c5 = l_4 >> (uint32_t)51U; + uint64_t tmp41 = FStar_UInt128_uint128_to_uint64(l_3) & 0x7ffffffffffffULL; + uint64_t c4 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_3, 51U)); + uint64_t l_4 = tmp01 + c4 * 19ULL; + uint64_t tmp0_ = l_4 & 0x7ffffffffffffULL; + uint64_t c5 = l_4 >> 51U; uint64_t o0 = tmp0_; uint64_t o1 = tmp11 + c5; uint64_t o2 = tmp21; @@ -168,7 +167,7 @@ Hacl_Impl_Curve25519_Field51_fmul2( FStar_UInt128_uint128 *uu___ ) { - KRML_HOST_IGNORE(uu___); + KRML_MAYBE_UNUSED_VAR(uu___); uint64_t f10 = f1[0U]; uint64_t f11 = f1[1U]; uint64_t f12 = f1[2U]; @@ -189,14 +188,14 @@ Hacl_Impl_Curve25519_Field51_fmul2( uint64_t f42 = f2[7U]; uint64_t f43 = f2[8U]; uint64_t f44 = f2[9U]; - uint64_t tmp11 = f21 * (uint64_t)19U; - uint64_t tmp12 = f22 * (uint64_t)19U; - uint64_t tmp13 = f23 * (uint64_t)19U; - uint64_t tmp14 = f24 * (uint64_t)19U; - uint64_t tmp21 = f41 * (uint64_t)19U; - uint64_t tmp22 = f42 * (uint64_t)19U; - uint64_t tmp23 = f43 * (uint64_t)19U; - uint64_t tmp24 = f44 * (uint64_t)19U; + uint64_t tmp11 = f21 * 19ULL; + uint64_t tmp12 = f22 * 19ULL; + uint64_t tmp13 = f23 * 19ULL; + uint64_t tmp14 = f24 * 19ULL; + uint64_t tmp21 = f41 * 19ULL; + uint64_t tmp22 = f42 * 19ULL; + uint64_t tmp23 = f43 * 19ULL; + uint64_t tmp24 = f44 * 19ULL; FStar_UInt128_uint128 o00 = FStar_UInt128_mul_wide(f10, f20); FStar_UInt128_uint128 o15 = FStar_UInt128_mul_wide(f10, f21); FStar_UInt128_uint128 o25 = FStar_UInt128_mul_wide(f10, f22); @@ -257,49 +256,47 @@ Hacl_Impl_Curve25519_Field51_fmul2( FStar_UInt128_uint128 tmp_w22 = o241; FStar_UInt128_uint128 tmp_w23 = o34; FStar_UInt128_uint128 tmp_w24 = o44; - FStar_UInt128_uint128 - l_ = FStar_UInt128_add(tmp_w10, FStar_UInt128_uint64_to_uint128((uint64_t)0U)); - uint64_t tmp00 = FStar_UInt128_uint128_to_uint64(l_) & (uint64_t)0x7ffffffffffffU; - uint64_t c00 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_, (uint32_t)51U)); + FStar_UInt128_uint128 l_ = FStar_UInt128_add(tmp_w10, FStar_UInt128_uint64_to_uint128(0ULL)); + uint64_t tmp00 = FStar_UInt128_uint128_to_uint64(l_) & 0x7ffffffffffffULL; + uint64_t c00 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_, 51U)); FStar_UInt128_uint128 l_0 = FStar_UInt128_add(tmp_w11, FStar_UInt128_uint64_to_uint128(c00)); - uint64_t tmp10 = FStar_UInt128_uint128_to_uint64(l_0) & (uint64_t)0x7ffffffffffffU; - uint64_t c10 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_0, (uint32_t)51U)); + uint64_t tmp10 = FStar_UInt128_uint128_to_uint64(l_0) & 0x7ffffffffffffULL; + uint64_t c10 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_0, 51U)); FStar_UInt128_uint128 l_1 = FStar_UInt128_add(tmp_w12, FStar_UInt128_uint64_to_uint128(c10)); - uint64_t tmp20 = FStar_UInt128_uint128_to_uint64(l_1) & (uint64_t)0x7ffffffffffffU; - uint64_t c20 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_1, (uint32_t)51U)); + uint64_t tmp20 = FStar_UInt128_uint128_to_uint64(l_1) & 0x7ffffffffffffULL; + uint64_t c20 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_1, 51U)); FStar_UInt128_uint128 l_2 = FStar_UInt128_add(tmp_w13, FStar_UInt128_uint64_to_uint128(c20)); - uint64_t tmp30 = FStar_UInt128_uint128_to_uint64(l_2) & (uint64_t)0x7ffffffffffffU; - uint64_t c30 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_2, (uint32_t)51U)); + uint64_t tmp30 = FStar_UInt128_uint128_to_uint64(l_2) & 0x7ffffffffffffULL; + uint64_t c30 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_2, 51U)); FStar_UInt128_uint128 l_3 = FStar_UInt128_add(tmp_w14, FStar_UInt128_uint64_to_uint128(c30)); - uint64_t tmp40 = FStar_UInt128_uint128_to_uint64(l_3) & (uint64_t)0x7ffffffffffffU; - uint64_t c40 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_3, (uint32_t)51U)); - uint64_t l_4 = tmp00 + c40 * (uint64_t)19U; - uint64_t tmp0_ = l_4 & (uint64_t)0x7ffffffffffffU; - uint64_t c50 = l_4 >> (uint32_t)51U; + uint64_t tmp40 = FStar_UInt128_uint128_to_uint64(l_3) & 0x7ffffffffffffULL; + uint64_t c40 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_3, 51U)); + uint64_t l_4 = tmp00 + c40 * 19ULL; + uint64_t tmp0_ = l_4 & 0x7ffffffffffffULL; + uint64_t c50 = l_4 >> 51U; uint64_t o100 = tmp0_; uint64_t o112 = tmp10 + c50; uint64_t o122 = tmp20; uint64_t o132 = tmp30; uint64_t o142 = tmp40; - FStar_UInt128_uint128 - l_5 = FStar_UInt128_add(tmp_w20, FStar_UInt128_uint64_to_uint128((uint64_t)0U)); - uint64_t tmp0 = FStar_UInt128_uint128_to_uint64(l_5) & (uint64_t)0x7ffffffffffffU; - uint64_t c0 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_5, (uint32_t)51U)); + FStar_UInt128_uint128 l_5 = FStar_UInt128_add(tmp_w20, FStar_UInt128_uint64_to_uint128(0ULL)); + uint64_t tmp0 = FStar_UInt128_uint128_to_uint64(l_5) & 0x7ffffffffffffULL; + uint64_t c0 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_5, 51U)); FStar_UInt128_uint128 l_6 = FStar_UInt128_add(tmp_w21, FStar_UInt128_uint64_to_uint128(c0)); - uint64_t tmp1 = FStar_UInt128_uint128_to_uint64(l_6) & (uint64_t)0x7ffffffffffffU; - uint64_t c1 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_6, (uint32_t)51U)); + uint64_t tmp1 = FStar_UInt128_uint128_to_uint64(l_6) & 0x7ffffffffffffULL; + uint64_t c1 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_6, 51U)); FStar_UInt128_uint128 l_7 = FStar_UInt128_add(tmp_w22, FStar_UInt128_uint64_to_uint128(c1)); - uint64_t tmp2 = FStar_UInt128_uint128_to_uint64(l_7) & (uint64_t)0x7ffffffffffffU; - uint64_t c2 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_7, (uint32_t)51U)); + uint64_t tmp2 = FStar_UInt128_uint128_to_uint64(l_7) & 0x7ffffffffffffULL; + uint64_t c2 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_7, 51U)); FStar_UInt128_uint128 l_8 = FStar_UInt128_add(tmp_w23, FStar_UInt128_uint64_to_uint128(c2)); - uint64_t tmp3 = FStar_UInt128_uint128_to_uint64(l_8) & (uint64_t)0x7ffffffffffffU; - uint64_t c3 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_8, (uint32_t)51U)); + uint64_t tmp3 = FStar_UInt128_uint128_to_uint64(l_8) & 0x7ffffffffffffULL; + uint64_t c3 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_8, 51U)); FStar_UInt128_uint128 l_9 = FStar_UInt128_add(tmp_w24, FStar_UInt128_uint64_to_uint128(c3)); - uint64_t tmp4 = FStar_UInt128_uint128_to_uint64(l_9) & (uint64_t)0x7ffffffffffffU; - uint64_t c4 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_9, (uint32_t)51U)); - uint64_t l_10 = tmp0 + c4 * (uint64_t)19U; - uint64_t tmp0_0 = l_10 & (uint64_t)0x7ffffffffffffU; - uint64_t c5 = l_10 >> (uint32_t)51U; + uint64_t tmp4 = FStar_UInt128_uint128_to_uint64(l_9) & 0x7ffffffffffffULL; + uint64_t c4 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_9, 51U)); + uint64_t l_10 = tmp0 + c4 * 19ULL; + uint64_t tmp0_0 = l_10 & 0x7ffffffffffffULL; + uint64_t c5 = l_10 >> 51U; uint64_t o200 = tmp0_0; uint64_t o212 = tmp1 + c5; uint64_t o222 = tmp2; @@ -339,25 +336,24 @@ static inline void Hacl_Impl_Curve25519_Field51_fmul1(uint64_t *out, uint64_t *f FStar_UInt128_uint128 tmp_w2 = FStar_UInt128_mul_wide(f2, f12); FStar_UInt128_uint128 tmp_w3 = FStar_UInt128_mul_wide(f2, f13); FStar_UInt128_uint128 tmp_w4 = FStar_UInt128_mul_wide(f2, f14); - FStar_UInt128_uint128 - l_ = FStar_UInt128_add(tmp_w0, FStar_UInt128_uint64_to_uint128((uint64_t)0U)); - uint64_t tmp0 = FStar_UInt128_uint128_to_uint64(l_) & (uint64_t)0x7ffffffffffffU; - uint64_t c0 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_, (uint32_t)51U)); + FStar_UInt128_uint128 l_ = FStar_UInt128_add(tmp_w0, FStar_UInt128_uint64_to_uint128(0ULL)); + uint64_t tmp0 = FStar_UInt128_uint128_to_uint64(l_) & 0x7ffffffffffffULL; + uint64_t c0 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_, 51U)); FStar_UInt128_uint128 l_0 = FStar_UInt128_add(tmp_w1, FStar_UInt128_uint64_to_uint128(c0)); - uint64_t tmp1 = FStar_UInt128_uint128_to_uint64(l_0) & (uint64_t)0x7ffffffffffffU; - uint64_t c1 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_0, (uint32_t)51U)); + uint64_t tmp1 = FStar_UInt128_uint128_to_uint64(l_0) & 0x7ffffffffffffULL; + uint64_t c1 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_0, 51U)); FStar_UInt128_uint128 l_1 = FStar_UInt128_add(tmp_w2, FStar_UInt128_uint64_to_uint128(c1)); - uint64_t tmp2 = FStar_UInt128_uint128_to_uint64(l_1) & (uint64_t)0x7ffffffffffffU; - uint64_t c2 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_1, (uint32_t)51U)); + uint64_t tmp2 = FStar_UInt128_uint128_to_uint64(l_1) & 0x7ffffffffffffULL; + uint64_t c2 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_1, 51U)); FStar_UInt128_uint128 l_2 = FStar_UInt128_add(tmp_w3, FStar_UInt128_uint64_to_uint128(c2)); - uint64_t tmp3 = FStar_UInt128_uint128_to_uint64(l_2) & (uint64_t)0x7ffffffffffffU; - uint64_t c3 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_2, (uint32_t)51U)); + uint64_t tmp3 = FStar_UInt128_uint128_to_uint64(l_2) & 0x7ffffffffffffULL; + uint64_t c3 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_2, 51U)); FStar_UInt128_uint128 l_3 = FStar_UInt128_add(tmp_w4, FStar_UInt128_uint64_to_uint128(c3)); - uint64_t tmp4 = FStar_UInt128_uint128_to_uint64(l_3) & (uint64_t)0x7ffffffffffffU; - uint64_t c4 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_3, (uint32_t)51U)); - uint64_t l_4 = tmp0 + c4 * (uint64_t)19U; - uint64_t tmp0_ = l_4 & (uint64_t)0x7ffffffffffffU; - uint64_t c5 = l_4 >> (uint32_t)51U; + uint64_t tmp4 = FStar_UInt128_uint128_to_uint64(l_3) & 0x7ffffffffffffULL; + uint64_t c4 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_3, 51U)); + uint64_t l_4 = tmp0 + c4 * 19ULL; + uint64_t tmp0_ = l_4 & 0x7ffffffffffffULL; + uint64_t c5 = l_4 >> 51U; uint64_t o0 = tmp0_; uint64_t o1 = tmp1 + c5; uint64_t o2 = tmp2; @@ -373,18 +369,18 @@ static inline void Hacl_Impl_Curve25519_Field51_fmul1(uint64_t *out, uint64_t *f static inline void Hacl_Impl_Curve25519_Field51_fsqr(uint64_t *out, uint64_t *f, FStar_UInt128_uint128 *uu___) { - KRML_HOST_IGNORE(uu___); + KRML_MAYBE_UNUSED_VAR(uu___); uint64_t f0 = f[0U]; uint64_t f1 = f[1U]; uint64_t f2 = f[2U]; uint64_t f3 = f[3U]; uint64_t f4 = f[4U]; - uint64_t d0 = (uint64_t)2U * f0; - uint64_t d1 = (uint64_t)2U * f1; - uint64_t d2 = (uint64_t)38U * f2; - uint64_t d3 = (uint64_t)19U * f3; - uint64_t d419 = (uint64_t)19U * f4; - uint64_t d4 = (uint64_t)2U * d419; + uint64_t d0 = 2ULL * f0; + uint64_t d1 = 2ULL * f1; + uint64_t d2 = 38ULL * f2; + uint64_t d3 = 19ULL * f3; + uint64_t d419 = 19ULL * f4; + uint64_t d4 = 2ULL * d419; FStar_UInt128_uint128 s0 = FStar_UInt128_add(FStar_UInt128_add(FStar_UInt128_mul_wide(f0, f0), @@ -415,25 +411,24 @@ Hacl_Impl_Curve25519_Field51_fsqr(uint64_t *out, uint64_t *f, FStar_UInt128_uint FStar_UInt128_uint128 o20 = s2; FStar_UInt128_uint128 o30 = s3; FStar_UInt128_uint128 o40 = s4; - FStar_UInt128_uint128 - l_ = FStar_UInt128_add(o00, FStar_UInt128_uint64_to_uint128((uint64_t)0U)); - uint64_t tmp0 = FStar_UInt128_uint128_to_uint64(l_) & (uint64_t)0x7ffffffffffffU; - uint64_t c0 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_, (uint32_t)51U)); + FStar_UInt128_uint128 l_ = FStar_UInt128_add(o00, FStar_UInt128_uint64_to_uint128(0ULL)); + uint64_t tmp0 = FStar_UInt128_uint128_to_uint64(l_) & 0x7ffffffffffffULL; + uint64_t c0 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_, 51U)); FStar_UInt128_uint128 l_0 = FStar_UInt128_add(o10, FStar_UInt128_uint64_to_uint128(c0)); - uint64_t tmp1 = FStar_UInt128_uint128_to_uint64(l_0) & (uint64_t)0x7ffffffffffffU; - uint64_t c1 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_0, (uint32_t)51U)); + uint64_t tmp1 = FStar_UInt128_uint128_to_uint64(l_0) & 0x7ffffffffffffULL; + uint64_t c1 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_0, 51U)); FStar_UInt128_uint128 l_1 = FStar_UInt128_add(o20, FStar_UInt128_uint64_to_uint128(c1)); - uint64_t tmp2 = FStar_UInt128_uint128_to_uint64(l_1) & (uint64_t)0x7ffffffffffffU; - uint64_t c2 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_1, (uint32_t)51U)); + uint64_t tmp2 = FStar_UInt128_uint128_to_uint64(l_1) & 0x7ffffffffffffULL; + uint64_t c2 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_1, 51U)); FStar_UInt128_uint128 l_2 = FStar_UInt128_add(o30, FStar_UInt128_uint64_to_uint128(c2)); - uint64_t tmp3 = FStar_UInt128_uint128_to_uint64(l_2) & (uint64_t)0x7ffffffffffffU; - uint64_t c3 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_2, (uint32_t)51U)); + uint64_t tmp3 = FStar_UInt128_uint128_to_uint64(l_2) & 0x7ffffffffffffULL; + uint64_t c3 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_2, 51U)); FStar_UInt128_uint128 l_3 = FStar_UInt128_add(o40, FStar_UInt128_uint64_to_uint128(c3)); - uint64_t tmp4 = FStar_UInt128_uint128_to_uint64(l_3) & (uint64_t)0x7ffffffffffffU; - uint64_t c4 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_3, (uint32_t)51U)); - uint64_t l_4 = tmp0 + c4 * (uint64_t)19U; - uint64_t tmp0_ = l_4 & (uint64_t)0x7ffffffffffffU; - uint64_t c5 = l_4 >> (uint32_t)51U; + uint64_t tmp4 = FStar_UInt128_uint128_to_uint64(l_3) & 0x7ffffffffffffULL; + uint64_t c4 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_3, 51U)); + uint64_t l_4 = tmp0 + c4 * 19ULL; + uint64_t tmp0_ = l_4 & 0x7ffffffffffffULL; + uint64_t c5 = l_4 >> 51U; uint64_t o0 = tmp0_; uint64_t o1 = tmp1 + c5; uint64_t o2 = tmp2; @@ -449,7 +444,7 @@ Hacl_Impl_Curve25519_Field51_fsqr(uint64_t *out, uint64_t *f, FStar_UInt128_uint static inline void Hacl_Impl_Curve25519_Field51_fsqr2(uint64_t *out, uint64_t *f, FStar_UInt128_uint128 *uu___) { - KRML_HOST_IGNORE(uu___); + KRML_MAYBE_UNUSED_VAR(uu___); uint64_t f10 = f[0U]; uint64_t f11 = f[1U]; uint64_t f12 = f[2U]; @@ -460,12 +455,12 @@ Hacl_Impl_Curve25519_Field51_fsqr2(uint64_t *out, uint64_t *f, FStar_UInt128_uin uint64_t f22 = f[7U]; uint64_t f23 = f[8U]; uint64_t f24 = f[9U]; - uint64_t d00 = (uint64_t)2U * f10; - uint64_t d10 = (uint64_t)2U * f11; - uint64_t d20 = (uint64_t)38U * f12; - uint64_t d30 = (uint64_t)19U * f13; - uint64_t d4190 = (uint64_t)19U * f14; - uint64_t d40 = (uint64_t)2U * d4190; + uint64_t d00 = 2ULL * f10; + uint64_t d10 = 2ULL * f11; + uint64_t d20 = 38ULL * f12; + uint64_t d30 = 19ULL * f13; + uint64_t d4190 = 19ULL * f14; + uint64_t d40 = 2ULL * d4190; FStar_UInt128_uint128 s00 = FStar_UInt128_add(FStar_UInt128_add(FStar_UInt128_mul_wide(f10, f10), @@ -496,12 +491,12 @@ Hacl_Impl_Curve25519_Field51_fsqr2(uint64_t *out, uint64_t *f, FStar_UInt128_uin FStar_UInt128_uint128 o120 = s20; FStar_UInt128_uint128 o130 = s30; FStar_UInt128_uint128 o140 = s40; - uint64_t d0 = (uint64_t)2U * f20; - uint64_t d1 = (uint64_t)2U * f21; - uint64_t d2 = (uint64_t)38U * f22; - uint64_t d3 = (uint64_t)19U * f23; - uint64_t d419 = (uint64_t)19U * f24; - uint64_t d4 = (uint64_t)2U * d419; + uint64_t d0 = 2ULL * f20; + uint64_t d1 = 2ULL * f21; + uint64_t d2 = 38ULL * f22; + uint64_t d3 = 19ULL * f23; + uint64_t d419 = 19ULL * f24; + uint64_t d4 = 2ULL * d419; FStar_UInt128_uint128 s0 = FStar_UInt128_add(FStar_UInt128_add(FStar_UInt128_mul_wide(f20, f20), @@ -532,49 +527,47 @@ Hacl_Impl_Curve25519_Field51_fsqr2(uint64_t *out, uint64_t *f, FStar_UInt128_uin FStar_UInt128_uint128 o220 = s2; FStar_UInt128_uint128 o230 = s3; FStar_UInt128_uint128 o240 = s4; - FStar_UInt128_uint128 - l_ = FStar_UInt128_add(o100, FStar_UInt128_uint64_to_uint128((uint64_t)0U)); - uint64_t tmp00 = FStar_UInt128_uint128_to_uint64(l_) & (uint64_t)0x7ffffffffffffU; - uint64_t c00 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_, (uint32_t)51U)); + FStar_UInt128_uint128 l_ = FStar_UInt128_add(o100, FStar_UInt128_uint64_to_uint128(0ULL)); + uint64_t tmp00 = FStar_UInt128_uint128_to_uint64(l_) & 0x7ffffffffffffULL; + uint64_t c00 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_, 51U)); FStar_UInt128_uint128 l_0 = FStar_UInt128_add(o110, FStar_UInt128_uint64_to_uint128(c00)); - uint64_t tmp10 = FStar_UInt128_uint128_to_uint64(l_0) & (uint64_t)0x7ffffffffffffU; - uint64_t c10 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_0, (uint32_t)51U)); + uint64_t tmp10 = FStar_UInt128_uint128_to_uint64(l_0) & 0x7ffffffffffffULL; + uint64_t c10 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_0, 51U)); FStar_UInt128_uint128 l_1 = FStar_UInt128_add(o120, FStar_UInt128_uint64_to_uint128(c10)); - uint64_t tmp20 = FStar_UInt128_uint128_to_uint64(l_1) & (uint64_t)0x7ffffffffffffU; - uint64_t c20 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_1, (uint32_t)51U)); + uint64_t tmp20 = FStar_UInt128_uint128_to_uint64(l_1) & 0x7ffffffffffffULL; + uint64_t c20 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_1, 51U)); FStar_UInt128_uint128 l_2 = FStar_UInt128_add(o130, FStar_UInt128_uint64_to_uint128(c20)); - uint64_t tmp30 = FStar_UInt128_uint128_to_uint64(l_2) & (uint64_t)0x7ffffffffffffU; - uint64_t c30 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_2, (uint32_t)51U)); + uint64_t tmp30 = FStar_UInt128_uint128_to_uint64(l_2) & 0x7ffffffffffffULL; + uint64_t c30 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_2, 51U)); FStar_UInt128_uint128 l_3 = FStar_UInt128_add(o140, FStar_UInt128_uint64_to_uint128(c30)); - uint64_t tmp40 = FStar_UInt128_uint128_to_uint64(l_3) & (uint64_t)0x7ffffffffffffU; - uint64_t c40 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_3, (uint32_t)51U)); - uint64_t l_4 = tmp00 + c40 * (uint64_t)19U; - uint64_t tmp0_ = l_4 & (uint64_t)0x7ffffffffffffU; - uint64_t c50 = l_4 >> (uint32_t)51U; + uint64_t tmp40 = FStar_UInt128_uint128_to_uint64(l_3) & 0x7ffffffffffffULL; + uint64_t c40 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_3, 51U)); + uint64_t l_4 = tmp00 + c40 * 19ULL; + uint64_t tmp0_ = l_4 & 0x7ffffffffffffULL; + uint64_t c50 = l_4 >> 51U; uint64_t o101 = tmp0_; uint64_t o111 = tmp10 + c50; uint64_t o121 = tmp20; uint64_t o131 = tmp30; uint64_t o141 = tmp40; - FStar_UInt128_uint128 - l_5 = FStar_UInt128_add(o200, FStar_UInt128_uint64_to_uint128((uint64_t)0U)); - uint64_t tmp0 = FStar_UInt128_uint128_to_uint64(l_5) & (uint64_t)0x7ffffffffffffU; - uint64_t c0 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_5, (uint32_t)51U)); + FStar_UInt128_uint128 l_5 = FStar_UInt128_add(o200, FStar_UInt128_uint64_to_uint128(0ULL)); + uint64_t tmp0 = FStar_UInt128_uint128_to_uint64(l_5) & 0x7ffffffffffffULL; + uint64_t c0 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_5, 51U)); FStar_UInt128_uint128 l_6 = FStar_UInt128_add(o210, FStar_UInt128_uint64_to_uint128(c0)); - uint64_t tmp1 = FStar_UInt128_uint128_to_uint64(l_6) & (uint64_t)0x7ffffffffffffU; - uint64_t c1 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_6, (uint32_t)51U)); + uint64_t tmp1 = FStar_UInt128_uint128_to_uint64(l_6) & 0x7ffffffffffffULL; + uint64_t c1 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_6, 51U)); FStar_UInt128_uint128 l_7 = FStar_UInt128_add(o220, FStar_UInt128_uint64_to_uint128(c1)); - uint64_t tmp2 = FStar_UInt128_uint128_to_uint64(l_7) & (uint64_t)0x7ffffffffffffU; - uint64_t c2 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_7, (uint32_t)51U)); + uint64_t tmp2 = FStar_UInt128_uint128_to_uint64(l_7) & 0x7ffffffffffffULL; + uint64_t c2 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_7, 51U)); FStar_UInt128_uint128 l_8 = FStar_UInt128_add(o230, FStar_UInt128_uint64_to_uint128(c2)); - uint64_t tmp3 = FStar_UInt128_uint128_to_uint64(l_8) & (uint64_t)0x7ffffffffffffU; - uint64_t c3 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_8, (uint32_t)51U)); + uint64_t tmp3 = FStar_UInt128_uint128_to_uint64(l_8) & 0x7ffffffffffffULL; + uint64_t c3 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_8, 51U)); FStar_UInt128_uint128 l_9 = FStar_UInt128_add(o240, FStar_UInt128_uint64_to_uint128(c3)); - uint64_t tmp4 = FStar_UInt128_uint128_to_uint64(l_9) & (uint64_t)0x7ffffffffffffU; - uint64_t c4 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_9, (uint32_t)51U)); - uint64_t l_10 = tmp0 + c4 * (uint64_t)19U; - uint64_t tmp0_0 = l_10 & (uint64_t)0x7ffffffffffffU; - uint64_t c5 = l_10 >> (uint32_t)51U; + uint64_t tmp4 = FStar_UInt128_uint128_to_uint64(l_9) & 0x7ffffffffffffULL; + uint64_t c4 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_9, 51U)); + uint64_t l_10 = tmp0 + c4 * 19ULL; + uint64_t tmp0_0 = l_10 & 0x7ffffffffffffULL; + uint64_t c5 = l_10 >> 51U; uint64_t o201 = tmp0_0; uint64_t o211 = tmp1 + c5; uint64_t o221 = tmp2; @@ -609,49 +602,49 @@ static inline void Hacl_Impl_Curve25519_Field51_store_felem(uint64_t *u64s, uint uint64_t f2 = f[2U]; uint64_t f3 = f[3U]; uint64_t f4 = f[4U]; - uint64_t l_ = f0 + (uint64_t)0U; - uint64_t tmp0 = l_ & (uint64_t)0x7ffffffffffffU; - uint64_t c0 = l_ >> (uint32_t)51U; + uint64_t l_ = f0 + 0ULL; + uint64_t tmp0 = l_ & 0x7ffffffffffffULL; + uint64_t c0 = l_ >> 51U; uint64_t l_0 = f1 + c0; - uint64_t tmp1 = l_0 & (uint64_t)0x7ffffffffffffU; - uint64_t c1 = l_0 >> (uint32_t)51U; + uint64_t tmp1 = l_0 & 0x7ffffffffffffULL; + uint64_t c1 = l_0 >> 51U; uint64_t l_1 = f2 + c1; - uint64_t tmp2 = l_1 & (uint64_t)0x7ffffffffffffU; - uint64_t c2 = l_1 >> (uint32_t)51U; + uint64_t tmp2 = l_1 & 0x7ffffffffffffULL; + uint64_t c2 = l_1 >> 51U; uint64_t l_2 = f3 + c2; - uint64_t tmp3 = l_2 & (uint64_t)0x7ffffffffffffU; - uint64_t c3 = l_2 >> (uint32_t)51U; + uint64_t tmp3 = l_2 & 0x7ffffffffffffULL; + uint64_t c3 = l_2 >> 51U; uint64_t l_3 = f4 + c3; - uint64_t tmp4 = l_3 & (uint64_t)0x7ffffffffffffU; - uint64_t c4 = l_3 >> (uint32_t)51U; - uint64_t l_4 = tmp0 + c4 * (uint64_t)19U; - uint64_t tmp0_ = l_4 & (uint64_t)0x7ffffffffffffU; - uint64_t c5 = l_4 >> (uint32_t)51U; + uint64_t tmp4 = l_3 & 0x7ffffffffffffULL; + uint64_t c4 = l_3 >> 51U; + uint64_t l_4 = tmp0 + c4 * 19ULL; + uint64_t tmp0_ = l_4 & 0x7ffffffffffffULL; + uint64_t c5 = l_4 >> 51U; uint64_t f01 = tmp0_; uint64_t f11 = tmp1 + c5; uint64_t f21 = tmp2; uint64_t f31 = tmp3; uint64_t f41 = tmp4; - uint64_t m0 = FStar_UInt64_gte_mask(f01, (uint64_t)0x7ffffffffffedU); - uint64_t m1 = FStar_UInt64_eq_mask(f11, (uint64_t)0x7ffffffffffffU); - uint64_t m2 = FStar_UInt64_eq_mask(f21, (uint64_t)0x7ffffffffffffU); - uint64_t m3 = FStar_UInt64_eq_mask(f31, (uint64_t)0x7ffffffffffffU); - uint64_t m4 = FStar_UInt64_eq_mask(f41, (uint64_t)0x7ffffffffffffU); + uint64_t m0 = FStar_UInt64_gte_mask(f01, 0x7ffffffffffedULL); + uint64_t m1 = FStar_UInt64_eq_mask(f11, 0x7ffffffffffffULL); + uint64_t m2 = FStar_UInt64_eq_mask(f21, 0x7ffffffffffffULL); + uint64_t m3 = FStar_UInt64_eq_mask(f31, 0x7ffffffffffffULL); + uint64_t m4 = FStar_UInt64_eq_mask(f41, 0x7ffffffffffffULL); uint64_t mask = (((m0 & m1) & m2) & m3) & m4; - uint64_t f0_ = f01 - (mask & (uint64_t)0x7ffffffffffedU); - uint64_t f1_ = f11 - (mask & (uint64_t)0x7ffffffffffffU); - uint64_t f2_ = f21 - (mask & (uint64_t)0x7ffffffffffffU); - uint64_t f3_ = f31 - (mask & (uint64_t)0x7ffffffffffffU); - uint64_t f4_ = f41 - (mask & (uint64_t)0x7ffffffffffffU); + uint64_t f0_ = f01 - (mask & 0x7ffffffffffedULL); + uint64_t f1_ = f11 - (mask & 0x7ffffffffffffULL); + uint64_t f2_ = f21 - (mask & 0x7ffffffffffffULL); + uint64_t f3_ = f31 - (mask & 0x7ffffffffffffULL); + uint64_t f4_ = f41 - (mask & 0x7ffffffffffffULL); uint64_t f02 = f0_; uint64_t f12 = f1_; uint64_t f22 = f2_; uint64_t f32 = f3_; uint64_t f42 = f4_; - uint64_t o00 = f02 | f12 << (uint32_t)51U; - uint64_t o10 = f12 >> (uint32_t)13U | f22 << (uint32_t)38U; - uint64_t o20 = f22 >> (uint32_t)26U | f32 << (uint32_t)25U; - uint64_t o30 = f32 >> (uint32_t)39U | f42 << (uint32_t)12U; + uint64_t o00 = f02 | f12 << 51U; + uint64_t o10 = f12 >> 13U | f22 << 38U; + uint64_t o20 = f22 >> 26U | f32 << 25U; + uint64_t o30 = f32 >> 39U | f42 << 12U; uint64_t o0 = o00; uint64_t o1 = o10; uint64_t o2 = o20; @@ -665,11 +658,11 @@ static inline void Hacl_Impl_Curve25519_Field51_store_felem(uint64_t *u64s, uint static inline void Hacl_Impl_Curve25519_Field51_cswap2(uint64_t bit, uint64_t *p1, uint64_t *p2) { - uint64_t mask = (uint64_t)0U - bit; + uint64_t mask = 0ULL - bit; KRML_MAYBE_FOR10(i, - (uint32_t)0U, - (uint32_t)10U, - (uint32_t)1U, + 0U, + 10U, + 1U, uint64_t dummy = mask & (p1[i] ^ p2[i]); p1[i] = p1[i] ^ dummy; p2[i] = p2[i] ^ dummy;); diff --git a/include/msvc/internal/Hacl_Bignum_Base.h b/include/msvc/internal/Hacl_Bignum_Base.h index e4d35fe9..bafd4896 100644 --- a/include/msvc/internal/Hacl_Bignum_Base.h +++ b/include/msvc/internal/Hacl_Bignum_Base.h @@ -45,7 +45,7 @@ Hacl_Bignum_Base_mul_wide_add2_u32(uint32_t a, uint32_t b, uint32_t c_in, uint32 uint32_t out0 = out[0U]; uint64_t res = (uint64_t)a * (uint64_t)b + (uint64_t)c_in + (uint64_t)out0; out[0U] = (uint32_t)res; - return (uint32_t)(res >> (uint32_t)32U); + return (uint32_t)(res >> 32U); } static inline uint64_t @@ -58,22 +58,22 @@ Hacl_Bignum_Base_mul_wide_add2_u64(uint64_t a, uint64_t b, uint64_t c_in, uint64 FStar_UInt128_uint64_to_uint128(c_in)), FStar_UInt128_uint64_to_uint128(out0)); out[0U] = FStar_UInt128_uint128_to_uint64(res); - return FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(res, (uint32_t)64U)); + return FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(res, 64U)); } static inline void Hacl_Bignum_Convert_bn_from_bytes_be_uint64(uint32_t len, uint8_t *b, uint64_t *res) { - uint32_t bnLen = (len - (uint32_t)1U) / (uint32_t)8U + (uint32_t)1U; - uint32_t tmpLen = (uint32_t)8U * bnLen; + uint32_t bnLen = (len - 1U) / 8U + 1U; + uint32_t tmpLen = 8U * bnLen; KRML_CHECK_SIZE(sizeof (uint8_t), tmpLen); uint8_t *tmp = (uint8_t *)alloca(tmpLen * sizeof (uint8_t)); memset(tmp, 0U, tmpLen * sizeof (uint8_t)); memcpy(tmp + tmpLen - len, b, len * sizeof (uint8_t)); - for (uint32_t i = (uint32_t)0U; i < bnLen; i++) + for (uint32_t i = 0U; i < bnLen; i++) { uint64_t *os = res; - uint64_t u = load64_be(tmp + (bnLen - i - (uint32_t)1U) * (uint32_t)8U); + uint64_t u = load64_be(tmp + (bnLen - i - 1U) * 8U); uint64_t x = u; os[i] = x; } @@ -82,24 +82,24 @@ Hacl_Bignum_Convert_bn_from_bytes_be_uint64(uint32_t len, uint8_t *b, uint64_t * static inline void Hacl_Bignum_Convert_bn_to_bytes_be_uint64(uint32_t len, uint64_t *b, uint8_t *res) { - uint32_t bnLen = (len - (uint32_t)1U) / (uint32_t)8U + (uint32_t)1U; - uint32_t tmpLen = (uint32_t)8U * bnLen; + uint32_t bnLen = (len - 1U) / 8U + 1U; + uint32_t tmpLen = 8U * bnLen; KRML_CHECK_SIZE(sizeof (uint8_t), tmpLen); uint8_t *tmp = (uint8_t *)alloca(tmpLen * sizeof (uint8_t)); memset(tmp, 0U, tmpLen * sizeof (uint8_t)); - for (uint32_t i = (uint32_t)0U; i < bnLen; i++) + for (uint32_t i = 0U; i < bnLen; i++) { - store64_be(tmp + i * (uint32_t)8U, b[bnLen - i - (uint32_t)1U]); + store64_be(tmp + i * 8U, b[bnLen - i - 1U]); } memcpy(res, tmp + tmpLen - len, len * sizeof (uint8_t)); } static inline uint32_t Hacl_Bignum_Lib_bn_get_top_index_u32(uint32_t len, uint32_t *b) { - uint32_t priv = (uint32_t)0U; - for (uint32_t i = (uint32_t)0U; i < len; i++) + uint32_t priv = 0U; + for (uint32_t i = 0U; i < len; i++) { - uint32_t mask = FStar_UInt32_eq_mask(b[i], (uint32_t)0U); + uint32_t mask = FStar_UInt32_eq_mask(b[i], 0U); priv = (mask & priv) | (~mask & i); } return priv; @@ -107,10 +107,10 @@ static inline uint32_t Hacl_Bignum_Lib_bn_get_top_index_u32(uint32_t len, uint32 static inline uint64_t Hacl_Bignum_Lib_bn_get_top_index_u64(uint32_t len, uint64_t *b) { - uint64_t priv = (uint64_t)0U; - for (uint32_t i = (uint32_t)0U; i < len; i++) + uint64_t priv = 0ULL; + for (uint32_t i = 0U; i < len; i++) { - uint64_t mask = FStar_UInt64_eq_mask(b[i], (uint64_t)0U); + uint64_t mask = FStar_UInt64_eq_mask(b[i], 0ULL); priv = (mask & priv) | (~mask & (uint64_t)i); } return priv; @@ -119,63 +119,63 @@ static inline uint64_t Hacl_Bignum_Lib_bn_get_top_index_u64(uint32_t len, uint64 static inline uint32_t Hacl_Bignum_Lib_bn_get_bits_u32(uint32_t len, uint32_t *b, uint32_t i, uint32_t l) { - uint32_t i1 = i / (uint32_t)32U; - uint32_t j = i % (uint32_t)32U; + uint32_t i1 = i / 32U; + uint32_t j = i % 32U; uint32_t p1 = b[i1] >> j; uint32_t ite; - if (i1 + (uint32_t)1U < len && (uint32_t)0U < j) + if (i1 + 1U < len && 0U < j) { - ite = p1 | b[i1 + (uint32_t)1U] << ((uint32_t)32U - j); + ite = p1 | b[i1 + 1U] << (32U - j); } else { ite = p1; } - return ite & (((uint32_t)1U << l) - (uint32_t)1U); + return ite & ((1U << l) - 1U); } static inline uint64_t Hacl_Bignum_Lib_bn_get_bits_u64(uint32_t len, uint64_t *b, uint32_t i, uint32_t l) { - uint32_t i1 = i / (uint32_t)64U; - uint32_t j = i % (uint32_t)64U; + uint32_t i1 = i / 64U; + uint32_t j = i % 64U; uint64_t p1 = b[i1] >> j; uint64_t ite; - if (i1 + (uint32_t)1U < len && (uint32_t)0U < j) + if (i1 + 1U < len && 0U < j) { - ite = p1 | b[i1 + (uint32_t)1U] << ((uint32_t)64U - j); + ite = p1 | b[i1 + 1U] << (64U - j); } else { ite = p1; } - return ite & (((uint64_t)1U << l) - (uint64_t)1U); + return ite & ((1ULL << l) - 1ULL); } static inline uint32_t Hacl_Bignum_Addition_bn_sub_eq_len_u32(uint32_t aLen, uint32_t *a, uint32_t *b, uint32_t *res) { - uint32_t c = (uint32_t)0U; - for (uint32_t i = (uint32_t)0U; i < aLen / (uint32_t)4U; i++) + uint32_t c = 0U; + for (uint32_t i = 0U; i < aLen / 4U; i++) { - uint32_t t1 = a[(uint32_t)4U * i]; - uint32_t t20 = b[(uint32_t)4U * i]; - uint32_t *res_i0 = res + (uint32_t)4U * i; + uint32_t t1 = a[4U * i]; + uint32_t t20 = b[4U * i]; + uint32_t *res_i0 = res + 4U * i; c = Lib_IntTypes_Intrinsics_sub_borrow_u32(c, t1, t20, res_i0); - uint32_t t10 = a[(uint32_t)4U * i + (uint32_t)1U]; - uint32_t t21 = b[(uint32_t)4U * i + (uint32_t)1U]; - uint32_t *res_i1 = res + (uint32_t)4U * i + (uint32_t)1U; + uint32_t t10 = a[4U * i + 1U]; + uint32_t t21 = b[4U * i + 1U]; + uint32_t *res_i1 = res + 4U * i + 1U; c = Lib_IntTypes_Intrinsics_sub_borrow_u32(c, t10, t21, res_i1); - uint32_t t11 = a[(uint32_t)4U * i + (uint32_t)2U]; - uint32_t t22 = b[(uint32_t)4U * i + (uint32_t)2U]; - uint32_t *res_i2 = res + (uint32_t)4U * i + (uint32_t)2U; + uint32_t t11 = a[4U * i + 2U]; + uint32_t t22 = b[4U * i + 2U]; + uint32_t *res_i2 = res + 4U * i + 2U; c = Lib_IntTypes_Intrinsics_sub_borrow_u32(c, t11, t22, res_i2); - uint32_t t12 = a[(uint32_t)4U * i + (uint32_t)3U]; - uint32_t t2 = b[(uint32_t)4U * i + (uint32_t)3U]; - uint32_t *res_i = res + (uint32_t)4U * i + (uint32_t)3U; + uint32_t t12 = a[4U * i + 3U]; + uint32_t t2 = b[4U * i + 3U]; + uint32_t *res_i = res + 4U * i + 3U; c = Lib_IntTypes_Intrinsics_sub_borrow_u32(c, t12, t2, res_i); } - for (uint32_t i = aLen / (uint32_t)4U * (uint32_t)4U; i < aLen; i++) + for (uint32_t i = aLen / 4U * 4U; i < aLen; i++) { uint32_t t1 = a[i]; uint32_t t2 = b[i]; @@ -188,27 +188,27 @@ Hacl_Bignum_Addition_bn_sub_eq_len_u32(uint32_t aLen, uint32_t *a, uint32_t *b, static inline uint64_t Hacl_Bignum_Addition_bn_sub_eq_len_u64(uint32_t aLen, uint64_t *a, uint64_t *b, uint64_t *res) { - uint64_t c = (uint64_t)0U; - for (uint32_t i = (uint32_t)0U; i < aLen / (uint32_t)4U; i++) + uint64_t c = 0ULL; + for (uint32_t i = 0U; i < aLen / 4U; i++) { - uint64_t t1 = a[(uint32_t)4U * i]; - uint64_t t20 = b[(uint32_t)4U * i]; - uint64_t *res_i0 = res + (uint32_t)4U * i; + uint64_t t1 = a[4U * i]; + uint64_t t20 = b[4U * i]; + uint64_t *res_i0 = res + 4U * i; c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t1, t20, res_i0); - uint64_t t10 = a[(uint32_t)4U * i + (uint32_t)1U]; - uint64_t t21 = b[(uint32_t)4U * i + (uint32_t)1U]; - uint64_t *res_i1 = res + (uint32_t)4U * i + (uint32_t)1U; + uint64_t t10 = a[4U * i + 1U]; + uint64_t t21 = b[4U * i + 1U]; + uint64_t *res_i1 = res + 4U * i + 1U; c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t10, t21, res_i1); - uint64_t t11 = a[(uint32_t)4U * i + (uint32_t)2U]; - uint64_t t22 = b[(uint32_t)4U * i + (uint32_t)2U]; - uint64_t *res_i2 = res + (uint32_t)4U * i + (uint32_t)2U; + uint64_t t11 = a[4U * i + 2U]; + uint64_t t22 = b[4U * i + 2U]; + uint64_t *res_i2 = res + 4U * i + 2U; c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t11, t22, res_i2); - uint64_t t12 = a[(uint32_t)4U * i + (uint32_t)3U]; - uint64_t t2 = b[(uint32_t)4U * i + (uint32_t)3U]; - uint64_t *res_i = res + (uint32_t)4U * i + (uint32_t)3U; + uint64_t t12 = a[4U * i + 3U]; + uint64_t t2 = b[4U * i + 3U]; + uint64_t *res_i = res + 4U * i + 3U; c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t12, t2, res_i); } - for (uint32_t i = aLen / (uint32_t)4U * (uint32_t)4U; i < aLen; i++) + for (uint32_t i = aLen / 4U * 4U; i < aLen; i++) { uint64_t t1 = a[i]; uint64_t t2 = b[i]; @@ -221,27 +221,27 @@ Hacl_Bignum_Addition_bn_sub_eq_len_u64(uint32_t aLen, uint64_t *a, uint64_t *b, static inline uint32_t Hacl_Bignum_Addition_bn_add_eq_len_u32(uint32_t aLen, uint32_t *a, uint32_t *b, uint32_t *res) { - uint32_t c = (uint32_t)0U; - for (uint32_t i = (uint32_t)0U; i < aLen / (uint32_t)4U; i++) + uint32_t c = 0U; + for (uint32_t i = 0U; i < aLen / 4U; i++) { - uint32_t t1 = a[(uint32_t)4U * i]; - uint32_t t20 = b[(uint32_t)4U * i]; - uint32_t *res_i0 = res + (uint32_t)4U * i; + uint32_t t1 = a[4U * i]; + uint32_t t20 = b[4U * i]; + uint32_t *res_i0 = res + 4U * i; c = Lib_IntTypes_Intrinsics_add_carry_u32(c, t1, t20, res_i0); - uint32_t t10 = a[(uint32_t)4U * i + (uint32_t)1U]; - uint32_t t21 = b[(uint32_t)4U * i + (uint32_t)1U]; - uint32_t *res_i1 = res + (uint32_t)4U * i + (uint32_t)1U; + uint32_t t10 = a[4U * i + 1U]; + uint32_t t21 = b[4U * i + 1U]; + uint32_t *res_i1 = res + 4U * i + 1U; c = Lib_IntTypes_Intrinsics_add_carry_u32(c, t10, t21, res_i1); - uint32_t t11 = a[(uint32_t)4U * i + (uint32_t)2U]; - uint32_t t22 = b[(uint32_t)4U * i + (uint32_t)2U]; - uint32_t *res_i2 = res + (uint32_t)4U * i + (uint32_t)2U; + uint32_t t11 = a[4U * i + 2U]; + uint32_t t22 = b[4U * i + 2U]; + uint32_t *res_i2 = res + 4U * i + 2U; c = Lib_IntTypes_Intrinsics_add_carry_u32(c, t11, t22, res_i2); - uint32_t t12 = a[(uint32_t)4U * i + (uint32_t)3U]; - uint32_t t2 = b[(uint32_t)4U * i + (uint32_t)3U]; - uint32_t *res_i = res + (uint32_t)4U * i + (uint32_t)3U; + uint32_t t12 = a[4U * i + 3U]; + uint32_t t2 = b[4U * i + 3U]; + uint32_t *res_i = res + 4U * i + 3U; c = Lib_IntTypes_Intrinsics_add_carry_u32(c, t12, t2, res_i); } - for (uint32_t i = aLen / (uint32_t)4U * (uint32_t)4U; i < aLen; i++) + for (uint32_t i = aLen / 4U * 4U; i < aLen; i++) { uint32_t t1 = a[i]; uint32_t t2 = b[i]; @@ -254,27 +254,27 @@ Hacl_Bignum_Addition_bn_add_eq_len_u32(uint32_t aLen, uint32_t *a, uint32_t *b, static inline uint64_t Hacl_Bignum_Addition_bn_add_eq_len_u64(uint32_t aLen, uint64_t *a, uint64_t *b, uint64_t *res) { - uint64_t c = (uint64_t)0U; - for (uint32_t i = (uint32_t)0U; i < aLen / (uint32_t)4U; i++) + uint64_t c = 0ULL; + for (uint32_t i = 0U; i < aLen / 4U; i++) { - uint64_t t1 = a[(uint32_t)4U * i]; - uint64_t t20 = b[(uint32_t)4U * i]; - uint64_t *res_i0 = res + (uint32_t)4U * i; + uint64_t t1 = a[4U * i]; + uint64_t t20 = b[4U * i]; + uint64_t *res_i0 = res + 4U * i; c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t1, t20, res_i0); - uint64_t t10 = a[(uint32_t)4U * i + (uint32_t)1U]; - uint64_t t21 = b[(uint32_t)4U * i + (uint32_t)1U]; - uint64_t *res_i1 = res + (uint32_t)4U * i + (uint32_t)1U; + uint64_t t10 = a[4U * i + 1U]; + uint64_t t21 = b[4U * i + 1U]; + uint64_t *res_i1 = res + 4U * i + 1U; c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t10, t21, res_i1); - uint64_t t11 = a[(uint32_t)4U * i + (uint32_t)2U]; - uint64_t t22 = b[(uint32_t)4U * i + (uint32_t)2U]; - uint64_t *res_i2 = res + (uint32_t)4U * i + (uint32_t)2U; + uint64_t t11 = a[4U * i + 2U]; + uint64_t t22 = b[4U * i + 2U]; + uint64_t *res_i2 = res + 4U * i + 2U; c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t11, t22, res_i2); - uint64_t t12 = a[(uint32_t)4U * i + (uint32_t)3U]; - uint64_t t2 = b[(uint32_t)4U * i + (uint32_t)3U]; - uint64_t *res_i = res + (uint32_t)4U * i + (uint32_t)3U; + uint64_t t12 = a[4U * i + 3U]; + uint64_t t2 = b[4U * i + 3U]; + uint64_t *res_i = res + 4U * i + 3U; c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t12, t2, res_i); } - for (uint32_t i = aLen / (uint32_t)4U * (uint32_t)4U; i < aLen; i++) + for (uint32_t i = aLen / 4U * 4U; i < aLen; i++) { uint64_t t1 = a[i]; uint64_t t2 = b[i]; @@ -294,27 +294,27 @@ Hacl_Bignum_Multiplication_bn_mul_u32( ) { memset(res, 0U, (aLen + bLen) * sizeof (uint32_t)); - for (uint32_t i0 = (uint32_t)0U; i0 < bLen; i0++) + for (uint32_t i0 = 0U; i0 < bLen; i0++) { uint32_t bj = b[i0]; uint32_t *res_j = res + i0; - uint32_t c = (uint32_t)0U; - for (uint32_t i = (uint32_t)0U; i < aLen / (uint32_t)4U; i++) + uint32_t c = 0U; + for (uint32_t i = 0U; i < aLen / 4U; i++) { - uint32_t a_i = a[(uint32_t)4U * i]; - uint32_t *res_i0 = res_j + (uint32_t)4U * i; + uint32_t a_i = a[4U * i]; + uint32_t *res_i0 = res_j + 4U * i; c = Hacl_Bignum_Base_mul_wide_add2_u32(a_i, bj, c, res_i0); - uint32_t a_i0 = a[(uint32_t)4U * i + (uint32_t)1U]; - uint32_t *res_i1 = res_j + (uint32_t)4U * i + (uint32_t)1U; + uint32_t a_i0 = a[4U * i + 1U]; + uint32_t *res_i1 = res_j + 4U * i + 1U; c = Hacl_Bignum_Base_mul_wide_add2_u32(a_i0, bj, c, res_i1); - uint32_t a_i1 = a[(uint32_t)4U * i + (uint32_t)2U]; - uint32_t *res_i2 = res_j + (uint32_t)4U * i + (uint32_t)2U; + uint32_t a_i1 = a[4U * i + 2U]; + uint32_t *res_i2 = res_j + 4U * i + 2U; c = Hacl_Bignum_Base_mul_wide_add2_u32(a_i1, bj, c, res_i2); - uint32_t a_i2 = a[(uint32_t)4U * i + (uint32_t)3U]; - uint32_t *res_i = res_j + (uint32_t)4U * i + (uint32_t)3U; + uint32_t a_i2 = a[4U * i + 3U]; + uint32_t *res_i = res_j + 4U * i + 3U; c = Hacl_Bignum_Base_mul_wide_add2_u32(a_i2, bj, c, res_i); } - for (uint32_t i = aLen / (uint32_t)4U * (uint32_t)4U; i < aLen; i++) + for (uint32_t i = aLen / 4U * 4U; i < aLen; i++) { uint32_t a_i = a[i]; uint32_t *res_i = res_j + i; @@ -335,27 +335,27 @@ Hacl_Bignum_Multiplication_bn_mul_u64( ) { memset(res, 0U, (aLen + bLen) * sizeof (uint64_t)); - for (uint32_t i0 = (uint32_t)0U; i0 < bLen; i0++) + for (uint32_t i0 = 0U; i0 < bLen; i0++) { uint64_t bj = b[i0]; uint64_t *res_j = res + i0; - uint64_t c = (uint64_t)0U; - for (uint32_t i = (uint32_t)0U; i < aLen / (uint32_t)4U; i++) + uint64_t c = 0ULL; + for (uint32_t i = 0U; i < aLen / 4U; i++) { - uint64_t a_i = a[(uint32_t)4U * i]; - uint64_t *res_i0 = res_j + (uint32_t)4U * i; + uint64_t a_i = a[4U * i]; + uint64_t *res_i0 = res_j + 4U * i; c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i, bj, c, res_i0); - uint64_t a_i0 = a[(uint32_t)4U * i + (uint32_t)1U]; - uint64_t *res_i1 = res_j + (uint32_t)4U * i + (uint32_t)1U; + uint64_t a_i0 = a[4U * i + 1U]; + uint64_t *res_i1 = res_j + 4U * i + 1U; c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i0, bj, c, res_i1); - uint64_t a_i1 = a[(uint32_t)4U * i + (uint32_t)2U]; - uint64_t *res_i2 = res_j + (uint32_t)4U * i + (uint32_t)2U; + uint64_t a_i1 = a[4U * i + 2U]; + uint64_t *res_i2 = res_j + 4U * i + 2U; c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i1, bj, c, res_i2); - uint64_t a_i2 = a[(uint32_t)4U * i + (uint32_t)3U]; - uint64_t *res_i = res_j + (uint32_t)4U * i + (uint32_t)3U; + uint64_t a_i2 = a[4U * i + 3U]; + uint64_t *res_i = res_j + 4U * i + 3U; c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i2, bj, c, res_i); } - for (uint32_t i = aLen / (uint32_t)4U * (uint32_t)4U; i < aLen; i++) + for (uint32_t i = aLen / 4U * 4U; i < aLen; i++) { uint64_t a_i = a[i]; uint64_t *res_i = res_j + i; @@ -370,28 +370,28 @@ static inline void Hacl_Bignum_Multiplication_bn_sqr_u32(uint32_t aLen, uint32_t *a, uint32_t *res) { memset(res, 0U, (aLen + aLen) * sizeof (uint32_t)); - for (uint32_t i0 = (uint32_t)0U; i0 < aLen; i0++) + for (uint32_t i0 = 0U; i0 < aLen; i0++) { uint32_t *ab = a; uint32_t a_j = a[i0]; uint32_t *res_j = res + i0; - uint32_t c = (uint32_t)0U; - for (uint32_t i = (uint32_t)0U; i < i0 / (uint32_t)4U; i++) + uint32_t c = 0U; + for (uint32_t i = 0U; i < i0 / 4U; i++) { - uint32_t a_i = ab[(uint32_t)4U * i]; - uint32_t *res_i0 = res_j + (uint32_t)4U * i; + uint32_t a_i = ab[4U * i]; + uint32_t *res_i0 = res_j + 4U * i; c = Hacl_Bignum_Base_mul_wide_add2_u32(a_i, a_j, c, res_i0); - uint32_t a_i0 = ab[(uint32_t)4U * i + (uint32_t)1U]; - uint32_t *res_i1 = res_j + (uint32_t)4U * i + (uint32_t)1U; + uint32_t a_i0 = ab[4U * i + 1U]; + uint32_t *res_i1 = res_j + 4U * i + 1U; c = Hacl_Bignum_Base_mul_wide_add2_u32(a_i0, a_j, c, res_i1); - uint32_t a_i1 = ab[(uint32_t)4U * i + (uint32_t)2U]; - uint32_t *res_i2 = res_j + (uint32_t)4U * i + (uint32_t)2U; + uint32_t a_i1 = ab[4U * i + 2U]; + uint32_t *res_i2 = res_j + 4U * i + 2U; c = Hacl_Bignum_Base_mul_wide_add2_u32(a_i1, a_j, c, res_i2); - uint32_t a_i2 = ab[(uint32_t)4U * i + (uint32_t)3U]; - uint32_t *res_i = res_j + (uint32_t)4U * i + (uint32_t)3U; + uint32_t a_i2 = ab[4U * i + 3U]; + uint32_t *res_i = res_j + 4U * i + 3U; c = Hacl_Bignum_Base_mul_wide_add2_u32(a_i2, a_j, c, res_i); } - for (uint32_t i = i0 / (uint32_t)4U * (uint32_t)4U; i < i0; i++) + for (uint32_t i = i0 / 4U * 4U; i < i0; i++) { uint32_t a_i = ab[i]; uint32_t *res_i = res_j + i; @@ -401,48 +401,48 @@ Hacl_Bignum_Multiplication_bn_sqr_u32(uint32_t aLen, uint32_t *a, uint32_t *res) res[i0 + i0] = r; } uint32_t c0 = Hacl_Bignum_Addition_bn_add_eq_len_u32(aLen + aLen, res, res, res); - KRML_HOST_IGNORE(c0); + KRML_MAYBE_UNUSED_VAR(c0); KRML_CHECK_SIZE(sizeof (uint32_t), aLen + aLen); uint32_t *tmp = (uint32_t *)alloca((aLen + aLen) * sizeof (uint32_t)); memset(tmp, 0U, (aLen + aLen) * sizeof (uint32_t)); - for (uint32_t i = (uint32_t)0U; i < aLen; i++) + for (uint32_t i = 0U; i < aLen; i++) { uint64_t res1 = (uint64_t)a[i] * (uint64_t)a[i]; - uint32_t hi = (uint32_t)(res1 >> (uint32_t)32U); + uint32_t hi = (uint32_t)(res1 >> 32U); uint32_t lo = (uint32_t)res1; - tmp[(uint32_t)2U * i] = lo; - tmp[(uint32_t)2U * i + (uint32_t)1U] = hi; + tmp[2U * i] = lo; + tmp[2U * i + 1U] = hi; } uint32_t c1 = Hacl_Bignum_Addition_bn_add_eq_len_u32(aLen + aLen, res, tmp, res); - KRML_HOST_IGNORE(c1); + KRML_MAYBE_UNUSED_VAR(c1); } static inline void Hacl_Bignum_Multiplication_bn_sqr_u64(uint32_t aLen, uint64_t *a, uint64_t *res) { memset(res, 0U, (aLen + aLen) * sizeof (uint64_t)); - for (uint32_t i0 = (uint32_t)0U; i0 < aLen; i0++) + for (uint32_t i0 = 0U; i0 < aLen; i0++) { uint64_t *ab = a; uint64_t a_j = a[i0]; uint64_t *res_j = res + i0; - uint64_t c = (uint64_t)0U; - for (uint32_t i = (uint32_t)0U; i < i0 / (uint32_t)4U; i++) + uint64_t c = 0ULL; + for (uint32_t i = 0U; i < i0 / 4U; i++) { - uint64_t a_i = ab[(uint32_t)4U * i]; - uint64_t *res_i0 = res_j + (uint32_t)4U * i; + uint64_t a_i = ab[4U * i]; + uint64_t *res_i0 = res_j + 4U * i; c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i, a_j, c, res_i0); - uint64_t a_i0 = ab[(uint32_t)4U * i + (uint32_t)1U]; - uint64_t *res_i1 = res_j + (uint32_t)4U * i + (uint32_t)1U; + uint64_t a_i0 = ab[4U * i + 1U]; + uint64_t *res_i1 = res_j + 4U * i + 1U; c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i0, a_j, c, res_i1); - uint64_t a_i1 = ab[(uint32_t)4U * i + (uint32_t)2U]; - uint64_t *res_i2 = res_j + (uint32_t)4U * i + (uint32_t)2U; + uint64_t a_i1 = ab[4U * i + 2U]; + uint64_t *res_i2 = res_j + 4U * i + 2U; c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i1, a_j, c, res_i2); - uint64_t a_i2 = ab[(uint32_t)4U * i + (uint32_t)3U]; - uint64_t *res_i = res_j + (uint32_t)4U * i + (uint32_t)3U; + uint64_t a_i2 = ab[4U * i + 3U]; + uint64_t *res_i = res_j + 4U * i + 3U; c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i2, a_j, c, res_i); } - for (uint32_t i = i0 / (uint32_t)4U * (uint32_t)4U; i < i0; i++) + for (uint32_t i = i0 / 4U * 4U; i < i0; i++) { uint64_t a_i = ab[i]; uint64_t *res_i = res_j + i; @@ -452,20 +452,20 @@ Hacl_Bignum_Multiplication_bn_sqr_u64(uint32_t aLen, uint64_t *a, uint64_t *res) res[i0 + i0] = r; } uint64_t c0 = Hacl_Bignum_Addition_bn_add_eq_len_u64(aLen + aLen, res, res, res); - KRML_HOST_IGNORE(c0); + KRML_MAYBE_UNUSED_VAR(c0); KRML_CHECK_SIZE(sizeof (uint64_t), aLen + aLen); uint64_t *tmp = (uint64_t *)alloca((aLen + aLen) * sizeof (uint64_t)); memset(tmp, 0U, (aLen + aLen) * sizeof (uint64_t)); - for (uint32_t i = (uint32_t)0U; i < aLen; i++) + for (uint32_t i = 0U; i < aLen; i++) { FStar_UInt128_uint128 res1 = FStar_UInt128_mul_wide(a[i], a[i]); - uint64_t hi = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(res1, (uint32_t)64U)); + uint64_t hi = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(res1, 64U)); uint64_t lo = FStar_UInt128_uint128_to_uint64(res1); - tmp[(uint32_t)2U * i] = lo; - tmp[(uint32_t)2U * i + (uint32_t)1U] = hi; + tmp[2U * i] = lo; + tmp[2U * i + 1U] = hi; } uint64_t c1 = Hacl_Bignum_Addition_bn_add_eq_len_u64(aLen + aLen, res, tmp, res); - KRML_HOST_IGNORE(c1); + KRML_MAYBE_UNUSED_VAR(c1); } #if defined(__cplusplus) diff --git a/include/msvc/internal/Hacl_Bignum_K256.h b/include/msvc/internal/Hacl_Bignum_K256.h index 59aff176..fe72fffe 100644 --- a/include/msvc/internal/Hacl_Bignum_K256.h +++ b/include/msvc/internal/Hacl_Bignum_K256.h @@ -45,13 +45,7 @@ static inline bool Hacl_K256_Field_is_felem_zero_vartime(uint64_t *f) uint64_t f2 = f[2U]; uint64_t f3 = f[3U]; uint64_t f4 = f[4U]; - return - f0 - == (uint64_t)0U - && f1 == (uint64_t)0U - && f2 == (uint64_t)0U - && f3 == (uint64_t)0U - && f4 == (uint64_t)0U; + return f0 == 0ULL && f1 == 0ULL && f2 == 0ULL && f3 == 0ULL && f4 == 0ULL; } static inline bool Hacl_K256_Field_is_felem_eq_vartime(uint64_t *f1, uint64_t *f2) @@ -76,42 +70,42 @@ static inline bool Hacl_K256_Field_is_felem_lt_prime_minus_order_vartime(uint64_ uint64_t f2 = f[2U]; uint64_t f3 = f[3U]; uint64_t f4 = f[4U]; - if (f4 > (uint64_t)0U) + if (f4 > 0ULL) { return false; } - if (f3 > (uint64_t)0U) + if (f3 > 0ULL) { return false; } - if (f2 < (uint64_t)0x1455123U) + if (f2 < 0x1455123ULL) { return true; } - if (f2 > (uint64_t)0x1455123U) + if (f2 > 0x1455123ULL) { return false; } - if (f1 < (uint64_t)0x1950b75fc4402U) + if (f1 < 0x1950b75fc4402ULL) { return true; } - if (f1 > (uint64_t)0x1950b75fc4402U) + if (f1 > 0x1950b75fc4402ULL) { return false; } - return f0 < (uint64_t)0xda1722fc9baeeU; + return f0 < 0xda1722fc9baeeULL; } static inline void Hacl_K256_Field_load_felem(uint64_t *f, uint8_t *b) { uint64_t tmp[4U] = { 0U }; KRML_MAYBE_FOR4(i, - (uint32_t)0U, - (uint32_t)4U, - (uint32_t)1U, + 0U, + 4U, + 1U, uint64_t *os = tmp; - uint8_t *bj = b + i * (uint32_t)8U; + uint8_t *bj = b + i * 8U; uint64_t u = load64_be(bj); uint64_t r = u; uint64_t x = r; @@ -120,11 +114,11 @@ static inline void Hacl_K256_Field_load_felem(uint64_t *f, uint8_t *b) uint64_t s1 = tmp[2U]; uint64_t s2 = tmp[1U]; uint64_t s3 = tmp[0U]; - uint64_t f00 = s0 & (uint64_t)0xfffffffffffffU; - uint64_t f10 = s0 >> (uint32_t)52U | (s1 & (uint64_t)0xffffffffffU) << (uint32_t)12U; - uint64_t f20 = s1 >> (uint32_t)40U | (s2 & (uint64_t)0xfffffffU) << (uint32_t)24U; - uint64_t f30 = s2 >> (uint32_t)28U | (s3 & (uint64_t)0xffffU) << (uint32_t)36U; - uint64_t f40 = s3 >> (uint32_t)16U; + uint64_t f00 = s0 & 0xfffffffffffffULL; + uint64_t f10 = s0 >> 52U | (s1 & 0xffffffffffULL) << 12U; + uint64_t f20 = s1 >> 40U | (s2 & 0xfffffffULL) << 24U; + uint64_t f30 = s2 >> 28U | (s3 & 0xffffULL) << 36U; + uint64_t f40 = s3 >> 16U; uint64_t f0 = f00; uint64_t f1 = f10; uint64_t f2 = f20; @@ -148,11 +142,11 @@ static inline bool Hacl_K256_Field_load_felem_lt_prime_vartime(uint64_t *f, uint bool is_ge_p = f0 - >= (uint64_t)0xffffefffffc2fU - && f1 == (uint64_t)0xfffffffffffffU - && f2 == (uint64_t)0xfffffffffffffU - && f3 == (uint64_t)0xfffffffffffffU - && f4 == (uint64_t)0xffffffffffffU; + >= 0xffffefffffc2fULL + && f1 == 0xfffffffffffffULL + && f2 == 0xfffffffffffffULL + && f3 == 0xfffffffffffffULL + && f4 == 0xffffffffffffULL; return !is_ge_p; } @@ -164,10 +158,10 @@ static inline void Hacl_K256_Field_store_felem(uint8_t *b, uint64_t *f) uint64_t f20 = f[2U]; uint64_t f30 = f[3U]; uint64_t f4 = f[4U]; - uint64_t o0 = f00 | f10 << (uint32_t)52U; - uint64_t o1 = f10 >> (uint32_t)12U | f20 << (uint32_t)40U; - uint64_t o2 = f20 >> (uint32_t)24U | f30 << (uint32_t)28U; - uint64_t o3 = f30 >> (uint32_t)36U | f4 << (uint32_t)16U; + uint64_t o0 = f00 | f10 << 52U; + uint64_t o1 = f10 >> 12U | f20 << 40U; + uint64_t o2 = f20 >> 24U | f30 << 28U; + uint64_t o3 = f30 >> 36U | f4 << 16U; uint64_t f0 = o0; uint64_t f1 = o1; uint64_t f2 = o2; @@ -176,11 +170,7 @@ static inline void Hacl_K256_Field_store_felem(uint8_t *b, uint64_t *f) tmp[1U] = f2; tmp[2U] = f1; tmp[3U] = f0; - KRML_MAYBE_FOR4(i, - (uint32_t)0U, - (uint32_t)4U, - (uint32_t)1U, - store64_be(b + i * (uint32_t)8U, tmp[i]);); + KRML_MAYBE_FOR4(i, 0U, 4U, 1U, store64_be(b + i * 8U, tmp[i]);); } static inline void Hacl_K256_Field_fmul_small_num(uint64_t *out, uint64_t *f, uint64_t num) @@ -248,11 +238,11 @@ static inline void Hacl_K256_Field_fsub(uint64_t *out, uint64_t *f1, uint64_t *f uint64_t b2 = f2[2U]; uint64_t b3 = f2[3U]; uint64_t b4 = f2[4U]; - uint64_t r00 = (uint64_t)9007190664804446U * x - b0; - uint64_t r10 = (uint64_t)9007199254740990U * x - b1; - uint64_t r20 = (uint64_t)9007199254740990U * x - b2; - uint64_t r30 = (uint64_t)9007199254740990U * x - b3; - uint64_t r40 = (uint64_t)562949953421310U * x - b4; + uint64_t r00 = 9007190664804446ULL * x - b0; + uint64_t r10 = 9007199254740990ULL * x - b1; + uint64_t r20 = 9007199254740990ULL * x - b2; + uint64_t r30 = 9007199254740990ULL * x - b3; + uint64_t r40 = 562949953421310ULL * x - b4; uint64_t r0 = r00; uint64_t r1 = r10; uint64_t r2 = r20; @@ -287,7 +277,7 @@ static inline void Hacl_K256_Field_fmul(uint64_t *out, uint64_t *f1, uint64_t *f uint64_t b2 = f2[2U]; uint64_t b3 = f2[3U]; uint64_t b4 = f2[4U]; - uint64_t r = (uint64_t)0x1000003D10U; + uint64_t r = 0x1000003D10ULL; FStar_UInt128_uint128 d0 = FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_mul_wide(a0, @@ -298,9 +288,9 @@ static inline void Hacl_K256_Field_fmul(uint64_t *out, uint64_t *f1, uint64_t *f FStar_UInt128_uint128 c0 = FStar_UInt128_mul_wide(a4, b4); FStar_UInt128_uint128 d1 = FStar_UInt128_add_mod(d0, FStar_UInt128_mul_wide(r, FStar_UInt128_uint128_to_uint64(c0))); - uint64_t c1 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(c0, (uint32_t)64U)); - uint64_t t3 = FStar_UInt128_uint128_to_uint64(d1) & (uint64_t)0xfffffffffffffU; - FStar_UInt128_uint128 d2 = FStar_UInt128_shift_right(d1, (uint32_t)52U); + uint64_t c1 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(c0, 64U)); + uint64_t t3 = FStar_UInt128_uint128_to_uint64(d1) & 0xfffffffffffffULL; + FStar_UInt128_uint128 d2 = FStar_UInt128_shift_right(d1, 52U); FStar_UInt128_uint128 d3 = FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_add_mod(d2, @@ -309,12 +299,11 @@ static inline void Hacl_K256_Field_fmul(uint64_t *out, uint64_t *f1, uint64_t *f FStar_UInt128_mul_wide(a2, b2)), FStar_UInt128_mul_wide(a3, b1)), FStar_UInt128_mul_wide(a4, b0)); - FStar_UInt128_uint128 - d4 = FStar_UInt128_add_mod(d3, FStar_UInt128_mul_wide(r << (uint32_t)12U, c1)); - uint64_t t4 = FStar_UInt128_uint128_to_uint64(d4) & (uint64_t)0xfffffffffffffU; - FStar_UInt128_uint128 d5 = FStar_UInt128_shift_right(d4, (uint32_t)52U); - uint64_t tx = t4 >> (uint32_t)48U; - uint64_t t4_ = t4 & (uint64_t)0xffffffffffffU; + FStar_UInt128_uint128 d4 = FStar_UInt128_add_mod(d3, FStar_UInt128_mul_wide(r << 12U, c1)); + uint64_t t4 = FStar_UInt128_uint128_to_uint64(d4) & 0xfffffffffffffULL; + FStar_UInt128_uint128 d5 = FStar_UInt128_shift_right(d4, 52U); + uint64_t tx = t4 >> 48U; + uint64_t t4_ = t4 & 0xffffffffffffULL; FStar_UInt128_uint128 c2 = FStar_UInt128_mul_wide(a0, b0); FStar_UInt128_uint128 d6 = @@ -323,13 +312,12 @@ static inline void Hacl_K256_Field_fmul(uint64_t *out, uint64_t *f1, uint64_t *f FStar_UInt128_mul_wide(a2, b3)), FStar_UInt128_mul_wide(a3, b2)), FStar_UInt128_mul_wide(a4, b1)); - uint64_t u0 = FStar_UInt128_uint128_to_uint64(d6) & (uint64_t)0xfffffffffffffU; - FStar_UInt128_uint128 d7 = FStar_UInt128_shift_right(d6, (uint32_t)52U); - uint64_t u0_ = tx | u0 << (uint32_t)4U; - FStar_UInt128_uint128 - c3 = FStar_UInt128_add_mod(c2, FStar_UInt128_mul_wide(u0_, r >> (uint32_t)4U)); - uint64_t r0 = FStar_UInt128_uint128_to_uint64(c3) & (uint64_t)0xfffffffffffffU; - FStar_UInt128_uint128 c4 = FStar_UInt128_shift_right(c3, (uint32_t)52U); + uint64_t u0 = FStar_UInt128_uint128_to_uint64(d6) & 0xfffffffffffffULL; + FStar_UInt128_uint128 d7 = FStar_UInt128_shift_right(d6, 52U); + uint64_t u0_ = tx | u0 << 4U; + FStar_UInt128_uint128 c3 = FStar_UInt128_add_mod(c2, FStar_UInt128_mul_wide(u0_, r >> 4U)); + uint64_t r0 = FStar_UInt128_uint128_to_uint64(c3) & 0xfffffffffffffULL; + FStar_UInt128_uint128 c4 = FStar_UInt128_shift_right(c3, 52U); FStar_UInt128_uint128 c5 = FStar_UInt128_add_mod(FStar_UInt128_add_mod(c4, FStar_UInt128_mul_wide(a0, b1)), @@ -343,10 +331,10 @@ static inline void Hacl_K256_Field_fmul(uint64_t *out, uint64_t *f1, uint64_t *f FStar_UInt128_uint128 c6 = FStar_UInt128_add_mod(c5, - FStar_UInt128_mul_wide(FStar_UInt128_uint128_to_uint64(d8) & (uint64_t)0xfffffffffffffU, r)); - FStar_UInt128_uint128 d9 = FStar_UInt128_shift_right(d8, (uint32_t)52U); - uint64_t r1 = FStar_UInt128_uint128_to_uint64(c6) & (uint64_t)0xfffffffffffffU; - FStar_UInt128_uint128 c7 = FStar_UInt128_shift_right(c6, (uint32_t)52U); + FStar_UInt128_mul_wide(FStar_UInt128_uint128_to_uint64(d8) & 0xfffffffffffffULL, r)); + FStar_UInt128_uint128 d9 = FStar_UInt128_shift_right(d8, 52U); + uint64_t r1 = FStar_UInt128_uint128_to_uint64(c6) & 0xfffffffffffffULL; + FStar_UInt128_uint128 c7 = FStar_UInt128_shift_right(c6, 52U); FStar_UInt128_uint128 c8 = FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_add_mod(c7, @@ -359,16 +347,15 @@ static inline void Hacl_K256_Field_fmul(uint64_t *out, uint64_t *f1, uint64_t *f FStar_UInt128_mul_wide(a4, b3)); FStar_UInt128_uint128 c9 = FStar_UInt128_add_mod(c8, FStar_UInt128_mul_wide(r, FStar_UInt128_uint128_to_uint64(d10))); - uint64_t d11 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(d10, (uint32_t)64U)); - uint64_t r2 = FStar_UInt128_uint128_to_uint64(c9) & (uint64_t)0xfffffffffffffU; - FStar_UInt128_uint128 c10 = FStar_UInt128_shift_right(c9, (uint32_t)52U); + uint64_t d11 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(d10, 64U)); + uint64_t r2 = FStar_UInt128_uint128_to_uint64(c9) & 0xfffffffffffffULL; + FStar_UInt128_uint128 c10 = FStar_UInt128_shift_right(c9, 52U); FStar_UInt128_uint128 c11 = - FStar_UInt128_add_mod(FStar_UInt128_add_mod(c10, - FStar_UInt128_mul_wide(r << (uint32_t)12U, d11)), + FStar_UInt128_add_mod(FStar_UInt128_add_mod(c10, FStar_UInt128_mul_wide(r << 12U, d11)), FStar_UInt128_uint64_to_uint128(t3)); - uint64_t r3 = FStar_UInt128_uint128_to_uint64(c11) & (uint64_t)0xfffffffffffffU; - uint64_t c12 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(c11, (uint32_t)52U)); + uint64_t r3 = FStar_UInt128_uint128_to_uint64(c11) & 0xfffffffffffffULL; + uint64_t c12 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(c11, 52U)); uint64_t r4 = c12 + t4_; uint64_t f0 = r0; uint64_t f11 = r1; @@ -389,43 +376,41 @@ static inline void Hacl_K256_Field_fsqr(uint64_t *out, uint64_t *f) uint64_t a2 = f[2U]; uint64_t a3 = f[3U]; uint64_t a4 = f[4U]; - uint64_t r = (uint64_t)0x1000003D10U; + uint64_t r = 0x1000003D10ULL; FStar_UInt128_uint128 d0 = - FStar_UInt128_add_mod(FStar_UInt128_mul_wide(a0 * (uint64_t)2U, a3), - FStar_UInt128_mul_wide(a1 * (uint64_t)2U, a2)); + FStar_UInt128_add_mod(FStar_UInt128_mul_wide(a0 * 2ULL, a3), + FStar_UInt128_mul_wide(a1 * 2ULL, a2)); FStar_UInt128_uint128 c0 = FStar_UInt128_mul_wide(a4, a4); FStar_UInt128_uint128 d1 = FStar_UInt128_add_mod(d0, FStar_UInt128_mul_wide(r, FStar_UInt128_uint128_to_uint64(c0))); - uint64_t c1 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(c0, (uint32_t)64U)); - uint64_t t3 = FStar_UInt128_uint128_to_uint64(d1) & (uint64_t)0xfffffffffffffU; - FStar_UInt128_uint128 d2 = FStar_UInt128_shift_right(d1, (uint32_t)52U); - uint64_t a41 = a4 * (uint64_t)2U; + uint64_t c1 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(c0, 64U)); + uint64_t t3 = FStar_UInt128_uint128_to_uint64(d1) & 0xfffffffffffffULL; + FStar_UInt128_uint128 d2 = FStar_UInt128_shift_right(d1, 52U); + uint64_t a41 = a4 * 2ULL; FStar_UInt128_uint128 d3 = FStar_UInt128_add_mod(FStar_UInt128_add_mod(FStar_UInt128_add_mod(d2, FStar_UInt128_mul_wide(a0, a41)), - FStar_UInt128_mul_wide(a1 * (uint64_t)2U, a3)), + FStar_UInt128_mul_wide(a1 * 2ULL, a3)), FStar_UInt128_mul_wide(a2, a2)); - FStar_UInt128_uint128 - d4 = FStar_UInt128_add_mod(d3, FStar_UInt128_mul_wide(r << (uint32_t)12U, c1)); - uint64_t t4 = FStar_UInt128_uint128_to_uint64(d4) & (uint64_t)0xfffffffffffffU; - FStar_UInt128_uint128 d5 = FStar_UInt128_shift_right(d4, (uint32_t)52U); - uint64_t tx = t4 >> (uint32_t)48U; - uint64_t t4_ = t4 & (uint64_t)0xffffffffffffU; + FStar_UInt128_uint128 d4 = FStar_UInt128_add_mod(d3, FStar_UInt128_mul_wide(r << 12U, c1)); + uint64_t t4 = FStar_UInt128_uint128_to_uint64(d4) & 0xfffffffffffffULL; + FStar_UInt128_uint128 d5 = FStar_UInt128_shift_right(d4, 52U); + uint64_t tx = t4 >> 48U; + uint64_t t4_ = t4 & 0xffffffffffffULL; FStar_UInt128_uint128 c2 = FStar_UInt128_mul_wide(a0, a0); FStar_UInt128_uint128 d6 = FStar_UInt128_add_mod(FStar_UInt128_add_mod(d5, FStar_UInt128_mul_wide(a1, a41)), - FStar_UInt128_mul_wide(a2 * (uint64_t)2U, a3)); - uint64_t u0 = FStar_UInt128_uint128_to_uint64(d6) & (uint64_t)0xfffffffffffffU; - FStar_UInt128_uint128 d7 = FStar_UInt128_shift_right(d6, (uint32_t)52U); - uint64_t u0_ = tx | u0 << (uint32_t)4U; - FStar_UInt128_uint128 - c3 = FStar_UInt128_add_mod(c2, FStar_UInt128_mul_wide(u0_, r >> (uint32_t)4U)); - uint64_t r0 = FStar_UInt128_uint128_to_uint64(c3) & (uint64_t)0xfffffffffffffU; - FStar_UInt128_uint128 c4 = FStar_UInt128_shift_right(c3, (uint32_t)52U); - uint64_t a01 = a0 * (uint64_t)2U; + FStar_UInt128_mul_wide(a2 * 2ULL, a3)); + uint64_t u0 = FStar_UInt128_uint128_to_uint64(d6) & 0xfffffffffffffULL; + FStar_UInt128_uint128 d7 = FStar_UInt128_shift_right(d6, 52U); + uint64_t u0_ = tx | u0 << 4U; + FStar_UInt128_uint128 c3 = FStar_UInt128_add_mod(c2, FStar_UInt128_mul_wide(u0_, r >> 4U)); + uint64_t r0 = FStar_UInt128_uint128_to_uint64(c3) & 0xfffffffffffffULL; + FStar_UInt128_uint128 c4 = FStar_UInt128_shift_right(c3, 52U); + uint64_t a01 = a0 * 2ULL; FStar_UInt128_uint128 c5 = FStar_UInt128_add_mod(c4, FStar_UInt128_mul_wide(a01, a1)); FStar_UInt128_uint128 d8 = @@ -434,10 +419,10 @@ static inline void Hacl_K256_Field_fsqr(uint64_t *out, uint64_t *f) FStar_UInt128_uint128 c6 = FStar_UInt128_add_mod(c5, - FStar_UInt128_mul_wide(FStar_UInt128_uint128_to_uint64(d8) & (uint64_t)0xfffffffffffffU, r)); - FStar_UInt128_uint128 d9 = FStar_UInt128_shift_right(d8, (uint32_t)52U); - uint64_t r1 = FStar_UInt128_uint128_to_uint64(c6) & (uint64_t)0xfffffffffffffU; - FStar_UInt128_uint128 c7 = FStar_UInt128_shift_right(c6, (uint32_t)52U); + FStar_UInt128_mul_wide(FStar_UInt128_uint128_to_uint64(d8) & 0xfffffffffffffULL, r)); + FStar_UInt128_uint128 d9 = FStar_UInt128_shift_right(d8, 52U); + uint64_t r1 = FStar_UInt128_uint128_to_uint64(c6) & 0xfffffffffffffULL; + FStar_UInt128_uint128 c7 = FStar_UInt128_shift_right(c6, 52U); FStar_UInt128_uint128 c8 = FStar_UInt128_add_mod(FStar_UInt128_add_mod(c7, FStar_UInt128_mul_wide(a01, a2)), @@ -445,16 +430,15 @@ static inline void Hacl_K256_Field_fsqr(uint64_t *out, uint64_t *f) FStar_UInt128_uint128 d10 = FStar_UInt128_add_mod(d9, FStar_UInt128_mul_wide(a3, a41)); FStar_UInt128_uint128 c9 = FStar_UInt128_add_mod(c8, FStar_UInt128_mul_wide(r, FStar_UInt128_uint128_to_uint64(d10))); - uint64_t d11 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(d10, (uint32_t)64U)); - uint64_t r2 = FStar_UInt128_uint128_to_uint64(c9) & (uint64_t)0xfffffffffffffU; - FStar_UInt128_uint128 c10 = FStar_UInt128_shift_right(c9, (uint32_t)52U); + uint64_t d11 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(d10, 64U)); + uint64_t r2 = FStar_UInt128_uint128_to_uint64(c9) & 0xfffffffffffffULL; + FStar_UInt128_uint128 c10 = FStar_UInt128_shift_right(c9, 52U); FStar_UInt128_uint128 c11 = - FStar_UInt128_add_mod(FStar_UInt128_add_mod(c10, - FStar_UInt128_mul_wide(r << (uint32_t)12U, d11)), + FStar_UInt128_add_mod(FStar_UInt128_add_mod(c10, FStar_UInt128_mul_wide(r << 12U, d11)), FStar_UInt128_uint64_to_uint128(t3)); - uint64_t r3 = FStar_UInt128_uint128_to_uint64(c11) & (uint64_t)0xfffffffffffffU; - uint64_t c12 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(c11, (uint32_t)52U)); + uint64_t r3 = FStar_UInt128_uint128_to_uint64(c11) & 0xfffffffffffffULL; + uint64_t c12 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(c11, 52U)); uint64_t r4 = c12 + t4_; uint64_t f0 = r0; uint64_t f1 = r1; @@ -475,23 +459,23 @@ static inline void Hacl_K256_Field_fnormalize_weak(uint64_t *out, uint64_t *f) uint64_t t2 = f[2U]; uint64_t t3 = f[3U]; uint64_t t4 = f[4U]; - uint64_t x0 = t4 >> (uint32_t)48U; - uint64_t t410 = t4 & (uint64_t)0xffffffffffffU; + uint64_t x0 = t4 >> 48U; + uint64_t t410 = t4 & 0xffffffffffffULL; uint64_t x = x0; uint64_t t01 = t0; uint64_t t11 = t1; uint64_t t21 = t2; uint64_t t31 = t3; uint64_t t41 = t410; - uint64_t t02 = t01 + x * (uint64_t)0x1000003D1U; - uint64_t t12 = t11 + (t02 >> (uint32_t)52U); - uint64_t t03 = t02 & (uint64_t)0xfffffffffffffU; - uint64_t t22 = t21 + (t12 >> (uint32_t)52U); - uint64_t t13 = t12 & (uint64_t)0xfffffffffffffU; - uint64_t t32 = t31 + (t22 >> (uint32_t)52U); - uint64_t t23 = t22 & (uint64_t)0xfffffffffffffU; - uint64_t t42 = t41 + (t32 >> (uint32_t)52U); - uint64_t t33 = t32 & (uint64_t)0xfffffffffffffU; + uint64_t t02 = t01 + x * 0x1000003D1ULL; + uint64_t t12 = t11 + (t02 >> 52U); + uint64_t t03 = t02 & 0xfffffffffffffULL; + uint64_t t22 = t21 + (t12 >> 52U); + uint64_t t13 = t12 & 0xfffffffffffffULL; + uint64_t t32 = t31 + (t22 >> 52U); + uint64_t t23 = t22 & 0xfffffffffffffULL; + uint64_t t42 = t41 + (t32 >> 52U); + uint64_t t33 = t32 & 0xfffffffffffffULL; uint64_t f0 = t03; uint64_t f1 = t13; uint64_t f2 = t23; @@ -511,59 +495,59 @@ static inline void Hacl_K256_Field_fnormalize(uint64_t *out, uint64_t *f) uint64_t f20 = f[2U]; uint64_t f30 = f[3U]; uint64_t f40 = f[4U]; - uint64_t x0 = f40 >> (uint32_t)48U; - uint64_t t40 = f40 & (uint64_t)0xffffffffffffU; + uint64_t x0 = f40 >> 48U; + uint64_t t40 = f40 & 0xffffffffffffULL; uint64_t x1 = x0; uint64_t t00 = f00; uint64_t t10 = f10; uint64_t t20 = f20; uint64_t t30 = f30; uint64_t t42 = t40; - uint64_t t01 = t00 + x1 * (uint64_t)0x1000003D1U; - uint64_t t110 = t10 + (t01 >> (uint32_t)52U); - uint64_t t020 = t01 & (uint64_t)0xfffffffffffffU; - uint64_t t210 = t20 + (t110 >> (uint32_t)52U); - uint64_t t120 = t110 & (uint64_t)0xfffffffffffffU; - uint64_t t310 = t30 + (t210 >> (uint32_t)52U); - uint64_t t220 = t210 & (uint64_t)0xfffffffffffffU; - uint64_t t410 = t42 + (t310 >> (uint32_t)52U); - uint64_t t320 = t310 & (uint64_t)0xfffffffffffffU; + uint64_t t01 = t00 + x1 * 0x1000003D1ULL; + uint64_t t110 = t10 + (t01 >> 52U); + uint64_t t020 = t01 & 0xfffffffffffffULL; + uint64_t t210 = t20 + (t110 >> 52U); + uint64_t t120 = t110 & 0xfffffffffffffULL; + uint64_t t310 = t30 + (t210 >> 52U); + uint64_t t220 = t210 & 0xfffffffffffffULL; + uint64_t t410 = t42 + (t310 >> 52U); + uint64_t t320 = t310 & 0xfffffffffffffULL; uint64_t t0 = t020; uint64_t t1 = t120; uint64_t t2 = t220; uint64_t t3 = t320; uint64_t t4 = t410; - uint64_t x2 = t4 >> (uint32_t)48U; - uint64_t t411 = t4 & (uint64_t)0xffffffffffffU; + uint64_t x2 = t4 >> 48U; + uint64_t t411 = t4 & 0xffffffffffffULL; uint64_t x = x2; uint64_t r0 = t0; uint64_t r1 = t1; uint64_t r2 = t2; uint64_t r3 = t3; uint64_t r4 = t411; - uint64_t m4 = FStar_UInt64_eq_mask(r4, (uint64_t)0xffffffffffffU); - uint64_t m3 = FStar_UInt64_eq_mask(r3, (uint64_t)0xfffffffffffffU); - uint64_t m2 = FStar_UInt64_eq_mask(r2, (uint64_t)0xfffffffffffffU); - uint64_t m1 = FStar_UInt64_eq_mask(r1, (uint64_t)0xfffffffffffffU); - uint64_t m0 = FStar_UInt64_gte_mask(r0, (uint64_t)0xffffefffffc2fU); + uint64_t m4 = FStar_UInt64_eq_mask(r4, 0xffffffffffffULL); + uint64_t m3 = FStar_UInt64_eq_mask(r3, 0xfffffffffffffULL); + uint64_t m2 = FStar_UInt64_eq_mask(r2, 0xfffffffffffffULL); + uint64_t m1 = FStar_UInt64_eq_mask(r1, 0xfffffffffffffULL); + uint64_t m0 = FStar_UInt64_gte_mask(r0, 0xffffefffffc2fULL); uint64_t is_ge_p_m = (((m0 & m1) & m2) & m3) & m4; - uint64_t m_to_one = is_ge_p_m & (uint64_t)1U; + uint64_t m_to_one = is_ge_p_m & 1ULL; uint64_t x10 = m_to_one | x; - uint64_t t010 = r0 + x10 * (uint64_t)0x1000003D1U; - uint64_t t11 = r1 + (t010 >> (uint32_t)52U); - uint64_t t02 = t010 & (uint64_t)0xfffffffffffffU; - uint64_t t21 = r2 + (t11 >> (uint32_t)52U); - uint64_t t12 = t11 & (uint64_t)0xfffffffffffffU; - uint64_t t31 = r3 + (t21 >> (uint32_t)52U); - uint64_t t22 = t21 & (uint64_t)0xfffffffffffffU; - uint64_t t41 = r4 + (t31 >> (uint32_t)52U); - uint64_t t32 = t31 & (uint64_t)0xfffffffffffffU; + uint64_t t010 = r0 + x10 * 0x1000003D1ULL; + uint64_t t11 = r1 + (t010 >> 52U); + uint64_t t02 = t010 & 0xfffffffffffffULL; + uint64_t t21 = r2 + (t11 >> 52U); + uint64_t t12 = t11 & 0xfffffffffffffULL; + uint64_t t31 = r3 + (t21 >> 52U); + uint64_t t22 = t21 & 0xfffffffffffffULL; + uint64_t t41 = r4 + (t31 >> 52U); + uint64_t t32 = t31 & 0xfffffffffffffULL; uint64_t s0 = t02; uint64_t s1 = t12; uint64_t s2 = t22; uint64_t s3 = t32; uint64_t s4 = t41; - uint64_t t412 = s4 & (uint64_t)0xffffffffffffU; + uint64_t t412 = s4 & 0xffffffffffffULL; uint64_t k0 = s0; uint64_t k1 = s1; uint64_t k2 = s2; @@ -590,11 +574,11 @@ static inline void Hacl_K256_Field_fnegate_conditional_vartime(uint64_t *f, bool uint64_t a2 = f[2U]; uint64_t a3 = f[3U]; uint64_t a4 = f[4U]; - uint64_t r0 = (uint64_t)9007190664804446U - a0; - uint64_t r1 = (uint64_t)9007199254740990U - a1; - uint64_t r2 = (uint64_t)9007199254740990U - a2; - uint64_t r3 = (uint64_t)9007199254740990U - a3; - uint64_t r4 = (uint64_t)562949953421310U - a4; + uint64_t r0 = 9007190664804446ULL - a0; + uint64_t r1 = 9007199254740990ULL - a1; + uint64_t r2 = 9007199254740990ULL - a2; + uint64_t r3 = 9007199254740990ULL - a3; + uint64_t r4 = 562949953421310ULL - a4; uint64_t f0 = r0; uint64_t f1 = r1; uint64_t f2 = r2; @@ -612,7 +596,7 @@ static inline void Hacl_K256_Field_fnegate_conditional_vartime(uint64_t *f, bool static inline void Hacl_Impl_K256_Finv_fsquare_times_in_place(uint64_t *out, uint32_t b) { - for (uint32_t i = (uint32_t)0U; i < b; i++) + for (uint32_t i = 0U; i < b; i++) { Hacl_K256_Field_fsqr(out, out); } @@ -620,8 +604,8 @@ static inline void Hacl_Impl_K256_Finv_fsquare_times_in_place(uint64_t *out, uin static inline void Hacl_Impl_K256_Finv_fsquare_times(uint64_t *out, uint64_t *a, uint32_t b) { - memcpy(out, a, (uint32_t)5U * sizeof (uint64_t)); - for (uint32_t i = (uint32_t)0U; i < b; i++) + memcpy(out, a, 5U * sizeof (uint64_t)); + for (uint32_t i = 0U; i < b; i++) { Hacl_K256_Field_fsqr(out, out); } @@ -633,29 +617,29 @@ static inline void Hacl_Impl_K256_Finv_fexp_223_23(uint64_t *out, uint64_t *x2, uint64_t x22[5U] = { 0U }; uint64_t x44[5U] = { 0U }; uint64_t x88[5U] = { 0U }; - Hacl_Impl_K256_Finv_fsquare_times(x2, f, (uint32_t)1U); + Hacl_Impl_K256_Finv_fsquare_times(x2, f, 1U); Hacl_K256_Field_fmul(x2, x2, f); - Hacl_Impl_K256_Finv_fsquare_times(x3, x2, (uint32_t)1U); + Hacl_Impl_K256_Finv_fsquare_times(x3, x2, 1U); Hacl_K256_Field_fmul(x3, x3, f); - Hacl_Impl_K256_Finv_fsquare_times(out, x3, (uint32_t)3U); + Hacl_Impl_K256_Finv_fsquare_times(out, x3, 3U); Hacl_K256_Field_fmul(out, out, x3); - Hacl_Impl_K256_Finv_fsquare_times_in_place(out, (uint32_t)3U); + Hacl_Impl_K256_Finv_fsquare_times_in_place(out, 3U); Hacl_K256_Field_fmul(out, out, x3); - Hacl_Impl_K256_Finv_fsquare_times_in_place(out, (uint32_t)2U); + Hacl_Impl_K256_Finv_fsquare_times_in_place(out, 2U); Hacl_K256_Field_fmul(out, out, x2); - Hacl_Impl_K256_Finv_fsquare_times(x22, out, (uint32_t)11U); + Hacl_Impl_K256_Finv_fsquare_times(x22, out, 11U); Hacl_K256_Field_fmul(x22, x22, out); - Hacl_Impl_K256_Finv_fsquare_times(x44, x22, (uint32_t)22U); + Hacl_Impl_K256_Finv_fsquare_times(x44, x22, 22U); Hacl_K256_Field_fmul(x44, x44, x22); - Hacl_Impl_K256_Finv_fsquare_times(x88, x44, (uint32_t)44U); + Hacl_Impl_K256_Finv_fsquare_times(x88, x44, 44U); Hacl_K256_Field_fmul(x88, x88, x44); - Hacl_Impl_K256_Finv_fsquare_times(out, x88, (uint32_t)88U); + Hacl_Impl_K256_Finv_fsquare_times(out, x88, 88U); Hacl_K256_Field_fmul(out, out, x88); - Hacl_Impl_K256_Finv_fsquare_times_in_place(out, (uint32_t)44U); + Hacl_Impl_K256_Finv_fsquare_times_in_place(out, 44U); Hacl_K256_Field_fmul(out, out, x44); - Hacl_Impl_K256_Finv_fsquare_times_in_place(out, (uint32_t)3U); + Hacl_Impl_K256_Finv_fsquare_times_in_place(out, 3U); Hacl_K256_Field_fmul(out, out, x3); - Hacl_Impl_K256_Finv_fsquare_times_in_place(out, (uint32_t)23U); + Hacl_Impl_K256_Finv_fsquare_times_in_place(out, 23U); Hacl_K256_Field_fmul(out, out, x22); } @@ -663,11 +647,11 @@ static inline void Hacl_Impl_K256_Finv_finv(uint64_t *out, uint64_t *f) { uint64_t x2[5U] = { 0U }; Hacl_Impl_K256_Finv_fexp_223_23(out, x2, f); - Hacl_Impl_K256_Finv_fsquare_times_in_place(out, (uint32_t)5U); + Hacl_Impl_K256_Finv_fsquare_times_in_place(out, 5U); Hacl_K256_Field_fmul(out, out, f); - Hacl_Impl_K256_Finv_fsquare_times_in_place(out, (uint32_t)3U); + Hacl_Impl_K256_Finv_fsquare_times_in_place(out, 3U); Hacl_K256_Field_fmul(out, out, x2); - Hacl_Impl_K256_Finv_fsquare_times_in_place(out, (uint32_t)2U); + Hacl_Impl_K256_Finv_fsquare_times_in_place(out, 2U); Hacl_K256_Field_fmul(out, out, f); } @@ -675,9 +659,9 @@ static inline void Hacl_Impl_K256_Finv_fsqrt(uint64_t *out, uint64_t *f) { uint64_t x2[5U] = { 0U }; Hacl_Impl_K256_Finv_fexp_223_23(out, x2, f); - Hacl_Impl_K256_Finv_fsquare_times_in_place(out, (uint32_t)6U); + Hacl_Impl_K256_Finv_fsquare_times_in_place(out, 6U); Hacl_K256_Field_fmul(out, out, x2); - Hacl_Impl_K256_Finv_fsquare_times_in_place(out, (uint32_t)2U); + Hacl_Impl_K256_Finv_fsquare_times_in_place(out, 2U); } #if defined(__cplusplus) diff --git a/include/msvc/internal/Hacl_Ed25519_PrecompTable.h b/include/msvc/internal/Hacl_Ed25519_PrecompTable.h index 77d2244c..a20cd912 100644 --- a/include/msvc/internal/Hacl_Ed25519_PrecompTable.h +++ b/include/msvc/internal/Hacl_Ed25519_PrecompTable.h @@ -39,655 +39,491 @@ static const uint64_t Hacl_Ed25519_PrecompTable_precomp_basepoint_table_w4[320U] = { - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)1738742601995546U, (uint64_t)1146398526822698U, - (uint64_t)2070867633025821U, (uint64_t)562264141797630U, (uint64_t)587772402128613U, - (uint64_t)1801439850948184U, (uint64_t)1351079888211148U, (uint64_t)450359962737049U, - (uint64_t)900719925474099U, (uint64_t)1801439850948198U, (uint64_t)1U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1841354044333475U, - (uint64_t)16398895984059U, (uint64_t)755974180946558U, (uint64_t)900171276175154U, - (uint64_t)1821297809914039U, (uint64_t)1661154287933054U, (uint64_t)284530020860578U, - (uint64_t)1390261174866914U, (uint64_t)1524110943907984U, (uint64_t)1045603498418422U, - (uint64_t)928651508580478U, (uint64_t)1383326941296346U, (uint64_t)961937908925785U, - (uint64_t)80455759693706U, (uint64_t)904734540352947U, (uint64_t)1507481815385608U, - (uint64_t)2223447444246085U, (uint64_t)1083941587175919U, (uint64_t)2059929906842505U, - (uint64_t)1581435440146976U, (uint64_t)782730187692425U, (uint64_t)9928394897574U, - (uint64_t)1539449519985236U, (uint64_t)1923587931078510U, (uint64_t)552919286076056U, - (uint64_t)376925408065760U, (uint64_t)447320488831784U, (uint64_t)1362918338468019U, - (uint64_t)1470031896696846U, (uint64_t)2189796996539902U, (uint64_t)1337552949959847U, - (uint64_t)1762287177775726U, (uint64_t)237994495816815U, (uint64_t)1277840395970544U, - (uint64_t)543972849007241U, (uint64_t)1224692671618814U, (uint64_t)162359533289271U, - (uint64_t)282240927125249U, (uint64_t)586909166382289U, (uint64_t)17726488197838U, - (uint64_t)377014554985659U, (uint64_t)1433835303052512U, (uint64_t)702061469493692U, - (uint64_t)1142253108318154U, (uint64_t)318297794307551U, (uint64_t)954362646308543U, - (uint64_t)517363881452320U, (uint64_t)1868013482130416U, (uint64_t)262562472373260U, - (uint64_t)902232853249919U, (uint64_t)2107343057055746U, (uint64_t)462368348619024U, - (uint64_t)1893758677092974U, (uint64_t)2177729767846389U, (uint64_t)2168532543559143U, - (uint64_t)443867094639821U, (uint64_t)730169342581022U, (uint64_t)1564589016879755U, - (uint64_t)51218195700649U, (uint64_t)76684578423745U, (uint64_t)560266272480743U, - (uint64_t)922517457707697U, (uint64_t)2066645939860874U, (uint64_t)1318277348414638U, - (uint64_t)1576726809084003U, (uint64_t)1817337608563665U, (uint64_t)1874240939237666U, - (uint64_t)754733726333910U, (uint64_t)97085310406474U, (uint64_t)751148364309235U, - (uint64_t)1622159695715187U, (uint64_t)1444098819684916U, (uint64_t)130920805558089U, - (uint64_t)1260449179085308U, (uint64_t)1860021740768461U, (uint64_t)110052860348509U, - (uint64_t)193830891643810U, (uint64_t)164148413933881U, (uint64_t)180017794795332U, - (uint64_t)1523506525254651U, (uint64_t)465981629225956U, (uint64_t)559733514964572U, - (uint64_t)1279624874416974U, (uint64_t)2026642326892306U, (uint64_t)1425156829982409U, - (uint64_t)2160936383793147U, (uint64_t)1061870624975247U, (uint64_t)2023497043036941U, - (uint64_t)117942212883190U, (uint64_t)490339622800774U, (uint64_t)1729931303146295U, - (uint64_t)422305932971074U, (uint64_t)529103152793096U, (uint64_t)1211973233775992U, - (uint64_t)721364955929681U, (uint64_t)1497674430438813U, (uint64_t)342545521275073U, - (uint64_t)2102107575279372U, (uint64_t)2108462244669966U, (uint64_t)1382582406064082U, - (uint64_t)2206396818383323U, (uint64_t)2109093268641147U, (uint64_t)10809845110983U, - (uint64_t)1605176920880099U, (uint64_t)744640650753946U, (uint64_t)1712758897518129U, - (uint64_t)373410811281809U, (uint64_t)648838265800209U, (uint64_t)813058095530999U, - (uint64_t)513987632620169U, (uint64_t)465516160703329U, (uint64_t)2136322186126330U, - (uint64_t)1979645899422932U, (uint64_t)1197131006470786U, (uint64_t)1467836664863979U, - (uint64_t)1340751381374628U, (uint64_t)1810066212667962U, (uint64_t)1009933588225499U, - (uint64_t)1106129188080873U, (uint64_t)1388980405213901U, (uint64_t)533719246598044U, - (uint64_t)1169435803073277U, (uint64_t)198920999285821U, (uint64_t)487492330629854U, - (uint64_t)1807093008537778U, (uint64_t)1540899012923865U, (uint64_t)2075080271659867U, - (uint64_t)1527990806921523U, (uint64_t)1323728742908002U, (uint64_t)1568595959608205U, - (uint64_t)1388032187497212U, (uint64_t)2026968840050568U, (uint64_t)1396591153295755U, - (uint64_t)820416950170901U, (uint64_t)520060313205582U, (uint64_t)2016404325094901U, - (uint64_t)1584709677868520U, (uint64_t)272161374469956U, (uint64_t)1567188603996816U, - (uint64_t)1986160530078221U, (uint64_t)553930264324589U, (uint64_t)1058426729027503U, - (uint64_t)8762762886675U, (uint64_t)2216098143382988U, (uint64_t)1835145266889223U, - (uint64_t)1712936431558441U, (uint64_t)1017009937844974U, (uint64_t)585361667812740U, - (uint64_t)2114711541628181U, (uint64_t)2238729632971439U, (uint64_t)121257546253072U, - (uint64_t)847154149018345U, (uint64_t)211972965476684U, (uint64_t)287499084460129U, - (uint64_t)2098247259180197U, (uint64_t)839070411583329U, (uint64_t)339551619574372U, - (uint64_t)1432951287640743U, (uint64_t)526481249498942U, (uint64_t)931991661905195U, - (uint64_t)1884279965674487U, (uint64_t)200486405604411U, (uint64_t)364173020594788U, - (uint64_t)518034455936955U, (uint64_t)1085564703965501U, (uint64_t)16030410467927U, - (uint64_t)604865933167613U, (uint64_t)1695298441093964U, (uint64_t)498856548116159U, - (uint64_t)2193030062787034U, (uint64_t)1706339802964179U, (uint64_t)1721199073493888U, - (uint64_t)820740951039755U, (uint64_t)1216053436896834U, (uint64_t)23954895815139U, - (uint64_t)1662515208920491U, (uint64_t)1705443427511899U, (uint64_t)1957928899570365U, - (uint64_t)1189636258255725U, (uint64_t)1795695471103809U, (uint64_t)1691191297654118U, - (uint64_t)282402585374360U, (uint64_t)460405330264832U, (uint64_t)63765529445733U, - (uint64_t)469763447404473U, (uint64_t)733607089694996U, (uint64_t)685410420186959U, - (uint64_t)1096682630419738U, (uint64_t)1162548510542362U, (uint64_t)1020949526456676U, - (uint64_t)1211660396870573U, (uint64_t)613126398222696U, (uint64_t)1117829165843251U, - (uint64_t)742432540886650U, (uint64_t)1483755088010658U, (uint64_t)942392007134474U, - (uint64_t)1447834130944107U, (uint64_t)489368274863410U, (uint64_t)23192985544898U, - (uint64_t)648442406146160U, (uint64_t)785438843373876U, (uint64_t)249464684645238U, - (uint64_t)170494608205618U, (uint64_t)335112827260550U, (uint64_t)1462050123162735U, - (uint64_t)1084803668439016U, (uint64_t)853459233600325U, (uint64_t)215777728187495U, - (uint64_t)1965759433526974U, (uint64_t)1349482894446537U, (uint64_t)694163317612871U, - (uint64_t)860536766165036U, (uint64_t)1178788094084321U, (uint64_t)1652739626626996U, - (uint64_t)2115723946388185U, (uint64_t)1577204379094664U, (uint64_t)1083882859023240U, - (uint64_t)1768759143381635U, (uint64_t)1737180992507258U, (uint64_t)246054513922239U, - (uint64_t)577253134087234U, (uint64_t)356340280578042U, (uint64_t)1638917769925142U, - (uint64_t)223550348130103U, (uint64_t)470592666638765U, (uint64_t)22663573966996U, - (uint64_t)596552461152400U, (uint64_t)364143537069499U, (uint64_t)3942119457699U, - (uint64_t)107951982889287U, (uint64_t)1843471406713209U, (uint64_t)1625773041610986U, - (uint64_t)1466141092501702U, (uint64_t)1043024095021271U, (uint64_t)310429964047508U, - (uint64_t)98559121500372U, (uint64_t)152746933782868U, (uint64_t)259407205078261U, - (uint64_t)828123093322585U, (uint64_t)1576847274280091U, (uint64_t)1170871375757302U, - (uint64_t)1588856194642775U, (uint64_t)984767822341977U, (uint64_t)1141497997993760U, - (uint64_t)809325345150796U, (uint64_t)1879837728202511U, (uint64_t)201340910657893U, - (uint64_t)1079157558888483U, (uint64_t)1052373448588065U, (uint64_t)1732036202501778U, - (uint64_t)2105292670328445U, (uint64_t)679751387312402U, (uint64_t)1679682144926229U, - (uint64_t)1695823455818780U, (uint64_t)498852317075849U, (uint64_t)1786555067788433U, - (uint64_t)1670727545779425U, (uint64_t)117945875433544U, (uint64_t)407939139781844U, - (uint64_t)854632120023778U, (uint64_t)1413383148360437U, (uint64_t)286030901733673U, - (uint64_t)1207361858071196U, (uint64_t)461340408181417U, (uint64_t)1096919590360164U, - (uint64_t)1837594897475685U, (uint64_t)533755561544165U, (uint64_t)1638688042247712U, - (uint64_t)1431653684793005U, (uint64_t)1036458538873559U, (uint64_t)390822120341779U, - (uint64_t)1920929837111618U, (uint64_t)543426740024168U, (uint64_t)645751357799929U, - (uint64_t)2245025632994463U, (uint64_t)1550778638076452U, (uint64_t)223738153459949U, - (uint64_t)1337209385492033U, (uint64_t)1276967236456531U, (uint64_t)1463815821063071U, - (uint64_t)2070620870191473U, (uint64_t)1199170709413753U, (uint64_t)273230877394166U, - (uint64_t)1873264887608046U, (uint64_t)890877152910775U + 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, + 0ULL, 0ULL, 0ULL, 0ULL, 1738742601995546ULL, 1146398526822698ULL, 2070867633025821ULL, + 562264141797630ULL, 587772402128613ULL, 1801439850948184ULL, 1351079888211148ULL, + 450359962737049ULL, 900719925474099ULL, 1801439850948198ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, + 1841354044333475ULL, 16398895984059ULL, 755974180946558ULL, 900171276175154ULL, + 1821297809914039ULL, 1661154287933054ULL, 284530020860578ULL, 1390261174866914ULL, + 1524110943907984ULL, 1045603498418422ULL, 928651508580478ULL, 1383326941296346ULL, + 961937908925785ULL, 80455759693706ULL, 904734540352947ULL, 1507481815385608ULL, + 2223447444246085ULL, 1083941587175919ULL, 2059929906842505ULL, 1581435440146976ULL, + 782730187692425ULL, 9928394897574ULL, 1539449519985236ULL, 1923587931078510ULL, + 552919286076056ULL, 376925408065760ULL, 447320488831784ULL, 1362918338468019ULL, + 1470031896696846ULL, 2189796996539902ULL, 1337552949959847ULL, 1762287177775726ULL, + 237994495816815ULL, 1277840395970544ULL, 543972849007241ULL, 1224692671618814ULL, + 162359533289271ULL, 282240927125249ULL, 586909166382289ULL, 17726488197838ULL, + 377014554985659ULL, 1433835303052512ULL, 702061469493692ULL, 1142253108318154ULL, + 318297794307551ULL, 954362646308543ULL, 517363881452320ULL, 1868013482130416ULL, + 262562472373260ULL, 902232853249919ULL, 2107343057055746ULL, 462368348619024ULL, + 1893758677092974ULL, 2177729767846389ULL, 2168532543559143ULL, 443867094639821ULL, + 730169342581022ULL, 1564589016879755ULL, 51218195700649ULL, 76684578423745ULL, + 560266272480743ULL, 922517457707697ULL, 2066645939860874ULL, 1318277348414638ULL, + 1576726809084003ULL, 1817337608563665ULL, 1874240939237666ULL, 754733726333910ULL, + 97085310406474ULL, 751148364309235ULL, 1622159695715187ULL, 1444098819684916ULL, + 130920805558089ULL, 1260449179085308ULL, 1860021740768461ULL, 110052860348509ULL, + 193830891643810ULL, 164148413933881ULL, 180017794795332ULL, 1523506525254651ULL, + 465981629225956ULL, 559733514964572ULL, 1279624874416974ULL, 2026642326892306ULL, + 1425156829982409ULL, 2160936383793147ULL, 1061870624975247ULL, 2023497043036941ULL, + 117942212883190ULL, 490339622800774ULL, 1729931303146295ULL, 422305932971074ULL, + 529103152793096ULL, 1211973233775992ULL, 721364955929681ULL, 1497674430438813ULL, + 342545521275073ULL, 2102107575279372ULL, 2108462244669966ULL, 1382582406064082ULL, + 2206396818383323ULL, 2109093268641147ULL, 10809845110983ULL, 1605176920880099ULL, + 744640650753946ULL, 1712758897518129ULL, 373410811281809ULL, 648838265800209ULL, + 813058095530999ULL, 513987632620169ULL, 465516160703329ULL, 2136322186126330ULL, + 1979645899422932ULL, 1197131006470786ULL, 1467836664863979ULL, 1340751381374628ULL, + 1810066212667962ULL, 1009933588225499ULL, 1106129188080873ULL, 1388980405213901ULL, + 533719246598044ULL, 1169435803073277ULL, 198920999285821ULL, 487492330629854ULL, + 1807093008537778ULL, 1540899012923865ULL, 2075080271659867ULL, 1527990806921523ULL, + 1323728742908002ULL, 1568595959608205ULL, 1388032187497212ULL, 2026968840050568ULL, + 1396591153295755ULL, 820416950170901ULL, 520060313205582ULL, 2016404325094901ULL, + 1584709677868520ULL, 272161374469956ULL, 1567188603996816ULL, 1986160530078221ULL, + 553930264324589ULL, 1058426729027503ULL, 8762762886675ULL, 2216098143382988ULL, + 1835145266889223ULL, 1712936431558441ULL, 1017009937844974ULL, 585361667812740ULL, + 2114711541628181ULL, 2238729632971439ULL, 121257546253072ULL, 847154149018345ULL, + 211972965476684ULL, 287499084460129ULL, 2098247259180197ULL, 839070411583329ULL, + 339551619574372ULL, 1432951287640743ULL, 526481249498942ULL, 931991661905195ULL, + 1884279965674487ULL, 200486405604411ULL, 364173020594788ULL, 518034455936955ULL, + 1085564703965501ULL, 16030410467927ULL, 604865933167613ULL, 1695298441093964ULL, + 498856548116159ULL, 2193030062787034ULL, 1706339802964179ULL, 1721199073493888ULL, + 820740951039755ULL, 1216053436896834ULL, 23954895815139ULL, 1662515208920491ULL, + 1705443427511899ULL, 1957928899570365ULL, 1189636258255725ULL, 1795695471103809ULL, + 1691191297654118ULL, 282402585374360ULL, 460405330264832ULL, 63765529445733ULL, + 469763447404473ULL, 733607089694996ULL, 685410420186959ULL, 1096682630419738ULL, + 1162548510542362ULL, 1020949526456676ULL, 1211660396870573ULL, 613126398222696ULL, + 1117829165843251ULL, 742432540886650ULL, 1483755088010658ULL, 942392007134474ULL, + 1447834130944107ULL, 489368274863410ULL, 23192985544898ULL, 648442406146160ULL, + 785438843373876ULL, 249464684645238ULL, 170494608205618ULL, 335112827260550ULL, + 1462050123162735ULL, 1084803668439016ULL, 853459233600325ULL, 215777728187495ULL, + 1965759433526974ULL, 1349482894446537ULL, 694163317612871ULL, 860536766165036ULL, + 1178788094084321ULL, 1652739626626996ULL, 2115723946388185ULL, 1577204379094664ULL, + 1083882859023240ULL, 1768759143381635ULL, 1737180992507258ULL, 246054513922239ULL, + 577253134087234ULL, 356340280578042ULL, 1638917769925142ULL, 223550348130103ULL, + 470592666638765ULL, 22663573966996ULL, 596552461152400ULL, 364143537069499ULL, 3942119457699ULL, + 107951982889287ULL, 1843471406713209ULL, 1625773041610986ULL, 1466141092501702ULL, + 1043024095021271ULL, 310429964047508ULL, 98559121500372ULL, 152746933782868ULL, + 259407205078261ULL, 828123093322585ULL, 1576847274280091ULL, 1170871375757302ULL, + 1588856194642775ULL, 984767822341977ULL, 1141497997993760ULL, 809325345150796ULL, + 1879837728202511ULL, 201340910657893ULL, 1079157558888483ULL, 1052373448588065ULL, + 1732036202501778ULL, 2105292670328445ULL, 679751387312402ULL, 1679682144926229ULL, + 1695823455818780ULL, 498852317075849ULL, 1786555067788433ULL, 1670727545779425ULL, + 117945875433544ULL, 407939139781844ULL, 854632120023778ULL, 1413383148360437ULL, + 286030901733673ULL, 1207361858071196ULL, 461340408181417ULL, 1096919590360164ULL, + 1837594897475685ULL, 533755561544165ULL, 1638688042247712ULL, 1431653684793005ULL, + 1036458538873559ULL, 390822120341779ULL, 1920929837111618ULL, 543426740024168ULL, + 645751357799929ULL, 2245025632994463ULL, 1550778638076452ULL, 223738153459949ULL, + 1337209385492033ULL, 1276967236456531ULL, 1463815821063071ULL, 2070620870191473ULL, + 1199170709413753ULL, 273230877394166ULL, 1873264887608046ULL, 890877152910775ULL }; static const uint64_t Hacl_Ed25519_PrecompTable_precomp_g_pow2_64_table_w4[320U] = { - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)13559344787725U, (uint64_t)2051621493703448U, - (uint64_t)1947659315640708U, (uint64_t)626856790370168U, (uint64_t)1592804284034836U, - (uint64_t)1781728767459187U, (uint64_t)278818420518009U, (uint64_t)2038030359908351U, - (uint64_t)910625973862690U, (uint64_t)471887343142239U, (uint64_t)1298543306606048U, - (uint64_t)794147365642417U, (uint64_t)129968992326749U, (uint64_t)523140861678572U, - (uint64_t)1166419653909231U, (uint64_t)2009637196928390U, (uint64_t)1288020222395193U, - (uint64_t)1007046974985829U, (uint64_t)208981102651386U, (uint64_t)2074009315253380U, - (uint64_t)1564056062071967U, (uint64_t)276822668750618U, (uint64_t)206621292512572U, - (uint64_t)470304361809269U, (uint64_t)895215438398493U, (uint64_t)1527859053868686U, - (uint64_t)1624967223409369U, (uint64_t)811821865979736U, (uint64_t)350450534838340U, - (uint64_t)219143807921807U, (uint64_t)507994540371254U, (uint64_t)986513794574720U, - (uint64_t)1142661369967121U, (uint64_t)621278293399257U, (uint64_t)556189161519781U, - (uint64_t)351964007865066U, (uint64_t)2011573453777822U, (uint64_t)1367125527151537U, - (uint64_t)1691316722438196U, (uint64_t)731328817345164U, (uint64_t)1284781192709232U, - (uint64_t)478439299539269U, (uint64_t)204842178076429U, (uint64_t)2085125369913651U, - (uint64_t)1980773492792985U, (uint64_t)1480264409524940U, (uint64_t)688389585376233U, - (uint64_t)612962643526972U, (uint64_t)165595382536676U, (uint64_t)1850300069212263U, - (uint64_t)1176357203491551U, (uint64_t)1880164984292321U, (uint64_t)10786153104736U, - (uint64_t)1242293560510203U, (uint64_t)1358399951884084U, (uint64_t)1901358796610357U, - (uint64_t)1385092558795806U, (uint64_t)1734893785311348U, (uint64_t)2046201851951191U, - (uint64_t)1233811309557352U, (uint64_t)1531160168656129U, (uint64_t)1543287181303358U, - (uint64_t)516121446374119U, (uint64_t)723422668089935U, (uint64_t)1228176774959679U, - (uint64_t)1598014722726267U, (uint64_t)1630810326658412U, (uint64_t)1343833067463760U, - (uint64_t)1024397964362099U, (uint64_t)1157142161346781U, (uint64_t)56422174971792U, - (uint64_t)544901687297092U, (uint64_t)1291559028869009U, (uint64_t)1336918672345120U, - (uint64_t)1390874603281353U, (uint64_t)1127199512010904U, (uint64_t)992644979940964U, - (uint64_t)1035213479783573U, (uint64_t)36043651196100U, (uint64_t)1220961519321221U, - (uint64_t)1348190007756977U, (uint64_t)579420200329088U, (uint64_t)1703819961008985U, - (uint64_t)1993919213460047U, (uint64_t)2225080008232251U, (uint64_t)392785893702372U, - (uint64_t)464312521482632U, (uint64_t)1224525362116057U, (uint64_t)810394248933036U, - (uint64_t)932513521649107U, (uint64_t)592314953488703U, (uint64_t)586334603791548U, - (uint64_t)1310888126096549U, (uint64_t)650842674074281U, (uint64_t)1596447001791059U, - (uint64_t)2086767406328284U, (uint64_t)1866377645879940U, (uint64_t)1721604362642743U, - (uint64_t)738502322566890U, (uint64_t)1851901097729689U, (uint64_t)1158347571686914U, - (uint64_t)2023626733470827U, (uint64_t)329625404653699U, (uint64_t)563555875598551U, - (uint64_t)516554588079177U, (uint64_t)1134688306104598U, (uint64_t)186301198420809U, - (uint64_t)1339952213563300U, (uint64_t)643605614625891U, (uint64_t)1947505332718043U, - (uint64_t)1722071694852824U, (uint64_t)601679570440694U, (uint64_t)1821275721236351U, - (uint64_t)1808307842870389U, (uint64_t)1654165204015635U, (uint64_t)1457334100715245U, - (uint64_t)217784948678349U, (uint64_t)1820622417674817U, (uint64_t)1946121178444661U, - (uint64_t)597980757799332U, (uint64_t)1745271227710764U, (uint64_t)2010952890941980U, - (uint64_t)339811849696648U, (uint64_t)1066120666993872U, (uint64_t)261276166508990U, - (uint64_t)323098645774553U, (uint64_t)207454744271283U, (uint64_t)941448672977675U, - (uint64_t)71890920544375U, (uint64_t)840849789313357U, (uint64_t)1223996070717926U, - (uint64_t)196832550853408U, (uint64_t)115986818309231U, (uint64_t)1586171527267675U, - (uint64_t)1666169080973450U, (uint64_t)1456454731176365U, (uint64_t)44467854369003U, - (uint64_t)2149656190691480U, (uint64_t)283446383597589U, (uint64_t)2040542647729974U, - (uint64_t)305705593840224U, (uint64_t)475315822269791U, (uint64_t)648133452550632U, - (uint64_t)169218658835720U, (uint64_t)24960052338251U, (uint64_t)938907951346766U, - (uint64_t)425970950490510U, (uint64_t)1037622011013183U, (uint64_t)1026882082708180U, - (uint64_t)1635699409504916U, (uint64_t)1644776942870488U, (uint64_t)2151820331175914U, - (uint64_t)824120674069819U, (uint64_t)835744976610113U, (uint64_t)1991271032313190U, - (uint64_t)96507354724855U, (uint64_t)400645405133260U, (uint64_t)343728076650825U, - (uint64_t)1151585441385566U, (uint64_t)1403339955333520U, (uint64_t)230186314139774U, - (uint64_t)1736248861506714U, (uint64_t)1010804378904572U, (uint64_t)1394932289845636U, - (uint64_t)1901351256960852U, (uint64_t)2187471430089807U, (uint64_t)1003853262342670U, - (uint64_t)1327743396767461U, (uint64_t)1465160415991740U, (uint64_t)366625359144534U, - (uint64_t)1534791405247604U, (uint64_t)1790905930250187U, (uint64_t)1255484115292738U, - (uint64_t)2223291365520443U, (uint64_t)210967717407408U, (uint64_t)26722916813442U, - (uint64_t)1919574361907910U, (uint64_t)468825088280256U, (uint64_t)2230011775946070U, - (uint64_t)1628365642214479U, (uint64_t)568871869234932U, (uint64_t)1066987968780488U, - (uint64_t)1692242903745558U, (uint64_t)1678903997328589U, (uint64_t)214262165888021U, - (uint64_t)1929686748607204U, (uint64_t)1790138967989670U, (uint64_t)1790261616022076U, - (uint64_t)1559824537553112U, (uint64_t)1230364591311358U, (uint64_t)147531939886346U, - (uint64_t)1528207085815487U, (uint64_t)477957922927292U, (uint64_t)285670243881618U, - (uint64_t)264430080123332U, (uint64_t)1163108160028611U, (uint64_t)373201522147371U, - (uint64_t)34903775270979U, (uint64_t)1750870048600662U, (uint64_t)1319328308741084U, - (uint64_t)1547548634278984U, (uint64_t)1691259592202927U, (uint64_t)2247758037259814U, - (uint64_t)329611399953677U, (uint64_t)1385555496268877U, (uint64_t)2242438354031066U, - (uint64_t)1329523854843632U, (uint64_t)399895373846055U, (uint64_t)678005703193452U, - (uint64_t)1496357700997771U, (uint64_t)71909969781942U, (uint64_t)1515391418612349U, - (uint64_t)470110837888178U, (uint64_t)1981307309417466U, (uint64_t)1259888737412276U, - (uint64_t)669991710228712U, (uint64_t)1048546834514303U, (uint64_t)1678323291295512U, - (uint64_t)2172033978088071U, (uint64_t)1529278455500556U, (uint64_t)901984601941894U, - (uint64_t)780867622403807U, (uint64_t)550105677282793U, (uint64_t)975860231176136U, - (uint64_t)525188281689178U, (uint64_t)49966114807992U, (uint64_t)1776449263836645U, - (uint64_t)267851776380338U, (uint64_t)2225969494054620U, (uint64_t)2016794225789822U, - (uint64_t)1186108678266608U, (uint64_t)1023083271408882U, (uint64_t)1119289418565906U, - (uint64_t)1248185897348801U, (uint64_t)1846081539082697U, (uint64_t)23756429626075U, - (uint64_t)1441999021105403U, (uint64_t)724497586552825U, (uint64_t)1287761623605379U, - (uint64_t)685303359654224U, (uint64_t)2217156930690570U, (uint64_t)163769288918347U, - (uint64_t)1098423278284094U, (uint64_t)1391470723006008U, (uint64_t)570700152353516U, - (uint64_t)744804507262556U, (uint64_t)2200464788609495U, (uint64_t)624141899161992U, - (uint64_t)2249570166275684U, (uint64_t)378706441983561U, (uint64_t)122486379999375U, - (uint64_t)430741162798924U, (uint64_t)113847463452574U, (uint64_t)266250457840685U, - (uint64_t)2120743625072743U, (uint64_t)222186221043927U, (uint64_t)1964290018305582U, - (uint64_t)1435278008132477U, (uint64_t)1670867456663734U, (uint64_t)2009989552599079U, - (uint64_t)1348024113448744U, (uint64_t)1158423886300455U, (uint64_t)1356467152691569U, - (uint64_t)306943042363674U, (uint64_t)926879628664255U, (uint64_t)1349295689598324U, - (uint64_t)725558330071205U, (uint64_t)536569987519948U, (uint64_t)116436990335366U, - (uint64_t)1551888573800376U, (uint64_t)2044698345945451U, (uint64_t)104279940291311U, - (uint64_t)251526570943220U, (uint64_t)754735828122925U, (uint64_t)33448073576361U, - (uint64_t)994605876754543U, (uint64_t)546007584022006U, (uint64_t)2217332798409487U, - (uint64_t)706477052561591U, (uint64_t)131174619428653U, (uint64_t)2148698284087243U, - (uint64_t)239290486205186U, (uint64_t)2161325796952184U, (uint64_t)1713452845607994U, - (uint64_t)1297861562938913U, (uint64_t)1779539876828514U, (uint64_t)1926559018603871U, - (uint64_t)296485747893968U, (uint64_t)1859208206640686U, (uint64_t)538513979002718U, - (uint64_t)103998826506137U, (uint64_t)2025375396538469U, (uint64_t)1370680785701206U, - (uint64_t)1698557311253840U, (uint64_t)1411096399076595U, (uint64_t)2132580530813677U, - (uint64_t)2071564345845035U, (uint64_t)498581428556735U, (uint64_t)1136010486691371U, - (uint64_t)1927619356993146U + 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, + 0ULL, 0ULL, 0ULL, 0ULL, 13559344787725ULL, 2051621493703448ULL, 1947659315640708ULL, + 626856790370168ULL, 1592804284034836ULL, 1781728767459187ULL, 278818420518009ULL, + 2038030359908351ULL, 910625973862690ULL, 471887343142239ULL, 1298543306606048ULL, + 794147365642417ULL, 129968992326749ULL, 523140861678572ULL, 1166419653909231ULL, + 2009637196928390ULL, 1288020222395193ULL, 1007046974985829ULL, 208981102651386ULL, + 2074009315253380ULL, 1564056062071967ULL, 276822668750618ULL, 206621292512572ULL, + 470304361809269ULL, 895215438398493ULL, 1527859053868686ULL, 1624967223409369ULL, + 811821865979736ULL, 350450534838340ULL, 219143807921807ULL, 507994540371254ULL, + 986513794574720ULL, 1142661369967121ULL, 621278293399257ULL, 556189161519781ULL, + 351964007865066ULL, 2011573453777822ULL, 1367125527151537ULL, 1691316722438196ULL, + 731328817345164ULL, 1284781192709232ULL, 478439299539269ULL, 204842178076429ULL, + 2085125369913651ULL, 1980773492792985ULL, 1480264409524940ULL, 688389585376233ULL, + 612962643526972ULL, 165595382536676ULL, 1850300069212263ULL, 1176357203491551ULL, + 1880164984292321ULL, 10786153104736ULL, 1242293560510203ULL, 1358399951884084ULL, + 1901358796610357ULL, 1385092558795806ULL, 1734893785311348ULL, 2046201851951191ULL, + 1233811309557352ULL, 1531160168656129ULL, 1543287181303358ULL, 516121446374119ULL, + 723422668089935ULL, 1228176774959679ULL, 1598014722726267ULL, 1630810326658412ULL, + 1343833067463760ULL, 1024397964362099ULL, 1157142161346781ULL, 56422174971792ULL, + 544901687297092ULL, 1291559028869009ULL, 1336918672345120ULL, 1390874603281353ULL, + 1127199512010904ULL, 992644979940964ULL, 1035213479783573ULL, 36043651196100ULL, + 1220961519321221ULL, 1348190007756977ULL, 579420200329088ULL, 1703819961008985ULL, + 1993919213460047ULL, 2225080008232251ULL, 392785893702372ULL, 464312521482632ULL, + 1224525362116057ULL, 810394248933036ULL, 932513521649107ULL, 592314953488703ULL, + 586334603791548ULL, 1310888126096549ULL, 650842674074281ULL, 1596447001791059ULL, + 2086767406328284ULL, 1866377645879940ULL, 1721604362642743ULL, 738502322566890ULL, + 1851901097729689ULL, 1158347571686914ULL, 2023626733470827ULL, 329625404653699ULL, + 563555875598551ULL, 516554588079177ULL, 1134688306104598ULL, 186301198420809ULL, + 1339952213563300ULL, 643605614625891ULL, 1947505332718043ULL, 1722071694852824ULL, + 601679570440694ULL, 1821275721236351ULL, 1808307842870389ULL, 1654165204015635ULL, + 1457334100715245ULL, 217784948678349ULL, 1820622417674817ULL, 1946121178444661ULL, + 597980757799332ULL, 1745271227710764ULL, 2010952890941980ULL, 339811849696648ULL, + 1066120666993872ULL, 261276166508990ULL, 323098645774553ULL, 207454744271283ULL, + 941448672977675ULL, 71890920544375ULL, 840849789313357ULL, 1223996070717926ULL, + 196832550853408ULL, 115986818309231ULL, 1586171527267675ULL, 1666169080973450ULL, + 1456454731176365ULL, 44467854369003ULL, 2149656190691480ULL, 283446383597589ULL, + 2040542647729974ULL, 305705593840224ULL, 475315822269791ULL, 648133452550632ULL, + 169218658835720ULL, 24960052338251ULL, 938907951346766ULL, 425970950490510ULL, + 1037622011013183ULL, 1026882082708180ULL, 1635699409504916ULL, 1644776942870488ULL, + 2151820331175914ULL, 824120674069819ULL, 835744976610113ULL, 1991271032313190ULL, + 96507354724855ULL, 400645405133260ULL, 343728076650825ULL, 1151585441385566ULL, + 1403339955333520ULL, 230186314139774ULL, 1736248861506714ULL, 1010804378904572ULL, + 1394932289845636ULL, 1901351256960852ULL, 2187471430089807ULL, 1003853262342670ULL, + 1327743396767461ULL, 1465160415991740ULL, 366625359144534ULL, 1534791405247604ULL, + 1790905930250187ULL, 1255484115292738ULL, 2223291365520443ULL, 210967717407408ULL, + 26722916813442ULL, 1919574361907910ULL, 468825088280256ULL, 2230011775946070ULL, + 1628365642214479ULL, 568871869234932ULL, 1066987968780488ULL, 1692242903745558ULL, + 1678903997328589ULL, 214262165888021ULL, 1929686748607204ULL, 1790138967989670ULL, + 1790261616022076ULL, 1559824537553112ULL, 1230364591311358ULL, 147531939886346ULL, + 1528207085815487ULL, 477957922927292ULL, 285670243881618ULL, 264430080123332ULL, + 1163108160028611ULL, 373201522147371ULL, 34903775270979ULL, 1750870048600662ULL, + 1319328308741084ULL, 1547548634278984ULL, 1691259592202927ULL, 2247758037259814ULL, + 329611399953677ULL, 1385555496268877ULL, 2242438354031066ULL, 1329523854843632ULL, + 399895373846055ULL, 678005703193452ULL, 1496357700997771ULL, 71909969781942ULL, + 1515391418612349ULL, 470110837888178ULL, 1981307309417466ULL, 1259888737412276ULL, + 669991710228712ULL, 1048546834514303ULL, 1678323291295512ULL, 2172033978088071ULL, + 1529278455500556ULL, 901984601941894ULL, 780867622403807ULL, 550105677282793ULL, + 975860231176136ULL, 525188281689178ULL, 49966114807992ULL, 1776449263836645ULL, + 267851776380338ULL, 2225969494054620ULL, 2016794225789822ULL, 1186108678266608ULL, + 1023083271408882ULL, 1119289418565906ULL, 1248185897348801ULL, 1846081539082697ULL, + 23756429626075ULL, 1441999021105403ULL, 724497586552825ULL, 1287761623605379ULL, + 685303359654224ULL, 2217156930690570ULL, 163769288918347ULL, 1098423278284094ULL, + 1391470723006008ULL, 570700152353516ULL, 744804507262556ULL, 2200464788609495ULL, + 624141899161992ULL, 2249570166275684ULL, 378706441983561ULL, 122486379999375ULL, + 430741162798924ULL, 113847463452574ULL, 266250457840685ULL, 2120743625072743ULL, + 222186221043927ULL, 1964290018305582ULL, 1435278008132477ULL, 1670867456663734ULL, + 2009989552599079ULL, 1348024113448744ULL, 1158423886300455ULL, 1356467152691569ULL, + 306943042363674ULL, 926879628664255ULL, 1349295689598324ULL, 725558330071205ULL, + 536569987519948ULL, 116436990335366ULL, 1551888573800376ULL, 2044698345945451ULL, + 104279940291311ULL, 251526570943220ULL, 754735828122925ULL, 33448073576361ULL, + 994605876754543ULL, 546007584022006ULL, 2217332798409487ULL, 706477052561591ULL, + 131174619428653ULL, 2148698284087243ULL, 239290486205186ULL, 2161325796952184ULL, + 1713452845607994ULL, 1297861562938913ULL, 1779539876828514ULL, 1926559018603871ULL, + 296485747893968ULL, 1859208206640686ULL, 538513979002718ULL, 103998826506137ULL, + 2025375396538469ULL, 1370680785701206ULL, 1698557311253840ULL, 1411096399076595ULL, + 2132580530813677ULL, 2071564345845035ULL, 498581428556735ULL, 1136010486691371ULL, + 1927619356993146ULL }; static const uint64_t Hacl_Ed25519_PrecompTable_precomp_g_pow2_128_table_w4[320U] = { - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)557549315715710U, (uint64_t)196756086293855U, - (uint64_t)846062225082495U, (uint64_t)1865068224838092U, (uint64_t)991112090754908U, - (uint64_t)522916421512828U, (uint64_t)2098523346722375U, (uint64_t)1135633221747012U, - (uint64_t)858420432114866U, (uint64_t)186358544306082U, (uint64_t)1044420411868480U, - (uint64_t)2080052304349321U, (uint64_t)557301814716724U, (uint64_t)1305130257814057U, - (uint64_t)2126012765451197U, (uint64_t)1441004402875101U, (uint64_t)353948968859203U, - (uint64_t)470765987164835U, (uint64_t)1507675957683570U, (uint64_t)1086650358745097U, - (uint64_t)1911913434398388U, (uint64_t)66086091117182U, (uint64_t)1137511952425971U, - (uint64_t)36958263512141U, (uint64_t)2193310025325256U, (uint64_t)1085191426269045U, - (uint64_t)1232148267909446U, (uint64_t)1449894406170117U, (uint64_t)1241416717139557U, - (uint64_t)1940876999212868U, (uint64_t)829758415918121U, (uint64_t)309608450373449U, - (uint64_t)2228398547683851U, (uint64_t)1580623271960188U, (uint64_t)1675601502456740U, - (uint64_t)1360363115493548U, (uint64_t)1098397313096815U, (uint64_t)1809255384359797U, - (uint64_t)1458261916834384U, (uint64_t)210682545649705U, (uint64_t)1606836641068115U, - (uint64_t)1230478270405318U, (uint64_t)1843192771547802U, (uint64_t)1794596343564051U, - (uint64_t)229060710252162U, (uint64_t)2169742775467181U, (uint64_t)701467067318072U, - (uint64_t)696018499035555U, (uint64_t)521051885339807U, (uint64_t)158329567901874U, - (uint64_t)740426481832143U, (uint64_t)1369811177301441U, (uint64_t)503351589084015U, - (uint64_t)1781114827942261U, (uint64_t)1650493549693035U, (uint64_t)2174562418345156U, - (uint64_t)456517194809244U, (uint64_t)2052761522121179U, (uint64_t)2233342271123682U, - (uint64_t)1445872925177435U, (uint64_t)1131882576902813U, (uint64_t)220765848055241U, - (uint64_t)1280259961403769U, (uint64_t)1581497080160712U, (uint64_t)1477441080108824U, - (uint64_t)218428165202767U, (uint64_t)1970598141278907U, (uint64_t)643366736173069U, - (uint64_t)2167909426804014U, (uint64_t)834993711408259U, (uint64_t)1922437166463212U, - (uint64_t)1900036281472252U, (uint64_t)513794844386304U, (uint64_t)1297904164900114U, - (uint64_t)1147626295373268U, (uint64_t)1910101606251299U, (uint64_t)182933838633381U, - (uint64_t)806229530787362U, (uint64_t)155511666433200U, (uint64_t)290522463375462U, - (uint64_t)534373523491751U, (uint64_t)1302938814480515U, (uint64_t)1664979184120445U, - (uint64_t)304235649499423U, (uint64_t)339284524318609U, (uint64_t)1881717946973483U, - (uint64_t)1670802286833842U, (uint64_t)2223637120675737U, (uint64_t)135818919485814U, - (uint64_t)1144856572842792U, (uint64_t)2234981613434386U, (uint64_t)963917024969826U, - (uint64_t)402275378284993U, (uint64_t)141532417412170U, (uint64_t)921537468739387U, - (uint64_t)963905069722607U, (uint64_t)1405442890733358U, (uint64_t)1567763927164655U, - (uint64_t)1664776329195930U, (uint64_t)2095924165508507U, (uint64_t)994243110271379U, - (uint64_t)1243925610609353U, (uint64_t)1029845815569727U, (uint64_t)1001968867985629U, - (uint64_t)170368934002484U, (uint64_t)1100906131583801U, (uint64_t)1825190326449569U, - (uint64_t)1462285121182096U, (uint64_t)1545240767016377U, (uint64_t)797859025652273U, - (uint64_t)1062758326657530U, (uint64_t)1125600735118266U, (uint64_t)739325756774527U, - (uint64_t)1420144485966996U, (uint64_t)1915492743426702U, (uint64_t)752968196344993U, - (uint64_t)882156396938351U, (uint64_t)1909097048763227U, (uint64_t)849058590685611U, - (uint64_t)840754951388500U, (uint64_t)1832926948808323U, (uint64_t)2023317100075297U, - (uint64_t)322382745442827U, (uint64_t)1569741341737601U, (uint64_t)1678986113194987U, - (uint64_t)757598994581938U, (uint64_t)29678659580705U, (uint64_t)1239680935977986U, - (uint64_t)1509239427168474U, (uint64_t)1055981929287006U, (uint64_t)1894085471158693U, - (uint64_t)916486225488490U, (uint64_t)642168890366120U, (uint64_t)300453362620010U, - (uint64_t)1858797242721481U, (uint64_t)2077989823177130U, (uint64_t)510228455273334U, - (uint64_t)1473284798689270U, (uint64_t)5173934574301U, (uint64_t)765285232030050U, - (uint64_t)1007154707631065U, (uint64_t)1862128712885972U, (uint64_t)168873464821340U, - (uint64_t)1967853269759318U, (uint64_t)1489896018263031U, (uint64_t)592451806166369U, - (uint64_t)1242298565603883U, (uint64_t)1838918921339058U, (uint64_t)697532763910695U, - (uint64_t)294335466239059U, (uint64_t)135687058387449U, (uint64_t)2133734403874176U, - (uint64_t)2121911143127699U, (uint64_t)20222476737364U, (uint64_t)1200824626476747U, - (uint64_t)1397731736540791U, (uint64_t)702378430231418U, (uint64_t)59059527640068U, - (uint64_t)460992547183981U, (uint64_t)1016125857842765U, (uint64_t)1273530839608957U, - (uint64_t)96724128829301U, (uint64_t)1313433042425233U, (uint64_t)3543822857227U, - (uint64_t)761975685357118U, (uint64_t)110417360745248U, (uint64_t)1079634164577663U, - (uint64_t)2044574510020457U, (uint64_t)338709058603120U, (uint64_t)94541336042799U, - (uint64_t)127963233585039U, (uint64_t)94427896272258U, (uint64_t)1143501979342182U, - (uint64_t)1217958006212230U, (uint64_t)2153887831492134U, (uint64_t)1519219513255575U, - (uint64_t)251793195454181U, (uint64_t)392517349345200U, (uint64_t)1507033011868881U, - (uint64_t)2208494254670752U, (uint64_t)1364389582694359U, (uint64_t)2214069430728063U, - (uint64_t)1272814257105752U, (uint64_t)741450148906352U, (uint64_t)1105776675555685U, - (uint64_t)824447222014984U, (uint64_t)528745219306376U, (uint64_t)589427609121575U, - (uint64_t)1501786838809155U, (uint64_t)379067373073147U, (uint64_t)184909476589356U, - (uint64_t)1346887560616185U, (uint64_t)1932023742314082U, (uint64_t)1633302311869264U, - (uint64_t)1685314821133069U, (uint64_t)1836610282047884U, (uint64_t)1595571594397150U, - (uint64_t)615441688872198U, (uint64_t)1926435616702564U, (uint64_t)235632180396480U, - (uint64_t)1051918343571810U, (uint64_t)2150570051687050U, (uint64_t)879198845408738U, - (uint64_t)1443966275205464U, (uint64_t)481362545245088U, (uint64_t)512807443532642U, - (uint64_t)641147578283480U, (uint64_t)1594276116945596U, (uint64_t)1844812743300602U, - (uint64_t)2044559316019485U, (uint64_t)202620777969020U, (uint64_t)852992984136302U, - (uint64_t)1500869642692910U, (uint64_t)1085216217052457U, (uint64_t)1736294372259758U, - (uint64_t)2009666354486552U, (uint64_t)1262389020715248U, (uint64_t)1166527705256867U, - (uint64_t)1409917450806036U, (uint64_t)1705819160057637U, (uint64_t)1116901782584378U, - (uint64_t)1278460472285473U, (uint64_t)257879811360157U, (uint64_t)40314007176886U, - (uint64_t)701309846749639U, (uint64_t)1380457676672777U, (uint64_t)631519782380272U, - (uint64_t)1196339573466793U, (uint64_t)955537708940017U, (uint64_t)532725633381530U, - (uint64_t)641190593731833U, (uint64_t)7214357153807U, (uint64_t)481922072107983U, - (uint64_t)1634886189207352U, (uint64_t)1247659758261633U, (uint64_t)1655809614786430U, - (uint64_t)43105797900223U, (uint64_t)76205809912607U, (uint64_t)1936575107455823U, - (uint64_t)1107927314642236U, (uint64_t)2199986333469333U, (uint64_t)802974829322510U, - (uint64_t)718173128143482U, (uint64_t)539385184235615U, (uint64_t)2075693785611221U, - (uint64_t)953281147333690U, (uint64_t)1623571637172587U, (uint64_t)655274535022250U, - (uint64_t)1568078078819021U, (uint64_t)101142125049712U, (uint64_t)1488441673350881U, - (uint64_t)1457969561944515U, (uint64_t)1492622544287712U, (uint64_t)2041460689280803U, - (uint64_t)1961848091392887U, (uint64_t)461003520846938U, (uint64_t)934728060399807U, - (uint64_t)117723291519705U, (uint64_t)1027773762863526U, (uint64_t)56765304991567U, - (uint64_t)2184028379550479U, (uint64_t)1768767711894030U, (uint64_t)1304432068983172U, - (uint64_t)498080974452325U, (uint64_t)2134905654858163U, (uint64_t)1446137427202647U, - (uint64_t)551613831549590U, (uint64_t)680288767054205U, (uint64_t)1278113339140386U, - (uint64_t)378149431842614U, (uint64_t)80520494426960U, (uint64_t)2080985256348782U, - (uint64_t)673432591799820U, (uint64_t)739189463724560U, (uint64_t)1847191452197509U, - (uint64_t)527737312871602U, (uint64_t)477609358840073U, (uint64_t)1891633072677946U, - (uint64_t)1841456828278466U, (uint64_t)2242502936489002U, (uint64_t)524791829362709U, - (uint64_t)276648168514036U, (uint64_t)991706903257619U, (uint64_t)512580228297906U, - (uint64_t)1216855104975946U, (uint64_t)67030930303149U, (uint64_t)769593945208213U, - (uint64_t)2048873385103577U, (uint64_t)455635274123107U, (uint64_t)2077404927176696U, - (uint64_t)1803539634652306U, (uint64_t)1837579953843417U, (uint64_t)1564240068662828U, - (uint64_t)1964310918970435U, (uint64_t)832822906252492U, (uint64_t)1516044634195010U, - (uint64_t)770571447506889U, (uint64_t)602215152486818U, (uint64_t)1760828333136947U, - (uint64_t)730156776030376U + 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, + 0ULL, 0ULL, 0ULL, 0ULL, 557549315715710ULL, 196756086293855ULL, 846062225082495ULL, + 1865068224838092ULL, 991112090754908ULL, 522916421512828ULL, 2098523346722375ULL, + 1135633221747012ULL, 858420432114866ULL, 186358544306082ULL, 1044420411868480ULL, + 2080052304349321ULL, 557301814716724ULL, 1305130257814057ULL, 2126012765451197ULL, + 1441004402875101ULL, 353948968859203ULL, 470765987164835ULL, 1507675957683570ULL, + 1086650358745097ULL, 1911913434398388ULL, 66086091117182ULL, 1137511952425971ULL, + 36958263512141ULL, 2193310025325256ULL, 1085191426269045ULL, 1232148267909446ULL, + 1449894406170117ULL, 1241416717139557ULL, 1940876999212868ULL, 829758415918121ULL, + 309608450373449ULL, 2228398547683851ULL, 1580623271960188ULL, 1675601502456740ULL, + 1360363115493548ULL, 1098397313096815ULL, 1809255384359797ULL, 1458261916834384ULL, + 210682545649705ULL, 1606836641068115ULL, 1230478270405318ULL, 1843192771547802ULL, + 1794596343564051ULL, 229060710252162ULL, 2169742775467181ULL, 701467067318072ULL, + 696018499035555ULL, 521051885339807ULL, 158329567901874ULL, 740426481832143ULL, + 1369811177301441ULL, 503351589084015ULL, 1781114827942261ULL, 1650493549693035ULL, + 2174562418345156ULL, 456517194809244ULL, 2052761522121179ULL, 2233342271123682ULL, + 1445872925177435ULL, 1131882576902813ULL, 220765848055241ULL, 1280259961403769ULL, + 1581497080160712ULL, 1477441080108824ULL, 218428165202767ULL, 1970598141278907ULL, + 643366736173069ULL, 2167909426804014ULL, 834993711408259ULL, 1922437166463212ULL, + 1900036281472252ULL, 513794844386304ULL, 1297904164900114ULL, 1147626295373268ULL, + 1910101606251299ULL, 182933838633381ULL, 806229530787362ULL, 155511666433200ULL, + 290522463375462ULL, 534373523491751ULL, 1302938814480515ULL, 1664979184120445ULL, + 304235649499423ULL, 339284524318609ULL, 1881717946973483ULL, 1670802286833842ULL, + 2223637120675737ULL, 135818919485814ULL, 1144856572842792ULL, 2234981613434386ULL, + 963917024969826ULL, 402275378284993ULL, 141532417412170ULL, 921537468739387ULL, + 963905069722607ULL, 1405442890733358ULL, 1567763927164655ULL, 1664776329195930ULL, + 2095924165508507ULL, 994243110271379ULL, 1243925610609353ULL, 1029845815569727ULL, + 1001968867985629ULL, 170368934002484ULL, 1100906131583801ULL, 1825190326449569ULL, + 1462285121182096ULL, 1545240767016377ULL, 797859025652273ULL, 1062758326657530ULL, + 1125600735118266ULL, 739325756774527ULL, 1420144485966996ULL, 1915492743426702ULL, + 752968196344993ULL, 882156396938351ULL, 1909097048763227ULL, 849058590685611ULL, + 840754951388500ULL, 1832926948808323ULL, 2023317100075297ULL, 322382745442827ULL, + 1569741341737601ULL, 1678986113194987ULL, 757598994581938ULL, 29678659580705ULL, + 1239680935977986ULL, 1509239427168474ULL, 1055981929287006ULL, 1894085471158693ULL, + 916486225488490ULL, 642168890366120ULL, 300453362620010ULL, 1858797242721481ULL, + 2077989823177130ULL, 510228455273334ULL, 1473284798689270ULL, 5173934574301ULL, + 765285232030050ULL, 1007154707631065ULL, 1862128712885972ULL, 168873464821340ULL, + 1967853269759318ULL, 1489896018263031ULL, 592451806166369ULL, 1242298565603883ULL, + 1838918921339058ULL, 697532763910695ULL, 294335466239059ULL, 135687058387449ULL, + 2133734403874176ULL, 2121911143127699ULL, 20222476737364ULL, 1200824626476747ULL, + 1397731736540791ULL, 702378430231418ULL, 59059527640068ULL, 460992547183981ULL, + 1016125857842765ULL, 1273530839608957ULL, 96724128829301ULL, 1313433042425233ULL, + 3543822857227ULL, 761975685357118ULL, 110417360745248ULL, 1079634164577663ULL, + 2044574510020457ULL, 338709058603120ULL, 94541336042799ULL, 127963233585039ULL, + 94427896272258ULL, 1143501979342182ULL, 1217958006212230ULL, 2153887831492134ULL, + 1519219513255575ULL, 251793195454181ULL, 392517349345200ULL, 1507033011868881ULL, + 2208494254670752ULL, 1364389582694359ULL, 2214069430728063ULL, 1272814257105752ULL, + 741450148906352ULL, 1105776675555685ULL, 824447222014984ULL, 528745219306376ULL, + 589427609121575ULL, 1501786838809155ULL, 379067373073147ULL, 184909476589356ULL, + 1346887560616185ULL, 1932023742314082ULL, 1633302311869264ULL, 1685314821133069ULL, + 1836610282047884ULL, 1595571594397150ULL, 615441688872198ULL, 1926435616702564ULL, + 235632180396480ULL, 1051918343571810ULL, 2150570051687050ULL, 879198845408738ULL, + 1443966275205464ULL, 481362545245088ULL, 512807443532642ULL, 641147578283480ULL, + 1594276116945596ULL, 1844812743300602ULL, 2044559316019485ULL, 202620777969020ULL, + 852992984136302ULL, 1500869642692910ULL, 1085216217052457ULL, 1736294372259758ULL, + 2009666354486552ULL, 1262389020715248ULL, 1166527705256867ULL, 1409917450806036ULL, + 1705819160057637ULL, 1116901782584378ULL, 1278460472285473ULL, 257879811360157ULL, + 40314007176886ULL, 701309846749639ULL, 1380457676672777ULL, 631519782380272ULL, + 1196339573466793ULL, 955537708940017ULL, 532725633381530ULL, 641190593731833ULL, + 7214357153807ULL, 481922072107983ULL, 1634886189207352ULL, 1247659758261633ULL, + 1655809614786430ULL, 43105797900223ULL, 76205809912607ULL, 1936575107455823ULL, + 1107927314642236ULL, 2199986333469333ULL, 802974829322510ULL, 718173128143482ULL, + 539385184235615ULL, 2075693785611221ULL, 953281147333690ULL, 1623571637172587ULL, + 655274535022250ULL, 1568078078819021ULL, 101142125049712ULL, 1488441673350881ULL, + 1457969561944515ULL, 1492622544287712ULL, 2041460689280803ULL, 1961848091392887ULL, + 461003520846938ULL, 934728060399807ULL, 117723291519705ULL, 1027773762863526ULL, + 56765304991567ULL, 2184028379550479ULL, 1768767711894030ULL, 1304432068983172ULL, + 498080974452325ULL, 2134905654858163ULL, 1446137427202647ULL, 551613831549590ULL, + 680288767054205ULL, 1278113339140386ULL, 378149431842614ULL, 80520494426960ULL, + 2080985256348782ULL, 673432591799820ULL, 739189463724560ULL, 1847191452197509ULL, + 527737312871602ULL, 477609358840073ULL, 1891633072677946ULL, 1841456828278466ULL, + 2242502936489002ULL, 524791829362709ULL, 276648168514036ULL, 991706903257619ULL, + 512580228297906ULL, 1216855104975946ULL, 67030930303149ULL, 769593945208213ULL, + 2048873385103577ULL, 455635274123107ULL, 2077404927176696ULL, 1803539634652306ULL, + 1837579953843417ULL, 1564240068662828ULL, 1964310918970435ULL, 832822906252492ULL, + 1516044634195010ULL, 770571447506889ULL, 602215152486818ULL, 1760828333136947ULL, + 730156776030376ULL }; static const uint64_t Hacl_Ed25519_PrecompTable_precomp_g_pow2_192_table_w4[320U] = { - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)1129953239743101U, (uint64_t)1240339163956160U, - (uint64_t)61002583352401U, (uint64_t)2017604552196030U, (uint64_t)1576867829229863U, - (uint64_t)1508654942849389U, (uint64_t)270111619664077U, (uint64_t)1253097517254054U, - (uint64_t)721798270973250U, (uint64_t)161923365415298U, (uint64_t)828530877526011U, - (uint64_t)1494851059386763U, (uint64_t)662034171193976U, (uint64_t)1315349646974670U, - (uint64_t)2199229517308806U, (uint64_t)497078277852673U, (uint64_t)1310507715989956U, - (uint64_t)1881315714002105U, (uint64_t)2214039404983803U, (uint64_t)1331036420272667U, - (uint64_t)296286697520787U, (uint64_t)1179367922639127U, (uint64_t)25348441419697U, - (uint64_t)2200984961703188U, (uint64_t)150893128908291U, (uint64_t)1978614888570852U, - (uint64_t)1539657347172046U, (uint64_t)553810196523619U, (uint64_t)246017573977646U, - (uint64_t)1440448985385485U, (uint64_t)346049108099981U, (uint64_t)601166606218546U, - (uint64_t)855822004151713U, (uint64_t)1957521326383188U, (uint64_t)1114240380430887U, - (uint64_t)1349639675122048U, (uint64_t)957375954499040U, (uint64_t)111551795360136U, - (uint64_t)618586733648988U, (uint64_t)490708840688866U, (uint64_t)1267002049697314U, - (uint64_t)1130723224930028U, (uint64_t)215603029480828U, (uint64_t)1277138555414710U, - (uint64_t)1556750324971322U, (uint64_t)1407903521793741U, (uint64_t)1836836546590749U, - (uint64_t)576500297444199U, (uint64_t)2074707599091135U, (uint64_t)1826239864380012U, - (uint64_t)1935365705983312U, (uint64_t)239501825683682U, (uint64_t)1594236669034980U, - (uint64_t)1283078975055301U, (uint64_t)856745636255925U, (uint64_t)1342128647959981U, - (uint64_t)945216428379689U, (uint64_t)938746202496410U, (uint64_t)105775123333919U, - (uint64_t)1379852610117266U, (uint64_t)1770216827500275U, (uint64_t)1016017267535704U, - (uint64_t)1902885522469532U, (uint64_t)994184703730489U, (uint64_t)2227487538793763U, - (uint64_t)53155967096055U, (uint64_t)1264120808114350U, (uint64_t)1334928769376729U, - (uint64_t)393911808079997U, (uint64_t)826229239481845U, (uint64_t)1827903006733192U, - (uint64_t)1449283706008465U, (uint64_t)1258040415217849U, (uint64_t)1641484112868370U, - (uint64_t)1140150841968176U, (uint64_t)391113338021313U, (uint64_t)162138667815833U, - (uint64_t)742204396566060U, (uint64_t)110709233440557U, (uint64_t)90179377432917U, - (uint64_t)530511949644489U, (uint64_t)911568635552279U, (uint64_t)135869304780166U, - (uint64_t)617719999563692U, (uint64_t)1802525001631319U, (uint64_t)1836394639510490U, - (uint64_t)1862739456475085U, (uint64_t)1378284444664288U, (uint64_t)1617882529391756U, - (uint64_t)876124429891172U, (uint64_t)1147654641445091U, (uint64_t)1476943370400542U, - (uint64_t)688601222759067U, (uint64_t)2120281968990205U, (uint64_t)1387113236912611U, - (uint64_t)2125245820685788U, (uint64_t)1030674016350092U, (uint64_t)1594684598654247U, - (uint64_t)1165939511879820U, (uint64_t)271499323244173U, (uint64_t)546587254515484U, - (uint64_t)945603425742936U, (uint64_t)1242252568170226U, (uint64_t)561598728058142U, - (uint64_t)604827091794712U, (uint64_t)19869753585186U, (uint64_t)565367744708915U, - (uint64_t)536755754533603U, (uint64_t)1767258313589487U, (uint64_t)907952975936127U, - (uint64_t)292851652613937U, (uint64_t)163573546237963U, (uint64_t)837601408384564U, - (uint64_t)591996990118301U, (uint64_t)2126051747693057U, (uint64_t)182247548824566U, - (uint64_t)908369044122868U, (uint64_t)1335442699947273U, (uint64_t)2234292296528612U, - (uint64_t)689537529333034U, (uint64_t)2174778663790714U, (uint64_t)1011407643592667U, - (uint64_t)1856130618715473U, (uint64_t)1557437221651741U, (uint64_t)2250285407006102U, - (uint64_t)1412384213410827U, (uint64_t)1428042038612456U, (uint64_t)962709733973660U, - (uint64_t)313995703125919U, (uint64_t)1844969155869325U, (uint64_t)787716782673657U, - (uint64_t)622504542173478U, (uint64_t)930119043384654U, (uint64_t)2128870043952488U, - (uint64_t)537781531479523U, (uint64_t)1556666269904940U, (uint64_t)417333635741346U, - (uint64_t)1986743846438415U, (uint64_t)877620478041197U, (uint64_t)2205624582983829U, - (uint64_t)595260668884488U, (uint64_t)2025159350373157U, (uint64_t)2091659716088235U, - (uint64_t)1423634716596391U, (uint64_t)653686638634080U, (uint64_t)1972388399989956U, - (uint64_t)795575741798014U, (uint64_t)889240107997846U, (uint64_t)1446156876910732U, - (uint64_t)1028507012221776U, (uint64_t)1071697574586478U, (uint64_t)1689630411899691U, - (uint64_t)604092816502174U, (uint64_t)1909917373896122U, (uint64_t)1602544877643837U, - (uint64_t)1227177032923867U, (uint64_t)62684197535630U, (uint64_t)186146290753883U, - (uint64_t)414449055316766U, (uint64_t)1560555880866750U, (uint64_t)157579947096755U, - (uint64_t)230526795502384U, (uint64_t)1197673369665894U, (uint64_t)593779215869037U, - (uint64_t)214638834474097U, (uint64_t)1796344443484478U, (uint64_t)493550548257317U, - (uint64_t)1628442824033694U, (uint64_t)1410811655893495U, (uint64_t)1009361960995171U, - (uint64_t)604736219740352U, (uint64_t)392445928555351U, (uint64_t)1254295770295706U, - (uint64_t)1958074535046128U, (uint64_t)508699942241019U, (uint64_t)739405911261325U, - (uint64_t)1678760393882409U, (uint64_t)517763708545996U, (uint64_t)640040257898722U, - (uint64_t)384966810872913U, (uint64_t)407454748380128U, (uint64_t)152604679407451U, - (uint64_t)185102854927662U, (uint64_t)1448175503649595U, (uint64_t)100328519208674U, - (uint64_t)1153263667012830U, (uint64_t)1643926437586490U, (uint64_t)609632142834154U, - (uint64_t)980984004749261U, (uint64_t)855290732258779U, (uint64_t)2186022163021506U, - (uint64_t)1254052618626070U, (uint64_t)1850030517182611U, (uint64_t)162348933090207U, - (uint64_t)1948712273679932U, (uint64_t)1331832516262191U, (uint64_t)1219400369175863U, - (uint64_t)89689036937483U, (uint64_t)1554886057235815U, (uint64_t)1520047528432789U, - (uint64_t)81263957652811U, (uint64_t)146612464257008U, (uint64_t)2207945627164163U, - (uint64_t)919846660682546U, (uint64_t)1925694087906686U, (uint64_t)2102027292388012U, - (uint64_t)887992003198635U, (uint64_t)1817924871537027U, (uint64_t)746660005584342U, - (uint64_t)753757153275525U, (uint64_t)91394270908699U, (uint64_t)511837226544151U, - (uint64_t)736341543649373U, (uint64_t)1256371121466367U, (uint64_t)1977778299551813U, - (uint64_t)817915174462263U, (uint64_t)1602323381418035U, (uint64_t)190035164572930U, - (uint64_t)603796401391181U, (uint64_t)2152666873671669U, (uint64_t)1813900316324112U, - (uint64_t)1292622433358041U, (uint64_t)888439870199892U, (uint64_t)978918155071994U, - (uint64_t)534184417909805U, (uint64_t)466460084317313U, (uint64_t)1275223140288685U, - (uint64_t)786407043883517U, (uint64_t)1620520623925754U, (uint64_t)1753625021290269U, - (uint64_t)751937175104525U, (uint64_t)905301961820613U, (uint64_t)697059847245437U, - (uint64_t)584919033981144U, (uint64_t)1272165506533156U, (uint64_t)1532180021450866U, - (uint64_t)1901407354005301U, (uint64_t)1421319720492586U, (uint64_t)2179081609765456U, - (uint64_t)2193253156667632U, (uint64_t)1080248329608584U, (uint64_t)2158422436462066U, - (uint64_t)759167597017850U, (uint64_t)545759071151285U, (uint64_t)641600428493698U, - (uint64_t)943791424499848U, (uint64_t)469571542427864U, (uint64_t)951117845222467U, - (uint64_t)1780538594373407U, (uint64_t)614611122040309U, (uint64_t)1354826131886963U, - (uint64_t)221898131992340U, (uint64_t)1145699723916219U, (uint64_t)798735379961769U, - (uint64_t)1843560518208287U, (uint64_t)1424523160161545U, (uint64_t)205549016574779U, - (uint64_t)2239491587362749U, (uint64_t)1918363582399888U, (uint64_t)1292183072788455U, - (uint64_t)1783513123192567U, (uint64_t)1584027954317205U, (uint64_t)1890421443925740U, - (uint64_t)1718459319874929U, (uint64_t)1522091040748809U, (uint64_t)399467600667219U, - (uint64_t)1870973059066576U, (uint64_t)287514433150348U, (uint64_t)1397845311152885U, - (uint64_t)1880440629872863U, (uint64_t)709302939340341U, (uint64_t)1813571361109209U, - (uint64_t)86598795876860U, (uint64_t)1146964554310612U, (uint64_t)1590956584862432U, - (uint64_t)2097004628155559U, (uint64_t)656227622102390U, (uint64_t)1808500445541891U, - (uint64_t)958336726523135U, (uint64_t)2007604569465975U, (uint64_t)313504950390997U, - (uint64_t)1399686004953620U, (uint64_t)1759732788465234U, (uint64_t)1562539721055836U, - (uint64_t)1575722765016293U, (uint64_t)793318366641259U, (uint64_t)443876859384887U, - (uint64_t)547308921989704U, (uint64_t)636698687503328U, (uint64_t)2179175835287340U, - (uint64_t)498333551718258U, (uint64_t)932248760026176U, (uint64_t)1612395686304653U, - (uint64_t)2179774103745626U, (uint64_t)1359658123541018U, (uint64_t)171488501802442U, - (uint64_t)1625034951791350U, (uint64_t)520196922773633U, (uint64_t)1873787546341877U, - (uint64_t)303457823885368U + 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, + 0ULL, 0ULL, 0ULL, 0ULL, 1129953239743101ULL, 1240339163956160ULL, 61002583352401ULL, + 2017604552196030ULL, 1576867829229863ULL, 1508654942849389ULL, 270111619664077ULL, + 1253097517254054ULL, 721798270973250ULL, 161923365415298ULL, 828530877526011ULL, + 1494851059386763ULL, 662034171193976ULL, 1315349646974670ULL, 2199229517308806ULL, + 497078277852673ULL, 1310507715989956ULL, 1881315714002105ULL, 2214039404983803ULL, + 1331036420272667ULL, 296286697520787ULL, 1179367922639127ULL, 25348441419697ULL, + 2200984961703188ULL, 150893128908291ULL, 1978614888570852ULL, 1539657347172046ULL, + 553810196523619ULL, 246017573977646ULL, 1440448985385485ULL, 346049108099981ULL, + 601166606218546ULL, 855822004151713ULL, 1957521326383188ULL, 1114240380430887ULL, + 1349639675122048ULL, 957375954499040ULL, 111551795360136ULL, 618586733648988ULL, + 490708840688866ULL, 1267002049697314ULL, 1130723224930028ULL, 215603029480828ULL, + 1277138555414710ULL, 1556750324971322ULL, 1407903521793741ULL, 1836836546590749ULL, + 576500297444199ULL, 2074707599091135ULL, 1826239864380012ULL, 1935365705983312ULL, + 239501825683682ULL, 1594236669034980ULL, 1283078975055301ULL, 856745636255925ULL, + 1342128647959981ULL, 945216428379689ULL, 938746202496410ULL, 105775123333919ULL, + 1379852610117266ULL, 1770216827500275ULL, 1016017267535704ULL, 1902885522469532ULL, + 994184703730489ULL, 2227487538793763ULL, 53155967096055ULL, 1264120808114350ULL, + 1334928769376729ULL, 393911808079997ULL, 826229239481845ULL, 1827903006733192ULL, + 1449283706008465ULL, 1258040415217849ULL, 1641484112868370ULL, 1140150841968176ULL, + 391113338021313ULL, 162138667815833ULL, 742204396566060ULL, 110709233440557ULL, + 90179377432917ULL, 530511949644489ULL, 911568635552279ULL, 135869304780166ULL, + 617719999563692ULL, 1802525001631319ULL, 1836394639510490ULL, 1862739456475085ULL, + 1378284444664288ULL, 1617882529391756ULL, 876124429891172ULL, 1147654641445091ULL, + 1476943370400542ULL, 688601222759067ULL, 2120281968990205ULL, 1387113236912611ULL, + 2125245820685788ULL, 1030674016350092ULL, 1594684598654247ULL, 1165939511879820ULL, + 271499323244173ULL, 546587254515484ULL, 945603425742936ULL, 1242252568170226ULL, + 561598728058142ULL, 604827091794712ULL, 19869753585186ULL, 565367744708915ULL, + 536755754533603ULL, 1767258313589487ULL, 907952975936127ULL, 292851652613937ULL, + 163573546237963ULL, 837601408384564ULL, 591996990118301ULL, 2126051747693057ULL, + 182247548824566ULL, 908369044122868ULL, 1335442699947273ULL, 2234292296528612ULL, + 689537529333034ULL, 2174778663790714ULL, 1011407643592667ULL, 1856130618715473ULL, + 1557437221651741ULL, 2250285407006102ULL, 1412384213410827ULL, 1428042038612456ULL, + 962709733973660ULL, 313995703125919ULL, 1844969155869325ULL, 787716782673657ULL, + 622504542173478ULL, 930119043384654ULL, 2128870043952488ULL, 537781531479523ULL, + 1556666269904940ULL, 417333635741346ULL, 1986743846438415ULL, 877620478041197ULL, + 2205624582983829ULL, 595260668884488ULL, 2025159350373157ULL, 2091659716088235ULL, + 1423634716596391ULL, 653686638634080ULL, 1972388399989956ULL, 795575741798014ULL, + 889240107997846ULL, 1446156876910732ULL, 1028507012221776ULL, 1071697574586478ULL, + 1689630411899691ULL, 604092816502174ULL, 1909917373896122ULL, 1602544877643837ULL, + 1227177032923867ULL, 62684197535630ULL, 186146290753883ULL, 414449055316766ULL, + 1560555880866750ULL, 157579947096755ULL, 230526795502384ULL, 1197673369665894ULL, + 593779215869037ULL, 214638834474097ULL, 1796344443484478ULL, 493550548257317ULL, + 1628442824033694ULL, 1410811655893495ULL, 1009361960995171ULL, 604736219740352ULL, + 392445928555351ULL, 1254295770295706ULL, 1958074535046128ULL, 508699942241019ULL, + 739405911261325ULL, 1678760393882409ULL, 517763708545996ULL, 640040257898722ULL, + 384966810872913ULL, 407454748380128ULL, 152604679407451ULL, 185102854927662ULL, + 1448175503649595ULL, 100328519208674ULL, 1153263667012830ULL, 1643926437586490ULL, + 609632142834154ULL, 980984004749261ULL, 855290732258779ULL, 2186022163021506ULL, + 1254052618626070ULL, 1850030517182611ULL, 162348933090207ULL, 1948712273679932ULL, + 1331832516262191ULL, 1219400369175863ULL, 89689036937483ULL, 1554886057235815ULL, + 1520047528432789ULL, 81263957652811ULL, 146612464257008ULL, 2207945627164163ULL, + 919846660682546ULL, 1925694087906686ULL, 2102027292388012ULL, 887992003198635ULL, + 1817924871537027ULL, 746660005584342ULL, 753757153275525ULL, 91394270908699ULL, + 511837226544151ULL, 736341543649373ULL, 1256371121466367ULL, 1977778299551813ULL, + 817915174462263ULL, 1602323381418035ULL, 190035164572930ULL, 603796401391181ULL, + 2152666873671669ULL, 1813900316324112ULL, 1292622433358041ULL, 888439870199892ULL, + 978918155071994ULL, 534184417909805ULL, 466460084317313ULL, 1275223140288685ULL, + 786407043883517ULL, 1620520623925754ULL, 1753625021290269ULL, 751937175104525ULL, + 905301961820613ULL, 697059847245437ULL, 584919033981144ULL, 1272165506533156ULL, + 1532180021450866ULL, 1901407354005301ULL, 1421319720492586ULL, 2179081609765456ULL, + 2193253156667632ULL, 1080248329608584ULL, 2158422436462066ULL, 759167597017850ULL, + 545759071151285ULL, 641600428493698ULL, 943791424499848ULL, 469571542427864ULL, + 951117845222467ULL, 1780538594373407ULL, 614611122040309ULL, 1354826131886963ULL, + 221898131992340ULL, 1145699723916219ULL, 798735379961769ULL, 1843560518208287ULL, + 1424523160161545ULL, 205549016574779ULL, 2239491587362749ULL, 1918363582399888ULL, + 1292183072788455ULL, 1783513123192567ULL, 1584027954317205ULL, 1890421443925740ULL, + 1718459319874929ULL, 1522091040748809ULL, 399467600667219ULL, 1870973059066576ULL, + 287514433150348ULL, 1397845311152885ULL, 1880440629872863ULL, 709302939340341ULL, + 1813571361109209ULL, 86598795876860ULL, 1146964554310612ULL, 1590956584862432ULL, + 2097004628155559ULL, 656227622102390ULL, 1808500445541891ULL, 958336726523135ULL, + 2007604569465975ULL, 313504950390997ULL, 1399686004953620ULL, 1759732788465234ULL, + 1562539721055836ULL, 1575722765016293ULL, 793318366641259ULL, 443876859384887ULL, + 547308921989704ULL, 636698687503328ULL, 2179175835287340ULL, 498333551718258ULL, + 932248760026176ULL, 1612395686304653ULL, 2179774103745626ULL, 1359658123541018ULL, + 171488501802442ULL, 1625034951791350ULL, 520196922773633ULL, 1873787546341877ULL, + 303457823885368ULL }; static const uint64_t Hacl_Ed25519_PrecompTable_precomp_basepoint_table_w5[640U] = { - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)1738742601995546U, (uint64_t)1146398526822698U, - (uint64_t)2070867633025821U, (uint64_t)562264141797630U, (uint64_t)587772402128613U, - (uint64_t)1801439850948184U, (uint64_t)1351079888211148U, (uint64_t)450359962737049U, - (uint64_t)900719925474099U, (uint64_t)1801439850948198U, (uint64_t)1U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1841354044333475U, - (uint64_t)16398895984059U, (uint64_t)755974180946558U, (uint64_t)900171276175154U, - (uint64_t)1821297809914039U, (uint64_t)1661154287933054U, (uint64_t)284530020860578U, - (uint64_t)1390261174866914U, (uint64_t)1524110943907984U, (uint64_t)1045603498418422U, - (uint64_t)928651508580478U, (uint64_t)1383326941296346U, (uint64_t)961937908925785U, - (uint64_t)80455759693706U, (uint64_t)904734540352947U, (uint64_t)1507481815385608U, - (uint64_t)2223447444246085U, (uint64_t)1083941587175919U, (uint64_t)2059929906842505U, - (uint64_t)1581435440146976U, (uint64_t)782730187692425U, (uint64_t)9928394897574U, - (uint64_t)1539449519985236U, (uint64_t)1923587931078510U, (uint64_t)552919286076056U, - (uint64_t)376925408065760U, (uint64_t)447320488831784U, (uint64_t)1362918338468019U, - (uint64_t)1470031896696846U, (uint64_t)2189796996539902U, (uint64_t)1337552949959847U, - (uint64_t)1762287177775726U, (uint64_t)237994495816815U, (uint64_t)1277840395970544U, - (uint64_t)543972849007241U, (uint64_t)1224692671618814U, (uint64_t)162359533289271U, - (uint64_t)282240927125249U, (uint64_t)586909166382289U, (uint64_t)17726488197838U, - (uint64_t)377014554985659U, (uint64_t)1433835303052512U, (uint64_t)702061469493692U, - (uint64_t)1142253108318154U, (uint64_t)318297794307551U, (uint64_t)954362646308543U, - (uint64_t)517363881452320U, (uint64_t)1868013482130416U, (uint64_t)262562472373260U, - (uint64_t)902232853249919U, (uint64_t)2107343057055746U, (uint64_t)462368348619024U, - (uint64_t)1893758677092974U, (uint64_t)2177729767846389U, (uint64_t)2168532543559143U, - (uint64_t)443867094639821U, (uint64_t)730169342581022U, (uint64_t)1564589016879755U, - (uint64_t)51218195700649U, (uint64_t)76684578423745U, (uint64_t)560266272480743U, - (uint64_t)922517457707697U, (uint64_t)2066645939860874U, (uint64_t)1318277348414638U, - (uint64_t)1576726809084003U, (uint64_t)1817337608563665U, (uint64_t)1874240939237666U, - (uint64_t)754733726333910U, (uint64_t)97085310406474U, (uint64_t)751148364309235U, - (uint64_t)1622159695715187U, (uint64_t)1444098819684916U, (uint64_t)130920805558089U, - (uint64_t)1260449179085308U, (uint64_t)1860021740768461U, (uint64_t)110052860348509U, - (uint64_t)193830891643810U, (uint64_t)164148413933881U, (uint64_t)180017794795332U, - (uint64_t)1523506525254651U, (uint64_t)465981629225956U, (uint64_t)559733514964572U, - (uint64_t)1279624874416974U, (uint64_t)2026642326892306U, (uint64_t)1425156829982409U, - (uint64_t)2160936383793147U, (uint64_t)1061870624975247U, (uint64_t)2023497043036941U, - (uint64_t)117942212883190U, (uint64_t)490339622800774U, (uint64_t)1729931303146295U, - (uint64_t)422305932971074U, (uint64_t)529103152793096U, (uint64_t)1211973233775992U, - (uint64_t)721364955929681U, (uint64_t)1497674430438813U, (uint64_t)342545521275073U, - (uint64_t)2102107575279372U, (uint64_t)2108462244669966U, (uint64_t)1382582406064082U, - (uint64_t)2206396818383323U, (uint64_t)2109093268641147U, (uint64_t)10809845110983U, - (uint64_t)1605176920880099U, (uint64_t)744640650753946U, (uint64_t)1712758897518129U, - (uint64_t)373410811281809U, (uint64_t)648838265800209U, (uint64_t)813058095530999U, - (uint64_t)513987632620169U, (uint64_t)465516160703329U, (uint64_t)2136322186126330U, - (uint64_t)1979645899422932U, (uint64_t)1197131006470786U, (uint64_t)1467836664863979U, - (uint64_t)1340751381374628U, (uint64_t)1810066212667962U, (uint64_t)1009933588225499U, - (uint64_t)1106129188080873U, (uint64_t)1388980405213901U, (uint64_t)533719246598044U, - (uint64_t)1169435803073277U, (uint64_t)198920999285821U, (uint64_t)487492330629854U, - (uint64_t)1807093008537778U, (uint64_t)1540899012923865U, (uint64_t)2075080271659867U, - (uint64_t)1527990806921523U, (uint64_t)1323728742908002U, (uint64_t)1568595959608205U, - (uint64_t)1388032187497212U, (uint64_t)2026968840050568U, (uint64_t)1396591153295755U, - (uint64_t)820416950170901U, (uint64_t)520060313205582U, (uint64_t)2016404325094901U, - (uint64_t)1584709677868520U, (uint64_t)272161374469956U, (uint64_t)1567188603996816U, - (uint64_t)1986160530078221U, (uint64_t)553930264324589U, (uint64_t)1058426729027503U, - (uint64_t)8762762886675U, (uint64_t)2216098143382988U, (uint64_t)1835145266889223U, - (uint64_t)1712936431558441U, (uint64_t)1017009937844974U, (uint64_t)585361667812740U, - (uint64_t)2114711541628181U, (uint64_t)2238729632971439U, (uint64_t)121257546253072U, - (uint64_t)847154149018345U, (uint64_t)211972965476684U, (uint64_t)287499084460129U, - (uint64_t)2098247259180197U, (uint64_t)839070411583329U, (uint64_t)339551619574372U, - (uint64_t)1432951287640743U, (uint64_t)526481249498942U, (uint64_t)931991661905195U, - (uint64_t)1884279965674487U, (uint64_t)200486405604411U, (uint64_t)364173020594788U, - (uint64_t)518034455936955U, (uint64_t)1085564703965501U, (uint64_t)16030410467927U, - (uint64_t)604865933167613U, (uint64_t)1695298441093964U, (uint64_t)498856548116159U, - (uint64_t)2193030062787034U, (uint64_t)1706339802964179U, (uint64_t)1721199073493888U, - (uint64_t)820740951039755U, (uint64_t)1216053436896834U, (uint64_t)23954895815139U, - (uint64_t)1662515208920491U, (uint64_t)1705443427511899U, (uint64_t)1957928899570365U, - (uint64_t)1189636258255725U, (uint64_t)1795695471103809U, (uint64_t)1691191297654118U, - (uint64_t)282402585374360U, (uint64_t)460405330264832U, (uint64_t)63765529445733U, - (uint64_t)469763447404473U, (uint64_t)733607089694996U, (uint64_t)685410420186959U, - (uint64_t)1096682630419738U, (uint64_t)1162548510542362U, (uint64_t)1020949526456676U, - (uint64_t)1211660396870573U, (uint64_t)613126398222696U, (uint64_t)1117829165843251U, - (uint64_t)742432540886650U, (uint64_t)1483755088010658U, (uint64_t)942392007134474U, - (uint64_t)1447834130944107U, (uint64_t)489368274863410U, (uint64_t)23192985544898U, - (uint64_t)648442406146160U, (uint64_t)785438843373876U, (uint64_t)249464684645238U, - (uint64_t)170494608205618U, (uint64_t)335112827260550U, (uint64_t)1462050123162735U, - (uint64_t)1084803668439016U, (uint64_t)853459233600325U, (uint64_t)215777728187495U, - (uint64_t)1965759433526974U, (uint64_t)1349482894446537U, (uint64_t)694163317612871U, - (uint64_t)860536766165036U, (uint64_t)1178788094084321U, (uint64_t)1652739626626996U, - (uint64_t)2115723946388185U, (uint64_t)1577204379094664U, (uint64_t)1083882859023240U, - (uint64_t)1768759143381635U, (uint64_t)1737180992507258U, (uint64_t)246054513922239U, - (uint64_t)577253134087234U, (uint64_t)356340280578042U, (uint64_t)1638917769925142U, - (uint64_t)223550348130103U, (uint64_t)470592666638765U, (uint64_t)22663573966996U, - (uint64_t)596552461152400U, (uint64_t)364143537069499U, (uint64_t)3942119457699U, - (uint64_t)107951982889287U, (uint64_t)1843471406713209U, (uint64_t)1625773041610986U, - (uint64_t)1466141092501702U, (uint64_t)1043024095021271U, (uint64_t)310429964047508U, - (uint64_t)98559121500372U, (uint64_t)152746933782868U, (uint64_t)259407205078261U, - (uint64_t)828123093322585U, (uint64_t)1576847274280091U, (uint64_t)1170871375757302U, - (uint64_t)1588856194642775U, (uint64_t)984767822341977U, (uint64_t)1141497997993760U, - (uint64_t)809325345150796U, (uint64_t)1879837728202511U, (uint64_t)201340910657893U, - (uint64_t)1079157558888483U, (uint64_t)1052373448588065U, (uint64_t)1732036202501778U, - (uint64_t)2105292670328445U, (uint64_t)679751387312402U, (uint64_t)1679682144926229U, - (uint64_t)1695823455818780U, (uint64_t)498852317075849U, (uint64_t)1786555067788433U, - (uint64_t)1670727545779425U, (uint64_t)117945875433544U, (uint64_t)407939139781844U, - (uint64_t)854632120023778U, (uint64_t)1413383148360437U, (uint64_t)286030901733673U, - (uint64_t)1207361858071196U, (uint64_t)461340408181417U, (uint64_t)1096919590360164U, - (uint64_t)1837594897475685U, (uint64_t)533755561544165U, (uint64_t)1638688042247712U, - (uint64_t)1431653684793005U, (uint64_t)1036458538873559U, (uint64_t)390822120341779U, - (uint64_t)1920929837111618U, (uint64_t)543426740024168U, (uint64_t)645751357799929U, - (uint64_t)2245025632994463U, (uint64_t)1550778638076452U, (uint64_t)223738153459949U, - (uint64_t)1337209385492033U, (uint64_t)1276967236456531U, (uint64_t)1463815821063071U, - (uint64_t)2070620870191473U, (uint64_t)1199170709413753U, (uint64_t)273230877394166U, - (uint64_t)1873264887608046U, (uint64_t)890877152910775U, (uint64_t)983226445635730U, - (uint64_t)44873798519521U, (uint64_t)697147127512130U, (uint64_t)961631038239304U, - (uint64_t)709966160696826U, (uint64_t)1706677689540366U, (uint64_t)502782733796035U, - (uint64_t)812545535346033U, (uint64_t)1693622521296452U, (uint64_t)1955813093002510U, - (uint64_t)1259937612881362U, (uint64_t)1873032503803559U, (uint64_t)1140330566016428U, - (uint64_t)1675726082440190U, (uint64_t)60029928909786U, (uint64_t)170335608866763U, - (uint64_t)766444312315022U, (uint64_t)2025049511434113U, (uint64_t)2200845622430647U, - (uint64_t)1201269851450408U, (uint64_t)590071752404907U, (uint64_t)1400995030286946U, - (uint64_t)2152637413853822U, (uint64_t)2108495473841983U, (uint64_t)3855406710349U, - (uint64_t)1726137673168580U, (uint64_t)51004317200100U, (uint64_t)1749082328586939U, - (uint64_t)1704088976144558U, (uint64_t)1977318954775118U, (uint64_t)2062602253162400U, - (uint64_t)948062503217479U, (uint64_t)361953965048030U, (uint64_t)1528264887238440U, - (uint64_t)62582552172290U, (uint64_t)2241602163389280U, (uint64_t)156385388121765U, - (uint64_t)2124100319761492U, (uint64_t)388928050571382U, (uint64_t)1556123596922727U, - (uint64_t)979310669812384U, (uint64_t)113043855206104U, (uint64_t)2023223924825469U, - (uint64_t)643651703263034U, (uint64_t)2234446903655540U, (uint64_t)1577241261424997U, - (uint64_t)860253174523845U, (uint64_t)1691026473082448U, (uint64_t)1091672764933872U, - (uint64_t)1957463109756365U, (uint64_t)530699502660193U, (uint64_t)349587141723569U, - (uint64_t)674661681919563U, (uint64_t)1633727303856240U, (uint64_t)708909037922144U, - (uint64_t)2160722508518119U, (uint64_t)1302188051602540U, (uint64_t)976114603845777U, - (uint64_t)120004758721939U, (uint64_t)1681630708873780U, (uint64_t)622274095069244U, - (uint64_t)1822346309016698U, (uint64_t)1100921177951904U, (uint64_t)2216952659181677U, - (uint64_t)1844020550362490U, (uint64_t)1976451368365774U, (uint64_t)1321101422068822U, - (uint64_t)1189859436282668U, (uint64_t)2008801879735257U, (uint64_t)2219413454333565U, - (uint64_t)424288774231098U, (uint64_t)359793146977912U, (uint64_t)270293357948703U, - (uint64_t)587226003677000U, (uint64_t)1482071926139945U, (uint64_t)1419630774650359U, - (uint64_t)1104739070570175U, (uint64_t)1662129023224130U, (uint64_t)1609203612533411U, - (uint64_t)1250932720691980U, (uint64_t)95215711818495U, (uint64_t)498746909028150U, - (uint64_t)158151296991874U, (uint64_t)1201379988527734U, (uint64_t)561599945143989U, - (uint64_t)2211577425617888U, (uint64_t)2166577612206324U, (uint64_t)1057590354233512U, - (uint64_t)1968123280416769U, (uint64_t)1316586165401313U, (uint64_t)762728164447634U, - (uint64_t)2045395244316047U, (uint64_t)1531796898725716U, (uint64_t)315385971670425U, - (uint64_t)1109421039396756U, (uint64_t)2183635256408562U, (uint64_t)1896751252659461U, - (uint64_t)840236037179080U, (uint64_t)796245792277211U, (uint64_t)508345890111193U, - (uint64_t)1275386465287222U, (uint64_t)513560822858784U, (uint64_t)1784735733120313U, - (uint64_t)1346467478899695U, (uint64_t)601125231208417U, (uint64_t)701076661112726U, - (uint64_t)1841998436455089U, (uint64_t)1156768600940434U, (uint64_t)1967853462343221U, - (uint64_t)2178318463061452U, (uint64_t)481885520752741U, (uint64_t)675262828640945U, - (uint64_t)1033539418596582U, (uint64_t)1743329872635846U, (uint64_t)159322641251283U, - (uint64_t)1573076470127113U, (uint64_t)954827619308195U, (uint64_t)778834750662635U, - (uint64_t)619912782122617U, (uint64_t)515681498488209U, (uint64_t)1675866144246843U, - (uint64_t)811716020969981U, (uint64_t)1125515272217398U, (uint64_t)1398917918287342U, - (uint64_t)1301680949183175U, (uint64_t)726474739583734U, (uint64_t)587246193475200U, - (uint64_t)1096581582611864U, (uint64_t)1469911826213486U, (uint64_t)1990099711206364U, - (uint64_t)1256496099816508U, (uint64_t)2019924615195672U, (uint64_t)1251232456707555U, - (uint64_t)2042971196009755U, (uint64_t)214061878479265U, (uint64_t)115385726395472U, - (uint64_t)1677875239524132U, (uint64_t)756888883383540U, (uint64_t)1153862117756233U, - (uint64_t)503391530851096U, (uint64_t)946070017477513U, (uint64_t)1878319040542579U, - (uint64_t)1101349418586920U, (uint64_t)793245696431613U, (uint64_t)397920495357645U, - (uint64_t)2174023872951112U, (uint64_t)1517867915189593U, (uint64_t)1829855041462995U, - (uint64_t)1046709983503619U, (uint64_t)424081940711857U, (uint64_t)2112438073094647U, - (uint64_t)1504338467349861U, (uint64_t)2244574127374532U, (uint64_t)2136937537441911U, - (uint64_t)1741150838990304U, (uint64_t)25894628400571U, (uint64_t)512213526781178U, - (uint64_t)1168384260796379U, (uint64_t)1424607682379833U, (uint64_t)938677789731564U, - (uint64_t)872882241891896U, (uint64_t)1713199397007700U, (uint64_t)1410496326218359U, - (uint64_t)854379752407031U, (uint64_t)465141611727634U, (uint64_t)315176937037857U, - (uint64_t)1020115054571233U, (uint64_t)1856290111077229U, (uint64_t)2028366269898204U, - (uint64_t)1432980880307543U, (uint64_t)469932710425448U, (uint64_t)581165267592247U, - (uint64_t)496399148156603U, (uint64_t)2063435226705903U, (uint64_t)2116841086237705U, - (uint64_t)498272567217048U, (uint64_t)1829438076967906U, (uint64_t)1573925801278491U, - (uint64_t)460763576329867U, (uint64_t)1705264723728225U, (uint64_t)999514866082412U, - (uint64_t)29635061779362U, (uint64_t)1884233592281020U, (uint64_t)1449755591461338U, - (uint64_t)42579292783222U, (uint64_t)1869504355369200U, (uint64_t)495506004805251U, - (uint64_t)264073104888427U, (uint64_t)2088880861028612U, (uint64_t)104646456386576U, - (uint64_t)1258445191399967U, (uint64_t)1348736801545799U, (uint64_t)2068276361286613U, - (uint64_t)884897216646374U, (uint64_t)922387476801376U, (uint64_t)1043886580402805U, - (uint64_t)1240883498470831U, (uint64_t)1601554651937110U, (uint64_t)804382935289482U, - (uint64_t)512379564477239U, (uint64_t)1466384519077032U, (uint64_t)1280698500238386U, - (uint64_t)211303836685749U, (uint64_t)2081725624793803U, (uint64_t)545247644516879U, - (uint64_t)215313359330384U, (uint64_t)286479751145614U, (uint64_t)2213650281751636U, - (uint64_t)2164927945999874U, (uint64_t)2072162991540882U, (uint64_t)1443769115444779U, - (uint64_t)1581473274363095U, (uint64_t)434633875922699U, (uint64_t)340456055781599U, - (uint64_t)373043091080189U, (uint64_t)839476566531776U, (uint64_t)1856706858509978U, - (uint64_t)931616224909153U, (uint64_t)1888181317414065U, (uint64_t)213654322650262U, - (uint64_t)1161078103416244U, (uint64_t)1822042328851513U, (uint64_t)915817709028812U, - (uint64_t)1828297056698188U, (uint64_t)1212017130909403U, (uint64_t)60258343247333U, - (uint64_t)342085800008230U, (uint64_t)930240559508270U, (uint64_t)1549884999174952U, - (uint64_t)809895264249462U, (uint64_t)184726257947682U, (uint64_t)1157065433504828U, - (uint64_t)1209999630381477U, (uint64_t)999920399374391U, (uint64_t)1714770150788163U, - (uint64_t)2026130985413228U, (uint64_t)506776632883140U, (uint64_t)1349042668246528U, - (uint64_t)1937232292976967U, (uint64_t)942302637530730U, (uint64_t)160211904766226U, - (uint64_t)1042724500438571U, (uint64_t)212454865139142U, (uint64_t)244104425172642U, - (uint64_t)1376990622387496U, (uint64_t)76126752421227U, (uint64_t)1027540886376422U, - (uint64_t)1912210655133026U, (uint64_t)13410411589575U, (uint64_t)1475856708587773U, - (uint64_t)615563352691682U, (uint64_t)1446629324872644U, (uint64_t)1683670301784014U, - (uint64_t)1049873327197127U, (uint64_t)1826401704084838U, (uint64_t)2032577048760775U, - (uint64_t)1922203607878853U, (uint64_t)836708788764806U, (uint64_t)2193084654695012U, - (uint64_t)1342923183256659U, (uint64_t)849356986294271U, (uint64_t)1228863973965618U, - (uint64_t)94886161081867U, (uint64_t)1423288430204892U, (uint64_t)2016167528707016U, - (uint64_t)1633187660972877U, (uint64_t)1550621242301752U, (uint64_t)340630244512994U, - (uint64_t)2103577710806901U, (uint64_t)221625016538931U, (uint64_t)421544147350960U, - (uint64_t)580428704555156U, (uint64_t)1479831381265617U, (uint64_t)518057926544698U, - (uint64_t)955027348790630U, (uint64_t)1326749172561598U, (uint64_t)1118304625755967U, - (uint64_t)1994005916095176U, (uint64_t)1799757332780663U, (uint64_t)751343129396941U, - (uint64_t)1468672898746144U, (uint64_t)1451689964451386U, (uint64_t)755070293921171U, - (uint64_t)904857405877052U, (uint64_t)1276087530766984U, (uint64_t)403986562858511U, - (uint64_t)1530661255035337U, (uint64_t)1644972908910502U, (uint64_t)1370170080438957U, - (uint64_t)139839536695744U, (uint64_t)909930462436512U, (uint64_t)1899999215356933U, - (uint64_t)635992381064566U, (uint64_t)788740975837654U, (uint64_t)224241231493695U, - (uint64_t)1267090030199302U, (uint64_t)998908061660139U, (uint64_t)1784537499699278U, - (uint64_t)859195370018706U, (uint64_t)1953966091439379U, (uint64_t)2189271820076010U, - (uint64_t)2039067059943978U, (uint64_t)1526694380855202U, (uint64_t)2040321513194941U, - (uint64_t)329922071218689U, (uint64_t)1953032256401326U, (uint64_t)989631424403521U, - (uint64_t)328825014934242U, (uint64_t)9407151397696U, (uint64_t)63551373671268U, - (uint64_t)1624728632895792U, (uint64_t)1608324920739262U, (uint64_t)1178239350351945U, - (uint64_t)1198077399579702U, (uint64_t)277620088676229U, (uint64_t)1775359437312528U, - (uint64_t)1653558177737477U, (uint64_t)1652066043408850U, (uint64_t)1063359889686622U, - (uint64_t)1975063804860653U + 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, + 0ULL, 0ULL, 0ULL, 0ULL, 1738742601995546ULL, 1146398526822698ULL, 2070867633025821ULL, + 562264141797630ULL, 587772402128613ULL, 1801439850948184ULL, 1351079888211148ULL, + 450359962737049ULL, 900719925474099ULL, 1801439850948198ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, + 1841354044333475ULL, 16398895984059ULL, 755974180946558ULL, 900171276175154ULL, + 1821297809914039ULL, 1661154287933054ULL, 284530020860578ULL, 1390261174866914ULL, + 1524110943907984ULL, 1045603498418422ULL, 928651508580478ULL, 1383326941296346ULL, + 961937908925785ULL, 80455759693706ULL, 904734540352947ULL, 1507481815385608ULL, + 2223447444246085ULL, 1083941587175919ULL, 2059929906842505ULL, 1581435440146976ULL, + 782730187692425ULL, 9928394897574ULL, 1539449519985236ULL, 1923587931078510ULL, + 552919286076056ULL, 376925408065760ULL, 447320488831784ULL, 1362918338468019ULL, + 1470031896696846ULL, 2189796996539902ULL, 1337552949959847ULL, 1762287177775726ULL, + 237994495816815ULL, 1277840395970544ULL, 543972849007241ULL, 1224692671618814ULL, + 162359533289271ULL, 282240927125249ULL, 586909166382289ULL, 17726488197838ULL, + 377014554985659ULL, 1433835303052512ULL, 702061469493692ULL, 1142253108318154ULL, + 318297794307551ULL, 954362646308543ULL, 517363881452320ULL, 1868013482130416ULL, + 262562472373260ULL, 902232853249919ULL, 2107343057055746ULL, 462368348619024ULL, + 1893758677092974ULL, 2177729767846389ULL, 2168532543559143ULL, 443867094639821ULL, + 730169342581022ULL, 1564589016879755ULL, 51218195700649ULL, 76684578423745ULL, + 560266272480743ULL, 922517457707697ULL, 2066645939860874ULL, 1318277348414638ULL, + 1576726809084003ULL, 1817337608563665ULL, 1874240939237666ULL, 754733726333910ULL, + 97085310406474ULL, 751148364309235ULL, 1622159695715187ULL, 1444098819684916ULL, + 130920805558089ULL, 1260449179085308ULL, 1860021740768461ULL, 110052860348509ULL, + 193830891643810ULL, 164148413933881ULL, 180017794795332ULL, 1523506525254651ULL, + 465981629225956ULL, 559733514964572ULL, 1279624874416974ULL, 2026642326892306ULL, + 1425156829982409ULL, 2160936383793147ULL, 1061870624975247ULL, 2023497043036941ULL, + 117942212883190ULL, 490339622800774ULL, 1729931303146295ULL, 422305932971074ULL, + 529103152793096ULL, 1211973233775992ULL, 721364955929681ULL, 1497674430438813ULL, + 342545521275073ULL, 2102107575279372ULL, 2108462244669966ULL, 1382582406064082ULL, + 2206396818383323ULL, 2109093268641147ULL, 10809845110983ULL, 1605176920880099ULL, + 744640650753946ULL, 1712758897518129ULL, 373410811281809ULL, 648838265800209ULL, + 813058095530999ULL, 513987632620169ULL, 465516160703329ULL, 2136322186126330ULL, + 1979645899422932ULL, 1197131006470786ULL, 1467836664863979ULL, 1340751381374628ULL, + 1810066212667962ULL, 1009933588225499ULL, 1106129188080873ULL, 1388980405213901ULL, + 533719246598044ULL, 1169435803073277ULL, 198920999285821ULL, 487492330629854ULL, + 1807093008537778ULL, 1540899012923865ULL, 2075080271659867ULL, 1527990806921523ULL, + 1323728742908002ULL, 1568595959608205ULL, 1388032187497212ULL, 2026968840050568ULL, + 1396591153295755ULL, 820416950170901ULL, 520060313205582ULL, 2016404325094901ULL, + 1584709677868520ULL, 272161374469956ULL, 1567188603996816ULL, 1986160530078221ULL, + 553930264324589ULL, 1058426729027503ULL, 8762762886675ULL, 2216098143382988ULL, + 1835145266889223ULL, 1712936431558441ULL, 1017009937844974ULL, 585361667812740ULL, + 2114711541628181ULL, 2238729632971439ULL, 121257546253072ULL, 847154149018345ULL, + 211972965476684ULL, 287499084460129ULL, 2098247259180197ULL, 839070411583329ULL, + 339551619574372ULL, 1432951287640743ULL, 526481249498942ULL, 931991661905195ULL, + 1884279965674487ULL, 200486405604411ULL, 364173020594788ULL, 518034455936955ULL, + 1085564703965501ULL, 16030410467927ULL, 604865933167613ULL, 1695298441093964ULL, + 498856548116159ULL, 2193030062787034ULL, 1706339802964179ULL, 1721199073493888ULL, + 820740951039755ULL, 1216053436896834ULL, 23954895815139ULL, 1662515208920491ULL, + 1705443427511899ULL, 1957928899570365ULL, 1189636258255725ULL, 1795695471103809ULL, + 1691191297654118ULL, 282402585374360ULL, 460405330264832ULL, 63765529445733ULL, + 469763447404473ULL, 733607089694996ULL, 685410420186959ULL, 1096682630419738ULL, + 1162548510542362ULL, 1020949526456676ULL, 1211660396870573ULL, 613126398222696ULL, + 1117829165843251ULL, 742432540886650ULL, 1483755088010658ULL, 942392007134474ULL, + 1447834130944107ULL, 489368274863410ULL, 23192985544898ULL, 648442406146160ULL, + 785438843373876ULL, 249464684645238ULL, 170494608205618ULL, 335112827260550ULL, + 1462050123162735ULL, 1084803668439016ULL, 853459233600325ULL, 215777728187495ULL, + 1965759433526974ULL, 1349482894446537ULL, 694163317612871ULL, 860536766165036ULL, + 1178788094084321ULL, 1652739626626996ULL, 2115723946388185ULL, 1577204379094664ULL, + 1083882859023240ULL, 1768759143381635ULL, 1737180992507258ULL, 246054513922239ULL, + 577253134087234ULL, 356340280578042ULL, 1638917769925142ULL, 223550348130103ULL, + 470592666638765ULL, 22663573966996ULL, 596552461152400ULL, 364143537069499ULL, 3942119457699ULL, + 107951982889287ULL, 1843471406713209ULL, 1625773041610986ULL, 1466141092501702ULL, + 1043024095021271ULL, 310429964047508ULL, 98559121500372ULL, 152746933782868ULL, + 259407205078261ULL, 828123093322585ULL, 1576847274280091ULL, 1170871375757302ULL, + 1588856194642775ULL, 984767822341977ULL, 1141497997993760ULL, 809325345150796ULL, + 1879837728202511ULL, 201340910657893ULL, 1079157558888483ULL, 1052373448588065ULL, + 1732036202501778ULL, 2105292670328445ULL, 679751387312402ULL, 1679682144926229ULL, + 1695823455818780ULL, 498852317075849ULL, 1786555067788433ULL, 1670727545779425ULL, + 117945875433544ULL, 407939139781844ULL, 854632120023778ULL, 1413383148360437ULL, + 286030901733673ULL, 1207361858071196ULL, 461340408181417ULL, 1096919590360164ULL, + 1837594897475685ULL, 533755561544165ULL, 1638688042247712ULL, 1431653684793005ULL, + 1036458538873559ULL, 390822120341779ULL, 1920929837111618ULL, 543426740024168ULL, + 645751357799929ULL, 2245025632994463ULL, 1550778638076452ULL, 223738153459949ULL, + 1337209385492033ULL, 1276967236456531ULL, 1463815821063071ULL, 2070620870191473ULL, + 1199170709413753ULL, 273230877394166ULL, 1873264887608046ULL, 890877152910775ULL, + 983226445635730ULL, 44873798519521ULL, 697147127512130ULL, 961631038239304ULL, + 709966160696826ULL, 1706677689540366ULL, 502782733796035ULL, 812545535346033ULL, + 1693622521296452ULL, 1955813093002510ULL, 1259937612881362ULL, 1873032503803559ULL, + 1140330566016428ULL, 1675726082440190ULL, 60029928909786ULL, 170335608866763ULL, + 766444312315022ULL, 2025049511434113ULL, 2200845622430647ULL, 1201269851450408ULL, + 590071752404907ULL, 1400995030286946ULL, 2152637413853822ULL, 2108495473841983ULL, + 3855406710349ULL, 1726137673168580ULL, 51004317200100ULL, 1749082328586939ULL, + 1704088976144558ULL, 1977318954775118ULL, 2062602253162400ULL, 948062503217479ULL, + 361953965048030ULL, 1528264887238440ULL, 62582552172290ULL, 2241602163389280ULL, + 156385388121765ULL, 2124100319761492ULL, 388928050571382ULL, 1556123596922727ULL, + 979310669812384ULL, 113043855206104ULL, 2023223924825469ULL, 643651703263034ULL, + 2234446903655540ULL, 1577241261424997ULL, 860253174523845ULL, 1691026473082448ULL, + 1091672764933872ULL, 1957463109756365ULL, 530699502660193ULL, 349587141723569ULL, + 674661681919563ULL, 1633727303856240ULL, 708909037922144ULL, 2160722508518119ULL, + 1302188051602540ULL, 976114603845777ULL, 120004758721939ULL, 1681630708873780ULL, + 622274095069244ULL, 1822346309016698ULL, 1100921177951904ULL, 2216952659181677ULL, + 1844020550362490ULL, 1976451368365774ULL, 1321101422068822ULL, 1189859436282668ULL, + 2008801879735257ULL, 2219413454333565ULL, 424288774231098ULL, 359793146977912ULL, + 270293357948703ULL, 587226003677000ULL, 1482071926139945ULL, 1419630774650359ULL, + 1104739070570175ULL, 1662129023224130ULL, 1609203612533411ULL, 1250932720691980ULL, + 95215711818495ULL, 498746909028150ULL, 158151296991874ULL, 1201379988527734ULL, + 561599945143989ULL, 2211577425617888ULL, 2166577612206324ULL, 1057590354233512ULL, + 1968123280416769ULL, 1316586165401313ULL, 762728164447634ULL, 2045395244316047ULL, + 1531796898725716ULL, 315385971670425ULL, 1109421039396756ULL, 2183635256408562ULL, + 1896751252659461ULL, 840236037179080ULL, 796245792277211ULL, 508345890111193ULL, + 1275386465287222ULL, 513560822858784ULL, 1784735733120313ULL, 1346467478899695ULL, + 601125231208417ULL, 701076661112726ULL, 1841998436455089ULL, 1156768600940434ULL, + 1967853462343221ULL, 2178318463061452ULL, 481885520752741ULL, 675262828640945ULL, + 1033539418596582ULL, 1743329872635846ULL, 159322641251283ULL, 1573076470127113ULL, + 954827619308195ULL, 778834750662635ULL, 619912782122617ULL, 515681498488209ULL, + 1675866144246843ULL, 811716020969981ULL, 1125515272217398ULL, 1398917918287342ULL, + 1301680949183175ULL, 726474739583734ULL, 587246193475200ULL, 1096581582611864ULL, + 1469911826213486ULL, 1990099711206364ULL, 1256496099816508ULL, 2019924615195672ULL, + 1251232456707555ULL, 2042971196009755ULL, 214061878479265ULL, 115385726395472ULL, + 1677875239524132ULL, 756888883383540ULL, 1153862117756233ULL, 503391530851096ULL, + 946070017477513ULL, 1878319040542579ULL, 1101349418586920ULL, 793245696431613ULL, + 397920495357645ULL, 2174023872951112ULL, 1517867915189593ULL, 1829855041462995ULL, + 1046709983503619ULL, 424081940711857ULL, 2112438073094647ULL, 1504338467349861ULL, + 2244574127374532ULL, 2136937537441911ULL, 1741150838990304ULL, 25894628400571ULL, + 512213526781178ULL, 1168384260796379ULL, 1424607682379833ULL, 938677789731564ULL, + 872882241891896ULL, 1713199397007700ULL, 1410496326218359ULL, 854379752407031ULL, + 465141611727634ULL, 315176937037857ULL, 1020115054571233ULL, 1856290111077229ULL, + 2028366269898204ULL, 1432980880307543ULL, 469932710425448ULL, 581165267592247ULL, + 496399148156603ULL, 2063435226705903ULL, 2116841086237705ULL, 498272567217048ULL, + 1829438076967906ULL, 1573925801278491ULL, 460763576329867ULL, 1705264723728225ULL, + 999514866082412ULL, 29635061779362ULL, 1884233592281020ULL, 1449755591461338ULL, + 42579292783222ULL, 1869504355369200ULL, 495506004805251ULL, 264073104888427ULL, + 2088880861028612ULL, 104646456386576ULL, 1258445191399967ULL, 1348736801545799ULL, + 2068276361286613ULL, 884897216646374ULL, 922387476801376ULL, 1043886580402805ULL, + 1240883498470831ULL, 1601554651937110ULL, 804382935289482ULL, 512379564477239ULL, + 1466384519077032ULL, 1280698500238386ULL, 211303836685749ULL, 2081725624793803ULL, + 545247644516879ULL, 215313359330384ULL, 286479751145614ULL, 2213650281751636ULL, + 2164927945999874ULL, 2072162991540882ULL, 1443769115444779ULL, 1581473274363095ULL, + 434633875922699ULL, 340456055781599ULL, 373043091080189ULL, 839476566531776ULL, + 1856706858509978ULL, 931616224909153ULL, 1888181317414065ULL, 213654322650262ULL, + 1161078103416244ULL, 1822042328851513ULL, 915817709028812ULL, 1828297056698188ULL, + 1212017130909403ULL, 60258343247333ULL, 342085800008230ULL, 930240559508270ULL, + 1549884999174952ULL, 809895264249462ULL, 184726257947682ULL, 1157065433504828ULL, + 1209999630381477ULL, 999920399374391ULL, 1714770150788163ULL, 2026130985413228ULL, + 506776632883140ULL, 1349042668246528ULL, 1937232292976967ULL, 942302637530730ULL, + 160211904766226ULL, 1042724500438571ULL, 212454865139142ULL, 244104425172642ULL, + 1376990622387496ULL, 76126752421227ULL, 1027540886376422ULL, 1912210655133026ULL, + 13410411589575ULL, 1475856708587773ULL, 615563352691682ULL, 1446629324872644ULL, + 1683670301784014ULL, 1049873327197127ULL, 1826401704084838ULL, 2032577048760775ULL, + 1922203607878853ULL, 836708788764806ULL, 2193084654695012ULL, 1342923183256659ULL, + 849356986294271ULL, 1228863973965618ULL, 94886161081867ULL, 1423288430204892ULL, + 2016167528707016ULL, 1633187660972877ULL, 1550621242301752ULL, 340630244512994ULL, + 2103577710806901ULL, 221625016538931ULL, 421544147350960ULL, 580428704555156ULL, + 1479831381265617ULL, 518057926544698ULL, 955027348790630ULL, 1326749172561598ULL, + 1118304625755967ULL, 1994005916095176ULL, 1799757332780663ULL, 751343129396941ULL, + 1468672898746144ULL, 1451689964451386ULL, 755070293921171ULL, 904857405877052ULL, + 1276087530766984ULL, 403986562858511ULL, 1530661255035337ULL, 1644972908910502ULL, + 1370170080438957ULL, 139839536695744ULL, 909930462436512ULL, 1899999215356933ULL, + 635992381064566ULL, 788740975837654ULL, 224241231493695ULL, 1267090030199302ULL, + 998908061660139ULL, 1784537499699278ULL, 859195370018706ULL, 1953966091439379ULL, + 2189271820076010ULL, 2039067059943978ULL, 1526694380855202ULL, 2040321513194941ULL, + 329922071218689ULL, 1953032256401326ULL, 989631424403521ULL, 328825014934242ULL, + 9407151397696ULL, 63551373671268ULL, 1624728632895792ULL, 1608324920739262ULL, + 1178239350351945ULL, 1198077399579702ULL, 277620088676229ULL, 1775359437312528ULL, + 1653558177737477ULL, 1652066043408850ULL, 1063359889686622ULL, 1975063804860653ULL }; #if defined(__cplusplus) diff --git a/include/msvc/internal/Hacl_Frodo_KEM.h b/include/msvc/internal/Hacl_Frodo_KEM.h index 61574981..6a1ece49 100644 --- a/include/msvc/internal/Hacl_Frodo_KEM.h +++ b/include/msvc/internal/Hacl_Frodo_KEM.h @@ -55,22 +55,22 @@ Hacl_Keccak_shake128_4x( uint8_t *output3 ) { - Hacl_SHA3_shake128_hacl(input_len, input0, output_len, output0); - Hacl_SHA3_shake128_hacl(input_len, input1, output_len, output1); - Hacl_SHA3_shake128_hacl(input_len, input2, output_len, output2); - Hacl_SHA3_shake128_hacl(input_len, input3, output_len, output3); + Hacl_Hash_SHA3_shake128_hacl(input_len, input0, output_len, output0); + Hacl_Hash_SHA3_shake128_hacl(input_len, input1, output_len, output1); + Hacl_Hash_SHA3_shake128_hacl(input_len, input2, output_len, output2); + Hacl_Hash_SHA3_shake128_hacl(input_len, input3, output_len, output3); } static inline void Hacl_Impl_Matrix_mod_pow2(uint32_t n1, uint32_t n2, uint32_t logq, uint16_t *a) { - if (logq < (uint32_t)16U) + if (logq < 16U) { - for (uint32_t i0 = (uint32_t)0U; i0 < n1; i0++) + for (uint32_t i0 = 0U; i0 < n1; i0++) { - for (uint32_t i = (uint32_t)0U; i < n2; i++) + for (uint32_t i = 0U; i < n2; i++) { - a[i0 * n2 + i] = a[i0 * n2 + i] & (((uint16_t)1U << logq) - (uint16_t)1U); + a[i0 * n2 + i] = (uint32_t)a[i0 * n2 + i] & ((1U << logq) - 1U); } } return; @@ -80,11 +80,11 @@ Hacl_Impl_Matrix_mod_pow2(uint32_t n1, uint32_t n2, uint32_t logq, uint16_t *a) static inline void Hacl_Impl_Matrix_matrix_add(uint32_t n1, uint32_t n2, uint16_t *a, uint16_t *b) { - for (uint32_t i0 = (uint32_t)0U; i0 < n1; i0++) + for (uint32_t i0 = 0U; i0 < n1; i0++) { - for (uint32_t i = (uint32_t)0U; i < n2; i++) + for (uint32_t i = 0U; i < n2; i++) { - a[i0 * n2 + i] = a[i0 * n2 + i] + b[i0 * n2 + i]; + a[i0 * n2 + i] = (uint32_t)a[i0 * n2 + i] + (uint32_t)b[i0 * n2 + i]; } } } @@ -92,11 +92,11 @@ Hacl_Impl_Matrix_matrix_add(uint32_t n1, uint32_t n2, uint16_t *a, uint16_t *b) static inline void Hacl_Impl_Matrix_matrix_sub(uint32_t n1, uint32_t n2, uint16_t *a, uint16_t *b) { - for (uint32_t i0 = (uint32_t)0U; i0 < n1; i0++) + for (uint32_t i0 = 0U; i0 < n1; i0++) { - for (uint32_t i = (uint32_t)0U; i < n2; i++) + for (uint32_t i = 0U; i < n2; i++) { - b[i0 * n2 + i] = a[i0 * n2 + i] - b[i0 * n2 + i]; + b[i0 * n2 + i] = (uint32_t)a[i0 * n2 + i] - (uint32_t)b[i0 * n2 + i]; } } } @@ -111,17 +111,17 @@ Hacl_Impl_Matrix_matrix_mul( uint16_t *c ) { - for (uint32_t i0 = (uint32_t)0U; i0 < n1; i0++) + for (uint32_t i0 = 0U; i0 < n1; i0++) { - for (uint32_t i1 = (uint32_t)0U; i1 < n3; i1++) + for (uint32_t i1 = 0U; i1 < n3; i1++) { - uint16_t res = (uint16_t)0U; - for (uint32_t i = (uint32_t)0U; i < n2; i++) + uint16_t res = 0U; + for (uint32_t i = 0U; i < n2; i++) { uint16_t aij = a[i0 * n2 + i]; uint16_t bjk = b[i * n3 + i1]; uint16_t res0 = res; - res = res0 + aij * bjk; + res = (uint32_t)res0 + (uint32_t)aij * (uint32_t)bjk; } c[i0 * n3 + i1] = res; } @@ -138,17 +138,17 @@ Hacl_Impl_Matrix_matrix_mul_s( uint16_t *c ) { - for (uint32_t i0 = (uint32_t)0U; i0 < n1; i0++) + for (uint32_t i0 = 0U; i0 < n1; i0++) { - for (uint32_t i1 = (uint32_t)0U; i1 < n3; i1++) + for (uint32_t i1 = 0U; i1 < n3; i1++) { - uint16_t res = (uint16_t)0U; - for (uint32_t i = (uint32_t)0U; i < n2; i++) + uint16_t res = 0U; + for (uint32_t i = 0U; i < n2; i++) { uint16_t aij = a[i0 * n2 + i]; uint16_t bjk = b[i1 * n2 + i]; uint16_t res0 = res; - res = res0 + aij * bjk; + res = (uint32_t)res0 + (uint32_t)aij * (uint32_t)bjk; } c[i0 * n3 + i1] = res; } @@ -158,11 +158,11 @@ Hacl_Impl_Matrix_matrix_mul_s( static inline uint16_t Hacl_Impl_Matrix_matrix_eq(uint32_t n1, uint32_t n2, uint16_t *a, uint16_t *b) { - uint16_t res = (uint16_t)0xFFFFU; - for (uint32_t i = (uint32_t)0U; i < n1 * n2; i++) + uint16_t res = 0xFFFFU; + for (uint32_t i = 0U; i < n1 * n2; i++) { uint16_t uu____0 = FStar_UInt16_eq_mask(a[i], b[i]); - res = uu____0 & res; + res = (uint32_t)uu____0 & (uint32_t)res; } uint16_t r = res; return r; @@ -171,19 +171,19 @@ Hacl_Impl_Matrix_matrix_eq(uint32_t n1, uint32_t n2, uint16_t *a, uint16_t *b) static inline void Hacl_Impl_Matrix_matrix_to_lbytes(uint32_t n1, uint32_t n2, uint16_t *m, uint8_t *res) { - for (uint32_t i = (uint32_t)0U; i < n1 * n2; i++) + for (uint32_t i = 0U; i < n1 * n2; i++) { - store16_le(res + (uint32_t)2U * i, m[i]); + store16_le(res + 2U * i, m[i]); } } static inline void Hacl_Impl_Matrix_matrix_from_lbytes(uint32_t n1, uint32_t n2, uint8_t *b, uint16_t *res) { - for (uint32_t i = (uint32_t)0U; i < n1 * n2; i++) + for (uint32_t i = 0U; i < n1 * n2; i++) { uint16_t *os = res; - uint16_t u = load16_le(b + (uint32_t)2U * i); + uint16_t u = load16_le(b + 2U * i); uint16_t x = u; os[i] = x; } @@ -192,53 +192,53 @@ Hacl_Impl_Matrix_matrix_from_lbytes(uint32_t n1, uint32_t n2, uint8_t *b, uint16 static inline void Hacl_Impl_Frodo_Gen_frodo_gen_matrix_shake_4x(uint32_t n, uint8_t *seed, uint16_t *res) { - KRML_CHECK_SIZE(sizeof (uint8_t), (uint32_t)8U * n); - uint8_t *r = (uint8_t *)alloca((uint32_t)8U * n * sizeof (uint8_t)); - memset(r, 0U, (uint32_t)8U * n * sizeof (uint8_t)); + KRML_CHECK_SIZE(sizeof (uint8_t), 8U * n); + uint8_t *r = (uint8_t *)alloca(8U * n * sizeof (uint8_t)); + memset(r, 0U, 8U * n * sizeof (uint8_t)); uint8_t tmp_seed[72U] = { 0U }; - memcpy(tmp_seed + (uint32_t)2U, seed, (uint32_t)16U * sizeof (uint8_t)); - memcpy(tmp_seed + (uint32_t)20U, seed, (uint32_t)16U * sizeof (uint8_t)); - memcpy(tmp_seed + (uint32_t)38U, seed, (uint32_t)16U * sizeof (uint8_t)); - memcpy(tmp_seed + (uint32_t)56U, seed, (uint32_t)16U * sizeof (uint8_t)); + memcpy(tmp_seed + 2U, seed, 16U * sizeof (uint8_t)); + memcpy(tmp_seed + 20U, seed, 16U * sizeof (uint8_t)); + memcpy(tmp_seed + 38U, seed, 16U * sizeof (uint8_t)); + memcpy(tmp_seed + 56U, seed, 16U * sizeof (uint8_t)); memset(res, 0U, n * n * sizeof (uint16_t)); - for (uint32_t i = (uint32_t)0U; i < n / (uint32_t)4U; i++) + for (uint32_t i = 0U; i < n / 4U; i++) { - uint8_t *r0 = r + (uint32_t)0U * n; - uint8_t *r1 = r + (uint32_t)2U * n; - uint8_t *r2 = r + (uint32_t)4U * n; - uint8_t *r3 = r + (uint32_t)6U * n; + uint8_t *r0 = r + 0U * n; + uint8_t *r1 = r + 2U * n; + uint8_t *r2 = r + 4U * n; + uint8_t *r3 = r + 6U * n; uint8_t *tmp_seed0 = tmp_seed; - uint8_t *tmp_seed1 = tmp_seed + (uint32_t)18U; - uint8_t *tmp_seed2 = tmp_seed + (uint32_t)36U; - uint8_t *tmp_seed3 = tmp_seed + (uint32_t)54U; - store16_le(tmp_seed0, (uint16_t)((uint32_t)4U * i + (uint32_t)0U)); - store16_le(tmp_seed1, (uint16_t)((uint32_t)4U * i + (uint32_t)1U)); - store16_le(tmp_seed2, (uint16_t)((uint32_t)4U * i + (uint32_t)2U)); - store16_le(tmp_seed3, (uint16_t)((uint32_t)4U * i + (uint32_t)3U)); - Hacl_Keccak_shake128_4x((uint32_t)18U, + uint8_t *tmp_seed1 = tmp_seed + 18U; + uint8_t *tmp_seed2 = tmp_seed + 36U; + uint8_t *tmp_seed3 = tmp_seed + 54U; + store16_le(tmp_seed0, (uint16_t)(4U * i + 0U)); + store16_le(tmp_seed1, (uint16_t)(4U * i + 1U)); + store16_le(tmp_seed2, (uint16_t)(4U * i + 2U)); + store16_le(tmp_seed3, (uint16_t)(4U * i + 3U)); + Hacl_Keccak_shake128_4x(18U, tmp_seed0, tmp_seed1, tmp_seed2, tmp_seed3, - (uint32_t)2U * n, + 2U * n, r0, r1, r2, r3); - for (uint32_t i0 = (uint32_t)0U; i0 < n; i0++) + for (uint32_t i0 = 0U; i0 < n; i0++) { - uint8_t *resij0 = r0 + i0 * (uint32_t)2U; - uint8_t *resij1 = r1 + i0 * (uint32_t)2U; - uint8_t *resij2 = r2 + i0 * (uint32_t)2U; - uint8_t *resij3 = r3 + i0 * (uint32_t)2U; + uint8_t *resij0 = r0 + i0 * 2U; + uint8_t *resij1 = r1 + i0 * 2U; + uint8_t *resij2 = r2 + i0 * 2U; + uint8_t *resij3 = r3 + i0 * 2U; uint16_t u = load16_le(resij0); - res[((uint32_t)4U * i + (uint32_t)0U) * n + i0] = u; + res[(4U * i + 0U) * n + i0] = u; uint16_t u0 = load16_le(resij1); - res[((uint32_t)4U * i + (uint32_t)1U) * n + i0] = u0; + res[(4U * i + 1U) * n + i0] = u0; uint16_t u1 = load16_le(resij2); - res[((uint32_t)4U * i + (uint32_t)2U) * n + i0] = u1; + res[(4U * i + 2U) * n + i0] = u1; uint16_t u2 = load16_le(resij3); - res[((uint32_t)4U * i + (uint32_t)3U) * n + i0] = u2; + res[(4U * i + 3U) * n + i0] = u2; } } } @@ -270,27 +270,19 @@ static const uint16_t Hacl_Impl_Frodo_Params_cdf_table640[13U] = { - (uint16_t)4643U, (uint16_t)13363U, (uint16_t)20579U, (uint16_t)25843U, (uint16_t)29227U, - (uint16_t)31145U, (uint16_t)32103U, (uint16_t)32525U, (uint16_t)32689U, (uint16_t)32745U, - (uint16_t)32762U, (uint16_t)32766U, (uint16_t)32767U + 4643U, 13363U, 20579U, 25843U, 29227U, 31145U, 32103U, 32525U, 32689U, 32745U, 32762U, 32766U, + 32767U }; static const uint16_t Hacl_Impl_Frodo_Params_cdf_table976[11U] = - { - (uint16_t)5638U, (uint16_t)15915U, (uint16_t)23689U, (uint16_t)28571U, (uint16_t)31116U, - (uint16_t)32217U, (uint16_t)32613U, (uint16_t)32731U, (uint16_t)32760U, (uint16_t)32766U, - (uint16_t)32767U - }; + { 5638U, 15915U, 23689U, 28571U, 31116U, 32217U, 32613U, 32731U, 32760U, 32766U, 32767U }; static const uint16_t Hacl_Impl_Frodo_Params_cdf_table1344[7U] = - { - (uint16_t)9142U, (uint16_t)23462U, (uint16_t)30338U, (uint16_t)32361U, (uint16_t)32725U, - (uint16_t)32765U, (uint16_t)32767U - }; + { 9142U, 23462U, 30338U, 32361U, 32725U, 32765U, 32767U }; static inline void Hacl_Impl_Frodo_Sample_frodo_sample_matrix64( @@ -301,26 +293,26 @@ Hacl_Impl_Frodo_Sample_frodo_sample_matrix64( ) { memset(res, 0U, n1 * n2 * sizeof (uint16_t)); - for (uint32_t i0 = (uint32_t)0U; i0 < n1; i0++) + for (uint32_t i0 = 0U; i0 < n1; i0++) { - for (uint32_t i1 = (uint32_t)0U; i1 < n2; i1++) + for (uint32_t i1 = 0U; i1 < n2; i1++) { - uint8_t *resij = r + (uint32_t)2U * (n2 * i0 + i1); + uint8_t *resij = r + 2U * (n2 * i0 + i1); uint16_t u = load16_le(resij); uint16_t uu____0 = u; - uint16_t prnd = uu____0 >> (uint32_t)1U; - uint16_t sign = uu____0 & (uint16_t)1U; - uint16_t sample = (uint16_t)0U; - uint32_t bound = (uint32_t)12U; - for (uint32_t i = (uint32_t)0U; i < bound; i++) + uint16_t prnd = (uint32_t)uu____0 >> 1U; + uint16_t sign = (uint32_t)uu____0 & 1U; + uint16_t sample = 0U; + uint32_t bound = 12U; + for (uint32_t i = 0U; i < bound; i++) { uint16_t sample0 = sample; uint16_t ti = Hacl_Impl_Frodo_Params_cdf_table640[i]; - uint16_t samplei = (uint16_t)(uint32_t)(ti - prnd) >> (uint32_t)15U; - sample = samplei + sample0; + uint16_t samplei = (uint32_t)(uint16_t)(uint32_t)((uint32_t)ti - (uint32_t)prnd) >> 15U; + sample = (uint32_t)samplei + (uint32_t)sample0; } uint16_t sample0 = sample; - res[i0 * n2 + i1] = ((~sign + (uint16_t)1U) ^ sample0) + sign; + res[i0 * n2 + i1] = (((uint32_t)~sign + 1U) ^ (uint32_t)sample0) + (uint32_t)sign; } } } @@ -334,26 +326,26 @@ Hacl_Impl_Frodo_Sample_frodo_sample_matrix640( ) { memset(res, 0U, n1 * n2 * sizeof (uint16_t)); - for (uint32_t i0 = (uint32_t)0U; i0 < n1; i0++) + for (uint32_t i0 = 0U; i0 < n1; i0++) { - for (uint32_t i1 = (uint32_t)0U; i1 < n2; i1++) + for (uint32_t i1 = 0U; i1 < n2; i1++) { - uint8_t *resij = r + (uint32_t)2U * (n2 * i0 + i1); + uint8_t *resij = r + 2U * (n2 * i0 + i1); uint16_t u = load16_le(resij); uint16_t uu____0 = u; - uint16_t prnd = uu____0 >> (uint32_t)1U; - uint16_t sign = uu____0 & (uint16_t)1U; - uint16_t sample = (uint16_t)0U; - uint32_t bound = (uint32_t)12U; - for (uint32_t i = (uint32_t)0U; i < bound; i++) + uint16_t prnd = (uint32_t)uu____0 >> 1U; + uint16_t sign = (uint32_t)uu____0 & 1U; + uint16_t sample = 0U; + uint32_t bound = 12U; + for (uint32_t i = 0U; i < bound; i++) { uint16_t sample0 = sample; uint16_t ti = Hacl_Impl_Frodo_Params_cdf_table640[i]; - uint16_t samplei = (uint16_t)(uint32_t)(ti - prnd) >> (uint32_t)15U; - sample = samplei + sample0; + uint16_t samplei = (uint32_t)(uint16_t)(uint32_t)((uint32_t)ti - (uint32_t)prnd) >> 15U; + sample = (uint32_t)samplei + (uint32_t)sample0; } uint16_t sample0 = sample; - res[i0 * n2 + i1] = ((~sign + (uint16_t)1U) ^ sample0) + sign; + res[i0 * n2 + i1] = (((uint32_t)~sign + 1U) ^ (uint32_t)sample0) + (uint32_t)sign; } } } @@ -367,26 +359,26 @@ Hacl_Impl_Frodo_Sample_frodo_sample_matrix976( ) { memset(res, 0U, n1 * n2 * sizeof (uint16_t)); - for (uint32_t i0 = (uint32_t)0U; i0 < n1; i0++) + for (uint32_t i0 = 0U; i0 < n1; i0++) { - for (uint32_t i1 = (uint32_t)0U; i1 < n2; i1++) + for (uint32_t i1 = 0U; i1 < n2; i1++) { - uint8_t *resij = r + (uint32_t)2U * (n2 * i0 + i1); + uint8_t *resij = r + 2U * (n2 * i0 + i1); uint16_t u = load16_le(resij); uint16_t uu____0 = u; - uint16_t prnd = uu____0 >> (uint32_t)1U; - uint16_t sign = uu____0 & (uint16_t)1U; - uint16_t sample = (uint16_t)0U; - uint32_t bound = (uint32_t)10U; - for (uint32_t i = (uint32_t)0U; i < bound; i++) + uint16_t prnd = (uint32_t)uu____0 >> 1U; + uint16_t sign = (uint32_t)uu____0 & 1U; + uint16_t sample = 0U; + uint32_t bound = 10U; + for (uint32_t i = 0U; i < bound; i++) { uint16_t sample0 = sample; uint16_t ti = Hacl_Impl_Frodo_Params_cdf_table976[i]; - uint16_t samplei = (uint16_t)(uint32_t)(ti - prnd) >> (uint32_t)15U; - sample = samplei + sample0; + uint16_t samplei = (uint32_t)(uint16_t)(uint32_t)((uint32_t)ti - (uint32_t)prnd) >> 15U; + sample = (uint32_t)samplei + (uint32_t)sample0; } uint16_t sample0 = sample; - res[i0 * n2 + i1] = ((~sign + (uint16_t)1U) ^ sample0) + sign; + res[i0 * n2 + i1] = (((uint32_t)~sign + 1U) ^ (uint32_t)sample0) + (uint32_t)sign; } } } @@ -400,26 +392,26 @@ Hacl_Impl_Frodo_Sample_frodo_sample_matrix1344( ) { memset(res, 0U, n1 * n2 * sizeof (uint16_t)); - for (uint32_t i0 = (uint32_t)0U; i0 < n1; i0++) + for (uint32_t i0 = 0U; i0 < n1; i0++) { - for (uint32_t i1 = (uint32_t)0U; i1 < n2; i1++) + for (uint32_t i1 = 0U; i1 < n2; i1++) { - uint8_t *resij = r + (uint32_t)2U * (n2 * i0 + i1); + uint8_t *resij = r + 2U * (n2 * i0 + i1); uint16_t u = load16_le(resij); uint16_t uu____0 = u; - uint16_t prnd = uu____0 >> (uint32_t)1U; - uint16_t sign = uu____0 & (uint16_t)1U; - uint16_t sample = (uint16_t)0U; - uint32_t bound = (uint32_t)6U; - for (uint32_t i = (uint32_t)0U; i < bound; i++) + uint16_t prnd = (uint32_t)uu____0 >> 1U; + uint16_t sign = (uint32_t)uu____0 & 1U; + uint16_t sample = 0U; + uint32_t bound = 6U; + for (uint32_t i = 0U; i < bound; i++) { uint16_t sample0 = sample; uint16_t ti = Hacl_Impl_Frodo_Params_cdf_table1344[i]; - uint16_t samplei = (uint16_t)(uint32_t)(ti - prnd) >> (uint32_t)15U; - sample = samplei + sample0; + uint16_t samplei = (uint32_t)(uint16_t)(uint32_t)((uint32_t)ti - (uint32_t)prnd) >> 15U; + sample = (uint32_t)samplei + (uint32_t)sample0; } uint16_t sample0 = sample; - res[i0 * n2 + i1] = ((~sign + (uint16_t)1U) ^ sample0) + sign; + res[i0 * n2 + i1] = (((uint32_t)~sign + 1U) ^ (uint32_t)sample0) + (uint32_t)sign; } } } @@ -435,39 +427,34 @@ Hacl_Impl_Frodo_Pack_frodo_pack( uint8_t *res ) { - uint32_t n = n1 * n2 / (uint32_t)8U; - for (uint32_t i = (uint32_t)0U; i < n; i++) + uint32_t n = n1 * n2 / 8U; + for (uint32_t i = 0U; i < n; i++) { - uint16_t *a1 = a + (uint32_t)8U * i; + uint16_t *a1 = a + 8U * i; uint8_t *r = res + d * i; - uint16_t maskd = (uint16_t)((uint32_t)1U << d) - (uint16_t)1U; + uint16_t maskd = (uint32_t)(uint16_t)(1U << d) - 1U; uint8_t v16[16U] = { 0U }; - uint16_t a0 = a1[0U] & maskd; - uint16_t a11 = a1[1U] & maskd; - uint16_t a2 = a1[2U] & maskd; - uint16_t a3 = a1[3U] & maskd; - uint16_t a4 = a1[4U] & maskd; - uint16_t a5 = a1[5U] & maskd; - uint16_t a6 = a1[6U] & maskd; - uint16_t a7 = a1[7U] & maskd; + uint16_t a0 = (uint32_t)a1[0U] & (uint32_t)maskd; + uint16_t a11 = (uint32_t)a1[1U] & (uint32_t)maskd; + uint16_t a2 = (uint32_t)a1[2U] & (uint32_t)maskd; + uint16_t a3 = (uint32_t)a1[3U] & (uint32_t)maskd; + uint16_t a4 = (uint32_t)a1[4U] & (uint32_t)maskd; + uint16_t a5 = (uint32_t)a1[5U] & (uint32_t)maskd; + uint16_t a6 = (uint32_t)a1[6U] & (uint32_t)maskd; + uint16_t a7 = (uint32_t)a1[7U] & (uint32_t)maskd; FStar_UInt128_uint128 templong = FStar_UInt128_logor(FStar_UInt128_logor(FStar_UInt128_logor(FStar_UInt128_logor(FStar_UInt128_logor(FStar_UInt128_logor(FStar_UInt128_logor(FStar_UInt128_shift_left(FStar_UInt128_uint64_to_uint128((uint64_t)a0), - (uint32_t)7U * d), - FStar_UInt128_shift_left(FStar_UInt128_uint64_to_uint128((uint64_t)a11), - (uint32_t)6U * d)), - FStar_UInt128_shift_left(FStar_UInt128_uint64_to_uint128((uint64_t)a2), - (uint32_t)5U * d)), - FStar_UInt128_shift_left(FStar_UInt128_uint64_to_uint128((uint64_t)a3), - (uint32_t)4U * d)), - FStar_UInt128_shift_left(FStar_UInt128_uint64_to_uint128((uint64_t)a4), - (uint32_t)3U * d)), - FStar_UInt128_shift_left(FStar_UInt128_uint64_to_uint128((uint64_t)a5), - (uint32_t)2U * d)), - FStar_UInt128_shift_left(FStar_UInt128_uint64_to_uint128((uint64_t)a6), (uint32_t)1U * d)), - FStar_UInt128_shift_left(FStar_UInt128_uint64_to_uint128((uint64_t)a7), (uint32_t)0U * d)); + 7U * d), + FStar_UInt128_shift_left(FStar_UInt128_uint64_to_uint128((uint64_t)a11), 6U * d)), + FStar_UInt128_shift_left(FStar_UInt128_uint64_to_uint128((uint64_t)a2), 5U * d)), + FStar_UInt128_shift_left(FStar_UInt128_uint64_to_uint128((uint64_t)a3), 4U * d)), + FStar_UInt128_shift_left(FStar_UInt128_uint64_to_uint128((uint64_t)a4), 3U * d)), + FStar_UInt128_shift_left(FStar_UInt128_uint64_to_uint128((uint64_t)a5), 2U * d)), + FStar_UInt128_shift_left(FStar_UInt128_uint64_to_uint128((uint64_t)a6), 1U * d)), + FStar_UInt128_shift_left(FStar_UInt128_uint64_to_uint128((uint64_t)a7), 0U * d)); store128_be(v16, templong); - uint8_t *src = v16 + (uint32_t)16U - d; + uint8_t *src = v16 + 16U - d; memcpy(r, src, d * sizeof (uint8_t)); } } @@ -481,48 +468,48 @@ Hacl_Impl_Frodo_Pack_frodo_unpack( uint16_t *res ) { - uint32_t n = n1 * n2 / (uint32_t)8U; - for (uint32_t i = (uint32_t)0U; i < n; i++) + uint32_t n = n1 * n2 / 8U; + for (uint32_t i = 0U; i < n; i++) { uint8_t *b1 = b + d * i; - uint16_t *r = res + (uint32_t)8U * i; - uint16_t maskd = (uint16_t)((uint32_t)1U << d) - (uint16_t)1U; + uint16_t *r = res + 8U * i; + uint16_t maskd = (uint32_t)(uint16_t)(1U << d) - 1U; uint8_t src[16U] = { 0U }; - memcpy(src + (uint32_t)16U - d, b1, d * sizeof (uint8_t)); + memcpy(src + 16U - d, b1, d * sizeof (uint8_t)); FStar_UInt128_uint128 u = load128_be(src); FStar_UInt128_uint128 templong = u; r[0U] = - (uint16_t)FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(templong, - (uint32_t)7U * d)) - & maskd; + (uint32_t)(uint16_t)FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(templong, + 7U * d)) + & (uint32_t)maskd; r[1U] = - (uint16_t)FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(templong, - (uint32_t)6U * d)) - & maskd; + (uint32_t)(uint16_t)FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(templong, + 6U * d)) + & (uint32_t)maskd; r[2U] = - (uint16_t)FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(templong, - (uint32_t)5U * d)) - & maskd; + (uint32_t)(uint16_t)FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(templong, + 5U * d)) + & (uint32_t)maskd; r[3U] = - (uint16_t)FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(templong, - (uint32_t)4U * d)) - & maskd; + (uint32_t)(uint16_t)FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(templong, + 4U * d)) + & (uint32_t)maskd; r[4U] = - (uint16_t)FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(templong, - (uint32_t)3U * d)) - & maskd; + (uint32_t)(uint16_t)FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(templong, + 3U * d)) + & (uint32_t)maskd; r[5U] = - (uint16_t)FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(templong, - (uint32_t)2U * d)) - & maskd; + (uint32_t)(uint16_t)FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(templong, + 2U * d)) + & (uint32_t)maskd; r[6U] = - (uint16_t)FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(templong, - (uint32_t)1U * d)) - & maskd; + (uint32_t)(uint16_t)FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(templong, + 1U * d)) + & (uint32_t)maskd; r[7U] = - (uint16_t)FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(templong, - (uint32_t)0U * d)) - & maskd; + (uint32_t)(uint16_t)FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(templong, + 0U * d)) + & (uint32_t)maskd; } } @@ -535,7 +522,7 @@ Hacl_Impl_Frodo_Encode_frodo_key_encode( uint16_t *res ) { - for (uint32_t i0 = (uint32_t)0U; i0 < n; i0++) + for (uint32_t i0 = 0U; i0 < n; i0++) { uint8_t v8[8U] = { 0U }; uint8_t *chunk = a + i0 * b; @@ -544,11 +531,11 @@ Hacl_Impl_Frodo_Encode_frodo_key_encode( uint64_t x = u; uint64_t x0 = x; KRML_MAYBE_FOR8(i, - (uint32_t)0U, - (uint32_t)8U, - (uint32_t)1U, - uint64_t rk = x0 >> b * i & (((uint64_t)1U << b) - (uint64_t)1U); - res[i0 * n + i] = (uint16_t)rk << (logq - b);); + 0U, + 8U, + 1U, + uint64_t rk = x0 >> b * i & ((1ULL << b) - 1ULL); + res[i0 * n + i] = (uint32_t)(uint16_t)rk << (logq - b);); } } @@ -561,16 +548,16 @@ Hacl_Impl_Frodo_Encode_frodo_key_decode( uint8_t *res ) { - for (uint32_t i0 = (uint32_t)0U; i0 < n; i0++) + for (uint32_t i0 = 0U; i0 < n; i0++) { - uint64_t templong = (uint64_t)0U; + uint64_t templong = 0ULL; KRML_MAYBE_FOR8(i, - (uint32_t)0U, - (uint32_t)8U, - (uint32_t)1U, + 0U, + 8U, + 1U, uint16_t aik = a[i0 * n + i]; - uint16_t res1 = (aik + ((uint16_t)1U << (logq - b - (uint32_t)1U))) >> (logq - b); - templong = templong | (uint64_t)(res1 & (((uint16_t)1U << b) - (uint16_t)1U)) << b * i;); + uint16_t res1 = (((uint32_t)aik + (1U << (logq - b - 1U))) & 0xFFFFU) >> (logq - b); + templong = templong | (uint64_t)((uint32_t)res1 & ((1U << b) - 1U)) << b * i;); uint64_t templong0 = templong; uint8_t v8[8U] = { 0U }; store64_le(v8, templong0); diff --git a/include/internal/Hacl_Hash_Blake2.h b/include/msvc/internal/Hacl_HMAC.h similarity index 82% rename from include/internal/Hacl_Hash_Blake2.h rename to include/msvc/internal/Hacl_HMAC.h index 8f308bd9..ad344c4c 100644 --- a/include/internal/Hacl_Hash_Blake2.h +++ b/include/msvc/internal/Hacl_HMAC.h @@ -23,8 +23,8 @@ */ -#ifndef __internal_Hacl_Hash_Blake2_H -#define __internal_Hacl_Hash_Blake2_H +#ifndef __internal_Hacl_HMAC_H +#define __internal_Hacl_HMAC_H #if defined(__cplusplus) extern "C" { @@ -35,8 +35,12 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -#include "internal/Hacl_Impl_Blake2_Constants.h" -#include "../Hacl_Hash_Blake2.h" +#include "internal/Hacl_Krmllib.h" +#include "internal/Hacl_Hash_SHA2.h" +#include "internal/Hacl_Hash_SHA1.h" +#include "internal/Hacl_Hash_Blake2s.h" +#include "internal/Hacl_Hash_Blake2b.h" +#include "../Hacl_HMAC.h" typedef struct K___uint32_t_uint32_t_s { @@ -49,5 +53,5 @@ K___uint32_t_uint32_t; } #endif -#define __internal_Hacl_Hash_Blake2_H_DEFINED +#define __internal_Hacl_HMAC_H_DEFINED #endif diff --git a/include/msvc/internal/Hacl_Hash_Blake2b.h b/include/msvc/internal/Hacl_Hash_Blake2b.h new file mode 100644 index 00000000..21689d60 --- /dev/null +++ b/include/msvc/internal/Hacl_Hash_Blake2b.h @@ -0,0 +1,70 @@ +/* MIT License + * + * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation + * Copyright (c) 2022-2023 HACL* Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + + +#ifndef __internal_Hacl_Hash_Blake2b_H +#define __internal_Hacl_Hash_Blake2b_H + +#if defined(__cplusplus) +extern "C" { +#endif + +#include +#include "krml/internal/types.h" +#include "krml/lowstar_endianness.h" +#include "krml/internal/target.h" + +#include "internal/Hacl_Impl_Blake2_Constants.h" +#include "../Hacl_Hash_Blake2b.h" + +void Hacl_Hash_Blake2b_init(uint64_t *hash, uint32_t kk, uint32_t nn); + +void +Hacl_Hash_Blake2b_update_multi( + uint32_t len, + uint64_t *wv, + uint64_t *hash, + FStar_UInt128_uint128 prev, + uint8_t *blocks, + uint32_t nb +); + +void +Hacl_Hash_Blake2b_update_last( + uint32_t len, + uint64_t *wv, + uint64_t *hash, + FStar_UInt128_uint128 prev, + uint32_t rem, + uint8_t *d +); + +void Hacl_Hash_Blake2b_finish(uint32_t nn, uint8_t *output, uint64_t *hash); + +#if defined(__cplusplus) +} +#endif + +#define __internal_Hacl_Hash_Blake2b_H_DEFINED +#endif diff --git a/include/msvc/Hacl_Hash_Blake2b_256.h b/include/msvc/internal/Hacl_Hash_Blake2b_Simd256.h similarity index 61% rename from include/msvc/Hacl_Hash_Blake2b_256.h rename to include/msvc/internal/Hacl_Hash_Blake2b_Simd256.h index 2379fd75..4cc07869 100644 --- a/include/msvc/Hacl_Hash_Blake2b_256.h +++ b/include/msvc/internal/Hacl_Hash_Blake2b_Simd256.h @@ -23,8 +23,8 @@ */ -#ifndef __Hacl_Hash_Blake2b_256_H -#define __Hacl_Hash_Blake2b_256_H +#ifndef __internal_Hacl_Hash_Blake2b_Simd256_H +#define __internal_Hacl_Hash_Blake2b_Simd256_H #if defined(__cplusplus) extern "C" { @@ -35,23 +35,15 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -#include "Hacl_Krmllib.h" +#include "internal/Hacl_Impl_Blake2_Constants.h" +#include "../Hacl_Hash_Blake2b_Simd256.h" #include "libintvector.h" void -Hacl_Blake2b_256_blake2b_init(Lib_IntVector_Intrinsics_vec256 *hash, uint32_t kk, uint32_t nn); +Hacl_Hash_Blake2b_Simd256_init(Lib_IntVector_Intrinsics_vec256 *hash, uint32_t kk, uint32_t nn); void -Hacl_Blake2b_256_blake2b_update_key( - Lib_IntVector_Intrinsics_vec256 *wv, - Lib_IntVector_Intrinsics_vec256 *hash, - uint32_t kk, - uint8_t *k, - uint32_t ll -); - -void -Hacl_Blake2b_256_blake2b_update_multi( +Hacl_Hash_Blake2b_Simd256_update_multi( uint32_t len, Lib_IntVector_Intrinsics_vec256 *wv, Lib_IntVector_Intrinsics_vec256 *hash, @@ -61,7 +53,7 @@ Hacl_Blake2b_256_blake2b_update_multi( ); void -Hacl_Blake2b_256_blake2b_update_last( +Hacl_Hash_Blake2b_Simd256_update_last( uint32_t len, Lib_IntVector_Intrinsics_vec256 *wv, Lib_IntVector_Intrinsics_vec256 *hash, @@ -71,49 +63,29 @@ Hacl_Blake2b_256_blake2b_update_last( ); void -Hacl_Blake2b_256_blake2b_finish( +Hacl_Hash_Blake2b_Simd256_finish( uint32_t nn, uint8_t *output, Lib_IntVector_Intrinsics_vec256 *hash ); -/** -Write the BLAKE2b digest of message `d` using key `k` into `output`. - -@param nn Length of the to-be-generated digest with 1 <= `nn` <= 64. -@param output Pointer to `nn` bytes of memory where the digest is written to. -@param ll Length of the input message. -@param d Pointer to `ll` bytes of memory where the input message is read from. -@param kk Length of the key. Can be 0. -@param k Pointer to `kk` bytes of memory where the key is read from. -*/ -void -Hacl_Blake2b_256_blake2b( - uint32_t nn, - uint8_t *output, - uint32_t ll, - uint8_t *d, - uint32_t kk, - uint8_t *k -); - void -Hacl_Blake2b_256_load_state256b_from_state32( +Hacl_Hash_Blake2b_Simd256_load_state256b_from_state32( Lib_IntVector_Intrinsics_vec256 *st, uint64_t *st32 ); void -Hacl_Blake2b_256_store_state256b_to_state32( +Hacl_Hash_Blake2b_Simd256_store_state256b_to_state32( uint64_t *st32, Lib_IntVector_Intrinsics_vec256 *st ); -Lib_IntVector_Intrinsics_vec256 *Hacl_Blake2b_256_blake2b_malloc(void); +Lib_IntVector_Intrinsics_vec256 *Hacl_Hash_Blake2b_Simd256_malloc_with_key(void); #if defined(__cplusplus) } #endif -#define __Hacl_Hash_Blake2b_256_H_DEFINED +#define __internal_Hacl_Hash_Blake2b_Simd256_H_DEFINED #endif diff --git a/include/msvc/internal/Hacl_Hash_Blake2s.h b/include/msvc/internal/Hacl_Hash_Blake2s.h new file mode 100644 index 00000000..f814aa95 --- /dev/null +++ b/include/msvc/internal/Hacl_Hash_Blake2s.h @@ -0,0 +1,70 @@ +/* MIT License + * + * Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation + * Copyright (c) 2022-2023 HACL* Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + + +#ifndef __internal_Hacl_Hash_Blake2s_H +#define __internal_Hacl_Hash_Blake2s_H + +#if defined(__cplusplus) +extern "C" { +#endif + +#include +#include "krml/internal/types.h" +#include "krml/lowstar_endianness.h" +#include "krml/internal/target.h" + +#include "internal/Hacl_Impl_Blake2_Constants.h" +#include "../Hacl_Hash_Blake2s.h" + +void Hacl_Hash_Blake2s_init(uint32_t *hash, uint32_t kk, uint32_t nn); + +void +Hacl_Hash_Blake2s_update_multi( + uint32_t len, + uint32_t *wv, + uint32_t *hash, + uint64_t prev, + uint8_t *blocks, + uint32_t nb +); + +void +Hacl_Hash_Blake2s_update_last( + uint32_t len, + uint32_t *wv, + uint32_t *hash, + uint64_t prev, + uint32_t rem, + uint8_t *d +); + +void Hacl_Hash_Blake2s_finish(uint32_t nn, uint8_t *output, uint32_t *hash); + +#if defined(__cplusplus) +} +#endif + +#define __internal_Hacl_Hash_Blake2s_H_DEFINED +#endif diff --git a/include/Hacl_Hash_Blake2s_128.h b/include/msvc/internal/Hacl_Hash_Blake2s_Simd128.h similarity index 61% rename from include/Hacl_Hash_Blake2s_128.h rename to include/msvc/internal/Hacl_Hash_Blake2s_Simd128.h index 2af827cd..0589aec5 100644 --- a/include/Hacl_Hash_Blake2s_128.h +++ b/include/msvc/internal/Hacl_Hash_Blake2s_Simd128.h @@ -23,8 +23,8 @@ */ -#ifndef __Hacl_Hash_Blake2s_128_H -#define __Hacl_Hash_Blake2s_128_H +#ifndef __internal_Hacl_Hash_Blake2s_Simd128_H +#define __internal_Hacl_Hash_Blake2s_Simd128_H #if defined(__cplusplus) extern "C" { @@ -35,22 +35,15 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" +#include "internal/Hacl_Impl_Blake2_Constants.h" +#include "../Hacl_Hash_Blake2s_Simd128.h" #include "libintvector.h" void -Hacl_Blake2s_128_blake2s_init(Lib_IntVector_Intrinsics_vec128 *hash, uint32_t kk, uint32_t nn); +Hacl_Hash_Blake2s_Simd128_init(Lib_IntVector_Intrinsics_vec128 *hash, uint32_t kk, uint32_t nn); void -Hacl_Blake2s_128_blake2s_update_key( - Lib_IntVector_Intrinsics_vec128 *wv, - Lib_IntVector_Intrinsics_vec128 *hash, - uint32_t kk, - uint8_t *k, - uint32_t ll -); - -void -Hacl_Blake2s_128_blake2s_update_multi( +Hacl_Hash_Blake2s_Simd128_update_multi( uint32_t len, Lib_IntVector_Intrinsics_vec128 *wv, Lib_IntVector_Intrinsics_vec128 *hash, @@ -60,7 +53,7 @@ Hacl_Blake2s_128_blake2s_update_multi( ); void -Hacl_Blake2s_128_blake2s_update_last( +Hacl_Hash_Blake2s_Simd128_update_last( uint32_t len, Lib_IntVector_Intrinsics_vec128 *wv, Lib_IntVector_Intrinsics_vec128 *hash, @@ -70,49 +63,29 @@ Hacl_Blake2s_128_blake2s_update_last( ); void -Hacl_Blake2s_128_blake2s_finish( +Hacl_Hash_Blake2s_Simd128_finish( uint32_t nn, uint8_t *output, Lib_IntVector_Intrinsics_vec128 *hash ); -/** -Write the BLAKE2s digest of message `d` using key `k` into `output`. - -@param nn Length of to-be-generated digest with 1 <= `nn` <= 32. -@param output Pointer to `nn` bytes of memory where the digest is written to. -@param ll Length of the input message. -@param d Pointer to `ll` bytes of memory where the input message is read from. -@param kk Length of the key. Can be 0. -@param k Pointer to `kk` bytes of memory where the key is read from. -*/ -void -Hacl_Blake2s_128_blake2s( - uint32_t nn, - uint8_t *output, - uint32_t ll, - uint8_t *d, - uint32_t kk, - uint8_t *k -); - void -Hacl_Blake2s_128_store_state128s_to_state32( +Hacl_Hash_Blake2s_Simd128_store_state128s_to_state32( uint32_t *st32, Lib_IntVector_Intrinsics_vec128 *st ); void -Hacl_Blake2s_128_load_state128s_from_state32( +Hacl_Hash_Blake2s_Simd128_load_state128s_from_state32( Lib_IntVector_Intrinsics_vec128 *st, uint32_t *st32 ); -Lib_IntVector_Intrinsics_vec128 *Hacl_Blake2s_128_blake2s_malloc(void); +Lib_IntVector_Intrinsics_vec128 *Hacl_Hash_Blake2s_Simd128_malloc_with_key(void); #if defined(__cplusplus) } #endif -#define __Hacl_Hash_Blake2s_128_H_DEFINED +#define __internal_Hacl_Hash_Blake2s_Simd128_H_DEFINED #endif diff --git a/include/msvc/internal/Hacl_Hash_MD5.h b/include/msvc/internal/Hacl_Hash_MD5.h index 7fd567f3..dd77aaf1 100644 --- a/include/msvc/internal/Hacl_Hash_MD5.h +++ b/include/msvc/internal/Hacl_Hash_MD5.h @@ -37,21 +37,16 @@ extern "C" { #include "../Hacl_Hash_MD5.h" -void Hacl_Hash_Core_MD5_legacy_init(uint32_t *s); +void Hacl_Hash_MD5_init(uint32_t *s); -void Hacl_Hash_Core_MD5_legacy_finish(uint32_t *s, uint8_t *dst); +void Hacl_Hash_MD5_finish(uint32_t *s, uint8_t *dst); -void Hacl_Hash_MD5_legacy_update_multi(uint32_t *s, uint8_t *blocks, uint32_t n_blocks); +void Hacl_Hash_MD5_update_multi(uint32_t *s, uint8_t *blocks, uint32_t n_blocks); void -Hacl_Hash_MD5_legacy_update_last( - uint32_t *s, - uint64_t prev_len, - uint8_t *input, - uint32_t input_len -); - -void Hacl_Hash_MD5_legacy_hash(uint8_t *input, uint32_t input_len, uint8_t *dst); +Hacl_Hash_MD5_update_last(uint32_t *s, uint64_t prev_len, uint8_t *input, uint32_t input_len); + +void Hacl_Hash_MD5_hash_oneshot(uint8_t *output, uint8_t *input, uint32_t input_len); #if defined(__cplusplus) } diff --git a/include/msvc/internal/Hacl_Hash_SHA1.h b/include/msvc/internal/Hacl_Hash_SHA1.h index 72cf492c..ed53be55 100644 --- a/include/msvc/internal/Hacl_Hash_SHA1.h +++ b/include/msvc/internal/Hacl_Hash_SHA1.h @@ -37,21 +37,16 @@ extern "C" { #include "../Hacl_Hash_SHA1.h" -void Hacl_Hash_Core_SHA1_legacy_init(uint32_t *s); +void Hacl_Hash_SHA1_init(uint32_t *s); -void Hacl_Hash_Core_SHA1_legacy_finish(uint32_t *s, uint8_t *dst); +void Hacl_Hash_SHA1_finish(uint32_t *s, uint8_t *dst); -void Hacl_Hash_SHA1_legacy_update_multi(uint32_t *s, uint8_t *blocks, uint32_t n_blocks); +void Hacl_Hash_SHA1_update_multi(uint32_t *s, uint8_t *blocks, uint32_t n_blocks); void -Hacl_Hash_SHA1_legacy_update_last( - uint32_t *s, - uint64_t prev_len, - uint8_t *input, - uint32_t input_len -); - -void Hacl_Hash_SHA1_legacy_hash(uint8_t *input, uint32_t input_len, uint8_t *dst); +Hacl_Hash_SHA1_update_last(uint32_t *s, uint64_t prev_len, uint8_t *input, uint32_t input_len); + +void Hacl_Hash_SHA1_hash_oneshot(uint8_t *output, uint8_t *input, uint32_t input_len); #if defined(__cplusplus) } diff --git a/include/msvc/internal/Hacl_Hash_SHA2.h b/include/msvc/internal/Hacl_Hash_SHA2.h index bbffdc50..7dade3f3 100644 --- a/include/msvc/internal/Hacl_Hash_SHA2.h +++ b/include/msvc/internal/Hacl_Hash_SHA2.h @@ -40,141 +40,121 @@ extern "C" { static const uint32_t -Hacl_Impl_SHA2_Generic_h224[8U] = +Hacl_Hash_SHA2_h224[8U] = { - (uint32_t)0xc1059ed8U, (uint32_t)0x367cd507U, (uint32_t)0x3070dd17U, (uint32_t)0xf70e5939U, - (uint32_t)0xffc00b31U, (uint32_t)0x68581511U, (uint32_t)0x64f98fa7U, (uint32_t)0xbefa4fa4U + 0xc1059ed8U, 0x367cd507U, 0x3070dd17U, 0xf70e5939U, 0xffc00b31U, 0x68581511U, 0x64f98fa7U, + 0xbefa4fa4U }; static const uint32_t -Hacl_Impl_SHA2_Generic_h256[8U] = +Hacl_Hash_SHA2_h256[8U] = { - (uint32_t)0x6a09e667U, (uint32_t)0xbb67ae85U, (uint32_t)0x3c6ef372U, (uint32_t)0xa54ff53aU, - (uint32_t)0x510e527fU, (uint32_t)0x9b05688cU, (uint32_t)0x1f83d9abU, (uint32_t)0x5be0cd19U + 0x6a09e667U, 0xbb67ae85U, 0x3c6ef372U, 0xa54ff53aU, 0x510e527fU, 0x9b05688cU, 0x1f83d9abU, + 0x5be0cd19U }; static const uint64_t -Hacl_Impl_SHA2_Generic_h384[8U] = +Hacl_Hash_SHA2_h384[8U] = { - (uint64_t)0xcbbb9d5dc1059ed8U, (uint64_t)0x629a292a367cd507U, (uint64_t)0x9159015a3070dd17U, - (uint64_t)0x152fecd8f70e5939U, (uint64_t)0x67332667ffc00b31U, (uint64_t)0x8eb44a8768581511U, - (uint64_t)0xdb0c2e0d64f98fa7U, (uint64_t)0x47b5481dbefa4fa4U + 0xcbbb9d5dc1059ed8ULL, 0x629a292a367cd507ULL, 0x9159015a3070dd17ULL, 0x152fecd8f70e5939ULL, + 0x67332667ffc00b31ULL, 0x8eb44a8768581511ULL, 0xdb0c2e0d64f98fa7ULL, 0x47b5481dbefa4fa4ULL }; static const uint64_t -Hacl_Impl_SHA2_Generic_h512[8U] = +Hacl_Hash_SHA2_h512[8U] = { - (uint64_t)0x6a09e667f3bcc908U, (uint64_t)0xbb67ae8584caa73bU, (uint64_t)0x3c6ef372fe94f82bU, - (uint64_t)0xa54ff53a5f1d36f1U, (uint64_t)0x510e527fade682d1U, (uint64_t)0x9b05688c2b3e6c1fU, - (uint64_t)0x1f83d9abfb41bd6bU, (uint64_t)0x5be0cd19137e2179U + 0x6a09e667f3bcc908ULL, 0xbb67ae8584caa73bULL, 0x3c6ef372fe94f82bULL, 0xa54ff53a5f1d36f1ULL, + 0x510e527fade682d1ULL, 0x9b05688c2b3e6c1fULL, 0x1f83d9abfb41bd6bULL, 0x5be0cd19137e2179ULL }; static const uint32_t -Hacl_Impl_SHA2_Generic_k224_256[64U] = +Hacl_Hash_SHA2_k224_256[64U] = { - (uint32_t)0x428a2f98U, (uint32_t)0x71374491U, (uint32_t)0xb5c0fbcfU, (uint32_t)0xe9b5dba5U, - (uint32_t)0x3956c25bU, (uint32_t)0x59f111f1U, (uint32_t)0x923f82a4U, (uint32_t)0xab1c5ed5U, - (uint32_t)0xd807aa98U, (uint32_t)0x12835b01U, (uint32_t)0x243185beU, (uint32_t)0x550c7dc3U, - (uint32_t)0x72be5d74U, (uint32_t)0x80deb1feU, (uint32_t)0x9bdc06a7U, (uint32_t)0xc19bf174U, - (uint32_t)0xe49b69c1U, (uint32_t)0xefbe4786U, (uint32_t)0x0fc19dc6U, (uint32_t)0x240ca1ccU, - (uint32_t)0x2de92c6fU, (uint32_t)0x4a7484aaU, (uint32_t)0x5cb0a9dcU, (uint32_t)0x76f988daU, - (uint32_t)0x983e5152U, (uint32_t)0xa831c66dU, (uint32_t)0xb00327c8U, (uint32_t)0xbf597fc7U, - (uint32_t)0xc6e00bf3U, (uint32_t)0xd5a79147U, (uint32_t)0x06ca6351U, (uint32_t)0x14292967U, - (uint32_t)0x27b70a85U, (uint32_t)0x2e1b2138U, (uint32_t)0x4d2c6dfcU, (uint32_t)0x53380d13U, - (uint32_t)0x650a7354U, (uint32_t)0x766a0abbU, (uint32_t)0x81c2c92eU, (uint32_t)0x92722c85U, - (uint32_t)0xa2bfe8a1U, (uint32_t)0xa81a664bU, (uint32_t)0xc24b8b70U, (uint32_t)0xc76c51a3U, - (uint32_t)0xd192e819U, (uint32_t)0xd6990624U, (uint32_t)0xf40e3585U, (uint32_t)0x106aa070U, - (uint32_t)0x19a4c116U, (uint32_t)0x1e376c08U, (uint32_t)0x2748774cU, (uint32_t)0x34b0bcb5U, - (uint32_t)0x391c0cb3U, (uint32_t)0x4ed8aa4aU, (uint32_t)0x5b9cca4fU, (uint32_t)0x682e6ff3U, - (uint32_t)0x748f82eeU, (uint32_t)0x78a5636fU, (uint32_t)0x84c87814U, (uint32_t)0x8cc70208U, - (uint32_t)0x90befffaU, (uint32_t)0xa4506cebU, (uint32_t)0xbef9a3f7U, (uint32_t)0xc67178f2U + 0x428a2f98U, 0x71374491U, 0xb5c0fbcfU, 0xe9b5dba5U, 0x3956c25bU, 0x59f111f1U, 0x923f82a4U, + 0xab1c5ed5U, 0xd807aa98U, 0x12835b01U, 0x243185beU, 0x550c7dc3U, 0x72be5d74U, 0x80deb1feU, + 0x9bdc06a7U, 0xc19bf174U, 0xe49b69c1U, 0xefbe4786U, 0x0fc19dc6U, 0x240ca1ccU, 0x2de92c6fU, + 0x4a7484aaU, 0x5cb0a9dcU, 0x76f988daU, 0x983e5152U, 0xa831c66dU, 0xb00327c8U, 0xbf597fc7U, + 0xc6e00bf3U, 0xd5a79147U, 0x06ca6351U, 0x14292967U, 0x27b70a85U, 0x2e1b2138U, 0x4d2c6dfcU, + 0x53380d13U, 0x650a7354U, 0x766a0abbU, 0x81c2c92eU, 0x92722c85U, 0xa2bfe8a1U, 0xa81a664bU, + 0xc24b8b70U, 0xc76c51a3U, 0xd192e819U, 0xd6990624U, 0xf40e3585U, 0x106aa070U, 0x19a4c116U, + 0x1e376c08U, 0x2748774cU, 0x34b0bcb5U, 0x391c0cb3U, 0x4ed8aa4aU, 0x5b9cca4fU, 0x682e6ff3U, + 0x748f82eeU, 0x78a5636fU, 0x84c87814U, 0x8cc70208U, 0x90befffaU, 0xa4506cebU, 0xbef9a3f7U, + 0xc67178f2U }; static const uint64_t -Hacl_Impl_SHA2_Generic_k384_512[80U] = +Hacl_Hash_SHA2_k384_512[80U] = { - (uint64_t)0x428a2f98d728ae22U, (uint64_t)0x7137449123ef65cdU, (uint64_t)0xb5c0fbcfec4d3b2fU, - (uint64_t)0xe9b5dba58189dbbcU, (uint64_t)0x3956c25bf348b538U, (uint64_t)0x59f111f1b605d019U, - (uint64_t)0x923f82a4af194f9bU, (uint64_t)0xab1c5ed5da6d8118U, (uint64_t)0xd807aa98a3030242U, - (uint64_t)0x12835b0145706fbeU, (uint64_t)0x243185be4ee4b28cU, (uint64_t)0x550c7dc3d5ffb4e2U, - (uint64_t)0x72be5d74f27b896fU, (uint64_t)0x80deb1fe3b1696b1U, (uint64_t)0x9bdc06a725c71235U, - (uint64_t)0xc19bf174cf692694U, (uint64_t)0xe49b69c19ef14ad2U, (uint64_t)0xefbe4786384f25e3U, - (uint64_t)0x0fc19dc68b8cd5b5U, (uint64_t)0x240ca1cc77ac9c65U, (uint64_t)0x2de92c6f592b0275U, - (uint64_t)0x4a7484aa6ea6e483U, (uint64_t)0x5cb0a9dcbd41fbd4U, (uint64_t)0x76f988da831153b5U, - (uint64_t)0x983e5152ee66dfabU, (uint64_t)0xa831c66d2db43210U, (uint64_t)0xb00327c898fb213fU, - (uint64_t)0xbf597fc7beef0ee4U, (uint64_t)0xc6e00bf33da88fc2U, (uint64_t)0xd5a79147930aa725U, - (uint64_t)0x06ca6351e003826fU, (uint64_t)0x142929670a0e6e70U, (uint64_t)0x27b70a8546d22ffcU, - (uint64_t)0x2e1b21385c26c926U, (uint64_t)0x4d2c6dfc5ac42aedU, (uint64_t)0x53380d139d95b3dfU, - (uint64_t)0x650a73548baf63deU, (uint64_t)0x766a0abb3c77b2a8U, (uint64_t)0x81c2c92e47edaee6U, - (uint64_t)0x92722c851482353bU, (uint64_t)0xa2bfe8a14cf10364U, (uint64_t)0xa81a664bbc423001U, - (uint64_t)0xc24b8b70d0f89791U, (uint64_t)0xc76c51a30654be30U, (uint64_t)0xd192e819d6ef5218U, - (uint64_t)0xd69906245565a910U, (uint64_t)0xf40e35855771202aU, (uint64_t)0x106aa07032bbd1b8U, - (uint64_t)0x19a4c116b8d2d0c8U, (uint64_t)0x1e376c085141ab53U, (uint64_t)0x2748774cdf8eeb99U, - (uint64_t)0x34b0bcb5e19b48a8U, (uint64_t)0x391c0cb3c5c95a63U, (uint64_t)0x4ed8aa4ae3418acbU, - (uint64_t)0x5b9cca4f7763e373U, (uint64_t)0x682e6ff3d6b2b8a3U, (uint64_t)0x748f82ee5defb2fcU, - (uint64_t)0x78a5636f43172f60U, (uint64_t)0x84c87814a1f0ab72U, (uint64_t)0x8cc702081a6439ecU, - (uint64_t)0x90befffa23631e28U, (uint64_t)0xa4506cebde82bde9U, (uint64_t)0xbef9a3f7b2c67915U, - (uint64_t)0xc67178f2e372532bU, (uint64_t)0xca273eceea26619cU, (uint64_t)0xd186b8c721c0c207U, - (uint64_t)0xeada7dd6cde0eb1eU, (uint64_t)0xf57d4f7fee6ed178U, (uint64_t)0x06f067aa72176fbaU, - (uint64_t)0x0a637dc5a2c898a6U, (uint64_t)0x113f9804bef90daeU, (uint64_t)0x1b710b35131c471bU, - (uint64_t)0x28db77f523047d84U, (uint64_t)0x32caab7b40c72493U, (uint64_t)0x3c9ebe0a15c9bebcU, - (uint64_t)0x431d67c49c100d4cU, (uint64_t)0x4cc5d4becb3e42b6U, (uint64_t)0x597f299cfc657e2aU, - (uint64_t)0x5fcb6fab3ad6faecU, (uint64_t)0x6c44198c4a475817U + 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, 0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL, + 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL, 0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL, + 0xd807aa98a3030242ULL, 0x12835b0145706fbeULL, 0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL, + 0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL, 0x9bdc06a725c71235ULL, 0xc19bf174cf692694ULL, + 0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL, 0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL, + 0x2de92c6f592b0275ULL, 0x4a7484aa6ea6e483ULL, 0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL, + 0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL, 0xb00327c898fb213fULL, 0xbf597fc7beef0ee4ULL, + 0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL, 0x06ca6351e003826fULL, 0x142929670a0e6e70ULL, + 0x27b70a8546d22ffcULL, 0x2e1b21385c26c926ULL, 0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL, + 0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL, 0x81c2c92e47edaee6ULL, 0x92722c851482353bULL, + 0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL, 0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL, + 0xd192e819d6ef5218ULL, 0xd69906245565a910ULL, 0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL, + 0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL, 0x2748774cdf8eeb99ULL, 0x34b0bcb5e19b48a8ULL, + 0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL, 0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL, + 0x748f82ee5defb2fcULL, 0x78a5636f43172f60ULL, 0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL, + 0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL, 0xbef9a3f7b2c67915ULL, 0xc67178f2e372532bULL, + 0xca273eceea26619cULL, 0xd186b8c721c0c207ULL, 0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL, + 0x06f067aa72176fbaULL, 0x0a637dc5a2c898a6ULL, 0x113f9804bef90daeULL, 0x1b710b35131c471bULL, + 0x28db77f523047d84ULL, 0x32caab7b40c72493ULL, 0x3c9ebe0a15c9bebcULL, 0x431d67c49c100d4cULL, + 0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL, 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL }; -void Hacl_SHA2_Scalar32_sha256_init(uint32_t *hash); +void Hacl_Hash_SHA2_sha256_init(uint32_t *hash); -void Hacl_SHA2_Scalar32_sha256_update_nblocks(uint32_t len, uint8_t *b, uint32_t *st); +void Hacl_Hash_SHA2_sha256_update_nblocks(uint32_t len, uint8_t *b, uint32_t *st); void -Hacl_SHA2_Scalar32_sha256_update_last( - uint64_t totlen, - uint32_t len, - uint8_t *b, - uint32_t *hash -); +Hacl_Hash_SHA2_sha256_update_last(uint64_t totlen, uint32_t len, uint8_t *b, uint32_t *hash); -void Hacl_SHA2_Scalar32_sha256_finish(uint32_t *st, uint8_t *h); +void Hacl_Hash_SHA2_sha256_finish(uint32_t *st, uint8_t *h); -void Hacl_SHA2_Scalar32_sha224_init(uint32_t *hash); +void Hacl_Hash_SHA2_sha224_init(uint32_t *hash); void -Hacl_SHA2_Scalar32_sha224_update_last(uint64_t totlen, uint32_t len, uint8_t *b, uint32_t *st); +Hacl_Hash_SHA2_sha224_update_last(uint64_t totlen, uint32_t len, uint8_t *b, uint32_t *st); -void Hacl_SHA2_Scalar32_sha224_finish(uint32_t *st, uint8_t *h); +void Hacl_Hash_SHA2_sha224_finish(uint32_t *st, uint8_t *h); -void Hacl_SHA2_Scalar32_sha512_init(uint64_t *hash); +void Hacl_Hash_SHA2_sha512_init(uint64_t *hash); -void Hacl_SHA2_Scalar32_sha512_update_nblocks(uint32_t len, uint8_t *b, uint64_t *st); +void Hacl_Hash_SHA2_sha512_update_nblocks(uint32_t len, uint8_t *b, uint64_t *st); void -Hacl_SHA2_Scalar32_sha512_update_last( +Hacl_Hash_SHA2_sha512_update_last( FStar_UInt128_uint128 totlen, uint32_t len, uint8_t *b, uint64_t *hash ); -void Hacl_SHA2_Scalar32_sha512_finish(uint64_t *st, uint8_t *h); +void Hacl_Hash_SHA2_sha512_finish(uint64_t *st, uint8_t *h); -void Hacl_SHA2_Scalar32_sha384_init(uint64_t *hash); +void Hacl_Hash_SHA2_sha384_init(uint64_t *hash); -void Hacl_SHA2_Scalar32_sha384_update_nblocks(uint32_t len, uint8_t *b, uint64_t *st); +void Hacl_Hash_SHA2_sha384_update_nblocks(uint32_t len, uint8_t *b, uint64_t *st); void -Hacl_SHA2_Scalar32_sha384_update_last( +Hacl_Hash_SHA2_sha384_update_last( FStar_UInt128_uint128 totlen, uint32_t len, uint8_t *b, uint64_t *st ); -void Hacl_SHA2_Scalar32_sha384_finish(uint64_t *st, uint8_t *h); +void Hacl_Hash_SHA2_sha384_finish(uint64_t *st, uint8_t *h); #if defined(__cplusplus) } diff --git a/include/msvc/internal/Hacl_Hash_SHA3.h b/include/msvc/internal/Hacl_Hash_SHA3.h index 6f53d37c..1c8129fb 100644 --- a/include/msvc/internal/Hacl_Hash_SHA3.h +++ b/include/msvc/internal/Hacl_Hash_SHA3.h @@ -53,9 +53,9 @@ Hacl_Hash_SHA3_update_last_sha3( uint32_t input_len ); -void Hacl_Impl_SHA3_state_permute(uint64_t *s); +void Hacl_Hash_SHA3_state_permute(uint64_t *s); -void Hacl_Impl_SHA3_loadState(uint32_t rateInBytes, uint8_t *input, uint64_t *s); +void Hacl_Hash_SHA3_loadState(uint32_t rateInBytes, uint8_t *input, uint64_t *s); #if defined(__cplusplus) } diff --git a/include/msvc/internal/Hacl_Impl_Blake2_Constants.h b/include/msvc/internal/Hacl_Impl_Blake2_Constants.h index 185317ba..aedc2486 100644 --- a/include/msvc/internal/Hacl_Impl_Blake2_Constants.h +++ b/include/msvc/internal/Hacl_Impl_Blake2_Constants.h @@ -37,52 +37,32 @@ extern "C" { static const uint32_t -Hacl_Impl_Blake2_Constants_sigmaTable[160U] = +Hacl_Hash_Blake2s_sigmaTable[160U] = { - (uint32_t)0U, (uint32_t)1U, (uint32_t)2U, (uint32_t)3U, (uint32_t)4U, (uint32_t)5U, - (uint32_t)6U, (uint32_t)7U, (uint32_t)8U, (uint32_t)9U, (uint32_t)10U, (uint32_t)11U, - (uint32_t)12U, (uint32_t)13U, (uint32_t)14U, (uint32_t)15U, (uint32_t)14U, (uint32_t)10U, - (uint32_t)4U, (uint32_t)8U, (uint32_t)9U, (uint32_t)15U, (uint32_t)13U, (uint32_t)6U, - (uint32_t)1U, (uint32_t)12U, (uint32_t)0U, (uint32_t)2U, (uint32_t)11U, (uint32_t)7U, - (uint32_t)5U, (uint32_t)3U, (uint32_t)11U, (uint32_t)8U, (uint32_t)12U, (uint32_t)0U, - (uint32_t)5U, (uint32_t)2U, (uint32_t)15U, (uint32_t)13U, (uint32_t)10U, (uint32_t)14U, - (uint32_t)3U, (uint32_t)6U, (uint32_t)7U, (uint32_t)1U, (uint32_t)9U, (uint32_t)4U, - (uint32_t)7U, (uint32_t)9U, (uint32_t)3U, (uint32_t)1U, (uint32_t)13U, (uint32_t)12U, - (uint32_t)11U, (uint32_t)14U, (uint32_t)2U, (uint32_t)6U, (uint32_t)5U, (uint32_t)10U, - (uint32_t)4U, (uint32_t)0U, (uint32_t)15U, (uint32_t)8U, (uint32_t)9U, (uint32_t)0U, - (uint32_t)5U, (uint32_t)7U, (uint32_t)2U, (uint32_t)4U, (uint32_t)10U, (uint32_t)15U, - (uint32_t)14U, (uint32_t)1U, (uint32_t)11U, (uint32_t)12U, (uint32_t)6U, (uint32_t)8U, - (uint32_t)3U, (uint32_t)13U, (uint32_t)2U, (uint32_t)12U, (uint32_t)6U, (uint32_t)10U, - (uint32_t)0U, (uint32_t)11U, (uint32_t)8U, (uint32_t)3U, (uint32_t)4U, (uint32_t)13U, - (uint32_t)7U, (uint32_t)5U, (uint32_t)15U, (uint32_t)14U, (uint32_t)1U, (uint32_t)9U, - (uint32_t)12U, (uint32_t)5U, (uint32_t)1U, (uint32_t)15U, (uint32_t)14U, (uint32_t)13U, - (uint32_t)4U, (uint32_t)10U, (uint32_t)0U, (uint32_t)7U, (uint32_t)6U, (uint32_t)3U, - (uint32_t)9U, (uint32_t)2U, (uint32_t)8U, (uint32_t)11U, (uint32_t)13U, (uint32_t)11U, - (uint32_t)7U, (uint32_t)14U, (uint32_t)12U, (uint32_t)1U, (uint32_t)3U, (uint32_t)9U, - (uint32_t)5U, (uint32_t)0U, (uint32_t)15U, (uint32_t)4U, (uint32_t)8U, (uint32_t)6U, - (uint32_t)2U, (uint32_t)10U, (uint32_t)6U, (uint32_t)15U, (uint32_t)14U, (uint32_t)9U, - (uint32_t)11U, (uint32_t)3U, (uint32_t)0U, (uint32_t)8U, (uint32_t)12U, (uint32_t)2U, - (uint32_t)13U, (uint32_t)7U, (uint32_t)1U, (uint32_t)4U, (uint32_t)10U, (uint32_t)5U, - (uint32_t)10U, (uint32_t)2U, (uint32_t)8U, (uint32_t)4U, (uint32_t)7U, (uint32_t)6U, - (uint32_t)1U, (uint32_t)5U, (uint32_t)15U, (uint32_t)11U, (uint32_t)9U, (uint32_t)14U, - (uint32_t)3U, (uint32_t)12U, (uint32_t)13U + 0U, 1U, 2U, 3U, 4U, 5U, 6U, 7U, 8U, 9U, 10U, 11U, 12U, 13U, 14U, 15U, 14U, 10U, 4U, 8U, 9U, 15U, + 13U, 6U, 1U, 12U, 0U, 2U, 11U, 7U, 5U, 3U, 11U, 8U, 12U, 0U, 5U, 2U, 15U, 13U, 10U, 14U, 3U, 6U, + 7U, 1U, 9U, 4U, 7U, 9U, 3U, 1U, 13U, 12U, 11U, 14U, 2U, 6U, 5U, 10U, 4U, 0U, 15U, 8U, 9U, 0U, + 5U, 7U, 2U, 4U, 10U, 15U, 14U, 1U, 11U, 12U, 6U, 8U, 3U, 13U, 2U, 12U, 6U, 10U, 0U, 11U, 8U, 3U, + 4U, 13U, 7U, 5U, 15U, 14U, 1U, 9U, 12U, 5U, 1U, 15U, 14U, 13U, 4U, 10U, 0U, 7U, 6U, 3U, 9U, 2U, + 8U, 11U, 13U, 11U, 7U, 14U, 12U, 1U, 3U, 9U, 5U, 0U, 15U, 4U, 8U, 6U, 2U, 10U, 6U, 15U, 14U, 9U, + 11U, 3U, 0U, 8U, 12U, 2U, 13U, 7U, 1U, 4U, 10U, 5U, 10U, 2U, 8U, 4U, 7U, 6U, 1U, 5U, 15U, 11U, + 9U, 14U, 3U, 12U, 13U }; static const uint32_t -Hacl_Impl_Blake2_Constants_ivTable_S[8U] = +Hacl_Hash_Blake2s_ivTable_S[8U] = { - (uint32_t)0x6A09E667U, (uint32_t)0xBB67AE85U, (uint32_t)0x3C6EF372U, (uint32_t)0xA54FF53AU, - (uint32_t)0x510E527FU, (uint32_t)0x9B05688CU, (uint32_t)0x1F83D9ABU, (uint32_t)0x5BE0CD19U + 0x6A09E667U, 0xBB67AE85U, 0x3C6EF372U, 0xA54FF53AU, 0x510E527FU, 0x9B05688CU, 0x1F83D9ABU, + 0x5BE0CD19U }; static const uint64_t -Hacl_Impl_Blake2_Constants_ivTable_B[8U] = +Hacl_Hash_Blake2s_ivTable_B[8U] = { - (uint64_t)0x6A09E667F3BCC908U, (uint64_t)0xBB67AE8584CAA73BU, (uint64_t)0x3C6EF372FE94F82BU, - (uint64_t)0xA54FF53A5F1D36F1U, (uint64_t)0x510E527FADE682D1U, (uint64_t)0x9B05688C2B3E6C1FU, - (uint64_t)0x1F83D9ABFB41BD6BU, (uint64_t)0x5BE0CD19137E2179U + 0x6A09E667F3BCC908ULL, 0xBB67AE8584CAA73BULL, 0x3C6EF372FE94F82BULL, 0xA54FF53A5F1D36F1ULL, + 0x510E527FADE682D1ULL, 0x9B05688C2B3E6C1FULL, 0x1F83D9ABFB41BD6BULL, 0x5BE0CD19137E2179ULL }; #if defined(__cplusplus) diff --git a/include/msvc/internal/Hacl_Impl_FFDHE_Constants.h b/include/msvc/internal/Hacl_Impl_FFDHE_Constants.h index c746c411..80cbdd52 100644 --- a/include/msvc/internal/Hacl_Impl_FFDHE_Constants.h +++ b/include/msvc/internal/Hacl_Impl_FFDHE_Constants.h @@ -35,528 +35,265 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -static const uint8_t Hacl_Impl_FFDHE_Constants_ffdhe_g2[1U] = { (uint8_t)0x02U }; +static const uint8_t Hacl_Impl_FFDHE_Constants_ffdhe_g2[1U] = { 0x02U }; static const uint8_t Hacl_Impl_FFDHE_Constants_ffdhe_p2048[256U] = { - (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, - (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xADU, (uint8_t)0xF8U, (uint8_t)0x54U, (uint8_t)0x58U, - (uint8_t)0xA2U, (uint8_t)0xBBU, (uint8_t)0x4AU, (uint8_t)0x9AU, (uint8_t)0xAFU, (uint8_t)0xDCU, - (uint8_t)0x56U, (uint8_t)0x20U, (uint8_t)0x27U, (uint8_t)0x3DU, (uint8_t)0x3CU, (uint8_t)0xF1U, - (uint8_t)0xD8U, (uint8_t)0xB9U, (uint8_t)0xC5U, (uint8_t)0x83U, (uint8_t)0xCEU, (uint8_t)0x2DU, - (uint8_t)0x36U, (uint8_t)0x95U, (uint8_t)0xA9U, (uint8_t)0xE1U, (uint8_t)0x36U, (uint8_t)0x41U, - (uint8_t)0x14U, (uint8_t)0x64U, (uint8_t)0x33U, (uint8_t)0xFBU, (uint8_t)0xCCU, (uint8_t)0x93U, - (uint8_t)0x9DU, (uint8_t)0xCEU, (uint8_t)0x24U, (uint8_t)0x9BU, (uint8_t)0x3EU, (uint8_t)0xF9U, - (uint8_t)0x7DU, (uint8_t)0x2FU, (uint8_t)0xE3U, (uint8_t)0x63U, (uint8_t)0x63U, (uint8_t)0x0CU, - (uint8_t)0x75U, (uint8_t)0xD8U, (uint8_t)0xF6U, (uint8_t)0x81U, (uint8_t)0xB2U, (uint8_t)0x02U, - (uint8_t)0xAEU, (uint8_t)0xC4U, (uint8_t)0x61U, (uint8_t)0x7AU, (uint8_t)0xD3U, (uint8_t)0xDFU, - (uint8_t)0x1EU, (uint8_t)0xD5U, (uint8_t)0xD5U, (uint8_t)0xFDU, (uint8_t)0x65U, (uint8_t)0x61U, - (uint8_t)0x24U, (uint8_t)0x33U, (uint8_t)0xF5U, (uint8_t)0x1FU, (uint8_t)0x5FU, (uint8_t)0x06U, - (uint8_t)0x6EU, (uint8_t)0xD0U, (uint8_t)0x85U, (uint8_t)0x63U, (uint8_t)0x65U, (uint8_t)0x55U, - (uint8_t)0x3DU, (uint8_t)0xEDU, (uint8_t)0x1AU, (uint8_t)0xF3U, (uint8_t)0xB5U, (uint8_t)0x57U, - (uint8_t)0x13U, (uint8_t)0x5EU, (uint8_t)0x7FU, (uint8_t)0x57U, (uint8_t)0xC9U, (uint8_t)0x35U, - (uint8_t)0x98U, (uint8_t)0x4FU, (uint8_t)0x0CU, (uint8_t)0x70U, (uint8_t)0xE0U, (uint8_t)0xE6U, - (uint8_t)0x8BU, (uint8_t)0x77U, (uint8_t)0xE2U, (uint8_t)0xA6U, (uint8_t)0x89U, (uint8_t)0xDAU, - (uint8_t)0xF3U, (uint8_t)0xEFU, (uint8_t)0xE8U, (uint8_t)0x72U, (uint8_t)0x1DU, (uint8_t)0xF1U, - (uint8_t)0x58U, (uint8_t)0xA1U, (uint8_t)0x36U, (uint8_t)0xADU, (uint8_t)0xE7U, (uint8_t)0x35U, - (uint8_t)0x30U, (uint8_t)0xACU, (uint8_t)0xCAU, (uint8_t)0x4FU, (uint8_t)0x48U, (uint8_t)0x3AU, - (uint8_t)0x79U, (uint8_t)0x7AU, (uint8_t)0xBCU, (uint8_t)0x0AU, (uint8_t)0xB1U, (uint8_t)0x82U, - (uint8_t)0xB3U, (uint8_t)0x24U, (uint8_t)0xFBU, (uint8_t)0x61U, (uint8_t)0xD1U, (uint8_t)0x08U, - (uint8_t)0xA9U, (uint8_t)0x4BU, (uint8_t)0xB2U, (uint8_t)0xC8U, (uint8_t)0xE3U, (uint8_t)0xFBU, - (uint8_t)0xB9U, (uint8_t)0x6AU, (uint8_t)0xDAU, (uint8_t)0xB7U, (uint8_t)0x60U, (uint8_t)0xD7U, - (uint8_t)0xF4U, (uint8_t)0x68U, (uint8_t)0x1DU, (uint8_t)0x4FU, (uint8_t)0x42U, (uint8_t)0xA3U, - (uint8_t)0xDEU, (uint8_t)0x39U, (uint8_t)0x4DU, (uint8_t)0xF4U, (uint8_t)0xAEU, (uint8_t)0x56U, - (uint8_t)0xEDU, (uint8_t)0xE7U, (uint8_t)0x63U, (uint8_t)0x72U, (uint8_t)0xBBU, (uint8_t)0x19U, - (uint8_t)0x0BU, (uint8_t)0x07U, (uint8_t)0xA7U, (uint8_t)0xC8U, (uint8_t)0xEEU, (uint8_t)0x0AU, - (uint8_t)0x6DU, (uint8_t)0x70U, (uint8_t)0x9EU, (uint8_t)0x02U, (uint8_t)0xFCU, (uint8_t)0xE1U, - (uint8_t)0xCDU, (uint8_t)0xF7U, (uint8_t)0xE2U, (uint8_t)0xECU, (uint8_t)0xC0U, (uint8_t)0x34U, - (uint8_t)0x04U, (uint8_t)0xCDU, (uint8_t)0x28U, (uint8_t)0x34U, (uint8_t)0x2FU, (uint8_t)0x61U, - (uint8_t)0x91U, (uint8_t)0x72U, (uint8_t)0xFEU, (uint8_t)0x9CU, (uint8_t)0xE9U, (uint8_t)0x85U, - (uint8_t)0x83U, (uint8_t)0xFFU, (uint8_t)0x8EU, (uint8_t)0x4FU, (uint8_t)0x12U, (uint8_t)0x32U, - (uint8_t)0xEEU, (uint8_t)0xF2U, (uint8_t)0x81U, (uint8_t)0x83U, (uint8_t)0xC3U, (uint8_t)0xFEU, - (uint8_t)0x3BU, (uint8_t)0x1BU, (uint8_t)0x4CU, (uint8_t)0x6FU, (uint8_t)0xADU, (uint8_t)0x73U, - (uint8_t)0x3BU, (uint8_t)0xB5U, (uint8_t)0xFCU, (uint8_t)0xBCU, (uint8_t)0x2EU, (uint8_t)0xC2U, - (uint8_t)0x20U, (uint8_t)0x05U, (uint8_t)0xC5U, (uint8_t)0x8EU, (uint8_t)0xF1U, (uint8_t)0x83U, - (uint8_t)0x7DU, (uint8_t)0x16U, (uint8_t)0x83U, (uint8_t)0xB2U, (uint8_t)0xC6U, (uint8_t)0xF3U, - (uint8_t)0x4AU, (uint8_t)0x26U, (uint8_t)0xC1U, (uint8_t)0xB2U, (uint8_t)0xEFU, (uint8_t)0xFAU, - (uint8_t)0x88U, (uint8_t)0x6BU, (uint8_t)0x42U, (uint8_t)0x38U, (uint8_t)0x61U, (uint8_t)0x28U, - (uint8_t)0x5CU, (uint8_t)0x97U, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, - (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU + 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xADU, 0xF8U, 0x54U, 0x58U, 0xA2U, + 0xBBU, 0x4AU, 0x9AU, 0xAFU, 0xDCU, 0x56U, 0x20U, 0x27U, 0x3DU, 0x3CU, 0xF1U, 0xD8U, 0xB9U, + 0xC5U, 0x83U, 0xCEU, 0x2DU, 0x36U, 0x95U, 0xA9U, 0xE1U, 0x36U, 0x41U, 0x14U, 0x64U, 0x33U, + 0xFBU, 0xCCU, 0x93U, 0x9DU, 0xCEU, 0x24U, 0x9BU, 0x3EU, 0xF9U, 0x7DU, 0x2FU, 0xE3U, 0x63U, + 0x63U, 0x0CU, 0x75U, 0xD8U, 0xF6U, 0x81U, 0xB2U, 0x02U, 0xAEU, 0xC4U, 0x61U, 0x7AU, 0xD3U, + 0xDFU, 0x1EU, 0xD5U, 0xD5U, 0xFDU, 0x65U, 0x61U, 0x24U, 0x33U, 0xF5U, 0x1FU, 0x5FU, 0x06U, + 0x6EU, 0xD0U, 0x85U, 0x63U, 0x65U, 0x55U, 0x3DU, 0xEDU, 0x1AU, 0xF3U, 0xB5U, 0x57U, 0x13U, + 0x5EU, 0x7FU, 0x57U, 0xC9U, 0x35U, 0x98U, 0x4FU, 0x0CU, 0x70U, 0xE0U, 0xE6U, 0x8BU, 0x77U, + 0xE2U, 0xA6U, 0x89U, 0xDAU, 0xF3U, 0xEFU, 0xE8U, 0x72U, 0x1DU, 0xF1U, 0x58U, 0xA1U, 0x36U, + 0xADU, 0xE7U, 0x35U, 0x30U, 0xACU, 0xCAU, 0x4FU, 0x48U, 0x3AU, 0x79U, 0x7AU, 0xBCU, 0x0AU, + 0xB1U, 0x82U, 0xB3U, 0x24U, 0xFBU, 0x61U, 0xD1U, 0x08U, 0xA9U, 0x4BU, 0xB2U, 0xC8U, 0xE3U, + 0xFBU, 0xB9U, 0x6AU, 0xDAU, 0xB7U, 0x60U, 0xD7U, 0xF4U, 0x68U, 0x1DU, 0x4FU, 0x42U, 0xA3U, + 0xDEU, 0x39U, 0x4DU, 0xF4U, 0xAEU, 0x56U, 0xEDU, 0xE7U, 0x63U, 0x72U, 0xBBU, 0x19U, 0x0BU, + 0x07U, 0xA7U, 0xC8U, 0xEEU, 0x0AU, 0x6DU, 0x70U, 0x9EU, 0x02U, 0xFCU, 0xE1U, 0xCDU, 0xF7U, + 0xE2U, 0xECU, 0xC0U, 0x34U, 0x04U, 0xCDU, 0x28U, 0x34U, 0x2FU, 0x61U, 0x91U, 0x72U, 0xFEU, + 0x9CU, 0xE9U, 0x85U, 0x83U, 0xFFU, 0x8EU, 0x4FU, 0x12U, 0x32U, 0xEEU, 0xF2U, 0x81U, 0x83U, + 0xC3U, 0xFEU, 0x3BU, 0x1BU, 0x4CU, 0x6FU, 0xADU, 0x73U, 0x3BU, 0xB5U, 0xFCU, 0xBCU, 0x2EU, + 0xC2U, 0x20U, 0x05U, 0xC5U, 0x8EU, 0xF1U, 0x83U, 0x7DU, 0x16U, 0x83U, 0xB2U, 0xC6U, 0xF3U, + 0x4AU, 0x26U, 0xC1U, 0xB2U, 0xEFU, 0xFAU, 0x88U, 0x6BU, 0x42U, 0x38U, 0x61U, 0x28U, 0x5CU, + 0x97U, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU }; static const uint8_t Hacl_Impl_FFDHE_Constants_ffdhe_p3072[384U] = { - (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, - (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xADU, (uint8_t)0xF8U, (uint8_t)0x54U, (uint8_t)0x58U, - (uint8_t)0xA2U, (uint8_t)0xBBU, (uint8_t)0x4AU, (uint8_t)0x9AU, (uint8_t)0xAFU, (uint8_t)0xDCU, - (uint8_t)0x56U, (uint8_t)0x20U, (uint8_t)0x27U, (uint8_t)0x3DU, (uint8_t)0x3CU, (uint8_t)0xF1U, - (uint8_t)0xD8U, (uint8_t)0xB9U, (uint8_t)0xC5U, (uint8_t)0x83U, (uint8_t)0xCEU, (uint8_t)0x2DU, - (uint8_t)0x36U, (uint8_t)0x95U, (uint8_t)0xA9U, (uint8_t)0xE1U, (uint8_t)0x36U, (uint8_t)0x41U, - (uint8_t)0x14U, (uint8_t)0x64U, (uint8_t)0x33U, (uint8_t)0xFBU, (uint8_t)0xCCU, (uint8_t)0x93U, - (uint8_t)0x9DU, (uint8_t)0xCEU, (uint8_t)0x24U, (uint8_t)0x9BU, (uint8_t)0x3EU, (uint8_t)0xF9U, - (uint8_t)0x7DU, (uint8_t)0x2FU, (uint8_t)0xE3U, (uint8_t)0x63U, (uint8_t)0x63U, (uint8_t)0x0CU, - (uint8_t)0x75U, (uint8_t)0xD8U, (uint8_t)0xF6U, (uint8_t)0x81U, (uint8_t)0xB2U, (uint8_t)0x02U, - (uint8_t)0xAEU, (uint8_t)0xC4U, (uint8_t)0x61U, (uint8_t)0x7AU, (uint8_t)0xD3U, (uint8_t)0xDFU, - (uint8_t)0x1EU, (uint8_t)0xD5U, (uint8_t)0xD5U, (uint8_t)0xFDU, (uint8_t)0x65U, (uint8_t)0x61U, - (uint8_t)0x24U, (uint8_t)0x33U, (uint8_t)0xF5U, (uint8_t)0x1FU, (uint8_t)0x5FU, (uint8_t)0x06U, - (uint8_t)0x6EU, (uint8_t)0xD0U, (uint8_t)0x85U, (uint8_t)0x63U, (uint8_t)0x65U, (uint8_t)0x55U, - (uint8_t)0x3DU, (uint8_t)0xEDU, (uint8_t)0x1AU, (uint8_t)0xF3U, (uint8_t)0xB5U, (uint8_t)0x57U, - (uint8_t)0x13U, (uint8_t)0x5EU, (uint8_t)0x7FU, (uint8_t)0x57U, (uint8_t)0xC9U, (uint8_t)0x35U, - (uint8_t)0x98U, (uint8_t)0x4FU, (uint8_t)0x0CU, (uint8_t)0x70U, (uint8_t)0xE0U, (uint8_t)0xE6U, - (uint8_t)0x8BU, (uint8_t)0x77U, (uint8_t)0xE2U, (uint8_t)0xA6U, (uint8_t)0x89U, (uint8_t)0xDAU, - (uint8_t)0xF3U, (uint8_t)0xEFU, (uint8_t)0xE8U, (uint8_t)0x72U, (uint8_t)0x1DU, (uint8_t)0xF1U, - (uint8_t)0x58U, (uint8_t)0xA1U, (uint8_t)0x36U, (uint8_t)0xADU, (uint8_t)0xE7U, (uint8_t)0x35U, - (uint8_t)0x30U, (uint8_t)0xACU, (uint8_t)0xCAU, (uint8_t)0x4FU, (uint8_t)0x48U, (uint8_t)0x3AU, - (uint8_t)0x79U, (uint8_t)0x7AU, (uint8_t)0xBCU, (uint8_t)0x0AU, (uint8_t)0xB1U, (uint8_t)0x82U, - (uint8_t)0xB3U, (uint8_t)0x24U, (uint8_t)0xFBU, (uint8_t)0x61U, (uint8_t)0xD1U, (uint8_t)0x08U, - (uint8_t)0xA9U, (uint8_t)0x4BU, (uint8_t)0xB2U, (uint8_t)0xC8U, (uint8_t)0xE3U, (uint8_t)0xFBU, - (uint8_t)0xB9U, (uint8_t)0x6AU, (uint8_t)0xDAU, (uint8_t)0xB7U, (uint8_t)0x60U, (uint8_t)0xD7U, - (uint8_t)0xF4U, (uint8_t)0x68U, (uint8_t)0x1DU, (uint8_t)0x4FU, (uint8_t)0x42U, (uint8_t)0xA3U, - (uint8_t)0xDEU, (uint8_t)0x39U, (uint8_t)0x4DU, (uint8_t)0xF4U, (uint8_t)0xAEU, (uint8_t)0x56U, - (uint8_t)0xEDU, (uint8_t)0xE7U, (uint8_t)0x63U, (uint8_t)0x72U, (uint8_t)0xBBU, (uint8_t)0x19U, - (uint8_t)0x0BU, (uint8_t)0x07U, (uint8_t)0xA7U, (uint8_t)0xC8U, (uint8_t)0xEEU, (uint8_t)0x0AU, - (uint8_t)0x6DU, (uint8_t)0x70U, (uint8_t)0x9EU, (uint8_t)0x02U, (uint8_t)0xFCU, (uint8_t)0xE1U, - (uint8_t)0xCDU, (uint8_t)0xF7U, (uint8_t)0xE2U, (uint8_t)0xECU, (uint8_t)0xC0U, (uint8_t)0x34U, - (uint8_t)0x04U, (uint8_t)0xCDU, (uint8_t)0x28U, (uint8_t)0x34U, (uint8_t)0x2FU, (uint8_t)0x61U, - (uint8_t)0x91U, (uint8_t)0x72U, (uint8_t)0xFEU, (uint8_t)0x9CU, (uint8_t)0xE9U, (uint8_t)0x85U, - (uint8_t)0x83U, (uint8_t)0xFFU, (uint8_t)0x8EU, (uint8_t)0x4FU, (uint8_t)0x12U, (uint8_t)0x32U, - (uint8_t)0xEEU, (uint8_t)0xF2U, (uint8_t)0x81U, (uint8_t)0x83U, (uint8_t)0xC3U, (uint8_t)0xFEU, - (uint8_t)0x3BU, (uint8_t)0x1BU, (uint8_t)0x4CU, (uint8_t)0x6FU, (uint8_t)0xADU, (uint8_t)0x73U, - (uint8_t)0x3BU, (uint8_t)0xB5U, (uint8_t)0xFCU, (uint8_t)0xBCU, (uint8_t)0x2EU, (uint8_t)0xC2U, - (uint8_t)0x20U, (uint8_t)0x05U, (uint8_t)0xC5U, (uint8_t)0x8EU, (uint8_t)0xF1U, (uint8_t)0x83U, - (uint8_t)0x7DU, (uint8_t)0x16U, (uint8_t)0x83U, (uint8_t)0xB2U, (uint8_t)0xC6U, (uint8_t)0xF3U, - (uint8_t)0x4AU, (uint8_t)0x26U, (uint8_t)0xC1U, (uint8_t)0xB2U, (uint8_t)0xEFU, (uint8_t)0xFAU, - (uint8_t)0x88U, (uint8_t)0x6BU, (uint8_t)0x42U, (uint8_t)0x38U, (uint8_t)0x61U, (uint8_t)0x1FU, - (uint8_t)0xCFU, (uint8_t)0xDCU, (uint8_t)0xDEU, (uint8_t)0x35U, (uint8_t)0x5BU, (uint8_t)0x3BU, - (uint8_t)0x65U, (uint8_t)0x19U, (uint8_t)0x03U, (uint8_t)0x5BU, (uint8_t)0xBCU, (uint8_t)0x34U, - (uint8_t)0xF4U, (uint8_t)0xDEU, (uint8_t)0xF9U, (uint8_t)0x9CU, (uint8_t)0x02U, (uint8_t)0x38U, - (uint8_t)0x61U, (uint8_t)0xB4U, (uint8_t)0x6FU, (uint8_t)0xC9U, (uint8_t)0xD6U, (uint8_t)0xE6U, - (uint8_t)0xC9U, (uint8_t)0x07U, (uint8_t)0x7AU, (uint8_t)0xD9U, (uint8_t)0x1DU, (uint8_t)0x26U, - (uint8_t)0x91U, (uint8_t)0xF7U, (uint8_t)0xF7U, (uint8_t)0xEEU, (uint8_t)0x59U, (uint8_t)0x8CU, - (uint8_t)0xB0U, (uint8_t)0xFAU, (uint8_t)0xC1U, (uint8_t)0x86U, (uint8_t)0xD9U, (uint8_t)0x1CU, - (uint8_t)0xAEU, (uint8_t)0xFEU, (uint8_t)0x13U, (uint8_t)0x09U, (uint8_t)0x85U, (uint8_t)0x13U, - (uint8_t)0x92U, (uint8_t)0x70U, (uint8_t)0xB4U, (uint8_t)0x13U, (uint8_t)0x0CU, (uint8_t)0x93U, - (uint8_t)0xBCU, (uint8_t)0x43U, (uint8_t)0x79U, (uint8_t)0x44U, (uint8_t)0xF4U, (uint8_t)0xFDU, - (uint8_t)0x44U, (uint8_t)0x52U, (uint8_t)0xE2U, (uint8_t)0xD7U, (uint8_t)0x4DU, (uint8_t)0xD3U, - (uint8_t)0x64U, (uint8_t)0xF2U, (uint8_t)0xE2U, (uint8_t)0x1EU, (uint8_t)0x71U, (uint8_t)0xF5U, - (uint8_t)0x4BU, (uint8_t)0xFFU, (uint8_t)0x5CU, (uint8_t)0xAEU, (uint8_t)0x82U, (uint8_t)0xABU, - (uint8_t)0x9CU, (uint8_t)0x9DU, (uint8_t)0xF6U, (uint8_t)0x9EU, (uint8_t)0xE8U, (uint8_t)0x6DU, - (uint8_t)0x2BU, (uint8_t)0xC5U, (uint8_t)0x22U, (uint8_t)0x36U, (uint8_t)0x3AU, (uint8_t)0x0DU, - (uint8_t)0xABU, (uint8_t)0xC5U, (uint8_t)0x21U, (uint8_t)0x97U, (uint8_t)0x9BU, (uint8_t)0x0DU, - (uint8_t)0xEAU, (uint8_t)0xDAU, (uint8_t)0x1DU, (uint8_t)0xBFU, (uint8_t)0x9AU, (uint8_t)0x42U, - (uint8_t)0xD5U, (uint8_t)0xC4U, (uint8_t)0x48U, (uint8_t)0x4EU, (uint8_t)0x0AU, (uint8_t)0xBCU, - (uint8_t)0xD0U, (uint8_t)0x6BU, (uint8_t)0xFAU, (uint8_t)0x53U, (uint8_t)0xDDU, (uint8_t)0xEFU, - (uint8_t)0x3CU, (uint8_t)0x1BU, (uint8_t)0x20U, (uint8_t)0xEEU, (uint8_t)0x3FU, (uint8_t)0xD5U, - (uint8_t)0x9DU, (uint8_t)0x7CU, (uint8_t)0x25U, (uint8_t)0xE4U, (uint8_t)0x1DU, (uint8_t)0x2BU, - (uint8_t)0x66U, (uint8_t)0xC6U, (uint8_t)0x2EU, (uint8_t)0x37U, (uint8_t)0xFFU, (uint8_t)0xFFU, - (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU + 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xADU, 0xF8U, 0x54U, 0x58U, 0xA2U, + 0xBBU, 0x4AU, 0x9AU, 0xAFU, 0xDCU, 0x56U, 0x20U, 0x27U, 0x3DU, 0x3CU, 0xF1U, 0xD8U, 0xB9U, + 0xC5U, 0x83U, 0xCEU, 0x2DU, 0x36U, 0x95U, 0xA9U, 0xE1U, 0x36U, 0x41U, 0x14U, 0x64U, 0x33U, + 0xFBU, 0xCCU, 0x93U, 0x9DU, 0xCEU, 0x24U, 0x9BU, 0x3EU, 0xF9U, 0x7DU, 0x2FU, 0xE3U, 0x63U, + 0x63U, 0x0CU, 0x75U, 0xD8U, 0xF6U, 0x81U, 0xB2U, 0x02U, 0xAEU, 0xC4U, 0x61U, 0x7AU, 0xD3U, + 0xDFU, 0x1EU, 0xD5U, 0xD5U, 0xFDU, 0x65U, 0x61U, 0x24U, 0x33U, 0xF5U, 0x1FU, 0x5FU, 0x06U, + 0x6EU, 0xD0U, 0x85U, 0x63U, 0x65U, 0x55U, 0x3DU, 0xEDU, 0x1AU, 0xF3U, 0xB5U, 0x57U, 0x13U, + 0x5EU, 0x7FU, 0x57U, 0xC9U, 0x35U, 0x98U, 0x4FU, 0x0CU, 0x70U, 0xE0U, 0xE6U, 0x8BU, 0x77U, + 0xE2U, 0xA6U, 0x89U, 0xDAU, 0xF3U, 0xEFU, 0xE8U, 0x72U, 0x1DU, 0xF1U, 0x58U, 0xA1U, 0x36U, + 0xADU, 0xE7U, 0x35U, 0x30U, 0xACU, 0xCAU, 0x4FU, 0x48U, 0x3AU, 0x79U, 0x7AU, 0xBCU, 0x0AU, + 0xB1U, 0x82U, 0xB3U, 0x24U, 0xFBU, 0x61U, 0xD1U, 0x08U, 0xA9U, 0x4BU, 0xB2U, 0xC8U, 0xE3U, + 0xFBU, 0xB9U, 0x6AU, 0xDAU, 0xB7U, 0x60U, 0xD7U, 0xF4U, 0x68U, 0x1DU, 0x4FU, 0x42U, 0xA3U, + 0xDEU, 0x39U, 0x4DU, 0xF4U, 0xAEU, 0x56U, 0xEDU, 0xE7U, 0x63U, 0x72U, 0xBBU, 0x19U, 0x0BU, + 0x07U, 0xA7U, 0xC8U, 0xEEU, 0x0AU, 0x6DU, 0x70U, 0x9EU, 0x02U, 0xFCU, 0xE1U, 0xCDU, 0xF7U, + 0xE2U, 0xECU, 0xC0U, 0x34U, 0x04U, 0xCDU, 0x28U, 0x34U, 0x2FU, 0x61U, 0x91U, 0x72U, 0xFEU, + 0x9CU, 0xE9U, 0x85U, 0x83U, 0xFFU, 0x8EU, 0x4FU, 0x12U, 0x32U, 0xEEU, 0xF2U, 0x81U, 0x83U, + 0xC3U, 0xFEU, 0x3BU, 0x1BU, 0x4CU, 0x6FU, 0xADU, 0x73U, 0x3BU, 0xB5U, 0xFCU, 0xBCU, 0x2EU, + 0xC2U, 0x20U, 0x05U, 0xC5U, 0x8EU, 0xF1U, 0x83U, 0x7DU, 0x16U, 0x83U, 0xB2U, 0xC6U, 0xF3U, + 0x4AU, 0x26U, 0xC1U, 0xB2U, 0xEFU, 0xFAU, 0x88U, 0x6BU, 0x42U, 0x38U, 0x61U, 0x1FU, 0xCFU, + 0xDCU, 0xDEU, 0x35U, 0x5BU, 0x3BU, 0x65U, 0x19U, 0x03U, 0x5BU, 0xBCU, 0x34U, 0xF4U, 0xDEU, + 0xF9U, 0x9CU, 0x02U, 0x38U, 0x61U, 0xB4U, 0x6FU, 0xC9U, 0xD6U, 0xE6U, 0xC9U, 0x07U, 0x7AU, + 0xD9U, 0x1DU, 0x26U, 0x91U, 0xF7U, 0xF7U, 0xEEU, 0x59U, 0x8CU, 0xB0U, 0xFAU, 0xC1U, 0x86U, + 0xD9U, 0x1CU, 0xAEU, 0xFEU, 0x13U, 0x09U, 0x85U, 0x13U, 0x92U, 0x70U, 0xB4U, 0x13U, 0x0CU, + 0x93U, 0xBCU, 0x43U, 0x79U, 0x44U, 0xF4U, 0xFDU, 0x44U, 0x52U, 0xE2U, 0xD7U, 0x4DU, 0xD3U, + 0x64U, 0xF2U, 0xE2U, 0x1EU, 0x71U, 0xF5U, 0x4BU, 0xFFU, 0x5CU, 0xAEU, 0x82U, 0xABU, 0x9CU, + 0x9DU, 0xF6U, 0x9EU, 0xE8U, 0x6DU, 0x2BU, 0xC5U, 0x22U, 0x36U, 0x3AU, 0x0DU, 0xABU, 0xC5U, + 0x21U, 0x97U, 0x9BU, 0x0DU, 0xEAU, 0xDAU, 0x1DU, 0xBFU, 0x9AU, 0x42U, 0xD5U, 0xC4U, 0x48U, + 0x4EU, 0x0AU, 0xBCU, 0xD0U, 0x6BU, 0xFAU, 0x53U, 0xDDU, 0xEFU, 0x3CU, 0x1BU, 0x20U, 0xEEU, + 0x3FU, 0xD5U, 0x9DU, 0x7CU, 0x25U, 0xE4U, 0x1DU, 0x2BU, 0x66U, 0xC6U, 0x2EU, 0x37U, 0xFFU, + 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU }; static const uint8_t Hacl_Impl_FFDHE_Constants_ffdhe_p4096[512U] = { - (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, - (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xADU, (uint8_t)0xF8U, (uint8_t)0x54U, (uint8_t)0x58U, - (uint8_t)0xA2U, (uint8_t)0xBBU, (uint8_t)0x4AU, (uint8_t)0x9AU, (uint8_t)0xAFU, (uint8_t)0xDCU, - (uint8_t)0x56U, (uint8_t)0x20U, (uint8_t)0x27U, (uint8_t)0x3DU, (uint8_t)0x3CU, (uint8_t)0xF1U, - (uint8_t)0xD8U, (uint8_t)0xB9U, (uint8_t)0xC5U, (uint8_t)0x83U, (uint8_t)0xCEU, (uint8_t)0x2DU, - (uint8_t)0x36U, (uint8_t)0x95U, (uint8_t)0xA9U, (uint8_t)0xE1U, (uint8_t)0x36U, (uint8_t)0x41U, - (uint8_t)0x14U, (uint8_t)0x64U, (uint8_t)0x33U, (uint8_t)0xFBU, (uint8_t)0xCCU, (uint8_t)0x93U, - (uint8_t)0x9DU, (uint8_t)0xCEU, (uint8_t)0x24U, (uint8_t)0x9BU, (uint8_t)0x3EU, (uint8_t)0xF9U, - (uint8_t)0x7DU, (uint8_t)0x2FU, (uint8_t)0xE3U, (uint8_t)0x63U, (uint8_t)0x63U, (uint8_t)0x0CU, - (uint8_t)0x75U, (uint8_t)0xD8U, (uint8_t)0xF6U, (uint8_t)0x81U, (uint8_t)0xB2U, (uint8_t)0x02U, - (uint8_t)0xAEU, (uint8_t)0xC4U, (uint8_t)0x61U, (uint8_t)0x7AU, (uint8_t)0xD3U, (uint8_t)0xDFU, - (uint8_t)0x1EU, (uint8_t)0xD5U, (uint8_t)0xD5U, (uint8_t)0xFDU, (uint8_t)0x65U, (uint8_t)0x61U, - (uint8_t)0x24U, (uint8_t)0x33U, (uint8_t)0xF5U, (uint8_t)0x1FU, (uint8_t)0x5FU, (uint8_t)0x06U, - (uint8_t)0x6EU, (uint8_t)0xD0U, (uint8_t)0x85U, (uint8_t)0x63U, (uint8_t)0x65U, (uint8_t)0x55U, - (uint8_t)0x3DU, (uint8_t)0xEDU, (uint8_t)0x1AU, (uint8_t)0xF3U, (uint8_t)0xB5U, (uint8_t)0x57U, - (uint8_t)0x13U, (uint8_t)0x5EU, (uint8_t)0x7FU, (uint8_t)0x57U, (uint8_t)0xC9U, (uint8_t)0x35U, - (uint8_t)0x98U, (uint8_t)0x4FU, (uint8_t)0x0CU, (uint8_t)0x70U, (uint8_t)0xE0U, (uint8_t)0xE6U, - (uint8_t)0x8BU, (uint8_t)0x77U, (uint8_t)0xE2U, (uint8_t)0xA6U, (uint8_t)0x89U, (uint8_t)0xDAU, - (uint8_t)0xF3U, (uint8_t)0xEFU, (uint8_t)0xE8U, (uint8_t)0x72U, (uint8_t)0x1DU, (uint8_t)0xF1U, - (uint8_t)0x58U, (uint8_t)0xA1U, (uint8_t)0x36U, (uint8_t)0xADU, (uint8_t)0xE7U, (uint8_t)0x35U, - (uint8_t)0x30U, (uint8_t)0xACU, (uint8_t)0xCAU, (uint8_t)0x4FU, (uint8_t)0x48U, (uint8_t)0x3AU, - (uint8_t)0x79U, (uint8_t)0x7AU, (uint8_t)0xBCU, (uint8_t)0x0AU, (uint8_t)0xB1U, (uint8_t)0x82U, - (uint8_t)0xB3U, (uint8_t)0x24U, (uint8_t)0xFBU, (uint8_t)0x61U, (uint8_t)0xD1U, (uint8_t)0x08U, - (uint8_t)0xA9U, (uint8_t)0x4BU, (uint8_t)0xB2U, (uint8_t)0xC8U, (uint8_t)0xE3U, (uint8_t)0xFBU, - (uint8_t)0xB9U, (uint8_t)0x6AU, (uint8_t)0xDAU, (uint8_t)0xB7U, (uint8_t)0x60U, (uint8_t)0xD7U, - (uint8_t)0xF4U, (uint8_t)0x68U, (uint8_t)0x1DU, (uint8_t)0x4FU, (uint8_t)0x42U, (uint8_t)0xA3U, - (uint8_t)0xDEU, (uint8_t)0x39U, (uint8_t)0x4DU, (uint8_t)0xF4U, (uint8_t)0xAEU, (uint8_t)0x56U, - (uint8_t)0xEDU, (uint8_t)0xE7U, (uint8_t)0x63U, (uint8_t)0x72U, (uint8_t)0xBBU, (uint8_t)0x19U, - (uint8_t)0x0BU, (uint8_t)0x07U, (uint8_t)0xA7U, (uint8_t)0xC8U, (uint8_t)0xEEU, (uint8_t)0x0AU, - (uint8_t)0x6DU, (uint8_t)0x70U, (uint8_t)0x9EU, (uint8_t)0x02U, (uint8_t)0xFCU, (uint8_t)0xE1U, - (uint8_t)0xCDU, (uint8_t)0xF7U, (uint8_t)0xE2U, (uint8_t)0xECU, (uint8_t)0xC0U, (uint8_t)0x34U, - (uint8_t)0x04U, (uint8_t)0xCDU, (uint8_t)0x28U, (uint8_t)0x34U, (uint8_t)0x2FU, (uint8_t)0x61U, - (uint8_t)0x91U, (uint8_t)0x72U, (uint8_t)0xFEU, (uint8_t)0x9CU, (uint8_t)0xE9U, (uint8_t)0x85U, - (uint8_t)0x83U, (uint8_t)0xFFU, (uint8_t)0x8EU, (uint8_t)0x4FU, (uint8_t)0x12U, (uint8_t)0x32U, - (uint8_t)0xEEU, (uint8_t)0xF2U, (uint8_t)0x81U, (uint8_t)0x83U, (uint8_t)0xC3U, (uint8_t)0xFEU, - (uint8_t)0x3BU, (uint8_t)0x1BU, (uint8_t)0x4CU, (uint8_t)0x6FU, (uint8_t)0xADU, (uint8_t)0x73U, - (uint8_t)0x3BU, (uint8_t)0xB5U, (uint8_t)0xFCU, (uint8_t)0xBCU, (uint8_t)0x2EU, (uint8_t)0xC2U, - (uint8_t)0x20U, (uint8_t)0x05U, (uint8_t)0xC5U, (uint8_t)0x8EU, (uint8_t)0xF1U, (uint8_t)0x83U, - (uint8_t)0x7DU, (uint8_t)0x16U, (uint8_t)0x83U, (uint8_t)0xB2U, (uint8_t)0xC6U, (uint8_t)0xF3U, - (uint8_t)0x4AU, (uint8_t)0x26U, (uint8_t)0xC1U, (uint8_t)0xB2U, (uint8_t)0xEFU, (uint8_t)0xFAU, - (uint8_t)0x88U, (uint8_t)0x6BU, (uint8_t)0x42U, (uint8_t)0x38U, (uint8_t)0x61U, (uint8_t)0x1FU, - (uint8_t)0xCFU, (uint8_t)0xDCU, (uint8_t)0xDEU, (uint8_t)0x35U, (uint8_t)0x5BU, (uint8_t)0x3BU, - (uint8_t)0x65U, (uint8_t)0x19U, (uint8_t)0x03U, (uint8_t)0x5BU, (uint8_t)0xBCU, (uint8_t)0x34U, - (uint8_t)0xF4U, (uint8_t)0xDEU, (uint8_t)0xF9U, (uint8_t)0x9CU, (uint8_t)0x02U, (uint8_t)0x38U, - (uint8_t)0x61U, (uint8_t)0xB4U, (uint8_t)0x6FU, (uint8_t)0xC9U, (uint8_t)0xD6U, (uint8_t)0xE6U, - (uint8_t)0xC9U, (uint8_t)0x07U, (uint8_t)0x7AU, (uint8_t)0xD9U, (uint8_t)0x1DU, (uint8_t)0x26U, - (uint8_t)0x91U, (uint8_t)0xF7U, (uint8_t)0xF7U, (uint8_t)0xEEU, (uint8_t)0x59U, (uint8_t)0x8CU, - (uint8_t)0xB0U, (uint8_t)0xFAU, (uint8_t)0xC1U, (uint8_t)0x86U, (uint8_t)0xD9U, (uint8_t)0x1CU, - (uint8_t)0xAEU, (uint8_t)0xFEU, (uint8_t)0x13U, (uint8_t)0x09U, (uint8_t)0x85U, (uint8_t)0x13U, - (uint8_t)0x92U, (uint8_t)0x70U, (uint8_t)0xB4U, (uint8_t)0x13U, (uint8_t)0x0CU, (uint8_t)0x93U, - (uint8_t)0xBCU, (uint8_t)0x43U, (uint8_t)0x79U, (uint8_t)0x44U, (uint8_t)0xF4U, (uint8_t)0xFDU, - (uint8_t)0x44U, (uint8_t)0x52U, (uint8_t)0xE2U, (uint8_t)0xD7U, (uint8_t)0x4DU, (uint8_t)0xD3U, - (uint8_t)0x64U, (uint8_t)0xF2U, (uint8_t)0xE2U, (uint8_t)0x1EU, (uint8_t)0x71U, (uint8_t)0xF5U, - (uint8_t)0x4BU, (uint8_t)0xFFU, (uint8_t)0x5CU, (uint8_t)0xAEU, (uint8_t)0x82U, (uint8_t)0xABU, - (uint8_t)0x9CU, (uint8_t)0x9DU, (uint8_t)0xF6U, (uint8_t)0x9EU, (uint8_t)0xE8U, (uint8_t)0x6DU, - (uint8_t)0x2BU, (uint8_t)0xC5U, (uint8_t)0x22U, (uint8_t)0x36U, (uint8_t)0x3AU, (uint8_t)0x0DU, - (uint8_t)0xABU, (uint8_t)0xC5U, (uint8_t)0x21U, (uint8_t)0x97U, (uint8_t)0x9BU, (uint8_t)0x0DU, - (uint8_t)0xEAU, (uint8_t)0xDAU, (uint8_t)0x1DU, (uint8_t)0xBFU, (uint8_t)0x9AU, (uint8_t)0x42U, - (uint8_t)0xD5U, (uint8_t)0xC4U, (uint8_t)0x48U, (uint8_t)0x4EU, (uint8_t)0x0AU, (uint8_t)0xBCU, - (uint8_t)0xD0U, (uint8_t)0x6BU, (uint8_t)0xFAU, (uint8_t)0x53U, (uint8_t)0xDDU, (uint8_t)0xEFU, - (uint8_t)0x3CU, (uint8_t)0x1BU, (uint8_t)0x20U, (uint8_t)0xEEU, (uint8_t)0x3FU, (uint8_t)0xD5U, - (uint8_t)0x9DU, (uint8_t)0x7CU, (uint8_t)0x25U, (uint8_t)0xE4U, (uint8_t)0x1DU, (uint8_t)0x2BU, - (uint8_t)0x66U, (uint8_t)0x9EU, (uint8_t)0x1EU, (uint8_t)0xF1U, (uint8_t)0x6EU, (uint8_t)0x6FU, - (uint8_t)0x52U, (uint8_t)0xC3U, (uint8_t)0x16U, (uint8_t)0x4DU, (uint8_t)0xF4U, (uint8_t)0xFBU, - (uint8_t)0x79U, (uint8_t)0x30U, (uint8_t)0xE9U, (uint8_t)0xE4U, (uint8_t)0xE5U, (uint8_t)0x88U, - (uint8_t)0x57U, (uint8_t)0xB6U, (uint8_t)0xACU, (uint8_t)0x7DU, (uint8_t)0x5FU, (uint8_t)0x42U, - (uint8_t)0xD6U, (uint8_t)0x9FU, (uint8_t)0x6DU, (uint8_t)0x18U, (uint8_t)0x77U, (uint8_t)0x63U, - (uint8_t)0xCFU, (uint8_t)0x1DU, (uint8_t)0x55U, (uint8_t)0x03U, (uint8_t)0x40U, (uint8_t)0x04U, - (uint8_t)0x87U, (uint8_t)0xF5U, (uint8_t)0x5BU, (uint8_t)0xA5U, (uint8_t)0x7EU, (uint8_t)0x31U, - (uint8_t)0xCCU, (uint8_t)0x7AU, (uint8_t)0x71U, (uint8_t)0x35U, (uint8_t)0xC8U, (uint8_t)0x86U, - (uint8_t)0xEFU, (uint8_t)0xB4U, (uint8_t)0x31U, (uint8_t)0x8AU, (uint8_t)0xEDU, (uint8_t)0x6AU, - (uint8_t)0x1EU, (uint8_t)0x01U, (uint8_t)0x2DU, (uint8_t)0x9EU, (uint8_t)0x68U, (uint8_t)0x32U, - (uint8_t)0xA9U, (uint8_t)0x07U, (uint8_t)0x60U, (uint8_t)0x0AU, (uint8_t)0x91U, (uint8_t)0x81U, - (uint8_t)0x30U, (uint8_t)0xC4U, (uint8_t)0x6DU, (uint8_t)0xC7U, (uint8_t)0x78U, (uint8_t)0xF9U, - (uint8_t)0x71U, (uint8_t)0xADU, (uint8_t)0x00U, (uint8_t)0x38U, (uint8_t)0x09U, (uint8_t)0x29U, - (uint8_t)0x99U, (uint8_t)0xA3U, (uint8_t)0x33U, (uint8_t)0xCBU, (uint8_t)0x8BU, (uint8_t)0x7AU, - (uint8_t)0x1AU, (uint8_t)0x1DU, (uint8_t)0xB9U, (uint8_t)0x3DU, (uint8_t)0x71U, (uint8_t)0x40U, - (uint8_t)0x00U, (uint8_t)0x3CU, (uint8_t)0x2AU, (uint8_t)0x4EU, (uint8_t)0xCEU, (uint8_t)0xA9U, - (uint8_t)0xF9U, (uint8_t)0x8DU, (uint8_t)0x0AU, (uint8_t)0xCCU, (uint8_t)0x0AU, (uint8_t)0x82U, - (uint8_t)0x91U, (uint8_t)0xCDU, (uint8_t)0xCEU, (uint8_t)0xC9U, (uint8_t)0x7DU, (uint8_t)0xCFU, - (uint8_t)0x8EU, (uint8_t)0xC9U, (uint8_t)0xB5U, (uint8_t)0x5AU, (uint8_t)0x7FU, (uint8_t)0x88U, - (uint8_t)0xA4U, (uint8_t)0x6BU, (uint8_t)0x4DU, (uint8_t)0xB5U, (uint8_t)0xA8U, (uint8_t)0x51U, - (uint8_t)0xF4U, (uint8_t)0x41U, (uint8_t)0x82U, (uint8_t)0xE1U, (uint8_t)0xC6U, (uint8_t)0x8AU, - (uint8_t)0x00U, (uint8_t)0x7EU, (uint8_t)0x5EU, (uint8_t)0x65U, (uint8_t)0x5FU, (uint8_t)0x6AU, - (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, - (uint8_t)0xFFU, (uint8_t)0xFFU + 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xADU, 0xF8U, 0x54U, 0x58U, 0xA2U, + 0xBBU, 0x4AU, 0x9AU, 0xAFU, 0xDCU, 0x56U, 0x20U, 0x27U, 0x3DU, 0x3CU, 0xF1U, 0xD8U, 0xB9U, + 0xC5U, 0x83U, 0xCEU, 0x2DU, 0x36U, 0x95U, 0xA9U, 0xE1U, 0x36U, 0x41U, 0x14U, 0x64U, 0x33U, + 0xFBU, 0xCCU, 0x93U, 0x9DU, 0xCEU, 0x24U, 0x9BU, 0x3EU, 0xF9U, 0x7DU, 0x2FU, 0xE3U, 0x63U, + 0x63U, 0x0CU, 0x75U, 0xD8U, 0xF6U, 0x81U, 0xB2U, 0x02U, 0xAEU, 0xC4U, 0x61U, 0x7AU, 0xD3U, + 0xDFU, 0x1EU, 0xD5U, 0xD5U, 0xFDU, 0x65U, 0x61U, 0x24U, 0x33U, 0xF5U, 0x1FU, 0x5FU, 0x06U, + 0x6EU, 0xD0U, 0x85U, 0x63U, 0x65U, 0x55U, 0x3DU, 0xEDU, 0x1AU, 0xF3U, 0xB5U, 0x57U, 0x13U, + 0x5EU, 0x7FU, 0x57U, 0xC9U, 0x35U, 0x98U, 0x4FU, 0x0CU, 0x70U, 0xE0U, 0xE6U, 0x8BU, 0x77U, + 0xE2U, 0xA6U, 0x89U, 0xDAU, 0xF3U, 0xEFU, 0xE8U, 0x72U, 0x1DU, 0xF1U, 0x58U, 0xA1U, 0x36U, + 0xADU, 0xE7U, 0x35U, 0x30U, 0xACU, 0xCAU, 0x4FU, 0x48U, 0x3AU, 0x79U, 0x7AU, 0xBCU, 0x0AU, + 0xB1U, 0x82U, 0xB3U, 0x24U, 0xFBU, 0x61U, 0xD1U, 0x08U, 0xA9U, 0x4BU, 0xB2U, 0xC8U, 0xE3U, + 0xFBU, 0xB9U, 0x6AU, 0xDAU, 0xB7U, 0x60U, 0xD7U, 0xF4U, 0x68U, 0x1DU, 0x4FU, 0x42U, 0xA3U, + 0xDEU, 0x39U, 0x4DU, 0xF4U, 0xAEU, 0x56U, 0xEDU, 0xE7U, 0x63U, 0x72U, 0xBBU, 0x19U, 0x0BU, + 0x07U, 0xA7U, 0xC8U, 0xEEU, 0x0AU, 0x6DU, 0x70U, 0x9EU, 0x02U, 0xFCU, 0xE1U, 0xCDU, 0xF7U, + 0xE2U, 0xECU, 0xC0U, 0x34U, 0x04U, 0xCDU, 0x28U, 0x34U, 0x2FU, 0x61U, 0x91U, 0x72U, 0xFEU, + 0x9CU, 0xE9U, 0x85U, 0x83U, 0xFFU, 0x8EU, 0x4FU, 0x12U, 0x32U, 0xEEU, 0xF2U, 0x81U, 0x83U, + 0xC3U, 0xFEU, 0x3BU, 0x1BU, 0x4CU, 0x6FU, 0xADU, 0x73U, 0x3BU, 0xB5U, 0xFCU, 0xBCU, 0x2EU, + 0xC2U, 0x20U, 0x05U, 0xC5U, 0x8EU, 0xF1U, 0x83U, 0x7DU, 0x16U, 0x83U, 0xB2U, 0xC6U, 0xF3U, + 0x4AU, 0x26U, 0xC1U, 0xB2U, 0xEFU, 0xFAU, 0x88U, 0x6BU, 0x42U, 0x38U, 0x61U, 0x1FU, 0xCFU, + 0xDCU, 0xDEU, 0x35U, 0x5BU, 0x3BU, 0x65U, 0x19U, 0x03U, 0x5BU, 0xBCU, 0x34U, 0xF4U, 0xDEU, + 0xF9U, 0x9CU, 0x02U, 0x38U, 0x61U, 0xB4U, 0x6FU, 0xC9U, 0xD6U, 0xE6U, 0xC9U, 0x07U, 0x7AU, + 0xD9U, 0x1DU, 0x26U, 0x91U, 0xF7U, 0xF7U, 0xEEU, 0x59U, 0x8CU, 0xB0U, 0xFAU, 0xC1U, 0x86U, + 0xD9U, 0x1CU, 0xAEU, 0xFEU, 0x13U, 0x09U, 0x85U, 0x13U, 0x92U, 0x70U, 0xB4U, 0x13U, 0x0CU, + 0x93U, 0xBCU, 0x43U, 0x79U, 0x44U, 0xF4U, 0xFDU, 0x44U, 0x52U, 0xE2U, 0xD7U, 0x4DU, 0xD3U, + 0x64U, 0xF2U, 0xE2U, 0x1EU, 0x71U, 0xF5U, 0x4BU, 0xFFU, 0x5CU, 0xAEU, 0x82U, 0xABU, 0x9CU, + 0x9DU, 0xF6U, 0x9EU, 0xE8U, 0x6DU, 0x2BU, 0xC5U, 0x22U, 0x36U, 0x3AU, 0x0DU, 0xABU, 0xC5U, + 0x21U, 0x97U, 0x9BU, 0x0DU, 0xEAU, 0xDAU, 0x1DU, 0xBFU, 0x9AU, 0x42U, 0xD5U, 0xC4U, 0x48U, + 0x4EU, 0x0AU, 0xBCU, 0xD0U, 0x6BU, 0xFAU, 0x53U, 0xDDU, 0xEFU, 0x3CU, 0x1BU, 0x20U, 0xEEU, + 0x3FU, 0xD5U, 0x9DU, 0x7CU, 0x25U, 0xE4U, 0x1DU, 0x2BU, 0x66U, 0x9EU, 0x1EU, 0xF1U, 0x6EU, + 0x6FU, 0x52U, 0xC3U, 0x16U, 0x4DU, 0xF4U, 0xFBU, 0x79U, 0x30U, 0xE9U, 0xE4U, 0xE5U, 0x88U, + 0x57U, 0xB6U, 0xACU, 0x7DU, 0x5FU, 0x42U, 0xD6U, 0x9FU, 0x6DU, 0x18U, 0x77U, 0x63U, 0xCFU, + 0x1DU, 0x55U, 0x03U, 0x40U, 0x04U, 0x87U, 0xF5U, 0x5BU, 0xA5U, 0x7EU, 0x31U, 0xCCU, 0x7AU, + 0x71U, 0x35U, 0xC8U, 0x86U, 0xEFU, 0xB4U, 0x31U, 0x8AU, 0xEDU, 0x6AU, 0x1EU, 0x01U, 0x2DU, + 0x9EU, 0x68U, 0x32U, 0xA9U, 0x07U, 0x60U, 0x0AU, 0x91U, 0x81U, 0x30U, 0xC4U, 0x6DU, 0xC7U, + 0x78U, 0xF9U, 0x71U, 0xADU, 0x00U, 0x38U, 0x09U, 0x29U, 0x99U, 0xA3U, 0x33U, 0xCBU, 0x8BU, + 0x7AU, 0x1AU, 0x1DU, 0xB9U, 0x3DU, 0x71U, 0x40U, 0x00U, 0x3CU, 0x2AU, 0x4EU, 0xCEU, 0xA9U, + 0xF9U, 0x8DU, 0x0AU, 0xCCU, 0x0AU, 0x82U, 0x91U, 0xCDU, 0xCEU, 0xC9U, 0x7DU, 0xCFU, 0x8EU, + 0xC9U, 0xB5U, 0x5AU, 0x7FU, 0x88U, 0xA4U, 0x6BU, 0x4DU, 0xB5U, 0xA8U, 0x51U, 0xF4U, 0x41U, + 0x82U, 0xE1U, 0xC6U, 0x8AU, 0x00U, 0x7EU, 0x5EU, 0x65U, 0x5FU, 0x6AU, 0xFFU, 0xFFU, 0xFFU, + 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU }; static const uint8_t Hacl_Impl_FFDHE_Constants_ffdhe_p6144[768U] = { - (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, - (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xADU, (uint8_t)0xF8U, (uint8_t)0x54U, (uint8_t)0x58U, - (uint8_t)0xA2U, (uint8_t)0xBBU, (uint8_t)0x4AU, (uint8_t)0x9AU, (uint8_t)0xAFU, (uint8_t)0xDCU, - (uint8_t)0x56U, (uint8_t)0x20U, (uint8_t)0x27U, (uint8_t)0x3DU, (uint8_t)0x3CU, (uint8_t)0xF1U, - (uint8_t)0xD8U, (uint8_t)0xB9U, (uint8_t)0xC5U, (uint8_t)0x83U, (uint8_t)0xCEU, (uint8_t)0x2DU, - (uint8_t)0x36U, (uint8_t)0x95U, (uint8_t)0xA9U, (uint8_t)0xE1U, (uint8_t)0x36U, (uint8_t)0x41U, - (uint8_t)0x14U, (uint8_t)0x64U, (uint8_t)0x33U, (uint8_t)0xFBU, (uint8_t)0xCCU, (uint8_t)0x93U, - (uint8_t)0x9DU, (uint8_t)0xCEU, (uint8_t)0x24U, (uint8_t)0x9BU, (uint8_t)0x3EU, (uint8_t)0xF9U, - (uint8_t)0x7DU, (uint8_t)0x2FU, (uint8_t)0xE3U, (uint8_t)0x63U, (uint8_t)0x63U, (uint8_t)0x0CU, - (uint8_t)0x75U, (uint8_t)0xD8U, (uint8_t)0xF6U, (uint8_t)0x81U, (uint8_t)0xB2U, (uint8_t)0x02U, - (uint8_t)0xAEU, (uint8_t)0xC4U, (uint8_t)0x61U, (uint8_t)0x7AU, (uint8_t)0xD3U, (uint8_t)0xDFU, - (uint8_t)0x1EU, (uint8_t)0xD5U, (uint8_t)0xD5U, (uint8_t)0xFDU, (uint8_t)0x65U, (uint8_t)0x61U, - (uint8_t)0x24U, (uint8_t)0x33U, (uint8_t)0xF5U, (uint8_t)0x1FU, (uint8_t)0x5FU, (uint8_t)0x06U, - (uint8_t)0x6EU, (uint8_t)0xD0U, (uint8_t)0x85U, (uint8_t)0x63U, (uint8_t)0x65U, (uint8_t)0x55U, - (uint8_t)0x3DU, (uint8_t)0xEDU, (uint8_t)0x1AU, (uint8_t)0xF3U, (uint8_t)0xB5U, (uint8_t)0x57U, - (uint8_t)0x13U, (uint8_t)0x5EU, (uint8_t)0x7FU, (uint8_t)0x57U, (uint8_t)0xC9U, (uint8_t)0x35U, - (uint8_t)0x98U, (uint8_t)0x4FU, (uint8_t)0x0CU, (uint8_t)0x70U, (uint8_t)0xE0U, (uint8_t)0xE6U, - (uint8_t)0x8BU, (uint8_t)0x77U, (uint8_t)0xE2U, (uint8_t)0xA6U, (uint8_t)0x89U, (uint8_t)0xDAU, - (uint8_t)0xF3U, (uint8_t)0xEFU, (uint8_t)0xE8U, (uint8_t)0x72U, (uint8_t)0x1DU, (uint8_t)0xF1U, - (uint8_t)0x58U, (uint8_t)0xA1U, (uint8_t)0x36U, (uint8_t)0xADU, (uint8_t)0xE7U, (uint8_t)0x35U, - (uint8_t)0x30U, (uint8_t)0xACU, (uint8_t)0xCAU, (uint8_t)0x4FU, (uint8_t)0x48U, (uint8_t)0x3AU, - (uint8_t)0x79U, (uint8_t)0x7AU, (uint8_t)0xBCU, (uint8_t)0x0AU, (uint8_t)0xB1U, (uint8_t)0x82U, - (uint8_t)0xB3U, (uint8_t)0x24U, (uint8_t)0xFBU, (uint8_t)0x61U, (uint8_t)0xD1U, (uint8_t)0x08U, - (uint8_t)0xA9U, (uint8_t)0x4BU, (uint8_t)0xB2U, (uint8_t)0xC8U, (uint8_t)0xE3U, (uint8_t)0xFBU, - (uint8_t)0xB9U, (uint8_t)0x6AU, (uint8_t)0xDAU, (uint8_t)0xB7U, (uint8_t)0x60U, (uint8_t)0xD7U, - (uint8_t)0xF4U, (uint8_t)0x68U, (uint8_t)0x1DU, (uint8_t)0x4FU, (uint8_t)0x42U, (uint8_t)0xA3U, - (uint8_t)0xDEU, (uint8_t)0x39U, (uint8_t)0x4DU, (uint8_t)0xF4U, (uint8_t)0xAEU, (uint8_t)0x56U, - (uint8_t)0xEDU, (uint8_t)0xE7U, (uint8_t)0x63U, (uint8_t)0x72U, (uint8_t)0xBBU, (uint8_t)0x19U, - (uint8_t)0x0BU, (uint8_t)0x07U, (uint8_t)0xA7U, (uint8_t)0xC8U, (uint8_t)0xEEU, (uint8_t)0x0AU, - (uint8_t)0x6DU, (uint8_t)0x70U, (uint8_t)0x9EU, (uint8_t)0x02U, (uint8_t)0xFCU, (uint8_t)0xE1U, - (uint8_t)0xCDU, (uint8_t)0xF7U, (uint8_t)0xE2U, (uint8_t)0xECU, (uint8_t)0xC0U, (uint8_t)0x34U, - (uint8_t)0x04U, (uint8_t)0xCDU, (uint8_t)0x28U, (uint8_t)0x34U, (uint8_t)0x2FU, (uint8_t)0x61U, - (uint8_t)0x91U, (uint8_t)0x72U, (uint8_t)0xFEU, (uint8_t)0x9CU, (uint8_t)0xE9U, (uint8_t)0x85U, - (uint8_t)0x83U, (uint8_t)0xFFU, (uint8_t)0x8EU, (uint8_t)0x4FU, (uint8_t)0x12U, (uint8_t)0x32U, - (uint8_t)0xEEU, (uint8_t)0xF2U, (uint8_t)0x81U, (uint8_t)0x83U, (uint8_t)0xC3U, (uint8_t)0xFEU, - (uint8_t)0x3BU, (uint8_t)0x1BU, (uint8_t)0x4CU, (uint8_t)0x6FU, (uint8_t)0xADU, (uint8_t)0x73U, - (uint8_t)0x3BU, (uint8_t)0xB5U, (uint8_t)0xFCU, (uint8_t)0xBCU, (uint8_t)0x2EU, (uint8_t)0xC2U, - (uint8_t)0x20U, (uint8_t)0x05U, (uint8_t)0xC5U, (uint8_t)0x8EU, (uint8_t)0xF1U, (uint8_t)0x83U, - (uint8_t)0x7DU, (uint8_t)0x16U, (uint8_t)0x83U, (uint8_t)0xB2U, (uint8_t)0xC6U, (uint8_t)0xF3U, - (uint8_t)0x4AU, (uint8_t)0x26U, (uint8_t)0xC1U, (uint8_t)0xB2U, (uint8_t)0xEFU, (uint8_t)0xFAU, - (uint8_t)0x88U, (uint8_t)0x6BU, (uint8_t)0x42U, (uint8_t)0x38U, (uint8_t)0x61U, (uint8_t)0x1FU, - (uint8_t)0xCFU, (uint8_t)0xDCU, (uint8_t)0xDEU, (uint8_t)0x35U, (uint8_t)0x5BU, (uint8_t)0x3BU, - (uint8_t)0x65U, (uint8_t)0x19U, (uint8_t)0x03U, (uint8_t)0x5BU, (uint8_t)0xBCU, (uint8_t)0x34U, - (uint8_t)0xF4U, (uint8_t)0xDEU, (uint8_t)0xF9U, (uint8_t)0x9CU, (uint8_t)0x02U, (uint8_t)0x38U, - (uint8_t)0x61U, (uint8_t)0xB4U, (uint8_t)0x6FU, (uint8_t)0xC9U, (uint8_t)0xD6U, (uint8_t)0xE6U, - (uint8_t)0xC9U, (uint8_t)0x07U, (uint8_t)0x7AU, (uint8_t)0xD9U, (uint8_t)0x1DU, (uint8_t)0x26U, - (uint8_t)0x91U, (uint8_t)0xF7U, (uint8_t)0xF7U, (uint8_t)0xEEU, (uint8_t)0x59U, (uint8_t)0x8CU, - (uint8_t)0xB0U, (uint8_t)0xFAU, (uint8_t)0xC1U, (uint8_t)0x86U, (uint8_t)0xD9U, (uint8_t)0x1CU, - (uint8_t)0xAEU, (uint8_t)0xFEU, (uint8_t)0x13U, (uint8_t)0x09U, (uint8_t)0x85U, (uint8_t)0x13U, - (uint8_t)0x92U, (uint8_t)0x70U, (uint8_t)0xB4U, (uint8_t)0x13U, (uint8_t)0x0CU, (uint8_t)0x93U, - (uint8_t)0xBCU, (uint8_t)0x43U, (uint8_t)0x79U, (uint8_t)0x44U, (uint8_t)0xF4U, (uint8_t)0xFDU, - (uint8_t)0x44U, (uint8_t)0x52U, (uint8_t)0xE2U, (uint8_t)0xD7U, (uint8_t)0x4DU, (uint8_t)0xD3U, - (uint8_t)0x64U, (uint8_t)0xF2U, (uint8_t)0xE2U, (uint8_t)0x1EU, (uint8_t)0x71U, (uint8_t)0xF5U, - (uint8_t)0x4BU, (uint8_t)0xFFU, (uint8_t)0x5CU, (uint8_t)0xAEU, (uint8_t)0x82U, (uint8_t)0xABU, - (uint8_t)0x9CU, (uint8_t)0x9DU, (uint8_t)0xF6U, (uint8_t)0x9EU, (uint8_t)0xE8U, (uint8_t)0x6DU, - (uint8_t)0x2BU, (uint8_t)0xC5U, (uint8_t)0x22U, (uint8_t)0x36U, (uint8_t)0x3AU, (uint8_t)0x0DU, - (uint8_t)0xABU, (uint8_t)0xC5U, (uint8_t)0x21U, (uint8_t)0x97U, (uint8_t)0x9BU, (uint8_t)0x0DU, - (uint8_t)0xEAU, (uint8_t)0xDAU, (uint8_t)0x1DU, (uint8_t)0xBFU, (uint8_t)0x9AU, (uint8_t)0x42U, - (uint8_t)0xD5U, (uint8_t)0xC4U, (uint8_t)0x48U, (uint8_t)0x4EU, (uint8_t)0x0AU, (uint8_t)0xBCU, - (uint8_t)0xD0U, (uint8_t)0x6BU, (uint8_t)0xFAU, (uint8_t)0x53U, (uint8_t)0xDDU, (uint8_t)0xEFU, - (uint8_t)0x3CU, (uint8_t)0x1BU, (uint8_t)0x20U, (uint8_t)0xEEU, (uint8_t)0x3FU, (uint8_t)0xD5U, - (uint8_t)0x9DU, (uint8_t)0x7CU, (uint8_t)0x25U, (uint8_t)0xE4U, (uint8_t)0x1DU, (uint8_t)0x2BU, - (uint8_t)0x66U, (uint8_t)0x9EU, (uint8_t)0x1EU, (uint8_t)0xF1U, (uint8_t)0x6EU, (uint8_t)0x6FU, - (uint8_t)0x52U, (uint8_t)0xC3U, (uint8_t)0x16U, (uint8_t)0x4DU, (uint8_t)0xF4U, (uint8_t)0xFBU, - (uint8_t)0x79U, (uint8_t)0x30U, (uint8_t)0xE9U, (uint8_t)0xE4U, (uint8_t)0xE5U, (uint8_t)0x88U, - (uint8_t)0x57U, (uint8_t)0xB6U, (uint8_t)0xACU, (uint8_t)0x7DU, (uint8_t)0x5FU, (uint8_t)0x42U, - (uint8_t)0xD6U, (uint8_t)0x9FU, (uint8_t)0x6DU, (uint8_t)0x18U, (uint8_t)0x77U, (uint8_t)0x63U, - (uint8_t)0xCFU, (uint8_t)0x1DU, (uint8_t)0x55U, (uint8_t)0x03U, (uint8_t)0x40U, (uint8_t)0x04U, - (uint8_t)0x87U, (uint8_t)0xF5U, (uint8_t)0x5BU, (uint8_t)0xA5U, (uint8_t)0x7EU, (uint8_t)0x31U, - (uint8_t)0xCCU, (uint8_t)0x7AU, (uint8_t)0x71U, (uint8_t)0x35U, (uint8_t)0xC8U, (uint8_t)0x86U, - (uint8_t)0xEFU, (uint8_t)0xB4U, (uint8_t)0x31U, (uint8_t)0x8AU, (uint8_t)0xEDU, (uint8_t)0x6AU, - (uint8_t)0x1EU, (uint8_t)0x01U, (uint8_t)0x2DU, (uint8_t)0x9EU, (uint8_t)0x68U, (uint8_t)0x32U, - (uint8_t)0xA9U, (uint8_t)0x07U, (uint8_t)0x60U, (uint8_t)0x0AU, (uint8_t)0x91U, (uint8_t)0x81U, - (uint8_t)0x30U, (uint8_t)0xC4U, (uint8_t)0x6DU, (uint8_t)0xC7U, (uint8_t)0x78U, (uint8_t)0xF9U, - (uint8_t)0x71U, (uint8_t)0xADU, (uint8_t)0x00U, (uint8_t)0x38U, (uint8_t)0x09U, (uint8_t)0x29U, - (uint8_t)0x99U, (uint8_t)0xA3U, (uint8_t)0x33U, (uint8_t)0xCBU, (uint8_t)0x8BU, (uint8_t)0x7AU, - (uint8_t)0x1AU, (uint8_t)0x1DU, (uint8_t)0xB9U, (uint8_t)0x3DU, (uint8_t)0x71U, (uint8_t)0x40U, - (uint8_t)0x00U, (uint8_t)0x3CU, (uint8_t)0x2AU, (uint8_t)0x4EU, (uint8_t)0xCEU, (uint8_t)0xA9U, - (uint8_t)0xF9U, (uint8_t)0x8DU, (uint8_t)0x0AU, (uint8_t)0xCCU, (uint8_t)0x0AU, (uint8_t)0x82U, - (uint8_t)0x91U, (uint8_t)0xCDU, (uint8_t)0xCEU, (uint8_t)0xC9U, (uint8_t)0x7DU, (uint8_t)0xCFU, - (uint8_t)0x8EU, (uint8_t)0xC9U, (uint8_t)0xB5U, (uint8_t)0x5AU, (uint8_t)0x7FU, (uint8_t)0x88U, - (uint8_t)0xA4U, (uint8_t)0x6BU, (uint8_t)0x4DU, (uint8_t)0xB5U, (uint8_t)0xA8U, (uint8_t)0x51U, - (uint8_t)0xF4U, (uint8_t)0x41U, (uint8_t)0x82U, (uint8_t)0xE1U, (uint8_t)0xC6U, (uint8_t)0x8AU, - (uint8_t)0x00U, (uint8_t)0x7EU, (uint8_t)0x5EU, (uint8_t)0x0DU, (uint8_t)0xD9U, (uint8_t)0x02U, - (uint8_t)0x0BU, (uint8_t)0xFDU, (uint8_t)0x64U, (uint8_t)0xB6U, (uint8_t)0x45U, (uint8_t)0x03U, - (uint8_t)0x6CU, (uint8_t)0x7AU, (uint8_t)0x4EU, (uint8_t)0x67U, (uint8_t)0x7DU, (uint8_t)0x2CU, - (uint8_t)0x38U, (uint8_t)0x53U, (uint8_t)0x2AU, (uint8_t)0x3AU, (uint8_t)0x23U, (uint8_t)0xBAU, - (uint8_t)0x44U, (uint8_t)0x42U, (uint8_t)0xCAU, (uint8_t)0xF5U, (uint8_t)0x3EU, (uint8_t)0xA6U, - (uint8_t)0x3BU, (uint8_t)0xB4U, (uint8_t)0x54U, (uint8_t)0x32U, (uint8_t)0x9BU, (uint8_t)0x76U, - (uint8_t)0x24U, (uint8_t)0xC8U, (uint8_t)0x91U, (uint8_t)0x7BU, (uint8_t)0xDDU, (uint8_t)0x64U, - (uint8_t)0xB1U, (uint8_t)0xC0U, (uint8_t)0xFDU, (uint8_t)0x4CU, (uint8_t)0xB3U, (uint8_t)0x8EU, - (uint8_t)0x8CU, (uint8_t)0x33U, (uint8_t)0x4CU, (uint8_t)0x70U, (uint8_t)0x1CU, (uint8_t)0x3AU, - (uint8_t)0xCDU, (uint8_t)0xADU, (uint8_t)0x06U, (uint8_t)0x57U, (uint8_t)0xFCU, (uint8_t)0xCFU, - (uint8_t)0xECU, (uint8_t)0x71U, (uint8_t)0x9BU, (uint8_t)0x1FU, (uint8_t)0x5CU, (uint8_t)0x3EU, - (uint8_t)0x4EU, (uint8_t)0x46U, (uint8_t)0x04U, (uint8_t)0x1FU, (uint8_t)0x38U, (uint8_t)0x81U, - (uint8_t)0x47U, (uint8_t)0xFBU, (uint8_t)0x4CU, (uint8_t)0xFDU, (uint8_t)0xB4U, (uint8_t)0x77U, - (uint8_t)0xA5U, (uint8_t)0x24U, (uint8_t)0x71U, (uint8_t)0xF7U, (uint8_t)0xA9U, (uint8_t)0xA9U, - (uint8_t)0x69U, (uint8_t)0x10U, (uint8_t)0xB8U, (uint8_t)0x55U, (uint8_t)0x32U, (uint8_t)0x2EU, - (uint8_t)0xDBU, (uint8_t)0x63U, (uint8_t)0x40U, (uint8_t)0xD8U, (uint8_t)0xA0U, (uint8_t)0x0EU, - (uint8_t)0xF0U, (uint8_t)0x92U, (uint8_t)0x35U, (uint8_t)0x05U, (uint8_t)0x11U, (uint8_t)0xE3U, - (uint8_t)0x0AU, (uint8_t)0xBEU, (uint8_t)0xC1U, (uint8_t)0xFFU, (uint8_t)0xF9U, (uint8_t)0xE3U, - (uint8_t)0xA2U, (uint8_t)0x6EU, (uint8_t)0x7FU, (uint8_t)0xB2U, (uint8_t)0x9FU, (uint8_t)0x8CU, - (uint8_t)0x18U, (uint8_t)0x30U, (uint8_t)0x23U, (uint8_t)0xC3U, (uint8_t)0x58U, (uint8_t)0x7EU, - (uint8_t)0x38U, (uint8_t)0xDAU, (uint8_t)0x00U, (uint8_t)0x77U, (uint8_t)0xD9U, (uint8_t)0xB4U, - (uint8_t)0x76U, (uint8_t)0x3EU, (uint8_t)0x4EU, (uint8_t)0x4BU, (uint8_t)0x94U, (uint8_t)0xB2U, - (uint8_t)0xBBU, (uint8_t)0xC1U, (uint8_t)0x94U, (uint8_t)0xC6U, (uint8_t)0x65U, (uint8_t)0x1EU, - (uint8_t)0x77U, (uint8_t)0xCAU, (uint8_t)0xF9U, (uint8_t)0x92U, (uint8_t)0xEEU, (uint8_t)0xAAU, - (uint8_t)0xC0U, (uint8_t)0x23U, (uint8_t)0x2AU, (uint8_t)0x28U, (uint8_t)0x1BU, (uint8_t)0xF6U, - (uint8_t)0xB3U, (uint8_t)0xA7U, (uint8_t)0x39U, (uint8_t)0xC1U, (uint8_t)0x22U, (uint8_t)0x61U, - (uint8_t)0x16U, (uint8_t)0x82U, (uint8_t)0x0AU, (uint8_t)0xE8U, (uint8_t)0xDBU, (uint8_t)0x58U, - (uint8_t)0x47U, (uint8_t)0xA6U, (uint8_t)0x7CU, (uint8_t)0xBEU, (uint8_t)0xF9U, (uint8_t)0xC9U, - (uint8_t)0x09U, (uint8_t)0x1BU, (uint8_t)0x46U, (uint8_t)0x2DU, (uint8_t)0x53U, (uint8_t)0x8CU, - (uint8_t)0xD7U, (uint8_t)0x2BU, (uint8_t)0x03U, (uint8_t)0x74U, (uint8_t)0x6AU, (uint8_t)0xE7U, - (uint8_t)0x7FU, (uint8_t)0x5EU, (uint8_t)0x62U, (uint8_t)0x29U, (uint8_t)0x2CU, (uint8_t)0x31U, - (uint8_t)0x15U, (uint8_t)0x62U, (uint8_t)0xA8U, (uint8_t)0x46U, (uint8_t)0x50U, (uint8_t)0x5DU, - (uint8_t)0xC8U, (uint8_t)0x2DU, (uint8_t)0xB8U, (uint8_t)0x54U, (uint8_t)0x33U, (uint8_t)0x8AU, - (uint8_t)0xE4U, (uint8_t)0x9FU, (uint8_t)0x52U, (uint8_t)0x35U, (uint8_t)0xC9U, (uint8_t)0x5BU, - (uint8_t)0x91U, (uint8_t)0x17U, (uint8_t)0x8CU, (uint8_t)0xCFU, (uint8_t)0x2DU, (uint8_t)0xD5U, - (uint8_t)0xCAU, (uint8_t)0xCEU, (uint8_t)0xF4U, (uint8_t)0x03U, (uint8_t)0xECU, (uint8_t)0x9DU, - (uint8_t)0x18U, (uint8_t)0x10U, (uint8_t)0xC6U, (uint8_t)0x27U, (uint8_t)0x2BU, (uint8_t)0x04U, - (uint8_t)0x5BU, (uint8_t)0x3BU, (uint8_t)0x71U, (uint8_t)0xF9U, (uint8_t)0xDCU, (uint8_t)0x6BU, - (uint8_t)0x80U, (uint8_t)0xD6U, (uint8_t)0x3FU, (uint8_t)0xDDU, (uint8_t)0x4AU, (uint8_t)0x8EU, - (uint8_t)0x9AU, (uint8_t)0xDBU, (uint8_t)0x1EU, (uint8_t)0x69U, (uint8_t)0x62U, (uint8_t)0xA6U, - (uint8_t)0x95U, (uint8_t)0x26U, (uint8_t)0xD4U, (uint8_t)0x31U, (uint8_t)0x61U, (uint8_t)0xC1U, - (uint8_t)0xA4U, (uint8_t)0x1DU, (uint8_t)0x57U, (uint8_t)0x0DU, (uint8_t)0x79U, (uint8_t)0x38U, - (uint8_t)0xDAU, (uint8_t)0xD4U, (uint8_t)0xA4U, (uint8_t)0x0EU, (uint8_t)0x32U, (uint8_t)0x9CU, - (uint8_t)0xD0U, (uint8_t)0xE4U, (uint8_t)0x0EU, (uint8_t)0x65U, (uint8_t)0xFFU, (uint8_t)0xFFU, - (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU + 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xADU, 0xF8U, 0x54U, 0x58U, 0xA2U, + 0xBBU, 0x4AU, 0x9AU, 0xAFU, 0xDCU, 0x56U, 0x20U, 0x27U, 0x3DU, 0x3CU, 0xF1U, 0xD8U, 0xB9U, + 0xC5U, 0x83U, 0xCEU, 0x2DU, 0x36U, 0x95U, 0xA9U, 0xE1U, 0x36U, 0x41U, 0x14U, 0x64U, 0x33U, + 0xFBU, 0xCCU, 0x93U, 0x9DU, 0xCEU, 0x24U, 0x9BU, 0x3EU, 0xF9U, 0x7DU, 0x2FU, 0xE3U, 0x63U, + 0x63U, 0x0CU, 0x75U, 0xD8U, 0xF6U, 0x81U, 0xB2U, 0x02U, 0xAEU, 0xC4U, 0x61U, 0x7AU, 0xD3U, + 0xDFU, 0x1EU, 0xD5U, 0xD5U, 0xFDU, 0x65U, 0x61U, 0x24U, 0x33U, 0xF5U, 0x1FU, 0x5FU, 0x06U, + 0x6EU, 0xD0U, 0x85U, 0x63U, 0x65U, 0x55U, 0x3DU, 0xEDU, 0x1AU, 0xF3U, 0xB5U, 0x57U, 0x13U, + 0x5EU, 0x7FU, 0x57U, 0xC9U, 0x35U, 0x98U, 0x4FU, 0x0CU, 0x70U, 0xE0U, 0xE6U, 0x8BU, 0x77U, + 0xE2U, 0xA6U, 0x89U, 0xDAU, 0xF3U, 0xEFU, 0xE8U, 0x72U, 0x1DU, 0xF1U, 0x58U, 0xA1U, 0x36U, + 0xADU, 0xE7U, 0x35U, 0x30U, 0xACU, 0xCAU, 0x4FU, 0x48U, 0x3AU, 0x79U, 0x7AU, 0xBCU, 0x0AU, + 0xB1U, 0x82U, 0xB3U, 0x24U, 0xFBU, 0x61U, 0xD1U, 0x08U, 0xA9U, 0x4BU, 0xB2U, 0xC8U, 0xE3U, + 0xFBU, 0xB9U, 0x6AU, 0xDAU, 0xB7U, 0x60U, 0xD7U, 0xF4U, 0x68U, 0x1DU, 0x4FU, 0x42U, 0xA3U, + 0xDEU, 0x39U, 0x4DU, 0xF4U, 0xAEU, 0x56U, 0xEDU, 0xE7U, 0x63U, 0x72U, 0xBBU, 0x19U, 0x0BU, + 0x07U, 0xA7U, 0xC8U, 0xEEU, 0x0AU, 0x6DU, 0x70U, 0x9EU, 0x02U, 0xFCU, 0xE1U, 0xCDU, 0xF7U, + 0xE2U, 0xECU, 0xC0U, 0x34U, 0x04U, 0xCDU, 0x28U, 0x34U, 0x2FU, 0x61U, 0x91U, 0x72U, 0xFEU, + 0x9CU, 0xE9U, 0x85U, 0x83U, 0xFFU, 0x8EU, 0x4FU, 0x12U, 0x32U, 0xEEU, 0xF2U, 0x81U, 0x83U, + 0xC3U, 0xFEU, 0x3BU, 0x1BU, 0x4CU, 0x6FU, 0xADU, 0x73U, 0x3BU, 0xB5U, 0xFCU, 0xBCU, 0x2EU, + 0xC2U, 0x20U, 0x05U, 0xC5U, 0x8EU, 0xF1U, 0x83U, 0x7DU, 0x16U, 0x83U, 0xB2U, 0xC6U, 0xF3U, + 0x4AU, 0x26U, 0xC1U, 0xB2U, 0xEFU, 0xFAU, 0x88U, 0x6BU, 0x42U, 0x38U, 0x61U, 0x1FU, 0xCFU, + 0xDCU, 0xDEU, 0x35U, 0x5BU, 0x3BU, 0x65U, 0x19U, 0x03U, 0x5BU, 0xBCU, 0x34U, 0xF4U, 0xDEU, + 0xF9U, 0x9CU, 0x02U, 0x38U, 0x61U, 0xB4U, 0x6FU, 0xC9U, 0xD6U, 0xE6U, 0xC9U, 0x07U, 0x7AU, + 0xD9U, 0x1DU, 0x26U, 0x91U, 0xF7U, 0xF7U, 0xEEU, 0x59U, 0x8CU, 0xB0U, 0xFAU, 0xC1U, 0x86U, + 0xD9U, 0x1CU, 0xAEU, 0xFEU, 0x13U, 0x09U, 0x85U, 0x13U, 0x92U, 0x70U, 0xB4U, 0x13U, 0x0CU, + 0x93U, 0xBCU, 0x43U, 0x79U, 0x44U, 0xF4U, 0xFDU, 0x44U, 0x52U, 0xE2U, 0xD7U, 0x4DU, 0xD3U, + 0x64U, 0xF2U, 0xE2U, 0x1EU, 0x71U, 0xF5U, 0x4BU, 0xFFU, 0x5CU, 0xAEU, 0x82U, 0xABU, 0x9CU, + 0x9DU, 0xF6U, 0x9EU, 0xE8U, 0x6DU, 0x2BU, 0xC5U, 0x22U, 0x36U, 0x3AU, 0x0DU, 0xABU, 0xC5U, + 0x21U, 0x97U, 0x9BU, 0x0DU, 0xEAU, 0xDAU, 0x1DU, 0xBFU, 0x9AU, 0x42U, 0xD5U, 0xC4U, 0x48U, + 0x4EU, 0x0AU, 0xBCU, 0xD0U, 0x6BU, 0xFAU, 0x53U, 0xDDU, 0xEFU, 0x3CU, 0x1BU, 0x20U, 0xEEU, + 0x3FU, 0xD5U, 0x9DU, 0x7CU, 0x25U, 0xE4U, 0x1DU, 0x2BU, 0x66U, 0x9EU, 0x1EU, 0xF1U, 0x6EU, + 0x6FU, 0x52U, 0xC3U, 0x16U, 0x4DU, 0xF4U, 0xFBU, 0x79U, 0x30U, 0xE9U, 0xE4U, 0xE5U, 0x88U, + 0x57U, 0xB6U, 0xACU, 0x7DU, 0x5FU, 0x42U, 0xD6U, 0x9FU, 0x6DU, 0x18U, 0x77U, 0x63U, 0xCFU, + 0x1DU, 0x55U, 0x03U, 0x40U, 0x04U, 0x87U, 0xF5U, 0x5BU, 0xA5U, 0x7EU, 0x31U, 0xCCU, 0x7AU, + 0x71U, 0x35U, 0xC8U, 0x86U, 0xEFU, 0xB4U, 0x31U, 0x8AU, 0xEDU, 0x6AU, 0x1EU, 0x01U, 0x2DU, + 0x9EU, 0x68U, 0x32U, 0xA9U, 0x07U, 0x60U, 0x0AU, 0x91U, 0x81U, 0x30U, 0xC4U, 0x6DU, 0xC7U, + 0x78U, 0xF9U, 0x71U, 0xADU, 0x00U, 0x38U, 0x09U, 0x29U, 0x99U, 0xA3U, 0x33U, 0xCBU, 0x8BU, + 0x7AU, 0x1AU, 0x1DU, 0xB9U, 0x3DU, 0x71U, 0x40U, 0x00U, 0x3CU, 0x2AU, 0x4EU, 0xCEU, 0xA9U, + 0xF9U, 0x8DU, 0x0AU, 0xCCU, 0x0AU, 0x82U, 0x91U, 0xCDU, 0xCEU, 0xC9U, 0x7DU, 0xCFU, 0x8EU, + 0xC9U, 0xB5U, 0x5AU, 0x7FU, 0x88U, 0xA4U, 0x6BU, 0x4DU, 0xB5U, 0xA8U, 0x51U, 0xF4U, 0x41U, + 0x82U, 0xE1U, 0xC6U, 0x8AU, 0x00U, 0x7EU, 0x5EU, 0x0DU, 0xD9U, 0x02U, 0x0BU, 0xFDU, 0x64U, + 0xB6U, 0x45U, 0x03U, 0x6CU, 0x7AU, 0x4EU, 0x67U, 0x7DU, 0x2CU, 0x38U, 0x53U, 0x2AU, 0x3AU, + 0x23U, 0xBAU, 0x44U, 0x42U, 0xCAU, 0xF5U, 0x3EU, 0xA6U, 0x3BU, 0xB4U, 0x54U, 0x32U, 0x9BU, + 0x76U, 0x24U, 0xC8U, 0x91U, 0x7BU, 0xDDU, 0x64U, 0xB1U, 0xC0U, 0xFDU, 0x4CU, 0xB3U, 0x8EU, + 0x8CU, 0x33U, 0x4CU, 0x70U, 0x1CU, 0x3AU, 0xCDU, 0xADU, 0x06U, 0x57U, 0xFCU, 0xCFU, 0xECU, + 0x71U, 0x9BU, 0x1FU, 0x5CU, 0x3EU, 0x4EU, 0x46U, 0x04U, 0x1FU, 0x38U, 0x81U, 0x47U, 0xFBU, + 0x4CU, 0xFDU, 0xB4U, 0x77U, 0xA5U, 0x24U, 0x71U, 0xF7U, 0xA9U, 0xA9U, 0x69U, 0x10U, 0xB8U, + 0x55U, 0x32U, 0x2EU, 0xDBU, 0x63U, 0x40U, 0xD8U, 0xA0U, 0x0EU, 0xF0U, 0x92U, 0x35U, 0x05U, + 0x11U, 0xE3U, 0x0AU, 0xBEU, 0xC1U, 0xFFU, 0xF9U, 0xE3U, 0xA2U, 0x6EU, 0x7FU, 0xB2U, 0x9FU, + 0x8CU, 0x18U, 0x30U, 0x23U, 0xC3U, 0x58U, 0x7EU, 0x38U, 0xDAU, 0x00U, 0x77U, 0xD9U, 0xB4U, + 0x76U, 0x3EU, 0x4EU, 0x4BU, 0x94U, 0xB2U, 0xBBU, 0xC1U, 0x94U, 0xC6U, 0x65U, 0x1EU, 0x77U, + 0xCAU, 0xF9U, 0x92U, 0xEEU, 0xAAU, 0xC0U, 0x23U, 0x2AU, 0x28U, 0x1BU, 0xF6U, 0xB3U, 0xA7U, + 0x39U, 0xC1U, 0x22U, 0x61U, 0x16U, 0x82U, 0x0AU, 0xE8U, 0xDBU, 0x58U, 0x47U, 0xA6U, 0x7CU, + 0xBEU, 0xF9U, 0xC9U, 0x09U, 0x1BU, 0x46U, 0x2DU, 0x53U, 0x8CU, 0xD7U, 0x2BU, 0x03U, 0x74U, + 0x6AU, 0xE7U, 0x7FU, 0x5EU, 0x62U, 0x29U, 0x2CU, 0x31U, 0x15U, 0x62U, 0xA8U, 0x46U, 0x50U, + 0x5DU, 0xC8U, 0x2DU, 0xB8U, 0x54U, 0x33U, 0x8AU, 0xE4U, 0x9FU, 0x52U, 0x35U, 0xC9U, 0x5BU, + 0x91U, 0x17U, 0x8CU, 0xCFU, 0x2DU, 0xD5U, 0xCAU, 0xCEU, 0xF4U, 0x03U, 0xECU, 0x9DU, 0x18U, + 0x10U, 0xC6U, 0x27U, 0x2BU, 0x04U, 0x5BU, 0x3BU, 0x71U, 0xF9U, 0xDCU, 0x6BU, 0x80U, 0xD6U, + 0x3FU, 0xDDU, 0x4AU, 0x8EU, 0x9AU, 0xDBU, 0x1EU, 0x69U, 0x62U, 0xA6U, 0x95U, 0x26U, 0xD4U, + 0x31U, 0x61U, 0xC1U, 0xA4U, 0x1DU, 0x57U, 0x0DU, 0x79U, 0x38U, 0xDAU, 0xD4U, 0xA4U, 0x0EU, + 0x32U, 0x9CU, 0xD0U, 0xE4U, 0x0EU, 0x65U, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, + 0xFFU }; static const uint8_t Hacl_Impl_FFDHE_Constants_ffdhe_p8192[1024U] = { - (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, - (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xADU, (uint8_t)0xF8U, (uint8_t)0x54U, (uint8_t)0x58U, - (uint8_t)0xA2U, (uint8_t)0xBBU, (uint8_t)0x4AU, (uint8_t)0x9AU, (uint8_t)0xAFU, (uint8_t)0xDCU, - (uint8_t)0x56U, (uint8_t)0x20U, (uint8_t)0x27U, (uint8_t)0x3DU, (uint8_t)0x3CU, (uint8_t)0xF1U, - (uint8_t)0xD8U, (uint8_t)0xB9U, (uint8_t)0xC5U, (uint8_t)0x83U, (uint8_t)0xCEU, (uint8_t)0x2DU, - (uint8_t)0x36U, (uint8_t)0x95U, (uint8_t)0xA9U, (uint8_t)0xE1U, (uint8_t)0x36U, (uint8_t)0x41U, - (uint8_t)0x14U, (uint8_t)0x64U, (uint8_t)0x33U, (uint8_t)0xFBU, (uint8_t)0xCCU, (uint8_t)0x93U, - (uint8_t)0x9DU, (uint8_t)0xCEU, (uint8_t)0x24U, (uint8_t)0x9BU, (uint8_t)0x3EU, (uint8_t)0xF9U, - (uint8_t)0x7DU, (uint8_t)0x2FU, (uint8_t)0xE3U, (uint8_t)0x63U, (uint8_t)0x63U, (uint8_t)0x0CU, - (uint8_t)0x75U, (uint8_t)0xD8U, (uint8_t)0xF6U, (uint8_t)0x81U, (uint8_t)0xB2U, (uint8_t)0x02U, - (uint8_t)0xAEU, (uint8_t)0xC4U, (uint8_t)0x61U, (uint8_t)0x7AU, (uint8_t)0xD3U, (uint8_t)0xDFU, - (uint8_t)0x1EU, (uint8_t)0xD5U, (uint8_t)0xD5U, (uint8_t)0xFDU, (uint8_t)0x65U, (uint8_t)0x61U, - (uint8_t)0x24U, (uint8_t)0x33U, (uint8_t)0xF5U, (uint8_t)0x1FU, (uint8_t)0x5FU, (uint8_t)0x06U, - (uint8_t)0x6EU, (uint8_t)0xD0U, (uint8_t)0x85U, (uint8_t)0x63U, (uint8_t)0x65U, (uint8_t)0x55U, - (uint8_t)0x3DU, (uint8_t)0xEDU, (uint8_t)0x1AU, (uint8_t)0xF3U, (uint8_t)0xB5U, (uint8_t)0x57U, - (uint8_t)0x13U, (uint8_t)0x5EU, (uint8_t)0x7FU, (uint8_t)0x57U, (uint8_t)0xC9U, (uint8_t)0x35U, - (uint8_t)0x98U, (uint8_t)0x4FU, (uint8_t)0x0CU, (uint8_t)0x70U, (uint8_t)0xE0U, (uint8_t)0xE6U, - (uint8_t)0x8BU, (uint8_t)0x77U, (uint8_t)0xE2U, (uint8_t)0xA6U, (uint8_t)0x89U, (uint8_t)0xDAU, - (uint8_t)0xF3U, (uint8_t)0xEFU, (uint8_t)0xE8U, (uint8_t)0x72U, (uint8_t)0x1DU, (uint8_t)0xF1U, - (uint8_t)0x58U, (uint8_t)0xA1U, (uint8_t)0x36U, (uint8_t)0xADU, (uint8_t)0xE7U, (uint8_t)0x35U, - (uint8_t)0x30U, (uint8_t)0xACU, (uint8_t)0xCAU, (uint8_t)0x4FU, (uint8_t)0x48U, (uint8_t)0x3AU, - (uint8_t)0x79U, (uint8_t)0x7AU, (uint8_t)0xBCU, (uint8_t)0x0AU, (uint8_t)0xB1U, (uint8_t)0x82U, - (uint8_t)0xB3U, (uint8_t)0x24U, (uint8_t)0xFBU, (uint8_t)0x61U, (uint8_t)0xD1U, (uint8_t)0x08U, - (uint8_t)0xA9U, (uint8_t)0x4BU, (uint8_t)0xB2U, (uint8_t)0xC8U, (uint8_t)0xE3U, (uint8_t)0xFBU, - (uint8_t)0xB9U, (uint8_t)0x6AU, (uint8_t)0xDAU, (uint8_t)0xB7U, (uint8_t)0x60U, (uint8_t)0xD7U, - (uint8_t)0xF4U, (uint8_t)0x68U, (uint8_t)0x1DU, (uint8_t)0x4FU, (uint8_t)0x42U, (uint8_t)0xA3U, - (uint8_t)0xDEU, (uint8_t)0x39U, (uint8_t)0x4DU, (uint8_t)0xF4U, (uint8_t)0xAEU, (uint8_t)0x56U, - (uint8_t)0xEDU, (uint8_t)0xE7U, (uint8_t)0x63U, (uint8_t)0x72U, (uint8_t)0xBBU, (uint8_t)0x19U, - (uint8_t)0x0BU, (uint8_t)0x07U, (uint8_t)0xA7U, (uint8_t)0xC8U, (uint8_t)0xEEU, (uint8_t)0x0AU, - (uint8_t)0x6DU, (uint8_t)0x70U, (uint8_t)0x9EU, (uint8_t)0x02U, (uint8_t)0xFCU, (uint8_t)0xE1U, - (uint8_t)0xCDU, (uint8_t)0xF7U, (uint8_t)0xE2U, (uint8_t)0xECU, (uint8_t)0xC0U, (uint8_t)0x34U, - (uint8_t)0x04U, (uint8_t)0xCDU, (uint8_t)0x28U, (uint8_t)0x34U, (uint8_t)0x2FU, (uint8_t)0x61U, - (uint8_t)0x91U, (uint8_t)0x72U, (uint8_t)0xFEU, (uint8_t)0x9CU, (uint8_t)0xE9U, (uint8_t)0x85U, - (uint8_t)0x83U, (uint8_t)0xFFU, (uint8_t)0x8EU, (uint8_t)0x4FU, (uint8_t)0x12U, (uint8_t)0x32U, - (uint8_t)0xEEU, (uint8_t)0xF2U, (uint8_t)0x81U, (uint8_t)0x83U, (uint8_t)0xC3U, (uint8_t)0xFEU, - (uint8_t)0x3BU, (uint8_t)0x1BU, (uint8_t)0x4CU, (uint8_t)0x6FU, (uint8_t)0xADU, (uint8_t)0x73U, - (uint8_t)0x3BU, (uint8_t)0xB5U, (uint8_t)0xFCU, (uint8_t)0xBCU, (uint8_t)0x2EU, (uint8_t)0xC2U, - (uint8_t)0x20U, (uint8_t)0x05U, (uint8_t)0xC5U, (uint8_t)0x8EU, (uint8_t)0xF1U, (uint8_t)0x83U, - (uint8_t)0x7DU, (uint8_t)0x16U, (uint8_t)0x83U, (uint8_t)0xB2U, (uint8_t)0xC6U, (uint8_t)0xF3U, - (uint8_t)0x4AU, (uint8_t)0x26U, (uint8_t)0xC1U, (uint8_t)0xB2U, (uint8_t)0xEFU, (uint8_t)0xFAU, - (uint8_t)0x88U, (uint8_t)0x6BU, (uint8_t)0x42U, (uint8_t)0x38U, (uint8_t)0x61U, (uint8_t)0x1FU, - (uint8_t)0xCFU, (uint8_t)0xDCU, (uint8_t)0xDEU, (uint8_t)0x35U, (uint8_t)0x5BU, (uint8_t)0x3BU, - (uint8_t)0x65U, (uint8_t)0x19U, (uint8_t)0x03U, (uint8_t)0x5BU, (uint8_t)0xBCU, (uint8_t)0x34U, - (uint8_t)0xF4U, (uint8_t)0xDEU, (uint8_t)0xF9U, (uint8_t)0x9CU, (uint8_t)0x02U, (uint8_t)0x38U, - (uint8_t)0x61U, (uint8_t)0xB4U, (uint8_t)0x6FU, (uint8_t)0xC9U, (uint8_t)0xD6U, (uint8_t)0xE6U, - (uint8_t)0xC9U, (uint8_t)0x07U, (uint8_t)0x7AU, (uint8_t)0xD9U, (uint8_t)0x1DU, (uint8_t)0x26U, - (uint8_t)0x91U, (uint8_t)0xF7U, (uint8_t)0xF7U, (uint8_t)0xEEU, (uint8_t)0x59U, (uint8_t)0x8CU, - (uint8_t)0xB0U, (uint8_t)0xFAU, (uint8_t)0xC1U, (uint8_t)0x86U, (uint8_t)0xD9U, (uint8_t)0x1CU, - (uint8_t)0xAEU, (uint8_t)0xFEU, (uint8_t)0x13U, (uint8_t)0x09U, (uint8_t)0x85U, (uint8_t)0x13U, - (uint8_t)0x92U, (uint8_t)0x70U, (uint8_t)0xB4U, (uint8_t)0x13U, (uint8_t)0x0CU, (uint8_t)0x93U, - (uint8_t)0xBCU, (uint8_t)0x43U, (uint8_t)0x79U, (uint8_t)0x44U, (uint8_t)0xF4U, (uint8_t)0xFDU, - (uint8_t)0x44U, (uint8_t)0x52U, (uint8_t)0xE2U, (uint8_t)0xD7U, (uint8_t)0x4DU, (uint8_t)0xD3U, - (uint8_t)0x64U, (uint8_t)0xF2U, (uint8_t)0xE2U, (uint8_t)0x1EU, (uint8_t)0x71U, (uint8_t)0xF5U, - (uint8_t)0x4BU, (uint8_t)0xFFU, (uint8_t)0x5CU, (uint8_t)0xAEU, (uint8_t)0x82U, (uint8_t)0xABU, - (uint8_t)0x9CU, (uint8_t)0x9DU, (uint8_t)0xF6U, (uint8_t)0x9EU, (uint8_t)0xE8U, (uint8_t)0x6DU, - (uint8_t)0x2BU, (uint8_t)0xC5U, (uint8_t)0x22U, (uint8_t)0x36U, (uint8_t)0x3AU, (uint8_t)0x0DU, - (uint8_t)0xABU, (uint8_t)0xC5U, (uint8_t)0x21U, (uint8_t)0x97U, (uint8_t)0x9BU, (uint8_t)0x0DU, - (uint8_t)0xEAU, (uint8_t)0xDAU, (uint8_t)0x1DU, (uint8_t)0xBFU, (uint8_t)0x9AU, (uint8_t)0x42U, - (uint8_t)0xD5U, (uint8_t)0xC4U, (uint8_t)0x48U, (uint8_t)0x4EU, (uint8_t)0x0AU, (uint8_t)0xBCU, - (uint8_t)0xD0U, (uint8_t)0x6BU, (uint8_t)0xFAU, (uint8_t)0x53U, (uint8_t)0xDDU, (uint8_t)0xEFU, - (uint8_t)0x3CU, (uint8_t)0x1BU, (uint8_t)0x20U, (uint8_t)0xEEU, (uint8_t)0x3FU, (uint8_t)0xD5U, - (uint8_t)0x9DU, (uint8_t)0x7CU, (uint8_t)0x25U, (uint8_t)0xE4U, (uint8_t)0x1DU, (uint8_t)0x2BU, - (uint8_t)0x66U, (uint8_t)0x9EU, (uint8_t)0x1EU, (uint8_t)0xF1U, (uint8_t)0x6EU, (uint8_t)0x6FU, - (uint8_t)0x52U, (uint8_t)0xC3U, (uint8_t)0x16U, (uint8_t)0x4DU, (uint8_t)0xF4U, (uint8_t)0xFBU, - (uint8_t)0x79U, (uint8_t)0x30U, (uint8_t)0xE9U, (uint8_t)0xE4U, (uint8_t)0xE5U, (uint8_t)0x88U, - (uint8_t)0x57U, (uint8_t)0xB6U, (uint8_t)0xACU, (uint8_t)0x7DU, (uint8_t)0x5FU, (uint8_t)0x42U, - (uint8_t)0xD6U, (uint8_t)0x9FU, (uint8_t)0x6DU, (uint8_t)0x18U, (uint8_t)0x77U, (uint8_t)0x63U, - (uint8_t)0xCFU, (uint8_t)0x1DU, (uint8_t)0x55U, (uint8_t)0x03U, (uint8_t)0x40U, (uint8_t)0x04U, - (uint8_t)0x87U, (uint8_t)0xF5U, (uint8_t)0x5BU, (uint8_t)0xA5U, (uint8_t)0x7EU, (uint8_t)0x31U, - (uint8_t)0xCCU, (uint8_t)0x7AU, (uint8_t)0x71U, (uint8_t)0x35U, (uint8_t)0xC8U, (uint8_t)0x86U, - (uint8_t)0xEFU, (uint8_t)0xB4U, (uint8_t)0x31U, (uint8_t)0x8AU, (uint8_t)0xEDU, (uint8_t)0x6AU, - (uint8_t)0x1EU, (uint8_t)0x01U, (uint8_t)0x2DU, (uint8_t)0x9EU, (uint8_t)0x68U, (uint8_t)0x32U, - (uint8_t)0xA9U, (uint8_t)0x07U, (uint8_t)0x60U, (uint8_t)0x0AU, (uint8_t)0x91U, (uint8_t)0x81U, - (uint8_t)0x30U, (uint8_t)0xC4U, (uint8_t)0x6DU, (uint8_t)0xC7U, (uint8_t)0x78U, (uint8_t)0xF9U, - (uint8_t)0x71U, (uint8_t)0xADU, (uint8_t)0x00U, (uint8_t)0x38U, (uint8_t)0x09U, (uint8_t)0x29U, - (uint8_t)0x99U, (uint8_t)0xA3U, (uint8_t)0x33U, (uint8_t)0xCBU, (uint8_t)0x8BU, (uint8_t)0x7AU, - (uint8_t)0x1AU, (uint8_t)0x1DU, (uint8_t)0xB9U, (uint8_t)0x3DU, (uint8_t)0x71U, (uint8_t)0x40U, - (uint8_t)0x00U, (uint8_t)0x3CU, (uint8_t)0x2AU, (uint8_t)0x4EU, (uint8_t)0xCEU, (uint8_t)0xA9U, - (uint8_t)0xF9U, (uint8_t)0x8DU, (uint8_t)0x0AU, (uint8_t)0xCCU, (uint8_t)0x0AU, (uint8_t)0x82U, - (uint8_t)0x91U, (uint8_t)0xCDU, (uint8_t)0xCEU, (uint8_t)0xC9U, (uint8_t)0x7DU, (uint8_t)0xCFU, - (uint8_t)0x8EU, (uint8_t)0xC9U, (uint8_t)0xB5U, (uint8_t)0x5AU, (uint8_t)0x7FU, (uint8_t)0x88U, - (uint8_t)0xA4U, (uint8_t)0x6BU, (uint8_t)0x4DU, (uint8_t)0xB5U, (uint8_t)0xA8U, (uint8_t)0x51U, - (uint8_t)0xF4U, (uint8_t)0x41U, (uint8_t)0x82U, (uint8_t)0xE1U, (uint8_t)0xC6U, (uint8_t)0x8AU, - (uint8_t)0x00U, (uint8_t)0x7EU, (uint8_t)0x5EU, (uint8_t)0x0DU, (uint8_t)0xD9U, (uint8_t)0x02U, - (uint8_t)0x0BU, (uint8_t)0xFDU, (uint8_t)0x64U, (uint8_t)0xB6U, (uint8_t)0x45U, (uint8_t)0x03U, - (uint8_t)0x6CU, (uint8_t)0x7AU, (uint8_t)0x4EU, (uint8_t)0x67U, (uint8_t)0x7DU, (uint8_t)0x2CU, - (uint8_t)0x38U, (uint8_t)0x53U, (uint8_t)0x2AU, (uint8_t)0x3AU, (uint8_t)0x23U, (uint8_t)0xBAU, - (uint8_t)0x44U, (uint8_t)0x42U, (uint8_t)0xCAU, (uint8_t)0xF5U, (uint8_t)0x3EU, (uint8_t)0xA6U, - (uint8_t)0x3BU, (uint8_t)0xB4U, (uint8_t)0x54U, (uint8_t)0x32U, (uint8_t)0x9BU, (uint8_t)0x76U, - (uint8_t)0x24U, (uint8_t)0xC8U, (uint8_t)0x91U, (uint8_t)0x7BU, (uint8_t)0xDDU, (uint8_t)0x64U, - (uint8_t)0xB1U, (uint8_t)0xC0U, (uint8_t)0xFDU, (uint8_t)0x4CU, (uint8_t)0xB3U, (uint8_t)0x8EU, - (uint8_t)0x8CU, (uint8_t)0x33U, (uint8_t)0x4CU, (uint8_t)0x70U, (uint8_t)0x1CU, (uint8_t)0x3AU, - (uint8_t)0xCDU, (uint8_t)0xADU, (uint8_t)0x06U, (uint8_t)0x57U, (uint8_t)0xFCU, (uint8_t)0xCFU, - (uint8_t)0xECU, (uint8_t)0x71U, (uint8_t)0x9BU, (uint8_t)0x1FU, (uint8_t)0x5CU, (uint8_t)0x3EU, - (uint8_t)0x4EU, (uint8_t)0x46U, (uint8_t)0x04U, (uint8_t)0x1FU, (uint8_t)0x38U, (uint8_t)0x81U, - (uint8_t)0x47U, (uint8_t)0xFBU, (uint8_t)0x4CU, (uint8_t)0xFDU, (uint8_t)0xB4U, (uint8_t)0x77U, - (uint8_t)0xA5U, (uint8_t)0x24U, (uint8_t)0x71U, (uint8_t)0xF7U, (uint8_t)0xA9U, (uint8_t)0xA9U, - (uint8_t)0x69U, (uint8_t)0x10U, (uint8_t)0xB8U, (uint8_t)0x55U, (uint8_t)0x32U, (uint8_t)0x2EU, - (uint8_t)0xDBU, (uint8_t)0x63U, (uint8_t)0x40U, (uint8_t)0xD8U, (uint8_t)0xA0U, (uint8_t)0x0EU, - (uint8_t)0xF0U, (uint8_t)0x92U, (uint8_t)0x35U, (uint8_t)0x05U, (uint8_t)0x11U, (uint8_t)0xE3U, - (uint8_t)0x0AU, (uint8_t)0xBEU, (uint8_t)0xC1U, (uint8_t)0xFFU, (uint8_t)0xF9U, (uint8_t)0xE3U, - (uint8_t)0xA2U, (uint8_t)0x6EU, (uint8_t)0x7FU, (uint8_t)0xB2U, (uint8_t)0x9FU, (uint8_t)0x8CU, - (uint8_t)0x18U, (uint8_t)0x30U, (uint8_t)0x23U, (uint8_t)0xC3U, (uint8_t)0x58U, (uint8_t)0x7EU, - (uint8_t)0x38U, (uint8_t)0xDAU, (uint8_t)0x00U, (uint8_t)0x77U, (uint8_t)0xD9U, (uint8_t)0xB4U, - (uint8_t)0x76U, (uint8_t)0x3EU, (uint8_t)0x4EU, (uint8_t)0x4BU, (uint8_t)0x94U, (uint8_t)0xB2U, - (uint8_t)0xBBU, (uint8_t)0xC1U, (uint8_t)0x94U, (uint8_t)0xC6U, (uint8_t)0x65U, (uint8_t)0x1EU, - (uint8_t)0x77U, (uint8_t)0xCAU, (uint8_t)0xF9U, (uint8_t)0x92U, (uint8_t)0xEEU, (uint8_t)0xAAU, - (uint8_t)0xC0U, (uint8_t)0x23U, (uint8_t)0x2AU, (uint8_t)0x28U, (uint8_t)0x1BU, (uint8_t)0xF6U, - (uint8_t)0xB3U, (uint8_t)0xA7U, (uint8_t)0x39U, (uint8_t)0xC1U, (uint8_t)0x22U, (uint8_t)0x61U, - (uint8_t)0x16U, (uint8_t)0x82U, (uint8_t)0x0AU, (uint8_t)0xE8U, (uint8_t)0xDBU, (uint8_t)0x58U, - (uint8_t)0x47U, (uint8_t)0xA6U, (uint8_t)0x7CU, (uint8_t)0xBEU, (uint8_t)0xF9U, (uint8_t)0xC9U, - (uint8_t)0x09U, (uint8_t)0x1BU, (uint8_t)0x46U, (uint8_t)0x2DU, (uint8_t)0x53U, (uint8_t)0x8CU, - (uint8_t)0xD7U, (uint8_t)0x2BU, (uint8_t)0x03U, (uint8_t)0x74U, (uint8_t)0x6AU, (uint8_t)0xE7U, - (uint8_t)0x7FU, (uint8_t)0x5EU, (uint8_t)0x62U, (uint8_t)0x29U, (uint8_t)0x2CU, (uint8_t)0x31U, - (uint8_t)0x15U, (uint8_t)0x62U, (uint8_t)0xA8U, (uint8_t)0x46U, (uint8_t)0x50U, (uint8_t)0x5DU, - (uint8_t)0xC8U, (uint8_t)0x2DU, (uint8_t)0xB8U, (uint8_t)0x54U, (uint8_t)0x33U, (uint8_t)0x8AU, - (uint8_t)0xE4U, (uint8_t)0x9FU, (uint8_t)0x52U, (uint8_t)0x35U, (uint8_t)0xC9U, (uint8_t)0x5BU, - (uint8_t)0x91U, (uint8_t)0x17U, (uint8_t)0x8CU, (uint8_t)0xCFU, (uint8_t)0x2DU, (uint8_t)0xD5U, - (uint8_t)0xCAU, (uint8_t)0xCEU, (uint8_t)0xF4U, (uint8_t)0x03U, (uint8_t)0xECU, (uint8_t)0x9DU, - (uint8_t)0x18U, (uint8_t)0x10U, (uint8_t)0xC6U, (uint8_t)0x27U, (uint8_t)0x2BU, (uint8_t)0x04U, - (uint8_t)0x5BU, (uint8_t)0x3BU, (uint8_t)0x71U, (uint8_t)0xF9U, (uint8_t)0xDCU, (uint8_t)0x6BU, - (uint8_t)0x80U, (uint8_t)0xD6U, (uint8_t)0x3FU, (uint8_t)0xDDU, (uint8_t)0x4AU, (uint8_t)0x8EU, - (uint8_t)0x9AU, (uint8_t)0xDBU, (uint8_t)0x1EU, (uint8_t)0x69U, (uint8_t)0x62U, (uint8_t)0xA6U, - (uint8_t)0x95U, (uint8_t)0x26U, (uint8_t)0xD4U, (uint8_t)0x31U, (uint8_t)0x61U, (uint8_t)0xC1U, - (uint8_t)0xA4U, (uint8_t)0x1DU, (uint8_t)0x57U, (uint8_t)0x0DU, (uint8_t)0x79U, (uint8_t)0x38U, - (uint8_t)0xDAU, (uint8_t)0xD4U, (uint8_t)0xA4U, (uint8_t)0x0EU, (uint8_t)0x32U, (uint8_t)0x9CU, - (uint8_t)0xCFU, (uint8_t)0xF4U, (uint8_t)0x6AU, (uint8_t)0xAAU, (uint8_t)0x36U, (uint8_t)0xADU, - (uint8_t)0x00U, (uint8_t)0x4CU, (uint8_t)0xF6U, (uint8_t)0x00U, (uint8_t)0xC8U, (uint8_t)0x38U, - (uint8_t)0x1EU, (uint8_t)0x42U, (uint8_t)0x5AU, (uint8_t)0x31U, (uint8_t)0xD9U, (uint8_t)0x51U, - (uint8_t)0xAEU, (uint8_t)0x64U, (uint8_t)0xFDU, (uint8_t)0xB2U, (uint8_t)0x3FU, (uint8_t)0xCEU, - (uint8_t)0xC9U, (uint8_t)0x50U, (uint8_t)0x9DU, (uint8_t)0x43U, (uint8_t)0x68U, (uint8_t)0x7FU, - (uint8_t)0xEBU, (uint8_t)0x69U, (uint8_t)0xEDU, (uint8_t)0xD1U, (uint8_t)0xCCU, (uint8_t)0x5EU, - (uint8_t)0x0BU, (uint8_t)0x8CU, (uint8_t)0xC3U, (uint8_t)0xBDU, (uint8_t)0xF6U, (uint8_t)0x4BU, - (uint8_t)0x10U, (uint8_t)0xEFU, (uint8_t)0x86U, (uint8_t)0xB6U, (uint8_t)0x31U, (uint8_t)0x42U, - (uint8_t)0xA3U, (uint8_t)0xABU, (uint8_t)0x88U, (uint8_t)0x29U, (uint8_t)0x55U, (uint8_t)0x5BU, - (uint8_t)0x2FU, (uint8_t)0x74U, (uint8_t)0x7CU, (uint8_t)0x93U, (uint8_t)0x26U, (uint8_t)0x65U, - (uint8_t)0xCBU, (uint8_t)0x2CU, (uint8_t)0x0FU, (uint8_t)0x1CU, (uint8_t)0xC0U, (uint8_t)0x1BU, - (uint8_t)0xD7U, (uint8_t)0x02U, (uint8_t)0x29U, (uint8_t)0x38U, (uint8_t)0x88U, (uint8_t)0x39U, - (uint8_t)0xD2U, (uint8_t)0xAFU, (uint8_t)0x05U, (uint8_t)0xE4U, (uint8_t)0x54U, (uint8_t)0x50U, - (uint8_t)0x4AU, (uint8_t)0xC7U, (uint8_t)0x8BU, (uint8_t)0x75U, (uint8_t)0x82U, (uint8_t)0x82U, - (uint8_t)0x28U, (uint8_t)0x46U, (uint8_t)0xC0U, (uint8_t)0xBAU, (uint8_t)0x35U, (uint8_t)0xC3U, - (uint8_t)0x5FU, (uint8_t)0x5CU, (uint8_t)0x59U, (uint8_t)0x16U, (uint8_t)0x0CU, (uint8_t)0xC0U, - (uint8_t)0x46U, (uint8_t)0xFDU, (uint8_t)0x82U, (uint8_t)0x51U, (uint8_t)0x54U, (uint8_t)0x1FU, - (uint8_t)0xC6U, (uint8_t)0x8CU, (uint8_t)0x9CU, (uint8_t)0x86U, (uint8_t)0xB0U, (uint8_t)0x22U, - (uint8_t)0xBBU, (uint8_t)0x70U, (uint8_t)0x99U, (uint8_t)0x87U, (uint8_t)0x6AU, (uint8_t)0x46U, - (uint8_t)0x0EU, (uint8_t)0x74U, (uint8_t)0x51U, (uint8_t)0xA8U, (uint8_t)0xA9U, (uint8_t)0x31U, - (uint8_t)0x09U, (uint8_t)0x70U, (uint8_t)0x3FU, (uint8_t)0xEEU, (uint8_t)0x1CU, (uint8_t)0x21U, - (uint8_t)0x7EU, (uint8_t)0x6CU, (uint8_t)0x38U, (uint8_t)0x26U, (uint8_t)0xE5U, (uint8_t)0x2CU, - (uint8_t)0x51U, (uint8_t)0xAAU, (uint8_t)0x69U, (uint8_t)0x1EU, (uint8_t)0x0EU, (uint8_t)0x42U, - (uint8_t)0x3CU, (uint8_t)0xFCU, (uint8_t)0x99U, (uint8_t)0xE9U, (uint8_t)0xE3U, (uint8_t)0x16U, - (uint8_t)0x50U, (uint8_t)0xC1U, (uint8_t)0x21U, (uint8_t)0x7BU, (uint8_t)0x62U, (uint8_t)0x48U, - (uint8_t)0x16U, (uint8_t)0xCDU, (uint8_t)0xADU, (uint8_t)0x9AU, (uint8_t)0x95U, (uint8_t)0xF9U, - (uint8_t)0xD5U, (uint8_t)0xB8U, (uint8_t)0x01U, (uint8_t)0x94U, (uint8_t)0x88U, (uint8_t)0xD9U, - (uint8_t)0xC0U, (uint8_t)0xA0U, (uint8_t)0xA1U, (uint8_t)0xFEU, (uint8_t)0x30U, (uint8_t)0x75U, - (uint8_t)0xA5U, (uint8_t)0x77U, (uint8_t)0xE2U, (uint8_t)0x31U, (uint8_t)0x83U, (uint8_t)0xF8U, - (uint8_t)0x1DU, (uint8_t)0x4AU, (uint8_t)0x3FU, (uint8_t)0x2FU, (uint8_t)0xA4U, (uint8_t)0x57U, - (uint8_t)0x1EU, (uint8_t)0xFCU, (uint8_t)0x8CU, (uint8_t)0xE0U, (uint8_t)0xBAU, (uint8_t)0x8AU, - (uint8_t)0x4FU, (uint8_t)0xE8U, (uint8_t)0xB6U, (uint8_t)0x85U, (uint8_t)0x5DU, (uint8_t)0xFEU, - (uint8_t)0x72U, (uint8_t)0xB0U, (uint8_t)0xA6U, (uint8_t)0x6EU, (uint8_t)0xDEU, (uint8_t)0xD2U, - (uint8_t)0xFBU, (uint8_t)0xABU, (uint8_t)0xFBU, (uint8_t)0xE5U, (uint8_t)0x8AU, (uint8_t)0x30U, - (uint8_t)0xFAU, (uint8_t)0xFAU, (uint8_t)0xBEU, (uint8_t)0x1CU, (uint8_t)0x5DU, (uint8_t)0x71U, - (uint8_t)0xA8U, (uint8_t)0x7EU, (uint8_t)0x2FU, (uint8_t)0x74U, (uint8_t)0x1EU, (uint8_t)0xF8U, - (uint8_t)0xC1U, (uint8_t)0xFEU, (uint8_t)0x86U, (uint8_t)0xFEU, (uint8_t)0xA6U, (uint8_t)0xBBU, - (uint8_t)0xFDU, (uint8_t)0xE5U, (uint8_t)0x30U, (uint8_t)0x67U, (uint8_t)0x7FU, (uint8_t)0x0DU, - (uint8_t)0x97U, (uint8_t)0xD1U, (uint8_t)0x1DU, (uint8_t)0x49U, (uint8_t)0xF7U, (uint8_t)0xA8U, - (uint8_t)0x44U, (uint8_t)0x3DU, (uint8_t)0x08U, (uint8_t)0x22U, (uint8_t)0xE5U, (uint8_t)0x06U, - (uint8_t)0xA9U, (uint8_t)0xF4U, (uint8_t)0x61U, (uint8_t)0x4EU, (uint8_t)0x01U, (uint8_t)0x1EU, - (uint8_t)0x2AU, (uint8_t)0x94U, (uint8_t)0x83U, (uint8_t)0x8FU, (uint8_t)0xF8U, (uint8_t)0x8CU, - (uint8_t)0xD6U, (uint8_t)0x8CU, (uint8_t)0x8BU, (uint8_t)0xB7U, (uint8_t)0xC5U, (uint8_t)0xC6U, - (uint8_t)0x42U, (uint8_t)0x4CU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, - (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU, (uint8_t)0xFFU + 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xADU, 0xF8U, 0x54U, 0x58U, 0xA2U, + 0xBBU, 0x4AU, 0x9AU, 0xAFU, 0xDCU, 0x56U, 0x20U, 0x27U, 0x3DU, 0x3CU, 0xF1U, 0xD8U, 0xB9U, + 0xC5U, 0x83U, 0xCEU, 0x2DU, 0x36U, 0x95U, 0xA9U, 0xE1U, 0x36U, 0x41U, 0x14U, 0x64U, 0x33U, + 0xFBU, 0xCCU, 0x93U, 0x9DU, 0xCEU, 0x24U, 0x9BU, 0x3EU, 0xF9U, 0x7DU, 0x2FU, 0xE3U, 0x63U, + 0x63U, 0x0CU, 0x75U, 0xD8U, 0xF6U, 0x81U, 0xB2U, 0x02U, 0xAEU, 0xC4U, 0x61U, 0x7AU, 0xD3U, + 0xDFU, 0x1EU, 0xD5U, 0xD5U, 0xFDU, 0x65U, 0x61U, 0x24U, 0x33U, 0xF5U, 0x1FU, 0x5FU, 0x06U, + 0x6EU, 0xD0U, 0x85U, 0x63U, 0x65U, 0x55U, 0x3DU, 0xEDU, 0x1AU, 0xF3U, 0xB5U, 0x57U, 0x13U, + 0x5EU, 0x7FU, 0x57U, 0xC9U, 0x35U, 0x98U, 0x4FU, 0x0CU, 0x70U, 0xE0U, 0xE6U, 0x8BU, 0x77U, + 0xE2U, 0xA6U, 0x89U, 0xDAU, 0xF3U, 0xEFU, 0xE8U, 0x72U, 0x1DU, 0xF1U, 0x58U, 0xA1U, 0x36U, + 0xADU, 0xE7U, 0x35U, 0x30U, 0xACU, 0xCAU, 0x4FU, 0x48U, 0x3AU, 0x79U, 0x7AU, 0xBCU, 0x0AU, + 0xB1U, 0x82U, 0xB3U, 0x24U, 0xFBU, 0x61U, 0xD1U, 0x08U, 0xA9U, 0x4BU, 0xB2U, 0xC8U, 0xE3U, + 0xFBU, 0xB9U, 0x6AU, 0xDAU, 0xB7U, 0x60U, 0xD7U, 0xF4U, 0x68U, 0x1DU, 0x4FU, 0x42U, 0xA3U, + 0xDEU, 0x39U, 0x4DU, 0xF4U, 0xAEU, 0x56U, 0xEDU, 0xE7U, 0x63U, 0x72U, 0xBBU, 0x19U, 0x0BU, + 0x07U, 0xA7U, 0xC8U, 0xEEU, 0x0AU, 0x6DU, 0x70U, 0x9EU, 0x02U, 0xFCU, 0xE1U, 0xCDU, 0xF7U, + 0xE2U, 0xECU, 0xC0U, 0x34U, 0x04U, 0xCDU, 0x28U, 0x34U, 0x2FU, 0x61U, 0x91U, 0x72U, 0xFEU, + 0x9CU, 0xE9U, 0x85U, 0x83U, 0xFFU, 0x8EU, 0x4FU, 0x12U, 0x32U, 0xEEU, 0xF2U, 0x81U, 0x83U, + 0xC3U, 0xFEU, 0x3BU, 0x1BU, 0x4CU, 0x6FU, 0xADU, 0x73U, 0x3BU, 0xB5U, 0xFCU, 0xBCU, 0x2EU, + 0xC2U, 0x20U, 0x05U, 0xC5U, 0x8EU, 0xF1U, 0x83U, 0x7DU, 0x16U, 0x83U, 0xB2U, 0xC6U, 0xF3U, + 0x4AU, 0x26U, 0xC1U, 0xB2U, 0xEFU, 0xFAU, 0x88U, 0x6BU, 0x42U, 0x38U, 0x61U, 0x1FU, 0xCFU, + 0xDCU, 0xDEU, 0x35U, 0x5BU, 0x3BU, 0x65U, 0x19U, 0x03U, 0x5BU, 0xBCU, 0x34U, 0xF4U, 0xDEU, + 0xF9U, 0x9CU, 0x02U, 0x38U, 0x61U, 0xB4U, 0x6FU, 0xC9U, 0xD6U, 0xE6U, 0xC9U, 0x07U, 0x7AU, + 0xD9U, 0x1DU, 0x26U, 0x91U, 0xF7U, 0xF7U, 0xEEU, 0x59U, 0x8CU, 0xB0U, 0xFAU, 0xC1U, 0x86U, + 0xD9U, 0x1CU, 0xAEU, 0xFEU, 0x13U, 0x09U, 0x85U, 0x13U, 0x92U, 0x70U, 0xB4U, 0x13U, 0x0CU, + 0x93U, 0xBCU, 0x43U, 0x79U, 0x44U, 0xF4U, 0xFDU, 0x44U, 0x52U, 0xE2U, 0xD7U, 0x4DU, 0xD3U, + 0x64U, 0xF2U, 0xE2U, 0x1EU, 0x71U, 0xF5U, 0x4BU, 0xFFU, 0x5CU, 0xAEU, 0x82U, 0xABU, 0x9CU, + 0x9DU, 0xF6U, 0x9EU, 0xE8U, 0x6DU, 0x2BU, 0xC5U, 0x22U, 0x36U, 0x3AU, 0x0DU, 0xABU, 0xC5U, + 0x21U, 0x97U, 0x9BU, 0x0DU, 0xEAU, 0xDAU, 0x1DU, 0xBFU, 0x9AU, 0x42U, 0xD5U, 0xC4U, 0x48U, + 0x4EU, 0x0AU, 0xBCU, 0xD0U, 0x6BU, 0xFAU, 0x53U, 0xDDU, 0xEFU, 0x3CU, 0x1BU, 0x20U, 0xEEU, + 0x3FU, 0xD5U, 0x9DU, 0x7CU, 0x25U, 0xE4U, 0x1DU, 0x2BU, 0x66U, 0x9EU, 0x1EU, 0xF1U, 0x6EU, + 0x6FU, 0x52U, 0xC3U, 0x16U, 0x4DU, 0xF4U, 0xFBU, 0x79U, 0x30U, 0xE9U, 0xE4U, 0xE5U, 0x88U, + 0x57U, 0xB6U, 0xACU, 0x7DU, 0x5FU, 0x42U, 0xD6U, 0x9FU, 0x6DU, 0x18U, 0x77U, 0x63U, 0xCFU, + 0x1DU, 0x55U, 0x03U, 0x40U, 0x04U, 0x87U, 0xF5U, 0x5BU, 0xA5U, 0x7EU, 0x31U, 0xCCU, 0x7AU, + 0x71U, 0x35U, 0xC8U, 0x86U, 0xEFU, 0xB4U, 0x31U, 0x8AU, 0xEDU, 0x6AU, 0x1EU, 0x01U, 0x2DU, + 0x9EU, 0x68U, 0x32U, 0xA9U, 0x07U, 0x60U, 0x0AU, 0x91U, 0x81U, 0x30U, 0xC4U, 0x6DU, 0xC7U, + 0x78U, 0xF9U, 0x71U, 0xADU, 0x00U, 0x38U, 0x09U, 0x29U, 0x99U, 0xA3U, 0x33U, 0xCBU, 0x8BU, + 0x7AU, 0x1AU, 0x1DU, 0xB9U, 0x3DU, 0x71U, 0x40U, 0x00U, 0x3CU, 0x2AU, 0x4EU, 0xCEU, 0xA9U, + 0xF9U, 0x8DU, 0x0AU, 0xCCU, 0x0AU, 0x82U, 0x91U, 0xCDU, 0xCEU, 0xC9U, 0x7DU, 0xCFU, 0x8EU, + 0xC9U, 0xB5U, 0x5AU, 0x7FU, 0x88U, 0xA4U, 0x6BU, 0x4DU, 0xB5U, 0xA8U, 0x51U, 0xF4U, 0x41U, + 0x82U, 0xE1U, 0xC6U, 0x8AU, 0x00U, 0x7EU, 0x5EU, 0x0DU, 0xD9U, 0x02U, 0x0BU, 0xFDU, 0x64U, + 0xB6U, 0x45U, 0x03U, 0x6CU, 0x7AU, 0x4EU, 0x67U, 0x7DU, 0x2CU, 0x38U, 0x53U, 0x2AU, 0x3AU, + 0x23U, 0xBAU, 0x44U, 0x42U, 0xCAU, 0xF5U, 0x3EU, 0xA6U, 0x3BU, 0xB4U, 0x54U, 0x32U, 0x9BU, + 0x76U, 0x24U, 0xC8U, 0x91U, 0x7BU, 0xDDU, 0x64U, 0xB1U, 0xC0U, 0xFDU, 0x4CU, 0xB3U, 0x8EU, + 0x8CU, 0x33U, 0x4CU, 0x70U, 0x1CU, 0x3AU, 0xCDU, 0xADU, 0x06U, 0x57U, 0xFCU, 0xCFU, 0xECU, + 0x71U, 0x9BU, 0x1FU, 0x5CU, 0x3EU, 0x4EU, 0x46U, 0x04U, 0x1FU, 0x38U, 0x81U, 0x47U, 0xFBU, + 0x4CU, 0xFDU, 0xB4U, 0x77U, 0xA5U, 0x24U, 0x71U, 0xF7U, 0xA9U, 0xA9U, 0x69U, 0x10U, 0xB8U, + 0x55U, 0x32U, 0x2EU, 0xDBU, 0x63U, 0x40U, 0xD8U, 0xA0U, 0x0EU, 0xF0U, 0x92U, 0x35U, 0x05U, + 0x11U, 0xE3U, 0x0AU, 0xBEU, 0xC1U, 0xFFU, 0xF9U, 0xE3U, 0xA2U, 0x6EU, 0x7FU, 0xB2U, 0x9FU, + 0x8CU, 0x18U, 0x30U, 0x23U, 0xC3U, 0x58U, 0x7EU, 0x38U, 0xDAU, 0x00U, 0x77U, 0xD9U, 0xB4U, + 0x76U, 0x3EU, 0x4EU, 0x4BU, 0x94U, 0xB2U, 0xBBU, 0xC1U, 0x94U, 0xC6U, 0x65U, 0x1EU, 0x77U, + 0xCAU, 0xF9U, 0x92U, 0xEEU, 0xAAU, 0xC0U, 0x23U, 0x2AU, 0x28U, 0x1BU, 0xF6U, 0xB3U, 0xA7U, + 0x39U, 0xC1U, 0x22U, 0x61U, 0x16U, 0x82U, 0x0AU, 0xE8U, 0xDBU, 0x58U, 0x47U, 0xA6U, 0x7CU, + 0xBEU, 0xF9U, 0xC9U, 0x09U, 0x1BU, 0x46U, 0x2DU, 0x53U, 0x8CU, 0xD7U, 0x2BU, 0x03U, 0x74U, + 0x6AU, 0xE7U, 0x7FU, 0x5EU, 0x62U, 0x29U, 0x2CU, 0x31U, 0x15U, 0x62U, 0xA8U, 0x46U, 0x50U, + 0x5DU, 0xC8U, 0x2DU, 0xB8U, 0x54U, 0x33U, 0x8AU, 0xE4U, 0x9FU, 0x52U, 0x35U, 0xC9U, 0x5BU, + 0x91U, 0x17U, 0x8CU, 0xCFU, 0x2DU, 0xD5U, 0xCAU, 0xCEU, 0xF4U, 0x03U, 0xECU, 0x9DU, 0x18U, + 0x10U, 0xC6U, 0x27U, 0x2BU, 0x04U, 0x5BU, 0x3BU, 0x71U, 0xF9U, 0xDCU, 0x6BU, 0x80U, 0xD6U, + 0x3FU, 0xDDU, 0x4AU, 0x8EU, 0x9AU, 0xDBU, 0x1EU, 0x69U, 0x62U, 0xA6U, 0x95U, 0x26U, 0xD4U, + 0x31U, 0x61U, 0xC1U, 0xA4U, 0x1DU, 0x57U, 0x0DU, 0x79U, 0x38U, 0xDAU, 0xD4U, 0xA4U, 0x0EU, + 0x32U, 0x9CU, 0xCFU, 0xF4U, 0x6AU, 0xAAU, 0x36U, 0xADU, 0x00U, 0x4CU, 0xF6U, 0x00U, 0xC8U, + 0x38U, 0x1EU, 0x42U, 0x5AU, 0x31U, 0xD9U, 0x51U, 0xAEU, 0x64U, 0xFDU, 0xB2U, 0x3FU, 0xCEU, + 0xC9U, 0x50U, 0x9DU, 0x43U, 0x68U, 0x7FU, 0xEBU, 0x69U, 0xEDU, 0xD1U, 0xCCU, 0x5EU, 0x0BU, + 0x8CU, 0xC3U, 0xBDU, 0xF6U, 0x4BU, 0x10U, 0xEFU, 0x86U, 0xB6U, 0x31U, 0x42U, 0xA3U, 0xABU, + 0x88U, 0x29U, 0x55U, 0x5BU, 0x2FU, 0x74U, 0x7CU, 0x93U, 0x26U, 0x65U, 0xCBU, 0x2CU, 0x0FU, + 0x1CU, 0xC0U, 0x1BU, 0xD7U, 0x02U, 0x29U, 0x38U, 0x88U, 0x39U, 0xD2U, 0xAFU, 0x05U, 0xE4U, + 0x54U, 0x50U, 0x4AU, 0xC7U, 0x8BU, 0x75U, 0x82U, 0x82U, 0x28U, 0x46U, 0xC0U, 0xBAU, 0x35U, + 0xC3U, 0x5FU, 0x5CU, 0x59U, 0x16U, 0x0CU, 0xC0U, 0x46U, 0xFDU, 0x82U, 0x51U, 0x54U, 0x1FU, + 0xC6U, 0x8CU, 0x9CU, 0x86U, 0xB0U, 0x22U, 0xBBU, 0x70U, 0x99U, 0x87U, 0x6AU, 0x46U, 0x0EU, + 0x74U, 0x51U, 0xA8U, 0xA9U, 0x31U, 0x09U, 0x70U, 0x3FU, 0xEEU, 0x1CU, 0x21U, 0x7EU, 0x6CU, + 0x38U, 0x26U, 0xE5U, 0x2CU, 0x51U, 0xAAU, 0x69U, 0x1EU, 0x0EU, 0x42U, 0x3CU, 0xFCU, 0x99U, + 0xE9U, 0xE3U, 0x16U, 0x50U, 0xC1U, 0x21U, 0x7BU, 0x62U, 0x48U, 0x16U, 0xCDU, 0xADU, 0x9AU, + 0x95U, 0xF9U, 0xD5U, 0xB8U, 0x01U, 0x94U, 0x88U, 0xD9U, 0xC0U, 0xA0U, 0xA1U, 0xFEU, 0x30U, + 0x75U, 0xA5U, 0x77U, 0xE2U, 0x31U, 0x83U, 0xF8U, 0x1DU, 0x4AU, 0x3FU, 0x2FU, 0xA4U, 0x57U, + 0x1EU, 0xFCU, 0x8CU, 0xE0U, 0xBAU, 0x8AU, 0x4FU, 0xE8U, 0xB6U, 0x85U, 0x5DU, 0xFEU, 0x72U, + 0xB0U, 0xA6U, 0x6EU, 0xDEU, 0xD2U, 0xFBU, 0xABU, 0xFBU, 0xE5U, 0x8AU, 0x30U, 0xFAU, 0xFAU, + 0xBEU, 0x1CU, 0x5DU, 0x71U, 0xA8U, 0x7EU, 0x2FU, 0x74U, 0x1EU, 0xF8U, 0xC1U, 0xFEU, 0x86U, + 0xFEU, 0xA6U, 0xBBU, 0xFDU, 0xE5U, 0x30U, 0x67U, 0x7FU, 0x0DU, 0x97U, 0xD1U, 0x1DU, 0x49U, + 0xF7U, 0xA8U, 0x44U, 0x3DU, 0x08U, 0x22U, 0xE5U, 0x06U, 0xA9U, 0xF4U, 0x61U, 0x4EU, 0x01U, + 0x1EU, 0x2AU, 0x94U, 0x83U, 0x8FU, 0xF8U, 0x8CU, 0xD6U, 0x8CU, 0x8BU, 0xB7U, 0xC5U, 0xC6U, + 0x42U, 0x4CU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU }; #if defined(__cplusplus) diff --git a/include/msvc/internal/Hacl_K256_PrecompTable.h b/include/msvc/internal/Hacl_K256_PrecompTable.h index 26bdfa1f..ff15f1c9 100644 --- a/include/msvc/internal/Hacl_K256_PrecompTable.h +++ b/include/msvc/internal/Hacl_K256_PrecompTable.h @@ -39,498 +39,378 @@ static const uint64_t Hacl_K256_PrecompTable_precomp_basepoint_table_w4[240U] = { - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)705178180786072U, - (uint64_t)3855836460717471U, (uint64_t)4089131105950716U, (uint64_t)3301581525494108U, - (uint64_t)133858670344668U, (uint64_t)2199641648059576U, (uint64_t)1278080618437060U, - (uint64_t)3959378566518708U, (uint64_t)3455034269351872U, (uint64_t)79417610544803U, - (uint64_t)1U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, - (uint64_t)1282049064345544U, (uint64_t)971732600440099U, (uint64_t)1014594595727339U, - (uint64_t)4392159187541980U, (uint64_t)268327875692285U, (uint64_t)2411661712280539U, - (uint64_t)1092576199280126U, (uint64_t)4328619610718051U, (uint64_t)3535440816471627U, - (uint64_t)95182251488556U, (uint64_t)1893725512243753U, (uint64_t)3619861457111820U, - (uint64_t)879374960417905U, (uint64_t)2868056058129113U, (uint64_t)273195291893682U, - (uint64_t)2044797305960112U, (uint64_t)2357106853933780U, (uint64_t)3563112438336058U, - (uint64_t)2430811541762558U, (uint64_t)106443809495428U, (uint64_t)2231357633909668U, - (uint64_t)3641705835951936U, (uint64_t)80642569314189U, (uint64_t)2254841882373268U, - (uint64_t)149848031966573U, (uint64_t)2304615661367764U, (uint64_t)2410957403736446U, - (uint64_t)2712754805859804U, (uint64_t)2440183877540536U, (uint64_t)99784623895865U, - (uint64_t)3667773127482758U, (uint64_t)1354899394473308U, (uint64_t)3636602998800808U, - (uint64_t)2709296679846364U, (uint64_t)7253362091963U, (uint64_t)3585950735562744U, - (uint64_t)935775991758415U, (uint64_t)4108078106735201U, (uint64_t)556081800336307U, - (uint64_t)229585977163057U, (uint64_t)4055594186679801U, (uint64_t)1767681004944933U, - (uint64_t)1432634922083242U, (uint64_t)534935602949197U, (uint64_t)251753159522567U, - (uint64_t)2846474078499321U, (uint64_t)4488649590348702U, (uint64_t)2437476916025038U, - (uint64_t)3040577412822874U, (uint64_t)79405234918614U, (uint64_t)3030621226551508U, - (uint64_t)2801117003929806U, (uint64_t)1642927515498422U, (uint64_t)2802725079726297U, - (uint64_t)8472780626107U, (uint64_t)866068070352655U, (uint64_t)188080768545106U, - (uint64_t)2152119998903058U, (uint64_t)3391239985029665U, (uint64_t)23820026013564U, - (uint64_t)2965064154891949U, (uint64_t)1846516097921398U, (uint64_t)4418379948133146U, - (uint64_t)3137755426942400U, (uint64_t)47705291301781U, (uint64_t)4278533051105665U, - (uint64_t)3453643211214931U, (uint64_t)3379734319145156U, (uint64_t)3762442192097039U, - (uint64_t)40243003528694U, (uint64_t)4063448994211201U, (uint64_t)5697015368785U, - (uint64_t)1006545411838613U, (uint64_t)4242291693755210U, (uint64_t)135184629190512U, - (uint64_t)264898689131035U, (uint64_t)611796474823597U, (uint64_t)3255382250029089U, - (uint64_t)3490429246984696U, (uint64_t)236558595864362U, (uint64_t)2055934691551704U, - (uint64_t)1487711670114502U, (uint64_t)1823930698221632U, (uint64_t)2130937287438472U, - (uint64_t)154610053389779U, (uint64_t)2746573287023216U, (uint64_t)2430987262221221U, - (uint64_t)1668741642878689U, (uint64_t)904982541243977U, (uint64_t)56087343124948U, - (uint64_t)393905062353536U, (uint64_t)412681877350188U, (uint64_t)3153602040979977U, - (uint64_t)4466820876224989U, (uint64_t)146579165617857U, (uint64_t)2628741216508991U, - (uint64_t)747994231529806U, (uint64_t)750506569317681U, (uint64_t)1887492790748779U, - (uint64_t)35259008682771U, (uint64_t)2085116434894208U, (uint64_t)543291398921711U, - (uint64_t)1144362007901552U, (uint64_t)679305136036846U, (uint64_t)141090902244489U, - (uint64_t)632480954474859U, (uint64_t)2384513102652591U, (uint64_t)2225529790159790U, - (uint64_t)692258664851625U, (uint64_t)198681843567699U, (uint64_t)2397092587228181U, - (uint64_t)145862822166614U, (uint64_t)196976540479452U, (uint64_t)3321831130141455U, - (uint64_t)69266673089832U, (uint64_t)4469644227342284U, (uint64_t)3899271145504796U, - (uint64_t)1261890974076660U, (uint64_t)525357673886694U, (uint64_t)182135997828583U, - (uint64_t)4292760618810332U, (uint64_t)3404186545541683U, (uint64_t)312297386688768U, - (uint64_t)204377466824608U, (uint64_t)230900767857952U, (uint64_t)3871485172339693U, - (uint64_t)779449329662955U, (uint64_t)978655822464694U, (uint64_t)2278252139594027U, - (uint64_t)104641527040382U, (uint64_t)3528840153625765U, (uint64_t)4484699080275273U, - (uint64_t)1463971951102316U, (uint64_t)4013910812844749U, (uint64_t)228915589433620U, - (uint64_t)1209641433482461U, (uint64_t)4043178788774759U, (uint64_t)3008668238856634U, - (uint64_t)1448425089071412U, (uint64_t)26269719725037U, (uint64_t)3330785027545223U, - (uint64_t)852657975349259U, (uint64_t)227245054466105U, (uint64_t)1534632353984777U, - (uint64_t)207715098574660U, (uint64_t)3209837527352280U, (uint64_t)4051688046309066U, - (uint64_t)3839009590725955U, (uint64_t)1321506437398842U, (uint64_t)68340219159928U, - (uint64_t)1806950276956275U, (uint64_t)3923908055275295U, (uint64_t)743963253393575U, - (uint64_t)42162407478783U, (uint64_t)261334584474610U, (uint64_t)3728224928885214U, - (uint64_t)4004701081842869U, (uint64_t)709043201644674U, (uint64_t)4267294249150171U, - (uint64_t)255540582975025U, (uint64_t)875490593722211U, (uint64_t)796393708218375U, - (uint64_t)14774425627956U, (uint64_t)1500040516752097U, (uint64_t)141076627721678U, - (uint64_t)2634539368480628U, (uint64_t)1106488853550103U, (uint64_t)2346231921151930U, - (uint64_t)897108283954283U, (uint64_t)64616679559843U, (uint64_t)400244949840943U, - (uint64_t)1731263826831733U, (uint64_t)1649996579904651U, (uint64_t)3643693449640761U, - (uint64_t)172543068638991U, (uint64_t)329537981097182U, (uint64_t)2029799860802869U, - (uint64_t)4377737515208862U, (uint64_t)29103311051334U, (uint64_t)265583594111499U, - (uint64_t)3798074876561255U, (uint64_t)184749333259352U, (uint64_t)3117395073661801U, - (uint64_t)3695784565008833U, (uint64_t)64282709896721U, (uint64_t)1618968913246422U, - (uint64_t)3185235128095257U, (uint64_t)3288745068118692U, (uint64_t)1963818603508782U, - (uint64_t)281054350739495U, (uint64_t)1658639050810346U, (uint64_t)3061097601679552U, - (uint64_t)3023781433263746U, (uint64_t)2770283391242475U, (uint64_t)144508864751908U, - (uint64_t)173576288079856U, (uint64_t)46114579547054U, (uint64_t)1679480127300211U, - (uint64_t)1683062051644007U, (uint64_t)117183826129323U, (uint64_t)1894068608117440U, - (uint64_t)3846899838975733U, (uint64_t)4289279019496192U, (uint64_t)176995887914031U, - (uint64_t)78074942938713U, (uint64_t)454207263265292U, (uint64_t)972683614054061U, - (uint64_t)808474205144361U, (uint64_t)942703935951735U, (uint64_t)134460241077887U + 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, + 705178180786072ULL, 3855836460717471ULL, 4089131105950716ULL, 3301581525494108ULL, + 133858670344668ULL, 2199641648059576ULL, 1278080618437060ULL, 3959378566518708ULL, + 3455034269351872ULL, 79417610544803ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1282049064345544ULL, + 971732600440099ULL, 1014594595727339ULL, 4392159187541980ULL, 268327875692285ULL, + 2411661712280539ULL, 1092576199280126ULL, 4328619610718051ULL, 3535440816471627ULL, + 95182251488556ULL, 1893725512243753ULL, 3619861457111820ULL, 879374960417905ULL, + 2868056058129113ULL, 273195291893682ULL, 2044797305960112ULL, 2357106853933780ULL, + 3563112438336058ULL, 2430811541762558ULL, 106443809495428ULL, 2231357633909668ULL, + 3641705835951936ULL, 80642569314189ULL, 2254841882373268ULL, 149848031966573ULL, + 2304615661367764ULL, 2410957403736446ULL, 2712754805859804ULL, 2440183877540536ULL, + 99784623895865ULL, 3667773127482758ULL, 1354899394473308ULL, 3636602998800808ULL, + 2709296679846364ULL, 7253362091963ULL, 3585950735562744ULL, 935775991758415ULL, + 4108078106735201ULL, 556081800336307ULL, 229585977163057ULL, 4055594186679801ULL, + 1767681004944933ULL, 1432634922083242ULL, 534935602949197ULL, 251753159522567ULL, + 2846474078499321ULL, 4488649590348702ULL, 2437476916025038ULL, 3040577412822874ULL, + 79405234918614ULL, 3030621226551508ULL, 2801117003929806ULL, 1642927515498422ULL, + 2802725079726297ULL, 8472780626107ULL, 866068070352655ULL, 188080768545106ULL, + 2152119998903058ULL, 3391239985029665ULL, 23820026013564ULL, 2965064154891949ULL, + 1846516097921398ULL, 4418379948133146ULL, 3137755426942400ULL, 47705291301781ULL, + 4278533051105665ULL, 3453643211214931ULL, 3379734319145156ULL, 3762442192097039ULL, + 40243003528694ULL, 4063448994211201ULL, 5697015368785ULL, 1006545411838613ULL, + 4242291693755210ULL, 135184629190512ULL, 264898689131035ULL, 611796474823597ULL, + 3255382250029089ULL, 3490429246984696ULL, 236558595864362ULL, 2055934691551704ULL, + 1487711670114502ULL, 1823930698221632ULL, 2130937287438472ULL, 154610053389779ULL, + 2746573287023216ULL, 2430987262221221ULL, 1668741642878689ULL, 904982541243977ULL, + 56087343124948ULL, 393905062353536ULL, 412681877350188ULL, 3153602040979977ULL, + 4466820876224989ULL, 146579165617857ULL, 2628741216508991ULL, 747994231529806ULL, + 750506569317681ULL, 1887492790748779ULL, 35259008682771ULL, 2085116434894208ULL, + 543291398921711ULL, 1144362007901552ULL, 679305136036846ULL, 141090902244489ULL, + 632480954474859ULL, 2384513102652591ULL, 2225529790159790ULL, 692258664851625ULL, + 198681843567699ULL, 2397092587228181ULL, 145862822166614ULL, 196976540479452ULL, + 3321831130141455ULL, 69266673089832ULL, 4469644227342284ULL, 3899271145504796ULL, + 1261890974076660ULL, 525357673886694ULL, 182135997828583ULL, 4292760618810332ULL, + 3404186545541683ULL, 312297386688768ULL, 204377466824608ULL, 230900767857952ULL, + 3871485172339693ULL, 779449329662955ULL, 978655822464694ULL, 2278252139594027ULL, + 104641527040382ULL, 3528840153625765ULL, 4484699080275273ULL, 1463971951102316ULL, + 4013910812844749ULL, 228915589433620ULL, 1209641433482461ULL, 4043178788774759ULL, + 3008668238856634ULL, 1448425089071412ULL, 26269719725037ULL, 3330785027545223ULL, + 852657975349259ULL, 227245054466105ULL, 1534632353984777ULL, 207715098574660ULL, + 3209837527352280ULL, 4051688046309066ULL, 3839009590725955ULL, 1321506437398842ULL, + 68340219159928ULL, 1806950276956275ULL, 3923908055275295ULL, 743963253393575ULL, + 42162407478783ULL, 261334584474610ULL, 3728224928885214ULL, 4004701081842869ULL, + 709043201644674ULL, 4267294249150171ULL, 255540582975025ULL, 875490593722211ULL, + 796393708218375ULL, 14774425627956ULL, 1500040516752097ULL, 141076627721678ULL, + 2634539368480628ULL, 1106488853550103ULL, 2346231921151930ULL, 897108283954283ULL, + 64616679559843ULL, 400244949840943ULL, 1731263826831733ULL, 1649996579904651ULL, + 3643693449640761ULL, 172543068638991ULL, 329537981097182ULL, 2029799860802869ULL, + 4377737515208862ULL, 29103311051334ULL, 265583594111499ULL, 3798074876561255ULL, + 184749333259352ULL, 3117395073661801ULL, 3695784565008833ULL, 64282709896721ULL, + 1618968913246422ULL, 3185235128095257ULL, 3288745068118692ULL, 1963818603508782ULL, + 281054350739495ULL, 1658639050810346ULL, 3061097601679552ULL, 3023781433263746ULL, + 2770283391242475ULL, 144508864751908ULL, 173576288079856ULL, 46114579547054ULL, + 1679480127300211ULL, 1683062051644007ULL, 117183826129323ULL, 1894068608117440ULL, + 3846899838975733ULL, 4289279019496192ULL, 176995887914031ULL, 78074942938713ULL, + 454207263265292ULL, 972683614054061ULL, 808474205144361ULL, 942703935951735ULL, + 134460241077887ULL }; static const uint64_t Hacl_K256_PrecompTable_precomp_g_pow2_64_table_w4[240U] = { - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)4496295042185355U, - (uint64_t)3125448202219451U, (uint64_t)1239608518490046U, (uint64_t)2687445637493112U, - (uint64_t)77979604880139U, (uint64_t)3360310474215011U, (uint64_t)1216410458165163U, - (uint64_t)177901593587973U, (uint64_t)3209978938104985U, (uint64_t)118285133003718U, - (uint64_t)434519962075150U, (uint64_t)1114612377498854U, (uint64_t)3488596944003813U, - (uint64_t)450716531072892U, (uint64_t)66044973203836U, (uint64_t)2822827191156652U, - (uint64_t)2417714248626059U, (uint64_t)2173117567943U, (uint64_t)961513119252459U, - (uint64_t)233852556538333U, (uint64_t)3014783730323962U, (uint64_t)2955192634004574U, - (uint64_t)580546524951282U, (uint64_t)2982973948711252U, (uint64_t)226295722018730U, - (uint64_t)26457116218543U, (uint64_t)3401523493637663U, (uint64_t)2597746825024790U, - (uint64_t)1789211180483113U, (uint64_t)155862365823427U, (uint64_t)4056806876632134U, - (uint64_t)1742291745730568U, (uint64_t)3527759000626890U, (uint64_t)3740578471192596U, - (uint64_t)177295097700537U, (uint64_t)1533961415657770U, (uint64_t)4305228982382487U, - (uint64_t)4069090871282711U, (uint64_t)4090877481646667U, (uint64_t)220939617041498U, - (uint64_t)2057548127959588U, (uint64_t)45185623103252U, (uint64_t)2871963270423449U, - (uint64_t)3312974792248749U, (uint64_t)8710601879528U, (uint64_t)570612225194540U, - (uint64_t)2045632925323972U, (uint64_t)1263913878297555U, (uint64_t)1294592284757719U, - (uint64_t)238067747295054U, (uint64_t)1576659948829386U, (uint64_t)2315159636629917U, - (uint64_t)3624867787891655U, (uint64_t)647628266663887U, (uint64_t)75788399640253U, - (uint64_t)710811707847797U, (uint64_t)130020650130128U, (uint64_t)1975045425972589U, - (uint64_t)136351545314094U, (uint64_t)229292031212337U, (uint64_t)1061471455264148U, - (uint64_t)3281312694184822U, (uint64_t)1692442293921797U, (uint64_t)4171008525509513U, - (uint64_t)275424696197549U, (uint64_t)1170296303921965U, (uint64_t)4154092952807735U, - (uint64_t)4371262070870741U, (uint64_t)835769811036496U, (uint64_t)275812646528189U, - (uint64_t)4006745785521764U, (uint64_t)1965172239781114U, (uint64_t)4121055644916429U, - (uint64_t)3578995380229569U, (uint64_t)169798870760022U, (uint64_t)1834234783016431U, - (uint64_t)3186919121688538U, (uint64_t)1894269993170652U, (uint64_t)868603832348691U, - (uint64_t)110978471368876U, (uint64_t)1659296605881532U, (uint64_t)3257830829309297U, - (uint64_t)3381509832701119U, (uint64_t)4016163121121296U, (uint64_t)265240263496294U, - (uint64_t)4411285343933251U, (uint64_t)728746770806400U, (uint64_t)1767819098558739U, - (uint64_t)3002081480892841U, (uint64_t)96312133241935U, (uint64_t)468184501392107U, - (uint64_t)2061529496271208U, (uint64_t)801565111628867U, (uint64_t)3380678576799273U, - (uint64_t)121814978170941U, (uint64_t)3340363319165433U, (uint64_t)2764604325746928U, - (uint64_t)4475755976431968U, (uint64_t)3678073419927081U, (uint64_t)237001357924061U, - (uint64_t)4110487014553450U, (uint64_t)442517757833404U, (uint64_t)3976758767423859U, - (uint64_t)2559863799262476U, (uint64_t)178144664279213U, (uint64_t)2488702171798051U, - (uint64_t)4292079598620208U, (uint64_t)1642918280217329U, (uint64_t)3694920319798108U, - (uint64_t)111735528281657U, (uint64_t)2904433967156033U, (uint64_t)4391518032143166U, - (uint64_t)3018885875516259U, (uint64_t)3730342681447122U, (uint64_t)10320273322750U, - (uint64_t)555845881555519U, (uint64_t)58355404017985U, (uint64_t)379009359053696U, - (uint64_t)450317203955503U, (uint64_t)271063299686173U, (uint64_t)910340241794202U, - (uint64_t)4145234574853890U, (uint64_t)2059755654702755U, (uint64_t)626530377112246U, - (uint64_t)188918989156857U, (uint64_t)3316657461542117U, (uint64_t)778033563170765U, - (uint64_t)3568562306532187U, (uint64_t)2888619469733481U, (uint64_t)4364919962337U, - (uint64_t)4095057288587059U, (uint64_t)2275461355379988U, (uint64_t)1507422995910897U, - (uint64_t)3737691697116252U, (uint64_t)28779913258578U, (uint64_t)131453301647952U, - (uint64_t)3613515597508469U, (uint64_t)2389606941441321U, (uint64_t)2135459302594806U, - (uint64_t)105517262484263U, (uint64_t)2973432939331401U, (uint64_t)3447096622477885U, - (uint64_t)684654106536844U, (uint64_t)2815198316729695U, (uint64_t)280303067216071U, - (uint64_t)1841014812927024U, (uint64_t)1181026273060917U, (uint64_t)4092989148457730U, - (uint64_t)1381045116206278U, (uint64_t)112475725893965U, (uint64_t)2309144740156686U, - (uint64_t)1558825847609352U, (uint64_t)2008068002046292U, (uint64_t)3153511625856423U, - (uint64_t)38469701427673U, (uint64_t)4240572315518056U, (uint64_t)2295170987320580U, - (uint64_t)187734093837094U, (uint64_t)301041528077172U, (uint64_t)234553141005715U, - (uint64_t)4170513699279606U, (uint64_t)1600132848196146U, (uint64_t)3149113064155689U, - (uint64_t)2733255352600949U, (uint64_t)144915931419495U, (uint64_t)1221012073888926U, - (uint64_t)4395668111081710U, (uint64_t)2464799161496070U, (uint64_t)3664256125241313U, - (uint64_t)239705368981290U, (uint64_t)1415181408539490U, (uint64_t)2551836620449074U, - (uint64_t)3003106895689578U, (uint64_t)968947218886924U, (uint64_t)270781532362673U, - (uint64_t)2905980714350372U, (uint64_t)3246927349288975U, (uint64_t)2653377642686974U, - (uint64_t)1577457093418263U, (uint64_t)279488238785848U, (uint64_t)568335962564552U, - (uint64_t)4251365041645758U, (uint64_t)1257832559776007U, (uint64_t)2424022444243863U, - (uint64_t)261166122046343U, (uint64_t)4399874608082116U, (uint64_t)640509987891568U, - (uint64_t)3119706885332220U, (uint64_t)1990185416694007U, (uint64_t)119390098529341U, - (uint64_t)220106534694050U, (uint64_t)937225880034895U, (uint64_t)656288151358882U, - (uint64_t)1766967254772100U, (uint64_t)197900790969750U, (uint64_t)2992539221608875U, - (uint64_t)3960297171111858U, (uint64_t)3499202002925081U, (uint64_t)1103060980924705U, - (uint64_t)13670895919578U, (uint64_t)430132744187721U, (uint64_t)1206771838050953U, - (uint64_t)2474749300167198U, (uint64_t)296299539510780U, (uint64_t)61565517686436U, - (uint64_t)752778559080573U, (uint64_t)3049015829565410U, (uint64_t)3538647632527371U, - (uint64_t)1640473028662032U, (uint64_t)182488721849306U, (uint64_t)1234378482161516U, - (uint64_t)3736205988606381U, (uint64_t)2814216844344487U, (uint64_t)3877249891529557U, - (uint64_t)51681412928433U, (uint64_t)4275336620301239U, (uint64_t)3084074032750651U, - (uint64_t)42732308350456U, (uint64_t)3648603591552229U, (uint64_t)142450621701603U, - (uint64_t)4020045475009854U, (uint64_t)1050293952073054U, (uint64_t)1974773673079851U, - (uint64_t)1815515638724020U, (uint64_t)104845375825434U + 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, + 4496295042185355ULL, 3125448202219451ULL, 1239608518490046ULL, 2687445637493112ULL, + 77979604880139ULL, 3360310474215011ULL, 1216410458165163ULL, 177901593587973ULL, + 3209978938104985ULL, 118285133003718ULL, 434519962075150ULL, 1114612377498854ULL, + 3488596944003813ULL, 450716531072892ULL, 66044973203836ULL, 2822827191156652ULL, + 2417714248626059ULL, 2173117567943ULL, 961513119252459ULL, 233852556538333ULL, + 3014783730323962ULL, 2955192634004574ULL, 580546524951282ULL, 2982973948711252ULL, + 226295722018730ULL, 26457116218543ULL, 3401523493637663ULL, 2597746825024790ULL, + 1789211180483113ULL, 155862365823427ULL, 4056806876632134ULL, 1742291745730568ULL, + 3527759000626890ULL, 3740578471192596ULL, 177295097700537ULL, 1533961415657770ULL, + 4305228982382487ULL, 4069090871282711ULL, 4090877481646667ULL, 220939617041498ULL, + 2057548127959588ULL, 45185623103252ULL, 2871963270423449ULL, 3312974792248749ULL, + 8710601879528ULL, 570612225194540ULL, 2045632925323972ULL, 1263913878297555ULL, + 1294592284757719ULL, 238067747295054ULL, 1576659948829386ULL, 2315159636629917ULL, + 3624867787891655ULL, 647628266663887ULL, 75788399640253ULL, 710811707847797ULL, + 130020650130128ULL, 1975045425972589ULL, 136351545314094ULL, 229292031212337ULL, + 1061471455264148ULL, 3281312694184822ULL, 1692442293921797ULL, 4171008525509513ULL, + 275424696197549ULL, 1170296303921965ULL, 4154092952807735ULL, 4371262070870741ULL, + 835769811036496ULL, 275812646528189ULL, 4006745785521764ULL, 1965172239781114ULL, + 4121055644916429ULL, 3578995380229569ULL, 169798870760022ULL, 1834234783016431ULL, + 3186919121688538ULL, 1894269993170652ULL, 868603832348691ULL, 110978471368876ULL, + 1659296605881532ULL, 3257830829309297ULL, 3381509832701119ULL, 4016163121121296ULL, + 265240263496294ULL, 4411285343933251ULL, 728746770806400ULL, 1767819098558739ULL, + 3002081480892841ULL, 96312133241935ULL, 468184501392107ULL, 2061529496271208ULL, + 801565111628867ULL, 3380678576799273ULL, 121814978170941ULL, 3340363319165433ULL, + 2764604325746928ULL, 4475755976431968ULL, 3678073419927081ULL, 237001357924061ULL, + 4110487014553450ULL, 442517757833404ULL, 3976758767423859ULL, 2559863799262476ULL, + 178144664279213ULL, 2488702171798051ULL, 4292079598620208ULL, 1642918280217329ULL, + 3694920319798108ULL, 111735528281657ULL, 2904433967156033ULL, 4391518032143166ULL, + 3018885875516259ULL, 3730342681447122ULL, 10320273322750ULL, 555845881555519ULL, + 58355404017985ULL, 379009359053696ULL, 450317203955503ULL, 271063299686173ULL, + 910340241794202ULL, 4145234574853890ULL, 2059755654702755ULL, 626530377112246ULL, + 188918989156857ULL, 3316657461542117ULL, 778033563170765ULL, 3568562306532187ULL, + 2888619469733481ULL, 4364919962337ULL, 4095057288587059ULL, 2275461355379988ULL, + 1507422995910897ULL, 3737691697116252ULL, 28779913258578ULL, 131453301647952ULL, + 3613515597508469ULL, 2389606941441321ULL, 2135459302594806ULL, 105517262484263ULL, + 2973432939331401ULL, 3447096622477885ULL, 684654106536844ULL, 2815198316729695ULL, + 280303067216071ULL, 1841014812927024ULL, 1181026273060917ULL, 4092989148457730ULL, + 1381045116206278ULL, 112475725893965ULL, 2309144740156686ULL, 1558825847609352ULL, + 2008068002046292ULL, 3153511625856423ULL, 38469701427673ULL, 4240572315518056ULL, + 2295170987320580ULL, 187734093837094ULL, 301041528077172ULL, 234553141005715ULL, + 4170513699279606ULL, 1600132848196146ULL, 3149113064155689ULL, 2733255352600949ULL, + 144915931419495ULL, 1221012073888926ULL, 4395668111081710ULL, 2464799161496070ULL, + 3664256125241313ULL, 239705368981290ULL, 1415181408539490ULL, 2551836620449074ULL, + 3003106895689578ULL, 968947218886924ULL, 270781532362673ULL, 2905980714350372ULL, + 3246927349288975ULL, 2653377642686974ULL, 1577457093418263ULL, 279488238785848ULL, + 568335962564552ULL, 4251365041645758ULL, 1257832559776007ULL, 2424022444243863ULL, + 261166122046343ULL, 4399874608082116ULL, 640509987891568ULL, 3119706885332220ULL, + 1990185416694007ULL, 119390098529341ULL, 220106534694050ULL, 937225880034895ULL, + 656288151358882ULL, 1766967254772100ULL, 197900790969750ULL, 2992539221608875ULL, + 3960297171111858ULL, 3499202002925081ULL, 1103060980924705ULL, 13670895919578ULL, + 430132744187721ULL, 1206771838050953ULL, 2474749300167198ULL, 296299539510780ULL, + 61565517686436ULL, 752778559080573ULL, 3049015829565410ULL, 3538647632527371ULL, + 1640473028662032ULL, 182488721849306ULL, 1234378482161516ULL, 3736205988606381ULL, + 2814216844344487ULL, 3877249891529557ULL, 51681412928433ULL, 4275336620301239ULL, + 3084074032750651ULL, 42732308350456ULL, 3648603591552229ULL, 142450621701603ULL, + 4020045475009854ULL, 1050293952073054ULL, 1974773673079851ULL, 1815515638724020ULL, + 104845375825434ULL }; static const uint64_t Hacl_K256_PrecompTable_precomp_g_pow2_128_table_w4[240U] = { - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1277614565900951U, - (uint64_t)378671684419493U, (uint64_t)3176260448102880U, (uint64_t)1575691435565077U, - (uint64_t)167304528382180U, (uint64_t)2600787765776588U, (uint64_t)7497946149293U, - (uint64_t)2184272641272202U, (uint64_t)2200235265236628U, (uint64_t)265969268774814U, - (uint64_t)1913228635640715U, (uint64_t)2831959046949342U, (uint64_t)888030405442963U, - (uint64_t)1817092932985033U, (uint64_t)101515844997121U, (uint64_t)3309468394859588U, - (uint64_t)3965334773689948U, (uint64_t)1945272965790738U, (uint64_t)4450939211427964U, - (uint64_t)211349698782702U, (uint64_t)2085160302160079U, (uint64_t)212812506072603U, - (uint64_t)3646122434511764U, (uint64_t)1711405092320514U, (uint64_t)95160920508464U, - (uint64_t)1677683368518073U, (uint64_t)4384656939250953U, (uint64_t)3548591046529893U, - (uint64_t)1683233536091384U, (uint64_t)105919586159941U, (uint64_t)1941416002726455U, - (uint64_t)246264372248216U, (uint64_t)3063044110922228U, (uint64_t)3772292170415825U, - (uint64_t)222933374989815U, (uint64_t)2417211163452935U, (uint64_t)2018230365573200U, - (uint64_t)1985974538911047U, (uint64_t)1387197705332739U, (uint64_t)186400825584956U, - (uint64_t)2469330487750329U, (uint64_t)1291983813301638U, (uint64_t)333416733706302U, - (uint64_t)3413315564261070U, (uint64_t)189444777569683U, (uint64_t)1062005622360420U, - (uint64_t)1800197715938740U, (uint64_t)3693110992551647U, (uint64_t)626990328941945U, - (uint64_t)40998857100520U, (uint64_t)3921983552805085U, (uint64_t)1016632437340656U, - (uint64_t)4016615929950878U, (uint64_t)2682554586771281U, (uint64_t)7043555162389U, - (uint64_t)3333819830676567U, (uint64_t)4120091964944036U, (uint64_t)1960788263484015U, - (uint64_t)1642145656273304U, (uint64_t)252814075789128U, (uint64_t)3085777342821357U, - (uint64_t)4166637997604052U, (uint64_t)1339401689756469U, (uint64_t)845938529607551U, - (uint64_t)223351828189283U, (uint64_t)1148648705186890U, (uint64_t)1230525014760605U, - (uint64_t)1869739475126720U, (uint64_t)4193966261205530U, (uint64_t)175684010336013U, - (uint64_t)4476719358931508U, (uint64_t)4209547487457638U, (uint64_t)2197536411673724U, - (uint64_t)3010838433412303U, (uint64_t)169318997251483U, (uint64_t)49493868302162U, - (uint64_t)3594601099078584U, (uint64_t)3662420905445942U, (uint64_t)3606544932233685U, - (uint64_t)270643652662165U, (uint64_t)180681786228544U, (uint64_t)2095882682308564U, - (uint64_t)813484483841391U, (uint64_t)1622665392824698U, (uint64_t)113821770225137U, - (uint64_t)3075432444115417U, (uint64_t)716502989978722U, (uint64_t)2304779892217245U, - (uint64_t)1760144151770127U, (uint64_t)235719156963938U, (uint64_t)3180013070471143U, - (uint64_t)1331027634540579U, (uint64_t)552273022992392U, (uint64_t)2858693077461887U, - (uint64_t)197914407731510U, (uint64_t)187252310910959U, (uint64_t)4160637171377125U, - (uint64_t)3225059526713298U, (uint64_t)2574558217383978U, (uint64_t)249695600622489U, - (uint64_t)364988742814327U, (uint64_t)4245298536326258U, (uint64_t)1812464706589342U, - (uint64_t)2734857123772998U, (uint64_t)120105577124628U, (uint64_t)160179251271109U, - (uint64_t)3604555733307834U, (uint64_t)150380003195715U, (uint64_t)1574304909935121U, - (uint64_t)142190285600761U, (uint64_t)1835385847725651U, (uint64_t)3168087139615901U, - (uint64_t)3201434861713736U, (uint64_t)741757984537760U, (uint64_t)163585009419543U, - (uint64_t)3837997981109783U, (uint64_t)3771946407870997U, (uint64_t)2867641360295452U, - (uint64_t)3097548691501578U, (uint64_t)124624912142104U, (uint64_t)2729896088769328U, - (uint64_t)1087786827035225U, (uint64_t)3934000813818614U, (uint64_t)1176792318645055U, - (uint64_t)125311882169270U, (uint64_t)3530709439299502U, (uint64_t)1561477829834527U, - (uint64_t)3927894570196761U, (uint64_t)3957765307669212U, (uint64_t)105720519513730U, - (uint64_t)3758969845816997U, (uint64_t)2738320452287300U, (uint64_t)2380753632109507U, - (uint64_t)2762090901149075U, (uint64_t)123455059136515U, (uint64_t)4222807813169807U, - (uint64_t)118064783651432U, (uint64_t)2877694712254934U, (uint64_t)3535027426396448U, - (uint64_t)100175663703417U, (uint64_t)3287921121213155U, (uint64_t)4497246481824206U, - (uint64_t)1960809949007025U, (uint64_t)3236854264159102U, (uint64_t)35028112623717U, - (uint64_t)338838627913273U, (uint64_t)2827531947914645U, (uint64_t)4231826783810670U, - (uint64_t)1082490106100389U, (uint64_t)13267544387448U, (uint64_t)4249975884259105U, - (uint64_t)2844862161652484U, (uint64_t)262742197948971U, (uint64_t)3525653802457116U, - (uint64_t)269963889261701U, (uint64_t)3690062482117102U, (uint64_t)675413453822147U, - (uint64_t)2170937868437574U, (uint64_t)2367632187022010U, (uint64_t)214032802409445U, - (uint64_t)2054007379612477U, (uint64_t)3558050826739009U, (uint64_t)266827184752634U, - (uint64_t)1946520293291195U, (uint64_t)238087872386556U, (uint64_t)490056555385700U, - (uint64_t)794405769357386U, (uint64_t)3886901294859702U, (uint64_t)3120414548626348U, - (uint64_t)84316625221136U, (uint64_t)223073962531835U, (uint64_t)4280846460577631U, - (uint64_t)344296282849308U, (uint64_t)3522116652699457U, (uint64_t)171817232053075U, - (uint64_t)3296636283062273U, (uint64_t)3587303364425579U, (uint64_t)1033485783633331U, - (uint64_t)3686984130812906U, (uint64_t)268290803650477U, (uint64_t)2803988215834467U, - (uint64_t)3821246410529720U, (uint64_t)1077722388925870U, (uint64_t)4187137036866164U, - (uint64_t)104696540795905U, (uint64_t)998770003854764U, (uint64_t)3960768137535019U, - (uint64_t)4293792474919135U, (uint64_t)3251297981727034U, (uint64_t)192479028790101U, - (uint64_t)1175880869349935U, (uint64_t)3506949259311937U, (uint64_t)2161711516160714U, - (uint64_t)2506820922270187U, (uint64_t)131002200661047U, (uint64_t)3532399477339994U, - (uint64_t)2515815721228719U, (uint64_t)4274974119021502U, (uint64_t)265752394510924U, - (uint64_t)163144272153395U, (uint64_t)2824260010502991U, (uint64_t)517077012665142U, - (uint64_t)602987073882924U, (uint64_t)2939630061751780U, (uint64_t)59211609557440U, - (uint64_t)963423614549333U, (uint64_t)495476232754434U, (uint64_t)94274496109103U, - (uint64_t)2245136222990187U, (uint64_t)185414764872288U, (uint64_t)2266067668609289U, - (uint64_t)3873978896235927U, (uint64_t)4428283513152105U, (uint64_t)3881481480259312U, - (uint64_t)207746202010862U, (uint64_t)1609437858011364U, (uint64_t)477585758421515U, - (uint64_t)3850430788664649U, (uint64_t)2682299074459173U, (uint64_t)149439089751274U, - (uint64_t)3665760243877698U, (uint64_t)1356661512658931U, (uint64_t)1675903262368322U, - (uint64_t)3355649228050892U, (uint64_t)99772108898412U + 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, + 1277614565900951ULL, 378671684419493ULL, 3176260448102880ULL, 1575691435565077ULL, + 167304528382180ULL, 2600787765776588ULL, 7497946149293ULL, 2184272641272202ULL, + 2200235265236628ULL, 265969268774814ULL, 1913228635640715ULL, 2831959046949342ULL, + 888030405442963ULL, 1817092932985033ULL, 101515844997121ULL, 3309468394859588ULL, + 3965334773689948ULL, 1945272965790738ULL, 4450939211427964ULL, 211349698782702ULL, + 2085160302160079ULL, 212812506072603ULL, 3646122434511764ULL, 1711405092320514ULL, + 95160920508464ULL, 1677683368518073ULL, 4384656939250953ULL, 3548591046529893ULL, + 1683233536091384ULL, 105919586159941ULL, 1941416002726455ULL, 246264372248216ULL, + 3063044110922228ULL, 3772292170415825ULL, 222933374989815ULL, 2417211163452935ULL, + 2018230365573200ULL, 1985974538911047ULL, 1387197705332739ULL, 186400825584956ULL, + 2469330487750329ULL, 1291983813301638ULL, 333416733706302ULL, 3413315564261070ULL, + 189444777569683ULL, 1062005622360420ULL, 1800197715938740ULL, 3693110992551647ULL, + 626990328941945ULL, 40998857100520ULL, 3921983552805085ULL, 1016632437340656ULL, + 4016615929950878ULL, 2682554586771281ULL, 7043555162389ULL, 3333819830676567ULL, + 4120091964944036ULL, 1960788263484015ULL, 1642145656273304ULL, 252814075789128ULL, + 3085777342821357ULL, 4166637997604052ULL, 1339401689756469ULL, 845938529607551ULL, + 223351828189283ULL, 1148648705186890ULL, 1230525014760605ULL, 1869739475126720ULL, + 4193966261205530ULL, 175684010336013ULL, 4476719358931508ULL, 4209547487457638ULL, + 2197536411673724ULL, 3010838433412303ULL, 169318997251483ULL, 49493868302162ULL, + 3594601099078584ULL, 3662420905445942ULL, 3606544932233685ULL, 270643652662165ULL, + 180681786228544ULL, 2095882682308564ULL, 813484483841391ULL, 1622665392824698ULL, + 113821770225137ULL, 3075432444115417ULL, 716502989978722ULL, 2304779892217245ULL, + 1760144151770127ULL, 235719156963938ULL, 3180013070471143ULL, 1331027634540579ULL, + 552273022992392ULL, 2858693077461887ULL, 197914407731510ULL, 187252310910959ULL, + 4160637171377125ULL, 3225059526713298ULL, 2574558217383978ULL, 249695600622489ULL, + 364988742814327ULL, 4245298536326258ULL, 1812464706589342ULL, 2734857123772998ULL, + 120105577124628ULL, 160179251271109ULL, 3604555733307834ULL, 150380003195715ULL, + 1574304909935121ULL, 142190285600761ULL, 1835385847725651ULL, 3168087139615901ULL, + 3201434861713736ULL, 741757984537760ULL, 163585009419543ULL, 3837997981109783ULL, + 3771946407870997ULL, 2867641360295452ULL, 3097548691501578ULL, 124624912142104ULL, + 2729896088769328ULL, 1087786827035225ULL, 3934000813818614ULL, 1176792318645055ULL, + 125311882169270ULL, 3530709439299502ULL, 1561477829834527ULL, 3927894570196761ULL, + 3957765307669212ULL, 105720519513730ULL, 3758969845816997ULL, 2738320452287300ULL, + 2380753632109507ULL, 2762090901149075ULL, 123455059136515ULL, 4222807813169807ULL, + 118064783651432ULL, 2877694712254934ULL, 3535027426396448ULL, 100175663703417ULL, + 3287921121213155ULL, 4497246481824206ULL, 1960809949007025ULL, 3236854264159102ULL, + 35028112623717ULL, 338838627913273ULL, 2827531947914645ULL, 4231826783810670ULL, + 1082490106100389ULL, 13267544387448ULL, 4249975884259105ULL, 2844862161652484ULL, + 262742197948971ULL, 3525653802457116ULL, 269963889261701ULL, 3690062482117102ULL, + 675413453822147ULL, 2170937868437574ULL, 2367632187022010ULL, 214032802409445ULL, + 2054007379612477ULL, 3558050826739009ULL, 266827184752634ULL, 1946520293291195ULL, + 238087872386556ULL, 490056555385700ULL, 794405769357386ULL, 3886901294859702ULL, + 3120414548626348ULL, 84316625221136ULL, 223073962531835ULL, 4280846460577631ULL, + 344296282849308ULL, 3522116652699457ULL, 171817232053075ULL, 3296636283062273ULL, + 3587303364425579ULL, 1033485783633331ULL, 3686984130812906ULL, 268290803650477ULL, + 2803988215834467ULL, 3821246410529720ULL, 1077722388925870ULL, 4187137036866164ULL, + 104696540795905ULL, 998770003854764ULL, 3960768137535019ULL, 4293792474919135ULL, + 3251297981727034ULL, 192479028790101ULL, 1175880869349935ULL, 3506949259311937ULL, + 2161711516160714ULL, 2506820922270187ULL, 131002200661047ULL, 3532399477339994ULL, + 2515815721228719ULL, 4274974119021502ULL, 265752394510924ULL, 163144272153395ULL, + 2824260010502991ULL, 517077012665142ULL, 602987073882924ULL, 2939630061751780ULL, + 59211609557440ULL, 963423614549333ULL, 495476232754434ULL, 94274496109103ULL, + 2245136222990187ULL, 185414764872288ULL, 2266067668609289ULL, 3873978896235927ULL, + 4428283513152105ULL, 3881481480259312ULL, 207746202010862ULL, 1609437858011364ULL, + 477585758421515ULL, 3850430788664649ULL, 2682299074459173ULL, 149439089751274ULL, + 3665760243877698ULL, 1356661512658931ULL, 1675903262368322ULL, 3355649228050892ULL, + 99772108898412ULL }; static const uint64_t Hacl_K256_PrecompTable_precomp_g_pow2_192_table_w4[240U] = { - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)34056422761564U, - (uint64_t)3315864838337811U, (uint64_t)3797032336888745U, (uint64_t)2580641850480806U, - (uint64_t)208048944042500U, (uint64_t)1233795288689421U, (uint64_t)1048795233382631U, - (uint64_t)646545158071530U, (uint64_t)1816025742137285U, (uint64_t)12245672982162U, - (uint64_t)2119364213800870U, (uint64_t)2034960311715107U, (uint64_t)3172697815804487U, - (uint64_t)4185144850224160U, (uint64_t)2792055915674U, (uint64_t)795534452139321U, - (uint64_t)3647836177838185U, (uint64_t)2681403398797991U, (uint64_t)3149264270306207U, - (uint64_t)278704080615511U, (uint64_t)2752552368344718U, (uint64_t)1363840972378818U, - (uint64_t)1877521512083293U, (uint64_t)1862111388059470U, (uint64_t)36200324115014U, - (uint64_t)4183622899327217U, (uint64_t)747381675363076U, (uint64_t)2772916395314624U, - (uint64_t)833767013119965U, (uint64_t)246274452928088U, (uint64_t)1526238021297781U, - (uint64_t)3327534966022747U, (uint64_t)1169012581910517U, (uint64_t)4430894603030025U, - (uint64_t)149242742442115U, (uint64_t)1002569704307172U, (uint64_t)2763252093432365U, - (uint64_t)3037748497732938U, (uint64_t)2329811173939457U, (uint64_t)270769113180752U, - (uint64_t)4344092461623432U, (uint64_t)892200524589382U, (uint64_t)2511418516713970U, - (uint64_t)103575031265398U, (uint64_t)183736033430252U, (uint64_t)583003071257308U, - (uint64_t)3357167344738425U, (uint64_t)4038099763242651U, (uint64_t)1776250620957255U, - (uint64_t)51334115864192U, (uint64_t)2616405698969611U, (uint64_t)1196364755910565U, - (uint64_t)3135228056210500U, (uint64_t)533729417611761U, (uint64_t)86564351229326U, - (uint64_t)98936129527281U, (uint64_t)4425305036630677U, (uint64_t)2980296390253408U, - (uint64_t)2487091677325739U, (uint64_t)10501977234280U, (uint64_t)1805646499831077U, - (uint64_t)3120615962395477U, (uint64_t)3634629685307533U, (uint64_t)3009632755291436U, - (uint64_t)16794051906523U, (uint64_t)2465481597883214U, (uint64_t)211492787490403U, - (uint64_t)1120942867046103U, (uint64_t)486438308572108U, (uint64_t)76058986271771U, - (uint64_t)2435216584587357U, (uint64_t)3076359381968283U, (uint64_t)1071594491489655U, - (uint64_t)3148707450339154U, (uint64_t)249332205737851U, (uint64_t)4171051176626809U, - (uint64_t)3165176227956388U, (uint64_t)2400901591835233U, (uint64_t)1435783621333022U, - (uint64_t)20312753440321U, (uint64_t)1767293887448005U, (uint64_t)685150647587522U, - (uint64_t)2957187934449906U, (uint64_t)382661319140439U, (uint64_t)177583591139601U, - (uint64_t)2083572648630743U, (uint64_t)1083410277889419U, (uint64_t)4267902097868310U, - (uint64_t)679989918385081U, (uint64_t)123155311554032U, (uint64_t)2830267662472020U, - (uint64_t)4476040509735924U, (uint64_t)526697201585144U, (uint64_t)3465306430573135U, - (uint64_t)2296616218591U, (uint64_t)1270626872734279U, (uint64_t)1049740198790549U, - (uint64_t)4197567214843444U, (uint64_t)1962225231320591U, (uint64_t)186125026796856U, - (uint64_t)737027567341142U, (uint64_t)4364616098174U, (uint64_t)3618884818756660U, - (uint64_t)1236837563717668U, (uint64_t)162873772439548U, (uint64_t)3081542470065122U, - (uint64_t)910331750163991U, (uint64_t)2110498143869827U, (uint64_t)3208473121852657U, - (uint64_t)94687786224509U, (uint64_t)4113309027567819U, (uint64_t)4272179438357536U, - (uint64_t)1857418654076140U, (uint64_t)1672678841741004U, (uint64_t)94482160248411U, - (uint64_t)1928652436799020U, (uint64_t)1750866462381515U, (uint64_t)4048060485672270U, - (uint64_t)4006680581258587U, (uint64_t)14850434761312U, (uint64_t)2828734997081648U, - (uint64_t)1975589525873972U, (uint64_t)3724347738416009U, (uint64_t)597163266689736U, - (uint64_t)14568362978551U, (uint64_t)2203865455839744U, (uint64_t)2237034958890595U, - (uint64_t)1863572986731818U, (uint64_t)2329774560279041U, (uint64_t)245105447642201U, - (uint64_t)2179697447864822U, (uint64_t)1769609498189882U, (uint64_t)1916950746430931U, - (uint64_t)847019613787312U, (uint64_t)163210606565100U, (uint64_t)3658248417400062U, - (uint64_t)717138296045881U, (uint64_t)42531212306121U, (uint64_t)1040915917097532U, - (uint64_t)77364489101310U, (uint64_t)539253504015590U, (uint64_t)732690726289841U, - (uint64_t)3401622034697806U, (uint64_t)2864593278358513U, (uint64_t)142611941887017U, - (uint64_t)536364617506702U, (uint64_t)845071859974284U, (uint64_t)4461787417089721U, - (uint64_t)2633811871939723U, (uint64_t)113619731985610U, (uint64_t)2535870015489566U, - (uint64_t)2146224665077830U, (uint64_t)2593725534662047U, (uint64_t)1332349537449710U, - (uint64_t)153375287068096U, (uint64_t)3689977177165276U, (uint64_t)3631865615314120U, - (uint64_t)184644878348929U, (uint64_t)2220481726602813U, (uint64_t)204002551273091U, - (uint64_t)3022560051766785U, (uint64_t)3125940458001213U, (uint64_t)4258299086906325U, - (uint64_t)1072471915162030U, (uint64_t)2797562724530U, (uint64_t)3974298156223059U, - (uint64_t)1624778551002554U, (uint64_t)3490703864485971U, (uint64_t)2533877484212458U, - (uint64_t)176107782538555U, (uint64_t)4275987398312137U, (uint64_t)4397120757693722U, - (uint64_t)3001292763847390U, (uint64_t)1556490837621310U, (uint64_t)70442953037671U, - (uint64_t)1558915972545974U, (uint64_t)744724505252845U, (uint64_t)2697230204313363U, - (uint64_t)3495671924212144U, (uint64_t)95744296878924U, (uint64_t)1508848630912047U, - (uint64_t)4163599342850968U, (uint64_t)1234988733935901U, (uint64_t)3789722472212706U, - (uint64_t)219522007052022U, (uint64_t)2106597506701262U, (uint64_t)3231115099832239U, - (uint64_t)1296436890593905U, (uint64_t)1016795619587656U, (uint64_t)231150565033388U, - (uint64_t)4205501688458754U, (uint64_t)2271569140386062U, (uint64_t)3421769599058157U, - (uint64_t)4118408853784554U, (uint64_t)276709341465173U, (uint64_t)2681340614854362U, - (uint64_t)2514413365628788U, (uint64_t)62294545067341U, (uint64_t)277610220069365U, - (uint64_t)252463150123799U, (uint64_t)2547353593759399U, (uint64_t)1857438147448607U, - (uint64_t)2964811969681256U, (uint64_t)3303706463835387U, (uint64_t)248936570980853U, - (uint64_t)3208982702478009U, (uint64_t)2518671051730787U, (uint64_t)727433853033835U, - (uint64_t)1290389308223446U, (uint64_t)220742793981035U, (uint64_t)3851225361654709U, - (uint64_t)2307489307934273U, (uint64_t)1151710489948266U, (uint64_t)289775285210516U, - (uint64_t)222685002397295U, (uint64_t)1222117478082108U, (uint64_t)2822029169395728U, - (uint64_t)1172146252219882U, (uint64_t)2626108105510259U, (uint64_t)209803527887167U, - (uint64_t)2718831919953281U, (uint64_t)4348638387588593U, (uint64_t)3761438313263183U, - (uint64_t)13169515318095U, (uint64_t)212893621229476U + 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, + 34056422761564ULL, 3315864838337811ULL, 3797032336888745ULL, 2580641850480806ULL, + 208048944042500ULL, 1233795288689421ULL, 1048795233382631ULL, 646545158071530ULL, + 1816025742137285ULL, 12245672982162ULL, 2119364213800870ULL, 2034960311715107ULL, + 3172697815804487ULL, 4185144850224160ULL, 2792055915674ULL, 795534452139321ULL, + 3647836177838185ULL, 2681403398797991ULL, 3149264270306207ULL, 278704080615511ULL, + 2752552368344718ULL, 1363840972378818ULL, 1877521512083293ULL, 1862111388059470ULL, + 36200324115014ULL, 4183622899327217ULL, 747381675363076ULL, 2772916395314624ULL, + 833767013119965ULL, 246274452928088ULL, 1526238021297781ULL, 3327534966022747ULL, + 1169012581910517ULL, 4430894603030025ULL, 149242742442115ULL, 1002569704307172ULL, + 2763252093432365ULL, 3037748497732938ULL, 2329811173939457ULL, 270769113180752ULL, + 4344092461623432ULL, 892200524589382ULL, 2511418516713970ULL, 103575031265398ULL, + 183736033430252ULL, 583003071257308ULL, 3357167344738425ULL, 4038099763242651ULL, + 1776250620957255ULL, 51334115864192ULL, 2616405698969611ULL, 1196364755910565ULL, + 3135228056210500ULL, 533729417611761ULL, 86564351229326ULL, 98936129527281ULL, + 4425305036630677ULL, 2980296390253408ULL, 2487091677325739ULL, 10501977234280ULL, + 1805646499831077ULL, 3120615962395477ULL, 3634629685307533ULL, 3009632755291436ULL, + 16794051906523ULL, 2465481597883214ULL, 211492787490403ULL, 1120942867046103ULL, + 486438308572108ULL, 76058986271771ULL, 2435216584587357ULL, 3076359381968283ULL, + 1071594491489655ULL, 3148707450339154ULL, 249332205737851ULL, 4171051176626809ULL, + 3165176227956388ULL, 2400901591835233ULL, 1435783621333022ULL, 20312753440321ULL, + 1767293887448005ULL, 685150647587522ULL, 2957187934449906ULL, 382661319140439ULL, + 177583591139601ULL, 2083572648630743ULL, 1083410277889419ULL, 4267902097868310ULL, + 679989918385081ULL, 123155311554032ULL, 2830267662472020ULL, 4476040509735924ULL, + 526697201585144ULL, 3465306430573135ULL, 2296616218591ULL, 1270626872734279ULL, + 1049740198790549ULL, 4197567214843444ULL, 1962225231320591ULL, 186125026796856ULL, + 737027567341142ULL, 4364616098174ULL, 3618884818756660ULL, 1236837563717668ULL, + 162873772439548ULL, 3081542470065122ULL, 910331750163991ULL, 2110498143869827ULL, + 3208473121852657ULL, 94687786224509ULL, 4113309027567819ULL, 4272179438357536ULL, + 1857418654076140ULL, 1672678841741004ULL, 94482160248411ULL, 1928652436799020ULL, + 1750866462381515ULL, 4048060485672270ULL, 4006680581258587ULL, 14850434761312ULL, + 2828734997081648ULL, 1975589525873972ULL, 3724347738416009ULL, 597163266689736ULL, + 14568362978551ULL, 2203865455839744ULL, 2237034958890595ULL, 1863572986731818ULL, + 2329774560279041ULL, 245105447642201ULL, 2179697447864822ULL, 1769609498189882ULL, + 1916950746430931ULL, 847019613787312ULL, 163210606565100ULL, 3658248417400062ULL, + 717138296045881ULL, 42531212306121ULL, 1040915917097532ULL, 77364489101310ULL, + 539253504015590ULL, 732690726289841ULL, 3401622034697806ULL, 2864593278358513ULL, + 142611941887017ULL, 536364617506702ULL, 845071859974284ULL, 4461787417089721ULL, + 2633811871939723ULL, 113619731985610ULL, 2535870015489566ULL, 2146224665077830ULL, + 2593725534662047ULL, 1332349537449710ULL, 153375287068096ULL, 3689977177165276ULL, + 3631865615314120ULL, 184644878348929ULL, 2220481726602813ULL, 204002551273091ULL, + 3022560051766785ULL, 3125940458001213ULL, 4258299086906325ULL, 1072471915162030ULL, + 2797562724530ULL, 3974298156223059ULL, 1624778551002554ULL, 3490703864485971ULL, + 2533877484212458ULL, 176107782538555ULL, 4275987398312137ULL, 4397120757693722ULL, + 3001292763847390ULL, 1556490837621310ULL, 70442953037671ULL, 1558915972545974ULL, + 744724505252845ULL, 2697230204313363ULL, 3495671924212144ULL, 95744296878924ULL, + 1508848630912047ULL, 4163599342850968ULL, 1234988733935901ULL, 3789722472212706ULL, + 219522007052022ULL, 2106597506701262ULL, 3231115099832239ULL, 1296436890593905ULL, + 1016795619587656ULL, 231150565033388ULL, 4205501688458754ULL, 2271569140386062ULL, + 3421769599058157ULL, 4118408853784554ULL, 276709341465173ULL, 2681340614854362ULL, + 2514413365628788ULL, 62294545067341ULL, 277610220069365ULL, 252463150123799ULL, + 2547353593759399ULL, 1857438147448607ULL, 2964811969681256ULL, 3303706463835387ULL, + 248936570980853ULL, 3208982702478009ULL, 2518671051730787ULL, 727433853033835ULL, + 1290389308223446ULL, 220742793981035ULL, 3851225361654709ULL, 2307489307934273ULL, + 1151710489948266ULL, 289775285210516ULL, 222685002397295ULL, 1222117478082108ULL, + 2822029169395728ULL, 1172146252219882ULL, 2626108105510259ULL, 209803527887167ULL, + 2718831919953281ULL, 4348638387588593ULL, 3761438313263183ULL, 13169515318095ULL, + 212893621229476ULL }; static const uint64_t Hacl_K256_PrecompTable_precomp_basepoint_table_w5[480U] = { - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)705178180786072U, - (uint64_t)3855836460717471U, (uint64_t)4089131105950716U, (uint64_t)3301581525494108U, - (uint64_t)133858670344668U, (uint64_t)2199641648059576U, (uint64_t)1278080618437060U, - (uint64_t)3959378566518708U, (uint64_t)3455034269351872U, (uint64_t)79417610544803U, - (uint64_t)1U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, - (uint64_t)1282049064345544U, (uint64_t)971732600440099U, (uint64_t)1014594595727339U, - (uint64_t)4392159187541980U, (uint64_t)268327875692285U, (uint64_t)2411661712280539U, - (uint64_t)1092576199280126U, (uint64_t)4328619610718051U, (uint64_t)3535440816471627U, - (uint64_t)95182251488556U, (uint64_t)1893725512243753U, (uint64_t)3619861457111820U, - (uint64_t)879374960417905U, (uint64_t)2868056058129113U, (uint64_t)273195291893682U, - (uint64_t)2044797305960112U, (uint64_t)2357106853933780U, (uint64_t)3563112438336058U, - (uint64_t)2430811541762558U, (uint64_t)106443809495428U, (uint64_t)2231357633909668U, - (uint64_t)3641705835951936U, (uint64_t)80642569314189U, (uint64_t)2254841882373268U, - (uint64_t)149848031966573U, (uint64_t)2304615661367764U, (uint64_t)2410957403736446U, - (uint64_t)2712754805859804U, (uint64_t)2440183877540536U, (uint64_t)99784623895865U, - (uint64_t)3667773127482758U, (uint64_t)1354899394473308U, (uint64_t)3636602998800808U, - (uint64_t)2709296679846364U, (uint64_t)7253362091963U, (uint64_t)3585950735562744U, - (uint64_t)935775991758415U, (uint64_t)4108078106735201U, (uint64_t)556081800336307U, - (uint64_t)229585977163057U, (uint64_t)4055594186679801U, (uint64_t)1767681004944933U, - (uint64_t)1432634922083242U, (uint64_t)534935602949197U, (uint64_t)251753159522567U, - (uint64_t)2846474078499321U, (uint64_t)4488649590348702U, (uint64_t)2437476916025038U, - (uint64_t)3040577412822874U, (uint64_t)79405234918614U, (uint64_t)3030621226551508U, - (uint64_t)2801117003929806U, (uint64_t)1642927515498422U, (uint64_t)2802725079726297U, - (uint64_t)8472780626107U, (uint64_t)866068070352655U, (uint64_t)188080768545106U, - (uint64_t)2152119998903058U, (uint64_t)3391239985029665U, (uint64_t)23820026013564U, - (uint64_t)2965064154891949U, (uint64_t)1846516097921398U, (uint64_t)4418379948133146U, - (uint64_t)3137755426942400U, (uint64_t)47705291301781U, (uint64_t)4278533051105665U, - (uint64_t)3453643211214931U, (uint64_t)3379734319145156U, (uint64_t)3762442192097039U, - (uint64_t)40243003528694U, (uint64_t)4063448994211201U, (uint64_t)5697015368785U, - (uint64_t)1006545411838613U, (uint64_t)4242291693755210U, (uint64_t)135184629190512U, - (uint64_t)264898689131035U, (uint64_t)611796474823597U, (uint64_t)3255382250029089U, - (uint64_t)3490429246984696U, (uint64_t)236558595864362U, (uint64_t)2055934691551704U, - (uint64_t)1487711670114502U, (uint64_t)1823930698221632U, (uint64_t)2130937287438472U, - (uint64_t)154610053389779U, (uint64_t)2746573287023216U, (uint64_t)2430987262221221U, - (uint64_t)1668741642878689U, (uint64_t)904982541243977U, (uint64_t)56087343124948U, - (uint64_t)393905062353536U, (uint64_t)412681877350188U, (uint64_t)3153602040979977U, - (uint64_t)4466820876224989U, (uint64_t)146579165617857U, (uint64_t)2628741216508991U, - (uint64_t)747994231529806U, (uint64_t)750506569317681U, (uint64_t)1887492790748779U, - (uint64_t)35259008682771U, (uint64_t)2085116434894208U, (uint64_t)543291398921711U, - (uint64_t)1144362007901552U, (uint64_t)679305136036846U, (uint64_t)141090902244489U, - (uint64_t)632480954474859U, (uint64_t)2384513102652591U, (uint64_t)2225529790159790U, - (uint64_t)692258664851625U, (uint64_t)198681843567699U, (uint64_t)2397092587228181U, - (uint64_t)145862822166614U, (uint64_t)196976540479452U, (uint64_t)3321831130141455U, - (uint64_t)69266673089832U, (uint64_t)4469644227342284U, (uint64_t)3899271145504796U, - (uint64_t)1261890974076660U, (uint64_t)525357673886694U, (uint64_t)182135997828583U, - (uint64_t)4292760618810332U, (uint64_t)3404186545541683U, (uint64_t)312297386688768U, - (uint64_t)204377466824608U, (uint64_t)230900767857952U, (uint64_t)3871485172339693U, - (uint64_t)779449329662955U, (uint64_t)978655822464694U, (uint64_t)2278252139594027U, - (uint64_t)104641527040382U, (uint64_t)3528840153625765U, (uint64_t)4484699080275273U, - (uint64_t)1463971951102316U, (uint64_t)4013910812844749U, (uint64_t)228915589433620U, - (uint64_t)1209641433482461U, (uint64_t)4043178788774759U, (uint64_t)3008668238856634U, - (uint64_t)1448425089071412U, (uint64_t)26269719725037U, (uint64_t)3330785027545223U, - (uint64_t)852657975349259U, (uint64_t)227245054466105U, (uint64_t)1534632353984777U, - (uint64_t)207715098574660U, (uint64_t)3209837527352280U, (uint64_t)4051688046309066U, - (uint64_t)3839009590725955U, (uint64_t)1321506437398842U, (uint64_t)68340219159928U, - (uint64_t)1806950276956275U, (uint64_t)3923908055275295U, (uint64_t)743963253393575U, - (uint64_t)42162407478783U, (uint64_t)261334584474610U, (uint64_t)3728224928885214U, - (uint64_t)4004701081842869U, (uint64_t)709043201644674U, (uint64_t)4267294249150171U, - (uint64_t)255540582975025U, (uint64_t)875490593722211U, (uint64_t)796393708218375U, - (uint64_t)14774425627956U, (uint64_t)1500040516752097U, (uint64_t)141076627721678U, - (uint64_t)2634539368480628U, (uint64_t)1106488853550103U, (uint64_t)2346231921151930U, - (uint64_t)897108283954283U, (uint64_t)64616679559843U, (uint64_t)400244949840943U, - (uint64_t)1731263826831733U, (uint64_t)1649996579904651U, (uint64_t)3643693449640761U, - (uint64_t)172543068638991U, (uint64_t)329537981097182U, (uint64_t)2029799860802869U, - (uint64_t)4377737515208862U, (uint64_t)29103311051334U, (uint64_t)265583594111499U, - (uint64_t)3798074876561255U, (uint64_t)184749333259352U, (uint64_t)3117395073661801U, - (uint64_t)3695784565008833U, (uint64_t)64282709896721U, (uint64_t)1618968913246422U, - (uint64_t)3185235128095257U, (uint64_t)3288745068118692U, (uint64_t)1963818603508782U, - (uint64_t)281054350739495U, (uint64_t)1658639050810346U, (uint64_t)3061097601679552U, - (uint64_t)3023781433263746U, (uint64_t)2770283391242475U, (uint64_t)144508864751908U, - (uint64_t)173576288079856U, (uint64_t)46114579547054U, (uint64_t)1679480127300211U, - (uint64_t)1683062051644007U, (uint64_t)117183826129323U, (uint64_t)1894068608117440U, - (uint64_t)3846899838975733U, (uint64_t)4289279019496192U, (uint64_t)176995887914031U, - (uint64_t)78074942938713U, (uint64_t)454207263265292U, (uint64_t)972683614054061U, - (uint64_t)808474205144361U, (uint64_t)942703935951735U, (uint64_t)134460241077887U, - (uint64_t)2104196179349630U, (uint64_t)501632371208418U, (uint64_t)1666838991431177U, - (uint64_t)445606193139838U, (uint64_t)73704603396096U, (uint64_t)3140284774064777U, - (uint64_t)1356066420820179U, (uint64_t)227054159419281U, (uint64_t)1847611229198687U, - (uint64_t)82327838827660U, (uint64_t)3704027573265803U, (uint64_t)1585260489220244U, - (uint64_t)4404647914931933U, (uint64_t)2424649827425515U, (uint64_t)206821944206116U, - (uint64_t)1508635776287972U, (uint64_t)1933584575629676U, (uint64_t)1903635423783032U, - (uint64_t)4193642165165650U, (uint64_t)234321074690644U, (uint64_t)210406774251925U, - (uint64_t)1965845668185599U, (uint64_t)3059839433804731U, (uint64_t)1933300510683631U, - (uint64_t)150696600689211U, (uint64_t)4069293682158567U, (uint64_t)4346344602660044U, - (uint64_t)312200249664561U, (uint64_t)2495020807621840U, (uint64_t)1912707714385U, - (uint64_t)299345978159762U, (uint64_t)1164752722686920U, (uint64_t)225322433710338U, - (uint64_t)3128747381283759U, (uint64_t)275659067815583U, (uint64_t)1489671057429039U, - (uint64_t)1567693343342676U, (uint64_t)921672046098071U, (uint64_t)3707418899384085U, - (uint64_t)54646424931593U, (uint64_t)4026733380127147U, (uint64_t)2933435393699231U, - (uint64_t)3356593659521967U, (uint64_t)3637750749325529U, (uint64_t)232939412379045U, - (uint64_t)2298399636043069U, (uint64_t)270361546063041U, (uint64_t)2523933572551420U, - (uint64_t)3456896091572950U, (uint64_t)185447004732850U, (uint64_t)429322937697821U, - (uint64_t)2579704215668222U, (uint64_t)695065378803349U, (uint64_t)3987916247731243U, - (uint64_t)255159546348233U, (uint64_t)3057777929921282U, (uint64_t)1608970699916312U, - (uint64_t)1902369623063807U, (uint64_t)1413619643652777U, (uint64_t)94983996321227U, - (uint64_t)2832873179548050U, (uint64_t)4335430233622555U, (uint64_t)1559023976028843U, - (uint64_t)3297181988648895U, (uint64_t)100072021232323U, (uint64_t)2124984034109675U, - (uint64_t)4501252835618918U, (uint64_t)2053336899483297U, (uint64_t)638807226463876U, - (uint64_t)278445213600634U, (uint64_t)2311236445660555U, (uint64_t)303317664040012U, - (uint64_t)2659353858089024U, (uint64_t)3598827423980130U, (uint64_t)176059343827873U, - (uint64_t)3891639526275437U, (uint64_t)252823982819463U, (uint64_t)3404823300622345U, - (uint64_t)2758370772497456U, (uint64_t)91397496598783U, (uint64_t)2248661144141892U, - (uint64_t)491087075271969U, (uint64_t)1786344894571315U, (uint64_t)452497694885923U, - (uint64_t)34039628873357U, (uint64_t)2116503165025197U, (uint64_t)4436733709429923U, - (uint64_t)3045800776819238U, (uint64_t)1385518906078375U, (uint64_t)110495603336764U, - (uint64_t)4051447296249587U, (uint64_t)1103557421498625U, (uint64_t)1840785058439622U, - (uint64_t)425322753992314U, (uint64_t)98330046771676U, (uint64_t)365407468686431U, - (uint64_t)2611246859977123U, (uint64_t)3050253933135339U, (uint64_t)1006482220896688U, - (uint64_t)166818196428389U, (uint64_t)3415236093104372U, (uint64_t)1762308883882288U, - (uint64_t)1327828123094558U, (uint64_t)3403946425556706U, (uint64_t)96503464455441U, - (uint64_t)3893015304031471U, (uint64_t)3740839477490397U, (uint64_t)2411470812852231U, - (uint64_t)940927462436211U, (uint64_t)163825285911099U, (uint64_t)1622441495640386U, - (uint64_t)850224095680266U, (uint64_t)76199085900939U, (uint64_t)1941852365144042U, - (uint64_t)140326673652807U, (uint64_t)3161611011249524U, (uint64_t)317297150009965U, - (uint64_t)2145053259340619U, (uint64_t)2180498176457552U, (uint64_t)38457740506224U, - (uint64_t)394174899129468U, (uint64_t)2687474560485245U, (uint64_t)1542175980184516U, - (uint64_t)1628502671124819U, (uint64_t)48477401124385U, (uint64_t)4474181600025082U, - (uint64_t)2142747956365708U, (uint64_t)1638299432475478U, (uint64_t)2005869320353249U, - (uint64_t)112292630760956U, (uint64_t)1887521965171588U, (uint64_t)457587531429696U, - (uint64_t)840994209504042U, (uint64_t)4268060856325798U, (uint64_t)195597993440388U, - (uint64_t)4148484749020338U, (uint64_t)2074885000909672U, (uint64_t)2309839019263165U, - (uint64_t)2087616209681024U, (uint64_t)257214370719966U, (uint64_t)2331363508376581U, - (uint64_t)1233124357504711U, (uint64_t)2849542202650296U, (uint64_t)3790982825325736U, - (uint64_t)13381453503890U, (uint64_t)1665246594531069U, (uint64_t)4165624287443904U, - (uint64_t)3418759698027493U, (uint64_t)2118493255117399U, (uint64_t)136249206366067U, - (uint64_t)4064050233283309U, (uint64_t)1368779887911300U, (uint64_t)4370550759530269U, - (uint64_t)66992990631341U, (uint64_t)84442368922270U, (uint64_t)2139322635321394U, - (uint64_t)2076163483726795U, (uint64_t)657097866349103U, (uint64_t)2095579409488071U, - (uint64_t)226525774791341U, (uint64_t)4445744257665359U, (uint64_t)2035752839278107U, - (uint64_t)1998242662838304U, (uint64_t)1601548415521694U, (uint64_t)151297684296198U, - (uint64_t)1350963039017303U, (uint64_t)2624916349548281U, (uint64_t)2018863259670197U, - (uint64_t)2717274357461290U, (uint64_t)94024796961533U, (uint64_t)711335520409111U, - (uint64_t)4322093765820263U, (uint64_t)2041650358174649U, (uint64_t)3439791603157577U, - (uint64_t)179292018616267U, (uint64_t)2436436921286669U, (uint64_t)3905268797208340U, - (uint64_t)2829194895162985U, (uint64_t)1355175382191543U, (uint64_t)55128779761539U, - (uint64_t)2648428998786922U, (uint64_t)869805912573515U, (uint64_t)3706708942847864U, - (uint64_t)2785288916584667U, (uint64_t)37156862850147U, (uint64_t)1422245336293228U, - (uint64_t)4497066058933021U, (uint64_t)85588912978349U, (uint64_t)2616252221194611U, - (uint64_t)53506393720989U, (uint64_t)3727539190732644U, (uint64_t)872132446545237U, - (uint64_t)933583590986077U, (uint64_t)3794591170581203U, (uint64_t)167875550514069U, - (uint64_t)2267466834993297U, (uint64_t)3072652681756816U, (uint64_t)2108499037430803U, - (uint64_t)1606735192928366U, (uint64_t)72339568815255U, (uint64_t)3258484260684219U, - (uint64_t)3277927277719855U, (uint64_t)2459560373011535U, (uint64_t)1672794293294033U, - (uint64_t)227460934880669U, (uint64_t)3702454405413705U, (uint64_t)106168148441676U, - (uint64_t)1356617643071159U, (uint64_t)3280896569942762U, (uint64_t)142618711614302U, - (uint64_t)4291782740862057U, (uint64_t)4141020884874235U, (uint64_t)3720787221267125U, - (uint64_t)552884940089351U, (uint64_t)174626154407180U, (uint64_t)972071013326540U, - (uint64_t)4458530419931903U, (uint64_t)4435168973822858U, (uint64_t)1902967548748411U, - (uint64_t)53007977605840U, (uint64_t)2453997334323925U, (uint64_t)3653077937283262U, - (uint64_t)850660265046356U, (uint64_t)312721924805450U, (uint64_t)268503679240683U, - (uint64_t)256960167714122U, (uint64_t)1474492507858350U, (uint64_t)2456345526438488U, - (uint64_t)3686029507160255U, (uint64_t)279158933010398U, (uint64_t)3646946293948063U, - (uint64_t)704477527214036U, (uint64_t)3387744169891031U, (uint64_t)3772622670980241U, - (uint64_t)136368897543304U, (uint64_t)3744894052577607U, (uint64_t)1976007214443430U, - (uint64_t)2090045379763451U, (uint64_t)968565474458988U, (uint64_t)234295114806066U + 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, 0ULL, + 705178180786072ULL, 3855836460717471ULL, 4089131105950716ULL, 3301581525494108ULL, + 133858670344668ULL, 2199641648059576ULL, 1278080618437060ULL, 3959378566518708ULL, + 3455034269351872ULL, 79417610544803ULL, 1ULL, 0ULL, 0ULL, 0ULL, 0ULL, 1282049064345544ULL, + 971732600440099ULL, 1014594595727339ULL, 4392159187541980ULL, 268327875692285ULL, + 2411661712280539ULL, 1092576199280126ULL, 4328619610718051ULL, 3535440816471627ULL, + 95182251488556ULL, 1893725512243753ULL, 3619861457111820ULL, 879374960417905ULL, + 2868056058129113ULL, 273195291893682ULL, 2044797305960112ULL, 2357106853933780ULL, + 3563112438336058ULL, 2430811541762558ULL, 106443809495428ULL, 2231357633909668ULL, + 3641705835951936ULL, 80642569314189ULL, 2254841882373268ULL, 149848031966573ULL, + 2304615661367764ULL, 2410957403736446ULL, 2712754805859804ULL, 2440183877540536ULL, + 99784623895865ULL, 3667773127482758ULL, 1354899394473308ULL, 3636602998800808ULL, + 2709296679846364ULL, 7253362091963ULL, 3585950735562744ULL, 935775991758415ULL, + 4108078106735201ULL, 556081800336307ULL, 229585977163057ULL, 4055594186679801ULL, + 1767681004944933ULL, 1432634922083242ULL, 534935602949197ULL, 251753159522567ULL, + 2846474078499321ULL, 4488649590348702ULL, 2437476916025038ULL, 3040577412822874ULL, + 79405234918614ULL, 3030621226551508ULL, 2801117003929806ULL, 1642927515498422ULL, + 2802725079726297ULL, 8472780626107ULL, 866068070352655ULL, 188080768545106ULL, + 2152119998903058ULL, 3391239985029665ULL, 23820026013564ULL, 2965064154891949ULL, + 1846516097921398ULL, 4418379948133146ULL, 3137755426942400ULL, 47705291301781ULL, + 4278533051105665ULL, 3453643211214931ULL, 3379734319145156ULL, 3762442192097039ULL, + 40243003528694ULL, 4063448994211201ULL, 5697015368785ULL, 1006545411838613ULL, + 4242291693755210ULL, 135184629190512ULL, 264898689131035ULL, 611796474823597ULL, + 3255382250029089ULL, 3490429246984696ULL, 236558595864362ULL, 2055934691551704ULL, + 1487711670114502ULL, 1823930698221632ULL, 2130937287438472ULL, 154610053389779ULL, + 2746573287023216ULL, 2430987262221221ULL, 1668741642878689ULL, 904982541243977ULL, + 56087343124948ULL, 393905062353536ULL, 412681877350188ULL, 3153602040979977ULL, + 4466820876224989ULL, 146579165617857ULL, 2628741216508991ULL, 747994231529806ULL, + 750506569317681ULL, 1887492790748779ULL, 35259008682771ULL, 2085116434894208ULL, + 543291398921711ULL, 1144362007901552ULL, 679305136036846ULL, 141090902244489ULL, + 632480954474859ULL, 2384513102652591ULL, 2225529790159790ULL, 692258664851625ULL, + 198681843567699ULL, 2397092587228181ULL, 145862822166614ULL, 196976540479452ULL, + 3321831130141455ULL, 69266673089832ULL, 4469644227342284ULL, 3899271145504796ULL, + 1261890974076660ULL, 525357673886694ULL, 182135997828583ULL, 4292760618810332ULL, + 3404186545541683ULL, 312297386688768ULL, 204377466824608ULL, 230900767857952ULL, + 3871485172339693ULL, 779449329662955ULL, 978655822464694ULL, 2278252139594027ULL, + 104641527040382ULL, 3528840153625765ULL, 4484699080275273ULL, 1463971951102316ULL, + 4013910812844749ULL, 228915589433620ULL, 1209641433482461ULL, 4043178788774759ULL, + 3008668238856634ULL, 1448425089071412ULL, 26269719725037ULL, 3330785027545223ULL, + 852657975349259ULL, 227245054466105ULL, 1534632353984777ULL, 207715098574660ULL, + 3209837527352280ULL, 4051688046309066ULL, 3839009590725955ULL, 1321506437398842ULL, + 68340219159928ULL, 1806950276956275ULL, 3923908055275295ULL, 743963253393575ULL, + 42162407478783ULL, 261334584474610ULL, 3728224928885214ULL, 4004701081842869ULL, + 709043201644674ULL, 4267294249150171ULL, 255540582975025ULL, 875490593722211ULL, + 796393708218375ULL, 14774425627956ULL, 1500040516752097ULL, 141076627721678ULL, + 2634539368480628ULL, 1106488853550103ULL, 2346231921151930ULL, 897108283954283ULL, + 64616679559843ULL, 400244949840943ULL, 1731263826831733ULL, 1649996579904651ULL, + 3643693449640761ULL, 172543068638991ULL, 329537981097182ULL, 2029799860802869ULL, + 4377737515208862ULL, 29103311051334ULL, 265583594111499ULL, 3798074876561255ULL, + 184749333259352ULL, 3117395073661801ULL, 3695784565008833ULL, 64282709896721ULL, + 1618968913246422ULL, 3185235128095257ULL, 3288745068118692ULL, 1963818603508782ULL, + 281054350739495ULL, 1658639050810346ULL, 3061097601679552ULL, 3023781433263746ULL, + 2770283391242475ULL, 144508864751908ULL, 173576288079856ULL, 46114579547054ULL, + 1679480127300211ULL, 1683062051644007ULL, 117183826129323ULL, 1894068608117440ULL, + 3846899838975733ULL, 4289279019496192ULL, 176995887914031ULL, 78074942938713ULL, + 454207263265292ULL, 972683614054061ULL, 808474205144361ULL, 942703935951735ULL, + 134460241077887ULL, 2104196179349630ULL, 501632371208418ULL, 1666838991431177ULL, + 445606193139838ULL, 73704603396096ULL, 3140284774064777ULL, 1356066420820179ULL, + 227054159419281ULL, 1847611229198687ULL, 82327838827660ULL, 3704027573265803ULL, + 1585260489220244ULL, 4404647914931933ULL, 2424649827425515ULL, 206821944206116ULL, + 1508635776287972ULL, 1933584575629676ULL, 1903635423783032ULL, 4193642165165650ULL, + 234321074690644ULL, 210406774251925ULL, 1965845668185599ULL, 3059839433804731ULL, + 1933300510683631ULL, 150696600689211ULL, 4069293682158567ULL, 4346344602660044ULL, + 312200249664561ULL, 2495020807621840ULL, 1912707714385ULL, 299345978159762ULL, + 1164752722686920ULL, 225322433710338ULL, 3128747381283759ULL, 275659067815583ULL, + 1489671057429039ULL, 1567693343342676ULL, 921672046098071ULL, 3707418899384085ULL, + 54646424931593ULL, 4026733380127147ULL, 2933435393699231ULL, 3356593659521967ULL, + 3637750749325529ULL, 232939412379045ULL, 2298399636043069ULL, 270361546063041ULL, + 2523933572551420ULL, 3456896091572950ULL, 185447004732850ULL, 429322937697821ULL, + 2579704215668222ULL, 695065378803349ULL, 3987916247731243ULL, 255159546348233ULL, + 3057777929921282ULL, 1608970699916312ULL, 1902369623063807ULL, 1413619643652777ULL, + 94983996321227ULL, 2832873179548050ULL, 4335430233622555ULL, 1559023976028843ULL, + 3297181988648895ULL, 100072021232323ULL, 2124984034109675ULL, 4501252835618918ULL, + 2053336899483297ULL, 638807226463876ULL, 278445213600634ULL, 2311236445660555ULL, + 303317664040012ULL, 2659353858089024ULL, 3598827423980130ULL, 176059343827873ULL, + 3891639526275437ULL, 252823982819463ULL, 3404823300622345ULL, 2758370772497456ULL, + 91397496598783ULL, 2248661144141892ULL, 491087075271969ULL, 1786344894571315ULL, + 452497694885923ULL, 34039628873357ULL, 2116503165025197ULL, 4436733709429923ULL, + 3045800776819238ULL, 1385518906078375ULL, 110495603336764ULL, 4051447296249587ULL, + 1103557421498625ULL, 1840785058439622ULL, 425322753992314ULL, 98330046771676ULL, + 365407468686431ULL, 2611246859977123ULL, 3050253933135339ULL, 1006482220896688ULL, + 166818196428389ULL, 3415236093104372ULL, 1762308883882288ULL, 1327828123094558ULL, + 3403946425556706ULL, 96503464455441ULL, 3893015304031471ULL, 3740839477490397ULL, + 2411470812852231ULL, 940927462436211ULL, 163825285911099ULL, 1622441495640386ULL, + 850224095680266ULL, 76199085900939ULL, 1941852365144042ULL, 140326673652807ULL, + 3161611011249524ULL, 317297150009965ULL, 2145053259340619ULL, 2180498176457552ULL, + 38457740506224ULL, 394174899129468ULL, 2687474560485245ULL, 1542175980184516ULL, + 1628502671124819ULL, 48477401124385ULL, 4474181600025082ULL, 2142747956365708ULL, + 1638299432475478ULL, 2005869320353249ULL, 112292630760956ULL, 1887521965171588ULL, + 457587531429696ULL, 840994209504042ULL, 4268060856325798ULL, 195597993440388ULL, + 4148484749020338ULL, 2074885000909672ULL, 2309839019263165ULL, 2087616209681024ULL, + 257214370719966ULL, 2331363508376581ULL, 1233124357504711ULL, 2849542202650296ULL, + 3790982825325736ULL, 13381453503890ULL, 1665246594531069ULL, 4165624287443904ULL, + 3418759698027493ULL, 2118493255117399ULL, 136249206366067ULL, 4064050233283309ULL, + 1368779887911300ULL, 4370550759530269ULL, 66992990631341ULL, 84442368922270ULL, + 2139322635321394ULL, 2076163483726795ULL, 657097866349103ULL, 2095579409488071ULL, + 226525774791341ULL, 4445744257665359ULL, 2035752839278107ULL, 1998242662838304ULL, + 1601548415521694ULL, 151297684296198ULL, 1350963039017303ULL, 2624916349548281ULL, + 2018863259670197ULL, 2717274357461290ULL, 94024796961533ULL, 711335520409111ULL, + 4322093765820263ULL, 2041650358174649ULL, 3439791603157577ULL, 179292018616267ULL, + 2436436921286669ULL, 3905268797208340ULL, 2829194895162985ULL, 1355175382191543ULL, + 55128779761539ULL, 2648428998786922ULL, 869805912573515ULL, 3706708942847864ULL, + 2785288916584667ULL, 37156862850147ULL, 1422245336293228ULL, 4497066058933021ULL, + 85588912978349ULL, 2616252221194611ULL, 53506393720989ULL, 3727539190732644ULL, + 872132446545237ULL, 933583590986077ULL, 3794591170581203ULL, 167875550514069ULL, + 2267466834993297ULL, 3072652681756816ULL, 2108499037430803ULL, 1606735192928366ULL, + 72339568815255ULL, 3258484260684219ULL, 3277927277719855ULL, 2459560373011535ULL, + 1672794293294033ULL, 227460934880669ULL, 3702454405413705ULL, 106168148441676ULL, + 1356617643071159ULL, 3280896569942762ULL, 142618711614302ULL, 4291782740862057ULL, + 4141020884874235ULL, 3720787221267125ULL, 552884940089351ULL, 174626154407180ULL, + 972071013326540ULL, 4458530419931903ULL, 4435168973822858ULL, 1902967548748411ULL, + 53007977605840ULL, 2453997334323925ULL, 3653077937283262ULL, 850660265046356ULL, + 312721924805450ULL, 268503679240683ULL, 256960167714122ULL, 1474492507858350ULL, + 2456345526438488ULL, 3686029507160255ULL, 279158933010398ULL, 3646946293948063ULL, + 704477527214036ULL, 3387744169891031ULL, 3772622670980241ULL, 136368897543304ULL, + 3744894052577607ULL, 1976007214443430ULL, 2090045379763451ULL, 968565474458988ULL, + 234295114806066ULL }; #if defined(__cplusplus) diff --git a/include/internal/Hacl_Poly1305_256.h b/include/msvc/internal/Hacl_MAC_Poly1305.h similarity index 77% rename from include/internal/Hacl_Poly1305_256.h rename to include/msvc/internal/Hacl_MAC_Poly1305.h index 21d78b16..29e1734a 100644 --- a/include/internal/Hacl_Poly1305_256.h +++ b/include/msvc/internal/Hacl_MAC_Poly1305.h @@ -23,8 +23,8 @@ */ -#ifndef __internal_Hacl_Poly1305_256_H -#define __internal_Hacl_Poly1305_256_H +#ifndef __internal_Hacl_MAC_Poly1305_H +#define __internal_Hacl_MAC_Poly1305_H #if defined(__cplusplus) extern "C" { @@ -35,21 +35,15 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -#include "../Hacl_Poly1305_256.h" -#include "libintvector.h" +#include "../Hacl_MAC_Poly1305.h" -void -Hacl_Impl_Poly1305_Field32xN_256_load_acc4(Lib_IntVector_Intrinsics_vec256 *acc, uint8_t *b); +void Hacl_MAC_Poly1305_poly1305_init(uint64_t *ctx, uint8_t *key); -void -Hacl_Impl_Poly1305_Field32xN_256_fmul_r4_normalize( - Lib_IntVector_Intrinsics_vec256 *out, - Lib_IntVector_Intrinsics_vec256 *p -); +void Hacl_MAC_Poly1305_poly1305_finish(uint8_t *tag, uint8_t *key, uint64_t *ctx); #if defined(__cplusplus) } #endif -#define __internal_Hacl_Poly1305_256_H_DEFINED +#define __internal_Hacl_MAC_Poly1305_H_DEFINED #endif diff --git a/include/Hacl_Poly1305_128.h b/include/msvc/internal/Hacl_MAC_Poly1305_Simd128.h similarity index 72% rename from include/Hacl_Poly1305_128.h rename to include/msvc/internal/Hacl_MAC_Poly1305_Simd128.h index 834d4a8a..fe120e43 100644 --- a/include/Hacl_Poly1305_128.h +++ b/include/msvc/internal/Hacl_MAC_Poly1305_Simd128.h @@ -23,8 +23,8 @@ */ -#ifndef __Hacl_Poly1305_128_H -#define __Hacl_Poly1305_128_H +#ifndef __internal_Hacl_MAC_Poly1305_Simd128_H +#define __internal_Hacl_MAC_Poly1305_Simd128_H #if defined(__cplusplus) extern "C" { @@ -35,33 +35,30 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" +#include "../Hacl_MAC_Poly1305_Simd128.h" #include "libintvector.h" -typedef Lib_IntVector_Intrinsics_vec128 *Hacl_Poly1305_128_poly1305_ctx; - -void Hacl_Poly1305_128_poly1305_init(Lib_IntVector_Intrinsics_vec128 *ctx, uint8_t *key); - -void Hacl_Poly1305_128_poly1305_update1(Lib_IntVector_Intrinsics_vec128 *ctx, uint8_t *text); +void Hacl_MAC_Poly1305_Simd128_load_acc2(Lib_IntVector_Intrinsics_vec128 *acc, uint8_t *b); void -Hacl_Poly1305_128_poly1305_update( - Lib_IntVector_Intrinsics_vec128 *ctx, - uint32_t len, - uint8_t *text +Hacl_MAC_Poly1305_Simd128_fmul_r2_normalize( + Lib_IntVector_Intrinsics_vec128 *out, + Lib_IntVector_Intrinsics_vec128 *p ); void -Hacl_Poly1305_128_poly1305_finish( +Hacl_MAC_Poly1305_Simd128_poly1305_init(Lib_IntVector_Intrinsics_vec128 *ctx, uint8_t *key); + +void +Hacl_MAC_Poly1305_Simd128_poly1305_finish( uint8_t *tag, uint8_t *key, Lib_IntVector_Intrinsics_vec128 *ctx ); -void Hacl_Poly1305_128_poly1305_mac(uint8_t *tag, uint32_t len, uint8_t *text, uint8_t *key); - #if defined(__cplusplus) } #endif -#define __Hacl_Poly1305_128_H_DEFINED +#define __internal_Hacl_MAC_Poly1305_Simd128_H_DEFINED #endif diff --git a/include/msvc/Hacl_Poly1305_256.h b/include/msvc/internal/Hacl_MAC_Poly1305_Simd256.h similarity index 72% rename from include/msvc/Hacl_Poly1305_256.h rename to include/msvc/internal/Hacl_MAC_Poly1305_Simd256.h index 9d1ae8c3..7bf106c1 100644 --- a/include/msvc/Hacl_Poly1305_256.h +++ b/include/msvc/internal/Hacl_MAC_Poly1305_Simd256.h @@ -23,8 +23,8 @@ */ -#ifndef __Hacl_Poly1305_256_H -#define __Hacl_Poly1305_256_H +#ifndef __internal_Hacl_MAC_Poly1305_Simd256_H +#define __internal_Hacl_MAC_Poly1305_Simd256_H #if defined(__cplusplus) extern "C" { @@ -35,33 +35,30 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" +#include "../Hacl_MAC_Poly1305_Simd256.h" #include "libintvector.h" -typedef Lib_IntVector_Intrinsics_vec256 *Hacl_Poly1305_256_poly1305_ctx; - -void Hacl_Poly1305_256_poly1305_init(Lib_IntVector_Intrinsics_vec256 *ctx, uint8_t *key); - -void Hacl_Poly1305_256_poly1305_update1(Lib_IntVector_Intrinsics_vec256 *ctx, uint8_t *text); +void Hacl_MAC_Poly1305_Simd256_load_acc4(Lib_IntVector_Intrinsics_vec256 *acc, uint8_t *b); void -Hacl_Poly1305_256_poly1305_update( - Lib_IntVector_Intrinsics_vec256 *ctx, - uint32_t len, - uint8_t *text +Hacl_MAC_Poly1305_Simd256_fmul_r4_normalize( + Lib_IntVector_Intrinsics_vec256 *out, + Lib_IntVector_Intrinsics_vec256 *p ); void -Hacl_Poly1305_256_poly1305_finish( +Hacl_MAC_Poly1305_Simd256_poly1305_init(Lib_IntVector_Intrinsics_vec256 *ctx, uint8_t *key); + +void +Hacl_MAC_Poly1305_Simd256_poly1305_finish( uint8_t *tag, uint8_t *key, Lib_IntVector_Intrinsics_vec256 *ctx ); -void Hacl_Poly1305_256_poly1305_mac(uint8_t *tag, uint32_t len, uint8_t *text, uint8_t *key); - #if defined(__cplusplus) } #endif -#define __Hacl_Poly1305_256_H_DEFINED +#define __internal_Hacl_MAC_Poly1305_Simd256_H_DEFINED #endif diff --git a/include/msvc/internal/Hacl_P256_PrecompTable.h b/include/msvc/internal/Hacl_P256_PrecompTable.h index f185c2be..c852ef8c 100644 --- a/include/msvc/internal/Hacl_P256_PrecompTable.h +++ b/include/msvc/internal/Hacl_P256_PrecompTable.h @@ -39,476 +39,360 @@ static const uint64_t Hacl_P256_PrecompTable_precomp_basepoint_table_w4[192U] = { - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, - (uint64_t)18446744069414584320U, (uint64_t)18446744073709551615U, (uint64_t)4294967294U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)8784043285714375740U, - (uint64_t)8483257759279461889U, (uint64_t)8789745728267363600U, (uint64_t)1770019616739251654U, - (uint64_t)15992936863339206154U, (uint64_t)10037038012062884956U, - (uint64_t)15197544864945402661U, (uint64_t)9615747158586711429U, (uint64_t)1U, - (uint64_t)18446744069414584320U, (uint64_t)18446744073709551615U, (uint64_t)4294967294U, - (uint64_t)10634854829044225757U, (uint64_t)351552716085025155U, (uint64_t)10645315080955407736U, - (uint64_t)3609262091244858135U, (uint64_t)15760741698986874125U, - (uint64_t)14936374388219697827U, (uint64_t)15751360096993017895U, - (uint64_t)18012233706239762398U, (uint64_t)1993877568177495041U, - (uint64_t)10345888787846536528U, (uint64_t)7746511691117935375U, - (uint64_t)14517043990409914413U, (uint64_t)14122549297570634151U, - (uint64_t)16934610359517083771U, (uint64_t)5724511325497097418U, (uint64_t)8983432969107448705U, - (uint64_t)2687429970334080245U, (uint64_t)16525396802810050288U, (uint64_t)7602596488871585854U, - (uint64_t)4813919589149203084U, (uint64_t)7680395813780804519U, (uint64_t)6687709583048023590U, - (uint64_t)18086445169104142027U, (uint64_t)9637814708330203929U, - (uint64_t)14785108459960679090U, (uint64_t)3838023279095023581U, (uint64_t)3555615526157830307U, - (uint64_t)5177066488380472871U, (uint64_t)18218186719108038403U, - (uint64_t)16281556341699656105U, (uint64_t)1524227924561461191U, (uint64_t)4148060517641909597U, - (uint64_t)2858290374115363433U, (uint64_t)8942772026334130620U, (uint64_t)3034451298319885113U, - (uint64_t)8447866036736640940U, (uint64_t)11204933433076256578U, - (uint64_t)18333595740249588297U, (uint64_t)8259597024804538246U, (uint64_t)9539734295777539786U, - (uint64_t)9797290423046626413U, (uint64_t)5777303437849646537U, (uint64_t)8739356909899132020U, - (uint64_t)14815960973766782158U, (uint64_t)15286581798204509801U, - (uint64_t)17597362577777019682U, (uint64_t)13259283710820519742U, - (uint64_t)10501322996899164670U, (uint64_t)1221138904338319642U, - (uint64_t)14586685489551951885U, (uint64_t)895326705426031212U, (uint64_t)14398171728560617847U, - (uint64_t)9592550823745097391U, (uint64_t)17240998489162206026U, (uint64_t)8085479283308189196U, - (uint64_t)14844657737893882826U, (uint64_t)15923425394150618234U, - (uint64_t)2997808084773249525U, (uint64_t)494323555453660587U, (uint64_t)1215695327517794764U, - (uint64_t)9476207381098391690U, (uint64_t)7480789678419122995U, (uint64_t)15212230329321082489U, - (uint64_t)436189395349576388U, (uint64_t)17377474396456660834U, (uint64_t)15237013929655017939U, - (uint64_t)11444428846883781676U, (uint64_t)5112749694521428575U, (uint64_t)950829367509872073U, - (uint64_t)17665036182057559519U, (uint64_t)17205133339690002313U, - (uint64_t)16233765170251334549U, (uint64_t)10122775683257972591U, - (uint64_t)3352514236455632420U, (uint64_t)9143148522359954691U, (uint64_t)601191684005658860U, - (uint64_t)13398772186646349998U, (uint64_t)15512696600132928431U, - (uint64_t)9128416073728948653U, (uint64_t)11233051033546138578U, (uint64_t)6769345682610122833U, - (uint64_t)10823233224575054288U, (uint64_t)9997725227559980175U, (uint64_t)6733425642852897415U, - (uint64_t)16302206918151466066U, (uint64_t)1669330822143265921U, (uint64_t)2661645605036546002U, - (uint64_t)17182558479745802165U, (uint64_t)1165082692376932040U, (uint64_t)9470595929011488359U, - (uint64_t)6142147329285324932U, (uint64_t)4829075085998111287U, (uint64_t)10231370681107338930U, - (uint64_t)9591876895322495239U, (uint64_t)10316468561384076618U, - (uint64_t)11592503647238064235U, (uint64_t)13395813606055179632U, (uint64_t)511127033980815508U, - (uint64_t)12434976573147649880U, (uint64_t)3425094795384359127U, (uint64_t)6816971736303023445U, - (uint64_t)15444670609021139344U, (uint64_t)9464349818322082360U, - (uint64_t)16178216413042376883U, (uint64_t)9595540370774317348U, (uint64_t)7229365182662875710U, - (uint64_t)4601177649460012843U, (uint64_t)5455046447382487090U, (uint64_t)10854066421606187521U, - (uint64_t)15913416821879788071U, (uint64_t)2297365362023460173U, (uint64_t)2603252216454941350U, - (uint64_t)6768791943870490934U, (uint64_t)15705936687122754810U, (uint64_t)9537096567546600694U, - (uint64_t)17580538144855035062U, (uint64_t)4496542856965746638U, (uint64_t)8444341625922124942U, - (uint64_t)12191263903636183168U, (uint64_t)17427332907535974165U, - (uint64_t)14307569739254103736U, (uint64_t)13900598742063266169U, - (uint64_t)7176996424355977650U, (uint64_t)5709008170379717479U, (uint64_t)14471312052264549092U, - (uint64_t)1464519909491759867U, (uint64_t)3328154641049602121U, (uint64_t)13020349337171136774U, - (uint64_t)2772166279972051938U, (uint64_t)10854476939425975292U, (uint64_t)1967189930534630940U, - (uint64_t)2802919076529341959U, (uint64_t)14792226094833519208U, - (uint64_t)14675640928566522177U, (uint64_t)14838974364643800837U, - (uint64_t)17631460696099549980U, (uint64_t)17434186275364935469U, - (uint64_t)2665648200587705473U, (uint64_t)13202122464492564051U, (uint64_t)7576287350918073341U, - (uint64_t)2272206013910186424U, (uint64_t)14558761641743937843U, (uint64_t)5675729149929979729U, - (uint64_t)9043135187561613166U, (uint64_t)11750149293830589225U, (uint64_t)740555197954307911U, - (uint64_t)9871738005087190699U, (uint64_t)17178667634283502053U, - (uint64_t)18046255991533013265U, (uint64_t)4458222096988430430U, (uint64_t)8452427758526311627U, - (uint64_t)13825286929656615266U, (uint64_t)13956286357198391218U, - (uint64_t)15875692916799995079U, (uint64_t)10634895319157013920U, - (uint64_t)13230116118036304207U, (uint64_t)8795317393614625606U, (uint64_t)7001710806858862020U, - (uint64_t)7949746088586183478U, (uint64_t)14677556044923602317U, - (uint64_t)11184023437485843904U, (uint64_t)11215864722023085094U, - (uint64_t)6444464081471519014U, (uint64_t)1706241174022415217U, (uint64_t)8243975633057550613U, - (uint64_t)15502902453836085864U, (uint64_t)3799182188594003953U, (uint64_t)3538840175098724094U + 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 18446744069414584320ULL, 18446744073709551615ULL, 4294967294ULL, + 0ULL, 0ULL, 0ULL, 0ULL, 8784043285714375740ULL, 8483257759279461889ULL, 8789745728267363600ULL, + 1770019616739251654ULL, 15992936863339206154ULL, 10037038012062884956ULL, + 15197544864945402661ULL, 9615747158586711429ULL, 1ULL, 18446744069414584320ULL, + 18446744073709551615ULL, 4294967294ULL, 10634854829044225757ULL, 351552716085025155ULL, + 10645315080955407736ULL, 3609262091244858135ULL, 15760741698986874125ULL, + 14936374388219697827ULL, 15751360096993017895ULL, 18012233706239762398ULL, + 1993877568177495041ULL, 10345888787846536528ULL, 7746511691117935375ULL, + 14517043990409914413ULL, 14122549297570634151ULL, 16934610359517083771ULL, + 5724511325497097418ULL, 8983432969107448705ULL, 2687429970334080245ULL, 16525396802810050288ULL, + 7602596488871585854ULL, 4813919589149203084ULL, 7680395813780804519ULL, 6687709583048023590ULL, + 18086445169104142027ULL, 9637814708330203929ULL, 14785108459960679090ULL, + 3838023279095023581ULL, 3555615526157830307ULL, 5177066488380472871ULL, 18218186719108038403ULL, + 16281556341699656105ULL, 1524227924561461191ULL, 4148060517641909597ULL, 2858290374115363433ULL, + 8942772026334130620ULL, 3034451298319885113ULL, 8447866036736640940ULL, 11204933433076256578ULL, + 18333595740249588297ULL, 8259597024804538246ULL, 9539734295777539786ULL, 9797290423046626413ULL, + 5777303437849646537ULL, 8739356909899132020ULL, 14815960973766782158ULL, + 15286581798204509801ULL, 17597362577777019682ULL, 13259283710820519742ULL, + 10501322996899164670ULL, 1221138904338319642ULL, 14586685489551951885ULL, 895326705426031212ULL, + 14398171728560617847ULL, 9592550823745097391ULL, 17240998489162206026ULL, + 8085479283308189196ULL, 14844657737893882826ULL, 15923425394150618234ULL, + 2997808084773249525ULL, 494323555453660587ULL, 1215695327517794764ULL, 9476207381098391690ULL, + 7480789678419122995ULL, 15212230329321082489ULL, 436189395349576388ULL, 17377474396456660834ULL, + 15237013929655017939ULL, 11444428846883781676ULL, 5112749694521428575ULL, 950829367509872073ULL, + 17665036182057559519ULL, 17205133339690002313ULL, 16233765170251334549ULL, + 10122775683257972591ULL, 3352514236455632420ULL, 9143148522359954691ULL, 601191684005658860ULL, + 13398772186646349998ULL, 15512696600132928431ULL, 9128416073728948653ULL, + 11233051033546138578ULL, 6769345682610122833ULL, 10823233224575054288ULL, + 9997725227559980175ULL, 6733425642852897415ULL, 16302206918151466066ULL, 1669330822143265921ULL, + 2661645605036546002ULL, 17182558479745802165ULL, 1165082692376932040ULL, 9470595929011488359ULL, + 6142147329285324932ULL, 4829075085998111287ULL, 10231370681107338930ULL, 9591876895322495239ULL, + 10316468561384076618ULL, 11592503647238064235ULL, 13395813606055179632ULL, + 511127033980815508ULL, 12434976573147649880ULL, 3425094795384359127ULL, 6816971736303023445ULL, + 15444670609021139344ULL, 9464349818322082360ULL, 16178216413042376883ULL, + 9595540370774317348ULL, 7229365182662875710ULL, 4601177649460012843ULL, 5455046447382487090ULL, + 10854066421606187521ULL, 15913416821879788071ULL, 2297365362023460173ULL, + 2603252216454941350ULL, 6768791943870490934ULL, 15705936687122754810ULL, 9537096567546600694ULL, + 17580538144855035062ULL, 4496542856965746638ULL, 8444341625922124942ULL, + 12191263903636183168ULL, 17427332907535974165ULL, 14307569739254103736ULL, + 13900598742063266169ULL, 7176996424355977650ULL, 5709008170379717479ULL, + 14471312052264549092ULL, 1464519909491759867ULL, 3328154641049602121ULL, + 13020349337171136774ULL, 2772166279972051938ULL, 10854476939425975292ULL, + 1967189930534630940ULL, 2802919076529341959ULL, 14792226094833519208ULL, + 14675640928566522177ULL, 14838974364643800837ULL, 17631460696099549980ULL, + 17434186275364935469ULL, 2665648200587705473ULL, 13202122464492564051ULL, + 7576287350918073341ULL, 2272206013910186424ULL, 14558761641743937843ULL, 5675729149929979729ULL, + 9043135187561613166ULL, 11750149293830589225ULL, 740555197954307911ULL, 9871738005087190699ULL, + 17178667634283502053ULL, 18046255991533013265ULL, 4458222096988430430ULL, + 8452427758526311627ULL, 13825286929656615266ULL, 13956286357198391218ULL, + 15875692916799995079ULL, 10634895319157013920ULL, 13230116118036304207ULL, + 8795317393614625606ULL, 7001710806858862020ULL, 7949746088586183478ULL, 14677556044923602317ULL, + 11184023437485843904ULL, 11215864722023085094ULL, 6444464081471519014ULL, + 1706241174022415217ULL, 8243975633057550613ULL, 15502902453836085864ULL, 3799182188594003953ULL, + 3538840175098724094ULL }; static const uint64_t Hacl_P256_PrecompTable_precomp_g_pow2_64_table_w4[192U] = { - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, - (uint64_t)18446744069414584320U, (uint64_t)18446744073709551615U, (uint64_t)4294967294U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1499621593102562565U, - (uint64_t)16692369783039433128U, (uint64_t)15337520135922861848U, - (uint64_t)5455737214495366228U, (uint64_t)17827017231032529600U, - (uint64_t)12413621606240782649U, (uint64_t)2290483008028286132U, - (uint64_t)15752017553340844820U, (uint64_t)4846430910634234874U, - (uint64_t)10861682798464583253U, (uint64_t)15404737222404363049U, (uint64_t)363586619281562022U, - (uint64_t)9866710912401645115U, (uint64_t)1162548847543228595U, (uint64_t)7649967190445130486U, - (uint64_t)5212340432230915749U, (uint64_t)7572620550182916491U, (uint64_t)14876145112448665096U, - (uint64_t)2063227348838176167U, (uint64_t)3519435548295415847U, (uint64_t)8390400282019023103U, - (uint64_t)17666843593163037841U, (uint64_t)9450204148816496323U, (uint64_t)8483374507652916768U, - (uint64_t)6254661047265818424U, (uint64_t)16382127809582285023U, (uint64_t)125359443771153172U, - (uint64_t)1374336701588437897U, (uint64_t)11362596098420127726U, (uint64_t)2101654420738681387U, - (uint64_t)12772780342444840510U, (uint64_t)12546934328908550060U, - (uint64_t)8331880412333790397U, (uint64_t)11687262051473819904U, (uint64_t)8926848496503457587U, - (uint64_t)9603974142010467857U, (uint64_t)13199952163826973175U, (uint64_t)2189856264898797734U, - (uint64_t)11356074861870267226U, (uint64_t)2027714896422561895U, (uint64_t)5261606367808050149U, - (uint64_t)153855954337762312U, (uint64_t)6375919692894573986U, (uint64_t)12364041207536146533U, - (uint64_t)1891896010455057160U, (uint64_t)1568123795087313171U, (uint64_t)18138710056556660101U, - (uint64_t)6004886947510047736U, (uint64_t)4811859325589542932U, (uint64_t)3618763430148954981U, - (uint64_t)11434521746258554122U, (uint64_t)10086341535864049427U, - (uint64_t)8073421629570399570U, (uint64_t)12680586148814729338U, (uint64_t)9619958020761569612U, - (uint64_t)15827203580658384478U, (uint64_t)12832694810937550406U, - (uint64_t)14977975484447400910U, (uint64_t)5478002389061063653U, - (uint64_t)14731136312639060880U, (uint64_t)4317867687275472033U, (uint64_t)6642650962855259884U, - (uint64_t)2514254944289495285U, (uint64_t)14231405641534478436U, (uint64_t)4045448346091518946U, - (uint64_t)8985477013445972471U, (uint64_t)8869039454457032149U, (uint64_t)4356978486208692970U, - (uint64_t)10805288613335538577U, (uint64_t)12832353127812502042U, - (uint64_t)4576590051676547490U, (uint64_t)6728053735138655107U, (uint64_t)17814206719173206184U, - (uint64_t)79790138573994940U, (uint64_t)17920293215101822267U, (uint64_t)13422026625585728864U, - (uint64_t)5018058010492547271U, (uint64_t)110232326023384102U, (uint64_t)10834264070056942976U, - (uint64_t)15222249086119088588U, (uint64_t)15119439519142044997U, - (uint64_t)11655511970063167313U, (uint64_t)1614477029450566107U, (uint64_t)3619322817271059794U, - (uint64_t)9352862040415412867U, (uint64_t)14017522553242747074U, - (uint64_t)13138513643674040327U, (uint64_t)3610195242889455765U, (uint64_t)8371069193996567291U, - (uint64_t)12670227996544662654U, (uint64_t)1205961025092146303U, - (uint64_t)13106709934003962112U, (uint64_t)4350113471327723407U, - (uint64_t)15060941403739680459U, (uint64_t)13639127647823205030U, - (uint64_t)10790943339357725715U, (uint64_t)498760574280648264U, (uint64_t)17922071907832082887U, - (uint64_t)15122670976670152145U, (uint64_t)6275027991110214322U, (uint64_t)7250912847491816402U, - (uint64_t)15206617260142982380U, (uint64_t)3385668313694152877U, - (uint64_t)17522479771766801905U, (uint64_t)2965919117476170655U, (uint64_t)1553238516603269404U, - (uint64_t)5820770015631050991U, (uint64_t)4999445222232605348U, (uint64_t)9245650860833717444U, - (uint64_t)1508811811724230728U, (uint64_t)5190684913765614385U, (uint64_t)15692927070934536166U, - (uint64_t)12981978499190500902U, (uint64_t)5143491963193394698U, (uint64_t)7705698092144084129U, - (uint64_t)581120653055084783U, (uint64_t)13886552864486459714U, (uint64_t)6290301270652587255U, - (uint64_t)8663431529954393128U, (uint64_t)17033405846475472443U, (uint64_t)5206780355442651635U, - (uint64_t)12580364474736467688U, (uint64_t)17934601912005283310U, - (uint64_t)15119491731028933652U, (uint64_t)17848231399859044858U, - (uint64_t)4427673319524919329U, (uint64_t)2673607337074368008U, (uint64_t)14034876464294699949U, - (uint64_t)10938948975420813697U, (uint64_t)15202340615298669183U, - (uint64_t)5496603454069431071U, (uint64_t)2486526142064906845U, (uint64_t)4507882119510526802U, - (uint64_t)13888151172411390059U, (uint64_t)15049027856908071726U, - (uint64_t)9667231543181973158U, (uint64_t)6406671575277563202U, (uint64_t)3395801050331215139U, - (uint64_t)9813607433539108308U, (uint64_t)2681417728820980381U, (uint64_t)18407064643927113994U, - (uint64_t)7707177692113485527U, (uint64_t)14218149384635317074U, (uint64_t)3658668346206375919U, - (uint64_t)15404713991002362166U, (uint64_t)10152074687696195207U, - (uint64_t)10926946599582128139U, (uint64_t)16907298600007085320U, - (uint64_t)16544287219664720279U, (uint64_t)11007075933432813205U, - (uint64_t)8652245965145713599U, (uint64_t)7857626748965990384U, (uint64_t)5602306604520095870U, - (uint64_t)2525139243938658618U, (uint64_t)14405696176872077447U, - (uint64_t)18432270482137885332U, (uint64_t)9913880809120071177U, - (uint64_t)16896141737831216972U, (uint64_t)7484791498211214829U, - (uint64_t)15635259968266497469U, (uint64_t)8495118537612215624U, (uint64_t)4915477980562575356U, - (uint64_t)16453519279754924350U, (uint64_t)14462108244565406969U, - (uint64_t)14837837755237096687U, (uint64_t)14130171078892575346U, - (uint64_t)15423793222528491497U, (uint64_t)5460399262075036084U, - (uint64_t)16085440580308415349U, (uint64_t)26873200736954488U, (uint64_t)5603655807457499550U, - (uint64_t)3342202915871129617U, (uint64_t)1604413932150236626U, (uint64_t)9684226585089458974U, - (uint64_t)1213229904006618539U, (uint64_t)6782978662408837236U, (uint64_t)11197029877749307372U, - (uint64_t)14085968786551657744U, (uint64_t)17352273610494009342U, - (uint64_t)7876582961192434984U + 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 18446744069414584320ULL, 18446744073709551615ULL, 4294967294ULL, + 0ULL, 0ULL, 0ULL, 0ULL, 1499621593102562565ULL, 16692369783039433128ULL, + 15337520135922861848ULL, 5455737214495366228ULL, 17827017231032529600ULL, + 12413621606240782649ULL, 2290483008028286132ULL, 15752017553340844820ULL, + 4846430910634234874ULL, 10861682798464583253ULL, 15404737222404363049ULL, 363586619281562022ULL, + 9866710912401645115ULL, 1162548847543228595ULL, 7649967190445130486ULL, 5212340432230915749ULL, + 7572620550182916491ULL, 14876145112448665096ULL, 2063227348838176167ULL, 3519435548295415847ULL, + 8390400282019023103ULL, 17666843593163037841ULL, 9450204148816496323ULL, 8483374507652916768ULL, + 6254661047265818424ULL, 16382127809582285023ULL, 125359443771153172ULL, 1374336701588437897ULL, + 11362596098420127726ULL, 2101654420738681387ULL, 12772780342444840510ULL, + 12546934328908550060ULL, 8331880412333790397ULL, 11687262051473819904ULL, + 8926848496503457587ULL, 9603974142010467857ULL, 13199952163826973175ULL, 2189856264898797734ULL, + 11356074861870267226ULL, 2027714896422561895ULL, 5261606367808050149ULL, 153855954337762312ULL, + 6375919692894573986ULL, 12364041207536146533ULL, 1891896010455057160ULL, 1568123795087313171ULL, + 18138710056556660101ULL, 6004886947510047736ULL, 4811859325589542932ULL, 3618763430148954981ULL, + 11434521746258554122ULL, 10086341535864049427ULL, 8073421629570399570ULL, + 12680586148814729338ULL, 9619958020761569612ULL, 15827203580658384478ULL, + 12832694810937550406ULL, 14977975484447400910ULL, 5478002389061063653ULL, + 14731136312639060880ULL, 4317867687275472033ULL, 6642650962855259884ULL, 2514254944289495285ULL, + 14231405641534478436ULL, 4045448346091518946ULL, 8985477013445972471ULL, 8869039454457032149ULL, + 4356978486208692970ULL, 10805288613335538577ULL, 12832353127812502042ULL, + 4576590051676547490ULL, 6728053735138655107ULL, 17814206719173206184ULL, 79790138573994940ULL, + 17920293215101822267ULL, 13422026625585728864ULL, 5018058010492547271ULL, 110232326023384102ULL, + 10834264070056942976ULL, 15222249086119088588ULL, 15119439519142044997ULL, + 11655511970063167313ULL, 1614477029450566107ULL, 3619322817271059794ULL, 9352862040415412867ULL, + 14017522553242747074ULL, 13138513643674040327ULL, 3610195242889455765ULL, + 8371069193996567291ULL, 12670227996544662654ULL, 1205961025092146303ULL, + 13106709934003962112ULL, 4350113471327723407ULL, 15060941403739680459ULL, + 13639127647823205030ULL, 10790943339357725715ULL, 498760574280648264ULL, + 17922071907832082887ULL, 15122670976670152145ULL, 6275027991110214322ULL, + 7250912847491816402ULL, 15206617260142982380ULL, 3385668313694152877ULL, + 17522479771766801905ULL, 2965919117476170655ULL, 1553238516603269404ULL, 5820770015631050991ULL, + 4999445222232605348ULL, 9245650860833717444ULL, 1508811811724230728ULL, 5190684913765614385ULL, + 15692927070934536166ULL, 12981978499190500902ULL, 5143491963193394698ULL, + 7705698092144084129ULL, 581120653055084783ULL, 13886552864486459714ULL, 6290301270652587255ULL, + 8663431529954393128ULL, 17033405846475472443ULL, 5206780355442651635ULL, + 12580364474736467688ULL, 17934601912005283310ULL, 15119491731028933652ULL, + 17848231399859044858ULL, 4427673319524919329ULL, 2673607337074368008ULL, + 14034876464294699949ULL, 10938948975420813697ULL, 15202340615298669183ULL, + 5496603454069431071ULL, 2486526142064906845ULL, 4507882119510526802ULL, 13888151172411390059ULL, + 15049027856908071726ULL, 9667231543181973158ULL, 6406671575277563202ULL, 3395801050331215139ULL, + 9813607433539108308ULL, 2681417728820980381ULL, 18407064643927113994ULL, 7707177692113485527ULL, + 14218149384635317074ULL, 3658668346206375919ULL, 15404713991002362166ULL, + 10152074687696195207ULL, 10926946599582128139ULL, 16907298600007085320ULL, + 16544287219664720279ULL, 11007075933432813205ULL, 8652245965145713599ULL, + 7857626748965990384ULL, 5602306604520095870ULL, 2525139243938658618ULL, 14405696176872077447ULL, + 18432270482137885332ULL, 9913880809120071177ULL, 16896141737831216972ULL, + 7484791498211214829ULL, 15635259968266497469ULL, 8495118537612215624ULL, 4915477980562575356ULL, + 16453519279754924350ULL, 14462108244565406969ULL, 14837837755237096687ULL, + 14130171078892575346ULL, 15423793222528491497ULL, 5460399262075036084ULL, + 16085440580308415349ULL, 26873200736954488ULL, 5603655807457499550ULL, 3342202915871129617ULL, + 1604413932150236626ULL, 9684226585089458974ULL, 1213229904006618539ULL, 6782978662408837236ULL, + 11197029877749307372ULL, 14085968786551657744ULL, 17352273610494009342ULL, + 7876582961192434984ULL }; static const uint64_t Hacl_P256_PrecompTable_precomp_g_pow2_128_table_w4[192U] = { - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, - (uint64_t)18446744069414584320U, (uint64_t)18446744073709551615U, (uint64_t)4294967294U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)14619254753077084366U, - (uint64_t)13913835116514008593U, (uint64_t)15060744674088488145U, - (uint64_t)17668414598203068685U, (uint64_t)10761169236902342334U, - (uint64_t)15467027479157446221U, (uint64_t)14989185522423469618U, - (uint64_t)14354539272510107003U, (uint64_t)14298211796392133693U, - (uint64_t)13270323784253711450U, (uint64_t)13380964971965046957U, - (uint64_t)8686204248456909699U, (uint64_t)17434630286744937066U, (uint64_t)1355903775279084720U, - (uint64_t)7554695053550308662U, (uint64_t)11354971222741863570U, (uint64_t)564601613420749879U, - (uint64_t)8466325837259054896U, (uint64_t)10752965181772434263U, - (uint64_t)11405876547368426319U, (uint64_t)13791894568738930940U, - (uint64_t)8230587134406354675U, (uint64_t)12415514098722758608U, - (uint64_t)18414183046995786744U, (uint64_t)15508000368227372870U, - (uint64_t)5781062464627999307U, (uint64_t)15339429052219195590U, - (uint64_t)16038703753810741903U, (uint64_t)9587718938298980714U, (uint64_t)4822658817952386407U, - (uint64_t)1376351024833260660U, (uint64_t)1120174910554766702U, (uint64_t)1730170933262569274U, - (uint64_t)5187428548444533500U, (uint64_t)16242053503368957131U, (uint64_t)3036811119519868279U, - (uint64_t)1760267587958926638U, (uint64_t)170244572981065185U, (uint64_t)8063080791967388171U, - (uint64_t)4824892826607692737U, (uint64_t)16286391083472040552U, - (uint64_t)11945158615253358747U, (uint64_t)14096887760410224200U, - (uint64_t)1613720831904557039U, (uint64_t)14316966673761197523U, - (uint64_t)17411006201485445341U, (uint64_t)8112301506943158801U, (uint64_t)2069889233927989984U, - (uint64_t)10082848378277483927U, (uint64_t)3609691194454404430U, (uint64_t)6110437205371933689U, - (uint64_t)9769135977342231601U, (uint64_t)11977962151783386478U, - (uint64_t)18088718692559983573U, (uint64_t)11741637975753055U, (uint64_t)11110390325701582190U, - (uint64_t)1341402251566067019U, (uint64_t)3028229550849726478U, (uint64_t)10438984083997451310U, - (uint64_t)12730851885100145709U, (uint64_t)11524169532089894189U, - (uint64_t)4523375903229602674U, (uint64_t)2028602258037385622U, (uint64_t)17082839063089388410U, - (uint64_t)6103921364634113167U, (uint64_t)17066180888225306102U, - (uint64_t)11395680486707876195U, (uint64_t)10952892272443345484U, - (uint64_t)8792831960605859401U, (uint64_t)14194485427742325139U, - (uint64_t)15146020821144305250U, (uint64_t)1654766014957123343U, (uint64_t)7955526243090948551U, - (uint64_t)3989277566080493308U, (uint64_t)12229385116397931231U, - (uint64_t)13430548930727025562U, (uint64_t)3434892688179800602U, (uint64_t)8431998794645622027U, - (uint64_t)12132530981596299272U, (uint64_t)2289461608863966999U, - (uint64_t)18345870950201487179U, (uint64_t)13517947207801901576U, - (uint64_t)5213113244172561159U, (uint64_t)17632986594098340879U, (uint64_t)4405251818133148856U, - (uint64_t)11783009269435447793U, (uint64_t)9332138983770046035U, - (uint64_t)12863411548922539505U, (uint64_t)3717030292816178224U, - (uint64_t)10026078446427137374U, (uint64_t)11167295326594317220U, - (uint64_t)12425328773141588668U, (uint64_t)5760335125172049352U, (uint64_t)9016843701117277863U, - (uint64_t)5657892835694680172U, (uint64_t)11025130589305387464U, (uint64_t)1368484957977406173U, - (uint64_t)17361351345281258834U, (uint64_t)1907113641956152700U, - (uint64_t)16439233413531427752U, (uint64_t)5893322296986588932U, - (uint64_t)14000206906171746627U, (uint64_t)14979266987545792900U, - (uint64_t)6926291766898221120U, (uint64_t)7162023296083360752U, (uint64_t)14762747553625382529U, - (uint64_t)12610831658612406849U, (uint64_t)10462926899548715515U, - (uint64_t)4794017723140405312U, (uint64_t)5234438200490163319U, (uint64_t)8019519110339576320U, - (uint64_t)7194604241290530100U, (uint64_t)12626770134810813246U, - (uint64_t)10793074474236419890U, (uint64_t)11323224347913978783U, - (uint64_t)16831128015895380245U, (uint64_t)18323094195124693378U, - (uint64_t)2361097165281567692U, (uint64_t)15755578675014279498U, - (uint64_t)14289876470325854580U, (uint64_t)12856787656093616839U, - (uint64_t)3578928531243900594U, (uint64_t)3847532758790503699U, (uint64_t)8377953190224748743U, - (uint64_t)3314546646092744596U, (uint64_t)800810188859334358U, (uint64_t)4626344124229343596U, - (uint64_t)6620381605850876621U, (uint64_t)11422073570955989527U, - (uint64_t)12676813626484814469U, (uint64_t)16725029886764122240U, - (uint64_t)16648497372773830008U, (uint64_t)9135702594931291048U, - (uint64_t)16080949688826680333U, (uint64_t)11528096561346602947U, - (uint64_t)2632498067099740984U, (uint64_t)11583842699108800714U, (uint64_t)8378404864573610526U, - (uint64_t)1076560261627788534U, (uint64_t)13836015994325032828U, - (uint64_t)11234295937817067909U, (uint64_t)5893659808396722708U, - (uint64_t)11277421142886984364U, (uint64_t)8968549037166726491U, - (uint64_t)14841374331394032822U, (uint64_t)9967344773947889341U, (uint64_t)8799244393578496085U, - (uint64_t)5094686877301601410U, (uint64_t)8780316747074726862U, (uint64_t)9119697306829835718U, - (uint64_t)15381243327921855368U, (uint64_t)2686250164449435196U, - (uint64_t)16466917280442198358U, (uint64_t)13791704489163125216U, - (uint64_t)16955859337117924272U, (uint64_t)17112836394923783642U, - (uint64_t)4639176427338618063U, (uint64_t)16770029310141094964U, - (uint64_t)11049953922966416185U, (uint64_t)12012669590884098968U, - (uint64_t)4859326885929417214U, (uint64_t)896380084392586061U, (uint64_t)7153028362977034008U, - (uint64_t)10540021163316263301U, (uint64_t)9318277998512936585U, - (uint64_t)18344496977694796523U, (uint64_t)11374737400567645494U, - (uint64_t)17158800051138212954U, (uint64_t)18343197867863253153U, - (uint64_t)18204799297967861226U, (uint64_t)15798973531606348828U, - (uint64_t)9870158263408310459U, (uint64_t)17578869832774612627U, (uint64_t)8395748875822696932U, - (uint64_t)15310679007370670872U, (uint64_t)11205576736030808860U, - (uint64_t)10123429210002838967U, (uint64_t)5910544144088393959U, - (uint64_t)14016615653353687369U, (uint64_t)11191676704772957822U + 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 18446744069414584320ULL, 18446744073709551615ULL, 4294967294ULL, + 0ULL, 0ULL, 0ULL, 0ULL, 14619254753077084366ULL, 13913835116514008593ULL, + 15060744674088488145ULL, 17668414598203068685ULL, 10761169236902342334ULL, + 15467027479157446221ULL, 14989185522423469618ULL, 14354539272510107003ULL, + 14298211796392133693ULL, 13270323784253711450ULL, 13380964971965046957ULL, + 8686204248456909699ULL, 17434630286744937066ULL, 1355903775279084720ULL, 7554695053550308662ULL, + 11354971222741863570ULL, 564601613420749879ULL, 8466325837259054896ULL, 10752965181772434263ULL, + 11405876547368426319ULL, 13791894568738930940ULL, 8230587134406354675ULL, + 12415514098722758608ULL, 18414183046995786744ULL, 15508000368227372870ULL, + 5781062464627999307ULL, 15339429052219195590ULL, 16038703753810741903ULL, + 9587718938298980714ULL, 4822658817952386407ULL, 1376351024833260660ULL, 1120174910554766702ULL, + 1730170933262569274ULL, 5187428548444533500ULL, 16242053503368957131ULL, 3036811119519868279ULL, + 1760267587958926638ULL, 170244572981065185ULL, 8063080791967388171ULL, 4824892826607692737ULL, + 16286391083472040552ULL, 11945158615253358747ULL, 14096887760410224200ULL, + 1613720831904557039ULL, 14316966673761197523ULL, 17411006201485445341ULL, + 8112301506943158801ULL, 2069889233927989984ULL, 10082848378277483927ULL, 3609691194454404430ULL, + 6110437205371933689ULL, 9769135977342231601ULL, 11977962151783386478ULL, + 18088718692559983573ULL, 11741637975753055ULL, 11110390325701582190ULL, 1341402251566067019ULL, + 3028229550849726478ULL, 10438984083997451310ULL, 12730851885100145709ULL, + 11524169532089894189ULL, 4523375903229602674ULL, 2028602258037385622ULL, + 17082839063089388410ULL, 6103921364634113167ULL, 17066180888225306102ULL, + 11395680486707876195ULL, 10952892272443345484ULL, 8792831960605859401ULL, + 14194485427742325139ULL, 15146020821144305250ULL, 1654766014957123343ULL, + 7955526243090948551ULL, 3989277566080493308ULL, 12229385116397931231ULL, + 13430548930727025562ULL, 3434892688179800602ULL, 8431998794645622027ULL, + 12132530981596299272ULL, 2289461608863966999ULL, 18345870950201487179ULL, + 13517947207801901576ULL, 5213113244172561159ULL, 17632986594098340879ULL, + 4405251818133148856ULL, 11783009269435447793ULL, 9332138983770046035ULL, + 12863411548922539505ULL, 3717030292816178224ULL, 10026078446427137374ULL, + 11167295326594317220ULL, 12425328773141588668ULL, 5760335125172049352ULL, + 9016843701117277863ULL, 5657892835694680172ULL, 11025130589305387464ULL, 1368484957977406173ULL, + 17361351345281258834ULL, 1907113641956152700ULL, 16439233413531427752ULL, + 5893322296986588932ULL, 14000206906171746627ULL, 14979266987545792900ULL, + 6926291766898221120ULL, 7162023296083360752ULL, 14762747553625382529ULL, + 12610831658612406849ULL, 10462926899548715515ULL, 4794017723140405312ULL, + 5234438200490163319ULL, 8019519110339576320ULL, 7194604241290530100ULL, 12626770134810813246ULL, + 10793074474236419890ULL, 11323224347913978783ULL, 16831128015895380245ULL, + 18323094195124693378ULL, 2361097165281567692ULL, 15755578675014279498ULL, + 14289876470325854580ULL, 12856787656093616839ULL, 3578928531243900594ULL, + 3847532758790503699ULL, 8377953190224748743ULL, 3314546646092744596ULL, 800810188859334358ULL, + 4626344124229343596ULL, 6620381605850876621ULL, 11422073570955989527ULL, + 12676813626484814469ULL, 16725029886764122240ULL, 16648497372773830008ULL, + 9135702594931291048ULL, 16080949688826680333ULL, 11528096561346602947ULL, + 2632498067099740984ULL, 11583842699108800714ULL, 8378404864573610526ULL, 1076560261627788534ULL, + 13836015994325032828ULL, 11234295937817067909ULL, 5893659808396722708ULL, + 11277421142886984364ULL, 8968549037166726491ULL, 14841374331394032822ULL, + 9967344773947889341ULL, 8799244393578496085ULL, 5094686877301601410ULL, 8780316747074726862ULL, + 9119697306829835718ULL, 15381243327921855368ULL, 2686250164449435196ULL, + 16466917280442198358ULL, 13791704489163125216ULL, 16955859337117924272ULL, + 17112836394923783642ULL, 4639176427338618063ULL, 16770029310141094964ULL, + 11049953922966416185ULL, 12012669590884098968ULL, 4859326885929417214ULL, 896380084392586061ULL, + 7153028362977034008ULL, 10540021163316263301ULL, 9318277998512936585ULL, + 18344496977694796523ULL, 11374737400567645494ULL, 17158800051138212954ULL, + 18343197867863253153ULL, 18204799297967861226ULL, 15798973531606348828ULL, + 9870158263408310459ULL, 17578869832774612627ULL, 8395748875822696932ULL, + 15310679007370670872ULL, 11205576736030808860ULL, 10123429210002838967ULL, + 5910544144088393959ULL, 14016615653353687369ULL, 11191676704772957822ULL }; static const uint64_t Hacl_P256_PrecompTable_precomp_g_pow2_192_table_w4[192U] = { - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, - (uint64_t)18446744069414584320U, (uint64_t)18446744073709551615U, (uint64_t)4294967294U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)7870395003430845958U, - (uint64_t)18001862936410067720U, (uint64_t)8006461232116967215U, (uint64_t)5921313779532424762U, - (uint64_t)10702113371959864307U, (uint64_t)8070517410642379879U, (uint64_t)7139806720777708306U, - (uint64_t)8253938546650739833U, (uint64_t)17490482834545705718U, (uint64_t)1065249776797037500U, - (uint64_t)5018258455937968775U, (uint64_t)14100621120178668337U, (uint64_t)8392845221328116213U, - (uint64_t)14630296398338540788U, (uint64_t)4268947906723414372U, (uint64_t)9231207002243517909U, - (uint64_t)14261219637616504262U, (uint64_t)7786881626982345356U, - (uint64_t)11412720751765882139U, (uint64_t)14119585051365330009U, - (uint64_t)15281626286521302128U, (uint64_t)6350171933454266732U, - (uint64_t)16559468304937127866U, (uint64_t)13200760478271693417U, - (uint64_t)6733381546280350776U, (uint64_t)3801404890075189193U, (uint64_t)2741036364686993903U, - (uint64_t)3218612940540174008U, (uint64_t)10894914335165419505U, - (uint64_t)11862941430149998362U, (uint64_t)4223151729402839584U, (uint64_t)2913215088487087887U, - (uint64_t)14562168920104952953U, (uint64_t)2170089393468287453U, - (uint64_t)10520900655016579352U, (uint64_t)7040362608949989273U, (uint64_t)8376510559381705307U, - (uint64_t)9142237200448131532U, (uint64_t)5696859948123854080U, (uint64_t)925422306716081180U, - (uint64_t)11155545953469186421U, (uint64_t)1888208646862572812U, - (uint64_t)11151095998248845721U, (uint64_t)15793503271680275267U, - (uint64_t)7729877044494854851U, (uint64_t)6235134673193032913U, (uint64_t)7364280682182401564U, - (uint64_t)5479679373325519985U, (uint64_t)17966037684582301763U, - (uint64_t)14140891609330279185U, (uint64_t)5814744449740463867U, (uint64_t)5652588426712591652U, - (uint64_t)774745682988690912U, (uint64_t)13228255573220500373U, (uint64_t)11949122068786859397U, - (uint64_t)8021166392900770376U, (uint64_t)7994323710948720063U, (uint64_t)9924618472877849977U, - (uint64_t)17618517523141194266U, (uint64_t)2750424097794401714U, - (uint64_t)15481749570715253207U, (uint64_t)14646964509921760497U, - (uint64_t)1037442848094301355U, (uint64_t)6295995947389299132U, (uint64_t)16915049722317579514U, - (uint64_t)10493877400992990313U, (uint64_t)18391008753060553521U, (uint64_t)483942209623707598U, - (uint64_t)2017775662838016613U, (uint64_t)5933251998459363553U, (uint64_t)11789135019970707407U, - (uint64_t)5484123723153268336U, (uint64_t)13246954648848484954U, (uint64_t)4774374393926023505U, - (uint64_t)14863995618704457336U, (uint64_t)13220153167104973625U, - (uint64_t)5988445485312390826U, (uint64_t)17580359464028944682U, (uint64_t)7297100131969874771U, - (uint64_t)379931507867989375U, (uint64_t)10927113096513421444U, (uint64_t)17688881974428340857U, - (uint64_t)4259872578781463333U, (uint64_t)8573076295966784472U, (uint64_t)16389829450727275032U, - (uint64_t)1667243868963568259U, (uint64_t)17730726848925960919U, - (uint64_t)11408899874569778008U, (uint64_t)3576527582023272268U, - (uint64_t)16492920640224231656U, (uint64_t)7906130545972460130U, - (uint64_t)13878604278207681266U, (uint64_t)41446695125652041U, (uint64_t)8891615271337333503U, - (uint64_t)2594537723613594470U, (uint64_t)7699579176995770924U, (uint64_t)147458463055730655U, - (uint64_t)12120406862739088406U, (uint64_t)12044892493010567063U, - (uint64_t)8554076749615475136U, (uint64_t)1005097692260929999U, (uint64_t)2687202654471188715U, - (uint64_t)9457588752176879209U, (uint64_t)17472884880062444019U, (uint64_t)9792097892056020166U, - (uint64_t)2525246678512797150U, (uint64_t)15958903035313115662U, - (uint64_t)11336038170342247032U, (uint64_t)11560342382835141123U, - (uint64_t)6212009033479929024U, (uint64_t)8214308203775021229U, (uint64_t)8475469210070503698U, - (uint64_t)13287024123485719563U, (uint64_t)12956951963817520723U, - (uint64_t)10693035819908470465U, (uint64_t)11375478788224786725U, - (uint64_t)16934625208487120398U, (uint64_t)10094585729115874495U, - (uint64_t)2763884524395905776U, (uint64_t)13535890148969964883U, - (uint64_t)13514657411765064358U, (uint64_t)9903074440788027562U, - (uint64_t)17324720726421199990U, (uint64_t)2273931039117368789U, (uint64_t)3442641041506157854U, - (uint64_t)1119853641236409612U, (uint64_t)12037070344296077989U, (uint64_t)581736433335671746U, - (uint64_t)6019150647054369174U, (uint64_t)14864096138068789375U, (uint64_t)6652995210998318662U, - (uint64_t)12773883697029175304U, (uint64_t)12751275631451845119U, - (uint64_t)11449095003038250478U, (uint64_t)1025805267334366480U, (uint64_t)2764432500300815015U, - (uint64_t)18274564429002844381U, (uint64_t)10445634195592600351U, - (uint64_t)11814099592837202735U, (uint64_t)5006796893679120289U, (uint64_t)6908397253997261914U, - (uint64_t)13266696965302879279U, (uint64_t)7768715053015037430U, (uint64_t)3569923738654785686U, - (uint64_t)5844853453464857549U, (uint64_t)1837340805629559110U, (uint64_t)1034657624388283114U, - (uint64_t)711244516069456460U, (uint64_t)12519286026957934814U, (uint64_t)2613464944620837619U, - (uint64_t)10003023321338286213U, (uint64_t)7291332092642881376U, (uint64_t)9832199564117004897U, - (uint64_t)3280736694860799890U, (uint64_t)6416452202849179874U, (uint64_t)7326961381798642069U, - (uint64_t)8435688798040635029U, (uint64_t)16630141263910982958U, - (uint64_t)17222635514422533318U, (uint64_t)9482787389178881499U, (uint64_t)836561194658263905U, - (uint64_t)3405319043337616649U, (uint64_t)2786146577568026518U, (uint64_t)7625483685691626321U, - (uint64_t)6728084875304656716U, (uint64_t)1140997959232544268U, (uint64_t)12847384827606303792U, - (uint64_t)1719121337754572070U, (uint64_t)12863589482936438532U, (uint64_t)3880712899640530862U, - (uint64_t)2748456882813671564U, (uint64_t)4775988900044623019U, (uint64_t)8937847374382191162U, - (uint64_t)3767367347172252295U, (uint64_t)13468672401049388646U, - (uint64_t)14359032216842397576U, (uint64_t)2002555958685443975U, - (uint64_t)16488678606651526810U, (uint64_t)11826135409597474760U, - (uint64_t)15296495673182508601U + 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 18446744069414584320ULL, 18446744073709551615ULL, 4294967294ULL, + 0ULL, 0ULL, 0ULL, 0ULL, 7870395003430845958ULL, 18001862936410067720ULL, 8006461232116967215ULL, + 5921313779532424762ULL, 10702113371959864307ULL, 8070517410642379879ULL, 7139806720777708306ULL, + 8253938546650739833ULL, 17490482834545705718ULL, 1065249776797037500ULL, 5018258455937968775ULL, + 14100621120178668337ULL, 8392845221328116213ULL, 14630296398338540788ULL, + 4268947906723414372ULL, 9231207002243517909ULL, 14261219637616504262ULL, 7786881626982345356ULL, + 11412720751765882139ULL, 14119585051365330009ULL, 15281626286521302128ULL, + 6350171933454266732ULL, 16559468304937127866ULL, 13200760478271693417ULL, + 6733381546280350776ULL, 3801404890075189193ULL, 2741036364686993903ULL, 3218612940540174008ULL, + 10894914335165419505ULL, 11862941430149998362ULL, 4223151729402839584ULL, + 2913215088487087887ULL, 14562168920104952953ULL, 2170089393468287453ULL, + 10520900655016579352ULL, 7040362608949989273ULL, 8376510559381705307ULL, 9142237200448131532ULL, + 5696859948123854080ULL, 925422306716081180ULL, 11155545953469186421ULL, 1888208646862572812ULL, + 11151095998248845721ULL, 15793503271680275267ULL, 7729877044494854851ULL, + 6235134673193032913ULL, 7364280682182401564ULL, 5479679373325519985ULL, 17966037684582301763ULL, + 14140891609330279185ULL, 5814744449740463867ULL, 5652588426712591652ULL, 774745682988690912ULL, + 13228255573220500373ULL, 11949122068786859397ULL, 8021166392900770376ULL, + 7994323710948720063ULL, 9924618472877849977ULL, 17618517523141194266ULL, 2750424097794401714ULL, + 15481749570715253207ULL, 14646964509921760497ULL, 1037442848094301355ULL, + 6295995947389299132ULL, 16915049722317579514ULL, 10493877400992990313ULL, + 18391008753060553521ULL, 483942209623707598ULL, 2017775662838016613ULL, 5933251998459363553ULL, + 11789135019970707407ULL, 5484123723153268336ULL, 13246954648848484954ULL, + 4774374393926023505ULL, 14863995618704457336ULL, 13220153167104973625ULL, + 5988445485312390826ULL, 17580359464028944682ULL, 7297100131969874771ULL, 379931507867989375ULL, + 10927113096513421444ULL, 17688881974428340857ULL, 4259872578781463333ULL, + 8573076295966784472ULL, 16389829450727275032ULL, 1667243868963568259ULL, + 17730726848925960919ULL, 11408899874569778008ULL, 3576527582023272268ULL, + 16492920640224231656ULL, 7906130545972460130ULL, 13878604278207681266ULL, 41446695125652041ULL, + 8891615271337333503ULL, 2594537723613594470ULL, 7699579176995770924ULL, 147458463055730655ULL, + 12120406862739088406ULL, 12044892493010567063ULL, 8554076749615475136ULL, + 1005097692260929999ULL, 2687202654471188715ULL, 9457588752176879209ULL, 17472884880062444019ULL, + 9792097892056020166ULL, 2525246678512797150ULL, 15958903035313115662ULL, + 11336038170342247032ULL, 11560342382835141123ULL, 6212009033479929024ULL, + 8214308203775021229ULL, 8475469210070503698ULL, 13287024123485719563ULL, + 12956951963817520723ULL, 10693035819908470465ULL, 11375478788224786725ULL, + 16934625208487120398ULL, 10094585729115874495ULL, 2763884524395905776ULL, + 13535890148969964883ULL, 13514657411765064358ULL, 9903074440788027562ULL, + 17324720726421199990ULL, 2273931039117368789ULL, 3442641041506157854ULL, 1119853641236409612ULL, + 12037070344296077989ULL, 581736433335671746ULL, 6019150647054369174ULL, 14864096138068789375ULL, + 6652995210998318662ULL, 12773883697029175304ULL, 12751275631451845119ULL, + 11449095003038250478ULL, 1025805267334366480ULL, 2764432500300815015ULL, + 18274564429002844381ULL, 10445634195592600351ULL, 11814099592837202735ULL, + 5006796893679120289ULL, 6908397253997261914ULL, 13266696965302879279ULL, 7768715053015037430ULL, + 3569923738654785686ULL, 5844853453464857549ULL, 1837340805629559110ULL, 1034657624388283114ULL, + 711244516069456460ULL, 12519286026957934814ULL, 2613464944620837619ULL, 10003023321338286213ULL, + 7291332092642881376ULL, 9832199564117004897ULL, 3280736694860799890ULL, 6416452202849179874ULL, + 7326961381798642069ULL, 8435688798040635029ULL, 16630141263910982958ULL, + 17222635514422533318ULL, 9482787389178881499ULL, 836561194658263905ULL, 3405319043337616649ULL, + 2786146577568026518ULL, 7625483685691626321ULL, 6728084875304656716ULL, 1140997959232544268ULL, + 12847384827606303792ULL, 1719121337754572070ULL, 12863589482936438532ULL, + 3880712899640530862ULL, 2748456882813671564ULL, 4775988900044623019ULL, 8937847374382191162ULL, + 3767367347172252295ULL, 13468672401049388646ULL, 14359032216842397576ULL, + 2002555958685443975ULL, 16488678606651526810ULL, 11826135409597474760ULL, + 15296495673182508601ULL }; static const uint64_t Hacl_P256_PrecompTable_precomp_basepoint_table_w5[384U] = { - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)1U, - (uint64_t)18446744069414584320U, (uint64_t)18446744073709551615U, (uint64_t)4294967294U, - (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)0U, (uint64_t)8784043285714375740U, - (uint64_t)8483257759279461889U, (uint64_t)8789745728267363600U, (uint64_t)1770019616739251654U, - (uint64_t)15992936863339206154U, (uint64_t)10037038012062884956U, - (uint64_t)15197544864945402661U, (uint64_t)9615747158586711429U, (uint64_t)1U, - (uint64_t)18446744069414584320U, (uint64_t)18446744073709551615U, (uint64_t)4294967294U, - (uint64_t)10634854829044225757U, (uint64_t)351552716085025155U, (uint64_t)10645315080955407736U, - (uint64_t)3609262091244858135U, (uint64_t)15760741698986874125U, - (uint64_t)14936374388219697827U, (uint64_t)15751360096993017895U, - (uint64_t)18012233706239762398U, (uint64_t)1993877568177495041U, - (uint64_t)10345888787846536528U, (uint64_t)7746511691117935375U, - (uint64_t)14517043990409914413U, (uint64_t)14122549297570634151U, - (uint64_t)16934610359517083771U, (uint64_t)5724511325497097418U, (uint64_t)8983432969107448705U, - (uint64_t)2687429970334080245U, (uint64_t)16525396802810050288U, (uint64_t)7602596488871585854U, - (uint64_t)4813919589149203084U, (uint64_t)7680395813780804519U, (uint64_t)6687709583048023590U, - (uint64_t)18086445169104142027U, (uint64_t)9637814708330203929U, - (uint64_t)14785108459960679090U, (uint64_t)3838023279095023581U, (uint64_t)3555615526157830307U, - (uint64_t)5177066488380472871U, (uint64_t)18218186719108038403U, - (uint64_t)16281556341699656105U, (uint64_t)1524227924561461191U, (uint64_t)4148060517641909597U, - (uint64_t)2858290374115363433U, (uint64_t)8942772026334130620U, (uint64_t)3034451298319885113U, - (uint64_t)8447866036736640940U, (uint64_t)11204933433076256578U, - (uint64_t)18333595740249588297U, (uint64_t)8259597024804538246U, (uint64_t)9539734295777539786U, - (uint64_t)9797290423046626413U, (uint64_t)5777303437849646537U, (uint64_t)8739356909899132020U, - (uint64_t)14815960973766782158U, (uint64_t)15286581798204509801U, - (uint64_t)17597362577777019682U, (uint64_t)13259283710820519742U, - (uint64_t)10501322996899164670U, (uint64_t)1221138904338319642U, - (uint64_t)14586685489551951885U, (uint64_t)895326705426031212U, (uint64_t)14398171728560617847U, - (uint64_t)9592550823745097391U, (uint64_t)17240998489162206026U, (uint64_t)8085479283308189196U, - (uint64_t)14844657737893882826U, (uint64_t)15923425394150618234U, - (uint64_t)2997808084773249525U, (uint64_t)494323555453660587U, (uint64_t)1215695327517794764U, - (uint64_t)9476207381098391690U, (uint64_t)7480789678419122995U, (uint64_t)15212230329321082489U, - (uint64_t)436189395349576388U, (uint64_t)17377474396456660834U, (uint64_t)15237013929655017939U, - (uint64_t)11444428846883781676U, (uint64_t)5112749694521428575U, (uint64_t)950829367509872073U, - (uint64_t)17665036182057559519U, (uint64_t)17205133339690002313U, - (uint64_t)16233765170251334549U, (uint64_t)10122775683257972591U, - (uint64_t)3352514236455632420U, (uint64_t)9143148522359954691U, (uint64_t)601191684005658860U, - (uint64_t)13398772186646349998U, (uint64_t)15512696600132928431U, - (uint64_t)9128416073728948653U, (uint64_t)11233051033546138578U, (uint64_t)6769345682610122833U, - (uint64_t)10823233224575054288U, (uint64_t)9997725227559980175U, (uint64_t)6733425642852897415U, - (uint64_t)16302206918151466066U, (uint64_t)1669330822143265921U, (uint64_t)2661645605036546002U, - (uint64_t)17182558479745802165U, (uint64_t)1165082692376932040U, (uint64_t)9470595929011488359U, - (uint64_t)6142147329285324932U, (uint64_t)4829075085998111287U, (uint64_t)10231370681107338930U, - (uint64_t)9591876895322495239U, (uint64_t)10316468561384076618U, - (uint64_t)11592503647238064235U, (uint64_t)13395813606055179632U, (uint64_t)511127033980815508U, - (uint64_t)12434976573147649880U, (uint64_t)3425094795384359127U, (uint64_t)6816971736303023445U, - (uint64_t)15444670609021139344U, (uint64_t)9464349818322082360U, - (uint64_t)16178216413042376883U, (uint64_t)9595540370774317348U, (uint64_t)7229365182662875710U, - (uint64_t)4601177649460012843U, (uint64_t)5455046447382487090U, (uint64_t)10854066421606187521U, - (uint64_t)15913416821879788071U, (uint64_t)2297365362023460173U, (uint64_t)2603252216454941350U, - (uint64_t)6768791943870490934U, (uint64_t)15705936687122754810U, (uint64_t)9537096567546600694U, - (uint64_t)17580538144855035062U, (uint64_t)4496542856965746638U, (uint64_t)8444341625922124942U, - (uint64_t)12191263903636183168U, (uint64_t)17427332907535974165U, - (uint64_t)14307569739254103736U, (uint64_t)13900598742063266169U, - (uint64_t)7176996424355977650U, (uint64_t)5709008170379717479U, (uint64_t)14471312052264549092U, - (uint64_t)1464519909491759867U, (uint64_t)3328154641049602121U, (uint64_t)13020349337171136774U, - (uint64_t)2772166279972051938U, (uint64_t)10854476939425975292U, (uint64_t)1967189930534630940U, - (uint64_t)2802919076529341959U, (uint64_t)14792226094833519208U, - (uint64_t)14675640928566522177U, (uint64_t)14838974364643800837U, - (uint64_t)17631460696099549980U, (uint64_t)17434186275364935469U, - (uint64_t)2665648200587705473U, (uint64_t)13202122464492564051U, (uint64_t)7576287350918073341U, - (uint64_t)2272206013910186424U, (uint64_t)14558761641743937843U, (uint64_t)5675729149929979729U, - (uint64_t)9043135187561613166U, (uint64_t)11750149293830589225U, (uint64_t)740555197954307911U, - (uint64_t)9871738005087190699U, (uint64_t)17178667634283502053U, - (uint64_t)18046255991533013265U, (uint64_t)4458222096988430430U, (uint64_t)8452427758526311627U, - (uint64_t)13825286929656615266U, (uint64_t)13956286357198391218U, - (uint64_t)15875692916799995079U, (uint64_t)10634895319157013920U, - (uint64_t)13230116118036304207U, (uint64_t)8795317393614625606U, (uint64_t)7001710806858862020U, - (uint64_t)7949746088586183478U, (uint64_t)14677556044923602317U, - (uint64_t)11184023437485843904U, (uint64_t)11215864722023085094U, - (uint64_t)6444464081471519014U, (uint64_t)1706241174022415217U, (uint64_t)8243975633057550613U, - (uint64_t)15502902453836085864U, (uint64_t)3799182188594003953U, (uint64_t)3538840175098724094U, - (uint64_t)13240193491554624643U, (uint64_t)12365034249541329920U, - (uint64_t)2924326828590977357U, (uint64_t)5687195797140589099U, (uint64_t)16880427227292834531U, - (uint64_t)9691471435758991112U, (uint64_t)16642385273732487288U, - (uint64_t)12173806747523009914U, (uint64_t)13142722756877876849U, - (uint64_t)8370377548305121979U, (uint64_t)17988526053752025426U, (uint64_t)4818750752684100334U, - (uint64_t)5669241919350361655U, (uint64_t)4964810303238518540U, (uint64_t)16709712747671533191U, - (uint64_t)4461414404267448242U, (uint64_t)3971798785139504238U, (uint64_t)6276818948740422136U, - (uint64_t)1426735892164275762U, (uint64_t)7943622674892418919U, (uint64_t)9864274225563929680U, - (uint64_t)57815533745003233U, (uint64_t)10893588105168960233U, (uint64_t)15739162732907069535U, - (uint64_t)3923866849462073470U, (uint64_t)12279826158399226875U, (uint64_t)1533015761334846582U, - (uint64_t)15860156818568437510U, (uint64_t)8252625373831297988U, (uint64_t)9666953804812706358U, - (uint64_t)8767785238646914634U, (uint64_t)14382179044941403551U, - (uint64_t)10401039907264254245U, (uint64_t)8584860003763157350U, (uint64_t)3120462679504470266U, - (uint64_t)8670255778748340069U, (uint64_t)5313789577940369984U, (uint64_t)16977072364454789224U, - (uint64_t)12199578693972188324U, (uint64_t)18211098771672599237U, - (uint64_t)12868831556008795030U, (uint64_t)5310155061431048194U, - (uint64_t)18114153238435112606U, (uint64_t)14482365809278304512U, - (uint64_t)12520721662723001511U, (uint64_t)405943624021143002U, (uint64_t)8146944101507657423U, - (uint64_t)181739317780393495U, (uint64_t)81743892273670099U, (uint64_t)14759561962550473930U, - (uint64_t)4592623849546992939U, (uint64_t)6916440441743449719U, (uint64_t)1304610503530809833U, - (uint64_t)5464930909232486441U, (uint64_t)15414883617496224671U, (uint64_t)8129283345256790U, - (uint64_t)18294252198413739489U, (uint64_t)17394115281884857288U, - (uint64_t)7808348415224731235U, (uint64_t)13195566655747230608U, (uint64_t)8568194219353949094U, - (uint64_t)15329813048672122440U, (uint64_t)9604275495885785744U, (uint64_t)1577712551205219835U, - (uint64_t)15964209008022052790U, (uint64_t)15087297920782098160U, - (uint64_t)3946031512438511898U, (uint64_t)10050061168984440631U, - (uint64_t)11382452014533138316U, (uint64_t)6313670788911952792U, - (uint64_t)12015989229696164014U, (uint64_t)5946702628076168852U, (uint64_t)5219995658774362841U, - (uint64_t)12230141881068377972U, (uint64_t)12361195202673441956U, - (uint64_t)4732862275653856711U, (uint64_t)17221430380805252370U, - (uint64_t)15397525953897375810U, (uint64_t)16557437297239563045U, - (uint64_t)10101683801868971351U, (uint64_t)1402611372245592868U, (uint64_t)1931806383735563658U, - (uint64_t)10991705207471512479U, (uint64_t)861333583207471392U, (uint64_t)15207766844626322355U, - (uint64_t)9224628129811432393U, (uint64_t)3497069567089055613U, (uint64_t)11956632757898590316U, - (uint64_t)8733729372586312960U, (uint64_t)18091521051714930927U, (uint64_t)77582787724373283U, - (uint64_t)9922437373519669237U, (uint64_t)3079321456325704615U, (uint64_t)12171198408512478457U, - (uint64_t)17179130884012147596U, (uint64_t)6839115479620367181U, (uint64_t)4421032569964105406U, - (uint64_t)10353331468657256053U, (uint64_t)17400988720335968824U, - (uint64_t)17138855889417480540U, (uint64_t)4507980080381370611U, - (uint64_t)10703175719793781886U, (uint64_t)12598516658725890426U, - (uint64_t)8353463412173898932U, (uint64_t)17703029389228422404U, (uint64_t)9313111267107226233U, - (uint64_t)5441322942995154196U, (uint64_t)8952817660034465484U, (uint64_t)17571113341183703118U, - (uint64_t)7375087953801067019U, (uint64_t)13381466302076453648U, (uint64_t)3218165271423914596U, - (uint64_t)16956372157249382685U, (uint64_t)509080090049418841U, (uint64_t)13374233893294084913U, - (uint64_t)2988537624204297086U, (uint64_t)4979195832939384620U, (uint64_t)3803931594068976394U, - (uint64_t)10731535883829627646U, (uint64_t)12954845047607194278U, - (uint64_t)10494298062560667399U, (uint64_t)4967351022190213065U, - (uint64_t)13391917938145756456U, (uint64_t)951370484866918160U, (uint64_t)13531334179067685307U, - (uint64_t)12868421357919390599U, (uint64_t)15918857042998130258U, - (uint64_t)17769743831936974016U, (uint64_t)7137921979260368809U, - (uint64_t)12461369180685892062U, (uint64_t)827476514081935199U, (uint64_t)15107282134224767230U, - (uint64_t)10084765752802805748U, (uint64_t)3303739059392464407U, - (uint64_t)17859532612136591428U, (uint64_t)10949414770405040164U, - (uint64_t)12838613589371008785U, (uint64_t)5554397169231540728U, - (uint64_t)18375114572169624408U, (uint64_t)15649286703242390139U, - (uint64_t)2957281557463706877U, (uint64_t)14000350446219393213U, - (uint64_t)14355199721749620351U, (uint64_t)2730856240099299695U, - (uint64_t)17528131000714705752U, (uint64_t)2537498525883536360U, (uint64_t)6121058967084509393U, - (uint64_t)16897667060435514221U, (uint64_t)12367869599571112440U, - (uint64_t)3388831797050807508U, (uint64_t)16791449724090982798U, (uint64_t)2673426123453294928U, - (uint64_t)11369313542384405846U, (uint64_t)15641960333586432634U, - (uint64_t)15080962589658958379U, (uint64_t)7747943772340226569U, (uint64_t)8075023376199159152U, - (uint64_t)8485093027378306528U, (uint64_t)13503706844122243648U, (uint64_t)8401961362938086226U, - (uint64_t)8125426002124226402U, (uint64_t)9005399361407785203U, (uint64_t)6847968030066906634U, - (uint64_t)11934937736309295197U, (uint64_t)5116750888594772351U, (uint64_t)2817039227179245227U, - (uint64_t)17724206901239332980U, (uint64_t)4985702708254058578U, (uint64_t)5786345435756642871U, - (uint64_t)17772527414940936938U, (uint64_t)1201320251272957006U, - (uint64_t)15787430120324348129U, (uint64_t)6305488781359965661U, - (uint64_t)12423900845502858433U, (uint64_t)17485949424202277720U, - (uint64_t)2062237315546855852U, (uint64_t)10353639467860902375U, (uint64_t)2315398490451287299U, - (uint64_t)15394572894814882621U, (uint64_t)232866113801165640U, (uint64_t)7413443736109338926U, - (uint64_t)902719806551551191U, (uint64_t)16568853118619045174U, (uint64_t)14202214862428279177U, - (uint64_t)11719595395278861192U, (uint64_t)5890053236389907647U, (uint64_t)9996196494965833627U, - (uint64_t)12967056942364782577U, (uint64_t)9034128755157395787U, - (uint64_t)17898204904710512655U, (uint64_t)8229373445062993977U, - (uint64_t)13580036169519833644U + 0ULL, 0ULL, 0ULL, 0ULL, 1ULL, 18446744069414584320ULL, 18446744073709551615ULL, 4294967294ULL, + 0ULL, 0ULL, 0ULL, 0ULL, 8784043285714375740ULL, 8483257759279461889ULL, 8789745728267363600ULL, + 1770019616739251654ULL, 15992936863339206154ULL, 10037038012062884956ULL, + 15197544864945402661ULL, 9615747158586711429ULL, 1ULL, 18446744069414584320ULL, + 18446744073709551615ULL, 4294967294ULL, 10634854829044225757ULL, 351552716085025155ULL, + 10645315080955407736ULL, 3609262091244858135ULL, 15760741698986874125ULL, + 14936374388219697827ULL, 15751360096993017895ULL, 18012233706239762398ULL, + 1993877568177495041ULL, 10345888787846536528ULL, 7746511691117935375ULL, + 14517043990409914413ULL, 14122549297570634151ULL, 16934610359517083771ULL, + 5724511325497097418ULL, 8983432969107448705ULL, 2687429970334080245ULL, 16525396802810050288ULL, + 7602596488871585854ULL, 4813919589149203084ULL, 7680395813780804519ULL, 6687709583048023590ULL, + 18086445169104142027ULL, 9637814708330203929ULL, 14785108459960679090ULL, + 3838023279095023581ULL, 3555615526157830307ULL, 5177066488380472871ULL, 18218186719108038403ULL, + 16281556341699656105ULL, 1524227924561461191ULL, 4148060517641909597ULL, 2858290374115363433ULL, + 8942772026334130620ULL, 3034451298319885113ULL, 8447866036736640940ULL, 11204933433076256578ULL, + 18333595740249588297ULL, 8259597024804538246ULL, 9539734295777539786ULL, 9797290423046626413ULL, + 5777303437849646537ULL, 8739356909899132020ULL, 14815960973766782158ULL, + 15286581798204509801ULL, 17597362577777019682ULL, 13259283710820519742ULL, + 10501322996899164670ULL, 1221138904338319642ULL, 14586685489551951885ULL, 895326705426031212ULL, + 14398171728560617847ULL, 9592550823745097391ULL, 17240998489162206026ULL, + 8085479283308189196ULL, 14844657737893882826ULL, 15923425394150618234ULL, + 2997808084773249525ULL, 494323555453660587ULL, 1215695327517794764ULL, 9476207381098391690ULL, + 7480789678419122995ULL, 15212230329321082489ULL, 436189395349576388ULL, 17377474396456660834ULL, + 15237013929655017939ULL, 11444428846883781676ULL, 5112749694521428575ULL, 950829367509872073ULL, + 17665036182057559519ULL, 17205133339690002313ULL, 16233765170251334549ULL, + 10122775683257972591ULL, 3352514236455632420ULL, 9143148522359954691ULL, 601191684005658860ULL, + 13398772186646349998ULL, 15512696600132928431ULL, 9128416073728948653ULL, + 11233051033546138578ULL, 6769345682610122833ULL, 10823233224575054288ULL, + 9997725227559980175ULL, 6733425642852897415ULL, 16302206918151466066ULL, 1669330822143265921ULL, + 2661645605036546002ULL, 17182558479745802165ULL, 1165082692376932040ULL, 9470595929011488359ULL, + 6142147329285324932ULL, 4829075085998111287ULL, 10231370681107338930ULL, 9591876895322495239ULL, + 10316468561384076618ULL, 11592503647238064235ULL, 13395813606055179632ULL, + 511127033980815508ULL, 12434976573147649880ULL, 3425094795384359127ULL, 6816971736303023445ULL, + 15444670609021139344ULL, 9464349818322082360ULL, 16178216413042376883ULL, + 9595540370774317348ULL, 7229365182662875710ULL, 4601177649460012843ULL, 5455046447382487090ULL, + 10854066421606187521ULL, 15913416821879788071ULL, 2297365362023460173ULL, + 2603252216454941350ULL, 6768791943870490934ULL, 15705936687122754810ULL, 9537096567546600694ULL, + 17580538144855035062ULL, 4496542856965746638ULL, 8444341625922124942ULL, + 12191263903636183168ULL, 17427332907535974165ULL, 14307569739254103736ULL, + 13900598742063266169ULL, 7176996424355977650ULL, 5709008170379717479ULL, + 14471312052264549092ULL, 1464519909491759867ULL, 3328154641049602121ULL, + 13020349337171136774ULL, 2772166279972051938ULL, 10854476939425975292ULL, + 1967189930534630940ULL, 2802919076529341959ULL, 14792226094833519208ULL, + 14675640928566522177ULL, 14838974364643800837ULL, 17631460696099549980ULL, + 17434186275364935469ULL, 2665648200587705473ULL, 13202122464492564051ULL, + 7576287350918073341ULL, 2272206013910186424ULL, 14558761641743937843ULL, 5675729149929979729ULL, + 9043135187561613166ULL, 11750149293830589225ULL, 740555197954307911ULL, 9871738005087190699ULL, + 17178667634283502053ULL, 18046255991533013265ULL, 4458222096988430430ULL, + 8452427758526311627ULL, 13825286929656615266ULL, 13956286357198391218ULL, + 15875692916799995079ULL, 10634895319157013920ULL, 13230116118036304207ULL, + 8795317393614625606ULL, 7001710806858862020ULL, 7949746088586183478ULL, 14677556044923602317ULL, + 11184023437485843904ULL, 11215864722023085094ULL, 6444464081471519014ULL, + 1706241174022415217ULL, 8243975633057550613ULL, 15502902453836085864ULL, 3799182188594003953ULL, + 3538840175098724094ULL, 13240193491554624643ULL, 12365034249541329920ULL, + 2924326828590977357ULL, 5687195797140589099ULL, 16880427227292834531ULL, 9691471435758991112ULL, + 16642385273732487288ULL, 12173806747523009914ULL, 13142722756877876849ULL, + 8370377548305121979ULL, 17988526053752025426ULL, 4818750752684100334ULL, 5669241919350361655ULL, + 4964810303238518540ULL, 16709712747671533191ULL, 4461414404267448242ULL, 3971798785139504238ULL, + 6276818948740422136ULL, 1426735892164275762ULL, 7943622674892418919ULL, 9864274225563929680ULL, + 57815533745003233ULL, 10893588105168960233ULL, 15739162732907069535ULL, 3923866849462073470ULL, + 12279826158399226875ULL, 1533015761334846582ULL, 15860156818568437510ULL, + 8252625373831297988ULL, 9666953804812706358ULL, 8767785238646914634ULL, 14382179044941403551ULL, + 10401039907264254245ULL, 8584860003763157350ULL, 3120462679504470266ULL, 8670255778748340069ULL, + 5313789577940369984ULL, 16977072364454789224ULL, 12199578693972188324ULL, + 18211098771672599237ULL, 12868831556008795030ULL, 5310155061431048194ULL, + 18114153238435112606ULL, 14482365809278304512ULL, 12520721662723001511ULL, + 405943624021143002ULL, 8146944101507657423ULL, 181739317780393495ULL, 81743892273670099ULL, + 14759561962550473930ULL, 4592623849546992939ULL, 6916440441743449719ULL, 1304610503530809833ULL, + 5464930909232486441ULL, 15414883617496224671ULL, 8129283345256790ULL, 18294252198413739489ULL, + 17394115281884857288ULL, 7808348415224731235ULL, 13195566655747230608ULL, + 8568194219353949094ULL, 15329813048672122440ULL, 9604275495885785744ULL, 1577712551205219835ULL, + 15964209008022052790ULL, 15087297920782098160ULL, 3946031512438511898ULL, + 10050061168984440631ULL, 11382452014533138316ULL, 6313670788911952792ULL, + 12015989229696164014ULL, 5946702628076168852ULL, 5219995658774362841ULL, + 12230141881068377972ULL, 12361195202673441956ULL, 4732862275653856711ULL, + 17221430380805252370ULL, 15397525953897375810ULL, 16557437297239563045ULL, + 10101683801868971351ULL, 1402611372245592868ULL, 1931806383735563658ULL, + 10991705207471512479ULL, 861333583207471392ULL, 15207766844626322355ULL, 9224628129811432393ULL, + 3497069567089055613ULL, 11956632757898590316ULL, 8733729372586312960ULL, + 18091521051714930927ULL, 77582787724373283ULL, 9922437373519669237ULL, 3079321456325704615ULL, + 12171198408512478457ULL, 17179130884012147596ULL, 6839115479620367181ULL, + 4421032569964105406ULL, 10353331468657256053ULL, 17400988720335968824ULL, + 17138855889417480540ULL, 4507980080381370611ULL, 10703175719793781886ULL, + 12598516658725890426ULL, 8353463412173898932ULL, 17703029389228422404ULL, + 9313111267107226233ULL, 5441322942995154196ULL, 8952817660034465484ULL, 17571113341183703118ULL, + 7375087953801067019ULL, 13381466302076453648ULL, 3218165271423914596ULL, + 16956372157249382685ULL, 509080090049418841ULL, 13374233893294084913ULL, 2988537624204297086ULL, + 4979195832939384620ULL, 3803931594068976394ULL, 10731535883829627646ULL, + 12954845047607194278ULL, 10494298062560667399ULL, 4967351022190213065ULL, + 13391917938145756456ULL, 951370484866918160ULL, 13531334179067685307ULL, + 12868421357919390599ULL, 15918857042998130258ULL, 17769743831936974016ULL, + 7137921979260368809ULL, 12461369180685892062ULL, 827476514081935199ULL, 15107282134224767230ULL, + 10084765752802805748ULL, 3303739059392464407ULL, 17859532612136591428ULL, + 10949414770405040164ULL, 12838613589371008785ULL, 5554397169231540728ULL, + 18375114572169624408ULL, 15649286703242390139ULL, 2957281557463706877ULL, + 14000350446219393213ULL, 14355199721749620351ULL, 2730856240099299695ULL, + 17528131000714705752ULL, 2537498525883536360ULL, 6121058967084509393ULL, + 16897667060435514221ULL, 12367869599571112440ULL, 3388831797050807508ULL, + 16791449724090982798ULL, 2673426123453294928ULL, 11369313542384405846ULL, + 15641960333586432634ULL, 15080962589658958379ULL, 7747943772340226569ULL, + 8075023376199159152ULL, 8485093027378306528ULL, 13503706844122243648ULL, 8401961362938086226ULL, + 8125426002124226402ULL, 9005399361407785203ULL, 6847968030066906634ULL, 11934937736309295197ULL, + 5116750888594772351ULL, 2817039227179245227ULL, 17724206901239332980ULL, 4985702708254058578ULL, + 5786345435756642871ULL, 17772527414940936938ULL, 1201320251272957006ULL, + 15787430120324348129ULL, 6305488781359965661ULL, 12423900845502858433ULL, + 17485949424202277720ULL, 2062237315546855852ULL, 10353639467860902375ULL, + 2315398490451287299ULL, 15394572894814882621ULL, 232866113801165640ULL, 7413443736109338926ULL, + 902719806551551191ULL, 16568853118619045174ULL, 14202214862428279177ULL, + 11719595395278861192ULL, 5890053236389907647ULL, 9996196494965833627ULL, + 12967056942364782577ULL, 9034128755157395787ULL, 17898204904710512655ULL, + 8229373445062993977ULL, 13580036169519833644ULL }; #if defined(__cplusplus) diff --git a/include/msvc/internal/Hacl_SHA2_Types.h b/include/msvc/internal/Hacl_SHA2_Types.h index 1e51a0f1..5a1eb668 100644 --- a/include/msvc/internal/Hacl_SHA2_Types.h +++ b/include/msvc/internal/Hacl_SHA2_Types.h @@ -35,68 +35,68 @@ extern "C" { #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" -typedef struct Hacl_Impl_SHA2_Types_uint8_2p_s +typedef struct Hacl_Hash_SHA2_uint8_2p_s { uint8_t *fst; uint8_t *snd; } -Hacl_Impl_SHA2_Types_uint8_2p; +Hacl_Hash_SHA2_uint8_2p; -typedef struct Hacl_Impl_SHA2_Types_uint8_3p_s +typedef struct Hacl_Hash_SHA2_uint8_3p_s { uint8_t *fst; - Hacl_Impl_SHA2_Types_uint8_2p snd; + Hacl_Hash_SHA2_uint8_2p snd; } -Hacl_Impl_SHA2_Types_uint8_3p; +Hacl_Hash_SHA2_uint8_3p; -typedef struct Hacl_Impl_SHA2_Types_uint8_4p_s +typedef struct Hacl_Hash_SHA2_uint8_4p_s { uint8_t *fst; - Hacl_Impl_SHA2_Types_uint8_3p snd; + Hacl_Hash_SHA2_uint8_3p snd; } -Hacl_Impl_SHA2_Types_uint8_4p; +Hacl_Hash_SHA2_uint8_4p; -typedef struct Hacl_Impl_SHA2_Types_uint8_5p_s +typedef struct Hacl_Hash_SHA2_uint8_5p_s { uint8_t *fst; - Hacl_Impl_SHA2_Types_uint8_4p snd; + Hacl_Hash_SHA2_uint8_4p snd; } -Hacl_Impl_SHA2_Types_uint8_5p; +Hacl_Hash_SHA2_uint8_5p; -typedef struct Hacl_Impl_SHA2_Types_uint8_6p_s +typedef struct Hacl_Hash_SHA2_uint8_6p_s { uint8_t *fst; - Hacl_Impl_SHA2_Types_uint8_5p snd; + Hacl_Hash_SHA2_uint8_5p snd; } -Hacl_Impl_SHA2_Types_uint8_6p; +Hacl_Hash_SHA2_uint8_6p; -typedef struct Hacl_Impl_SHA2_Types_uint8_7p_s +typedef struct Hacl_Hash_SHA2_uint8_7p_s { uint8_t *fst; - Hacl_Impl_SHA2_Types_uint8_6p snd; + Hacl_Hash_SHA2_uint8_6p snd; } -Hacl_Impl_SHA2_Types_uint8_7p; +Hacl_Hash_SHA2_uint8_7p; -typedef struct Hacl_Impl_SHA2_Types_uint8_8p_s +typedef struct Hacl_Hash_SHA2_uint8_8p_s { uint8_t *fst; - Hacl_Impl_SHA2_Types_uint8_7p snd; + Hacl_Hash_SHA2_uint8_7p snd; } -Hacl_Impl_SHA2_Types_uint8_8p; +Hacl_Hash_SHA2_uint8_8p; -typedef struct Hacl_Impl_SHA2_Types_uint8_2x4p_s +typedef struct Hacl_Hash_SHA2_uint8_2x4p_s { - Hacl_Impl_SHA2_Types_uint8_4p fst; - Hacl_Impl_SHA2_Types_uint8_4p snd; + Hacl_Hash_SHA2_uint8_4p fst; + Hacl_Hash_SHA2_uint8_4p snd; } -Hacl_Impl_SHA2_Types_uint8_2x4p; +Hacl_Hash_SHA2_uint8_2x4p; -typedef struct Hacl_Impl_SHA2_Types_uint8_2x8p_s +typedef struct Hacl_Hash_SHA2_uint8_2x8p_s { - Hacl_Impl_SHA2_Types_uint8_8p fst; - Hacl_Impl_SHA2_Types_uint8_8p snd; + Hacl_Hash_SHA2_uint8_8p fst; + Hacl_Hash_SHA2_uint8_8p snd; } -Hacl_Impl_SHA2_Types_uint8_2x8p; +Hacl_Hash_SHA2_uint8_2x8p; #if defined(__cplusplus) } diff --git a/info.txt b/info.txt index af3dbf98..a34b82c2 100644 --- a/info.txt +++ b/info.txt @@ -1,5 +1,5 @@ The code was generated with the following toolchain. -F* version: bc622701c668f6b4092760879372968265d4a4e1 -KaRaMeL version: 7cffd27cfefbd220e986e561e8d350f043609f76 -HACL* version: 1b30697fc2b0d8d5e2f541eccfd3fb52b45b905c +F* version: 6e23042e74555544267731295b7d382c86edc574 +Karamel version: a7be2a7c43eca637ceb57fe8f3ffd16fc6627ebd +HACL* version: ae5d839c2e1fa95055b618cda60aeb1c486c720c Vale version: 0.3.19 diff --git a/js/api.js b/js/api.js index bd8c6c0d..5ad3bdde 100644 --- a/js/api.js +++ b/js/api.js @@ -217,9 +217,9 @@ var HaclWasm = (function() { // We defined a few WASM-specific "compile-time macros". var my_imports = { EverCrypt_TargetConfig: (mem) => ({ - hacl_can_compile_vale: 0, - hacl_can_compile_vec128: 0, - hacl_can_compile_vec256: 0, + HACL_CAN_COMPILE_VALE: 0, + HACL_CAN_COMPILE_VEC128: 0, + HACL_CAN_COMPILE_VEC256: 0, has_vec128_not_avx: () => false, has_vec256_not_avx2: () => false, }), diff --git a/js/api.json b/js/api.json index eec09b22..f6fa0e60 100644 --- a/js/api.json +++ b/js/api.json @@ -110,31 +110,40 @@ } }, "Chacha20Poly1305": { - "aead_encrypt": { - "module": "Hacl_Chacha20Poly1305_32", - "name": "aead_encrypt", - "args": [{ - "name": "key", - "kind": "input", + "encrypt": { + "module": "Hacl_AEAD_Chacha20Poly1305", + "name": "encrypt", + "args": [ + { + "name": "ciphertext", + "kind": "output", "type": "buffer", - "size": 32, - "interface_index": 0, + "size": "len", "tests": [ - "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f" + "d31a8d34648e60db7b86afbc53ef7ec2a4aded51296e08fea9e2b5a736ee62d63dbea45e8ca9671282fafb69da92728b1a71de0a9e060b2905d6a5b67ecd3b3692ddbd7f2d778b8c9803aee328091b58fab324e4fad675945585808b4831d7bc3ff4def08e4b7a9de576d26586cec64b6116" ] }, { - "name": "nonce", + "name": "mac", + "kind": "output", + "type": "buffer", + "size": 16, + "tests": [ + "1ae10b594f09e26a7e902ecbd0600691" + ] + }, + { + "name": "plaintext", "kind": "input", "type": "buffer", - "size": 12, - "interface_index": 1, + "size": "len", + "interface_index": 0, "tests": [ - "070000004041424344454647" + "4c616469657320616e642047656e746c656d656e206f662074686520636c617373206f66202739393a204966204920636f756c64206f6666657220796f75206f6e6c79206f6e652074697020666f7220746865206675747572652c2073756e73637265656e20776f756c642062652069742e" ] }, { - "name": "alen", + "name": "len", "kind": "input", "type": "uint32" }, @@ -143,42 +152,34 @@ "kind": "input", "type": "buffer", "size": "alen", - "interface_index": 2, + "interface_index": 1, "tests": [ "50515253c0c1c2c3c4c5c6c7" ] }, { - "name": "len", + "name": "alen", "kind": "input", "type": "uint32" }, { - "name": "plaintext", + "name": "key", "kind": "input", "type": "buffer", - "size": "len", - "interface_index": 3, - "tests": [ - "4c616469657320616e642047656e746c656d656e206f662074686520636c617373206f66202739393a204966204920636f756c64206f6666657220796f75206f6e6c79206f6e652074697020666f7220746865206675747572652c2073756e73637265656e20776f756c642062652069742e" - ] - }, - { - "name": "ciphertext", - "kind": "output", - "type": "buffer", - "size": "len", + "size": 32, + "interface_index": 2, "tests": [ - "d31a8d34648e60db7b86afbc53ef7ec2a4aded51296e08fea9e2b5a736ee62d63dbea45e8ca9671282fafb69da92728b1a71de0a9e060b2905d6a5b67ecd3b3692ddbd7f2d778b8c9803aee328091b58fab324e4fad675945585808b4831d7bc3ff4def08e4b7a9de576d26586cec64b6116" + "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f" ] }, { - "name": "mac", - "kind": "output", + "name": "nonce", + "kind": "input", "type": "buffer", - "size": 16, + "size": 12, + "interface_index": 3, "tests": [ - "1ae10b594f09e26a7e902ecbd0600691" + "070000004041424344454647" ] } ], @@ -186,31 +187,31 @@ "type": "void" } }, - "aead_decrypt": { - "module": "Hacl_Chacha20Poly1305_32", - "name": "aead_decrypt", - "args": [{ - "name": "key", - "kind": "input", + "decrypt": { + "module": "Hacl_AEAD_Chacha20Poly1305", + "name": "decrypt", + "args": [ + { + "name": "plaintext", + "kind": "output", "type": "buffer", - "size": 32, - "interface_index": 0, + "size": "len", "tests": [ - "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f" + "4c616469657320616e642047656e746c656d656e206f662074686520636c617373206f66202739393a204966204920636f756c64206f6666657220796f75206f6e6c79206f6e652074697020666f7220746865206675747572652c2073756e73637265656e20776f756c642062652069742e" ] }, { - "name": "nonce", + "name": "ciphertext", "kind": "input", "type": "buffer", - "size": 12, - "interface_index": 1, + "size": "len", + "interface_index": 0, "tests": [ - "070000004041424344454647" + "d31a8d34648e60db7b86afbc53ef7ec2a4aded51296e08fea9e2b5a736ee62d63dbea45e8ca9671282fafb69da92728b1a71de0a9e060b2905d6a5b67ecd3b3692ddbd7f2d778b8c9803aee328091b58fab324e4fad675945585808b4831d7bc3ff4def08e4b7a9de576d26586cec64b6116" ] }, { - "name": "alen", + "name": "len", "kind": "input", "type": "uint32" }, @@ -219,33 +220,34 @@ "kind": "input", "type": "buffer", "size": "alen", - "interface_index": 2, + "interface_index": 1, "tests": [ "50515253c0c1c2c3c4c5c6c7" ] }, { - "name": "len", + "name": "alen", "kind": "input", "type": "uint32" }, { - "name": "plaintext", - "kind": "output", + "name": "key", + "kind": "input", "type": "buffer", - "size": "len", + "size": 32, + "interface_index": 2, "tests": [ - "4c616469657320616e642047656e746c656d656e206f662074686520636c617373206f66202739393a204966204920636f756c64206f6666657220796f75206f6e6c79206f6e652074697020666f7220746865206675747572652c2073756e73637265656e20776f756c642062652069742e" + "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f" ] }, { - "name": "ciphertext", + "name": "nonce", "kind": "input", "type": "buffer", - "size": "len", + "size": 12, "interface_index": 3, "tests": [ - "d31a8d34648e60db7b86afbc53ef7ec2a4aded51296e08fea9e2b5a736ee62d63dbea45e8ca9671282fafb69da92728b1a71de0a9e060b2905d6a5b67ecd3b3692ddbd7f2d778b8c9803aee328091b58fab324e4fad675945585808b4831d7bc3ff4def08e4b7a9de576d26586cec64b6116" + "070000004041424344454647" ] }, { @@ -407,9 +409,19 @@ "SHA2": { "hash_512": { "module": "Hacl_Hash_SHA2", - "custom_module_name": true, - "name": "Hacl_Streaming_SHA2_hash_512", + "name": "hash_512", "args": [{ + "name": "output", + "kind": "output", + "type": "buffer", + "size": 64, + "tests": [ + "ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f", + "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e", + "204a8fc6dda82f0a0ced7beb8e08a41657c16ef468b228a8279be331a703c33596fd15c13b1b07f9aa1d3bea57789ca031ad85c7a71dd70354ec631238ca3445", + "8e959b75dae313da8cf4f72814fc143f8f7779c6eb9f7fa17299aeadb6889018501d289e4900f7e4331b99dec4b5433ac7d329eeb6dd26545e96e55b874be909" + ] + }, { "name": "input", "kind": "input", "type": "buffer", @@ -421,23 +433,10 @@ "6162636462636465636465666465666765666768666768696768696a68696a6b696a6b6c6a6b6c6d6b6c6d6e6c6d6e6f6d6e6f706e6f7071", "61626364656667686263646566676869636465666768696a6465666768696a6b65666768696a6b6c666768696a6b6c6d6768696a6b6c6d6e68696a6b6c6d6e6f696a6b6c6d6e6f706a6b6c6d6e6f70716b6c6d6e6f7071726c6d6e6f707172736d6e6f70717273746e6f707172737475" ] - }, - { + }, { "name": "input_len", "kind": "input", "type": "uint32" - }, - { - "name": "hash", - "kind": "output", - "type": "buffer", - "size": 64, - "tests": [ - "ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f", - "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e", - "204a8fc6dda82f0a0ced7beb8e08a41657c16ef468b228a8279be331a703c33596fd15c13b1b07f9aa1d3bea57789ca031ad85c7a71dd70354ec631238ca3445", - "8e959b75dae313da8cf4f72814fc143f8f7779c6eb9f7fa17299aeadb6889018501d289e4900f7e4331b99dec4b5433ac7d329eeb6dd26545e96e55b874be909" - ] } ], "return": { @@ -446,9 +445,19 @@ }, "hash_384": { "module": "Hacl_Hash_SHA2", - "custom_module_name": true, - "name": "Hacl_Streaming_SHA2_hash_384", + "name": "hash_384", "args": [{ + "name": "hash", + "kind": "output", + "type": "buffer", + "size": 48, + "tests": [ + "cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7", + "38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b", + "3391fdddfc8dc7393707a65b1b4709397cf8b1d162af05abfe8f450de5f36bc6b0455a8520bc4e6f5fe95b1fe3c8452b", + "09330c33f71147e83d192fc782cd1b4753111b173b3b05d22fa08086e3b0f712fcc7c71a557e2db966c3e9fa91746039" + ] + }, { "name": "input", "kind": "input", "type": "buffer", @@ -460,23 +469,10 @@ "6162636462636465636465666465666765666768666768696768696a68696a6b696a6b6c6a6b6c6d6b6c6d6e6c6d6e6f6d6e6f706e6f7071", "61626364656667686263646566676869636465666768696a6465666768696a6b65666768696a6b6c666768696a6b6c6d6768696a6b6c6d6e68696a6b6c6d6e6f696a6b6c6d6e6f706a6b6c6d6e6f70716b6c6d6e6f7071726c6d6e6f707172736d6e6f70717273746e6f707172737475" ] - }, - { + }, { "name": "input_len", "kind": "input", "type": "uint32" - }, - { - "name": "hash", - "kind": "output", - "type": "buffer", - "size": 48, - "tests": [ - "cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7", - "38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b", - "3391fdddfc8dc7393707a65b1b4709397cf8b1d162af05abfe8f450de5f36bc6b0455a8520bc4e6f5fe95b1fe3c8452b", - "09330c33f71147e83d192fc782cd1b4753111b173b3b05d22fa08086e3b0f712fcc7c71a557e2db966c3e9fa91746039" - ] } ], "return": { @@ -485,9 +481,19 @@ }, "hash_256": { "module": "Hacl_Hash_SHA2", - "custom_module_name": true, - "name": "Hacl_Streaming_SHA2_hash_256", + "name": "hash_256", "args": [{ + "name": "hash", + "kind": "output", + "type": "buffer", + "size": 32, + "tests": [ + "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad", + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1", + "cf5b16a778af8380036ce59e7b0492370b249b11e8f07a51afac45037afee9d1" + ] + }, { "name": "input", "kind": "input", "type": "buffer", @@ -499,23 +505,10 @@ "6162636462636465636465666465666765666768666768696768696a68696a6b696a6b6c6a6b6c6d6b6c6d6e6c6d6e6f6d6e6f706e6f7071", "61626364656667686263646566676869636465666768696a6465666768696a6b65666768696a6b6c666768696a6b6c6d6768696a6b6c6d6e68696a6b6c6d6e6f696a6b6c6d6e6f706a6b6c6d6e6f70716b6c6d6e6f7071726c6d6e6f707172736d6e6f70717273746e6f707172737475" ] - }, - { + }, { "name": "input_len", "kind": "input", "type": "uint32" - }, - { - "name": "hash", - "kind": "output", - "type": "buffer", - "size": 32, - "tests": [ - "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad", - "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1", - "cf5b16a778af8380036ce59e7b0492370b249b11e8f07a51afac45037afee9d1" - ] } ], "return": { @@ -525,18 +518,10 @@ }, "Blake2": { "blake2b": { - "module": "Hacl_Hash_Blake2", + "module": "Hacl_Hash_Blake2b", "custom_module_name": true, - "name": "Hacl_Blake2b_32_blake2b", + "name": "Hacl_Hash_Blake2b_hash_with_key", "args": [{ - "type": "uint32", - "kind": "input", - "name": "output_len", - "interface_index": 0, - "tests": [ - 64, 64 - ] - }, { "name": "output", "kind": "output", "type": "buffer", @@ -545,26 +530,28 @@ "ba80a53f981c4d0d6a2797b69f12f6e94c212f14685ac4b74b12bb6fdbffa2d17d87c5392aab792dc252d5de4533cc9518d38aa8dbf1925ab92386edd4009923", "e47bb6f20fbf14984f72a4c3cd9f3dc0d38928e536733ba7c5b153c71546584b7371f9b7070777b9a0947703409650fd04cfc9a5d561f99ed134ef262b03db94" ] - }, - { + }, { "type": "uint32", "kind": "input", - "name": "data_len" + "name": "output_len", + "interface_index": 0, + "tests": [ + 64, 64 + ] }, { - "name": "data", + "name": "input", "kind": "input", "type": "buffer", - "size": "data_len", + "size": "input_len", "interface_index": 1, "tests": [ "616263", "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" ] - }, - { + }, { "type": "uint32", "kind": "input", - "name": "key_len" + "name": "input_len" }, { "name": "key", "kind": "input", @@ -575,6 +562,10 @@ "", "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" ] + }, { + "type": "uint32", + "kind": "input", + "name": "key_len" } ], "return": { @@ -582,21 +573,10 @@ } }, "blake2s": { - "module": "Hacl_Hash_Blake2", + "module": "Hacl_Hash_Blake2s", "custom_module_name": true, - "name": "Hacl_Blake2s_32_blake2s", + "name": "Hacl_Hash_Blake2s_hash_with_key", "args": [{ - "type": "uint32", - "kind": "input", - "name": "output_len", - "interface_index": 0, - "tests": [ - 32, - 32, - 32, - 32 - ] - }, { "name": "output", "kind": "output", "type": "buffer", @@ -607,16 +587,22 @@ "3fb735061abc519dfe979e54c1ee5bfad0a9d858b3315bad34bde999efd724dd", "d12bf3732ef4af5c22fa90356af8fc50fcb40f8f2ea5c8594737a3b3d5abdbd7" ] - }, - { + }, { "type": "uint32", "kind": "input", - "name": "data_len" + "name": "output_len", + "interface_index": 0, + "tests": [ + 32, + 32, + 32, + 32 + ] }, { - "name": "data", + "name": "input", "kind": "input", "type": "buffer", - "size": "data_len", + "size": "input_len", "interface_index": 1, "tests": [ "616263", @@ -624,11 +610,10 @@ "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfe", "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fa" ] - }, - { + }, { "type": "uint32", "kind": "input", - "name": "key_len" + "name": "input_len" }, { "name": "key", "kind": "input", @@ -641,6 +626,10 @@ "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f" ] + }, { + "type": "uint32", + "kind": "input", + "name": "key_len" } ], "return": { @@ -652,27 +641,10 @@ "hash_512": { "module": "Hacl_Hash_SHA3", "custom_module_name": true, - "name": "Hacl_SHA3_sha3_512", - "args": [{ - "name": "input_len", - "kind": "input", - "type": "uint32" - }, - { - "name": "input", - "kind": "input", - "type": "buffer", - "size": "input_len", - "interface_index": 0, - "tests": [ - "", - "616263", - "6162636462636465636465666465666765666768666768696768696a68696a6b696a6b6c6a6b6c6d6b6c6d6e6c6d6e6f6d6e6f706e6f7071", - "61626364656667686263646566676869636465666768696a6465666768696a6b65666768696a6b6c666768696a6b6c6d6768696a6b6c6d6e68696a6b6c6d6e6f696a6b6c6d6e6f706a6b6c6d6e6f70716b6c6d6e6f7071726c6d6e6f707172736d6e6f70717273746e6f707172737475" - ] - }, + "name": "Hacl_Hash_SHA3_sha3_512", + "args": [ { - "name": "hash", + "name": "output", "kind": "output", "type": "buffer", "size": 64, @@ -682,22 +654,7 @@ "04a371e84ecfb5b8b77cb48610fca8182dd457ce6f326a0fd3d7ec2f1e91636dee691fbe0c985302ba1b0d8dc78c086346b533b49c030d99a27daf1139d6e75e", "afebb2ef542e6579c50cad06d2e578f9f8dd6881d7dc824d26360feebf18a4fa73e3261122948efcfd492e74e82e2189ed0fb440d187f382270cb455f21dd185" ] - } - ], - "return": { - "type": "void" - } - }, - "hash_384": { - "module": "Hacl_Hash_SHA3", - "custom_module_name": true, - "name": "Hacl_SHA3_sha3_384", - "args": [{ - "name": "input_len", - "kind": "input", - "type": "uint32" - }, - { + }, { "name": "input", "kind": "input", "type": "buffer", @@ -709,7 +666,21 @@ "6162636462636465636465666465666765666768666768696768696a68696a6b696a6b6c6a6b6c6d6b6c6d6e6c6d6e6f6d6e6f706e6f7071", "61626364656667686263646566676869636465666768696a6465666768696a6b65666768696a6b6c666768696a6b6c6d6768696a6b6c6d6e68696a6b6c6d6e6f696a6b6c6d6e6f706a6b6c6d6e6f70716b6c6d6e6f7071726c6d6e6f707172736d6e6f70717273746e6f707172737475" ] - }, + }, { + "name": "input_len", + "kind": "input", + "type": "uint32" + } + ], + "return": { + "type": "void" + } + }, + "hash_384": { + "module": "Hacl_Hash_SHA3", + "custom_module_name": true, + "name": "Hacl_Hash_SHA3_sha3_384", + "args": [ { "name": "hash", "kind": "output", @@ -721,22 +692,7 @@ "991c665755eb3a4b6bbdfb75c78a492e8c56a22c5c4d7e429bfdbc32b9d4ad5aa04a1f076e62fea19eef51acd0657c22", "79407d3b5916b59c3e30b09822974791c313fb9ecc849e406f23592d04f625dc8c709b98b43b3852b337216179aa7fc7" ] - } - ], - "return": { - "type": "void" - } - }, - "hash_256": { - "module": "Hacl_Hash_SHA3", - "custom_module_name": true, - "name": "Hacl_SHA3_sha3_256", - "args": [{ - "name": "input_len", - "kind": "input", - "type": "uint32" - }, - { + }, { "name": "input", "kind": "input", "type": "buffer", @@ -748,7 +704,21 @@ "6162636462636465636465666465666765666768666768696768696a68696a6b696a6b6c6a6b6c6d6b6c6d6e6c6d6e6f6d6e6f706e6f7071", "61626364656667686263646566676869636465666768696a6465666768696a6b65666768696a6b6c666768696a6b6c6d6768696a6b6c6d6e68696a6b6c6d6e6f696a6b6c6d6e6f706a6b6c6d6e6f70716b6c6d6e6f7071726c6d6e6f707172736d6e6f70717273746e6f707172737475" ] - }, + }, { + "name": "input_len", + "kind": "input", + "type": "uint32" + } + ], + "return": { + "type": "void" + } + }, + "hash_256": { + "module": "Hacl_Hash_SHA3", + "custom_module_name": true, + "name": "Hacl_Hash_SHA3_sha3_256", + "args": [ { "name": "hash", "kind": "output", @@ -760,22 +730,7 @@ "41c0dba2a9d6240849100376a8235e2c82e1b9998a999e21db32dd97496d3376", "916f6061fe879741ca6469b43971dfdb28b1a32dc36cb3254e812be27aad1d18" ] - } - ], - "return": { - "type": "void" - } - }, - "hash_224": { - "module": "Hacl_Hash_SHA3", - "custom_module_name": true, - "name": "Hacl_SHA3_sha3_224", - "args": [{ - "name": "input_len", - "kind": "input", - "type": "uint32" - }, - { + }, { "name": "input", "kind": "input", "type": "buffer", @@ -787,7 +742,21 @@ "6162636462636465636465666465666765666768666768696768696a68696a6b696a6b6c6a6b6c6d6b6c6d6e6c6d6e6f6d6e6f706e6f7071", "61626364656667686263646566676869636465666768696a6465666768696a6b65666768696a6b6c666768696a6b6c6d6768696a6b6c6d6e68696a6b6c6d6e6f696a6b6c6d6e6f706a6b6c6d6e6f70716b6c6d6e6f7071726c6d6e6f707172736d6e6f70717273746e6f707172737475" ] - }, + },{ + "name": "input_len", + "kind": "input", + "type": "uint32" + } + ], + "return": { + "type": "void" + } + }, + "hash_224": { + "module": "Hacl_Hash_SHA3", + "custom_module_name": true, + "name": "Hacl_Hash_SHA3_sha3_224", + "args": [ { "name": "hash", "kind": "output", @@ -799,7 +768,23 @@ "8a24108b154ada21c9fd5574494479ba5c7e7ab76ef264ead0fcce33", "543e6868e1666c1a643630df77367ae5a62a85070a51c14cbf665cbc" ] - } + }, { + "name": "input", + "kind": "input", + "type": "buffer", + "size": "input_len", + "interface_index": 0, + "tests": [ + "", + "616263", + "6162636462636465636465666465666765666768666768696768696a68696a6b696a6b6c6a6b6c6d6b6c6d6e6c6d6e6f6d6e6f706e6f7071", + "61626364656667686263646566676869636465666768696a6465666768696a6b65666768696a6b6c666768696a6b6c6d6768696a6b6c6d6e68696a6b6c6d6e6f696a6b6c6d6e6f706a6b6c6d6e6f70716b6c6d6e6f7071726c6d6e6f707172736d6e6f70717273746e6f707172737475" + ] + }, { + "name": "input_len", + "kind": "input", + "type": "uint32" + } ], "return": { "type": "void" @@ -807,8 +792,7 @@ }, "keccak": { "module": "Hacl_Hash_SHA3", - "name": "Hacl_Impl_SHA3_keccak", - "custom_module_name": true, + "name": "keccak", "args": [{ "name": "rate", "kind": "input", @@ -3694,7 +3678,7 @@ "args": [{ "name": "state", "kind": "input", - "type": "EverCrypt_Hash_Incremental_hash_state", + "type": "EverCrypt_Hash_Incremental_state_t", "interface_index": 0, "tests": [ ] @@ -3706,10 +3690,10 @@ ] } }, - "create": { + "malloc": { "module": "EverCrypt_Hash", "custom_module_name": true, - "name": "EverCrypt_Hash_Incremental_create_in", + "name": "EverCrypt_Hash_Incremental_malloc", "args": [{ "name": "hash_alg", "kind": "input", @@ -3721,7 +3705,7 @@ ], "return": { "kind": "layout", - "type": "EverCrypt_Hash_Incremental_hash_state", + "type": "EverCrypt_Hash_Incremental_state_t", "tests": [ ] } @@ -3733,7 +3717,7 @@ "args": [{ "name": "state", "kind": "output", - "type": "EverCrypt_Hash_Incremental_hash_state", + "type": "EverCrypt_Hash_Incremental_state_t", "interface_index": 0, "tests": [ ] @@ -3757,14 +3741,14 @@ ] } }, - "finish": { + "digest": { "module": "EverCrypt_Hash", "custom_module_name": true, - "name": "EverCrypt_Hash_Incremental_finish", + "name": "EverCrypt_Hash_Incremental_digest", "args": [{ "name": "state", "kind": "input", - "type": "EverCrypt_Hash_Incremental_hash_state", + "type": "EverCrypt_Hash_Incremental_state_t", "interface_index": 0, "tests": [ ] diff --git a/js/test.html b/js/test.html index 6f5c40c8..a93dfdb3 100644 --- a/js/test.html +++ b/js/test.html @@ -5,7 +5,7 @@ KaRaMeL main driver diff --git a/src/wasm/shell.js b/src/wasm/shell.js index 2b0217e7..cc877fd1 100644 --- a/src/wasm/shell.js +++ b/src/wasm/shell.js @@ -1,7 +1,7 @@ // To be loaded by main.js var my_js_files = ["./test.js"]; -var my_modules = ["WasmSupport", "FStar", "LowStar_Endianness", "Hacl_Impl_Blake2_Constants", "Hacl_Lib", "Hacl_Hash_Blake2", "Hacl_Hash_Blake2b_256", "Hacl_Hash_Blake2s_128", "Hacl_Hash_SHA3", "Hacl_Hash_Base", "Hacl_Hash_MD5", "Hacl_Hash_SHA1", "Hacl_Hash_SHA2", "EverCrypt_TargetConfig", "EverCrypt", "Vale", "EverCrypt_Hash", "Hacl_Chacha20", "Hacl_Salsa20", "Hacl_IntTypes_Intrinsics", "Hacl_Bignum_Base", "Hacl_Bignum", "Hacl_Bignum25519_51", "Hacl_Curve25519_51", "Hacl_Ed25519_PrecompTable", "Hacl_Ed25519", "Hacl_Poly1305_32", "Hacl_NaCl", "Hacl_P256_PrecompTable", "Hacl_P256", "Hacl_Bignum_K256", "Hacl_K256_PrecompTable", "Hacl_K256_ECDSA", "Hacl_HMAC", "Hacl_HKDF", "Hacl_Chacha20Poly1305_32", "Hacl_HPKE_Curve51_CP32_SHA256", "Hacl_HPKE_Curve51_CP32_SHA512", "Hacl_Streaming_Blake2b_256", "Hacl_Streaming_Blake2s_128", "Hacl_GenericField32", "Hacl_SHA2_Vec256", "Hacl_EC_K256", "Hacl_Bignum4096", "Hacl_Chacha20_Vec32", "Hacl_Bignum4096_32", "Hacl_HMAC_Blake2s_128", "Hacl_HKDF_Blake2s_128", "Hacl_GenericField64", "Hacl_Bignum32", "Hacl_Bignum256_32", "Hacl_SHA2_Vec128", "Hacl_Streaming_Poly1305_32", "Hacl_HMAC_DRBG", "Hacl_Streaming_Blake2", "Hacl_Bignum64", "Hacl_HMAC_Blake2b_256", "Hacl_HKDF_Blake2b_256", "Hacl_EC_Ed25519", "Hacl_Bignum256"]; +var my_modules = ["WasmSupport", "FStar", "LowStar_Endianness", "Hacl_Impl_Blake2_Constants", "Hacl_Lib", "Hacl_Hash_Blake2b", "Hacl_Hash_Blake2s", "Hacl_Hash_Blake2b_Simd256", "Hacl_Hash_Blake2s_Simd128", "Hacl_Hash_Base", "Hacl_Hash_SHA1", "Hacl_Hash_SHA2", "Hacl_HMAC", "Hacl_HMAC_Blake2s_128", "Hacl_HMAC_Blake2b_256", "Hacl_Hash_SHA3", "Hacl_Hash_MD5", "EverCrypt_TargetConfig", "EverCrypt", "Vale", "EverCrypt_Hash", "Hacl_Chacha20", "Hacl_Chacha20_Vec128_Hacl_Chacha20_Vec256", "Hacl_Salsa20", "Hacl_IntTypes_Intrinsics", "Hacl_Bignum_Base", "Hacl_Bignum", "Hacl_Bignum25519_51", "Hacl_Curve25519_51", "Hacl_MAC_Poly1305", "Hacl_AEAD_Chacha20Poly1305", "Hacl_Poly1305_128_Hacl_Poly1305_256_Hacl_Impl_Poly1305", "Hacl_AEAD_Chacha20Poly1305_Simd128", "Hacl_AEAD_Chacha20Poly1305_Simd256", "Hacl_Ed25519_PrecompTable", "Hacl_Ed25519", "Hacl_NaCl", "Hacl_P256_PrecompTable", "Hacl_P256", "Hacl_Bignum_K256", "Hacl_K256_PrecompTable", "Hacl_K256_ECDSA", "Hacl_HKDF", "Hacl_HPKE_Curve51_CP32_SHA256", "Hacl_HPKE_Curve51_CP32_SHA512", "Hacl_GenericField32", "Hacl_SHA2_Vec256", "Hacl_EC_K256", "Hacl_Bignum4096", "Hacl_Chacha20_Vec32", "Hacl_Bignum4096_32", "Hacl_HKDF_Blake2s_128", "Hacl_GenericField64", "Hacl_Bignum32", "Hacl_Bignum256_32", "Hacl_SHA2_Vec128", "Hacl_HMAC_DRBG", "Hacl_Bignum64", "Hacl_HKDF_Blake2b_256", "Hacl_EC_Ed25519", "Hacl_Bignum256"]; var my_debug = false; if (typeof module !== "undefined") diff --git a/tests/blake2b.cc b/tests/blake2b.cc index 95559bb7..a58c5ba3 100644 --- a/tests/blake2b.cc +++ b/tests/blake2b.cc @@ -11,17 +11,15 @@ #include "EverCrypt_Hash.h" // ANCHOR(example header) -#include "Hacl_Hash_Blake2.h" +#include "Hacl_Hash_Blake2b.h" // ANCHOR_END(example header) -#include "Hacl_Streaming_Blake2.h" #include "config.h" #include "evercrypt.h" #include "hacl-cpu-features.h" #include "util.h" #ifdef HACL_CAN_COMPILE_VEC256 -#include "Hacl_Hash_Blake2b_256.h" -#include "Hacl_Streaming_Blake2b_256.h" +#include "Hacl_Hash_Blake2b_Simd256.h" #endif #define VALE \ @@ -61,12 +59,10 @@ TEST(ApiTestSuite, ApiTest) uint32_t key_len = 0; uint8_t* key = 0; - Hacl_Blake2b_32_blake2b(HACL_HASH_BLAKE2B_DIGEST_LENGTH_MAX, - output, - message_len, - (uint8_t*)message, - key_len, - key); + Hacl_Hash_Blake2b_hash_with_key( + output, HACL_HASH_BLAKE2B_DIGEST_LENGTH_MAX, + (uint8_t*)message, message_len, + key, key_len); print_hex_ln(HACL_HASH_BLAKE2B_DIGEST_LENGTH_MAX, output); // ANCHOR_END(example) @@ -96,25 +92,22 @@ TEST(ApiTestSuite, ApiTest) uint8_t digest_2[HACL_HASH_BLAKE2B_DIGEST_LENGTH_MAX]; // Init - Hacl_Streaming_Blake2_blake2b_32_state_s* state = - Hacl_Streaming_Blake2_blake2b_32_no_key_create_in(); - Hacl_Streaming_Blake2_blake2b_32_no_key_init(state); + Hacl_Hash_Blake2b_state_t* state = Hacl_Hash_Blake2b_malloc(); + Hacl_Hash_Blake2b_reset(state); // 1/2 Include `Hello, ` into the hash calculation and // obtain the intermediate hash of "Hello, ". - Hacl_Streaming_Blake2_blake2b_32_no_key_update( - state, (uint8_t*)chunk_1, chunk_1_size); + Hacl_Hash_Blake2b_update(state, (uint8_t*)chunk_1, chunk_1_size); // This is optional when no intermediate results are required. - Hacl_Streaming_Blake2_blake2b_32_no_key_finish(state, digest_1); + Hacl_Hash_Blake2b_digest(state, digest_1); // 2/2 Include `World!` into the hash calculation and // obtain the final hash of "Hello, World!". - Hacl_Streaming_Blake2_blake2b_32_no_key_update( - state, (uint8_t*)chunk_2, chunk_2_size); - Hacl_Streaming_Blake2_blake2b_32_no_key_finish(state, digest_2); + Hacl_Hash_Blake2b_update(state, (uint8_t*)chunk_2, chunk_2_size); + Hacl_Hash_Blake2b_digest(state, digest_2); // Cleanup - Hacl_Streaming_Blake2_blake2b_32_no_key_free(state); + Hacl_Hash_Blake2b_free(state); print_hex_ln(HACL_HASH_BLAKE2B_DIGEST_LENGTH_MAX, digest_1); print_hex_ln(HACL_HASH_BLAKE2B_DIGEST_LENGTH_MAX, digest_2); @@ -233,12 +226,9 @@ TEST_P(Blake2b, KAT) { bytes got_digest(test.out_len); - Hacl_Blake2b_32_blake2b(test.out_len, - got_digest.data(), - test.input.size(), - test.input.data(), - test.key.size(), - test.key.data()); + Hacl_Hash_Blake2b_hash_with_key( + got_digest.data(), test.out_len, test.input.data(), test.input.size(), + test.key.data(), test.key.size()); bool outcome = compare_and_print(test.out_len, got_digest.data(), test.digest.data()); @@ -266,19 +256,17 @@ TEST_P(Blake2bStreaming, KAT) bytes got_digest(64); // Init - Hacl_Streaming_Blake2_blake2b_32_state_s* state = - Hacl_Streaming_Blake2_blake2b_32_no_key_create_in(); - Hacl_Streaming_Blake2_blake2b_32_no_key_init(state); + Hacl_Hash_Blake2b_state_t* state = Hacl_Hash_Blake2b_malloc(); + Hacl_Hash_Blake2b_reset(state); // Update for (auto chunk : split_by_index_list(test_case.input, lengths)) { - Hacl_Streaming_Blake2_blake2b_32_no_key_update( - state, chunk.data(), chunk.size()); + Hacl_Hash_Blake2b_update(state, chunk.data(), chunk.size()); } // Finish - Hacl_Streaming_Blake2_blake2b_32_no_key_finish(state, got_digest.data()); - Hacl_Streaming_Blake2_blake2b_32_no_key_free(state); + Hacl_Hash_Blake2b_digest(state, got_digest.data()); + Hacl_Hash_Blake2b_free(state); EXPECT_EQ(test_case.digest, got_digest); } @@ -291,18 +279,17 @@ TEST_P(Blake2bStreaming, KAT) bytes got_hash(64); // Init - Hacl_Streaming_Blake2b_256_blake2b_256_state* state = - Hacl_Streaming_Blake2b_256_blake2b_256_no_key_create_in(); - Hacl_Streaming_Blake2b_256_blake2b_256_no_key_init(state); + Hacl_Hash_Blake2b_Simd256_state_t* state = + Hacl_Hash_Blake2b_Simd256_malloc(); + Hacl_Hash_Blake2b_Simd256_reset(state); // Update - Hacl_Streaming_Blake2b_256_blake2b_256_no_key_update( + Hacl_Hash_Blake2b_Simd256_update( state, test_case.input.data(), test_case.input.size()); // Finish - Hacl_Streaming_Blake2b_256_blake2b_256_no_key_finish(state, - got_hash.data()); - Hacl_Streaming_Blake2b_256_blake2b_256_no_key_free(state); + Hacl_Hash_Blake2b_Simd256_digest(state, got_hash.data()); + Hacl_Hash_Blake2b_Simd256_free(state); EXPECT_EQ(test_case.digest, got_hash); } else { @@ -344,16 +331,16 @@ TEST_P(EverCryptSuiteTestCase, HashTest) { bytes got_digest(test.digest.size(), 0); - EverCrypt_Hash_Incremental_hash_state* state = - EverCrypt_Hash_Incremental_create_in(Spec_Hash_Definitions_Blake2B); + EverCrypt_Hash_Incremental_state_t* state = + EverCrypt_Hash_Incremental_malloc(Spec_Hash_Definitions_Blake2B); - EverCrypt_Hash_Incremental_init(state); + EverCrypt_Hash_Incremental_reset(state); for (auto chunk : split_by_index_list(test.input, lengths)) { EverCrypt_Hash_Incremental_update(state, chunk.data(), chunk.size()); } - EverCrypt_Hash_Incremental_finish(state, got_digest.data()); + EverCrypt_Hash_Incremental_digest(state, got_digest.data()); EverCrypt_Hash_Incremental_free(state); EXPECT_EQ(test.digest, got_digest); diff --git a/tests/blake2s.cc b/tests/blake2s.cc index 2b8b142f..903d2378 100644 --- a/tests/blake2s.cc +++ b/tests/blake2s.cc @@ -12,16 +12,14 @@ #include "EverCrypt_Hash.h" // ANCHOR(example header) -#include "Hacl_Hash_Blake2.h" +#include "Hacl_Hash_Blake2s.h" // ANCHOR_END(example header) -#include "Hacl_Streaming_Blake2.h" #include "evercrypt.h" #include "hacl-cpu-features.h" #include "util.h" #ifdef HACL_CAN_COMPILE_VEC128 -#include "Hacl_Hash_Blake2s_128.h" -#include "Hacl_Streaming_Blake2s_128.h" +#include "Hacl_Hash_Blake2s_Simd128.h" #endif // ANCHOR(example define) @@ -73,12 +71,10 @@ TEST(ApiTestSuite, ApiTest) uint32_t key_len = 0; uint8_t* key = 0; - Hacl_Blake2s_32_blake2s(HACL_HASH_BLAKE2S_DIGEST_LENGTH_MAX, - output, - message_len, - (uint8_t*)message, - key_len, - key); + Hacl_Hash_Blake2s_hash_with_key( + output, HACL_HASH_BLAKE2S_DIGEST_LENGTH_MAX, + (uint8_t*)message, message_len, + key, key_len); print_hex_ln(HACL_HASH_BLAKE2S_DIGEST_LENGTH_MAX, output); // ANCHOR_END(example) @@ -107,25 +103,22 @@ TEST(ApiTestSuite, ApiTest) uint8_t digest_2[HACL_HASH_BLAKE2S_DIGEST_LENGTH_MAX]; // Init - Hacl_Streaming_Blake2_blake2s_32_state_s* state = - Hacl_Streaming_Blake2_blake2s_32_no_key_create_in(); - Hacl_Streaming_Blake2_blake2s_32_no_key_init(state); + Hacl_Hash_Blake2s_state_t* state = Hacl_Hash_Blake2s_malloc(); + Hacl_Hash_Blake2s_reset(state); // 1/2 Include `Hello, ` into the hash calculation and // obtain the intermediate hash of "Hello, ". - Hacl_Streaming_Blake2_blake2s_32_no_key_update( - state, (uint8_t*)chunk_1, chunk_1_size); + Hacl_Hash_Blake2s_update(state, (uint8_t*)chunk_1, chunk_1_size); // This is optional when no intermediate results are required. - Hacl_Streaming_Blake2_blake2s_32_no_key_finish(state, digest_1); + Hacl_Hash_Blake2s_digest(state, digest_1); // 2/2 Include `World!` into the hash calculation and // obtain the final hash of "Hello, World!". - Hacl_Streaming_Blake2_blake2s_32_no_key_update( - state, (uint8_t*)chunk_2, chunk_2_size); - Hacl_Streaming_Blake2_blake2s_32_no_key_finish(state, digest_2); + Hacl_Hash_Blake2s_update(state, (uint8_t*)chunk_2, chunk_2_size); + Hacl_Hash_Blake2s_digest(state, digest_2); // Cleanup - Hacl_Streaming_Blake2_blake2s_32_no_key_free(state); + Hacl_Hash_Blake2s_free(state); print_hex_ln(HACL_HASH_BLAKE2S_DIGEST_LENGTH_MAX, digest_1); print_hex_ln(HACL_HASH_BLAKE2S_DIGEST_LENGTH_MAX, digest_2); @@ -161,12 +154,9 @@ TEST_P(Blake2s, TryKAT) { bytes got_digest(test.out_len); - Hacl_Blake2s_32_blake2s(test.out_len, - got_digest.data(), - test.input.size(), - test.input.data(), - test.key.size(), - test.key.data()); + Hacl_Hash_Blake2s_hash_with_key( + got_digest.data(), test.out_len, test.input.data(), test.input.size(), + test.key.data(), test.key.size()); bool outcome = false; outcome = @@ -181,19 +171,17 @@ TEST_P(Blake2s, TryKAT) if (test.key.size() == 0) { // Init - Hacl_Streaming_Blake2_blake2s_32_state* state = - Hacl_Streaming_Blake2_blake2s_32_no_key_create_in(); - Hacl_Streaming_Blake2_blake2s_32_no_key_init(state); + Hacl_Hash_Blake2s_state_t* state = Hacl_Hash_Blake2s_malloc(); + Hacl_Hash_Blake2s_reset(state); // Update for (auto chunk : split_by_index_list(test.input, lengths)) { - Hacl_Streaming_Blake2_blake2s_32_no_key_update( - state, chunk.data(), chunk.size()); + Hacl_Hash_Blake2s_update(state, chunk.data(), chunk.size()); } // Finish - Hacl_Streaming_Blake2_blake2s_32_no_key_finish(state, got_digest.data()); - Hacl_Streaming_Blake2_blake2s_32_no_key_free(state); + Hacl_Hash_Blake2s_digest(state, got_digest.data()); + Hacl_Hash_Blake2s_free(state); bool outcome = compare_and_print( test.digest.size(), got_digest.data(), test.digest.data()); @@ -210,23 +198,21 @@ TEST_P(Blake2s, TryKAT) // TODO: Enable this. See // https://github.com/project-everest/hacl-star/issues/586 // - // Hacl_Blake2s_128_blake2s(expected_len, got_digest.data(), input_len, - // input, key_len, key); outcome = outcome && + // Hacl_Hash_Blake2s_Simd128_hash(got_digest.data(), expected_len, input, + // input_len, key, key_len); outcome = outcome && // compare_and_print(expected_len, got_digest.data(), expected); // // // Streaming variant. // if (key_len == 0) { // // Init - // Hacl_Streaming_Blake2s_128_blake2s_128_state_s* state = - // Hacl_Streaming_Blake2s_128_blake2s_128_no_key_create_in(); + // Hacl_Hash_Blake2s_Simd128_state_t* state = + // Hacl_Hash_Blake2s_Simd128_malloc(); // // // Update - // Hacl_Streaming_Blake2s_128_blake2s_128_no_key_update(state, input, - // input_len); + // Hacl_Hash_Blake2s_Simd128_update(state, input, input_len); // // // Finish - // Hacl_Streaming_Blake2s_128_blake2s_128_no_key_finish(state, - // got_digest.data()); + // Hacl_Hash_Blake2s_Simd128_digest(state, got_digest.data()); // // outcome = outcome && compare_and_print(expected_len, // got_digest.data(), expected); @@ -326,14 +312,14 @@ TEST_P(EverCryptSuiteTestCase, HashTest) { bytes got_digest(test.digest.size(), 0); - EverCrypt_Hash_Incremental_hash_state* state = - EverCrypt_Hash_Incremental_create_in(Spec_Hash_Definitions_Blake2S); + EverCrypt_Hash_Incremental_state_t* state = + EverCrypt_Hash_Incremental_malloc(Spec_Hash_Definitions_Blake2S); - EverCrypt_Hash_Incremental_init(state); + EverCrypt_Hash_Incremental_reset(state); for (auto chunk : split_by_index_list(test.input, lengths)) { EverCrypt_Hash_Incremental_update(state, chunk.data(), chunk.size()); } - EverCrypt_Hash_Incremental_finish(state, got_digest.data()); + EverCrypt_Hash_Incremental_digest(state, got_digest.data()); EverCrypt_Hash_Incremental_free(state); EXPECT_EQ(test.digest, got_digest); diff --git a/tests/chacha20poly1305.cc b/tests/chacha20poly1305.cc index fe2e6970..aa07c88e 100644 --- a/tests/chacha20poly1305.cc +++ b/tests/chacha20poly1305.cc @@ -8,7 +8,7 @@ #include -#include "Hacl_Chacha20Poly1305_32.h" +#include "Hacl_AEAD_Chacha20Poly1305.h" #include "Hacl_Chacha20_Vec32.h" #include "chacha20poly1305_vectors.h" #include "hacl-cpu-features.h" @@ -16,11 +16,11 @@ #include "wycheproof.h" #ifdef HACL_CAN_COMPILE_VEC128 -#include "Hacl_Chacha20Poly1305_128.h" +#include "Hacl_AEAD_Chacha20Poly1305_Simd128.h" #endif #ifdef HACL_CAN_COMPILE_VEC256 -#include "Hacl_Chacha20Poly1305_256.h" +#include "Hacl_AEAD_Chacha20Poly1305_Simd256.h" #endif #define VALE \ @@ -34,10 +34,10 @@ // Function pointer to multiplex between the different implementations. typedef void (*test_encrypt)(uint8_t*, uint8_t*, - uint32_t, uint8_t*, uint32_t, uint8_t*, + uint32_t, uint8_t*, uint8_t*); @@ -68,12 +68,12 @@ print_test(test_encrypt aead_encrypt, memset(ciphertext, 0, in_len * sizeof ciphertext[0]); uint8_t mac[16] = { 0 }; - (*aead_encrypt)(key, nonce, aad_len, aad, in_len, in, ciphertext, mac); + (*aead_encrypt)(ciphertext, mac, in, in_len, aad, aad_len, key, nonce); bool ok = compare_and_print(in_len, ciphertext, exp_cipher); ok = ok && compare_and_print(16, mac, exp_mac); int res = (*aead_decrypt)( - key, nonce, aad_len, aad, in_len, plaintext, exp_cipher, exp_mac); + plaintext, exp_cipher, in_len, aad, aad_len, key, nonce, exp_mac); ok = ok && (res == 0); ok = ok && compare_and_print(in_len, plaintext, in); @@ -125,22 +125,16 @@ TEST(ApiSuite, ApiTest) uint8_t mac[HACL_AEAD_CHACHA20_POLY1305_MAC_LEN]; // Encryption. - Hacl_Chacha20Poly1305_32_aead_encrypt( - key, nonce, aad_len, (uint8_t*)aad, msg_len, (uint8_t*)msg, cipher, mac); + Hacl_AEAD_Chacha20Poly1305_encrypt( + cipher, mac, (uint8_t*)msg, msg_len, (uint8_t*)aad, aad_len, key, nonce); // Decryption. // Allocate the same amount of memory for the recovered message as for the // ciphertext. uint8_t* recovered = (uint8_t*)malloc(msg_len); - uint32_t res = Hacl_Chacha20Poly1305_32_aead_decrypt(key, - nonce, - aad_len, - (uint8_t*)aad, - msg_len, - (uint8_t*)recovered, - cipher, - mac); + uint32_t res = Hacl_AEAD_Chacha20Poly1305_decrypt( + (uint8_t*)recovered, cipher, msg_len, (uint8_t*)aad, aad_len, key, nonce, mac); if (res == 0) { printf("Decryption successful."); @@ -164,8 +158,8 @@ TEST_P(Chacha20Poly1305Testing, TryTestVectors) hacl_init_cpu_features(); const chacha20poly1305_test_vector& vectors(GetParam()); - bool test = print_test(&Hacl_Chacha20Poly1305_32_aead_encrypt, - &Hacl_Chacha20Poly1305_32_aead_decrypt, + bool test = print_test(&Hacl_AEAD_Chacha20Poly1305_encrypt, + &Hacl_AEAD_Chacha20Poly1305_decrypt, vectors.input_len, vectors.input, &vectors.key[0], @@ -180,8 +174,8 @@ TEST_P(Chacha20Poly1305Testing, TryTestVectors) // We might have compiled vec128 chachapoly but don't have it available on the // CPU when running now. if (hacl_vec128_support()) { - test = print_test(&Hacl_Chacha20Poly1305_128_aead_encrypt, - &Hacl_Chacha20Poly1305_128_aead_decrypt, + test = print_test(&Hacl_AEAD_Chacha20Poly1305_Simd128_encrypt, + &Hacl_AEAD_Chacha20Poly1305_Simd128_decrypt, vectors.input_len, vectors.input, &vectors.key[0], @@ -200,8 +194,8 @@ TEST_P(Chacha20Poly1305Testing, TryTestVectors) // We might have compiled vec256 chachapoly but don't have it available on the // CPU when running now. if (hacl_vec256_support()) { - test = print_test(&Hacl_Chacha20Poly1305_256_aead_encrypt, - &Hacl_Chacha20Poly1305_256_aead_decrypt, + test = print_test(&Hacl_AEAD_Chacha20Poly1305_Simd256_encrypt, + &Hacl_AEAD_Chacha20Poly1305_Simd256_decrypt, vectors.input_len, vectors.input, &vectors.key[0], @@ -247,15 +241,15 @@ TEST_P(Chacha20Poly1305Wycheproof, TryWycheproof) uint8_t* ct = const_cast(test_case.ct.data()); // Check that encryption yields the expected cipher text. - Hacl_Chacha20Poly1305_32_aead_encrypt( - key, iv, test_case.aad.size(), aad, msg_size, msg, ciphertext.data(), mac); + Hacl_AEAD_Chacha20Poly1305_encrypt( + ciphertext.data(), mac, msg, msg_size, aad, test_case.aad.size(), key, iv); if (test_case.valid) { EXPECT_EQ(ciphertext, test_case.ct); EXPECT_EQ(std::vector(mac, mac + 16), test_case.tag); } - int res = Hacl_Chacha20Poly1305_32_aead_decrypt( - key, iv, test_case.aad.size(), aad, msg_size, plaintext.data(), ct, tag); + int res = Hacl_AEAD_Chacha20Poly1305_decrypt( + plaintext.data(), ct, msg_size, aad, test_case.aad.size(), key, iv, tag); EXPECT_EQ(res, test_case.valid ? 0 : 1); { @@ -278,21 +272,15 @@ TEST_P(Chacha20Poly1305Wycheproof, TryWycheproof) // CPU when running now. if (hacl_vec128_support()) { // Check that encryption yields the expected cipher text. - Hacl_Chacha20Poly1305_128_aead_encrypt(key, - iv, - test_case.aad.size(), - aad, - msg_size, - msg, - ciphertext.data(), - mac); + Hacl_AEAD_Chacha20Poly1305_Simd128_encrypt( + ciphertext.data(), mac, msg, msg_size, aad, test_case.aad.size(), key, iv); if (test_case.valid) { EXPECT_EQ(ciphertext, test_case.ct); EXPECT_EQ(std::vector(mac, mac + 16), test_case.tag); } - res = Hacl_Chacha20Poly1305_128_aead_decrypt( - key, iv, test_case.aad.size(), aad, msg_size, plaintext.data(), ct, tag); + res = Hacl_AEAD_Chacha20Poly1305_Simd128_decrypt( + plaintext.data(), ct, msg_size, aad, test_case.aad.size(), key, iv, tag); EXPECT_EQ(res, test_case.valid ? 0 : 1); } else { printf(" ! Vec128 was compiled but it is not available on this CPU.\n"); @@ -305,21 +293,15 @@ TEST_P(Chacha20Poly1305Wycheproof, TryWycheproof) // CPU when running now. if (hacl_vec256_support()) { // Check that encryption yields the expected cipher text. - Hacl_Chacha20Poly1305_256_aead_encrypt(key, - iv, - test_case.aad.size(), - aad, - msg_size, - msg, - ciphertext.data(), - mac); + Hacl_AEAD_Chacha20Poly1305_Simd256_encrypt( + ciphertext.data(), mac, msg, msg_size, aad, test_case.aad.size(), key, iv); if (test_case.valid) { EXPECT_EQ(ciphertext, test_case.ct); EXPECT_EQ(std::vector(mac, mac + 16), test_case.tag); } - res = Hacl_Chacha20Poly1305_256_aead_decrypt( - key, iv, test_case.aad.size(), aad, msg_size, plaintext.data(), ct, tag); + res = Hacl_AEAD_Chacha20Poly1305_Simd256_decrypt( + plaintext.data(), ct, msg_size, aad, test_case.aad.size(), key, iv, tag); EXPECT_EQ(res, test_case.valid ? 0 : 1); } else { printf(" ! Vec256 was compiled but it is not available on this CPU.\n"); diff --git a/tests/hmac.cc b/tests/hmac.cc index 942aa296..77c86ebd 100644 --- a/tests/hmac.cc +++ b/tests/hmac.cc @@ -155,7 +155,7 @@ TEST_P(HmacKAT, TryKAT) bytes tag(test_case.full_size, 0); if (test_case.full_size == 20) { - Hacl_HMAC_legacy_compute_sha1( + Hacl_HMAC_compute_sha1( tag.data(), key, test_case.key.size(), msg, test_case.msg.size()); } else if (test_case.full_size == 28) { std::cout << "Skipping \"full_size=" << test_case.full_size << "\"" diff --git a/tests/k256_ecdsa.cc b/tests/k256_ecdsa.cc index b3bf7aaf..d6643b2c 100644 --- a/tests/k256_ecdsa.cc +++ b/tests/k256_ecdsa.cc @@ -178,7 +178,7 @@ TEST_P(P256EcdsaWycheproof, TryWycheproof) // TODO: Only testing non low-S normalized here for now. uint8_t digest[32] = { 0 }; - Hacl_Streaming_SHA2_hash_256(msg, test_case.msg.size(), &digest[0]); + Hacl_Hash_SHA2_hash_256(&digest[0], msg, test_case.msg.size()); EXPECT_EQ(test_case.valid, Hacl_K256_ECDSA_ecdsa_verify_hashed_msg( &digest[0], plain_public_key, rs.data())); diff --git a/tests/md5.cc b/tests/md5.cc index 827152e9..b212a4b7 100644 --- a/tests/md5.cc +++ b/tests/md5.cc @@ -33,8 +33,7 @@ TEST_P(Md5Suite, TestCase) auto test = GetParam(); bytes got_hash = std::vector(16); - Hacl_Streaming_MD5_legacy_hash( - test.message.data(), test.message.size(), got_hash.data()); + Hacl_Hash_MD5_hash(got_hash.data(), test.message.data(), test.message.size()); EXPECT_EQ(got_hash, test.hash); } @@ -63,12 +62,12 @@ TEST_P(EverCryptSuiteTestCase, HashTest) { bytes got_digest(Hacl_Hash_Definitions_hash_len(Spec_Hash_Definitions_MD5)); - EverCrypt_Hash_Incremental_hash_state* state = - EverCrypt_Hash_Incremental_create_in(Spec_Hash_Definitions_MD5); - EverCrypt_Hash_Incremental_init(state); + EverCrypt_Hash_Incremental_state_t* state = + EverCrypt_Hash_Incremental_malloc(Spec_Hash_Definitions_MD5); + EverCrypt_Hash_Incremental_reset(state); EverCrypt_Hash_Incremental_update( state, test.message.data(), test.message.size()); - EverCrypt_Hash_Incremental_finish(state, got_digest.data()); + EverCrypt_Hash_Incremental_digest(state, got_digest.data()); EverCrypt_Hash_Incremental_free(state); ASSERT_EQ(test.hash, got_digest); diff --git a/tests/poly1305.cc b/tests/poly1305.cc index d12f0216..5b1f0bde 100644 --- a/tests/poly1305.cc +++ b/tests/poly1305.cc @@ -11,19 +11,16 @@ #include #include "EverCrypt_Poly1305.h" -#include "Hacl_Poly1305_32.h" -#include "Hacl_Streaming_Poly1305_32.h" +#include "Hacl_MAC_Poly1305.h" #include "hacl-cpu-features.h" #include "util.h" #ifdef HACL_CAN_COMPILE_VEC128 -#include "Hacl_Poly1305_128.h" -#include "Hacl_Streaming_Poly1305_128.h" +#include "Hacl_MAC_Poly1305_Simd128.h" #endif #ifdef HACL_CAN_COMPILE_VEC256 -#include "Hacl_Poly1305_256.h" -#include "Hacl_Streaming_Poly1305_256.h" +#include "Hacl_MAC_Poly1305_Simd256.h" #endif using json = nlohmann::json; @@ -62,16 +59,15 @@ poly1305_mac(bytes key, bytes text, bytes& tag) // This works everywhere. Let's use it as a base for comparisons. bytes base_tag = vector(POLY1305_TAG_SIZE); - Hacl_Poly1305_32_poly1305_mac( - base_tag.data(), text.size(), text.data(), key.data()); + Hacl_MAC_Poly1305_mac(base_tag.data(), text.data(), text.size(), key.data()); #ifdef HACL_CAN_COMPILE_VEC128 if (hacl_vec128_support()) { cout << "Poly1305.Mac (VEC128)" << endl; bytes tag = vector(POLY1305_TAG_SIZE); - Hacl_Poly1305_128_poly1305_mac( - tag.data(), text.size(), text.data(), key.data()); + Hacl_MAC_Poly1305_Simd128_mac( + tag.data(), text.data(), text.size(), key.data()); EXPECT_EQ(base_tag, tag) << "Detected difference between base and _128 version"; @@ -85,8 +81,8 @@ poly1305_mac(bytes key, bytes text, bytes& tag) cout << "Poly1305.Mac (VEC256)" << endl; bytes tag = vector(POLY1305_TAG_SIZE); - Hacl_Poly1305_256_poly1305_mac( - tag.data(), text.size(), text.data(), key.data()); + Hacl_MAC_Poly1305_Simd256_mac( + tag.data(), text.data(), text.size(), key.data()); EXPECT_EQ(base_tag, tag) << "Detected difference between base and _256 version"; @@ -103,7 +99,7 @@ poly1305_mac(bytes key, bytes text, bytes& tag) bytes tag = bytes(POLY1305_TAG_SIZE); - EverCrypt_Poly1305_poly1305( + EverCrypt_Poly1305_mac( tag.data(), text.data(), text.size(), key.data()); EXPECT_EQ(base_tag, tag) @@ -119,87 +115,46 @@ poly1305_mac_streaming(bytes key, vector lengths, bytes expected_tag) { - cout << "Poly1305.Mac (Streaming, Variant 1)" << endl; - { - bytes got_tag = vector(POLY1305_TAG_SIZE); - - // Init - vector ctx(32); - Hacl_Poly1305_32_poly1305_init(ctx.data(), key.data()); - - // Update - // Note: This doesn't work with arbitrary chunks. - for (auto chunk : chunk(text, 16)) { - Hacl_Poly1305_32_poly1305_update(ctx.data(), chunk.size(), chunk.data()); - } - - // Finish - Hacl_Poly1305_32_poly1305_finish(got_tag.data(), key.data(), ctx.data()); - - ASSERT_EQ(expected_tag, got_tag); - } - - cout << "Poly1305.Mac (Streaming, Variant 2)" << endl; + cout << "Poly1305.Mac (Streaming)" << endl; { bytes got_tag = vector(POLY1305_TAG_SIZE); // Init uint8_t raw_state[32]; - Hacl_Streaming_Poly1305_32_poly1305_32_state_s* state = - Hacl_Streaming_Poly1305_32_create_in(raw_state); - Hacl_Streaming_Poly1305_32_init(key.data(), state); + Hacl_MAC_Poly1305_state_t* state = Hacl_MAC_Poly1305_malloc(raw_state); + Hacl_MAC_Poly1305_reset(state, key.data()); // Update for (auto chunk : split_by_index_list(text, lengths)) { - Hacl_Streaming_Poly1305_32_update(state, chunk.data(), chunk.size()); + Hacl_MAC_Poly1305_update(state, chunk.data(), chunk.size()); } // Finish - Hacl_Streaming_Poly1305_32_finish(state, got_tag.data()); - Hacl_Streaming_Poly1305_32_free(state); + Hacl_MAC_Poly1305_digest(state, got_tag.data()); + Hacl_MAC_Poly1305_free(state); ASSERT_EQ(expected_tag, got_tag); } #ifdef HACL_CAN_COMPILE_VEC128 if (hacl_vec128_support()) { - cout << "Poly1305.Mac (VEC128, Streaming, Variant 1)" << endl; - { - bytes got_tag = vector(POLY1305_TAG_SIZE); - - // Init - Lib_IntVector_Intrinsics_vec128 ctx[32]; - Hacl_Poly1305_128_poly1305_init(ctx, key.data()); - - // Update - // Note: This doesn't work with arbitrary chunks. - for (auto chunk : chunk(text, 16)) { - Hacl_Poly1305_128_poly1305_update(ctx, chunk.size(), chunk.data()); - } - - // Finish - Hacl_Poly1305_128_poly1305_finish(got_tag.data(), key.data(), ctx); - - ASSERT_EQ(expected_tag, got_tag); - } - - cout << "Poly1305.Mac (VEC128, Streaming, Variant 2)" << endl; + cout << "Poly1305.Mac (VEC128, Streaming)" << endl; { bytes got_tag = vector(POLY1305_TAG_SIZE); // Init - Hacl_Streaming_Poly1305_128_poly1305_128_state* state = - Hacl_Streaming_Poly1305_128_create_in(key.data()); - Hacl_Streaming_Poly1305_128_init(key.data(), state); + Hacl_MAC_Poly1305_Simd128_state_t* state = + Hacl_MAC_Poly1305_Simd128_malloc(key.data()); + Hacl_MAC_Poly1305_Simd128_reset(state, key.data()); // Update for (auto chunk : split_by_index_list(text, lengths)) { - Hacl_Streaming_Poly1305_128_update(state, chunk.data(), chunk.size()); + Hacl_MAC_Poly1305_Simd128_update(state, chunk.data(), chunk.size()); } // Finish - Hacl_Streaming_Poly1305_128_finish(state, got_tag.data()); - Hacl_Streaming_Poly1305_128_free(state); + Hacl_MAC_Poly1305_Simd128_digest(state, got_tag.data()); + Hacl_MAC_Poly1305_Simd128_free(state); ASSERT_EQ(expected_tag, got_tag); } @@ -210,49 +165,25 @@ poly1305_mac_streaming(bytes key, #ifdef HACL_CAN_COMPILE_VEC256 if (hacl_vec256_support()) { - cout << "Poly1305.Mac (VEC256, Streaming, Variant 1)" << endl; + cout << "Poly1305.Mac (VEC256, Streaming)" << endl; { - bytes got_tag = vector(POLY1305_TAG_SIZE); - + bytes tag = vector(POLY1305_TAG_SIZE); + // Init - Lib_IntVector_Intrinsics_vec256 ctx[32]; - Hacl_Poly1305_256_poly1305_init(ctx, key.data()); - + Hacl_MAC_Poly1305_Simd256_state_t* state = + Hacl_MAC_Poly1305_Simd256_malloc(key.data()); + // Update - // Note: This doesn't work with arbitrary chunks. - for (auto chunk : chunk(text, 16)) { - Hacl_Poly1305_256_poly1305_update(ctx, chunk.size(), chunk.data()); + for (auto chunk : split_by_index_list(text, lengths)) { + Hacl_MAC_Poly1305_Simd256_update(state, chunk.data(), chunk.size()); } - + // Finish - Hacl_Poly1305_256_poly1305_finish(got_tag.data(), key.data(), ctx); - - ASSERT_EQ(expected_tag, got_tag); - } - - cout << "Poly1305.Mac (VEC256, Streaming, Variant 2)" << endl; - { - // TODO: This doesn't work currently. - // See https://github.com/project-everest/hacl-star/issues/586 - - // bytes tag = vector(POLY1305_TAG_SIZE); - // - // // Init - // Hacl_Streaming_Poly1305_256_poly1305_256_state* state = - // Hacl_Streaming_Poly1305_256_create_in(key.data()); - // - // // Update - // for (auto chunk : chunks) { - // Hacl_Streaming_Poly1305_256_update(state, chunk.data(), - // chunk.size()); - // } - // - // // Finish - // Hacl_Streaming_Poly1305_256_finish(state, tag.data()); - // Hacl_Streaming_Poly1305_256_free(state); - // - // EXPECT_EQ(base_tag, tag) - // << "Detected difference between _32 and _128 version"; + Hacl_MAC_Poly1305_Simd256_digest(state, tag.data()); + Hacl_MAC_Poly1305_Simd256_free(state); + + EXPECT_EQ(expected_tag, tag) + << "Detected difference between _32 and _128 version"; } } else { cout << "No support for VEC256 on this CPU." << endl; diff --git a/tests/sha1.cc b/tests/sha1.cc index b0c13a3e..b253d7e9 100644 --- a/tests/sha1.cc +++ b/tests/sha1.cc @@ -76,7 +76,7 @@ TEST(ApiSuite, ApiTest) uint8_t digest[HACL_HASH_SHA1_DIGEST_LENGTH]; - Hacl_Streaming_SHA1_legacy_hash((uint8_t*)message, message_size, digest); + Hacl_Hash_SHA1_hash(digest, (uint8_t*)message, message_size); // END OneShot bytes expected_digest = @@ -94,7 +94,7 @@ TEST(ApiSuite, ApiTest) // ANCHOR(streaming) // This example shows how to hash the byte sequence "Hello, World!" in two // chunks. As a bonus, it also shows how to obtain intermediate results by - // calling `finish` more than once. + // calling `digest` more than once. const char* chunk_1 = "Hello, "; const char* chunk_2 = "World!"; @@ -105,22 +105,22 @@ TEST(ApiSuite, ApiTest) uint8_t digest_2[HACL_HASH_SHA1_DIGEST_LENGTH]; // Init - Hacl_Streaming_SHA1_state* state = Hacl_Streaming_SHA1_legacy_create_in(); - Hacl_Streaming_SHA1_legacy_init(state); + Hacl_Hash_SHA1_state_t* state = Hacl_Hash_SHA1_malloc(); + Hacl_Hash_SHA1_reset(state); // 1/2 Include `Hello, ` into the hash calculation and // obtain the intermediate hash of "Hello, ". - Hacl_Streaming_SHA1_legacy_update(state, (uint8_t*)chunk_1, chunk_1_size); + Hacl_Hash_SHA1_update(state, (uint8_t*)chunk_1, chunk_1_size); // This is optional when no intermediate results are required. - Hacl_Streaming_SHA1_legacy_finish(state, digest_1); + Hacl_Hash_SHA1_digest(state, digest_1); // 2/2 Include `World!` into the hash calculation and // obtain the final hash of "Hello, World!". - Hacl_Streaming_SHA1_legacy_update(state, (uint8_t*)chunk_2, chunk_2_size); - Hacl_Streaming_SHA1_legacy_finish(state, digest_2); + Hacl_Hash_SHA1_update(state, (uint8_t*)chunk_2, chunk_2_size); + Hacl_Hash_SHA1_digest(state, digest_2); // Cleanup - Hacl_Streaming_SHA1_legacy_free(state); + Hacl_Hash_SHA1_free(state); print_hex_ln(HACL_HASH_SHA1_DIGEST_LENGTH, digest_1); print_hex_ln(HACL_HASH_SHA1_DIGEST_LENGTH, digest_2); @@ -154,17 +154,17 @@ TEST_P(Sha1, KAT) bytes digest(test.md.size()); // Init - Hacl_Streaming_SHA1_state* state = Hacl_Streaming_SHA1_legacy_create_in(); - Hacl_Streaming_SHA1_legacy_init(state); + Hacl_Hash_SHA1_state_t* state = Hacl_Hash_SHA1_malloc(); + Hacl_Hash_SHA1_reset(state); // Update for (auto chunk : split_by_index_list(test.msg, lengths)) { - Hacl_Streaming_SHA1_legacy_update(state, chunk.data(), chunk.size()); + Hacl_Hash_SHA1_update(state, chunk.data(), chunk.size()); } // Finish - Hacl_Streaming_SHA1_legacy_finish(state, digest.data()); - Hacl_Streaming_SHA1_legacy_free(state); + Hacl_Hash_SHA1_digest(state, digest.data()); + Hacl_Hash_SHA1_free(state); EXPECT_EQ(test.md, digest) << bytes_to_hex(test.md) << endl << bytes_to_hex(digest) << endl; @@ -198,15 +198,15 @@ TEST_P(EverCryptSuiteTestCase, HashTest) bytes got_digest( Hacl_Hash_Definitions_hash_len(Spec_Hash_Definitions_SHA1)); - EverCrypt_Hash_Incremental_hash_state* state = - EverCrypt_Hash_Incremental_create_in(Spec_Hash_Definitions_SHA1); - EverCrypt_Hash_Incremental_init(state); + EverCrypt_Hash_Incremental_state_t* state = + EverCrypt_Hash_Incremental_malloc(Spec_Hash_Definitions_SHA1); + EverCrypt_Hash_Incremental_reset(state); for (auto chunk : split_by_index_list(test.msg, lengths)) { EverCrypt_Hash_Incremental_update(state, chunk.data(), chunk.size()); } - EverCrypt_Hash_Incremental_finish(state, got_digest.data()); + EverCrypt_Hash_Incremental_digest(state, got_digest.data()); EverCrypt_Hash_Incremental_free(state); ASSERT_EQ(test.md, got_digest); diff --git a/tests/sha2.cc b/tests/sha2.cc index 12cdbd21..9ccce2e6 100644 --- a/tests/sha2.cc +++ b/tests/sha2.cc @@ -80,7 +80,7 @@ TEST(ApiSuite, ApiTest) uint8_t digest[HACL_HASH_SHA2_256_DIGEST_LENGTH]; - Hacl_Streaming_SHA2_hash_256((uint8_t*)message, message_size, digest); + Hacl_Hash_SHA2_hash_256(digest, (uint8_t*)message, message_size); // END OneShot bytes expected_digest = from_hex( @@ -98,7 +98,7 @@ TEST(ApiSuite, ApiTest) // ANCHOR(example streaming) // This example shows how to hash the byte sequence "Hello, World!" in two // chunks. As a bonus, it also shows how to obtain intermediate results by - // calling `finish` more than once. + // calling `digest` more than once. const char* chunk_1 = "Hello, "; const char* chunk_2 = "World!"; @@ -109,23 +109,22 @@ TEST(ApiSuite, ApiTest) uint8_t digest_2[HACL_HASH_SHA2_256_DIGEST_LENGTH]; // Init - Hacl_Streaming_SHA2_state_sha2_256* state = - Hacl_Streaming_SHA2_create_in_256(); - Hacl_Streaming_SHA2_init_256(state); + Hacl_Hash_SHA2_state_t_256* state = + Hacl_Hash_SHA2_malloc_256(); // 1/2 Include `Hello, ` into the hash calculation and // obtain the intermediate hash of "Hello, ". - Hacl_Streaming_SHA2_update_256(state, (uint8_t*)chunk_1, chunk_1_size); + Hacl_Hash_SHA2_update_256(state, (uint8_t*)chunk_1, chunk_1_size); // This is optional when no intermediate results are required. - Hacl_Streaming_SHA2_finish_256(state, digest_1); + Hacl_Hash_SHA2_digest_256(state, digest_1); // 2/2 Include `World!` into the hash calculation and // obtain the final hash of "Hello, World!". - Hacl_Streaming_SHA2_update_256(state, (uint8_t*)chunk_2, chunk_2_size); - Hacl_Streaming_SHA2_finish_256(state, digest_2); + Hacl_Hash_SHA2_update_256(state, (uint8_t*)chunk_2, chunk_2_size); + Hacl_Hash_SHA2_digest_256(state, digest_2); // Cleanup - Hacl_Streaming_SHA2_free_256(state); + Hacl_Hash_SHA2_free_256(state); print_hex_ln(HACL_HASH_SHA2_256_DIGEST_LENGTH, digest_1); print_hex_ln(HACL_HASH_SHA2_256_DIGEST_LENGTH, digest_2); @@ -158,13 +157,13 @@ TEST_P(Sha2KAT, TryKAT) bytes digest(test.md.size(), 0); if (test.md.size() == 224 / 8) { - Hacl_Streaming_SHA2_hash_224(test.msg.data(), test.msg.size(), digest.data()); + Hacl_Hash_SHA2_hash_224(digest.data(), test.msg.data(), test.msg.size()); } else if (test.md.size() == 256 / 8) { - Hacl_Streaming_SHA2_hash_256(test.msg.data(), test.msg.size(), digest.data()); + Hacl_Hash_SHA2_hash_256(digest.data(), test.msg.data(), test.msg.size()); } else if (test.md.size() == 384 / 8) { - Hacl_Streaming_SHA2_hash_384(test.msg.data(), test.msg.size(), digest.data()); + Hacl_Hash_SHA2_hash_384(digest.data(), test.msg.data(), test.msg.size()); } else if (test.md.size() == 512 / 8) { - Hacl_Streaming_SHA2_hash_512(test.msg.data(), test.msg.size(), digest.data()); + Hacl_Hash_SHA2_hash_512(digest.data(), test.msg.data(), test.msg.size()); } EXPECT_EQ(test.md, digest) << bytes_to_hex(test.md) << endl @@ -176,60 +175,60 @@ TEST_P(Sha2KAT, TryKAT) if (test.md.size() == 224 / 8) { // Init - Hacl_Streaming_SHA2_state_sha2_224* state = - Hacl_Streaming_SHA2_create_in_224(); - Hacl_Streaming_SHA2_init_224(state); + Hacl_Hash_SHA2_state_t_224* state = + Hacl_Hash_SHA2_malloc_224(); + Hacl_Hash_SHA2_reset_224(state); // Update for (auto chunk : split_by_index_list(test.msg, lengths)) { - Hacl_Streaming_SHA2_update_224(state, chunk.data(), chunk.size()); + Hacl_Hash_SHA2_update_224(state, chunk.data(), chunk.size()); } // Finish - Hacl_Streaming_SHA2_finish_224(state, digest.data()); - Hacl_Streaming_SHA2_free_224(state); + Hacl_Hash_SHA2_digest_224(state, digest.data()); + Hacl_Hash_SHA2_free_224(state); } else if (test.md.size() == 256 / 8) { // Init - Hacl_Streaming_SHA2_state_sha2_224* state = - Hacl_Streaming_SHA2_create_in_256(); - Hacl_Streaming_SHA2_init_256(state); + Hacl_Hash_SHA2_state_t_224* state = + Hacl_Hash_SHA2_malloc_256(); + Hacl_Hash_SHA2_reset_256(state); // Update for (auto chunk : split_by_index_list(test.msg, lengths)) { - Hacl_Streaming_SHA2_update_256(state, chunk.data(), chunk.size()); + Hacl_Hash_SHA2_update_256(state, chunk.data(), chunk.size()); } // Finish - Hacl_Streaming_SHA2_finish_256(state, digest.data()); - Hacl_Streaming_SHA2_free_256(state); + Hacl_Hash_SHA2_digest_256(state, digest.data()); + Hacl_Hash_SHA2_free_256(state); } else if (test.md.size() == 384 / 8) { // Init - Hacl_Streaming_SHA2_state_sha2_384* state = - Hacl_Streaming_SHA2_create_in_384(); - Hacl_Streaming_SHA2_init_384(state); + Hacl_Hash_SHA2_state_t_384* state = + Hacl_Hash_SHA2_malloc_384(); + Hacl_Hash_SHA2_reset_384(state); // Update for (auto chunk : split_by_index_list(test.msg, lengths)) { - Hacl_Streaming_SHA2_update_384(state, chunk.data(), chunk.size()); + Hacl_Hash_SHA2_update_384(state, chunk.data(), chunk.size()); } // Finish - Hacl_Streaming_SHA2_finish_384(state, digest.data()); - Hacl_Streaming_SHA2_free_384(state); + Hacl_Hash_SHA2_digest_384(state, digest.data()); + Hacl_Hash_SHA2_free_384(state); } else if (test.md.size() == 512 / 8) { // Init - Hacl_Streaming_SHA2_state_sha2_512* state = - Hacl_Streaming_SHA2_create_in_512(); - Hacl_Streaming_SHA2_init_512(state); + Hacl_Hash_SHA2_state_t_512* state = + Hacl_Hash_SHA2_malloc_512(); + Hacl_Hash_SHA2_reset_512(state); // Update for (auto chunk : split_by_index_list(test.msg, lengths)) { - Hacl_Streaming_SHA2_update_512(state, chunk.data(), chunk.size()); + Hacl_Hash_SHA2_update_512(state, chunk.data(), chunk.size()); } // Finish - Hacl_Streaming_SHA2_finish_512(state, digest.data()); - Hacl_Streaming_SHA2_free_512(state); + Hacl_Hash_SHA2_digest_512(state, digest.data()); + Hacl_Hash_SHA2_free_512(state); } EXPECT_EQ(test.md, digest) << bytes_to_hex(test.md) << endl @@ -284,30 +283,30 @@ TEST_P(EverCryptSuiteTestCase, HashTest) { bytes got_digest(test.md.size(), 0); - EverCrypt_Hash_Incremental_hash_state* state; + EverCrypt_Hash_Incremental_state_t* state; if (test.md.size() == 224 / 8) { state = - EverCrypt_Hash_Incremental_create_in(Spec_Hash_Definitions_SHA2_224); + EverCrypt_Hash_Incremental_malloc(Spec_Hash_Definitions_SHA2_224); } else if (test.md.size() == 256 / 8) { state = - EverCrypt_Hash_Incremental_create_in(Spec_Hash_Definitions_SHA2_256); + EverCrypt_Hash_Incremental_malloc(Spec_Hash_Definitions_SHA2_256); } else if (test.md.size() == 384 / 8) { state = - EverCrypt_Hash_Incremental_create_in(Spec_Hash_Definitions_SHA2_384); + EverCrypt_Hash_Incremental_malloc(Spec_Hash_Definitions_SHA2_384); } else if (test.md.size() == 512 / 8) { state = - EverCrypt_Hash_Incremental_create_in(Spec_Hash_Definitions_SHA2_512); + EverCrypt_Hash_Incremental_malloc(Spec_Hash_Definitions_SHA2_512); } else { FAIL(); } - EverCrypt_Hash_Incremental_init(state); + EverCrypt_Hash_Incremental_reset(state); for (auto chunk : split_by_index_list(test.msg, lengths)) { EverCrypt_Hash_Incremental_update(state, chunk.data(), chunk.size()); } - EverCrypt_Hash_Incremental_finish(state, got_digest.data()); + EverCrypt_Hash_Incremental_digest(state, got_digest.data()); EverCrypt_Hash_Incremental_free(state); EXPECT_EQ(test.md, got_digest); diff --git a/tests/sha3.cc b/tests/sha3.cc index cc481970..7f9aeabe 100644 --- a/tests/sha3.cc +++ b/tests/sha3.cc @@ -65,7 +65,7 @@ TEST(ApiSuite, ApiTest) uint8_t digest[HACL_HASH_SHA3_256_DIGEST_LENGTH]; - Hacl_SHA3_sha3_256(message_size, (uint8_t*)message, digest); + Hacl_Hash_SHA3_sha3_256(digest, (uint8_t*)message, message_size); // END OneShot bytes expected_digest = from_hex( @@ -83,7 +83,7 @@ TEST(ApiSuite, ApiTest) // ANCHOR(streaming) // This example shows how to hash the byte sequence "Hello, World!" in two // chunks. As a bonus, it also shows how to obtain intermediate results by - // calling `finish` more than once. + // calling `digest` more than once. const char* chunk_1 = "Hello, "; const char* chunk_2 = "World!"; @@ -94,29 +94,28 @@ TEST(ApiSuite, ApiTest) uint8_t digest_2[HACL_HASH_SHA3_256_DIGEST_LENGTH]; // Init - Hacl_Streaming_Keccak_state* state = - Hacl_Streaming_Keccak_malloc(Spec_Hash_Definitions_SHA3_256); - Hacl_Streaming_Keccak_reset(state); + Hacl_Hash_SHA3_state_t* state = + Hacl_Hash_SHA3_malloc(Spec_Hash_Definitions_SHA3_256); // 1/2 Include `Hello, ` into the hash calculation and // obtain the intermediate hash of "Hello, ". uint32_t update_res = - Hacl_Streaming_Keccak_update(state, (uint8_t*)chunk_1, chunk_1_size); + Hacl_Hash_SHA3_update(state, (uint8_t*)chunk_1, chunk_1_size); ASSERT_EQ(0, update_res); // This is optional when no intermediate results are required. - auto finish_res = Hacl_Streaming_Keccak_finish(state, digest_1); + auto finish_res = Hacl_Hash_SHA3_digest(state, digest_1); ASSERT_EQ(Hacl_Streaming_Types_Success, finish_res); // 2/2 Include `World!` into the hash calculation and // obtain the final hash of "Hello, World!". uint32_t update_res_2 = - Hacl_Streaming_Keccak_update(state, (uint8_t*)chunk_2, chunk_2_size); + Hacl_Hash_SHA3_update(state, (uint8_t*)chunk_2, chunk_2_size); ASSERT_EQ(0, update_res_2); - auto finish_res_2 = Hacl_Streaming_Keccak_finish(state, digest_2); + auto finish_res_2 = Hacl_Hash_SHA3_digest(state, digest_2); ASSERT_EQ(Hacl_Streaming_Types_Success, finish_res_2); // Cleanup - Hacl_Streaming_Keccak_free(state); + Hacl_Hash_SHA3_free(state); print_hex_ln(HACL_HASH_SHA3_256_DIGEST_LENGTH, digest_1); print_hex_ln(HACL_HASH_SHA3_256_DIGEST_LENGTH, digest_2); @@ -150,7 +149,7 @@ TEST(ApiSuite, ApiTest) uint32_t digest_size = 42; uint8_t digest[42]; - Hacl_SHA3_shake128_hacl( + Hacl_Hash_SHA3_shake128_hacl( message_size, (uint8_t*)message, digest_size, digest); // ANCHOR_END(example shake128) @@ -173,17 +172,17 @@ TEST_P(Sha3KAT, TryKAT) { bytes digest(test_case.md.size(), 0); if (test_case.md.size() == 224 / 8) { - Hacl_SHA3_sha3_224( - test_case.msg.size(), test_case.msg.data(), digest.data()); + Hacl_Hash_SHA3_sha3_224( + digest.data(), test_case.msg.data(), test_case.msg.size()); } else if (test_case.md.size() == 256 / 8) { - Hacl_SHA3_sha3_256( - test_case.msg.size(), test_case.msg.data(), digest.data()); + Hacl_Hash_SHA3_sha3_256( + digest.data(), test_case.msg.data(), test_case.msg.size()); } else if (test_case.md.size() == 384 / 8) { - Hacl_SHA3_sha3_384( - test_case.msg.size(), test_case.msg.data(), digest.data()); + Hacl_Hash_SHA3_sha3_384( + digest.data(), test_case.msg.data(), test_case.msg.size()); } else if (test_case.md.size() == 512 / 8) { - Hacl_SHA3_sha3_512( - test_case.msg.size(), test_case.msg.data(), digest.data()); + Hacl_Hash_SHA3_sha3_512( + digest.data(), test_case.msg.data(), test_case.msg.size()); } EXPECT_EQ(test_case.md, digest) << bytes_to_hex(test_case.md) << std::endl @@ -202,20 +201,16 @@ TEST_P(ShakeKAT, TryKAT) if (test_case.md.size() == 128 / 8) { bytes digest(test_case.md.size(), 128 / 8); - Hacl_SHA3_shake128_hacl(test_case.msg.size(), - test_case.msg.data(), - digest.size(), - digest.data()); + Hacl_Hash_SHA3_shake128_hacl( + test_case.msg.size(), test_case.msg.data(), digest.size(), digest.data()); EXPECT_EQ(test_case.md, digest) << bytes_to_hex(test_case.md) << std::endl << bytes_to_hex(digest) << std::endl; } else if (test_case.md.size() == 256 / 8) { bytes digest(test_case.md.size(), 256 / 8); - Hacl_SHA3_shake256_hacl(test_case.msg.size(), - test_case.msg.data(), - digest.size(), - digest.data()); + Hacl_Hash_SHA3_shake256_hacl( + test_case.msg.size(), test_case.msg.data(), digest.size(), digest.data()); EXPECT_EQ(test_case.md, digest) << bytes_to_hex(test_case.md) << std::endl << bytes_to_hex(digest) << std::endl;