yuzu/src/core/hle/service/spl/spl.cpp

187 lines
6.8 KiB
C++
Raw Normal View History

2020-12-28 19:15:37 +04:00
// Copyright 2018 yuzu emulator team
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "core/hle/service/spl/spl.h"
namespace Service::SPL {
SPL::SPL(Core::System& system_, std::shared_ptr<Module> module_)
: Interface(system_, std::move(module_), "spl:") {
2021-03-18 08:46:23 +04:00
// clang-format off
static const FunctionInfo functions[] = {
2021-06-23 16:35:57 +04:00
{0, &SPL::GetConfig, "GetConfig"},
{1, &SPL::ModularExponentiate, "ModularExponentiate"},
{5, &SPL::SetConfig, "SetConfig"},
{7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"},
{11, &SPL::IsDevelopment, "IsDevelopment"},
{24, &SPL::SetBootReason, "SetBootReason"},
{25, &SPL::GetBootReason, "GetBootReason"},
2021-03-18 08:46:23 +04:00
};
// clang-format on
RegisterHandlers(functions);
}
SPL_MIG::SPL_MIG(Core::System& system_, std::shared_ptr<Module> module_)
: Interface(system_, std::move(module_), "spl:mig") {
// clang-format off
2020-12-28 19:15:37 +04:00
static const FunctionInfo functions[] = {
2021-06-23 16:35:57 +04:00
{0, &SPL::GetConfig, "GetConfig"},
{1, &SPL::ModularExponentiate, "ModularExponentiate"},
2020-12-28 19:15:37 +04:00
{2, nullptr, "GenerateAesKek"},
{3, nullptr, "LoadAesKey"},
{4, nullptr, "GenerateAesKey"},
2021-06-23 16:35:57 +04:00
{5, &SPL::SetConfig, "SetConfig"},
{7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"},
{11, &SPL::IsDevelopment, "IsDevelopment"},
2021-03-18 08:46:23 +04:00
{14, nullptr, "DecryptAesKey"},
{15, nullptr, "CryptAesCtr"},
{16, nullptr, "ComputeCmac"},
{21, nullptr, "AllocateAesKeyslot"},
{22, nullptr, "DeallocateAesKeySlot"},
{23, nullptr, "GetAesKeyslotAvailableEvent"},
2021-06-23 16:35:57 +04:00
{24, &SPL::SetBootReason, "SetBootReason"},
{25, &SPL::GetBootReason, "GetBootReason"},
2021-03-18 08:46:23 +04:00
};
// clang-format on
RegisterHandlers(functions);
}
SPL_FS::SPL_FS(Core::System& system_, std::shared_ptr<Module> module_)
: Interface(system_, std::move(module_), "spl:fs") {
// clang-format off
static const FunctionInfo functions[] = {
2021-06-23 16:35:57 +04:00
{0, &SPL::GetConfig, "GetConfig"},
{1, &SPL::ModularExponentiate, "ModularExponentiate"},
2021-03-18 08:46:23 +04:00
{2, nullptr, "GenerateAesKek"},
{3, nullptr, "LoadAesKey"},
{4, nullptr, "GenerateAesKey"},
2021-06-23 16:35:57 +04:00
{5, &SPL::SetConfig, "SetConfig"},
{7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"},
2021-04-10 10:39:53 +04:00
{9, nullptr, "ImportLotusKey"},
{10, nullptr, "DecryptLotusMessage"},
2021-06-23 16:35:57 +04:00
{11, &SPL::IsDevelopment, "IsDevelopment"},
2020-12-28 19:15:37 +04:00
{12, nullptr, "GenerateSpecificAesKey"},
{14, nullptr, "DecryptAesKey"},
{15, nullptr, "CryptAesCtr"},
{16, nullptr, "ComputeCmac"},
{19, nullptr, "LoadTitleKey"},
2021-03-18 08:46:23 +04:00
{21, nullptr, "AllocateAesKeyslot"},
{22, nullptr, "DeallocateAesKeySlot"},
{23, nullptr, "GetAesKeyslotAvailableEvent"},
2021-06-23 16:35:57 +04:00
{24, &SPL::SetBootReason, "SetBootReason"},
{25, &SPL::GetBootReason, "GetBootReason"},
2021-03-18 08:46:23 +04:00
{31, nullptr, "GetPackage2Hash"},
};
// clang-format on
RegisterHandlers(functions);
}
SPL_SSL::SPL_SSL(Core::System& system_, std::shared_ptr<Module> module_)
: Interface(system_, std::move(module_), "spl:ssl") {
// clang-format off
static const FunctionInfo functions[] = {
2021-06-23 16:35:57 +04:00
{0, &SPL::GetConfig, "GetConfig"},
{1, &SPL::ModularExponentiate, "ModularExponentiate"},
2021-03-18 08:46:23 +04:00
{2, nullptr, "GenerateAesKek"},
{3, nullptr, "LoadAesKey"},
{4, nullptr, "GenerateAesKey"},
2021-06-23 16:35:57 +04:00
{5, &SPL::SetConfig, "SetConfig"},
{7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"},
{11, &SPL::IsDevelopment, "IsDevelopment"},
2021-03-18 08:46:23 +04:00
{13, nullptr, "DecryptDeviceUniqueData"},
{14, nullptr, "DecryptAesKey"},
{15, nullptr, "CryptAesCtr"},
{16, nullptr, "ComputeCmac"},
2020-12-28 19:15:37 +04:00
{21, nullptr, "AllocateAesKeyslot"},
{22, nullptr, "DeallocateAesKeySlot"},
{23, nullptr, "GetAesKeyslotAvailableEvent"},
2021-06-23 16:35:57 +04:00
{24, &SPL::SetBootReason, "SetBootReason"},
{25, &SPL::GetBootReason, "GetBootReason"},
2020-12-28 19:15:37 +04:00
{26, nullptr, "DecryptAndStoreSslClientCertKey"},
{27, nullptr, "ModularExponentiateWithSslClientCertKey"},
2021-03-18 08:46:23 +04:00
};
// clang-format on
RegisterHandlers(functions);
}
SPL_ES::SPL_ES(Core::System& system_, std::shared_ptr<Module> module_)
: Interface(system_, std::move(module_), "spl:es") {
// clang-format off
static const FunctionInfo functions[] = {
2021-06-23 16:35:57 +04:00
{0, &SPL::GetConfig, "GetConfig"},
{1, &SPL::ModularExponentiate, "ModularExponentiate"},
2021-03-18 08:46:23 +04:00
{2, nullptr, "GenerateAesKek"},
{3, nullptr, "LoadAesKey"},
{4, nullptr, "GenerateAesKey"},
2021-06-23 16:35:57 +04:00
{5, &SPL::SetConfig, "SetConfig"},
{7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"},
{11, &SPL::IsDevelopment, "IsDevelopment"},
2021-03-18 08:46:23 +04:00
{13, nullptr, "DecryptDeviceUniqueData"},
{14, nullptr, "DecryptAesKey"},
{15, nullptr, "CryptAesCtr"},
{16, nullptr, "ComputeCmac"},
2021-04-10 10:39:53 +04:00
{17, nullptr, "ImportEsKey"},
2021-03-18 08:46:23 +04:00
{18, nullptr, "UnwrapTitleKey"},
{20, nullptr, "PrepareEsCommonKey"},
{21, nullptr, "AllocateAesKeyslot"},
{22, nullptr, "DeallocateAesKeySlot"},
{23, nullptr, "GetAesKeyslotAvailableEvent"},
2021-06-23 16:35:57 +04:00
{24, &SPL::SetBootReason, "SetBootReason"},
{25, &SPL::GetBootReason, "GetBootReason"},
2020-12-28 19:15:37 +04:00
{28, nullptr, "DecryptAndStoreDrmDeviceCertKey"},
{29, nullptr, "ModularExponentiateWithDrmDeviceCertKey"},
2021-03-18 08:46:23 +04:00
{31, nullptr, "PrepareEsArchiveKey"},
2020-12-28 19:15:37 +04:00
{32, nullptr, "LoadPreparedAesKey"},
};
2021-03-18 08:46:23 +04:00
// clang-format on
RegisterHandlers(functions);
}
SPL_MANU::SPL_MANU(Core::System& system_, std::shared_ptr<Module> module_)
: Interface(system_, std::move(module_), "spl:manu") {
// clang-format off
static const FunctionInfo functions[] = {
2021-06-23 16:35:57 +04:00
{0, &SPL::GetConfig, "GetConfig"},
{1, &SPL::ModularExponentiate, "ModularExponentiate"},
2021-03-18 08:46:23 +04:00
{2, nullptr, "GenerateAesKek"},
{3, nullptr, "LoadAesKey"},
{4, nullptr, "GenerateAesKey"},
2021-06-23 16:35:57 +04:00
{5, &SPL::SetConfig, "SetConfig"},
{7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"},
{11, &SPL::IsDevelopment, "IsDevelopment"},
2021-03-18 08:46:23 +04:00
{13, nullptr, "DecryptDeviceUniqueData"},
{14, nullptr, "DecryptAesKey"},
{15, nullptr, "CryptAesCtr"},
{16, nullptr, "ComputeCmac"},
{21, nullptr, "AllocateAesKeyslot"},
{22, nullptr, "DeallocateAesKeySlot"},
{23, nullptr, "GetAesKeyslotAvailableEvent"},
2021-06-23 16:35:57 +04:00
{24, &SPL::SetBootReason, "SetBootReason"},
{25, &SPL::GetBootReason, "GetBootReason"},
2021-03-18 08:46:23 +04:00
{30, nullptr, "ReencryptDeviceUniqueData"},
};
// clang-format on
2020-12-28 19:15:37 +04:00
RegisterHandlers(functions);
}
SPL::~SPL() = default;
2021-03-18 08:46:23 +04:00
SPL_MIG::~SPL_MIG() = default;
SPL_FS::~SPL_FS() = default;
SPL_SSL::~SPL_SSL() = default;
SPL_ES::~SPL_ES() = default;
SPL_MANU::~SPL_MANU() = default;
2020-12-28 19:15:37 +04:00
} // namespace Service::SPL