Christoph M. Wintersteiger | 6e0cac1 | 2019-02-22 17:02:12 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Interface to code from Project Everest |
| 3 | * |
| 4 | * Copyright 2016-2018 INRIA and Microsoft Corporation |
| 5 | * SPDX-License-Identifier: Apache-2.0 |
| 6 | * |
| 7 | * Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 8 | * not use this file except in compliance with the License. |
| 9 | * You may obtain a copy of the License at |
| 10 | * |
| 11 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | * |
| 13 | * Unless required by applicable law or agreed to in writing, software |
| 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | * See the License for the specific language governing permissions and |
| 17 | * limitations under the License. |
| 18 | * |
Gilles Peskine | e820c0a | 2023-08-03 17:45:20 +0200 | [diff] [blame] | 19 | * This file is part of Mbed TLS (https://tls.mbed.org) |
Christoph M. Wintersteiger | 6e0cac1 | 2019-02-22 17:02:12 +0000 | [diff] [blame] | 20 | */ |
okhowang(王沛文) | df865c3 | 2020-09-03 16:21:30 +0800 | [diff] [blame] | 21 | #ifndef _BSD_SOURCE |
Dave Rodgman | c9c6e8d | 2022-05-12 09:22:50 +0100 | [diff] [blame] | 22 | /* Required to get htole64() from gcc/glibc's endian.h (older systems) |
| 23 | * when we compile with -std=c99 */ |
| 24 | #define _BSD_SOURCE |
okhowang(王沛文) | df865c3 | 2020-09-03 16:21:30 +0800 | [diff] [blame] | 25 | #endif |
| 26 | #ifndef _DEFAULT_SOURCE |
Dave Rodgman | c9c6e8d | 2022-05-12 09:22:50 +0100 | [diff] [blame] | 27 | /* (modern version of _BSD_SOURCE) */ |
okhowang(王沛文) | df865c3 | 2020-09-03 16:21:30 +0800 | [diff] [blame] | 28 | #define _DEFAULT_SOURCE |
| 29 | #endif |
Christoph M. Wintersteiger | 6e0cac1 | 2019-02-22 17:02:12 +0000 | [diff] [blame] | 30 | |
Gilles Peskine | db09ef6 | 2020-06-03 01:43:33 +0200 | [diff] [blame] | 31 | #include "common.h" |
Christoph M. Wintersteiger | 6e0cac1 | 2019-02-22 17:02:12 +0000 | [diff] [blame] | 32 | |
| 33 | #if defined(MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED) |
| 34 | |
| 35 | #if defined(__SIZEOF_INT128__) && (__SIZEOF_INT128__ == 16) |
| 36 | #define MBEDTLS_HAVE_INT128 |
| 37 | #endif |
| 38 | |
| 39 | #if defined(MBEDTLS_HAVE_INT128) |
| 40 | #include "Hacl_Curve25519.c" |
| 41 | #else |
| 42 | #define KRML_VERIFIED_UINT128 |
| 43 | #include "kremlib/FStar_UInt128_extracted.c" |
| 44 | #include "legacy/Hacl_Curve25519.c" |
| 45 | #endif |
| 46 | |
| 47 | #include "kremlib/FStar_UInt64_FStar_UInt32_FStar_UInt16_FStar_UInt8.c" |
| 48 | |
Christoph M. Wintersteiger | 26b98e1 | 2019-02-26 12:26:04 +0000 | [diff] [blame] | 49 | #endif /* defined(MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED) */ |
| 50 | |