mirror of
https://github.com/LNH-team/pico-loader.git
synced 2026-01-10 08:29:29 +01:00
23 lines
725 B
C++
23 lines
725 B
C++
#pragma once
|
|
#include <libtwl/aes/aes.h>
|
|
#include "ndsHeader.h"
|
|
|
|
/// @brief Class handling AES crypto for DSi roms.
|
|
class TwlAes
|
|
{
|
|
public:
|
|
/// @brief Sets up AES for the DSi rom with the given \p romHeader.
|
|
/// @param romHeader The header of the DSi rom to setup AES for.
|
|
void SetupAes(const nds_header_twl_t* romHeader) const;
|
|
|
|
/// @brief Performs modcrypt decryption.
|
|
/// @param data The data to decrypt.
|
|
/// @param length The length of the data to decrypt.
|
|
/// @param iv The AES initialization vector.
|
|
void DecryptModuleAes(void* data, u32 length, const aes_u128_t* iv) const;
|
|
|
|
private:
|
|
void SetupModuleKeyXY(const nds_header_twl_t* romHeader) const;
|
|
void SetupNandKeyX() const;
|
|
};
|