Browse Source

fix compilation issues in FPC trunk caused by some recent changes

fixed FPC trunk compilation issues caused by http://wiki.freepascal.org/User_Changes_Trunk#Visibility_of_methods_implementing_interface_methods
and 
http://wiki.freepascal.org/User_Changes_Trunk#Methods_implementing_interface_methods_and_overloads
Ugochukwu Mmaduekwe 7 years ago
parent
commit
28ba7620dc

+ 2 - 3
CryptoLib.Tests/src/Utils/ClpFixedSecureRandom.pas

@@ -53,8 +53,6 @@ type
 
 
     FisAndroidStyle, FisClasspathStyle, FisRegularStyle: Boolean;
     FisAndroidStyle, FisClasspathStyle, FisRegularStyle: Boolean;
 
 
-    function GetIsExhausted: Boolean; inline;
-
     class procedure Boot(); static;
     class procedure Boot(); static;
     class constructor FixedSecureRandom();
     class constructor FixedSecureRandom();
 
 
@@ -75,6 +73,7 @@ type
     const v: TCryptoLibByteArray): TCryptoLibByteArray; static;
     const v: TCryptoLibByteArray): TCryptoLibByteArray; static;
 
 
   strict protected
   strict protected
+    function GetIsExhausted: Boolean; inline;
     constructor Create(const data: TCryptoLibByteArray); overload;
     constructor Create(const data: TCryptoLibByteArray); overload;
 
 
   public
   public
@@ -89,7 +88,7 @@ type
     strict private
     strict private
     var
     var
       Fdata: TCryptoLibByteArray;
       Fdata: TCryptoLibByteArray;
-
+    strict protected
       function GetData: TCryptoLibByteArray; inline;
       function GetData: TCryptoLibByteArray; inline;
 
 
     public
     public

+ 18 - 23
CryptoLib/src/Asn1/ClpAsn1Objects.pas

@@ -670,10 +670,9 @@ type
   var
   var
     F_out: TStream;
     F_out: TStream;
 
 
-    function GetOut: TStream; inline;
-
   strict protected
   strict protected
     constructor Create(outStream: TStream);
     constructor Create(outStream: TStream);
+    function GetOut: TStream; inline;
     property &Out: TStream read GetOut;
     property &Out: TStream read GetOut;
 
 
   public
   public
@@ -703,10 +702,10 @@ type
   strict private
   strict private
   var
   var
     FStr: TCryptoLibByteArray;
     FStr: TCryptoLibByteArray;
-    function GetStr: TCryptoLibByteArray; inline;
-    function GetParser: IAsn1OctetStringParser; inline;
 
 
   strict protected
   strict protected
+    function GetStr: TCryptoLibByteArray; inline;
+    function GetParser: IAsn1OctetStringParser; inline;
     function Asn1GetHashCode(): Int32; override;
     function Asn1GetHashCode(): Int32; override;
     function Asn1Equals(const asn1Object: IAsn1Object): Boolean; override;
     function Asn1Equals(const asn1Object: IAsn1Object): Boolean; override;
 
 
@@ -766,11 +765,6 @@ type
   var
   var
     FSeq: TList<IAsn1Encodable>;
     FSeq: TList<IAsn1Encodable>;
 
 
-    function GetCount: Int32; virtual;
-    function GetParser: IAsn1SequenceParser; virtual;
-    function GetSelf(Index: Integer): IAsn1Encodable; virtual;
-    function GetCurrent(const e: IAsn1Encodable): IAsn1Encodable;
-
   type
   type
     TAsn1SequenceParserImpl = class sealed(TInterfacedObject,
     TAsn1SequenceParserImpl = class sealed(TInterfacedObject,
       IAsn1SequenceParserImpl, IAsn1SequenceParser)
       IAsn1SequenceParserImpl, IAsn1SequenceParser)
@@ -788,6 +782,10 @@ type
     end;
     end;
 
 
   strict protected
   strict protected
