blob: 0b759000a76539005818c1b2879b6dc74e48f203 [file] [log] [blame]
gabor-mezei-armdb9a38c2021-09-27 11:28:54 +02001/**
2 * Constant-time functions
3 *
4 * Copyright The Mbed TLS Contributors
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 */
19
20#include "common.h"
21
22#include <stddef.h>
23
24int mbedtls_ssl_safer_memcmp( const void *a, const void *b, size_t n );
25
26int mbedtls_constant_time_memcmp( const void *v1, const void *v2, size_t len );
27
28unsigned char mbedtls_nist_kw_safer_memcmp( const void *a, const void *b, size_t n );
29
30int mbedtls_safer_memcmp( const void *a, const void *b, size_t n );
gabor-mezei-arm340948e2021-09-27 11:40:03 +020031
32
33unsigned mbedtls_cf_uint_mask( unsigned value );
gabor-mezei-arm3733bf82021-09-27 11:49:42 +020034
35size_t mbedtls_cf_size_mask( size_t bit );
gabor-mezei-armc76227d2021-09-27 11:53:54 +020036
37size_t mbedtls_cf_size_mask_lt( size_t x, size_t y );