Solaris dev/random
H开发者_如何学Callo,
Which algorithm implements dev/random of Solaris? Is taht Yarrow-160 or Yarrow-256 or is the algorithm the same as in Linux? Is there documentation / link ? I have already looked a lot, but I couldn't find it. Thanks in advance.
Perhaps the OpenSolaris source, in particular /src/uts/common/crypto/io/swrand.c
, has some clues:
/*
* Software based random number provider for the Kernel Cryptographic
* Framework (KCF). This provider periodically collects unpredictable input
* from external sources and processes it into a pool of entropy (randomness)
* in order to satisfy requests for random bits from kCF. It implements
* software-based mixing, extraction, and generation algorithms.
*
* A history note: The software-based algorithms in this file used to be
* part of the /dev/random driver.
*/
Skimming that file: the PRNG is initialized with high-res time from boot, the current TOD and physical memory state and values are generated from repeated SHA1 hashing with additional entropy pool mixing ("churning" in the yarrow specification). SHA1 is 160 bit.
Also of relevance from that file:
#define MINEXTRACTBITS 160 /* Min entropy level for extraction */
From that brief analysis Solaris' /dev/random
looks like a Yarrow-160 implementation.
精彩评论