提交 0b5cfe32 编写于 作者: U Ulf Möller

Use comment from md_rand.c in rand.pod

上级 cc8709a0
...@@ -188,7 +188,7 @@ static void ssleay_rand_add(const void *buf, int num, int add) ...@@ -188,7 +188,7 @@ static void ssleay_rand_add(const void *buf, int num, int add)
* *
* The input is chopped up into units of 16 bytes (or less for * The input is chopped up into units of 16 bytes (or less for
* the last block). Each of these blocks is run through the hash * the last block). Each of these blocks is run through the hash
* function as follow: The data passed to the hash function * function as follows: The data passed to the hash function
* is the current 'md', the same number of bytes from the 'state' * is the current 'md', the same number of bytes from the 'state'
* (the location determined by in incremented looping index) as * (the location determined by in incremented looping index) as
* the current 'block', the new key data 'block', and 'count' * the current 'block', the new key data 'block', and 'count'
......
...@@ -106,13 +106,16 @@ working hash function ('md') and a counter ('count'). ...@@ -106,13 +106,16 @@ working hash function ('md') and a counter ('count').
Whenever seed data is added, it is inserted into the 'state' as Whenever seed data is added, it is inserted into the 'state' as
follows. follows.
The input is chopped up into units of 16 bytes (or less for the last The input is chopped up into units of 16 bytes (or less for
block). Each of these blocks is run through the hash function. The the last block). Each of these blocks is run through the hash
data passed to the hash function is the current 'md', the same number function as follows: The data passed to the hash function
of bytes from the 'state' (the location determined by in incremented is the current 'md', the same number of bytes from the 'state'
looping index) as the current 'block' and the new key data 'block'. (the location determined by in incremented looping index) as
The result of this is kept in 'md' and also xored into the 'state' at the current 'block', the new key data 'block', and 'count'
the same locations that were used as input into the hash function. I (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
hash function. I
believe this system addresses points 1 (hash function; currently believe this system addresses points 1 (hash function; currently
SHA-1), 3 (the 'state'), 4 (via the 'md'), 5 (by the use of a hash SHA-1), 3 (the 'state'), 4 (via the 'md'), 5 (by the use of a hash
function and xor). function and xor).
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册