Yarrow algorithm

The Yarrow algorithm is a family of cryptographic pseudorandom number generators (CSPRNG) devised by John Kelsey, Bruce Schneier, and Niels Ferguson and published in 1999.

Fortunetellers divide a set of 50 yarrow stalks into piles and use modular arithmetic recursively to generate two bits of random information[4] that have a non-uniform distribution.

Yarrow's main design principles are: resistance to attacks, easy use by programmers with no cryptography background, and reusability of existing building blocks.

The former widely used designs such as ANSI X9.17 and RSAREF 2.0 PRNG have loopholes that provide attack opportunities under some circumstances.

Yarrow also aims to provide easy integration, to enable system designers with little knowledge of PRNG functionality.

The designers accumulate entropy in the purpose of keeping the ability to recover the PRNG even when the key is compromised.

Once some system security parameter Pg is reached, the algorithm will generate k bits of PRNG output and use them as the new key.

Functions for generation mechanism