2018-04-21 09:23:55 +00:00
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#include <fnd/types.h>
|
|
|
|
#include <crypto/aes.h>
|
|
|
|
#include <crypto/sha.h>
|
|
|
|
#include <fnd/ISerialiseableBinary.h>
|
|
|
|
|
|
|
|
namespace nx
|
|
|
|
{
|
|
|
|
// Also known as HierarchicalIntegrity
|
|
|
|
namespace ivfc
|
|
|
|
{
|
|
|
|
const std::string kIvfcSig = "IVFC";
|
2018-05-11 09:44:41 +00:00
|
|
|
static const size_t kMaxIvfcLevel = 7;
|
2018-04-21 09:23:55 +00:00
|
|
|
static const uint32_t kIvfcId = 0x20000;
|
|
|
|
}
|
|
|
|
|
|
|
|
#pragma pack(push,1)
|
|
|
|
struct sIvfcHeader
|
|
|
|
{
|
|
|
|
char signature[4];
|
|
|
|
le_uint32_t id;
|
|
|
|
le_uint32_t master_hash_size;
|
|
|
|
le_uint32_t level_num;
|
|
|
|
struct sIvfcLevelHeader
|
|
|
|
{
|
2018-05-11 09:44:41 +00:00
|
|
|
le_uint64_t logical_offset;
|
|
|
|
le_uint64_t hash_data_size;
|
|
|
|
le_uint32_t block_size;
|
2018-04-21 09:23:55 +00:00
|
|
|
byte_t reserved[4];
|
|
|
|
} level_header[ivfc::kMaxIvfcLevel];
|
2018-05-11 09:44:41 +00:00
|
|
|
byte_t reserved_00[0x8];
|
|
|
|
crypto::sha::sSha256Hash master_hash;
|
2018-04-21 09:23:55 +00:00
|
|
|
};
|
|
|
|
#pragma pack(pop)
|
|
|
|
}
|