From 561c61a6ee3923619b7e77cd6fc9d201c34f78b1 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sun, 22 Mar 2026 00:32:28 -0400 Subject: [PATCH] Add better code documentation to PartitionKeys --- NDecrypt.Core/PartitionKeys.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/NDecrypt.Core/PartitionKeys.cs b/NDecrypt.Core/PartitionKeys.cs index 65d7c66..770e5d6 100644 --- a/NDecrypt.Core/PartitionKeys.cs +++ b/NDecrypt.Core/PartitionKeys.cs @@ -9,10 +9,22 @@ namespace NDecrypt.Core /// public class PartitionKeys { + /// + /// Primary AES-CTR encryption key + /// + /// Used for both EXE-FS and ROM-FS public byte[] NormalKey { get; private set; } + /// + /// Secondary AES-CTR encryption key + /// + /// Used for only EXE-FS public byte[] NormalKey2C { get; } + /// + /// First 16 bytes of the RSA-2048 signature + /// + /// Used as an XOR value during key generation private readonly byte[] KeyY; /// @@ -22,7 +34,7 @@ namespace NDecrypt.Core /// BitMasks from the partition or backup header /// AES hardware constant to use /// KeyX value to assign based on crypto method and development status - /// KeyX value to assign based on development status + /// KeyX2C value to assign based on development status public PartitionKeys(byte[]? signature, BitMasks masks, byte[] hardwareConstant, byte[] keyX, byte[] keyX0x2C) { // Validate inputs @@ -62,6 +74,9 @@ namespace NDecrypt.Core /// /// Set RomFS values based on the bit masks /// + /// BitMasks from the partition or backup header + /// AES hardware constant to use + /// KeyX2C value to assign based on development status public void SetRomFSValues(BitMasks masks, byte[] hardwareConstant, byte[] keyX0x2C) { // NormalKey has a constant value for zero-key