/** * Base constructor. * * @param size the number of messages on the board we are issuing challenges on. * @param stepNo the number of the step in the shuffling process. * @param seed a random seed for creating index numbers to challenge on - must be at least 55 bytes. */ public SeededChallenger(Integer size, Integer stepNo, byte[] seed) { this.counter = 0; this.startIndex = 0; this.bitSet = buildBitSet(size, new HashSP800DRBG(new SHA256Digest(), 256, new SingleEntropySourceProvider(seed).get(440), null, null)); this.isMirror = (((seed[seed.length - 1] & 0xff) + stepNo) & 0x01) == 0; this.max = (isMirror) ? (size - (size / 2)) : (size / 2); }
public SP80090DRBG get(EntropySource entropySource) { return new HashSP800DRBG(digest, securityStrength, entropySource, personalizationString, nonce); }