Browse Source

inc files refactoring

Ugochukwu Mmaduekwe 1 day ago
parent
commit
1d299df8f7

+ 2 - 5
CryptoLib/src/Crypto/Digests/ClpDigest.pas

@@ -122,13 +122,10 @@ var
   LowPoint, HighPoint: Int32;
   LowPoint, HighPoint: Int32;
 begin
 begin
   LName := FHash.Name;
   LName := FHash.Name;
-{$IFDEF DELPHIXE3_UP}
-  LowPoint := System.Low(LName);
-  HighPoint := System.High(LName);
-{$ELSE}
+
   LowPoint := 1;
   LowPoint := 1;
   HighPoint := System.Length(LName);
   HighPoint := System.Length(LName);
-{$ENDIF DELPHIXE3_UP}
+
   result := Copy(LName, LowPoint + 1, HighPoint - 1);
   result := Copy(LName, LowPoint + 1, HighPoint - 1);
 end;
 end;
 
 

+ 2 - 5
CryptoLib/src/Crypto/Macs/ClpKMac.pas

@@ -149,13 +149,10 @@ var
   LowPoint, HighPoint: Int32;
   LowPoint, HighPoint: Int32;
 begin
 begin
   LName := Self.ClassName;
   LName := Self.ClassName;
-{$IFDEF DELPHIXE3_UP}
-  LowPoint := System.Low(LName);
-  HighPoint := System.High(LName);
-{$ELSE}
+
   LowPoint := 1;
   LowPoint := 1;
   HighPoint := System.Length(LName);
   HighPoint := System.Length(LName);
-{$ENDIF DELPHIXE3_UP}
+
   result := Copy(LName, LowPoint + 1, HighPoint - 1);
   result := Copy(LName, LowPoint + 1, HighPoint - 1);
 end;
 end;
 
 

+ 7 - 210
CryptoLib/src/Include/CryptoLib.inc

@@ -15,224 +15,21 @@
 
 
 (* &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& *)
 (* &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& *)
 
 
-{$DEFINE DELPHI}
 
 
-(* &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& *)
+{---------------------------- Compiler Family Switch --------------------------}
 {$IFDEF FPC}
 {$IFDEF FPC}
-{$I CryptoLibHelper.inc} // Had to Include this Since Delphi Does not allow "FPC_FULLVERSION" to Compile.
-{$UNDEF DELPHI}
-{$MODE delphi}
-
-{$IFDEF CPU386}
-   {$DEFINE CRYPTOLIB_X86}
-{$ENDIF}
-
-{$IFDEF CPUX64}
-   {$DEFINE CRYPTOLIB_X86_64}
-{$ENDIF}
-
-{$IFDEF CPUARM}
-   {$DEFINE CRYPTOLIB_ARM}
-{$ENDIF}
-
-{$IFDEF CPUAARCH64}
-   {$DEFINE CRYPTOLIB_AARCH64}
-{$ENDIF}
-
-{$IFDEF IPHONESIM}
-   {$DEFINE CRYPTOLIB_IOSSIM}
-{$ENDIF}
-
-{$IF DEFINED(MSWINDOWS)}
-   {$DEFINE CRYPTOLIB_MSWINDOWS}
-{$ELSEIF DEFINED(UNIX)}
-   {$DEFINE CRYPTOLIB_UNIX}
-   {$IF DEFINED(BSD)}
-      {$IF DEFINED(DARWIN)}
-         {$DEFINE CRYPTOLIB_APPLE}
-         {$IF DEFINED(CRYPTOLIB_ARM) OR DEFINED(CRYPTOLIB_AARCH64)}
-            {$DEFINE CRYPTOLIB_IOS}
-         {$ELSE}
-            {$DEFINE CRYPTOLIB_MACOS}
-         {$IFEND}
-      {$ELSEIF DEFINED(FREEBSD) OR DEFINED(NETBSD) OR DEFINED(OPENBSD) OR DEFINED(DRAGONFLY)}
-         {$DEFINE CRYPTOLIB_GENERIC_BSD}
-      {$IFEND}
-  {$ELSEIF DEFINED(ANDROID)}
-     {$DEFINE CRYPTOLIB_ANDROID}
-  {$ELSEIF DEFINED(LINUX)}
-     {$DEFINE CRYPTOLIB_LINUX}
-  {$ELSEIF DEFINED(SOLARIS)}
-     {$DEFINE CRYPTOLIB_SOLARIS}
-  {$ELSE}
-     {$DEFINE CRYPTOLIB_UNDEFINED_UNIX_VARIANTS}
-  {$IFEND}
+  {$I CryptoLibFPC.inc} // FPC-specific settings
 {$ELSE}
 {$ELSE}
