// public constructors public DigestRandomGenerator(Digest digest) { this.digest = digest; this.seed = new byte[digest.getDigestSize()]; this.seedCounter = 1; this.state = new byte[digest.getDigestSize()]; this.stateCounter = 1; }
private void digestDoFinal(byte[] result) { digest.doFinal(result, 0); }
private void digestUpdate(byte[] inSeed) { digest.update(inSeed, 0, inSeed.length); }
private void digestAddCounter(long seed) { for (int i = 0; i != 8; i++) { digest.update((byte) seed); seed >>>= 8; } }