mirror of
https://github.com/jakcron/nstool
synced 2024-12-24 13:41:12 +00:00
[nx] Add getNcaPartititionAesCtr()
This commit is contained in:
parent
b69dc62062
commit
3291d06082
2 changed files with 9 additions and 0 deletions
|
@ -9,5 +9,6 @@ namespace nx
|
|||
static inline size_t sectorToOffset(size_t sector_index) { return sector_index * nx::nca::kSectorSize; }
|
||||
static void decryptNcaHeader(const byte_t* src, byte_t* dst, const crypto::aes::sAesXts128Key& key);
|
||||
static byte_t getMasterKeyRevisionFromKeyGeneration(byte_t key_generation);
|
||||
static void getNcaPartitionAesCtr(const nx::sNcaFsHeader* hdr, byte_t* ctr);
|
||||
};
|
||||
}
|
|
@ -46,4 +46,12 @@ byte_t nx::NcaUtils::getMasterKeyRevisionFromKeyGeneration(byte_t key_generation
|
|||
}
|
||||
|
||||
return masterkey_rev;
|
||||
}
|
||||
|
||||
void nx::NcaUtils::getNcaPartitionAesCtr(const nx::sNcaFsHeader* hdr, byte_t* ctr)
|
||||
{
|
||||
for (size_t i = 0; i < 16; i++)
|
||||
{
|
||||
ctr[15-i] = hdr->base_ctr.iv[i];
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue