class JitterentropyCollector

Defined at line 27 of file ../../zircon/kernel/lib/crypto/include/lib/crypto/entropy/jitterentropy_collector.h

An implementation of crypto::entropy::Collector that uses jitterentropy as

its entropy source. Ultimately, the entropy is derived from variations in

CPU timing, when various code blocks are exercised.

TODO(andrewkrieger): Document jitterentropy better for Zircon, then link to

that documentation here.

Public Methods

zx_status_t GetInstance (Collector ** ptr)

Gets the global JitterentropyCollector instance. Returns

ZX_ERR_NOT_SUPPORTED if jitterentropy is not supported (usually because

the system clock is not available or not suitable).

This function must be called once in a single-threaded context to

initialize the JitterentropyCollector instance. After one successful call

(typically during boot), it's safe to call this function from multiple

threads, and to access the JitterentropyCollector instance from multiple

threads. The JitterentropyCollector::DrawEntropy method is internally

guarded by a mutex, so it's safe to call from multiple threads but it may

block.

Defined at line 34 of file ../../zircon/kernel/lib/crypto/entropy/jitterentropy_collector.cc

size_t DrawEntropy (uint8_t * buf, size_t len)

Inherited from Collector; see comments there.

Note that this method internally uses a mutex to prevent multiple

accesses. It is safe to call this method from multiple threads, but it

may block.

TODO(andrewkrieger): Determine what level of thread safety is needed for

RNG reseeding, and support it more uniformly (e.g. have a thread safety

contract for Collector::DrawEntropy, obeyed by all implementations).

Defined at line 94 of file ../../zircon/kernel/lib/crypto/entropy/jitterentropy_collector.cc

Friends

class Access