Sfoglia il codice sorgente

Merge pull request #22 from PascalCoinDev/master

Set to 5.2
Pascal Coin 5 anni fa
parent
commit
377380d816

+ 4 - 1
CHANGELOG.md

@@ -1,6 +1,8 @@
 # Changelog
 
-## Build 5.2.0 (PENDING)
+## Build 5.2.0 - 2020-02-11
+- Mandatory upgrade due fixes some important security bugs
+- Fixed CryptoLib4Pascal multithreading bug
 - Fixed important bug caused by bad calculated "more work" blockchain
   - Previous "more work" (introduced on build 1.5.0.0 2017-02-15) was calculated by SUM(compact_target), but compact_target is a linear value (not exponential)
   - Current "more work" will be equals to "aggregated hashrate" that is SUM(CompactTargetToHashRate(compact_target)) where "hashrate" is exponential
@@ -8,6 +10,7 @@
 - NAT limited to 7 seconds by default as proposed by Herman Schoenfeld ([email protected]) in order to minimize a warp timestamp attack. This value can be configured.
 - Fix invalid "balance" rounded decimals value caused by FPC (daemon or Linux versions)
 - Improvements on hashlib4pascal library by Ugochukwu Mmaduekwe <https://github.com/Xor-el>
+- Introducing CryptoLib4Pascal usage
 - Minor improvements and fixed bugs
 
 ## Build 5.1.0 - 2019-11-25

+ 19 - 54
src/config.inc

@@ -24,29 +24,18 @@
   
   - Use_CryptoLib4Pascal    : Will not use OpenSSL library, will use pascal native CryptoLib4Pascal
   - Use_OpenSSL             : Will use OpenSSL library (Need version 1.1)
-  - OpenSSL10               : When "Use_OpenSSL" enabled, will use version 1.0 instead of 1.1 -> DO NOT USE!
   
   - Synapse                 : Will use Synapse sockets (Preferred)
   - DelphiSockets           : Will use Delphi Indy sockets (Use only for special purposes... for example for mobile apps)
   
-  - OPTIONS_BY_DEFAULT      : (Preferred)
-      Will define "Synapse" and will undefine "OpenSSL10"
-  - DelphiSockets_OpenSSLv10 :
-      Will define "DelphiSockets" and will define "OpenSSL10"
-  - Synapse_OpenSSLv10      :
-      Will define "Synapse" and will define "OpenSSL10"
-  - Synapse_OpenSSLv11      :
-      Will define "Synapse" and will undefine "OpenSSL10" 
-
 }
 
-  {.$DEFINE PRODUCTION}
-  {$DEFINE TESTNET}
+  {$DEFINE PRODUCTION}
+  {.$DEFINE TESTNET}
+
+  // Activate to define CryptoLib4Pascal by default on all compilations
+  {.$DEFINE Use_CryptoLib4Pascal}
 
-  {$DEFINE OPTIONS_BY_DEFAULT}
-  {.$DEFINE DelphiSockets_OpenSSLv10}
-  {.$DEFINE Synapse_OpenSSLv10}
-  {.$DEFINE Synapse_OpenSSLv11}
 
   // Used to activate RandomHash in V4 hard-fork
   {$DEFINE ACTIVATE_RANDOMHASH_V4}
@@ -77,60 +66,36 @@
 ERROR: You must select ONLY ONE option: PRODUCTION or TESTNET
 {$ENDIF}{$ELSE}{$DEFINE PRODUCTION}{$ENDIF}
 
-{$IFNDEF OPTIONS_BY_DEFAULT}{$IFNDEF DelphiSockets_OpenSSLv10}{$IFNDEF Synapse_OpenSSLv10}{$IFNDEF Synapse_OpenSSLv11}
-ERROR: You must select ONE option!
-{$ENDIF}{$ENDIF}{$ENDIF}{$ENDIF}
-{$IFDEF OPTIONS_BY_DEFAULT}
-  {$IFDEF DARWIN}
-  {$DEFINE Use_CryptoLib4Pascal}
-  {$ELSE}
+{$IF (not Defined(Use_OpenSSL)) or (not Defined(Use_CryptoLib4Pascal))}
   {$DEFINE Use_OpenSSL}
