Selaa lähdekoodia

PIP-0009: fixes to cosmetic fixes

Herman Schoenfeld 6 vuotta sitten
vanhempi
commit
6ada5a1ace
2 muutettua tiedostoa jossa 4 lisäystä ja 4 poistoa
  1. 2 2
      PIP/PIP-0009.md
  2. 2 2
      src/core/URandomHash.pas

+ 2 - 2
PIP/PIP-0009.md

@@ -439,12 +439,12 @@ The total memory consumed (in units M) is denoted ```G(N)```, and is simply the
 ```
     G(N) = M * sum(i=1, N) TotalMemoryAtRound(i)
          = M * sum(i=1, N) 2^(N-i) * (N-i)
-         = M * 2^N (N-2) + 2
+         = M * (2^N (N-2) + 2)
 ```
 
 Thus,
 ```
-    G(N) = M * 2^N (N-2) + 2
+    G(N) = M * (2^N (N-2) + 2)
 ```
 
 **NOTE**: For PascalCoin, ```N=5``` which results ```98``` units of memory for every single nonce. Choosing memory unit ```M=50kb``` results in approximately ```4.8MB``` per nonce. Quite low for a CPU, but bloats quickly for a GPU as mentioned below.

+ 2 - 2
src/core/URandomHash.pas

@@ -111,8 +111,8 @@ type
 
   TRandomHash = class sealed(TObject)
     const
-      N = 5;               // Number of hashing rounds required to compute a nonce (total rounds = 2^N - 1)
-      M = (10 * 1024) * 5; // The memory expansion unit (in bytes), total bytes =
+      N = 5;               // Number of hashing rounds required to compute a nonce, total rounds = 2^N
+      M = (10 * 1024) * 5; // The memory expansion unit (in bytes), total bytes per nonce = M * (2^N (N-2) + 2)
 
     {$IFNDEF UNITTESTS}private{$ELSE}public{$ENDIF}
       FMurmurHash3_x86_32 : IHash;