diff options
author | Ulf Möller <ulf@openssl.org> | 2000-01-21 17:50:27 +0000 |
---|---|---|
committer | Ulf Möller <ulf@openssl.org> | 2000-01-21 17:50:27 +0000 |
commit | 60b5245360a70f4b10a6c77aa0bf5ee04b2e7262 (patch) | |
tree | 2de908febe44ee615faf54ddd405e163d72c3f63 /crypto/rand | |
parent | 5d82c5b3f425b13d9e75db8b21db92a8cf22159b (diff) |
Document RAND library.
Diffstat (limited to 'crypto/rand')
-rw-r--r-- | crypto/rand/md_rand.c | 9 | ||||
-rw-r--r-- | crypto/rand/randfile.c | 1 |
2 files changed, 5 insertions, 5 deletions
diff --git a/crypto/rand/md_rand.c b/crypto/rand/md_rand.c index 7b8cde9401..1a840220fc 100644 --- a/crypto/rand/md_rand.c +++ b/crypto/rand/md_rand.c @@ -184,17 +184,18 @@ static void ssleay_rand_add(const void *buf, int num, int add) #endif /* - * (Based on doc/ssleay.txt, section rand.doc:) + * (Based on the rand(3) manpage) * * The input is chopped up into units of 16 bytes (or less for - * the last block). Each of these blocks is run through the MD5 - * message digest as follow: The data passed to the MD5 digest + * the last block). Each of these blocks is run through the hash + * function as follow: The data passed to the hash function * is the current 'md', the same number of bytes from the 'state' * (the location determined by in incremented looping index) as * the current 'block', the new key data 'block', and 'count' * (which is incremented after each use). * The result of this is kept in 'md' and also xored into the - * 'state' at the same locations that were used as input into the MD5. + * 'state' at the same locations that were used as input into the + * hash function. */ CRYPTO_w_lock(CRYPTO_LOCK_RAND); diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c index cf98643d3c..e9721f66c2 100644 --- a/crypto/rand/randfile.c +++ b/crypto/rand/randfile.c @@ -92,7 +92,6 @@ int RAND_load_file(const char *file, long bytes) i=stat(file,&sb); /* If the state fails, put some crap in anyway */ RAND_add(&sb,sizeof(sb),0); - ret+=sizeof(sb); if (i < 0) return(0); if (bytes <= 0) return(ret); |