-  {$ENDIF}
+  {$UNDEF Use_CryptoLib4Pascal}
+{$ENDIF}
+
+{$IF (Defined(Use_OpenSSL)) and (Defined(Use_CryptoLib4Pascal))}
+ERROR: You must select ONLY ONE option: Use_OpenSSL or Use_CryptoLib4Pascal
+{$ENDIF}
+  
+{$IFDEF DARWIN}
+  {$UNDEF Use_OpenSSL}
+  {$DEFINE Use_CryptoLib4Pascal}
+{$ENDIF}
+  
 
-  // By default are: Synapse + OpenSSLv11
   {$IFDEF ANDROID} 
     // Android usage (on Delphi) does not use Synapse
     {$UNDEF Synapse}
     {$DEFINE DelphiSockets}
   {$ELSE}
     {$DEFINE Synapse}
+    {$UNDEF DelphiSockets}
   {$ENDIF}
   {$UNDEF OpenSSL10}
-  {$IFDEF DelphiSockets_OpenSSLv10}ERROR: You selected more than 1 option{$ENDIF}
-  {$IFDEF Synapse_OpenSSLv10}ERROR: You selected more than 1 option{$ENDIF}
-  {$IFDEF Synapse_OpenSSLv11}ERROR: You selected more than 1 option{$ENDIF}
-{$ELSE}
-  {$IFDEF DelphiSockets_OpenSSLv10}
-    {$IFDEF FPC}
-      ERROR: With Free Pascal you cannot choose compiler directive DelphiSockets_OpenSSLv10
-    {$ELSE}
-      {$UNDEF Synapse}
-      {$DEFINE OpenSSL10}
-    {$ENDIF}
-    {$IFDEF Synapse_OpenSSLv10}ERROR: You selected more than 1 option{$ENDIF}
-    {$IFDEF Synapse_OpenSSLv11}ERROR: You selected more than 1 option{$ENDIF}
-  {$ELSE}
-    {$IFDEF Synapse_OpenSSLv10}
-      {$DEFINE Synapse}
-      {$DEFINE OpenSSL10}
-      {$IFDEF Synapse_OpenSSLv11}ERROR: You selected more than 1 option{$ENDIF}
-    {$ELSE}
-      {$IFDEF FPC}
-        {$DEFINE Synapse}
-        {$UNDEF OpenSSL10}
-      {$ELSE}
-        ERROR: With Delphi you cannot choose compiler directive Synapse_OpenSSLv11
-      {$ENDIF}
-    {$ENDIF}
-  {$ENDIF}
-{$ENDIF}
 
 {$IFNDEF FPC}
   // We are on Delphi compiler
   {$IF Defined(ANDROID) or Defined(MACOS) or Defined(IOS) }
     // On Delphi and Android/IOS/MAC environment, AnsiString is not available and use DelphiSockets instead of Synapse
     {$DEFINE NO_ANSISTRING}
-    {$UNDEF OpenSSL10}
     {$UNDEF Use_OpenSSL}
     {$DEFINE Use_CryptoLib4Pascal}
     {$UNDEF Synapse}

+ 1 - 1
src/core/UAES.pas

@@ -28,7 +28,7 @@ unit UAES;
   {$MODE Delphi}
 {$ENDIF}
 
-{$I config.inc}
+{$I ./../config.inc}
 
 {$IF not Defined(Use_OpenSSL)}
   {$Message Warn 'ERROR: Use_OpenSSL is not defined, you should not use this UNIT!'}

+ 1 - 1
src/core/UAccounts.pas

@@ -28,7 +28,7 @@ uses
   UPCHardcodedRandomHashTable, UJSONFunctions,
   {$IFNDEF FPC}System.Generics.Collections{$ELSE}Generics.Collections{$ENDIF};
 
-{$I config.inc}
+{$I ./../config.inc}
 
 Type
   TAccountKey = TECDSA_Public;

+ 1 - 1
src/core/UBaseTypes.pas

@@ -30,7 +30,7 @@ interface
 uses
   Classes, SysUtils;
 
-{$I config.inc}
+{$I ./../config.inc}
 
 Type
   {$IFDEF NO_ANSISTRING}