-   {$MESSAGE ERROR 'UNSUPPORTED TARGET.'}
-{$IFEND}
-
-{$IFDEF CRYPTOLIB_ANDROID}
-   {$DEFINE CRYPTOLIB_LINUX}
+  {$DEFINE DELPHI}
+  {$I ../../CryptoLib/src/Include/CryptoLibDelphi.inc} // Delphi-specific settings
 {$ENDIF}
 {$ENDIF}
 
 
-{$IF DEFINED(CRYPTOLIB_LINUX) OR DEFINED(CRYPTOLIB_SOLARIS)}
-   {$DEFINE CRYPTOLIB_HAS_GETRANDOM}
-{$IFEND}
-
-{$DEFINE USE_UNROLLED_VARIANT}
-
-// Disable Overflow and RangeChecks.
+{-------------------------- Common Compiler Settings --------------------------}
+{$SCOPEDENUMS ON}
 {$OVERFLOWCHECKS OFF}
 {$OVERFLOWCHECKS OFF}
 {$RANGECHECKS OFF}
 {$RANGECHECKS OFF}
-
-// Enable Pointer Math
 {$POINTERMATH ON}
 {$POINTERMATH ON}
-
-// Disable Warnings and Hints.
 {$WARNINGS OFF}
 {$WARNINGS OFF}
 {$HINTS OFF}
 {$HINTS OFF}
