eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'RandomRDRand':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: RandomRDRand


Inheritance:

   Object
   |
   +--RandomRDRand

Package:
stx:libbasic2
Category:
Magnitude-Numbers-Random
Version:
rev: 1.6 date: 2018/05/09 23:09:22
user: cg
file: RandomRDRand.st directory: libbasic2
module: stx stc-classLibrary: libbasic2
Author:
Claus Gittinger.

Description:


This generator uses the rdgen random generator which is built into modern intel chips.
Before using, you should check via the isSupported query.

Warning:
    there have been discussions about the security of the intel rdgen instruction
    and whether there are NSA backdoors built into it.
    Linus Torwalds refuses to use it for /dev/urandom in the linux kernel, for that very reason.
    Be sure you know what you are doing, if you use this generator for sensitive cryptographic stuff.
    We recommend using one of the libcrypt-based generators and use this only to get additional
    entropy for the seed.

NO WARRANTY

RandomRDGen new nextInteger


Related information:

    RandomGenerator
    -
    the
    default;
    uses
    the
    machine's
    /dev/random
    if
    available
    Random
    -
    fast,
    but
    generates
    less
    quality
    random
    numbers
    RandomTT800
    -
    another
    random
    generator
    RandomParkMiller
    -
    another
    random
    generator
    RandomMT19937
    -
    another
    random
    generator
    RandomKISS
    -
    another
    random
    generator
    [xept]
    -
    a
    library
    containing
    more
    stuff
    based
    on
    hashes
    and
    cyphers

Class protocol:

instance creation
o  new
self new nextInteger

o  new: seed
seed is actually ignored

queries
o  isSupported
true if this architecture supports hardware random numbers
usage example(s):
     self isSupported


Instance protocol:

initialization
o  initialize

o  seed: seed
ignored

random numbers
o  nextBoolean
generates a boolean random

o  nextInteger
generates the next integer in 0..FFFFFFFF.
Notice, it may raise an illegal instruction exception on some cpu chips,
even though the cpuid instruction says that it is available
usage example(s):
     self new nextInteger



ST/X 7.1.0.0; WebServer 1.663 at exept.de:8081; Thu, 15 Nov 2018 12:34:58 GMT