blob: fcdd1f099d57c0610884f8f97c3dce4aa91595ae [file] [log] [blame]
Tom Cosgroveb2fafa52023-09-01 14:40:21 +01001/* mbedtls_config.h modifier that defines mbedtls_platform_zeroize() to be
Tom Cosgrove7eced7d2023-09-01 13:55:39 +01002 * memset(), so that the compile can check arguments for us.
3 * Used for testing.
4 */
5/*
6 * Copyright The Mbed TLS Contributors
7 * SPDX-License-Identifier: Apache-2.0
8 *
9 * Licensed under the Apache License, Version 2.0 (the "License"); you may
10 * not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
12 *
13 * http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 */
21
Tom Cosgrove7eced7d2023-09-01 13:55:39 +010022#include <string.h>
23
24/* Define _ALT so we don't get the built-in implementation. The test code will
25 * also need to define MBEDTLS_TEST_DEFINES_ZEROIZE so we don't get the
26 * declaration. */
27#define MBEDTLS_PLATFORM_ZEROIZE_ALT
28
29#define mbedtls_platform_zeroize(buf, len) memset(buf, 0, len)