-{$NOTES OFF}
-
-// Optimizations
-{$OPTIMIZATION LEVEL3}
-// disable "USELOADMODIFYSTORE" because it produces incorrect result
-// when used in combination with -CpCOREAVX2 and -OpCOREAVX2 in FPC 3.2.0 beta
-{$IFDEF FPC_GREATER_THAN_3.0.4}
-   {$OPTIMIZATION NOUSELOADMODIFYSTORE}
-{$ENDIF}
-// level 4 optimizations
-{$OPTIMIZATION ORDERFIELDS}
-{$OPTIMIZATION DEADVALUES}
-
-{$IFDEF CPUI386}
-   {$OPTIMIZATION USEEBP}
-{$ENDIF}
-
-{$IFDEF CPUX86_64}
-   {$OPTIMIZATION USERBP}
-{$ENDIF}
-
-{$ENDIF FPC}
-
-(* &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& *)
-
-{$IFDEF DELPHI}
-
- // XE3 and Above
-{$IF CompilerVersion >= 24.0}
-   {$DEFINE DELPHIXE3_UP}
-   {$DEFINE SUPPORT_TSTREAM_READ_BYTEARRAY_OVERLOAD}
-   {$DEFINE SUPPORT_TSTREAM_WRITE_BYTEARRAY_OVERLOAD}
-   {$LEGACYIFEND ON}
-   {$ZEROBASEDSTRINGS OFF}
-{$IFEND}
-
-  // XE and Above
-{$IF CompilerVersion >= 22.0}
-   {$DEFINE DELPHIXE_UP}
-{$IFEND}
-
- // XE4 and Above
-{$IF CompilerVersion >= 25.0}
-   {$DEFINE DELPHIXE4_UP}
-   {$DEFINE SHIFT_OVERFLOW_BUG_FIXED}
-{$IFEND}
-
-  // 10.1 Berlin and Above
-{$IF CompilerVersion >= 31.0}
-   {$DEFINE DELPHI10.1_BERLIN_UP}
-   {$DEFINE HAS_VOLATILE}
-{$IFEND}
-
-  // 10.2 Tokyo and Above
-{$IF CompilerVersion >= 32.0}
-   {$DEFINE DELPHI10.2_TOKYO_UP}
-{$IFEND}
-
-  // 10.2 Tokyo and Above
-{$IFNDEF DELPHI10.2_TOKYO_UP}
-   {$MESSAGE ERROR 'This Library requires Delphi Tokyo or higher.'}
-{$ENDIF}
-
-{$IFDEF CPU386}
-   {$DEFINE CRYPTOLIB_X86}
-{$ENDIF}
-
-{$IFDEF CPUX64}
-   {$DEFINE CRYPTOLIB_X86_64}
-{$ENDIF}
-
-{$IFDEF CPUARM32}
-   {$DEFINE CRYPTOLIB_ARM}
-{$ENDIF}
-
-{$IFDEF CPUARM64}
-   {$DEFINE CRYPTOLIB_AARCH64}
-{$ENDIF}
-
-{$IFDEF IOS}
-  {$IFNDEF CPUARM}
-     {$DEFINE CRYPTOLIB_IOSSIM}
-  {$ENDIF}
-{$ENDIF}
-
-{$IFDEF IOS}
-   {$DEFINE CRYPTOLIB_IOS}
-{$ENDIF}
-
-{$IFDEF MSWINDOWS}
-   {$DEFINE CRYPTOLIB_MSWINDOWS}
-{$ENDIF}
-
-{$IFDEF MACOS}
-   {$IFNDEF IOS}
-      {$DEFINE CRYPTOLIB_MACOS}
-   {$ENDIF}
-{$ENDIF}
-
-{$IFDEF ANDROID}
-   {$DEFINE CRYPTOLIB_ANDROID}
-{$ENDIF}
-
-{$IF DEFINED(CRYPTOLIB_IOS) OR DEFINED(CRYPTOLIB_MACOS)}
-   {$DEFINE CRYPTOLIB_APPLE}
-{$IFEND}
-
-{$IF DEFINED(LINUX) OR DEFINED(CRYPTOLIB_ANDROID)}
-   {$DEFINE CRYPTOLIB_LINUX}
-{$IFEND}
-
-{$IFDEF CRYPTOLIB_LINUX}
-   {$DEFINE CRYPTOLIB_HAS_GETRANDOM}
-{$ENDIF}
-
-{$IF DEFINED(CRYPTOLIB_APPLE) OR DEFINED(CRYPTOLIB_LINUX)}
-   {$DEFINE CRYPTOLIB_UNIX}
-{$IFEND}
-
-{$DEFINE USE_UNROLLED_VARIANT}
-
-// This option is needed to enable code browsing (aka Ctrl+Click)
-// It does not affect the binary size or generated code
-{$DEFINITIONINFO ON}
-
-// Disable Overflow and RangeChecks.
-{$OVERFLOWCHECKS OFF}
-{$RANGECHECKS OFF}
-
- // Enable Pointer Math
-{$POINTERMATH ON}
-
-// Disable String Checks
-{$STRINGCHECKS OFF}
-
-// Disable Duplicate Constructor Warnings
-{$WARN DUPLICATE_CTOR_DTOR OFF}
-
-// Disable Deprecated Warnings
-{$WARN SYMBOL_DEPRECATED OFF}
-
-{$ENDIF DELPHI}
-
-(* &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& *)
 
 
+(* &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& *)

+ 105 - 0
CryptoLib/src/Include/CryptoLibDelphi.inc

