xref: /optee_os/core/lib/libtomcrypt/src/misc/zeromem.c (revision 8411e6ad673d20c4742ed30c785e3f5cdea54dfa)
1*8411e6adSJerome Forissier /* LibTomCrypt, modular cryptographic library -- Tom St Denis */
2*8411e6adSJerome Forissier /* SPDX-License-Identifier: Unlicense */
35a913ee7SJerome Forissier #include "tomcrypt_private.h"
403121b2cSSumit Garg #include <string_ext.h>
5b0104773SPascal Brand 
6b0104773SPascal Brand /**
7b0104773SPascal Brand    @file zeromem.c
8b0104773SPascal Brand    Zero a block of memory, Tom St Denis
9b0104773SPascal Brand */
10b0104773SPascal Brand 
11b0104773SPascal Brand /**
12b0104773SPascal Brand    Zero a block of memory
13b0104773SPascal Brand    @param out    The destination of the area to zero
14b0104773SPascal Brand    @param outlen The length of the area to zero (octets)
15b0104773SPascal Brand */
zeromem(volatile void * out,size_t outlen)16a50cb361SMatt Ma void zeromem(volatile void *out, size_t outlen)
17b0104773SPascal Brand {
18b0104773SPascal Brand    LTC_ARGCHKVD(out != NULL);
1903121b2cSSumit Garg    memzero_explicit((void *)out, outlen);
20b0104773SPascal Brand }
21