blob: 9008f5d43008464cef6651745dacc2bdc026c4fb [file] [log] [blame]
Gabor Mezei28d61152021-11-15 16:13:01 +01001/**
2 * \file constant_time_invasive.h
3 *
4 * \brief Constant-time module: interfaces for invasive testing only.
5 *
6 * The interfaces in this file are intended for testing purposes only.
7 * They SHOULD NOT be made available in library integrations except when
8 * building the library for testing.
9 */
10/*
11 * Copyright The Mbed TLS Contributors
12 * SPDX-License-Identifier: Apache-2.0
13 *
14 * Licensed under the Apache License, Version 2.0 (the "License"); you may
15 * not use this file except in compliance with the License.
16 * You may obtain a copy of the License at
17 *
18 * http://www.apache.org/licenses/LICENSE-2.0
19 *
20 * Unless required by applicable law or agreed to in writing, software
21 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
22 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23 * See the License for the specific language governing permissions and
24 * limitations under the License.
25 */
26
27#ifndef MBEDTLS_CONSTANT_TIME_INVASIVE_H
28#define MBEDTLS_CONSTANT_TIME_INVASIVE_H
29
30#include "common.h"
31
32#if defined(MBEDTLS_TEST_HOOKS)
33
34/* Return 0xff if low <= c <= high, 0 otherwise.
35 *
36 * Constant flow with respect to c.
37 */
38unsigned char mbedtls_ct_uchar_mask_of_range( unsigned char low,
39 unsigned char high,
40 unsigned char c );
41
42#endif /* MBEDTLS_TEST_HOOKS */
43
44#endif /* MBEDTLS_CONSTANT_TIME_INVASIVE_H */