From 3166a438a83c5e9a66c8d17df8ad4b940d571981 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Tue, 5 Mar 2024 14:53:27 -0500 Subject: [PATCH] Reduce some unused constants --- SabreTools.Core/Constants.cs | 29 ----------------------------- SabreTools.Core/Tools/Utilities.cs | 4 ++-- 2 files changed, 2 insertions(+), 31 deletions(-) diff --git a/SabreTools.Core/Constants.cs b/SabreTools.Core/Constants.cs index 1f96650f..9b9283cd 100644 --- a/SabreTools.Core/Constants.cs +++ b/SabreTools.Core/Constants.cs @@ -31,37 +31,8 @@ 0xb4, 0x10, 0xff, 0x61, 0xf2, 0x00, 0x15, 0xad ]; public const string SHA384Zero = "cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7"; - public static readonly byte[] SHA384ZeroBytes = [ 0xcb, 0x00, 0x75, 0x3f, - 0x45, 0xa3, 0x5e, 0x8b, - 0xb5, 0xa0, 0x3d, 0x69, - 0x9a, 0xc6, 0x50, 0x07, - 0x27, 0x2c, 0x32, 0xab, - 0x0e, 0xde, 0xd1, 0x63, - 0x1a, 0x8b, 0x60, 0x5a, - 0x43, 0xff, 0x5b, 0xed, - 0x80, 0x86, 0x07, 0x2b, - 0xa1, 0xe7, 0xcc, 0x23, - 0x58, 0xba, 0xec, 0xa1, - 0x34, 0xc8, 0x25, 0xa7 ]; public const string SHA512Zero = "ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f"; - public static readonly byte[] SHA512ZeroBytes = [ 0xdd, 0xaf, 0x35, 0xa1, - 0x93, 0x61, 0x7a, 0xba, - 0xcc, 0x41, 0x73, 0x49, - 0xae, 0x20, 0x41, 0x31, - 0x12, 0xe6, 0xfa, 0x4e, - 0x89, 0xa9, 0x7e, 0xa2, - 0x0a, 0x9e, 0xee, 0xe6, - 0x4b, 0x55, 0xd3, 0x9a, - 0x21, 0x92, 0x99, 0x2a, - 0x27, 0x4f, 0xc1, 0xa8, - 0x36, 0xba, 0x3c, 0x23, - 0xa3, 0xfe, 0xeb, 0xbd, - 0x45, 0x4d, 0x44, 0x23, - 0x64, 0x3c, 0xe8, 0x0e, - 0x2a, 0x9a, 0xc9, 0x4f, - 0xa5, 0x4c, 0xa4, 0x9f ]; public const string SpamSumZero = "QXX"; - public static readonly byte[] SpamSumZeroBytes = [0x51, 0x58, 0x58]; #endregion diff --git a/SabreTools.Core/Tools/Utilities.cs b/SabreTools.Core/Tools/Utilities.cs index 2a7ccaa5..33223043 100644 --- a/SabreTools.Core/Tools/Utilities.cs +++ b/SabreTools.Core/Tools/Utilities.cs @@ -63,8 +63,8 @@ namespace SabreTools.Core.Tools // Cap the depth between 0 and 20, for now if (depth < 0) depth = 0; - else if (depth > Constants.SHA1ZeroBytes.Length) - depth = Constants.SHA1ZeroBytes.Length; + else if (depth > (Constants.SHA1Length / 2)) + depth = (Constants.SHA1Length / 2); // Loop through and generate the subdirectory string path = string.Empty;