exo2: Implement (untested) SmcDecryptDeviceUniqueData

This commit is contained in:
Michael Scire
2020-05-17 02:36:48 -07:00
committed by SciresM
parent 4fe42eb997
commit 91e0bbd9d7
14 changed files with 925 additions and 46 deletions

View File

@@ -30,16 +30,24 @@ namespace ams::crypto::impl {
static constexpr s32 RoundCount = (KeySize / 4) + 6;
static constexpr size_t RoundKeySize = BlockSize * (RoundCount + 1);
private:
#ifdef ATMOSPHERE_IS_EXOSPHERE
int slot;
#endif
#ifdef ATMOSPHERE_IS_STRATOSPHERE
u32 round_keys[RoundKeySize / sizeof(u32)];
#endif
public:
~AesImpl();
void Initialize(const void *key, size_t key_size, bool is_encrypt);
void EncryptBlock(void *dst, size_t dst_size, const void *src, size_t src_size) const;
void DecryptBlock(void *dst, size_t dst_size, const void *src, size_t src_size) const;
#ifdef ATMOSPHERE_IS_STRATOSPHERE
const u8 *GetRoundKey() const {
return reinterpret_cast<const u8 *>(this->round_keys);
}
#endif
};
/* static_assert(HashFunction<Sha1Impl>); */