M5Unit-NFC 0.0.3 git rev:59f5362
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
14namespace m5 {
15namespace nfc {
16namespace crypto {
17
18inline void secure_zero(void* p, const size_t n)
19{
20 if (!p || n == 0) {
21 return;
22 }
23 volatile unsigned char* v = reinterpret_cast<volatile unsigned char*>(p);
24 for (size_t i = 0; i < n; ++i) {
25 v[i] = 0;
26 }
27}
28
29} // namespace crypto
30} // namespace nfc
31} // namespace m5
Top level namespace of M5stack.
NFC related definitions.
NFC-V definitions.