An Index Generation Function produces a sequence of numbers in the range [0..N-1] for some N.
The IGF2 algorithm is defined in terms of the following inputs:
The algorithm generates an index by reading 'bitsPerIndex' bits off of the input stream. If the result is larger than or equal to the cutoff the value is discarded and a new value is read. Once a value less than the cutoff is found the igf returns (value % N).
In addition to the IGF2 parameters, the default constructor also takes in the parameters needed to initialize an MGF1 byte stream. This is used as the underlying bitstream generator. A secondary constructor is also provided to make testing easier.
|
|
|
|
|
|
|
|
|
|
|
|