+ 2 - 2
src/core/UBlockChain.pas

@@ -26,7 +26,7 @@ uses
   Classes, UCrypto, UAccounts, ULog, UThread, SyncObjs, UBaseTypes, SysUtils,
   {$IFNDEF FPC}System.Generics.Collections{$ELSE}Generics.Collections{$ENDIF},
   UPCDataTypes;
-{$I config.inc}
+{$I ./../config.inc}
 
 {
 
@@ -1132,7 +1132,7 @@ begin
   end;
   LOrd := TOrderedCardinalList.Create;
   try
-    LStart := Integer(AFromBlock) - Integer(ABackBlocks);
+    LStart := Integer(AFromBlock) - Integer(ABackBlocks) + 1;
     LEnd := Integer(AFromBlock);
     if LStart<1 then LStart := 1; // Ensure we will get access to 0 as a previous Timestamp
     LPreviousTimestamp := SafeBox.GetBlockInfo(LStart - 1).timestamp; // Get first previous timestamp

+ 1 - 1
src/core/UConst.pas

@@ -22,7 +22,7 @@ unit UConst;
 
 interface
 
-{$I config.inc}
+{$I ./../config.inc}
 
 {$IFNDEF FPC}
   // See http://wiki.freepascal.org/Code_Conversion_Guide

+ 1 - 1
src/core/UCrypto.pas

@@ -20,7 +20,7 @@ unit UCrypto;
   {$MODE Delphi}
 {$ENDIF}
 
-{$I config.inc}
+{$I ./../config.inc}
 
 {$IF (not Defined(Use_CryptoLib4Pascal)) and (not Defined(Use_OpenSSL))}
   ERROR: At least Use_CryptoLib4Pascal or Use_OpenSSL must be defined!

+ 1 - 1
src/core/UECIES.pas

@@ -39,7 +39,7 @@ unit UECIES;
   {$MODE Delphi}
 {$ENDIF}
 
-{$I config.inc}
+{$I ./../config.inc}
 
 {$IF not Defined(Use_OpenSSL)}
   {$Message Warn 'ERROR: Use_OpenSSL is not defined, you should not use this UNIT!'}

+ 1 - 1
src/core/UFileStorage.pas

@@ -24,7 +24,7 @@ interface
 
 uses
   Classes, {$IFnDEF FPC}Windows,{$ENDIF} UBlockChain, SyncObjs, UThread, UAccounts, UCrypto;
-{$I config.inc}
+{$I ./../config.inc}
 
 Type
   TBlockHeader = Record

+ 6 - 2
src/core/UNode.pas

@@ -38,7 +38,7 @@ uses
   {$IFNDEF FPC}System.Generics.Collections{$ELSE}Generics.Collections{$ENDIF},
   UBlockChain, UNetProtocol, UAccounts, UCrypto, UThread, SyncObjs, ULog, UBaseTypes, UPCOrderedLists;
 
-{$I config.inc}
+{$I ./../config.inc}
 
 Type
 
@@ -873,7 +873,11 @@ end;
 
 class function TNode.NodeVersion: String;
 begin
-  Result := CT_ClientAppVersion{$IFDEF LINUX}+'L'{$ELSE}+'W'{$ENDIF}{$IFDEF FPC}{$IFDEF LCL}+'l'{$ELSE}+'f'{$ENDIF}{$ENDIF}{$IFDEF FPC}{$IFDEF CPU32}+'32b'{$ELSE}+'64b'{$ENDIF}{$ELSE}{$IFDEF CPU32BITS}+'32b'{$ELSE}+'64b'{$ENDIF}{$ENDIF};
+  Result := CT_ClientAppVersion
+    {$IFDEF LINUX}+'L'{$ELSE}+'W'{$ENDIF}
+    {$IFDEF FPC}{$IFDEF LCL}+'l'{$ELSE}+'f'{$ENDIF}{$ENDIF}
+    {$IFDEF FPC}{$IFDEF CPU32}+'32b'{$ELSE}+'64b'{$ENDIF}{$ELSE}{$IFDEF CPU32BITS}+'32b'{$ELSE}+'64b'{$ENDIF}{$ENDIF}
+    {$IFDEF Use_CryptoLib4Pascal}+'CL4P'{$ENDIF};
 end;
 
 procedure TNode.Notification(AComponent: TComponent; Operation: TOperation);

+ 1 - 1
src/core/UOpenSSL.pas

@@ -26,7 +26,7 @@ interface
   {$MODE Delphi}
 {$ENDIF}
 
-{$I config.inc}
+{$I ./../config.inc}
 
 {$IFDEF ANDROID}
 Uses UBaseTypes;

+ 1 - 1
src/core/UPCEncryption.pas

@@ -34,7 +34,7 @@ interface
   {$MODE Delphi}
 {$ENDIF}
 
-{$I config.inc}
+{$I ./../config.inc}
 
 {$IF (not Defined(Use_OpenSSL)) and (not Defined(Use_CryptoLib4Pascal))}
   {$Message Fatal 'ERROR: Use_OpenSSL or Use_CryptoLib4Pascal are not defined, you need to at least define one!'}

+ 1 - 1
src/core/UPCHardcodedRandomHashTable.pas

@@ -20,7 +20,7 @@ unit UPCHardcodedRandomHashTable;
   {$MODE Delphi}
 {$ENDIF}
 
-{$I config.inc}
+{$I ./../config.inc}
 
 interface
 

+ 1 - 1
src/core/UPCOpenSSLSignature.pas

@@ -31,7 +31,7 @@ interface
 {$ENDIF}
 
 
-{$I config.inc}
+{$I ./../config.inc}
 
 {$IF (not Defined(Use_OpenSSL))}
   {$Message Fatal 'ERROR: Use_OpenSSL is not defined!'}

+ 1 - 1
src/core/UPCOperationsBlockValidator.pas

@@ -28,7 +28,7 @@ unit UPCOperationsBlockValidator;
 
 interface
 
-{$I config.inc}
+{$I ./../config.inc}
 
 {$IFDEF FPC}
   {$MODE Delphi}

+ 5 - 2
src/core/UPCOperationsSignatureValidator.pas

@@ -28,7 +28,7 @@ unit UPCOperationsSignatureValidator;
 
 interface
 
-{$I config.inc}
+{$I ./../config.inc}
 
 {$IFDEF FPC}
   {$MODE Delphi}
@@ -329,7 +329,10 @@ begin
         try
           LIsValid := LOperation.IsValidSignatureBasedOnCurrentSafeboxState(FValidator.FSafeBoxTransaction);
         except
-          LIsValid := False;
+          On E:Exception do begin
+            LIsValid := False;
+            TLog.NewLog(lterror,ClassName,LOperation.ToString+' ERROR: ('+E.ClassName+') '+E.Message);
+          end;
         end;
         FValidator.SetOperationCheckResult(Self,LOperation, LIsValid);
       end;

+ 1 - 1
src/core/UPCRPCOpData.pas

@@ -22,7 +22,7 @@ unit UPCRPCOpData;
 
 interface
 
-{$I config.inc}
+{$I ./../config.inc}
 
 Uses classes, SysUtils,
   UJSONFunctions, UAccounts, UBaseTypes, UOpTransaction, UConst,

+ 1 - 1
src/core/UPCSafeBoxRootHash.pas

@@ -86,7 +86,7 @@ unit UPCSafeBoxRootHash;
 
 interface
 
-{$I config.inc}
+{$I ./../config.inc}
 uses
   Classes, SysUtils, UConst, UCrypto, SyncObjs, UThread, UBaseTypes,
   UPCOrderedLists, UPCDataTypes,

+ 1 - 1
src/core/UPCTNetDataExtraMessages.pas

@@ -26,7 +26,7 @@ unit UPCTNetDataExtraMessages;
 
 interface
 
-{$I config.inc}
+{$I ./../config.inc}
 
 {$IFDEF FPC}
   {$MODE Delphi}

+ 1 - 1
src/core/UPoolMinerThreads.pas

@@ -22,7 +22,7 @@ unit UPoolMinerThreads;
 
 interface
 
-{$I config.inc}
+{$I ./../config.inc}
 
 uses
   Classes, SysUtils, syncobjs, UThread, UPoolMining, UAccounts, UCrypto, ULog, UBlockChain, USha256, URandomHash, URandomHash2, UBaseTypes, UCommon,

+ 1 - 1
src/core/UPoolMining.pas

@@ -22,7 +22,7 @@ unit UPoolMining;
 
 interface
 
-{$I config.inc}
+{$I ./../config.inc}
 
 Uses
 {$IFnDEF FPC}

+ 1 - 1
src/core/URPC.pas

@@ -22,7 +22,7 @@ unit URPC;
 
 interface
 
-{$I config.inc}
+{$I ./../config.inc}
 
 Uses UThread, ULog, UConst, UNode, UAccounts, UCrypto, UBlockChain,
   UNetProtocol, UOpTransaction, UWallet, UTime, UPCEncryption, UTxMultiOperation,

+ 1 - 1
src/core/USettings.pas

@@ -20,7 +20,7 @@ unit USettings;
   {$mode delphi}
 {$ENDIF}
 
-{$I config.inc}
+{$I ./../config.inc}
 
 interface
 

+ 1 - 1
src/core/UTCPIP.pas

@@ -22,7 +22,7 @@ interface
   {$mode delphi}
 {$ENDIF}
 
-{$I config.inc}
+{$I ./../config.inc}
 
 {
   Change log: 2019-01-31

+ 1 - 1
src/core/UThread.pas

@@ -36,7 +36,7 @@ uses
   {$IFNDEF FPC}System.Generics.Collections{$ELSE}Generics.Collections{$ENDIF},
   Classes, SyncObjs, SysUtils, UBaseTypes;
 
-{$I config.inc}
+{$I ./../config.inc}
 
 Type
   TPCCriticalSection = Class(TCriticalSection)

+ 1 - 1
src/core/UWallet.pas

@@ -22,7 +22,7 @@ unit UWallet;
 
 interface
 
-{$I config.inc}
+{$I ./../config.inc}
 
 {$IFDEF ANDROID}
   {$UNDEF INTERNAL_USE_SETTINGS_UNIT}

+ 28 - 0
src/gui-classic/UFRMWallet.dfm

@@ -633,6 +633,10 @@ object FRMWallet: TFRMWallet
         object tsMultiSelectAccounts: TTabSheet
           Caption = 'Selected Accounts For Batch Operation'
           ImageIndex = 1
+          ExplicitLeft = 0
+          ExplicitTop = 0
+          ExplicitWidth = 0
+          ExplicitHeight = 0
           object dgSelectedAccounts: TDrawGrid
             Left = 41
             Top = 31
@@ -824,6 +828,10 @@ object FRMWallet: TFRMWallet
     object tsPendingOperations: TTabSheet
       Caption = 'Pending Operations'
       ImageIndex = 5
+      ExplicitLeft = 0
+      ExplicitTop = 0
+      ExplicitWidth = 0
+      ExplicitHeight = 0
       object dgPendingOperations: TDrawGrid
         Left = 0
         Top = 86
@@ -870,6 +878,10 @@ object FRMWallet: TFRMWallet
     object tsBlockChain: TTabSheet
       Caption = 'Block Explorer'
       ImageIndex = 1
+      ExplicitLeft = 0
+      ExplicitTop = 0
+      ExplicitWidth = 0
+      ExplicitHeight = 0
       object Panel2: TPanel
         Left = 0
         Top = 0
@@ -962,6 +974,10 @@ object FRMWallet: TFRMWallet
     object tsOperations: TTabSheet
       Caption = 'Operations Explorer'
       ImageIndex = 1
+      ExplicitLeft = 0
+      ExplicitTop = 0
+      ExplicitWidth = 0
+      ExplicitHeight = 0
       object Panel1: TPanel
         Left = 0
         Top = 0
@@ -1010,6 +1026,10 @@ object FRMWallet: TFRMWallet
     object tsLogs: TTabSheet
       Caption = 'Logs'
       ImageIndex = 2
+      ExplicitLeft = 0
+      ExplicitTop = 0
+      ExplicitWidth = 0
+      ExplicitHeight = 0
       object pnlTopLogs: TPanel
         Left = 0
         Top = 0
@@ -1041,6 +1061,10 @@ object FRMWallet: TFRMWallet
     object tsNodeStats: TTabSheet
       Caption = 'Node Stats'
       ImageIndex = 3
+      ExplicitLeft = 0
+      ExplicitTop = 0
+      ExplicitWidth = 0
+      ExplicitHeight = 0
       DesignSize = (
         857
         438)
@@ -1110,6 +1134,10 @@ object FRMWallet: TFRMWallet
     object tsMessages: TTabSheet
       Caption = 'Messages'
       ImageIndex = 6
+      ExplicitLeft = 0
+      ExplicitTop = 0
+      ExplicitWidth = 0
+      ExplicitHeight = 0
       DesignSize = (
         857
         438)

+ 4 - 2
src/gui-classic/UFRMWallet.pas

@@ -1671,6 +1671,8 @@ begin
     F := TFRMMemoText.Create(Self);
     Try
       F.Caption := title;
+      strings.add(Format('Agg Hashrate: %s',[FNode.Bank.SafeBox.AggregatedHashrate.ToDecimal]));
+      strings.add(Format('Agg Hashrate: %s',[FNode.Bank.SafeBox.AggregatedHashrate.HexaValue]));
       F.Memo.Lines.Assign(strings);
       F.ShowModal;
     Finally
@@ -2427,7 +2429,7 @@ begin
     LFilters.MinBalance := FMinAccountBalance;
     LFilters.MaxBalance := FMaxAccountBalance;
     if cbExploreMyAccounts.Checked then begin
-      FNode.Bank.SafeBox.StartThreadSafe;
+      //FNode.Bank.SafeBox.StartThreadSafe;
       try
         LFilters.OrderedAccountsKeyList := FWalletKeys.AccountsKeyList;
         if cbMyPrivateKeys.ItemIndex>0 then begin
@@ -2437,7 +2439,7 @@ begin
           end;
         end else LFilters.indexAccountsKeyList := -1;
       finally
-        FNode.Bank.SafeBox.EndThreadSave;
+        //FNode.Bank.SafeBox.EndThreadSave;
       end;
     end else begin
       LFilters.OrderedAccountsKeyList := Nil;

+ 11 - 3
src/gui-classic/UGridUtils.pas

@@ -208,6 +208,7 @@ Type
     TimeAverage50 : Real;
     TimeAverage25 : Real;
     TimeAverage10 : Real;
+    TimeAverage5 : Real;
   End;
 
   TBlockChainGrid = Class;
@@ -274,7 +275,8 @@ Type
   End;
 
 Const
-  CT_TBlockChainData_NUL : TBlockChainData = (Block:0;Timestamp:0;BlockProtocolVersion:0;BlockProtocolAvailable:0;OperationsCount:-1;Volume:-1;Reward:0;Fee:0;Target:0;HashRateTargetHs:0;HashRateHs:0;HashRateTargetKhs:0;HashRateKhs:0;MinerPayload:Nil;PoW:Nil;SafeBoxHash:Nil;TimeAverage200:0;TimeAverage150:0;TimeAverage100:0;TimeAverage75:0;TimeAverage50:0;TimeAverage25:0;TimeAverage10:0);
+  CT_TBlockChainData_NUL : TBlockChainData = (Block:0;Timestamp:0;BlockProtocolVersion:0;BlockProtocolAvailable:0;OperationsCount:-1;Volume:-1;Reward:0;Fee:0;Target:0;HashRateTargetHs:0;HashRateHs:0;HashRateTargetKhs:0;HashRateKhs:0;MinerPayload:Nil;PoW:Nil;SafeBoxHash:Nil;
+    TimeAverage200:0;TimeAverage150:0;TimeAverage100:0;TimeAverage75:0;TimeAverage50:0;TimeAverage25:0;TimeAverage10:0;TimeAverage5:0);
   CT_TAccountsGridFilter_NUL : TAccountsGridFilter = (MinBalance:-1;MaxBalance:-1;OrderedAccountsKeyList:Nil;indexAccountsKeyList:-1);
 
 implementation
@@ -1443,6 +1445,7 @@ begin
         bcd.TimeAverage50:=ANode.Bank.GetTargetSecondsAverage(bcd.Block,50);
         bcd.TimeAverage25:=ANode.Bank.GetTargetSecondsAverage(bcd.Block,25);
         bcd.TimeAverage10:=ANode.Bank.GetTargetSecondsAverage(bcd.Block,10);
+        bcd.TimeAverage5:=ANode.Bank.GetTargetSecondsAverage(bcd.Block,5);
         AList.Add(bcd);
         if (ABlockEnd>0) then dec(ABlockEnd) else Break;
       end;
@@ -1660,8 +1663,13 @@ begin
         s := Format('%.2f',[deviation])+' %';
         Canvas_TextRect(DrawGrid.Canvas,Rect,s,State,[tfRight,tfVerticalCenter,tfSingleLine]);
       end else if ACol=13 then begin
-        s := Format('200:%.1f 150:%.1f 100:%.1f 75:%.1f 50:%.1f 25:%.1f 10:%.1f',[bcd.TimeAverage200,
-           bcd.TimeAverage150,bcd.TimeAverage100,bcd.TimeAverage75,bcd.TimeAverage50,bcd.TimeAverage25,bcd.TimeAverage10]);
+        s := Format('200:%.1f 150:%.1f 100:%.1f 50:%.1f 25:%.1f 10:%.1f 5:%.1f',[bcd.TimeAverage200,
+           bcd.TimeAverage150,
+           bcd.TimeAverage100,
+           bcd.TimeAverage50,
+           bcd.TimeAverage25,
+           bcd.TimeAverage10,
+           bcd.TimeAverage5]);
         Canvas_TextRect(DrawGrid.Canvas,Rect,s,State,[tfLeft,tfVerticalCenter,tfSingleLine]);
       end;
     end;

+ 1 - 28
src/libraries/cryptolib4pascal/ClpECAlgorithms.pas

@@ -393,12 +393,6 @@ begin
 
   result := ImplShamirsTrickWNaf(preCompP, preCompNegP, wnafP, preCompQ,
     preCompNegQ, wnafQ);
-
-  infoP.PreComp := Nil; // Review
-  infoP.PreCompNeg := Nil; // Review
-  infoQ.PreComp := Nil; // Review
-  infoQ.PreCompNeg := Nil; // Review
-
 end;
 
 class function TECAlgorithms.ImplShamirsTrickWNaf(const p: IECPoint;
@@ -435,10 +429,6 @@ begin
   then
   begin
     result := ImplShamirsTrickFixedPoint(p, k, q, l);
-    infoP.PreComp := Nil; // Review
-    infoP.PreCompNeg := Nil; // Review
-    infoQ.PreComp := Nil; // Review
-    infoQ.PreCompNeg := Nil; // Review
     Exit;
   end;
 
@@ -486,10 +476,6 @@ begin
 
   result := ImplShamirsTrickWNaf(preCompP, preCompNegP, wnafP, preCompQ,
     preCompNegQ, wnafQ);
-  infoP.PreComp := Nil; // Review
-  infoP.PreCompNeg := Nil; // Review
-  infoQ.PreComp := Nil; // Review
-  infoQ.PreCompNeg := Nil; // Review
 end;
 
 class function TECAlgorithms.ImplShamirsTrickWNaf(const preCompP,
@@ -642,13 +628,6 @@ begin
   end;
 
   result := ImplSumOfMultiplies(negs, infos, wnafs);
-
-  for i := System.Low(infos) to System.High(infos) do
-  begin
-    infos[i].PreComp := Nil; // Review
-    infos[i].PreCompNeg := Nil; // Review
-  end;
-
 end;
 
 class function TECAlgorithms.ImplSumOfMultiplies
@@ -684,13 +663,6 @@ begin
   end;
 
   result := ImplSumOfMultiplies(negs, infos, wnafs);
-
-  for i := System.Low(infos) to System.High(infos) do
-  begin
-    infos[i].PreComp := Nil; // Review
-    infos[i].PreCompNeg := Nil; // Review
-  end;
-
 end;
 
 class function TECAlgorithms.ImplSumOfMultiplies
@@ -1067,3 +1039,4 @@ begin
 end;
 
 end.
+