2017-01-01 12:58:02 +00:00
|
|
|
// Copyright 2017 Citra Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#include <algorithm>
|
2018-10-05 10:37:55 +00:00
|
|
|
#include <optional>
|
2017-01-01 12:58:02 +00:00
|
|
|
#include <sstream>
|
2023-03-23 13:30:52 +00:00
|
|
|
#include <boost/iostreams/device/file_descriptor.hpp>
|
|
|
|
#include <boost/iostreams/stream.hpp>
|
2017-01-01 12:58:02 +00:00
|
|
|
#include "common/common_paths.h"
|
|
|
|
#include "common/file_util.h"
|
|
|
|
#include "common/logging/log.h"
|
|
|
|
#include "common/string_util.h"
|
2018-10-13 22:06:39 +00:00
|
|
|
#include "core/hle/service/fs/archive.h"
|
2017-01-01 12:58:02 +00:00
|
|
|
#include "core/hw/aes/arithmetic128.h"
|
|
|
|
#include "core/hw/aes/key.h"
|
2020-02-26 15:43:53 +00:00
|
|
|
#include "core/hw/rsa/rsa.h"
|
2017-01-01 12:58:02 +00:00
|
|
|
|
2019-02-19 01:34:18 +00:00
|
|
|
namespace HW::AES {
|
2017-01-01 12:58:02 +00:00
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
2018-10-17 14:07:11 +00:00
|
|
|
// The generator constant was calculated using the 0x39 KeyX and KeyY retrieved from a 3DS and the
|
|
|
|
// normal key dumped from a Wii U solving the equation:
|
|
|
|
// NormalKey = (((KeyX ROL 2) XOR KeyY) + constant) ROL 87
|
|
|
|
// On a real 3DS the generation for the normal key is hardware based, and thus the constant can't
|
2023-11-13 21:35:30 +00:00
|
|
|
// get dumped. Generated normal keys are also not accessible on a 3DS. The used formula for
|
2018-10-17 14:07:11 +00:00
|
|
|
// calculating the constant is a software implementation of what the hardware generator does.
|
|
|
|
constexpr AESKey generator_constant = {{0x1F, 0xF9, 0xE9, 0xAA, 0xC5, 0xFE, 0x04, 0x08, 0x02, 0x45,
|
|
|
|
0x91, 0xDC, 0x5D, 0x52, 0x76, 0x8A}};
|
2017-01-01 12:58:02 +00:00
|
|
|
|
2018-10-17 11:21:02 +00:00
|
|
|
AESKey HexToKey(const std::string& hex) {
|
|
|
|
if (hex.size() < 32) {
|
|
|
|
throw std::invalid_argument("hex string is too short");
|
|
|
|
}
|
|
|
|
|
|
|
|
AESKey key;
|
|
|
|
for (std::size_t i = 0; i < key.size(); ++i) {
|
2023-11-13 21:35:30 +00:00
|
|
|
key[i] = static_cast<u8>(std::stoi(hex.substr(i * 2, 2), nullptr, 16));
|
2018-10-17 11:21:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return key;
|
|
|
|
}
|
|
|
|
|
2023-04-09 19:16:31 +00:00
|
|
|
std::vector<u8> HexToVector(const std::string& hex) {
|
|
|
|
std::vector<u8> vector(hex.size() / 2);
|
|
|
|
for (std::size_t i = 0; i < vector.size(); ++i) {
|
|
|
|
vector[i] = static_cast<u8>(std::stoi(hex.substr(i * 2, 2), nullptr, 16));
|
|
|
|
}
|
|
|
|
|
|
|
|
return vector;
|
|
|
|
}
|
|
|
|
|
2023-11-13 21:35:30 +00:00
|
|
|
std::optional<std::size_t> ParseCommonKeyName(const std::string& full_name) {
|
|
|
|
std::size_t index;
|
|
|
|
int end;
|
|
|
|
if (std::sscanf(full_name.c_str(), "common%zd%n", &index, &end) == 1 &&
|
|
|
|
end == static_cast<int>(full_name.size())) {
|
|
|
|
return index;
|
|
|
|
} else {
|
|
|
|
return std::nullopt;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
std::optional<std::pair<std::size_t, std::string>> ParseNfcSecretName(
|
|
|
|
const std::string& full_name) {
|
|
|
|
std::size_t index;
|
|
|
|
int end;
|
|
|
|
if (std::sscanf(full_name.c_str(), "nfcSecret%zd%n", &index, &end) == 1) {
|
|
|
|
return std::make_pair(index, full_name.substr(end));
|
|
|
|
} else {
|
|
|
|
return std::nullopt;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
std::optional<std::pair<std::size_t, char>> ParseKeySlotName(const std::string& full_name) {
|
|
|
|
std::size_t slot;
|
|
|
|
char type;
|
|
|
|
int end;
|
|
|
|
if (std::sscanf(full_name.c_str(), "slot0x%zXKey%c%n", &slot, &type, &end) == 2 &&
|
|
|
|
end == static_cast<int>(full_name.size())) {
|
|
|
|
return std::make_pair(slot, type);
|
|
|
|
} else {
|
|
|
|
return std::nullopt;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-01 12:58:02 +00:00
|
|
|
struct KeySlot {
|
2018-10-05 10:37:55 +00:00
|
|
|
std::optional<AESKey> x;
|
|
|
|
std::optional<AESKey> y;
|
|
|
|
std::optional<AESKey> normal;
|
2017-01-01 12:58:02 +00:00
|
|
|
|
2018-10-05 10:37:55 +00:00
|
|
|
void SetKeyX(std::optional<AESKey> key) {
|
2017-01-01 12:58:02 +00:00
|
|
|
x = key;
|
2018-09-04 16:27:48 +00:00
|
|
|
GenerateNormalKey();
|
2017-01-01 12:58:02 +00:00
|
|
|
}
|
|
|
|
|
2018-10-05 10:37:55 +00:00
|
|
|
void SetKeyY(std::optional<AESKey> key) {
|
2017-01-01 12:58:02 +00:00
|
|
|
y = key;
|
2018-09-04 16:27:48 +00:00
|
|
|
GenerateNormalKey();
|
2017-01-01 12:58:02 +00:00
|
|
|
}
|
|
|
|
|
2018-10-05 10:37:55 +00:00
|
|
|
void SetNormalKey(std::optional<AESKey> key) {
|
2017-01-01 12:58:02 +00:00
|
|
|
normal = key;
|
|
|
|
}
|
|
|
|
|
|
|
|
void GenerateNormalKey() {
|
2018-10-17 14:07:11 +00:00
|
|
|
if (x && y) {
|
|
|
|
normal = Lrot128(Add128(Xor128(Lrot128(*x, 2), *y), generator_constant), 87);
|
2018-09-04 16:27:48 +00:00
|
|
|
} else {
|
2023-11-13 21:35:30 +00:00
|
|
|
normal.reset();
|
2018-09-04 16:27:48 +00:00
|
|
|
}
|
2017-01-01 12:58:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void Clear() {
|
|
|
|
x.reset();
|
|
|
|
y.reset();
|
|
|
|
normal.reset();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
std::array<KeySlot, KeySlotID::MaxKeySlotID> key_slots;
|
2023-02-09 19:58:08 +00:00
|
|
|
std::array<std::optional<AESKey>, MaxCommonKeySlot> common_key_y_slots;
|
2023-04-09 19:16:31 +00:00
|
|
|
std::array<std::optional<AESKey>, NumDlpNfcKeyYs> dlp_nfc_key_y_slots;
|
|
|
|
std::array<NfcSecret, NumNfcSecrets> nfc_secrets;
|
|
|
|
AESIV nfc_iv;
|
2017-01-01 12:58:02 +00:00
|
|
|
|
2023-11-13 21:35:30 +00:00
|
|
|
struct KeyDesc {
|
|
|
|
char key_type;
|
|
|
|
std::size_t slot_id;
|
|
|
|
// This key is identical to the key with the same key_type and slot_id -1
|
|
|
|
bool same_as_before;
|
2018-10-17 11:21:02 +00:00
|
|
|
};
|
2017-01-01 12:58:02 +00:00
|
|
|
|
2018-10-17 08:13:55 +00:00
|
|
|
void LoadBootromKeys() {
|
|
|
|
constexpr std::array<KeyDesc, 80> keys = {
|
|
|
|
{{'X', 0x2C, false}, {'X', 0x2D, true}, {'X', 0x2E, true}, {'X', 0x2F, true},
|
|
|
|
{'X', 0x30, false}, {'X', 0x31, true}, {'X', 0x32, true}, {'X', 0x33, true},
|
|
|
|
{'X', 0x34, false}, {'X', 0x35, true}, {'X', 0x36, true}, {'X', 0x37, true},
|
|
|
|
{'X', 0x38, false}, {'X', 0x39, true}, {'X', 0x3A, true}, {'X', 0x3B, true},
|
|
|
|
{'X', 0x3C, false}, {'X', 0x3D, false}, {'X', 0x3E, false}, {'X', 0x3F, false},
|
|
|
|
{'Y', 0x4, false}, {'Y', 0x5, false}, {'Y', 0x6, false}, {'Y', 0x7, false},
|
|
|
|
{'Y', 0x8, false}, {'Y', 0x9, false}, {'Y', 0xA, false}, {'Y', 0xB, false},
|
|
|
|
{'N', 0xC, false}, {'N', 0xD, true}, {'N', 0xE, true}, {'N', 0xF, true},
|
|
|
|
{'N', 0x10, false}, {'N', 0x11, true}, {'N', 0x12, true}, {'N', 0x13, true},
|
|
|
|
{'N', 0x14, false}, {'N', 0x15, false}, {'N', 0x16, false}, {'N', 0x17, false},
|
|
|
|
{'N', 0x18, false}, {'N', 0x19, true}, {'N', 0x1A, true}, {'N', 0x1B, true},
|
|
|
|
{'N', 0x1C, false}, {'N', 0x1D, true}, {'N', 0x1E, true}, {'N', 0x1F, true},
|
|
|
|
{'N', 0x20, false}, {'N', 0x21, true}, {'N', 0x22, true}, {'N', 0x23, true},
|
|
|
|
{'N', 0x24, false}, {'N', 0x25, true}, {'N', 0x26, true}, {'N', 0x27, true},
|
|
|
|
{'N', 0x28, true}, {'N', 0x29, false}, {'N', 0x2A, false}, {'N', 0x2B, false},
|
|
|
|
{'N', 0x2C, false}, {'N', 0x2D, true}, {'N', 0x2E, true}, {'N', 0x2F, true},
|
|
|
|
{'N', 0x30, false}, {'N', 0x31, true}, {'N', 0x32, true}, {'N', 0x33, true},
|
|
|
|
{'N', 0x34, false}, {'N', 0x35, true}, {'N', 0x36, true}, {'N', 0x37, true},
|
|
|
|
{'N', 0x38, false}, {'N', 0x39, true}, {'N', 0x3A, true}, {'N', 0x3B, true},
|
|
|
|
{'N', 0x3C, true}, {'N', 0x3D, false}, {'N', 0x3E, false}, {'N', 0x3F, false}}};
|
|
|
|
|
|
|
|
// Bootrom sets all these keys when executed, but later some of the normal keys get overwritten
|
|
|
|
// by other applications e.g. process9. These normal keys thus aren't used by any application
|
|
|
|
// and have no value for emulation
|
|
|
|
|
|
|
|
const std::string filepath = FileUtil::GetUserPath(FileUtil::UserPath::SysDataDir) + BOOTROM9;
|
|
|
|
auto file = FileUtil::IOFile(filepath, "rb");
|
|
|
|
if (!file) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
const std::size_t length = file.GetSize();
|
|
|
|
if (length != 65536) {
|
|
|
|
LOG_ERROR(HW_AES, "Bootrom9 size is wrong: {}", length);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
constexpr std::size_t KEY_SECTION_START = 55760;
|
|
|
|
file.Seek(KEY_SECTION_START, SEEK_SET); // Jump to the key section
|
|
|
|
|
|
|
|
AESKey new_key;
|
|
|
|
for (const auto& key : keys) {
|
|
|
|
if (!key.same_as_before) {
|
|
|
|
file.ReadArray(new_key.data(), new_key.size());
|
|
|
|
if (!file) {
|
|
|
|
LOG_ERROR(HW_AES, "Reading from Bootrom9 failed");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-11-13 21:35:30 +00:00
|
|
|
LOG_DEBUG(HW_AES, "Loaded Slot{:#02x} Key{} from Bootrom9.", key.slot_id, key.key_type);
|
2018-10-17 08:13:55 +00:00
|
|
|
|
|
|
|
switch (key.key_type) {
|
|
|
|
case 'X':
|
|
|
|
key_slots.at(key.slot_id).SetKeyX(new_key);
|
|
|
|
break;
|
|
|
|
case 'Y':
|
|
|
|
key_slots.at(key.slot_id).SetKeyY(new_key);
|
|
|
|
break;
|
|
|
|
case 'N':
|
|
|
|
key_slots.at(key.slot_id).SetNormalKey(new_key);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
LOG_ERROR(HW_AES, "Invalid key type {}", key.key_type);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-01 12:58:02 +00:00
|
|
|
void LoadPresetKeys() {
|
2018-07-21 19:52:42 +00:00
|
|
|
const std::string filepath = FileUtil::GetUserPath(FileUtil::UserPath::SysDataDir) + AES_KEYS;
|
2017-01-01 12:58:02 +00:00
|
|
|
FileUtil::CreateFullPath(filepath); // Create path if not already created
|
2023-03-23 13:30:52 +00:00
|
|
|
|
|
|
|
boost::iostreams::stream<boost::iostreams::file_descriptor_source> file;
|
|
|
|
FileUtil::OpenFStream<std::ios_base::in>(file, filepath);
|
|
|
|
if (!file.is_open()) {
|
2017-01-01 12:58:02 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
while (!file.eof()) {
|
|
|
|
std::string line;
|
|
|
|
std::getline(file, line);
|
2023-04-09 19:16:31 +00:00
|
|
|
|
|
|
|
// Ignore empty or commented lines.
|
|
|
|
if (line.empty() || line.starts_with("#")) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2023-04-27 04:38:28 +00:00
|
|
|
const auto parts = Common::SplitString(line, '=');
|
2017-01-01 12:58:02 +00:00
|
|
|
if (parts.size() != 2) {
|
2018-06-29 11:18:07 +00:00
|
|
|
LOG_ERROR(HW_AES, "Failed to parse {}", line);
|
2017-01-01 12:58:02 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
const std::string& name = parts[0];
|
2023-04-09 19:16:31 +00:00
|
|
|
|
2023-11-13 21:35:30 +00:00
|
|
|
const auto nfc_secret = ParseNfcSecretName(name);
|
|
|
|
if (nfc_secret) {
|
2023-04-09 19:16:31 +00:00
|
|
|
auto value = HexToVector(parts[1]);
|
2023-11-13 21:35:30 +00:00
|
|
|
if (nfc_secret->first >= nfc_secrets.size()) {
|
|
|
|
LOG_ERROR(HW_AES, "Invalid NFC secret index {}", nfc_secret->first);
|
|
|
|
} else if (nfc_secret->second == "Phrase") {
|
|
|
|
nfc_secrets[nfc_secret->first].phrase = value;
|
|
|
|
} else if (nfc_secret->second == "Seed") {
|
|
|
|
nfc_secrets[nfc_secret->first].seed = value;
|
|
|
|
} else if (nfc_secret->second == "HmacKey") {
|
|
|
|
nfc_secrets[nfc_secret->first].hmac_key = value;
|
2023-04-09 19:16:31 +00:00
|
|
|
} else {
|
2023-11-13 21:35:30 +00:00
|
|
|
LOG_ERROR(HW_AES, "Invalid NFC secret '{}'", name);
|
2023-04-09 19:16:31 +00:00
|
|
|
}
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2017-01-01 12:58:02 +00:00
|
|
|
AESKey key;
|
|
|
|
try {
|
|
|
|
key = HexToKey(parts[1]);
|
|
|
|
} catch (const std::logic_error& e) {
|
2018-06-29 11:18:07 +00:00
|
|
|
LOG_ERROR(HW_AES, "Invalid key {}: {}", parts[1], e.what());
|
2017-01-01 12:58:02 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2023-11-13 21:35:30 +00:00
|
|
|
const auto common_key = ParseCommonKeyName(name);
|
|
|
|
if (common_key) {
|
|
|
|
if (common_key >= common_key_y_slots.size()) {
|
|
|
|
LOG_ERROR(HW_AES, "Invalid common key index {}", common_key.value());
|
2018-09-04 16:27:48 +00:00
|
|
|
} else {
|
2023-11-13 21:35:30 +00:00
|
|
|
common_key_y_slots[common_key.value()] = key;
|
2018-09-04 16:27:48 +00:00
|
|
|
}
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2023-04-09 19:16:31 +00:00
|
|
|
if (name == "dlpKeyY") {
|
|
|
|
dlp_nfc_key_y_slots[DlpNfcKeyY::Dlp] = key;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (name == "nfcKeyY") {
|
|
|
|
dlp_nfc_key_y_slots[DlpNfcKeyY::Nfc] = key;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (name == "nfcIv") {
|
|
|
|
nfc_iv = key;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2023-11-13 21:35:30 +00:00
|
|
|
const auto key_slot = ParseKeySlotName(name);
|
|
|
|
if (!key_slot) {
|
|
|
|
LOG_ERROR(HW_AES, "Invalid key name '{}'", name);
|
2017-01-01 12:58:02 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2023-11-13 21:35:30 +00:00
|
|
|
if (key_slot->first >= MaxKeySlotID) {
|
|
|
|
LOG_ERROR(HW_AES, "Out of range key slot ID {:#X}", key_slot->first);
|
2017-01-01 12:58:02 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2023-11-13 21:35:30 +00:00
|
|
|
switch (key_slot->second) {
|
2017-01-01 12:58:02 +00:00
|
|
|
case 'X':
|
2023-11-13 21:35:30 +00:00
|
|
|
key_slots.at(key_slot->first).SetKeyX(key);
|
2017-01-01 12:58:02 +00:00
|
|
|
break;
|
|
|
|
case 'Y':
|
2023-11-13 21:35:30 +00:00
|
|
|
key_slots.at(key_slot->first).SetKeyY(key);
|
2017-01-01 12:58:02 +00:00
|
|
|
break;
|
|
|
|
case 'N':
|
2023-11-13 21:35:30 +00:00
|
|
|
key_slots.at(key_slot->first).SetNormalKey(key);
|
2017-01-01 12:58:02 +00:00
|
|
|
break;
|
|
|
|
default:
|
2023-11-13 21:35:30 +00:00
|
|
|
LOG_ERROR(HW_AES, "Invalid key type '{}'", key_slot->second);
|
2017-01-01 12:58:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
2023-02-09 19:58:08 +00:00
|
|
|
void InitKeys(bool force) {
|
2018-07-28 15:30:54 +00:00
|
|
|
static bool initialized = false;
|
2023-11-13 21:35:30 +00:00
|
|
|
if (initialized && !force) {
|
2018-07-28 15:30:54 +00:00
|
|
|
return;
|
2023-11-13 21:35:30 +00:00
|
|
|
}
|
2020-02-26 15:43:53 +00:00
|
|
|
initialized = true;
|
|
|
|
HW::RSA::InitSlots();
|
2018-10-17 08:13:55 +00:00
|
|
|
LoadBootromKeys();
|
2017-01-01 12:58:02 +00:00
|
|
|
LoadPresetKeys();
|
|
|
|
}
|
|
|
|
|
2018-09-06 20:03:28 +00:00
|
|
|
void SetKeyX(std::size_t slot_id, const AESKey& key) {
|
2017-01-01 12:58:02 +00:00
|
|
|
key_slots.at(slot_id).SetKeyX(key);
|
|
|
|
}
|
|
|
|
|
2018-09-06 20:03:28 +00:00
|
|
|
void SetKeyY(std::size_t slot_id, const AESKey& key) {
|
2017-01-01 12:58:02 +00:00
|
|
|
key_slots.at(slot_id).SetKeyY(key);
|
|
|
|
}
|
|
|
|
|
2018-09-06 20:03:28 +00:00
|
|
|
void SetNormalKey(std::size_t slot_id, const AESKey& key) {
|
2017-01-01 12:58:02 +00:00
|
|
|
key_slots.at(slot_id).SetNormalKey(key);
|
|
|
|
}
|
|
|
|
|
2023-06-03 02:16:48 +00:00
|
|
|
bool IsKeyXAvailable(std::size_t slot_id) {
|
|
|
|
return key_slots.at(slot_id).x.has_value();
|
|
|
|
}
|
|
|
|
|
2018-09-06 20:03:28 +00:00
|
|
|
bool IsNormalKeyAvailable(std::size_t slot_id) {
|
2018-10-05 10:37:55 +00:00
|
|
|
return key_slots.at(slot_id).normal.has_value();
|
2017-01-01 12:58:02 +00:00
|
|
|
}
|
|
|
|
|
2018-09-06 20:03:28 +00:00
|
|
|
AESKey GetNormalKey(std::size_t slot_id) {
|
2017-01-01 12:58:02 +00:00
|
|
|
return key_slots.at(slot_id).normal.value_or(AESKey{});
|
|
|
|
}
|
|
|
|
|
2018-09-04 16:27:48 +00:00
|
|
|
void SelectCommonKeyIndex(u8 index) {
|
|
|
|
key_slots[KeySlotID::TicketCommonKey].SetKeyY(common_key_y_slots.at(index));
|
|
|
|
}
|
|
|
|
|
2023-04-09 19:16:31 +00:00
|
|
|
void SelectDlpNfcKeyYIndex(u8 index) {
|
|
|
|
key_slots[KeySlotID::DLPNFCDataKey].SetKeyY(dlp_nfc_key_y_slots.at(index));
|
|
|
|
}
|
|
|
|
|
2023-07-06 18:45:46 +00:00
|
|
|
bool NfcSecretsAvailable() {
|
|
|
|
auto missing_secret =
|
|
|
|
std::find_if(nfc_secrets.begin(), nfc_secrets.end(), [](auto& nfc_secret) {
|
|
|
|
return nfc_secret.phrase.empty() || nfc_secret.seed.empty() ||
|
|
|
|
nfc_secret.hmac_key.empty();
|
|
|
|
});
|
|
|
|
SelectDlpNfcKeyYIndex(DlpNfcKeyY::Nfc);
|
|
|
|
return IsNormalKeyAvailable(KeySlotID::DLPNFCDataKey) && missing_secret == nfc_secrets.end();
|
|
|
|
}
|
|
|
|
|
|
|
|
const NfcSecret& GetNfcSecret(NfcSecretId secret_id) {
|
|
|
|
return nfc_secrets[secret_id];
|
2023-04-09 19:16:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const AESIV& GetNfcIv() {
|
|
|
|
return nfc_iv;
|
|
|
|
}
|
|
|
|
|
2019-02-19 01:34:18 +00:00
|
|
|
} // namespace HW::AES
|