M5Unit-NFC 0.0.3 git rev:59f5362
Loading...
Searching...
No Matches
aes.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#include <cstdint>
14
15namespace m5 {
16namespace nfc {
17namespace crypto {
18
26bool aes_ecb_encrypt(uint8_t out[16], const uint8_t key[16], const uint8_t in[16]);
27
38bool aes_cbc_crypt(uint8_t* out, const uint8_t key[16], const uint8_t iv_in[16], const uint8_t* in, size_t len,
39 bool encrypt);
40
48bool cmac_subkeys(uint8_t k1[16], uint8_t k2[16], const uint8_t key[16]);
49
58bool cmac_aes_128(uint8_t out[16], const uint8_t key[16], const uint8_t* msg, size_t msg_len);
59
60} // namespace crypto
61} // namespace nfc
62} // namespace m5
bool cmac_subkeys(uint8_t k1[16], uint8_t k2[16], const uint8_t key[16])
Generate AES-CMAC subkeys K1 and K2.
Definition aes.cpp:92
Top level namespace of M5stack.
NFC related definitions.