M5Unit-NFC
0.1.0 git rev:93745b5
Loading...
Searching...
No Matches
secure_zero.hpp
Go to the documentation of this file.
1
/*
2
* SPDX-FileCopyrightText: 2025 M5Stack Technology CO LTD
3
*
4
* SPDX-License-Identifier: MIT
5
*/
10
#pragma once
11
12
#include <cstddef>
13
14
namespace
m5
{
15
namespace
nfc
{
16
namespace
crypto {
17
23
inline
void
secure_zero
(
void
* p,
const
size_t
n)
24
{
25
if
(!p || n == 0) {
26
return
;
27
}
28
volatile
unsigned
char
*
v
=
reinterpret_cast<
volatile
unsigned
char
*
>
(p);
29
for
(
size_t
i = 0; i < n; ++i) {
30
v
[i] = 0;
31
}
32
}
33
34
}
// namespace crypto
35
}
// namespace nfc
36
}
// namespace m5
m5
Top level namespace of M5Stack.
nfc
NFC related definitions.
v
NFC-V definitions.
m5::nfc::crypto::secure_zero
void secure_zero(void *p, const size_t n)
Securely wipe a memory region (volatile-safe; not optimized away)
Definition
secure_zero.hpp:23
src
nfc
crypto
secure_zero.hpp
Generated by
1.11.0