2018-04-15 02:40:22 +00:00
|
|
|
#pragma once
|
2018-10-22 13:30:49 +00:00
|
|
|
#include <nn/hac/define/nca.h>
|
2018-04-15 02:40:22 +00:00
|
|
|
|
2018-08-07 07:17:51 +00:00
|
|
|
namespace nn
|
|
|
|
{
|
|
|
|
namespace hac
|
2018-04-15 02:40:22 +00:00
|
|
|
{
|
2018-10-25 12:44:48 +00:00
|
|
|
class ContentArchiveUtils
|
2018-04-15 02:40:22 +00:00
|
|
|
{
|
|
|
|
public:
|
2018-08-07 07:17:51 +00:00
|
|
|
static inline size_t sectorToOffset(size_t sector_index) { return sector_index * nn::hac::nca::kSectorSize; }
|
2018-10-25 12:25:31 +00:00
|
|
|
static void decryptContentArchiveHeader(const byte_t* src, byte_t* dst, const fnd::aes::sAesXts128Key& key);
|
2018-04-15 02:40:22 +00:00
|
|
|
static byte_t getMasterKeyRevisionFromKeyGeneration(byte_t key_generation);
|
2018-08-07 07:17:51 +00:00
|
|
|
static void getNcaPartitionAesCtr(const nn::hac::sNcaFsHeader* hdr, byte_t* ctr);
|
2018-04-15 02:40:22 +00:00
|
|
|
};
|
2018-08-07 07:17:51 +00:00
|
|
|
}
|
2018-04-15 02:40:22 +00:00
|
|
|
}
|