NdsForge.NET 1.0.1
Read, validate, edit, compare, and build Nintendo DS and DSi images from .NET
Loading...
Searching...
No Matches
NdsDsiDigestOptions.cs
1namespace NdsForge;
2
7public sealed record NdsDsiDigestOptions
8{
10 public static NdsDsiDigestOptions Default { get; } = new();
11
16 public int SectorSize { get; init; } = 0x400;
17
22 public int BlockSectorCount { get; init; } = 0x20;
23
26 internal void Validate()
27 {
28 if (SectorSize < 0x200 || SectorSize > 16 * 1024 * 1024 || (SectorSize & (SectorSize - 1)) != 0)
29 {
30 throw new ArgumentException("DSi digest sectors must be a power of two from 512 bytes through 16 MiB.");
31 }
32
33 if (BlockSectorCount is < 1 or > 65_536)
34 {
35 throw new ArgumentException("A DSi digest block must contain from one through 65,536 sector hashes.");
36 }
37 }
38}
Configures the optional DSi hierarchical HMAC-SHA1 tables that cover common NTR content and DSi-mode ...
int SectorSize
Splits each covered content range into independently authenticated chunks. The value must be a power ...
int BlockSectorCount
Groups this many consecutive 20-byte sector HMACs into one block-table HMAC. Values from one through ...
static NdsDsiDigestOptions Default
Uses the conventional 1 KiB content sector and 32 sector hashes per second-level block.