Add the MD5 hash of null as a constant

This commit is contained in:
Deterous
2023-10-27 17:47:33 +13:00
parent c5aa28a7c5
commit 026e2c1d85
2 changed files with 6 additions and 2 deletions
+1
View File
@@ -11,6 +11,7 @@ namespace BuildIRD
byte[] discID = new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
byte[] discPIC = new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
IRD ird = new IRD("Z:", discKey, discID, discPIC);
ird.Write("./ ird.ird");
Console.WriteLine(ird.HeaderLength);
}
}
+5 -2
View File
@@ -20,6 +20,11 @@ namespace LibIRD
///
public static readonly byte[] Magic = new byte[] { 0x33, 0x49, 0x52, 0x44 };
/// <summary>
/// MD5 hash of null
/// </summary>
public static readonly byte[] NullMD5 = new byte[] {0xd4, 0x1d, 0x8c, 0xd9, 0x8f, 0x00, 0xb2, 0x04, 0xe9, 0x80, 0x09, 0x98, 0xec, 0xf8, 0x42, 0x7e};
/// <summary>
/// AES encryption/decryption keys and initial values
/// </summary>
@@ -382,8 +387,6 @@ namespace LibIRD
{
// Keep track of the little-endian 32-bit "IEEE 802.3" CRC value
Crc32 crcStream = new Crc32();
// TODO: Run as an async Task?
crcStream.Append(outStream);
// Write IRD data to stream in order
using (BinaryWriter bw = new BinaryWriter(outStream))