+    function GetCount: Int32; virtual;
+    function GetParser: IAsn1SequenceParser; virtual;
+    function GetSelf(Index: Integer): IAsn1Encodable; virtual;
+    function GetCurrent(const e: IAsn1Encodable): IAsn1Encodable;
     function Asn1GetHashCode(): Int32; override;
     function Asn1GetHashCode(): Int32; override;
     function Asn1Equals(const asn1Object: IAsn1Object): Boolean; override;
     function Asn1Equals(const asn1Object: IAsn1Object): Boolean; override;
     procedure AddObject(const obj: IAsn1Encodable); inline;
     procedure AddObject(const obj: IAsn1Encodable); inline;
@@ -1043,10 +1041,6 @@ type
     Fexplicitly: Boolean;
     Fexplicitly: Boolean;
     Fobj: IAsn1Encodable;
     Fobj: IAsn1Encodable;
 
 
-    function GetTagNo: Int32; inline;
-    function Getexplicitly: Boolean; inline;
-    function Getobj: IAsn1Encodable; inline;
-
   strict protected
   strict protected
     // /**
     // /**
     // * @param tagNo the tag number for this object.
     // * @param tagNo the tag number for this object.
@@ -1061,6 +1055,10 @@ type
     constructor Create(explicitly: Boolean; tagNo: Int32;
     constructor Create(explicitly: Boolean; tagNo: Int32;
       const obj: IAsn1Encodable); overload;
       const obj: IAsn1Encodable); overload;
 
 
+    function GetTagNo: Int32; inline;
+    function Getexplicitly: Boolean; inline;
+    function Getobj: IAsn1Encodable; inline;
+
     function Asn1Equals(const asn1Object: IAsn1Object): Boolean; override;
     function Asn1Equals(const asn1Object: IAsn1Object): Boolean; override;
 
 
     function Asn1GetHashCode(): Int32; override;
     function Asn1GetHashCode(): Int32; override;
@@ -1158,11 +1156,6 @@ type
     F_set: TList<IAsn1Encodable>;
     F_set: TList<IAsn1Encodable>;
     FisSorted: Boolean;
     FisSorted: Boolean;
 
 
-    function GetCount: Int32; virtual;
-    function GetParser: IAsn1SetParser; inline;
-    function GetSelf(Index: Integer): IAsn1Encodable; virtual;
-    function GetCurrent(const e: IAsn1Encodable): IAsn1Encodable;
-
     /// <summary>
     /// <summary>
     /// return true if a &lt;= b (arrays are assumed padded with zeros).
     /// return true if a &lt;= b (arrays are assumed padded with zeros).
     /// </summary>
     /// </summary>
@@ -1184,6 +1177,10 @@ type
     end;
     end;
 
 
   strict protected
   strict protected
+    function GetCount: Int32; virtual;
+    function GetParser: IAsn1SetParser; inline;
+    function GetSelf(Index: Integer): IAsn1Encodable; virtual;
+    function GetCurrent(const e: IAsn1Encodable): IAsn1Encodable;
     function Asn1GetHashCode(): Int32; override;
     function Asn1GetHashCode(): Int32; override;
     function Asn1Equals(const asn1Object: IAsn1Object): Boolean; override;
     function Asn1Equals(const asn1Object: IAsn1Object): Boolean; override;
     procedure AddObject(const obj: IAsn1Encodable); inline;
     procedure AddObject(const obj: IAsn1Encodable); inline;
@@ -1382,13 +1379,12 @@ type
     Ftag: Int32;
     Ftag: Int32;
     Foctets: TCryptoLibByteArray;
     Foctets: TCryptoLibByteArray;
 
 
-    function GetApplicationTag: Int32; inline;
-    function GetLengthOfHeader(const data: TCryptoLibByteArray): Int32; inline;
-
     class function ReplaceTagNumber(newTag: Int32;
     class function ReplaceTagNumber(newTag: Int32;
       const input: TCryptoLibByteArray): TCryptoLibByteArray; static;
       const input: TCryptoLibByteArray): TCryptoLibByteArray; static;
 
 
   strict protected
   strict protected
+    function GetApplicationTag: Int32; inline;
+    function GetLengthOfHeader(const data: TCryptoLibByteArray): Int32; inline;
     function Asn1Equals(const asn1Object: IAsn1Object): Boolean; override;
     function Asn1Equals(const asn1Object: IAsn1Object): Boolean; override;
     function Asn1GetHashCode(): Int32; override;
     function Asn1GetHashCode(): Int32; override;
 
 
@@ -1595,13 +1591,12 @@ type
     F_tagged, F_isExplicit: Boolean;
     F_tagged, F_isExplicit: Boolean;
     F_tagNo: Int32;
     F_tagNo: Int32;
 
 
-    procedure WriteHdr(tag: Int32);
-
   strict protected
   strict protected
     constructor Create(outStream: TStream); overload;
     constructor Create(outStream: TStream); overload;
     constructor Create(outStream: TStream; tagNo: Int32;
     constructor Create(outStream: TStream; tagNo: Int32;
       isExplicit: Boolean); overload;
       isExplicit: Boolean); overload;
 
 
+    procedure WriteHdr(tag: Int32);
     procedure WriteBerHeader(tag: Int32);
     procedure WriteBerHeader(tag: Int32);
     procedure WriteBerBody(contentStream: TStream);
     procedure WriteBerBody(contentStream: TStream);
     procedure WriteBerEnd();
     procedure WriteBerEnd();

+ 1 - 1
CryptoLib/src/Asn1/X9/ClpX9ECParametersHolder.pas

@@ -32,7 +32,6 @@ type
 
 
   strict private
   strict private
     Fparameters: IX9ECParameters;
     Fparameters: IX9ECParameters;
-    function GetParameters: IX9ECParameters; inline;
 
 
     class var
     class var
 
 
@@ -43,6 +42,7 @@ type
     class destructor DestroyX9ECParametersHolder();
     class destructor DestroyX9ECParametersHolder();
 
 
   strict protected
   strict protected
+    function GetParameters: IX9ECParameters; inline;
     function CreateParameters(): IX9ECParameters; virtual; abstract;
     function CreateParameters(): IX9ECParameters; virtual; abstract;
 
 
   public
   public

+ 1 - 1
CryptoLib/src/Crypto/ClpAsymmetricKeyParameter.pas

@@ -33,10 +33,10 @@ type
   var
   var
     FprivateKey: Boolean;
     FprivateKey: Boolean;
 
 
+  strict protected
     function GetPrivateKey: Boolean; inline;
     function GetPrivateKey: Boolean; inline;
     function GetIsPrivate: Boolean; inline;
     function GetIsPrivate: Boolean; inline;
 
 
-  protected
     constructor Create(privateKey: Boolean);
     constructor Create(privateKey: Boolean);
 
 
   public
   public

+ 2 - 3
CryptoLib/src/Crypto/ClpBufferedCipherBase.pas

@@ -54,13 +54,12 @@ type
   const
   const
     BUFFER_SIZE = Int32(64 * 1024); // 64Kb
     BUFFER_SIZE = Int32(64 * 1024); // 64Kb
 
 
+  strict protected
+
     function GetBufferSize: Int32; inline;
     function GetBufferSize: Int32; inline;
     procedure SetBufferSize(value: Int32); inline;
     procedure SetBufferSize(value: Int32); inline;
     function GetOnProgress: TBufferedCipherProgressEvent; inline;
     function GetOnProgress: TBufferedCipherProgressEvent; inline;
     procedure SetOnProgress(const value: TBufferedCipherProgressEvent); inline;
     procedure SetOnProgress(const value: TBufferedCipherProgressEvent); inline;
-
-  strict protected
-
     procedure DoProgress(AProcessed, ATotal: Int64); virtual;
     procedure DoProgress(AProcessed, ATotal: Int64); virtual;
 
 
     class property EmptyBuffer: TCryptoLibByteArray read GetEmptyBuffer;
     class property EmptyBuffer: TCryptoLibByteArray read GetEmptyBuffer;

+ 2 - 0
CryptoLib/src/Crypto/ClpKeyGenerationParameters.pas

@@ -41,6 +41,8 @@ type
     FRandom: ISecureRandom;
     FRandom: ISecureRandom;
     FStrength: Int32;
     FStrength: Int32;
 
 
+  strict protected
+
     /// <returns>
     /// <returns>
     /// return the generators random source.
     /// return the generators random source.
     /// </returns>
     /// </returns>

+ 3 - 4
CryptoLib/src/Crypto/Parameters/ClpDsaKeyParameters.pas

@@ -32,13 +32,12 @@ type
   strict private
   strict private
   var
   var
     Fparameters: IDsaParameters;
     Fparameters: IDsaParameters;
-  strict private
-    function GetParameters: IDsaParameters;
-  protected
+  strict protected
+  function GetParameters: IDsaParameters;
     constructor Create(isPrivate: Boolean; parameters: IDsaParameters);
     constructor Create(isPrivate: Boolean; parameters: IDsaParameters);
 
 
   public
   public
-    function Equals(const other: IDsaKeyParameters): Boolean; reintroduce;
+    function Equals(const other: IDsaKeyParameters): Boolean; reintroduce; overload;
     function GetHashCode(): {$IFDEF DELPHI}Int32; {$ELSE}PtrInt;
     function GetHashCode(): {$IFDEF DELPHI}Int32; {$ELSE}PtrInt;
 {$ENDIF DELPHI}override;
 {$ENDIF DELPHI}override;
 
 

+ 1 - 1
CryptoLib/src/Crypto/Parameters/ClpDsaPrivateKeyParameters.pas

@@ -45,7 +45,7 @@ type
     constructor Create(const x: TBigInteger; const parameters: IDsaParameters);
     constructor Create(const x: TBigInteger; const parameters: IDsaParameters);
 
 
     function Equals(const other: IDsaPrivateKeyParameters): Boolean;
     function Equals(const other: IDsaPrivateKeyParameters): Boolean;
-      reintroduce;
+      reintroduce; overload;
     function GetHashCode(): {$IFDEF DELPHI}Int32; {$ELSE}PtrInt;
     function GetHashCode(): {$IFDEF DELPHI}Int32; {$ELSE}PtrInt;
 {$ENDIF DELPHI}override;
 {$ENDIF DELPHI}override;
 
 

+ 1 - 1
CryptoLib/src/Crypto/Parameters/ClpDsaPublicKeyParameters.pas

@@ -48,7 +48,7 @@ type
   public
   public
     constructor Create(const y: TBigInteger; const parameters: IDsaParameters);
     constructor Create(const y: TBigInteger; const parameters: IDsaParameters);
 
 
-    function Equals(const other: IDsaPublicKeyParameters): Boolean; reintroduce;
+    function Equals(const other: IDsaPublicKeyParameters): Boolean; reintroduce; overload;
     function GetHashCode(): {$IFDEF DELPHI}Int32; {$ELSE}PtrInt;
     function GetHashCode(): {$IFDEF DELPHI}Int32; {$ELSE}PtrInt;
 {$ENDIF DELPHI}override;
 {$ENDIF DELPHI}override;
 
 

+ 5 - 5
CryptoLib/src/Crypto/Parameters/ClpECKeyParameters.pas

@@ -59,10 +59,6 @@ type
     Fparameters: IECDomainParameters;
     Fparameters: IECDomainParameters;
     FpublicKeyParamSet: IDerObjectIdentifier;
     FpublicKeyParamSet: IDerObjectIdentifier;
 
 
