X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/90c7057fc0ae5d85a6443e7633642ef43553ab28..70e049261c2b49411fbc9cefc737bc18ee6c4365:/lcorernd.pas?ds=inline diff --git a/lcorernd.pas b/lcorernd.pas index 3a8ea0c..7dbd7f1 100644 --- a/lcorernd.pas +++ b/lcorernd.pas @@ -15,7 +15,7 @@ written by Bas Steendijk (beware) the aim of this unit is to provide randomness in a consistent way, using OS specific methods for seeding this unit uses MD5 for performance and code size, but it is made so it is easy to use a different hash, -as long as it is atleat 128 bits, and a multiple of the "word size" (32 bits) +as long as it is at least 128 bits, and a multiple of the "word size" (32 bits) goals: @@ -25,20 +25,20 @@ goals: - for the numbers to be - random: pass diehard and similar tests - - unique: generate UUID's + - unique: generate UUIDs - secure: difficult for a remote attacker to guess the internal state, even when given some output typical intended uses: - anything that needs random numbers without extreme demands on security or speed should be able to use this - - seeding other (faster) RNG's - - generation of passwords, UUID's, cookies, and session keys + - seeding other (faster) RNGs + - generation of passwords, UUIDs, cookies, and session keys - randomizing protocol fields to protect against spoofing attacks - randomness for games this is not intended to be directly used for: -- high securirity purposes (generating RSA root keys etc) +- high security purposes (generating RSA root keys etc) - needing random numbers at very high rates (disk wiping, some simulations, etc) performance: @@ -180,7 +180,7 @@ const hashpasssize=48; {this number has to be small enough that hashing this size uses only one block transform} var - {the seed part of this buffer must be atleast as big as the OS seed (windows: 104 bytes, unix: 36 bytes)} + {the seed part of this buffer must be at least as big as the OS seed (windows: 104 bytes, unix: 36 bytes)} pool:array[0..(pooldwords+seeddwords-1)] of wordtype; reseedcountdown:integer; @@ -259,7 +259,7 @@ var f:file; a:integer; l:packed record - devrnd:array[0..3] of integer; + devrnd:array[0..7] of integer; rdtscbuf:array[0..1] of integer; tv:ttimeval; pid:integer;