Browse Source

manually called static constructor

Ugochukwu Mmaduekwe 6 years ago
parent
commit
52dd9bb5b7

+ 2 - 0
CryptoLib/src/Security/ClpSecureRandom.pas

@@ -32,6 +32,7 @@ uses
   ClpIDigest,
   ClpIDigest,
   ClpIRandomGenerator,
   ClpIRandomGenerator,
   ClpRandom,
   ClpRandom,
+  ClpOSRandom,
   ClpDigestUtilities,
   ClpDigestUtilities,
   ClpCryptoApiRandomGenerator,
   ClpCryptoApiRandomGenerator,
   ClpICryptoApiRandomGenerator,
   ClpICryptoApiRandomGenerator,
@@ -324,6 +325,7 @@ begin
     Fmaster := TSecureRandom.Create(TCryptoApiRandomGenerator.Create()
     Fmaster := TSecureRandom.Create(TCryptoApiRandomGenerator.Create()
       as ICryptoApiRandomGenerator);
       as ICryptoApiRandomGenerator);
     FDoubleScale := Power(2.0, 64.0);
     FDoubleScale := Power(2.0, 64.0);
+    TOSRandom.Boot;
   end;
   end;
 end;
 end;
 
 

+ 1 - 2
CryptoLib/src/Utils/Randoms/ClpOSRandom.pas

@@ -317,11 +317,10 @@ type
       : Int32; static;
       : Int32; static;
 {$ENDIF}
 {$ENDIF}
     // ================================================================//
     // ================================================================//
-
-    class procedure Boot(); static;
     class constructor OSRandom();
     class constructor OSRandom();
 
 
   public
   public
+    class procedure Boot(); static;
     class procedure GetBytes(const data: TCryptoLibByteArray); static;
     class procedure GetBytes(const data: TCryptoLibByteArray); static;
     class procedure GetNonZeroBytes(const data: TCryptoLibByteArray); static;
     class procedure GetNonZeroBytes(const data: TCryptoLibByteArray); static;