mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-27 13:14:15 -04:00
exo2: implement SmcModularExponentiate(ByStorageKey)
This commit is contained in:
parent
ccba70abfe
commit
8a4019151b
3 changed files with 190 additions and 10 deletions
|
@ -20,6 +20,8 @@ namespace ams::secmon {
|
|||
|
||||
namespace {
|
||||
|
||||
constexpr const u8 RsaPublicKey[] = { 0x00, 0x01, 0x00, 0x01 };
|
||||
|
||||
constinit u8 g_rsa_moduli[ImportRsaKey_Count][se::RsaSize] = {};
|
||||
constinit bool g_rsa_modulus_committed[ImportRsaKey_Count] = {};
|
||||
|
||||
|
@ -80,6 +82,10 @@ namespace ams::secmon {
|
|||
se::SetRsaKey(slot, GetRsaKeyModulus(which), se::RsaSize, GetRsaKeyPrivateExponent(which), se::RsaSize);
|
||||
}
|
||||
|
||||
void LoadProvisionalRsaPublicKey(int slot, ImportRsaKey which) {
|
||||
se::SetRsaKey(slot, GetRsaKeyModulus(which), se::RsaSize, RsaPublicKey, sizeof(RsaPublicKey));
|
||||
}
|
||||
|
||||
void SetMasterKey(int generation, const void *src, size_t size) {
|
||||
const int index = generation - pkg1::KeyGeneration_Min;
|
||||
se::EncryptAes128(GetMasterKeyStorage(index), se::AesBlockSize, pkg1::AesKeySlot_RandomForKeyStorageWrap, src, size);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue