Browse Source

minor formatting and adjustments.

Ugochukwu Mmaduekwe 8 years ago
parent
commit
631759252b

+ 0 - 1
CryptoLib.Tests/src/Math/ECPointTests.pas

@@ -447,7 +447,6 @@ begin
       i.ToString, adder, multiplier);
     i := i.Add(TBigInteger.One);
   until ((adder.Equals(infinity)));
-
 end;
 
 procedure TTestECPoint.ImplTestEncoding(const p: IECPoint);

+ 2 - 3
CryptoLib/src/Math/EC/ClpECPoint.pas

@@ -78,7 +78,6 @@ type
   var
     Fm_zs: TCryptoLibGenericArray<IECFieldElement>;
     Fm_withCompression: Boolean;
-
     Fm_curve: IECCurve;
 
     Fm_x, Fm_y: IECFieldElement;
@@ -516,7 +515,7 @@ var
 begin
   h := curve.Cofactor;
   result := (not h.IsInitialized) or h.Equals(TBigInteger.One) or
-    (not TECAlgorithms.ReferenceMultiply(Self, h).IsInfinity);
+    (not TECAlgorithms.ReferenceMultiply(Self as IECPoint, h).IsInfinity);
 end;
 
 function TECPoint.ScaleX(const scale: IECFieldElement): IECPoint;
@@ -627,6 +626,7 @@ end;
 constructor TECPoint.Create(const curve: IECCurve; const x, y: IECFieldElement;
   zs: TCryptoLibGenericArray<IECFieldElement>; withCompression: Boolean);
 begin
+  Inherited Create();
   // Fm_curve := curve;
   TSetWeakRef.SetWeakReference(@Fm_curve, curve);
   Fm_x := x;
@@ -644,7 +644,6 @@ end;
 destructor TECPoint.Destroy;
 begin
   TSetWeakRef.SetWeakReference(@Fm_curve, Nil);
-
   Fm_preCompTable.Free;
   inherited Destroy;
 end;

+ 13 - 1
CryptoLib/src/Math/EC/Multiplier/ClpWNafPreCompInfo.pas

@@ -45,7 +45,7 @@ type
     function GetTwice: IECPoint; virtual;
     procedure SetTwice(const Value: IECPoint); virtual;
   strict protected
-
+  var
     /// <summary>
     /// Array holding the precomputed <c>ECPoint</c>s used for a Window NAF
     /// multiplication.
@@ -66,6 +66,8 @@ type
 
   public
 
+    constructor Create();
+    destructor Destroy; override;
     property PreComp: TCryptoLibGenericArray<IECPoint> read GetPreComp
       write SetPreComp;
     property PreCompNeg: TCryptoLibGenericArray<IECPoint> read GetPreCompNeg
@@ -78,6 +80,16 @@ implementation
 
 { TWNafPreCompInfo }
 
+constructor TWNafPreCompInfo.Create;
+begin
+  inherited Create();
+end;
+
+destructor TWNafPreCompInfo.Destroy;
+begin
+  inherited Destroy;
+end;
+
 function TWNafPreCompInfo.GetPreComp: TCryptoLibGenericArray<IECPoint>;
 begin
   Result := Fm_preComp;