diff --git a/HashLib.Benchmark/Delphi/PerformanceBenchmarkConsole.dpr b/HashLib.Benchmark/Delphi/PerformanceBenchmarkConsole.dpr index 45f62c0..1d4c574 100644 --- a/HashLib.Benchmark/Delphi/PerformanceBenchmarkConsole.dpr +++ b/HashLib.Benchmark/Delphi/PerformanceBenchmarkConsole.dpr @@ -74,7 +74,6 @@ uses HlpMurmurHash3_x86_32 in '..\..\HashLib\src\Hash32\HlpMurmurHash3_x86_32.pas', HlpMurmurHash3_x86_128 in '..\..\HashLib\src\Hash128\HlpMurmurHash3_x86_128.pas', HlpSipHash128 in '..\..\HashLib\src\Hash128\HlpSipHash128.pas', - HlpNullable in '..\..\HashLib\src\Nullable\HlpNullable.pas', HlpNullDigest in '..\..\HashLib\src\NullDigest\HlpNullDigest.pas', HlpOneAtTime in '..\..\HashLib\src\Hash32\HlpOneAtTime.pas', HlpPJW in '..\..\HashLib\src\Hash32\HlpPJW.pas', diff --git a/HashLib.Benchmark/Delphi/PerformanceBenchmarkFMX.dpr b/HashLib.Benchmark/Delphi/PerformanceBenchmarkFMX.dpr index 032bf80..b374140 100644 --- a/HashLib.Benchmark/Delphi/PerformanceBenchmarkFMX.dpr +++ b/HashLib.Benchmark/Delphi/PerformanceBenchmarkFMX.dpr @@ -73,7 +73,6 @@ uses HlpMurmurHash3_x86_32 in '..\..\HashLib\src\Hash32\HlpMurmurHash3_x86_32.pas', HlpMurmurHash3_x86_128 in '..\..\HashLib\src\Hash128\HlpMurmurHash3_x86_128.pas', HlpSipHash128 in '..\..\HashLib\src\Hash128\HlpSipHash128.pas', - HlpNullable in '..\..\HashLib\src\Nullable\HlpNullable.pas', HlpNullDigest in '..\..\HashLib\src\NullDigest\HlpNullDigest.pas', HlpOneAtTime in '..\..\HashLib\src\Hash32\HlpOneAtTime.pas', HlpPJW in '..\..\HashLib\src\Hash32\HlpPJW.pas', diff --git a/HashLib.Tests/Delphi.Tests/HashLib.Tests.TestInsight.dpr b/HashLib.Tests/Delphi.Tests/HashLib.Tests.TestInsight.dpr deleted file mode 100644 index d5956a8..0000000 --- a/HashLib.Tests/Delphi.Tests/HashLib.Tests.TestInsight.dpr +++ /dev/null @@ -1,140 +0,0 @@ -program HashLib.Tests.TestInsight; -{ - - Delphi DUnit Test Project - ------------------------- - This project contains the DUnit test framework and the GUI/Console test runners. - Add "CONSOLE_TESTRUNNER" to the conditional defines entry in the project options - to use the console test runner. Otherwise the GUI test runner will be used by - default. - -} - -{$WARN DUPLICATE_CTOR_DTOR OFF} -{$IFDEF CONSOLE_TESTRUNNER} -{$APPTYPE CONSOLE} -{$ENDIF} - -uses - TestInsight.DUnit, - HlpHash in '..\..\HashLib\src\Base\HlpHash.pas', - HlpKDF in '..\..\HashLib\src\Base\HlpKDF.pas', - HlpHashBuffer in '..\..\HashLib\src\Base\HlpHashBuffer.pas', - HlpHashCryptoNotBuildIn in '..\..\HashLib\src\Base\HlpHashCryptoNotBuildIn.pas', - HlpHashFactory in '..\..\HashLib\src\Base\HlpHashFactory.pas', - HlpHashResult in '..\..\HashLib\src\Base\HlpHashResult.pas', - HlpHashRounds in '..\..\HashLib\src\Base\HlpHashRounds.pas', - HlpHashSize in '..\..\HashLib\src\Base\HlpHashSize.pas', - HlpHMACNotBuildInAdapter in '..\..\HashLib\src\Base\HlpHMACNotBuildInAdapter.pas', - HlpMultipleTransformNonBlock in '..\..\HashLib\src\Base\HlpMultipleTransformNonBlock.pas', - HlpAdler32 in '..\..\HashLib\src\Checksum\HlpAdler32.pas', - HlpCRC in '..\..\HashLib\src\Checksum\HlpCRC.pas', - HlpCRC16 in '..\..\HashLib\src\Checksum\HlpCRC16.pas', - HlpCRC32 in '..\..\HashLib\src\Checksum\HlpCRC32.pas', - HlpCRC32Fast in '..\..\HashLib\src\Checksum\HlpCRC32Fast.pas', - HlpCRC64 in '..\..\HashLib\src\Checksum\HlpCRC64.pas', - HlpGost in '..\..\HashLib\src\Crypto\HlpGost.pas', - HlpGrindahl256 in '..\..\HashLib\src\Crypto\HlpGrindahl256.pas', - HlpGrindahl512 in '..\..\HashLib\src\Crypto\HlpGrindahl512.pas', - HlpHAS160 in '..\..\HashLib\src\Crypto\HlpHAS160.pas', - HlpHaval in '..\..\HashLib\src\Crypto\HlpHaval.pas', - HlpMD2 in '..\..\HashLib\src\Crypto\HlpMD2.pas', - HlpMD4 in '..\..\HashLib\src\Crypto\HlpMD4.pas', - HlpMD5 in '..\..\HashLib\src\Crypto\HlpMD5.pas', - HlpMDBase in '..\..\HashLib\src\Crypto\HlpMDBase.pas', - HlpPanama in '..\..\HashLib\src\Crypto\HlpPanama.pas', - HlpRadioGatun32 in '..\..\HashLib\src\Crypto\HlpRadioGatun32.pas', - HlpRadioGatun64 in '..\..\HashLib\src\Crypto\HlpRadioGatun64.pas', - HlpRIPEMD in '..\..\HashLib\src\Crypto\HlpRIPEMD.pas', - HlpRIPEMD128 in '..\..\HashLib\src\Crypto\HlpRIPEMD128.pas', - HlpRIPEMD160 in '..\..\HashLib\src\Crypto\HlpRIPEMD160.pas', - HlpRIPEMD256 in '..\..\HashLib\src\Crypto\HlpRIPEMD256.pas', - HlpRIPEMD320 in '..\..\HashLib\src\Crypto\HlpRIPEMD320.pas', - HlpSHA0 in '..\..\HashLib\src\Crypto\HlpSHA0.pas', - HlpSHA1 in '..\..\HashLib\src\Crypto\HlpSHA1.pas', - HlpSHA2_224 in '..\..\HashLib\src\Crypto\HlpSHA2_224.pas', - HlpSHA2_256 in '..\..\HashLib\src\Crypto\HlpSHA2_256.pas', - HlpSHA2_256Base in '..\..\HashLib\src\Crypto\HlpSHA2_256Base.pas', - HlpSHA2_384 in '..\..\HashLib\src\Crypto\HlpSHA2_384.pas', - HlpSHA2_512 in '..\..\HashLib\src\Crypto\HlpSHA2_512.pas', - HlpSHA2_512_224 in '..\..\HashLib\src\Crypto\HlpSHA2_512_224.pas', - HlpSHA2_512_256 in '..\..\HashLib\src\Crypto\HlpSHA2_512_256.pas', - HlpSHA2_512Base in '..\..\HashLib\src\Crypto\HlpSHA2_512Base.pas', - HlpSHA3 in '..\..\HashLib\src\Crypto\HlpSHA3.pas', - HlpSnefru in '..\..\HashLib\src\Crypto\HlpSnefru.pas', - HlpTiger in '..\..\HashLib\src\Crypto\HlpTiger.pas', - HlpTiger2 in '..\..\HashLib\src\Crypto\HlpTiger2.pas', - HlpWhirlPool in '..\..\HashLib\src\Crypto\HlpWhirlPool.pas', - HlpGOST3411_2012 in '..\..\HashLib\src\Crypto\HlpGOST3411_2012.pas', - HlpBlake2B in '..\..\HashLib\src\Crypto\HlpBlake2B.pas', - HlpBlake2S in '..\..\HashLib\src\Crypto\HlpBlake2S.pas', - HlpBlake2BParams in '..\..\HashLib\src\Crypto\Blake2BParams\HlpBlake2BParams.pas', - HlpBlake2SParams in '..\..\HashLib\src\Crypto\Blake2SParams\HlpBlake2SParams.pas', - HlpNullDigest in '..\..\HashLib\src\NullDigest\HlpNullDigest.pas', - HlpAP in '..\..\HashLib\src\Hash32\HlpAP.pas', - HlpBernstein in '..\..\HashLib\src\Hash32\HlpBernstein.pas', - HlpBernstein1 in '..\..\HashLib\src\Hash32\HlpBernstein1.pas', - HlpBKDR in '..\..\HashLib\src\Hash32\HlpBKDR.pas', - HlpDEK in '..\..\HashLib\src\Hash32\HlpDEK.pas', - HlpDJB in '..\..\HashLib\src\Hash32\HlpDJB.pas', - HlpELF in '..\..\HashLib\src\Hash32\HlpELF.pas', - HlpFNV in '..\..\HashLib\src\Hash32\HlpFNV.pas', - HlpFNV1a in '..\..\HashLib\src\Hash32\HlpFNV1a.pas', - HlpJenkins3 in '..\..\HashLib\src\Hash32\HlpJenkins3.pas', - HlpJS in '..\..\HashLib\src\Hash32\HlpJS.pas', - HlpMurmur2 in '..\..\HashLib\src\Hash32\HlpMurmur2.pas', - HlpMurmurHash3_x86_32 in '..\..\HashLib\src\Hash32\HlpMurmurHash3_x86_32.pas', - HlpOneAtTime in '..\..\HashLib\src\Hash32\HlpOneAtTime.pas', - HlpPJW in '..\..\HashLib\src\Hash32\HlpPJW.pas', - HlpRotating in '..\..\HashLib\src\Hash32\HlpRotating.pas', - HlpRS in '..\..\HashLib\src\Hash32\HlpRS.pas', - HlpSDBM in '..\..\HashLib\src\Hash32\HlpSDBM.pas', - HlpShiftAndXor in '..\..\HashLib\src\Hash32\HlpShiftAndXor.pas', - HlpSuperFast in '..\..\HashLib\src\Hash32\HlpSuperFast.pas', - HlpXXHash32 in '..\..\HashLib\src\Hash32\HlpXXHash32.pas', - HlpFNV1a64 in '..\..\HashLib\src\Hash64\HlpFNV1a64.pas', - HlpFNV64 in '..\..\HashLib\src\Hash64\HlpFNV64.pas', - HlpMurmur2_64 in '..\..\HashLib\src\Hash64\HlpMurmur2_64.pas', - HlpSipHash in '..\..\HashLib\src\Hash64\HlpSipHash.pas', - HlpXXHash64 in '..\..\HashLib\src\Hash64\HlpXXHash64.pas', - HlpMurmurHash3_x86_128 in '..\..\HashLib\src\Hash128\HlpMurmurHash3_x86_128.pas', - HlpMurmurHash3_x64_128 in '..\..\HashLib\src\Hash128\HlpMurmurHash3_x64_128.pas', - HlpSipHash128 in '..\..\HashLib\src\Hash128\HlpSipHash128.pas', - HlpIHash in '..\..\HashLib\src\Interfaces\HlpIHash.pas', - HlpIKDF in '..\..\HashLib\src\Interfaces\HlpIKDF.pas', - HlpICRC in '..\..\HashLib\src\Interfaces\HlpICRC.pas', - HlpIHashInfo in '..\..\HashLib\src\Interfaces\HlpIHashInfo.pas', - HlpIHashResult in '..\..\HashLib\src\Interfaces\HlpIHashResult.pas', - HlpIBlake2BParams in '..\..\HashLib\src\Interfaces\IBlake2BParams\HlpIBlake2BParams.pas', - HlpIBlake2SParams in '..\..\HashLib\src\Interfaces\IBlake2SParams\HlpIBlake2SParams.pas', - HlpBlake2BP in '..\..\HashLib\src\Crypto\HlpBlake2BP.pas', - HlpBlake2SP in '..\..\HashLib\src\Crypto\HlpBlake2SP.pas', - HlpBlake3 in '..\..\HashLib\src\Crypto\HlpBlake3.pas', - HlpPBKDF2_HMACNotBuildInAdapter in '..\..\HashLib\src\KDF\HlpPBKDF2_HMACNotBuildInAdapter.pas', - HlpPBKDF_Argon2NotBuildInAdapter in '..\..\HashLib\src\KDF\HlpPBKDF_Argon2NotBuildInAdapter.pas', - HlpArgon2TypeAndVersion in '..\..\HashLib\src\KDF\HlpArgon2TypeAndVersion.pas', - HlpPBKDF_ScryptNotBuildInAdapter in '..\..\HashLib\src\KDF\HlpPBKDF_ScryptNotBuildInAdapter.pas', - HlpNullable in '..\..\HashLib\src\Nullable\HlpNullable.pas', - HlpConverters in '..\..\HashLib\src\Utils\HlpConverters.pas', - HlpBitConverter in '..\..\HashLib\src\Utils\HlpBitConverter.pas', - HlpBits in '..\..\HashLib\src\Utils\HlpBits.pas', - HlpHashLibTypes in '..\..\HashLib\src\Utils\HlpHashLibTypes.pas', - HlpArrayUtils in '..\..\HashLib\src\Utils\HlpArrayUtils.pas', - HashLibTestBase in '..\src\HashLibTestBase.pas', - TestVectors in '..\src\TestVectors.pas', - ChecksumTests in '..\src\ChecksumTests.pas', - NullDigestTests in '..\src\NullDigestTests.pas', - Hash32Tests in '..\src\Hash32Tests.pas', - Hash64Tests in '..\src\Hash64Tests.pas', - Hash128Tests in '..\src\Hash128Tests.pas', - CryptoTests in '..\src\CryptoTests.pas', - BitConverterTests in '..\src\BitConverterTests.pas', - PBKDF2_HMACTests in '..\src\PBKDF2_HMACTests.pas', - PBKDF_Argon2Tests in '..\src\PBKDF_Argon2Tests.pas', - PBKDF_ScryptTests in '..\src\PBKDF_ScryptTests.pas', - CRCTests in '..\src\CRCTests.pas'; -begin - - TestInsight.DUnit.RunRegisteredTests; - -end. diff --git a/HashLib.Tests/Delphi.Tests/HashLib.Tests.dpr b/HashLib.Tests/Delphi.Tests/HashLib.Tests.dpr index 46e4be0..edc6108 100644 --- a/HashLib.Tests/Delphi.Tests/HashLib.Tests.dpr +++ b/HashLib.Tests/Delphi.Tests/HashLib.Tests.dpr @@ -11,15 +11,22 @@ program HashLib.Tests; } {$WARN DUPLICATE_CTOR_DTOR OFF} -{$IFDEF CONSOLE_TESTRUNNER} -{$APPTYPE CONSOLE} + +{$IFNDEF TESTINSIGHT} + {$IFDEF CONSOLE_TESTRUNNER} + {$APPTYPE CONSOLE} + {$ENDIF} {$ENDIF} uses - Forms, - TestFramework, - GUITestRunner, - TextTestRunner, +{$IFDEF TESTINSIGHT} + TestInsight.DUnit, +{$ELSE} + Forms, + TestFramework, + GUITestRunner, + TextTestRunner, +{$ENDIF} HlpHash in '..\..\HashLib\src\Base\HlpHash.pas', HlpKDF in '..\..\HashLib\src\Base\HlpKDF.pas', HlpHashBuffer in '..\..\HashLib\src\Base\HlpHashBuffer.pas', @@ -117,7 +124,6 @@ uses HlpPBKDF_Argon2NotBuildInAdapter in '..\..\HashLib\src\KDF\HlpPBKDF_Argon2NotBuildInAdapter.pas', HlpArgon2TypeAndVersion in '..\..\HashLib\src\KDF\HlpArgon2TypeAndVersion.pas', HlpPBKDF_ScryptNotBuildInAdapter in '..\..\HashLib\src\KDF\HlpPBKDF_ScryptNotBuildInAdapter.pas', - HlpNullable in '..\..\HashLib\src\Nullable\HlpNullable.pas', HlpConverters in '..\..\HashLib\src\Utils\HlpConverters.pas', HlpBitConverter in '..\..\HashLib\src\Utils\HlpBitConverter.pas', HlpBits in '..\..\HashLib\src\Utils\HlpBits.pas', @@ -139,10 +145,14 @@ uses begin +{$IFDEF TESTINSIGHT} + TestInsight.DUnit.RunRegisteredTests; +{$ELSE} Application.Initialize; if IsConsole then TextTestRunner.RunRegisteredTests else GUITestRunner.RunRegisteredTests; +{$ENDIF} end. diff --git a/HashLib.Tests/src/CRCTests.pas b/HashLib.Tests/src/CRCTests.pas index 81ca0f9..f4295b1 100644 --- a/HashLib.Tests/src/CRCTests.pas +++ b/HashLib.Tests/src/CRCTests.pas @@ -3,7 +3,6 @@ interface uses - Classes, SysUtils, {$IFDEF FPC} fpcunit, diff --git a/HashLib/src/Base/HlpHashResult.pas b/HashLib/src/Base/HlpHashResult.pas index 40132ac..5fd5ddb 100644 --- a/HashLib/src/Base/HlpHashResult.pas +++ b/HashLib/src/Base/HlpHashResult.pas @@ -6,16 +6,6 @@ interface uses SysUtils, -{$IFDEF FPC} - base64, -{$ELSE} -{$IFDEF HAS_DELPHI_NET_ENCODING} - System.NetEncoding, -{$ELSE} - Classes, - EncdDecd, -{$ENDIF HAS_DELPHI_NET_ENCODING} -{$ENDIF FPC} HlpBits, HlpHashLibTypes, HlpIHashResult, @@ -49,8 +39,6 @@ THashResult = class sealed(TInterfacedObject, IHashResult) function GetUInt64(): UInt64; function ToString(AGroup: Boolean = False): String; reintroduce; function Equals(const AHashResult: IHashResult): Boolean; reintroduce; - function GetHashCode(): {$IFDEF DELPHI}Int32; {$ELSE}PtrInt; -{$ENDIF DELPHI}override; end; @@ -107,68 +95,6 @@ function THashResult.GetBytes: THashLibByteArray; result := FHash; end; -function THashResult.GetHashCode: {$IFDEF DELPHI}Int32; {$ELSE}PtrInt; -{$ENDIF DELPHI} - -var - LResult: UInt32; - LIdx, LTop: Int32; - LTemp: String; -{$IFDEF HAS_DELPHI_NET_ENCODING} - LTempHolder: THashLibByteArray; -{$ELSE} -{$IFDEF DELPHI} - LTempHolder: TBytesStream; -{$ENDIF DELPHI} -{$ENDIF HAS_DELPHI_NET_ENCODING} -{$IFDEF FPC} - LTempHolder: String; -{$ENDIF FPC} -begin - -{$IFDEF HAS_DELPHI_NET_ENCODING} - LTempHolder := Self.FHash; -{$ELSE} -{$IFDEF DELPHI} - LTempHolder := TBytesStream.Create(Self.FHash); -{$ENDIF DELPHI} -{$ENDIF HAS_DELPHI_NET_ENCODING} -{$IFDEF FPC} - LTempHolder := EncodeStringBase64(TConverters.ConvertBytesToString(Self.FHash, - TEncoding.UTF8)); -{$ENDIF FPC} -{$IFDEF HAS_DELPHI_NET_ENCODING} - LTemp := StringReplace(TNetEncoding.base64.EncodeBytesToString(LTempHolder), - sLineBreak, '', [rfReplaceAll]); -{$ELSE} -{$IFDEF DELPHI} - try - LTemp := StringReplace(String(EncodeBase64(LTempHolder.Memory, - LTempHolder.Size)), sLineBreak, '', [rfReplaceAll]); - finally - LTempHolder.Free; - end; -{$ENDIF DELPHI} -{$ENDIF HAS_DELPHI_NET_ENCODING} -{$IFDEF FPC} - LTemp := LTempHolder; -{$ENDIF FPC} - LTemp := AnsiUpperCase(LTemp); - - LResult := 0; - LIdx := 1; - LTop := System.Length(LTemp); - - while LIdx <= LTop do - begin - LResult := TBits.RotateLeft32(LResult, 5); - LResult := LResult xor UInt32(LTemp[LIdx]); - System.Inc(LIdx); - end; - - result := LResult; -end; - function THashResult.GetInt32: Int32; begin if System.Length(FHash) <> sizeof(Int32) then diff --git a/HashLib/src/Crypto/HlpGost.pas b/HashLib/src/Crypto/HlpGost.pas index f571d3b..656279d 100644 --- a/HashLib/src/Crypto/HlpGost.pas +++ b/HashLib/src/Crypto/HlpGost.pas @@ -6,10 +6,6 @@ interface uses HlpHashLibTypes, -{$IFDEF DELPHI} - HlpHash, - HlpHashBuffer, -{$ENDIF DELPHI} HlpBits, HlpConverters, HlpIHash, diff --git a/HashLib/src/Crypto/HlpGrindahl256.pas b/HashLib/src/Crypto/HlpGrindahl256.pas index cf59188..de73c88 100644 --- a/HashLib/src/Crypto/HlpGrindahl256.pas +++ b/HashLib/src/Crypto/HlpGrindahl256.pas @@ -5,14 +5,7 @@ interface uses -{$IFDEF DELPHI2010} - SysUtils, // to get rid of compiler hint "not inlined" on Delphi 2010. -{$ENDIF DELPHI2010} HlpHashLibTypes, -{$IFDEF DELPHI} - HlpHash, - HlpHashBuffer, -{$ENDIF DELPHI} HlpConverters, HlpIHash, HlpIHashInfo, diff --git a/HashLib/src/Crypto/HlpGrindahl512.pas b/HashLib/src/Crypto/HlpGrindahl512.pas index 49ed5c1..682bd5f 100644 --- a/HashLib/src/Crypto/HlpGrindahl512.pas +++ b/HashLib/src/Crypto/HlpGrindahl512.pas @@ -5,14 +5,7 @@ interface uses -{$IFDEF DELPHI2010} - SysUtils, // to get rid of compiler hint "not inlined" on Delphi 2010. -{$ENDIF DELPHI2010} HlpHashLibTypes, -{$IFDEF DELPHI} - HlpHash, - HlpHashBuffer, -{$ENDIF DELPHI} HlpBits, HlpConverters, HlpIHash, diff --git a/HashLib/src/Crypto/HlpHAS160.pas b/HashLib/src/Crypto/HlpHAS160.pas index 1539832..a102684 100644 --- a/HashLib/src/Crypto/HlpHAS160.pas +++ b/HashLib/src/Crypto/HlpHAS160.pas @@ -5,14 +5,7 @@ interface uses -{$IFDEF DELPHI2010} - SysUtils, // to get rid of compiler hint "not inlined" on Delphi 2010. -{$ENDIF DELPHI2010} HlpHashLibTypes, -{$IFDEF DELPHI} - HlpHash, - HlpHashBuffer, -{$ENDIF DELPHI} HlpConverters, HlpIHash, HlpIHashInfo, diff --git a/HashLib/src/Crypto/HlpHaval.pas b/HashLib/src/Crypto/HlpHaval.pas index d88ae3b..30dc238 100644 --- a/HashLib/src/Crypto/HlpHaval.pas +++ b/HashLib/src/Crypto/HlpHaval.pas @@ -5,14 +5,7 @@ interface uses -{$IFDEF DELPHI2010} - SysUtils, // to get rid of compiler hint "not inlined" on Delphi 2010. -{$ENDIF DELPHI2010} HlpHashLibTypes, -{$IFDEF DELPHI} - HlpHash, - HlpHashBuffer, -{$ENDIF DELPHI} HlpBits, HlpHashSize, HlpHashRounds, diff --git a/HashLib/src/Crypto/HlpMD2.pas b/HashLib/src/Crypto/HlpMD2.pas index 6b3d431..bee14ac 100644 --- a/HashLib/src/Crypto/HlpMD2.pas +++ b/HashLib/src/Crypto/HlpMD2.pas @@ -6,10 +6,6 @@ interface uses HlpHashLibTypes, -{$IFDEF DELPHI} - HlpHashBuffer, - HlpHash, -{$ENDIF DELPHI} HlpIHash, HlpIHashInfo, HlpArrayUtils, diff --git a/HashLib/src/Crypto/HlpMD4.pas b/HashLib/src/Crypto/HlpMD4.pas index 6a27c60..d0a6742 100644 --- a/HashLib/src/Crypto/HlpMD4.pas +++ b/HashLib/src/Crypto/HlpMD4.pas @@ -5,14 +5,7 @@ interface uses -{$IFDEF DELPHI2010} - SysUtils, // to get rid of compiler hint "not inlined" on Delphi 2010. -{$ENDIF DELPHI2010} HlpMDBase, -{$IFDEF DELPHI} - HlpHashBuffer, - HlpHash, -{$ENDIF DELPHI} HlpBits, HlpConverters, HlpIHash, diff --git a/HashLib/src/Crypto/HlpMD5.pas b/HashLib/src/Crypto/HlpMD5.pas index 478903d..10bae3d 100644 --- a/HashLib/src/Crypto/HlpMD5.pas +++ b/HashLib/src/Crypto/HlpMD5.pas @@ -5,15 +5,8 @@ interface uses -{$IFDEF DELPHI2010} - SysUtils, // to get rid of compiler hint "not inlined" on Delphi 2010. -{$ENDIF DELPHI2010} HlpBits, HlpMDBase, -{$IFDEF DELPHI} - HlpHashBuffer, - HlpHash, -{$ENDIF DELPHI} HlpIHash, HlpConverters, HlpIHashInfo; diff --git a/HashLib/src/Crypto/HlpMDBase.pas b/HashLib/src/Crypto/HlpMDBase.pas index 30fa19e..e918904 100644 --- a/HashLib/src/Crypto/HlpMDBase.pas +++ b/HashLib/src/Crypto/HlpMDBase.pas @@ -5,13 +5,7 @@ interface uses -{$IFDEF DELPHI2010} - SysUtils, // to get rid of compiler hint "not inlined" on Delphi 2010. -{$ENDIF DELPHI2010} HlpHashLibTypes, -{$IFDEF DELPHI} - HlpHashBuffer, -{$ENDIF DELPHI} HlpIHashInfo, HlpHashCryptoNotBuildIn, HlpConverters; diff --git a/HashLib/src/Crypto/HlpPanama.pas b/HashLib/src/Crypto/HlpPanama.pas index 2667d26..b40c100 100644 --- a/HashLib/src/Crypto/HlpPanama.pas +++ b/HashLib/src/Crypto/HlpPanama.pas @@ -7,10 +7,6 @@ interface uses HlpHashLibTypes, HlpBits, -{$IFDEF DELPHI} - HlpHashBuffer, - HlpHash, -{$ENDIF DELPHI} HlpConverters, HlpIHash, HlpIHashInfo, diff --git a/HashLib/src/Crypto/HlpRIPEMD.pas b/HashLib/src/Crypto/HlpRIPEMD.pas index c222008..ffc00f4 100644 --- a/HashLib/src/Crypto/HlpRIPEMD.pas +++ b/HashLib/src/Crypto/HlpRIPEMD.pas @@ -5,14 +5,7 @@ interface uses -{$IFDEF DELPHI2010} - SysUtils, // to get rid of compiler hint "not inlined" on Delphi 2010. -{$ENDIF DELPHI2010} HlpBits, -{$IFDEF DELPHI} - HlpHashBuffer, - HlpHash, -{$ENDIF DELPHI} HlpMDBase, HlpConverters, HlpIHash, diff --git a/HashLib/src/Crypto/HlpRIPEMD128.pas b/HashLib/src/Crypto/HlpRIPEMD128.pas index 39cbcd3..9d35646 100644 --- a/HashLib/src/Crypto/HlpRIPEMD128.pas +++ b/HashLib/src/Crypto/HlpRIPEMD128.pas @@ -5,14 +5,7 @@ interface uses -{$IFDEF DELPHI2010} - SysUtils, // to get rid of compiler hint "not inlined" on Delphi 2010. -{$ENDIF DELPHI2010} HlpMDBase, -{$IFDEF DELPHI} - HlpHashBuffer, - HlpHash, -{$ENDIF DELPHI} HlpBits, HlpConverters, HlpIHash, diff --git a/HashLib/src/Crypto/HlpRIPEMD160.pas b/HashLib/src/Crypto/HlpRIPEMD160.pas index 2692472..b5e05a6 100644 --- a/HashLib/src/Crypto/HlpRIPEMD160.pas +++ b/HashLib/src/Crypto/HlpRIPEMD160.pas @@ -5,14 +5,7 @@ interface uses -{$IFDEF DELPHI2010} - SysUtils, // to get rid of compiler hint "not inlined" on Delphi 2010. -{$ENDIF DELPHI2010} HlpMDBase, -{$IFDEF DELPHI} - HlpHashBuffer, - HlpHash, -{$ENDIF DELPHI} HlpBits, HlpConverters, HlpIHash, diff --git a/HashLib/src/Crypto/HlpRIPEMD256.pas b/HashLib/src/Crypto/HlpRIPEMD256.pas index 60838c1..9418dda 100644 --- a/HashLib/src/Crypto/HlpRIPEMD256.pas +++ b/HashLib/src/Crypto/HlpRIPEMD256.pas @@ -5,15 +5,8 @@ interface uses -{$IFDEF DELPHI2010} - SysUtils, // to get rid of compiler hint "not inlined" on Delphi 2010. -{$ENDIF DELPHI2010} HlpMDBase, HlpBits, -{$IFDEF DELPHI} - HlpHashBuffer, - HlpHash, -{$ENDIF DELPHI} HlpConverters, HlpIHash, HlpIHashInfo; diff --git a/HashLib/src/Crypto/HlpRIPEMD320.pas b/HashLib/src/Crypto/HlpRIPEMD320.pas index 741750d..2d6faab 100644 --- a/HashLib/src/Crypto/HlpRIPEMD320.pas +++ b/HashLib/src/Crypto/HlpRIPEMD320.pas @@ -5,14 +5,7 @@ interface uses -{$IFDEF DELPHI2010} - SysUtils, // to get rid of compiler hint "not inlined" on Delphi 2010. -{$ENDIF DELPHI2010} HlpMDBase, -{$IFDEF DELPHI} - HlpHashBuffer, - HlpHash, -{$ENDIF DELPHI} HlpBits, HlpConverters, HlpIHash, diff --git a/HashLib/src/Crypto/HlpRadioGatun32.pas b/HashLib/src/Crypto/HlpRadioGatun32.pas index 602dbfc..5d53172 100644 --- a/HashLib/src/Crypto/HlpRadioGatun32.pas +++ b/HashLib/src/Crypto/HlpRadioGatun32.pas @@ -6,10 +6,6 @@ interface uses HlpHashLibTypes, -{$IFDEF DELPHI} - HlpHashBuffer, - HlpHash, -{$ENDIF DELPHI} HlpBits, HlpConverters, HlpIHash, diff --git a/HashLib/src/Crypto/HlpRadioGatun64.pas b/HashLib/src/Crypto/HlpRadioGatun64.pas index 6fc2e82..bb71913 100644 --- a/HashLib/src/Crypto/HlpRadioGatun64.pas +++ b/HashLib/src/Crypto/HlpRadioGatun64.pas @@ -6,10 +6,6 @@ interface uses HlpHashLibTypes, -{$IFDEF DELPHI} - HlpHashBuffer, - HlpHash, -{$ENDIF DELPHI} HlpBits, HlpConverters, HlpIHash, diff --git a/HashLib/src/Crypto/HlpSHA0.pas b/HashLib/src/Crypto/HlpSHA0.pas index 860e254..2824103 100644 --- a/HashLib/src/Crypto/HlpSHA0.pas +++ b/HashLib/src/Crypto/HlpSHA0.pas @@ -5,14 +5,7 @@ interface uses -{$IFDEF DELPHI2010} - SysUtils, // to get rid of compiler hint "not inlined" on Delphi 2010. -{$ENDIF DELPHI2010} HlpBits, -{$IFDEF DELPHI} - HlpHashBuffer, - HlpHash, -{$ENDIF DELPHI} HlpHashLibTypes, HlpConverters, HlpIHash, diff --git a/HashLib/src/Crypto/HlpSHA1.pas b/HashLib/src/Crypto/HlpSHA1.pas index d49ed71..567dce0 100644 --- a/HashLib/src/Crypto/HlpSHA1.pas +++ b/HashLib/src/Crypto/HlpSHA1.pas @@ -6,10 +6,6 @@ interface uses HlpBits, -{$IFDEF DELPHI} - HlpHashBuffer, - HlpHash, -{$ENDIF DELPHI} HlpSHA0, HlpIHash; diff --git a/HashLib/src/Crypto/HlpSHA2_224.pas b/HashLib/src/Crypto/HlpSHA2_224.pas index eca5983..7cae3f2 100644 --- a/HashLib/src/Crypto/HlpSHA2_224.pas +++ b/HashLib/src/Crypto/HlpSHA2_224.pas @@ -5,14 +5,7 @@ interface uses -{$IFDEF DELPHI2010} - SysUtils, // to get rid of compiler hint "not inlined" on Delphi 2010. -{$ENDIF DELPHI2010} HlpHashLibTypes, -{$IFDEF DELPHI} - HlpHashBuffer, - HlpHash, -{$ENDIF DELPHI} HlpSHA2_256Base, HlpIHash, HlpConverters; diff --git a/HashLib/src/Crypto/HlpSHA2_256.pas b/HashLib/src/Crypto/HlpSHA2_256.pas index 66fabc6..df0ada7 100644 --- a/HashLib/src/Crypto/HlpSHA2_256.pas +++ b/HashLib/src/Crypto/HlpSHA2_256.pas @@ -5,14 +5,7 @@ interface uses -{$IFDEF DELPHI2010} - SysUtils, // to get rid of compiler hint "not inlined" on Delphi 2010. -{$ENDIF DELPHI2010} HlpHashLibTypes, -{$IFDEF DELPHI} - HlpHashBuffer, - HlpHash, -{$ENDIF DELPHI} HlpIHash, HlpSHA2_256Base, HlpConverters; diff --git a/HashLib/src/Crypto/HlpSHA2_256Base.pas b/HashLib/src/Crypto/HlpSHA2_256Base.pas index 723ba0c..d4f9477 100644 --- a/HashLib/src/Crypto/HlpSHA2_256Base.pas +++ b/HashLib/src/Crypto/HlpSHA2_256Base.pas @@ -5,13 +5,7 @@ interface uses -{$IFDEF DELPHI2010} - SysUtils, // to get rid of compiler hint "not inlined" on Delphi 2010. -{$ENDIF DELPHI2010} HlpHashLibTypes, -{$IFDEF DELPHI} - HlpHashBuffer, -{$ENDIF DELPHI} HlpBits, HlpConverters, HlpIHashInfo, diff --git a/HashLib/src/Crypto/HlpSHA2_384.pas b/HashLib/src/Crypto/HlpSHA2_384.pas index 77b31e5..3c17f58 100644 --- a/HashLib/src/Crypto/HlpSHA2_384.pas +++ b/HashLib/src/Crypto/HlpSHA2_384.pas @@ -5,14 +5,7 @@ interface uses -{$IFDEF DELPHI2010} - SysUtils, // to get rid of compiler hint "not inlined" on Delphi 2010. -{$ENDIF DELPHI2010} HlpHashLibTypes, -{$IFDEF DELPHI} - HlpHashBuffer, - HlpHash, -{$ENDIF DELPHI} HlpIHash, HlpSHA2_512Base, HlpConverters; diff --git a/HashLib/src/Crypto/HlpSHA2_512.pas b/HashLib/src/Crypto/HlpSHA2_512.pas index 2e012e0..e1fb574 100644 --- a/HashLib/src/Crypto/HlpSHA2_512.pas +++ b/HashLib/src/Crypto/HlpSHA2_512.pas @@ -5,14 +5,7 @@ interface uses -{$IFDEF DELPHI2010} - SysUtils, // to get rid of compiler hint "not inlined" on Delphi 2010. -{$ENDIF DELPHI2010} HlpHashLibTypes, -{$IFDEF DELPHI} - HlpHashBuffer, - HlpHash, -{$ENDIF DELPHI} HlpIHash, HlpSHA2_512Base, HlpConverters; diff --git a/HashLib/src/Crypto/HlpSHA2_512Base.pas b/HashLib/src/Crypto/HlpSHA2_512Base.pas index ad7154b..334d3ef 100644 --- a/HashLib/src/Crypto/HlpSHA2_512Base.pas +++ b/HashLib/src/Crypto/HlpSHA2_512Base.pas @@ -5,13 +5,7 @@ interface uses -{$IFDEF DELPHI2010} - SysUtils, // to get rid of compiler hint "not inlined" on Delphi 2010. -{$ENDIF DELPHI2010} HlpHashLibTypes, -{$IFDEF DELPHI} - HlpHashBuffer, -{$ENDIF DELPHI} HlpBits, HlpConverters, HlpIHashInfo, diff --git a/HashLib/src/Crypto/HlpSHA2_512_224.pas b/HashLib/src/Crypto/HlpSHA2_512_224.pas index c95742e..f9348af 100644 --- a/HashLib/src/Crypto/HlpSHA2_512_224.pas +++ b/HashLib/src/Crypto/HlpSHA2_512_224.pas @@ -5,14 +5,7 @@ interface uses -{$IFDEF DELPHI2010} - SysUtils, // to get rid of compiler hint "not inlined" on Delphi 2010. -{$ENDIF DELPHI2010} HlpHashLibTypes, -{$IFDEF DELPHI} - HlpHashBuffer, - HlpHash, -{$ENDIF DELPHI} HlpIHash, HlpSHA2_512Base, HlpConverters; diff --git a/HashLib/src/Crypto/HlpSHA2_512_256.pas b/HashLib/src/Crypto/HlpSHA2_512_256.pas index e58aab4..a899f14 100644 --- a/HashLib/src/Crypto/HlpSHA2_512_256.pas +++ b/HashLib/src/Crypto/HlpSHA2_512_256.pas @@ -5,14 +5,7 @@ interface uses -{$IFDEF DELPHI2010} - SysUtils, // to get rid of compiler hint "not inlined" on Delphi 2010. -{$ENDIF DELPHI2010} HlpHashLibTypes, -{$IFDEF DELPHI} - HlpHashBuffer, - HlpHash, -{$ENDIF DELPHI} HlpIHash, HlpSHA2_512Base, HlpConverters; diff --git a/HashLib/src/Crypto/HlpSHA3.pas b/HashLib/src/Crypto/HlpSHA3.pas index 19f6beb..a0ac80a 100644 --- a/HashLib/src/Crypto/HlpSHA3.pas +++ b/HashLib/src/Crypto/HlpSHA3.pas @@ -8,9 +8,6 @@ interface SysUtils, HlpBits, HlpHash, -{$IFDEF DELPHI} - HlpHashBuffer, -{$ENDIF DELPHI} HlpIHashInfo, HlpIHash, HlpHashResult, diff --git a/HashLib/src/Crypto/HlpSnefru.pas b/HashLib/src/Crypto/HlpSnefru.pas index 82665f8..9056a6f 100644 --- a/HashLib/src/Crypto/HlpSnefru.pas +++ b/HashLib/src/Crypto/HlpSnefru.pas @@ -7,10 +7,6 @@ interface uses SysUtils, HlpHashLibTypes, -{$IFDEF DELPHI} - HlpHash, - HlpHashBuffer, -{$ENDIF DELPHI} HlpBits, HlpHashSize, HlpConverters, diff --git a/HashLib/src/Crypto/HlpTiger.pas b/HashLib/src/Crypto/HlpTiger.pas index ff23fc5..2175e1e 100644 --- a/HashLib/src/Crypto/HlpTiger.pas +++ b/HashLib/src/Crypto/HlpTiger.pas @@ -6,10 +6,6 @@ interface uses SysUtils, -{$IFDEF DELPHI} - HlpHash, - HlpHashBuffer, -{$ENDIF DELPHI} HlpHashLibTypes, HlpConverters, HlpHashRounds, diff --git a/HashLib/src/Crypto/HlpTiger2.pas b/HashLib/src/Crypto/HlpTiger2.pas index f42c3b4..2fce99a 100644 --- a/HashLib/src/Crypto/HlpTiger2.pas +++ b/HashLib/src/Crypto/HlpTiger2.pas @@ -6,10 +6,6 @@ interface uses SysUtils, -{$IFDEF DELPHI} - HlpHash, - HlpHashBuffer, -{$ENDIF DELPHI} HlpHashLibTypes, HlpConverters, HlpHashRounds, diff --git a/HashLib/src/Crypto/HlpWhirlPool.pas b/HashLib/src/Crypto/HlpWhirlPool.pas index 1a6ec12..ec857ad 100644 --- a/HashLib/src/Crypto/HlpWhirlPool.pas +++ b/HashLib/src/Crypto/HlpWhirlPool.pas @@ -5,14 +5,7 @@ interface uses -{$IFDEF DELPHI2010} - SysUtils, // to get rid of compiler hint "not inlined" on Delphi 2010. -{$ENDIF DELPHI2010} HlpHashLibTypes, -{$IFDEF DELPHI} - HlpHashBuffer, - HlpHash, -{$ENDIF DELPHI} HlpConverters, HlpIHash, HlpIHashInfo, diff --git a/HashLib/src/Hash128/HlpMurmurHash3_x64_128.pas b/HashLib/src/Hash128/HlpMurmurHash3_x64_128.pas index c5f5190..a71e434 100644 --- a/HashLib/src/Hash128/HlpMurmurHash3_x64_128.pas +++ b/HashLib/src/Hash128/HlpMurmurHash3_x64_128.pas @@ -5,13 +5,9 @@ interface uses -{$IFDEF DELPHI2010} - SysUtils, // to get rid of compiler hint "not inlined" on Delphi 2010. -{$ENDIF DELPHI2010} HlpHashLibTypes, HlpConverters, HlpIHashInfo, - HlpNullable, HlpHash, HlpIHash, HlpHashResult, @@ -40,24 +36,15 @@ TMurmurHash3_x64_128 = class sealed(THash, IHash128, IHashWithKey, const CKEY = UInt32($0); - -{$IFDEF FPC} // to bypass Internal error (200706094) on FPC, We use "Typed Constant". - C1: UInt64 = UInt64($87C37B91114253D5); C5: UInt64 = UInt64($FF51AFD7ED558CCD); C6: UInt64 = UInt64($C4CEB9FE1A85EC53); - -{$ELSE} - C1 = UInt64($87C37B91114253D5); - C5 = UInt64($FF51AFD7ED558CCD); - C6 = UInt64($C4CEB9FE1A85EC53); -{$ENDIF FPC} C2 = UInt64($4CF5AD432745937F); C3 = UInt32($52DCE729); C4 = UInt32($38495AB5); {$ENDREGION} - function GetKeyLength(): TNullableInteger; + function GetKeyLength(): Int32; function GetKey: THashLibByteArray; inline; procedure SetKey(const AValue: THashLibByteArray); inline; @@ -68,7 +55,7 @@ TMurmurHash3_x64_128 = class sealed(THash, IHash128, IHashWithKey, AIndex, ALength: Int32); override; function TransformFinal: IHashResult; override; function Clone(): IHash; override; - property KeyLength: TNullableInteger read GetKeyLength; + property KeyLength: Int32 read GetKeyLength; property Key: THashLibByteArray read GetKey write SetKey; end; @@ -378,7 +365,7 @@ function TMurmurHash3_x64_128.GetKey: THashLibByteArray; result := TConverters.ReadUInt32AsBytesLE(FKey); end; -function TMurmurHash3_x64_128.GetKeyLength: TNullableInteger; +function TMurmurHash3_x64_128.GetKeyLength: Int32; begin result := 4; end; @@ -400,10 +387,10 @@ procedure TMurmurHash3_x64_128.SetKey(const AValue: THashLibByteArray); end else begin - if System.length(AValue) <> KeyLength.value then + if System.length(AValue) <> KeyLength then begin raise EArgumentHashLibException.CreateResFmt(@SInvalidKeyLength, - [KeyLength.value]); + [KeyLength]); end; FKey := TConverters.ReadBytesAsUInt32LE(PByte(AValue), 0); end; diff --git a/HashLib/src/Hash128/HlpMurmurHash3_x86_128.pas b/HashLib/src/Hash128/HlpMurmurHash3_x86_128.pas index 42ea60f..d4749bf 100644 --- a/HashLib/src/Hash128/HlpMurmurHash3_x86_128.pas +++ b/HashLib/src/Hash128/HlpMurmurHash3_x86_128.pas @@ -5,13 +5,9 @@ interface uses -{$IFDEF DELPHI2010} - SysUtils, // to get rid of compiler hint "not inlined" on Delphi 2010. -{$ENDIF DELPHI2010} HlpHashLibTypes, HlpConverters, HlpIHashInfo, - HlpNullable, HlpHash, HlpIHash, HlpHashResult, @@ -53,7 +49,7 @@ TMurmurHash3_x86_128 = class sealed(THash, IHash128, IHashWithKey, C10 = UInt32($32AC3B17); {$ENDREGION} - function GetKeyLength(): TNullableInteger; + function GetKeyLength(): Int32; function GetKey: THashLibByteArray; inline; procedure SetKey(const AValue: THashLibByteArray); inline; @@ -64,7 +60,7 @@ TMurmurHash3_x86_128 = class sealed(THash, IHash128, IHashWithKey, AIndex, ALength: Int32); override; function TransformFinal: IHashResult; override; function Clone(): IHash; override; - property KeyLength: TNullableInteger read GetKeyLength; + property KeyLength: Int32 read GetKeyLength; property Key: THashLibByteArray read GetKey write SetKey; end; @@ -428,7 +424,7 @@ function TMurmurHash3_x86_128.GetKey: THashLibByteArray; result := TConverters.ReadUInt32AsBytesLE(FKey); end; -function TMurmurHash3_x86_128.GetKeyLength: TNullableInteger; +function TMurmurHash3_x86_128.GetKeyLength: Int32; begin result := 4; end; @@ -452,10 +448,10 @@ procedure TMurmurHash3_x86_128.SetKey(const AValue: THashLibByteArray); end else begin - if System.length(AValue) <> KeyLength.value then + if System.length(AValue) <> KeyLength then begin raise EArgumentHashLibException.CreateResFmt(@SInvalidKeyLength, - [KeyLength.value]); + [KeyLength]); end; FKey := TConverters.ReadBytesAsUInt32LE(PByte(AValue), 0); end; diff --git a/HashLib/src/Hash128/HlpSipHash128.pas b/HashLib/src/Hash128/HlpSipHash128.pas index 54dfbdb..9febd12 100644 --- a/HashLib/src/Hash128/HlpSipHash128.pas +++ b/HashLib/src/Hash128/HlpSipHash128.pas @@ -5,9 +5,6 @@ interface uses -{$IFDEF DELPHI} - HlpHash, -{$ENDIF DELPHI} HlpIHash, HlpSipHash; diff --git a/HashLib/src/Hash32/HlpDEK.pas b/HashLib/src/Hash32/HlpDEK.pas index 5938782..6b7d4c2 100644 --- a/HashLib/src/Hash32/HlpDEK.pas +++ b/HashLib/src/Hash32/HlpDEK.pas @@ -6,9 +6,6 @@ interface uses HlpHashLibTypes, -{$IFDEF DELPHI} - HlpHash, -{$ENDIF DELPHI} HlpBits, HlpIHash, HlpIHashInfo, diff --git a/HashLib/src/Hash32/HlpJenkins3.pas b/HashLib/src/Hash32/HlpJenkins3.pas index 0d8b248..56e7d54 100644 --- a/HashLib/src/Hash32/HlpJenkins3.pas +++ b/HashLib/src/Hash32/HlpJenkins3.pas @@ -6,9 +6,6 @@ interface uses HlpHashLibTypes, -{$IFDEF DELPHI} - HlpHash, -{$ENDIF DELPHI} HlpBits, HlpIHash, HlpIHashInfo, diff --git a/HashLib/src/Hash32/HlpMurmur2.pas b/HashLib/src/Hash32/HlpMurmur2.pas index 79f1232..1cb0ae9 100644 --- a/HashLib/src/Hash32/HlpMurmur2.pas +++ b/HashLib/src/Hash32/HlpMurmur2.pas @@ -5,20 +5,13 @@ interface uses -{$IFDEF DELPHI2010} - SysUtils, // to get rid of compiler hint "not inlined" on Delphi 2010. -{$ENDIF DELPHI2010} HlpHashLibTypes, -{$IFDEF DELPHI} - HlpHash, -{$ENDIF DELPHI} HlpIHash, HlpConverters, HlpIHashInfo, HlpHashResult, HlpIHashResult, - HlpMultipleTransformNonBlock, - HlpNullable; + HlpMultipleTransformNonBlock; resourcestring SInvalidKeyLength = 'KeyLength Must Be Equal to %d'; @@ -37,7 +30,7 @@ TMurmur2 = class sealed(TMultipleTransformNonBlock, IHash32, IHashWithKey, M = UInt32($5BD1E995); R = Int32(24); - function GetKeyLength(): TNullableInteger; + function GetKeyLength(): Int32; function GetKey: THashLibByteArray; inline; procedure SetKey(const AValue: THashLibByteArray); inline; @@ -49,7 +42,7 @@ TMurmur2 = class sealed(TMultipleTransformNonBlock, IHash32, IHashWithKey, constructor Create(); procedure Initialize(); override; function Clone(): IHash; override; - property KeyLength: TNullableInteger read GetKeyLength; + property KeyLength: Int32 read GetKeyLength; property Key: THashLibByteArray read GetKey write SetKey; end; @@ -77,16 +70,16 @@ procedure TMurmur2.SetKey(const AValue: THashLibByteArray); end else begin - if System.Length(AValue) <> KeyLength.value then + if System.Length(AValue) <> KeyLength then begin raise EArgumentHashLibException.CreateResFmt(@SInvalidKeyLength, - [KeyLength.value]); + [KeyLength]); end; FKey := TConverters.ReadBytesAsUInt32LE(PByte(AValue), 0); end; end; -function TMurmur2.GetKeyLength: TNullableInteger; +function TMurmur2.GetKeyLength: Int32; begin result := 4; end; diff --git a/HashLib/src/Hash32/HlpMurmurHash3_x86_32.pas b/HashLib/src/Hash32/HlpMurmurHash3_x86_32.pas index 4d9e721..2c4f411 100644 --- a/HashLib/src/Hash32/HlpMurmurHash3_x86_32.pas +++ b/HashLib/src/Hash32/HlpMurmurHash3_x86_32.pas @@ -5,13 +5,9 @@ interface uses -{$IFDEF DELPHI2010} - SysUtils, // to get rid of compiler hint "not inlined" on Delphi 2010. -{$ENDIF DELPHI2010} HlpHashLibTypes, HlpConverters, HlpIHashInfo, - HlpNullable, HlpHash, HlpIHash, HlpHashResult, @@ -44,7 +40,7 @@ TMurmurHash3_x86_32 = class sealed(THash, IHash32, IHashWithKey, C4 = UInt32($85EBCA6B); C5 = UInt32($C2B2AE35); - function GetKeyLength(): TNullableInteger; + function GetKeyLength(): Int32; function GetKey: THashLibByteArray; inline; procedure SetKey(const AValue: THashLibByteArray); inline; @@ -55,7 +51,7 @@ TMurmurHash3_x86_32 = class sealed(THash, IHash32, IHashWithKey, AIndex, ALength: Int32); override; function TransformFinal: IHashResult; override; function Clone(): IHash; override; - property KeyLength: TNullableInteger read GetKeyLength; + property KeyLength: Int32 read GetKeyLength; property Key: THashLibByteArray read GetKey write SetKey; end; @@ -181,16 +177,16 @@ procedure TMurmurHash3_x86_32.SetKey(const AValue: THashLibByteArray); end else begin - if System.Length(AValue) <> KeyLength.value then + if System.Length(AValue) <> KeyLength then begin raise EArgumentHashLibException.CreateResFmt(@SInvalidKeyLength, - [KeyLength.value]); + [KeyLength]); end; FKey := TConverters.ReadBytesAsUInt32LE(PByte(AValue), 0); end; end; -function TMurmurHash3_x86_32.GetKeyLength: TNullableInteger; +function TMurmurHash3_x86_32.GetKeyLength: Int32; begin result := 4; end; diff --git a/HashLib/src/Hash32/HlpSuperFast.pas b/HashLib/src/Hash32/HlpSuperFast.pas index ca919ad..29b7b9c 100644 --- a/HashLib/src/Hash32/HlpSuperFast.pas +++ b/HashLib/src/Hash32/HlpSuperFast.pas @@ -6,9 +6,6 @@ interface uses HlpHashLibTypes, -{$IFDEF DELPHI} - HlpHash, -{$ENDIF DELPHI} HlpIHash, HlpIHashInfo, HlpHashResult, diff --git a/HashLib/src/Hash32/HlpXXHash32.pas b/HashLib/src/Hash32/HlpXXHash32.pas index c8b3311..52612b0 100644 --- a/HashLib/src/Hash32/HlpXXHash32.pas +++ b/HashLib/src/Hash32/HlpXXHash32.pas @@ -12,7 +12,6 @@ interface HlpIHashInfo, HlpHashResult, HlpIHashResult, - HlpNullable, HlpBits; resourcestring @@ -35,7 +34,7 @@ TXXHash32 = class sealed(THash, IHash32, IHashWithKey, ITransformBlock) PRIME32_4 = UInt32(668265263); PRIME32_5 = UInt32(374761393); - function GetKeyLength(): TNullableInteger; + function GetKeyLength(): Int32; function GetKey: THashLibByteArray; inline; procedure SetKey(const AValue: THashLibByteArray); inline; @@ -64,7 +63,7 @@ TXXH_State = record AIndex, ALength: Int32); override; function TransformFinal(): IHashResult; override; function Clone(): IHash; override; - property KeyLength: TNullableInteger read GetKeyLength; + property KeyLength: Int32 read GetKeyLength; property Key: THashLibByteArray read GetKey write SetKey; end; @@ -111,7 +110,7 @@ function TXXHash32.GetKey: THashLibByteArray; result := TConverters.ReadUInt32AsBytesLE(FKey); end; -function TXXHash32.GetKeyLength: TNullableInteger; +function TXXHash32.GetKeyLength: Int32; begin result := 4; end; @@ -135,10 +134,10 @@ procedure TXXHash32.SetKey(const AValue: THashLibByteArray); end else begin - if System.Length(AValue) <> KeyLength.value then + if System.Length(AValue) <> KeyLength then begin raise EArgumentHashLibException.CreateResFmt(@SInvalidKeyLength, - [KeyLength.value]); + [KeyLength]); end; FKey := TConverters.ReadBytesAsUInt32LE(PByte(AValue), 0); end; diff --git a/HashLib/src/Hash64/HlpMurmur2_64.pas b/HashLib/src/Hash64/HlpMurmur2_64.pas index 2d49b21..ae51cef 100644 --- a/HashLib/src/Hash64/HlpMurmur2_64.pas +++ b/HashLib/src/Hash64/HlpMurmur2_64.pas @@ -6,16 +6,12 @@ interface uses HlpHashLibTypes, -{$IFDEF DELPHI} - HlpHash, -{$ENDIF DELPHI} HlpConverters, HlpIHash, HlpIHashInfo, HlpHashResult, HlpIHashResult, - HlpMultipleTransformNonBlock, - HlpNullable; + HlpMultipleTransformNonBlock; resourcestring SInvalidKeyLength = 'KeyLength Must Be Equal to %d'; @@ -31,17 +27,11 @@ TMurmur2_64 = class sealed(TMultipleTransformNonBlock, IHash64, IHashWithKey, const CKEY = UInt64($0); -{$IFDEF FPC} // to bypass Internal error (200706094) on FPC, We use "Typed Constant". - M: UInt64 = UInt64($C6A4A7935BD1E995); - -{$ELSE} - M = UInt64($C6A4A7935BD1E995); -{$ENDIF FPC} R = Int32(47); - function GetKeyLength(): TNullableInteger; + function GetKeyLength(): Int32; function GetKey: THashLibByteArray; inline; procedure SetKey(const AValue: THashLibByteArray); inline; @@ -53,7 +43,7 @@ TMurmur2_64 = class sealed(TMultipleTransformNonBlock, IHash64, IHashWithKey, constructor Create(); procedure Initialize(); override; function Clone(): IHash; override; - property KeyLength: TNullableInteger read GetKeyLength; + property KeyLength: Int32 read GetKeyLength; property Key: THashLibByteArray read GetKey write SetKey; end; @@ -223,7 +213,7 @@ function TMurmur2_64.GetKey: THashLibByteArray; result := TConverters.ReadUInt64AsBytesLE(FKey); end; -function TMurmur2_64.GetKeyLength: TNullableInteger; +function TMurmur2_64.GetKeyLength: Int32; begin result := 8; end; @@ -242,10 +232,10 @@ procedure TMurmur2_64.SetKey(const AValue: THashLibByteArray); end else begin - if System.length(AValue) <> KeyLength.value then + if System.length(AValue) <> KeyLength then begin raise EArgumentHashLibException.CreateResFmt(@SInvalidKeyLength, - [KeyLength.value]); + [KeyLength]); end; FKey := TConverters.ReadBytesAsUInt64LE(PByte(AValue), 0); end; diff --git a/HashLib/src/Hash64/HlpSipHash.pas b/HashLib/src/Hash64/HlpSipHash.pas index 651db54..b7562aa 100644 --- a/HashLib/src/Hash64/HlpSipHash.pas +++ b/HashLib/src/Hash64/HlpSipHash.pas @@ -5,14 +5,9 @@ interface uses - -{$IFDEF DELPHI2010} - SysUtils, // to get rid of compiler hint "not inlined" on Delphi 2010. -{$ENDIF DELPHI2010} HlpHashLibTypes, HlpConverters, HlpIHashInfo, - HlpNullable, HlpHash, HlpIHash, HlpHashResult, @@ -44,7 +39,7 @@ TSipHash = class abstract(THash, IHash64, IHashWithKey, ITransformBlock) function ProcessFinalBlock(): UInt64; procedure Finish(); - function GetKeyLength(): TNullableInteger; + function GetKeyLength(): Int32; function GetKey: THashLibByteArray; procedure SetKey(const AValue: THashLibByteArray); @@ -62,7 +57,7 @@ TSipHash = class abstract(THash, IHash64, IHashWithKey, ITransformBlock) procedure TransformBytes(const AData: THashLibByteArray; AIndex, ALength: Int32); override; function TransformFinal: IHashResult; override; - property KeyLength: TNullableInteger read GetKeyLength; + property KeyLength: Int32 read GetKeyLength; property Key: THashLibByteArray read GetKey write SetKey; end; @@ -262,7 +257,7 @@ function TSipHash.GetKey: THashLibByteArray; var LKey: THashLibByteArray; begin - System.SetLength(LKey, KeyLength.value); + System.SetLength(LKey, KeyLength); TConverters.ReadUInt64AsBytesLE(FKey0, LKey, 0); TConverters.ReadUInt64AsBytesLE(FKey1, LKey, 8); @@ -270,7 +265,7 @@ function TSipHash.GetKey: THashLibByteArray; Result := LKey; end; -function TSipHash.GetKeyLength: TNullableInteger; +function TSipHash.GetKeyLength: Int32; begin Result := 16; end; @@ -309,10 +304,10 @@ procedure TSipHash.SetKey(const AValue: THashLibByteArray); end else begin - if System.Length(AValue) <> KeyLength.value then + if System.Length(AValue) <> KeyLength then begin raise EArgumentHashLibException.CreateResFmt(@SInvalidKeyLength, - [KeyLength.value]); + [KeyLength]); end; FKey0 := TConverters.ReadBytesAsUInt64LE(PByte(AValue), 0); diff --git a/HashLib/src/Hash64/HlpXXHash64.pas b/HashLib/src/Hash64/HlpXXHash64.pas index c843602..830dcb4 100644 --- a/HashLib/src/Hash64/HlpXXHash64.pas +++ b/HashLib/src/Hash64/HlpXXHash64.pas @@ -12,7 +12,6 @@ interface HlpIHashInfo, HlpHashResult, HlpIHashResult, - HlpNullable, HlpBits; resourcestring @@ -28,22 +27,14 @@ TXXHash64 = class sealed(THash, IHash64, IHashWithKey, ITransformBlock) const CKEY = UInt64(0); - -{$IFDEF FPC} // to bypass Internal error (200706094) on FPC, We use "Typed Constant". PRIME64_1: UInt64 = (11400714785074694791); PRIME64_2: UInt64 = (14029467366897019727); PRIME64_3: UInt64 = (1609587929392839161); PRIME64_4: UInt64 = (9650029242287828579); PRIME64_5: UInt64 = (2870177450012600261); -{$ELSE} - PRIME64_1 = UInt64(11400714785074694791); - PRIME64_2 = UInt64(14029467366897019727); - PRIME64_3 = UInt64(1609587929392839161); - PRIME64_4 = UInt64(9650029242287828579); - PRIME64_5 = UInt64(2870177450012600261); -{$ENDIF FPC} - function GetKeyLength(): TNullableInteger; + + function GetKeyLength(): Int32; function GetKey: THashLibByteArray; inline; procedure SetKey(const AValue: THashLibByteArray); inline; @@ -72,7 +63,7 @@ TXXH_State = record AIndex, ALength: Int32); override; function TransformFinal(): IHashResult; override; function Clone(): IHash; override; - property KeyLength: TNullableInteger read GetKeyLength; + property KeyLength: Int32 read GetKeyLength; property Key: THashLibByteArray read GetKey write SetKey; end; @@ -119,7 +110,7 @@ function TXXHash64.GetKey: THashLibByteArray; result := TConverters.ReadUInt64AsBytesLE(FKey); end; -function TXXHash64.GetKeyLength: TNullableInteger; +function TXXHash64.GetKeyLength: Int32; begin result := 8; end; @@ -143,10 +134,10 @@ procedure TXXHash64.SetKey(const AValue: THashLibByteArray); end else begin - if System.Length(AValue) <> KeyLength.value then + if System.Length(AValue) <> KeyLength then begin raise EArgumentHashLibException.CreateResFmt(@SInvalidKeyLength, - [KeyLength.value]); + [KeyLength]); end; FKey := TConverters.ReadBytesAsUInt64LE(PByte(AValue), 0); end; diff --git a/HashLib/src/Include/HashLib.inc b/HashLib/src/Include/HashLib.inc index c35dcd6..1f96646 100644 --- a/HashLib/src/Include/HashLib.inc +++ b/HashLib/src/Include/HashLib.inc @@ -35,21 +35,12 @@ {$DEFINE USE_UNROLLED_VARIANT} - {$IF CompilerVersion = 21.0} - {$DEFINE DELPHI2010} - {$IFEND} - - {$IF CompilerVersion >= 22.0} - {$DEFINE DELPHIXE_UP} - {$IFEND} - {$IF CompilerVersion >= 25.0} {$DEFINE SHIFT_OVERFLOW_BUG_FIXED} {$IFEND} {$IF CompilerVersion >= 28.0} {$DEFINE HASHLIB_USE_PPL} // Use Parallel Programming Library - {$DEFINE HAS_DELPHI_NET_ENCODING} {$IFEND} {$ENDIF} diff --git a/HashLib/src/Include/HashLibFPC.inc b/HashLib/src/Include/HashLibFPC.inc index 5b67a2a..b44ce71 100644 --- a/HashLib/src/Include/HashLibFPC.inc +++ b/HashLib/src/Include/HashLibFPC.inc @@ -17,6 +17,10 @@ {$MESSAGE ERROR 'This Library requires FreePascal 3.0.0 or higher.'} {$IFEND} + {$IFDEF ENDIAN_BIG} + {$MESSAGE FATAL 'This Library does not support "Big Endian" processors yet.'} + {$ENDIF} + {$IFDEF FPC_LITTLE_ENDIAN} {$DEFINE HASHLIB_LITTLE_ENDIAN} {$ENDIF} diff --git a/HashLib/src/Interfaces/HlpIHashInfo.pas b/HashLib/src/Interfaces/HlpIHashInfo.pas index 601702e..8e76ffb 100644 --- a/HashLib/src/Interfaces/HlpIHashInfo.pas +++ b/HashLib/src/Interfaces/HlpIHashInfo.pas @@ -8,8 +8,7 @@ interface HlpHashLibTypes, HlpIKDF, HlpIHash, - HlpArgon2TypeAndVersion, - HlpNullable; + HlpArgon2TypeAndVersion; type @@ -43,8 +42,8 @@ interface function GetKey(): THashLibByteArray; procedure SetKey(const AValue: THashLibByteArray); property Key: THashLibByteArray read GetKey write SetKey; - function GetKeyLength(): TNullableInteger; - property KeyLength: TNullableInteger read GetKeyLength; + function GetKeyLength(): Int32; + property KeyLength: Int32 read GetKeyLength; end; diff --git a/HashLib/src/Interfaces/HlpIHashResult.pas b/HashLib/src/Interfaces/HlpIHashResult.pas index 6687b64..a8bc2b3 100644 --- a/HashLib/src/Interfaces/HlpIHashResult.pas +++ b/HashLib/src/Interfaces/HlpIHashResult.pas @@ -19,8 +19,6 @@ interface function GetUInt64(): UInt64; function ToString(AGroup: Boolean = False): String; function Equals(const AHashResult: IHashResult): Boolean; overload; - function GetHashCode(): {$IFDEF DELPHI}Int32; {$ELSE}PtrInt; -{$ENDIF DELPHI} end; implementation diff --git a/HashLib/src/Nullable/HlpNullable.pas b/HashLib/src/Nullable/HlpNullable.pas deleted file mode 100644 index 5a72c47..0000000 --- a/HashLib/src/Nullable/HlpNullable.pas +++ /dev/null @@ -1,242 +0,0 @@ -unit HlpNullable; - -{$I ..\Include\HashLib.inc} -{ /* The "Nullable Types" found in this Unit were extracted from - https://github.com/jpluimers/Conferences/blob/master/2009/DelphiLive.2009/Nullable-types-in-Delphi-Win32/Delphi-generic/src/NullableTypes.pas - with some little modifications by me. */ } - -interface - -uses - TypInfo, - HlpHashLibTypes; - -resourcestring - SCannotAssignPointerToNullable = - 'Cannot assign non-null pointer to nullable type.'; - SUnsupportedType = - 'Unsupported Type: Only supports Integers, Int64, Floats and Strings.'; - SGetNullValue = 'Attempted to get a null value.'; - -type - - Nullable = record - private - var - fValue: T; - class function CastBack(const aValue): T; static; - class function AddFloat(const aFloat, bFloat): T; static; - class function AddString(const aString, bString): T; static; - class function AddInt64(const aInt64, bInt64): T; static; - class function NewAddInt(const aInt, bInt): T; static; - - var - fInitValue: string; - - var - fDefault: T; - - var - fInitDefault: string; - procedure SetValue(const aValue: T); inline; - procedure CheckValue; inline; - procedure CheckType; inline; - function GetValue: T; inline; - function GetIsNull: Boolean; inline; - function GetHasValue: Boolean; inline; - function GetHasDefault: Boolean; inline; - public - property Value: T read GetValue write SetValue; - property IsNull: Boolean read GetIsNull; - property HasValue: Boolean read GetHasValue; - property HasDefault: Boolean read GetHasDefault; - procedure ClearValue; - procedure SetDefault(const aDefault: T); - - constructor Create(const aValue: T); overload; - constructor Create(const aValue: T; const aDefault: T); overload; - - class operator Implicit(a: T): Nullable; - class operator Implicit(a: Nullable): T; - class operator Implicit(a: Pointer): Nullable; - class operator Explicit(aValue: Nullable): T; - - class operator Add(a, b: Nullable): Nullable; - end; - - /// - /// Represents a Nullable Integer. - /// - TNullableInteger = Nullable; - -implementation - -{ Nullable } - -function Nullable.GetHasDefault: Boolean; -begin - Result := fInitDefault = 'I'; -end; - -function Nullable.GetHasValue: Boolean; -begin - Result := not IsNull; -end; - -function Nullable.GetIsNull: Boolean; -begin - Result := fInitValue <> 'I'; -end; - -procedure Nullable.CheckType; -var - info: PTypeInfo; -begin - info := TypeInfo(T); - case info^.Kind of - tkInteger: - ; - tkFloat: - ; - tkString: - ; - tkInt64: - ; - tkUString: - ; - else - Raise EUnsupportedTypeHashLibException.CreateRes(@SUnsupportedType); - end; -end; - -procedure Nullable.CheckValue; -begin - if IsNull then - if HasDefault then - fValue := fDefault - else - raise ENullReferenceHashLibException.CreateRes(@SGetNullValue); -end; - -function Nullable.GetValue: T; -begin - CheckType; - CheckValue; - Result := fValue; -end; - -procedure Nullable.SetDefault(const aDefault: T); -begin - fDefault := aDefault; - fInitDefault := 'I'; - if IsNull then - fValue := aDefault; -end; - -procedure Nullable.SetValue(const aValue: T); -begin - fInitValue := 'I'; - fValue := aValue; -end; - -class operator Nullable.Implicit(a: Nullable): T; -begin - Result := a.Value; -end; - -class operator Nullable.Implicit(a: T): Nullable; -begin - Result.Value := a; -end; - -class operator Nullable.Implicit(a: Pointer): Nullable; -begin - if not System.Assigned(a) then - Result.ClearValue - else - raise EInvalidOperationHashLibException.CreateRes - (@SCannotAssignPointerToNullable); -end; - -// got the idea from Andreas Hausladen -class function Nullable.CastBack(const aValue): T; -begin - Result := T(aValue); -end; - -class function Nullable.AddInt64(const aInt64, bInt64): T; -var - Value: Int64; -begin - Value := Int64(aInt64) + Int64(bInt64); - Result := CastBack(Value); -end; - -class function Nullable.AddFloat(const aFloat, bFloat): T; -var - Value: Double; -begin - Value := Double(aFloat) + Double(bFloat); - Result := CastBack(Value); -end; - -class function Nullable.AddString(const aString, bString): T; -var - Value: String; -begin - Value := String(aString) + String(bString); - Result := CastBack(Value); -end; - -class function Nullable.NewAddInt(const aInt, bInt): T; -var - Value: Int32; -begin - Value := Int32(aInt) + Int32(bInt); - Result := CastBack(Value); -end; - -class operator Nullable.Add(a, b: Nullable): Nullable; -var - info: PTypeInfo; -begin - if a.IsNull or b.IsNull then - Result.ClearValue - else - begin - info := TypeInfo(T); - case info^.Kind of - tkInteger: - Result.Value := NewAddInt(a.fValue, b.fValue); - tkFloat: - Result.Value := AddFloat(a.fValue, b.fValue); - tkString: - Result.Value := AddString(a.fValue, b.fValue); - tkInt64: - Result.Value := AddInt64(a.fValue, b.fValue); - end; - end; -end; - -procedure Nullable.ClearValue; -begin - fInitValue := ''; -end; - -constructor Nullable.Create(const aValue: T); -begin - SetValue(aValue); -end; - -constructor Nullable.Create(const aValue, aDefault: T); -begin - SetValue(aValue); - SetDefault(aDefault); -end; - -class operator Nullable.Explicit(aValue: Nullable): T; -begin - Result := aValue.Value; -end; - -end. diff --git a/HashLib/src/Packages/Delphi/HashLib4PascalPackage.dpk b/HashLib/src/Packages/Delphi/HashLib4PascalPackage.dpk index 53eb84c..95309ad 100644 --- a/HashLib/src/Packages/Delphi/HashLib4PascalPackage.dpk +++ b/HashLib/src/Packages/Delphi/HashLib4PascalPackage.dpk @@ -32,8 +32,7 @@ package HashLib4PascalPackage; {$IMPLICITBUILD ON} requires - rtl, - soaprtl; + rtl; contains HlpHash in '..\..\Base\HlpHash.pas', @@ -128,7 +127,6 @@ contains HlpPBKDF_Argon2NotBuildInAdapter in '..\..\KDF\HlpPBKDF_Argon2NotBuildInAdapter.pas', HlpArgon2TypeAndVersion in '..\..\KDF\HlpArgon2TypeAndVersion.pas', HlpPBKDF_ScryptNotBuildInAdapter in '..\..\KDF\HlpPBKDF_ScryptNotBuildInAdapter.pas', - HlpNullable in '..\..\Nullable\HlpNullable.pas', HlpConverters in '..\..\Utils\HlpConverters.pas', HlpBitConverter in '..\..\Utils\HlpBitConverter.pas', HlpBits in '..\..\Utils\HlpBits.pas', diff --git a/HashLib/src/Packages/FPC/HashLib4PascalPackage.lpk b/HashLib/src/Packages/FPC/HashLib4PascalPackage.lpk index b56831d..9f907a1 100644 --- a/HashLib/src/Packages/FPC/HashLib4PascalPackage.lpk +++ b/HashLib/src/Packages/FPC/HashLib4PascalPackage.lpk @@ -23,7 +23,7 @@ "/> - + @@ -341,109 +341,105 @@ - - - - - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + diff --git a/HashLib/src/Packages/FPC/HashLib4PascalPackage.pas b/HashLib/src/Packages/FPC/HashLib4PascalPackage.pas index cec73b3..946a233 100644 --- a/HashLib/src/Packages/FPC/HashLib4PascalPackage.pas +++ b/HashLib/src/Packages/FPC/HashLib4PascalPackage.pas @@ -22,7 +22,7 @@ interface HlpMurmur2, HlpMurmurHash3_x86_32, HlpOneAtTime, HlpPJW, HlpRotating, HlpRS, HlpSDBM, HlpShiftAndXor, HlpSuperFast, HlpXXHash32, HlpFNV1a64, HlpFNV64, HlpMurmur2_64, HlpSipHash, HlpXXHash64, HlpIHash, HlpIHashInfo, - HlpIHashResult, HlpNullable, HlpConverters, HlpBitConverter, HlpBits, + HlpIHashResult, HlpConverters, HlpBitConverter, HlpBits, HlpHashLibTypes, HlpMurmurHash3_x86_128, HlpPBKDF2_HMACNotBuildInAdapter, HlpIKDF, HlpKDF, HlpICRC, HlpBlake2B, HlpBlake2S, HlpGOST3411_2012, HlpCRC32Fast, HlpArgon2TypeAndVersion, HlpPBKDF_Argon2NotBuildInAdapter, diff --git a/HashLib/src/Utils/HlpConverters.pas b/HashLib/src/Utils/HlpConverters.pas index 7c9dd7c..269d950 100644 --- a/HashLib/src/Utils/HlpConverters.pas +++ b/HashLib/src/Utils/HlpConverters.pas @@ -6,7 +6,6 @@ interface uses Classes, - StrUtils, SysUtils, HlpHashLibTypes, HlpBits, diff --git a/HashLib/src/Utils/HlpHashLibTypes.pas b/HashLib/src/Utils/HlpHashLibTypes.pas index b09c173..89111dc 100644 --- a/HashLib/src/Utils/HlpHashLibTypes.pas +++ b/HashLib/src/Utils/HlpHashLibTypes.pas @@ -38,43 +38,6 @@ EUnsupportedTypeHashLibException = class(EHashLibException); /// THashLibMatrixGenericArray = array of THashLibGenericArray; -{$IFDEF DELPHIXE_UP} - /// - /// Represents a dynamic array of UInt32. - /// - THashLibUInt32Array = TArray; - - /// - /// Represents a dynamic array of UInt64. - /// - THashLibUInt64Array = TArray; - - /// - /// Represents a dynamic array of String. - /// - THashLibStringArray = TArray; - - /// - /// Represents a dynamic array of Char. - /// - THashLibCharArray = TArray; - - /// - /// Represents a dynamic array of array of Byte. - /// - THashLibMatrixByteArray = TArray; - - /// - /// Represents a dynamic array of array of UInt32. - /// - THashLibMatrixUInt32Array = TArray; - - /// - /// Represents a dynamic array of array of UInt64. - /// - THashLibMatrixUInt64Array = TArray; - -{$ELSE} /// /// Represents a dynamic array of UInt32. /// @@ -109,7 +72,6 @@ EUnsupportedTypeHashLibException = class(EHashLibException); /// Represents a dynamic array of array of UInt64. /// THashLibMatrixUInt64Array = array of THashLibUInt64Array; -{$ENDIF DELPHIXE_UP} implementation