Branch: Tag:

2001-11-08

2001-11-08 01:45:39 by Martin Nilsson <mani@lysator.liu.se>

Added some dummy autodoc.

Rev: lib/modules/Crypto/aes.pike:1.3
Rev: lib/modules/Crypto/des3.pike:1.7
Rev: lib/modules/Crypto/des3_cbc.pike:1.5
Rev: lib/modules/Crypto/des_cbc.pike:1.5
Rev: lib/modules/Crypto/dsa.pike:1.10
Rev: lib/modules/Crypto/hmac.pike:1.8
Rev: lib/modules/Crypto/idea_cbc.pike:1.5
Rev: lib/modules/Crypto/randomness.pmod:1.20
Rev: lib/modules/Crypto/rsa.pike:1.29

1: - /* $Id: randomness.pmod,v 1.19 2001/04/27 13:35:23 grubba Exp $ + /* $Id: randomness.pmod,v 1.20 2001/11/08 01:45:39 nilsson Exp $    */    - //! Assorted stronger or weaker randomnumber generators. + //! 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    - /* 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";
89:   }       - //! A pseudo random generator based on the ordinary random() function. + //! A pseudo random generator based on the ordinary random() function.   class pike_random {    -  //! Returns a string of length len with pseudo random values. +  //! Returns a string of length len with pseudo random values.    string read(int len)    {   #if 1 // major optimization /Hubbe
116:   }      #if constant(Crypto.arcfour) - //! A pseudo random generator based on the arcfour crypto. + //! A pseudo random generator based on the arcfour crypto.   class arcfour_random {       inherit Crypto.arcfour : arcfour;    -  //! Initialize and seed the arcfour random generator. +  //! Initialize and seed the arcfour random generator.    void create(string secret)    {    object hash = Crypto.sha();
130: Inside #if constant(Crypto.arcfour)
   arcfour::set_encrypt_key(hash->digest());    }    -  //! Return a string of the next len random characters from the -  //! arcfour random generator. +  //! Return a string of the next len random characters from the +  //! arcfour random generator.    string read(int len)    {    if (len > 16384) return read(len/2)+read(len-len/2);
141:      #endif /* constant(Crypto.arcfour) */    + //!   object reasonably_random()   {    if (file_stat(PRANDOM_DEVICE))
164:    throw( ({ "Crypto.randomness.reasonably_random: No source found\n", backtrace() }) );   }    + //!   object really_random(int|void may_block)   {    object res = Stdio.File();