Its not difficult. The author has a stream of data (random bytes for crypto keys) which needs to be consumed in different bits of the program at different times. The traditional ways are either a global variable holding the current state of the generator or else re-assigning that state to one or more variables in a complicated and error-prone way.