Browse Source

Fixed a Memory Leak in ClpECAlgorithms

*Fixed a Memory Leak in ClpECAlgorithms.
* Updated ECAlgorithmsTests.
* Bumped Version Number.
Ugochukwu Mmaduekwe 7 years ago
parent
commit
cc5e7e4569

+ 1 - 1
CryptoLib.Tests/src/Math/ECAlgorithmsTests.pas

@@ -120,7 +120,7 @@ begin
       c := curve.Configure().SetCoordinateSystem(coord).CreateCurve();
       c := curve.Configure().SetCoordinateSystem(coord).CreateCurve();
       point := c.ImportPoint(x9.G);
       point := c.ImportPoint(x9.G);
       params := TX9ECParameters.Create(c, point, x9.N, x9.H);
       params := TX9ECParameters.Create(c, point, x9.N, x9.H);
-      // x9s.Add(params);
+      x9s.Add(params);
     end;
     end;
   end;
   end;
 end;
 end;

+ 7 - 0
CryptoLib/src/Math/EC/ClpECAlgorithms.pas

@@ -512,6 +512,13 @@ begin
   end;
   end;
 
 
   result := ImplSumOfMultiplies(negs, infos, wnafs);
   result := ImplSumOfMultiplies(negs, infos, wnafs);
+
+  for i := System.Low(infos) to System.High(infos) do
+  begin
+    infos[i].PreComp := Nil;
+    infos[i].PreCompNeg := Nil;
+  end;
+
 end;
 end;
 
 
 class function TECAlgorithms.ImplSumOfMultiplies(negs: TCryptoLibBooleanArray;
 class function TECAlgorithms.ImplSumOfMultiplies(negs: TCryptoLibBooleanArray;

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

@@ -24,7 +24,7 @@
 
 
  Acknowledgements: 
  Acknowledgements: 
 Thanks to Sphere 10 Software (http://sphere10.com) for sponsoring the development of this library "/>
 Thanks to Sphere 10 Software (http://sphere10.com) for sponsoring the development of this library "/>
-    <Version Major="1" Minor="3"/>
+    <Version Major="1" Minor="4"/>
     <Files Count="281">
     <Files Count="281">
       <Item1>
       <Item1>
         <Filename Value="..\..\Asn1\ClpAsn1Encodable.pas"/>
         <Filename Value="..\..\Asn1\ClpAsn1Encodable.pas"/>