-    function GetAlgorithmName: String; inline;
-    function GetPublicKeyParamSet: IDerObjectIdentifier; inline;
-    function GetParameters: IECDomainParameters; inline;
-
   strict protected
   strict protected
 
 
     constructor Create(const algorithm: String; isPrivate: Boolean;
     constructor Create(const algorithm: String; isPrivate: Boolean;
@@ -74,7 +70,11 @@ type
     function CreateKeyGenerationParameters(const random: ISecureRandom)
     function CreateKeyGenerationParameters(const random: ISecureRandom)
       : IECKeyGenerationParameters; inline;
       : IECKeyGenerationParameters; inline;
 
 
-    function Equals(const other: IECKeyParameters): Boolean; reintroduce;
+    function GetAlgorithmName: String; inline;
+    function GetPublicKeyParamSet: IDerObjectIdentifier; inline;
+    function GetParameters: IECDomainParameters; inline;
+
+    function Equals(const other: IECKeyParameters): Boolean; reintroduce; overload;
 
 
   public
   public
     class function VerifyAlgorithmName(const algorithm: String): String; static;
     class function VerifyAlgorithmName(const algorithm: String): String; static;

+ 1 - 1
CryptoLib/src/Crypto/Parameters/ClpECPrivateKeyParameters.pas

@@ -54,7 +54,7 @@ type
 
 
     property d: TBigInteger read GetD;
     property d: TBigInteger read GetD;
 
 
-    function Equals(const other: IECPrivateKeyParameters): Boolean; reintroduce;
+    function Equals(const other: IECPrivateKeyParameters): Boolean; reintroduce; overload;
     function GetHashCode(): {$IFDEF DELPHI}Int32; {$ELSE}PtrInt;
     function GetHashCode(): {$IFDEF DELPHI}Int32; {$ELSE}PtrInt;
 {$ENDIF DELPHI}override;
 {$ENDIF DELPHI}override;
 
 

+ 1 - 1
CryptoLib/src/Crypto/Parameters/ClpECPublicKeyParameters.pas

@@ -56,7 +56,7 @@ type
 
 
     property q: IECPoint read GetQ;
     property q: IECPoint read GetQ;
 
 
-    function Equals(const other: IECPublicKeyParameters): Boolean; reintroduce;
+    function Equals(const other: IECPublicKeyParameters): Boolean; reintroduce; overload;
     function GetHashCode(): {$IFDEF DELPHI}Int32; {$ELSE}PtrInt;
     function GetHashCode(): {$IFDEF DELPHI}Int32; {$ELSE}PtrInt;
 {$ENDIF DELPHI}override;
 {$ENDIF DELPHI}override;
 
 

+ 1 - 0
CryptoLib/src/Crypto/Parameters/ClpIESParameters.pas

@@ -37,6 +37,7 @@ type
   var
   var
     Fderivation, Fencoding: TCryptoLibByteArray;
     Fderivation, Fencoding: TCryptoLibByteArray;
     FmacKeySize: Int32;
     FmacKeySize: Int32;
+  strict protected
     function GetMacKeySize(): Int32; inline;
     function GetMacKeySize(): Int32; inline;
   public
   public
     function GetDerivationV(): TCryptoLibByteArray; inline;
     function GetDerivationV(): TCryptoLibByteArray; inline;

+ 22 - 23
CryptoLib/src/Math/EC/ClpECC.pas

@@ -243,7 +243,7 @@ type
 
 
     property Q: TBigInteger read GetQ;
     property Q: TBigInteger read GetQ;
 
 
-    function Equals(const other: IFpFieldElement): Boolean; reintroduce;
+    function Equals(const other: IFpFieldElement): Boolean; reintroduce; overload;
 
 
     function GetHashCode(): {$IFDEF DELPHI}Int32; {$ELSE}PtrInt;
     function GetHashCode(): {$IFDEF DELPHI}Int32; {$ELSE}PtrInt;
 {$ENDIF DELPHI}override;
 {$ENDIF DELPHI}override;
@@ -393,7 +393,7 @@ type
 
 
     function SquarePow(pow: Int32): IECFieldElement; override;
     function SquarePow(pow: Int32): IECFieldElement; override;
 
 
-    function Equals(const other: IF2mFieldElement): Boolean; reintroduce;
+    function Equals(const other: IF2mFieldElement): Boolean; reintroduce; overload;
 
 
     function GetHashCode(): {$IFDEF DELPHI}Int32; {$ELSE}PtrInt;
     function GetHashCode(): {$IFDEF DELPHI}Int32; {$ELSE}PtrInt;
 {$ENDIF DELPHI}override;
 {$ENDIF DELPHI}override;
@@ -474,16 +474,6 @@ type
 
 
   strict private
   strict private
 
 
-    procedure SetCoord(const Value: Int32); inline;
-    procedure SetEndomorphism(const Value: IECEndomorphism); inline;
-    procedure SetMultiplier(const Value: IECMultiplier); inline;
-    function GetField: IFiniteField; virtual;
-    function GetA: IECFieldElement; virtual;
-    function GetB: IECFieldElement; virtual;
-    function GetOrder: TBigInteger; virtual;
-    function GetCofactor: TBigInteger; virtual;
-    function GetCoordinateSystem: Int32; virtual;
-
     class procedure Boot(); static;
     class procedure Boot(); static;
     class constructor CreateECCurve();
     class constructor CreateECCurve();
     class destructor DestroyECCurve();
     class destructor DestroyECCurve();
@@ -506,6 +496,16 @@ type
 
 
     constructor Create(const field: IFiniteField);
     constructor Create(const field: IFiniteField);
 
 
+    procedure SetCoord(const Value: Int32); inline;
+    procedure SetEndomorphism(const Value: IECEndomorphism); inline;
+    procedure SetMultiplier(const Value: IECMultiplier); inline;
+    function GetField: IFiniteField; virtual;
+    function GetA: IECFieldElement; virtual;
+    function GetB: IECFieldElement; virtual;
+    function GetOrder: TBigInteger; virtual;
+    function GetCofactor: TBigInteger; virtual;
+    function GetCoordinateSystem: Int32; virtual;
+
     function GetFieldSize: Int32; virtual; abstract;
     function GetFieldSize: Int32; virtual; abstract;
     function GetInfinity: IECPoint; virtual; abstract;
     function GetInfinity: IECPoint; virtual; abstract;
 
 
@@ -1073,17 +1073,6 @@ type
 
 
     end;
     end;
 
 
-  function GetIsInfinity: Boolean; inline;
-  function GetIsCompressed: Boolean; inline;
-  function GetpreCompTable: TDictionary<String, IPreCompInfo>; inline;
-  procedure SetpreCompTable(const Value
-    : TDictionary<String, IPreCompInfo>); inline;
-  function GetCurve: IECCurve; virtual;
-  function GetCurveCoordinateSystem: Int32; virtual;
-  function GetAffineXCoord: IECFieldElement; virtual;
-  function GetAffineYCoord: IECFieldElement; virtual;
-  function GetXCoord: IECFieldElement; virtual;
-
   class constructor ECPoint();
   class constructor ECPoint();
 
 
   strict protected
   strict protected
@@ -1099,6 +1088,16 @@ type
 
 
     Fm_x, Fm_y: IECFieldElement;
     Fm_x, Fm_y: IECFieldElement;
 
 
+    function GetIsInfinity: Boolean; inline;
+    function GetIsCompressed: Boolean; inline;
+    function GetpreCompTable: TDictionary<String, IPreCompInfo>; inline;
+    procedure SetpreCompTable(const Value: TDictionary<String, IPreCompInfo>); inline;
+    function GetCurve: IECCurve; virtual;
+    function GetCurveCoordinateSystem: Int32; virtual;
+    function GetAffineXCoord: IECFieldElement; virtual;
+    function GetAffineYCoord: IECFieldElement; virtual;
+    function GetXCoord: IECFieldElement; virtual;
+
     function GetCompressionYTilde: Boolean; virtual; abstract;
     function GetCompressionYTilde: Boolean; virtual; abstract;
 
 
     constructor Create(const curve: IECCurve; const x, y: IECFieldElement;
     constructor Create(const curve: IECCurve; const x, y: IECFieldElement;

+ 1 - 1
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="2" Minor="8"/>
+    <Version Major="2" Minor="9"/>
     <Files Count="269">
     <Files Count="269">
       <Item1>
       <Item1>
         <Filename Value="..\..\Asn1\ClpOidTokenizer.pas"/>
         <Filename Value="..\..\Asn1\ClpOidTokenizer.pas"/>