@@ -0,0 +1,105 @@
+{ *********************************************************************************** }
+{ *                              CryptoLib Library                                  * }
+{ *                Copyright (c) 2018 - 20XX Ugochukwu Mmaduekwe                    * }
+{ *                 Github Repository <https://github.com/Xor-el>                   * }
+
+{ *  Distributed under the MIT software license, see the accompanying file LICENSE  * }
+{ *          or visit http://www.opensource.org/licenses/mit-license.php.           * }
+
+{ *                              Acknowledgements:                                  * }
+{ *                                                                                 * }
+{ *      Thanks to Sphere 10 Software (http://www.sphere10.com/) for sponsoring     * }
+{ *                           development of this library                           * }
+
+{ * ******************************************************************************* * }
+
+(* &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& *)
+
+{$IFDEF DELPHI}
+  {$DEFINITIONINFO ON}       // IDE navigation; no binary impact
+  {$STRINGCHECKS OFF}
+  {$WARN DUPLICATE_CTOR_DTOR OFF}
+
+{$IF CompilerVersion < 32.0}
+   {$MESSAGE ERROR 'This Library requires Delphi Tokyo or higher.'}
+{$IFEND}
+
+  // XE and Above
+{$IF CompilerVersion >= 22.0}
+   {$DEFINE DELPHIXE_UP}
+{$IFEND}
+
+ // XE3 and Above
+{$IF CompilerVersion >= 24.0}
+   {$DEFINE SUPPORT_TSTREAM_READ_BYTEARRAY_OVERLOAD}
+   {$DEFINE SUPPORT_TSTREAM_WRITE_BYTEARRAY_OVERLOAD}
+{$IFEND}
+
+ // XE4 and Above
+{$IF CompilerVersion >= 25.0}
+   {$DEFINE SHIFT_OVERFLOW_BUG_FIXED}
+{$IFEND}
+
+  // 10.1 Berlin and Above
+{$IF CompilerVersion >= 31.0}
+   {$DEFINE HAS_VOLATILE}
+{$IFEND}
+
+{$IFDEF CPU386}
+   {$DEFINE CRYPTOLIB_X86}
+{$ENDIF}
+
+{$IFDEF CPUX64}
+   {$DEFINE CRYPTOLIB_X86_64}
+{$ENDIF}
+
+{$IFDEF CPUARM32}
+   {$DEFINE CRYPTOLIB_ARM}
+{$ENDIF}
+
+{$IFDEF CPUARM64}
+   {$DEFINE CRYPTOLIB_AARCH64}
+{$ENDIF}
+
+{$IFDEF IOS}
+  {$IFNDEF CPUARM}
+     {$DEFINE CRYPTOLIB_IOSSIM}
+  {$ENDIF}
+{$ENDIF}
+
+{$IFDEF IOS}
+   {$DEFINE CRYPTOLIB_IOS}
+{$ENDIF}
+
+{$IFDEF MSWINDOWS}
+   {$DEFINE CRYPTOLIB_MSWINDOWS}
+{$ENDIF}
+
+{$IFDEF MACOS}
+   {$IFNDEF IOS}
+      {$DEFINE CRYPTOLIB_MACOS}
+   {$ENDIF}
+{$ENDIF}
+
+{$IFDEF ANDROID}
+   {$DEFINE CRYPTOLIB_ANDROID}
+{$ENDIF}
+
+{$IF DEFINED(CRYPTOLIB_IOS) OR DEFINED(CRYPTOLIB_MACOS)}
+   {$DEFINE CRYPTOLIB_APPLE}
+{$IFEND}
+
+{$IF DEFINED(LINUX) OR DEFINED(CRYPTOLIB_ANDROID)}
+   {$DEFINE CRYPTOLIB_LINUX}
+{$IFEND}
+
+{$IFDEF CRYPTOLIB_LINUX}
+   {$DEFINE CRYPTOLIB_HAS_GETRANDOM}
+{$ENDIF}
+
+{$IF DEFINED(CRYPTOLIB_APPLE) OR DEFINED(CRYPTOLIB_LINUX)}
+   {$DEFINE CRYPTOLIB_UNIX}
+{$IFEND}
+
+{$ENDIF}
+

+ 100 - 0
CryptoLib/src/Include/CryptoLibFPC.inc

@@ -0,0 +1,100 @@
+{ *********************************************************************************** }
+{ *                              CryptoLib Library                                  * }
+{ *                Copyright (c) 2018 - 20XX Ugochukwu Mmaduekwe                    * }
+{ *                 Github Repository <https://github.com/Xor-el>                   * }
+
+{ *  Distributed under the MIT software license, see the accompanying file LICENSE  * }
+{ *          or visit http://www.opensource.org/licenses/mit-license.php.           * }
+
+{ *                              Acknowledgements:                                  * }
+{ *                                                                                 * }
+{ *      Thanks to Sphere 10 Software (http://www.sphere10.com/) for sponsoring     * }
+{ *                           development of this library                           * }
+
+{ * ******************************************************************************* * }
+
+(* &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& *)
+
+{$IFDEF FPC}
+{$IFDEF ENDIAN_BIG}
+   {$MESSAGE FATAL 'This Library does not support "Big Endian" processors yet.'}
+{$ENDIF}
+
+{$IF FPC_FULLVERSION < 30004}
+   {$MESSAGE ERROR 'This Library requires FreePascal 3.0.4 or higher.'}
+{$IFEND}
+
+{$IF FPC_FULLVERSION >= 30301}
+   {$DEFINE HAS_VOLATILE}
+{$IFEND}
+
+{$IFDEF CPU386}
+   {$DEFINE CRYPTOLIB_X86}
+{$ENDIF}
+
+{$IFDEF CPUX64}
+   {$DEFINE CRYPTOLIB_X86_64}
+{$ENDIF}
+
+{$IFDEF CPUARM}
+   {$DEFINE CRYPTOLIB_ARM}
+{$ENDIF}
+
+{$IFDEF CPUAARCH64}
+   {$DEFINE CRYPTOLIB_AARCH64}
+{$ENDIF}
+
+{$IFDEF IPHONESIM}
+   {$DEFINE CRYPTOLIB_IOSSIM}
+{$ENDIF}
+
+{$IF DEFINED(MSWINDOWS)}
+   {$DEFINE CRYPTOLIB_MSWINDOWS}
+{$ELSEIF DEFINED(UNIX)}
+   {$DEFINE CRYPTOLIB_UNIX}
+   {$IF DEFINED(BSD)}
+      {$IF DEFINED(DARWIN)}
+         {$DEFINE CRYPTOLIB_APPLE}
+         {$IF DEFINED(CRYPTOLIB_ARM) OR DEFINED(CRYPTOLIB_AARCH64)}
+            {$DEFINE CRYPTOLIB_IOS}
+         {$ELSE}
+            {$DEFINE CRYPTOLIB_MACOS}
+         {$IFEND}
+      {$ELSEIF DEFINED(FREEBSD) OR DEFINED(NETBSD) OR DEFINED(OPENBSD) OR DEFINED(DRAGONFLY)}
+         {$DEFINE CRYPTOLIB_GENERIC_BSD}
+      {$IFEND}
+  {$ELSEIF DEFINED(ANDROID)}
+     {$DEFINE CRYPTOLIB_ANDROID}
+  {$ELSEIF DEFINED(LINUX)}
+     {$DEFINE CRYPTOLIB_LINUX}
+  {$ELSEIF DEFINED(SOLARIS)}
+     {$DEFINE CRYPTOLIB_SOLARIS}
+  {$ELSE}
+     {$DEFINE CRYPTOLIB_UNDEFINED_UNIX_VARIANTS}
+  {$IFEND}
+{$ELSE}
+   {$MESSAGE ERROR 'UNSUPPORTED TARGET.'}
+{$IFEND}
+
+{$IFDEF CRYPTOLIB_ANDROID}
+   {$DEFINE CRYPTOLIB_LINUX}
+{$ENDIF}
+
+{$IF DEFINED(CRYPTOLIB_LINUX) OR DEFINED(CRYPTOLIB_SOLARIS)}
+   {$DEFINE CRYPTOLIB_HAS_GETRANDOM}
+{$IFEND}
+
+  {$MODE DELPHI}
+  {$MACRO ON}
+  {$NOTES OFF}
+
+  {$OPTIMIZATION LEVEL3}
+
+  {$OPTIMIZATION NOREGVAR}
+  {$OPTIMIZATION NOUSELOADMODIFYSTORE}
+  {$OPTIMIZATION ORDERFIELDS}
+  {$OPTIMIZATION DEADVALUES}
+  {$IFDEF CPUI386}  {$OPTIMIZATION USEEBP} {$ENDIF}
+  {$IFDEF CPUX86_64} {$OPTIMIZATION USERBP} {$ENDIF}
+{$ENDIF}
+

+ 0 - 34
CryptoLib/src/Include/CryptoLibHelper.inc

@@ -1,34 +0,0 @@
-{ *********************************************************************************** }
-{ *                              CryptoLib Library                                  * }
-{ *                Copyright (c) 2018 - 20XX Ugochukwu Mmaduekwe                    * }
-{ *                 Github Repository <https://github.com/Xor-el>                   * }
-
-{ *  Distributed under the MIT software license, see the accompanying file LICENSE  * }
-{ *          or visit http://www.opensource.org/licenses/mit-license.php.           * }
-
-{ *                              Acknowledgements:                                  * }
-{ *                                                                                 * }
-{ *      Thanks to Sphere 10 Software (http://www.sphere10.com/) for sponsoring     * }
-{ *                           development of this library                           * }
-
-{ * ******************************************************************************* * }
-
-(* &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& *)
-
-{$MACRO ON}
-{$IFDEF ENDIAN_BIG}
-   {$MESSAGE FATAL 'This Library does not support "Big Endian" processors yet.'}
-{$ENDIF}
-// FPC 3.0.4 and Above
-// Had to Include this here since Delphi does not allow it Compile in "CryptoLib.inc".
-{$IF FPC_FULLVERSION < 30004}
-   {$MESSAGE ERROR 'This Library requires FreePascal 3.0.4 or higher.'}
-{$IFEND}
-
-{$IF FPC_FULLVERSION > 30004}
-   {$DEFINE FPC_GREATER_THAN_3.0.4}
-{$IFEND}
-
-{$IF FPC_FULLVERSION >= 30301}
-   {$DEFINE HAS_VOLATILE}
-{$IFEND}

+ 2 - 6
CryptoLib/src/Math/ClpBigInteger.pas

@@ -3313,13 +3313,9 @@ begin
 
 
   end;
   end;
 
 
-{$IFDEF DELPHIXE3_UP}
-  LowPoint := System.Low(str);
-  HighPoint := System.High(str);
-{$ELSE}
   LowPoint := 1;
   LowPoint := 1;
-  HighPoint := System.length(str);
-{$ENDIF DELPHIXE3_UP}
+  HighPoint := System.Length(str);
+
   index := LowPoint;
   index := LowPoint;
   Fsign := 1;
   Fsign := 1;
 
 

+ 2 - 2
CryptoLib/src/Packages/FPC/CryptoLib4PascalPackage.lpk

@@ -24,7 +24,7 @@
 
 
  Acknowledgements: 
  Acknowledgements: 
 Thanks to Sphere 10 Software (http://www.sphere10.com/) for sponsoring the development of this library "/>
 Thanks to Sphere 10 Software (http://www.sphere10.com/) for sponsoring the development of this library "/>
-    <Version Major="3" Minor="1"/>
+    <Version Major="3" Minor="2"/>
     <Files Count="360">
     <Files Count="360">
       <Item1>
       <Item1>
         <Filename Value="..\..\Asn1\ClpOidTokenizer.pas"/>
         <Filename Value="..\..\Asn1\ClpOidTokenizer.pas"/>
@@ -147,7 +147,7 @@ Thanks to Sphere 10 Software (http://www.sphere10.com/) for sponsoring the devel
         <Type Value="Include"/>
         <Type Value="Include"/>
       </Item30>
       </Item30>
       <Item31>
       <Item31>
-        <Filename Value="..\..\Include\CryptoLibHelper.inc"/>
+        <Filename Value="..\..\Include\CryptoLibFPC.inc"/>
         <Type Value="Include"/>
         <Type Value="Include"/>
       </Item31>
       </Item31>
       <Item32>
       <Item32>

+ 1 - 17
CryptoLib/src/Security/ClpCipherUtilities.pas

@@ -172,13 +172,9 @@ class function TCipherUtilities.GetDigitIndex(const s: String): Int32;
 var
 var
   i, LowPoint, HighPoint: Int32;
   i, LowPoint, HighPoint: Int32;
 begin
 begin
-{$IFDEF DELPHIXE3_UP}
-  LowPoint := System.Low(s);
-  HighPoint := System.High(s);
-{$ELSE}
   LowPoint := 1;
   LowPoint := 1;
   HighPoint := System.Length(s);
   HighPoint := System.Length(s);
-{$ENDIF DELPHIXE3_UP}
+
   For i := LowPoint to HighPoint do
   For i := LowPoint to HighPoint do
   begin
   begin
     if (CharInSet(s[i], ['0' .. '9'])) then
     if (CharInSet(s[i], ['0' .. '9'])) then
@@ -345,11 +341,7 @@ begin
     di := GetDigitIndex(mode);
     di := GetDigitIndex(mode);
     if di >= 0 then
     if di >= 0 then
     begin
     begin
-{$IFDEF DELPHIXE3_UP}
-      LowPoint := System.Low(mode);
-{$ELSE}
       LowPoint := 1;
       LowPoint := 1;
-{$ENDIF DELPHIXE3_UP}
       modeName := System.Copy(mode, LowPoint, di);
       modeName := System.Copy(mode, LowPoint, di);
     end
     end
     else
     else
@@ -389,11 +381,7 @@ begin
           end
           end
           else
           else
           begin
           begin
-{$IFDEF DELPHIXE3_UP}
-            HighPoint := System.High(mode);
-{$ELSE}
             HighPoint := System.Length(mode);
             HighPoint := System.Length(mode);
-{$ENDIF DELPHIXE3_UP}
             bits := StrToInt(System.Copy(mode, di, HighPoint - di));
             bits := StrToInt(System.Copy(mode, di, HighPoint - di));
           end;
           end;
 
 
@@ -420,11 +408,7 @@ begin
           end
           end
           else
           else
           begin
           begin
-{$IFDEF DELPHIXE3_UP}
-            HighPoint := System.High(mode);
-{$ELSE}
             HighPoint := System.Length(mode);
             HighPoint := System.Length(mode);
-{$ENDIF DELPHIXE3_UP}
             bits := StrToInt(System.Copy(mode, di, HighPoint - di));
             bits := StrToInt(System.Copy(mode, di, HighPoint - di));
           end;
           end;
 
 

+ 0 - 4
CryptoLib/src/Security/ClpMacUtilities.pas

@@ -129,11 +129,7 @@ begin
 
 
   if TStringUtils.BeginsWith(mechanism, 'HMAC', True) then
   if TStringUtils.BeginsWith(mechanism, 'HMAC', True) then
   begin
   begin
-{$IFDEF DELPHIXE3_UP}
-    HighPoint := System.High(mechanism);
-{$ELSE}
     HighPoint := System.Length(mechanism);
     HighPoint := System.Length(mechanism);
-{$ENDIF DELPHIXE3_UP}
     if ((TStringUtils.BeginsWith(mechanism, 'HMAC-', True)) or
     if ((TStringUtils.BeginsWith(mechanism, 'HMAC-', True)) or
       (TStringUtils.BeginsWith(mechanism, 'HMAC/', True))) then
       (TStringUtils.BeginsWith(mechanism, 'HMAC/', True))) then
     begin
     begin

+ 2 - 5
CryptoLib/src/Security/ClpSecureRandom.pas

@@ -342,13 +342,10 @@ var
   LowPoint, HighPoint: Int32;
   LowPoint, HighPoint: Int32;
 begin
 begin
   upper := UpperCase(algorithm);
   upper := UpperCase(algorithm);
-{$IFDEF DELPHIXE3_UP}
-  LowPoint := System.Low(upper);
-  HighPoint := System.High(upper);
-{$ELSE}
+
   LowPoint := 1;
   LowPoint := 1;
   HighPoint := System.length(upper);
   HighPoint := System.length(upper);
-{$ENDIF DELPHIXE3_UP}
+
   if AnsiEndsStr('PRNG', upper) then
   if AnsiEndsStr('PRNG', upper) then
   begin
   begin
     digestName := System.Copy(upper, LowPoint,
     digestName := System.Copy(upper, LowPoint,

+ 3 - 10
CryptoLib/src/Utils/ClpStringUtils.pas

@@ -87,13 +87,10 @@ var
   LResult: UInt32;
   LResult: UInt32;
 begin
 begin
   LResult := 0;
   LResult := 0;
-{$IFDEF DELPHIXE3_UP}
-  LowPoint := System.Low(Input);
-  HighPoint := System.High(Input);
-{$ELSE}
+
   LowPoint := 1;
   LowPoint := 1;
   HighPoint := System.Length(Input);
   HighPoint := System.Length(Input);
-{$ENDIF DELPHIXE3_UP}
+
   while LowPoint <= HighPoint do
   while LowPoint <= HighPoint do
   begin
   begin
     LResult := TBits.RotateLeft32(LResult, 5);
     LResult := TBits.RotateLeft32(LResult, 5);
@@ -168,13 +165,9 @@ begin
   if Input <> '' then
   if Input <> '' then
   begin
   begin
     { Determine the length of the resulting array }
     { Determine the length of the resulting array }
-{$IFDEF DELPHIXE3_UP}
-    LowPoint := System.Low(Input);
-    HighPoint := System.High(Input);
-{$ELSE}
     LowPoint := 1;
     LowPoint := 1;
     HighPoint := System.Length(Input);
     HighPoint := System.Length(Input);
-{$ENDIF DELPHIXE3_UP}
+
     SplitPoints := 0;
     SplitPoints := 0;
     for I := LowPoint to HighPoint do
     for I := LowPoint to HighPoint do
     begin
     begin