pike.git / lib / modules / Crypto / randomness.pmod

version» Context lines:

pike.git/lib/modules/Crypto/randomness.pmod:1: - // $Id: randomness.pmod,v 1.22 2003/01/04 00:36:06 nilsson Exp $ + // $Id: randomness.pmod,v 1.23 2003/01/09 17:43:20 grubba Exp $      //! Assorted stronger or weaker randomnumber generators.   //! These devices try to collect entropy from the environment.   //! They differ in behaviour when they run low on entropy, /dev/random   //! will block if it can't provide enough random bits, while /dev/urandom   //! will degenerate into a reasonably strong pseudo random generator      #pike __REAL_VERSION__      static constant RANDOM_DEVICE = "/dev/random";
pike.git/lib/modules/Crypto/randomness.pmod:23: Inside #if undefined(__NT__)
   "uptime","ps -fel","ps aux",    "vmstat -s","vmstat -M",    "iostat","iostat -cdDItx"   });   #endif      static RandomSource global_arcfour;   static int(0..1) goodseed;      #ifdef __NT__ - static nt_random_string(int len) { + static string nt_random_string(int len) {    object ctx = Crypto.nt.CryptAcquireContext(0, 0, Crypto.nt.PROV_RSA_FULL,    Crypto.nt.CRYPT_VERIFYCONTEXT    /*|Crypto.nt.CRYPT_SILENT*/);    if(!ctx)    error( "Couldn't create crypto context.\n" );       string res = ctx->CryptGenRandom(len);       if(!res)    error( "Couldn't generate randomness.\n" );