Ugochukwu Mmaduekwe 7 years ago
parent
commit
a1642297fc

+ 1 - 1
CryptoLib.Tests/FreePascal.Tests/CryptoLibConsole.lpr

@@ -10,7 +10,7 @@ uses
   OIDTests,
   OIDTests,
   BigIntegerTests,
   BigIntegerTests,
  // ECAlgorithmsTests,
  // ECAlgorithmsTests,
- ECPointTests,
+//  ECPointTests,
   SecP384R1FieldTests,
   SecP384R1FieldTests,
  // ECDsa5Tests,
  // ECDsa5Tests,
  // ECTests,
  // ECTests,

+ 4 - 2
CryptoLib/src/Math/EC/ClpECFieldElement.pas

@@ -964,7 +964,7 @@ function TFpFieldElement.LucasSequence(const P, Q, K: TBigInteger)
   : TCryptoLibGenericArray<TBigInteger>;
   : TCryptoLibGenericArray<TBigInteger>;
 var
 var
   n, s, j: Int32;
   n, s, j: Int32;
-  Uh, Vl, Vh, Ql, Qh: TBigInteger;
+  Uh, Vl, Vh, Ql, Qh, temp: TBigInteger;
 begin
 begin
   // TODO Research and apply "common-multiplicand multiplication here"
   // TODO Research and apply "common-multiplicand multiplication here"
 
 
@@ -1013,7 +1013,9 @@ begin
   while j <= s do
   while j <= s do
   begin
   begin
     Uh := ModMult(Uh, Vl);
     Uh := ModMult(Uh, Vl);
-    Vl := ModReduce(Vl.Multiply(Vl).Subtract(Ql.ShiftLeft(1)));
+    temp := Vl.Multiply(Vl);
+    Writeln(temp.ToString);
+    Vl := ModReduce(temp.Subtract(Ql.ShiftLeft(1)));
     Ql := ModMult(Ql, Ql);
     Ql := ModMult(Ql, Ql);
     System.Inc(j);
     System.Inc(j);
   end;
   end;