Table of Contents

Class: CSPRNG src/entropy.py

Cryptographically Secure Pseudo Random Number Generation.

Based on RandomPool, it uses the thread scheduling entropy pseudo random number generator (TSEPRNG) to add entropic bytes to the pool.

Base Classes   
EntropyPool
Methods   
__init__
tStir
  __init__ 
__init__ ( self,  tStirNow=0 )

Constructs a tgCSPRNG. Set tStirNow to true if you wish to run a threading stir right off the bat using the default settings.

  tStir 
tStir (
        self,
        bufferAmount=4,
        bufferSize=16,
        rounds=3,
        x=0,
        y=0,
        z=0,
        )

Uses thread scheduling entropy to stir really entropic bytes into the random pool. By default, it will produce and stir in 64 bytes. This takes about 0.6 seconds on my 800.

For information about tweaking the thread parameters, see the documentation for the trandom function. And experiment :)

tStir is very resource intensive. Use carefully and only if you require cryptographically strong entropy. Otherwise use whrandom! It is good practice to call tStir to ensure the pool is really entropic, then simply call stir() subsequently.


Table of Contents

This document was automatically generated on Thu Nov 29 11:49:10 2001 by HappyDoc version r1_6_1