Andres Amaya Garcia | 614d9c0 | 2017-10-24 21:27:43 +0100 | [diff] [blame] | 1 | /** |
| 2 | * \file utils.h |
| 3 | * |
Andres Amaya Garcia | 757cd72 | 2018-03-08 21:25:25 +0000 | [diff] [blame^] | 4 | * \brief Mbed TLS utility functions |
Andres Amaya Garcia | 614d9c0 | 2017-10-24 21:27:43 +0100 | [diff] [blame] | 5 | * |
Andres Amaya Garcia | 757cd72 | 2018-03-08 21:25:25 +0000 | [diff] [blame^] | 6 | * Copyright (C) 2018, Arm Limited, All Rights Reserved |
Andres Amaya Garcia | 614d9c0 | 2017-10-24 21:27:43 +0100 | [diff] [blame] | 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 | * |
Andres Amaya Garcia | 757cd72 | 2018-03-08 21:25:25 +0000 | [diff] [blame^] | 21 | * This file is part of Mbed TLS (https://tls.mbed.org) |
Andres Amaya Garcia | 614d9c0 | 2017-10-24 21:27:43 +0100 | [diff] [blame] | 22 | */ |
| 23 | #ifndef MBEDTLS_UTILS_H |
| 24 | #define MBEDTLS_UTILS_H |
| 25 | |
| 26 | #include <stddef.h> |
| 27 | |
| 28 | /** |
| 29 | * \brief Securely zeroize a buffer |
| 30 | * |
| 31 | * \param buf Buffer to be zeroized |
| 32 | * \param len Length of the buffer in bytes |
| 33 | * |
| 34 | * \note This implementation should never be optimized out by the |
| 35 | * compiler |
Andres Amaya Garcia | 1e8ea5f | 2018-03-08 20:46:39 +0000 | [diff] [blame] | 36 | * |
| 37 | * \note It is extremely difficult to guarantee that calls to |
| 38 | * mbedtls_zeroize() are not removed by aggressive compiler |
| 39 | * optimizations in a portable way. For this reason, Mbed TLS |
| 40 | * provides the configuration option MBEDTLS_UTILS_ZEROIZE_ALT, |
| 41 | * which allows users to configure mbedtls_zeroize() to use a |
| 42 | * suitable implementation for their platform and needs |
Andres Amaya Garcia | 614d9c0 | 2017-10-24 21:27:43 +0100 | [diff] [blame] | 43 | */ |
| 44 | void mbedtls_zeroize( void *buf, size_t len ); |
| 45 | |
| 46 | #endif /* MBEDTLS_UTILS_H */ |