Пример #1
0
  // 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;
  }
Пример #2
0
 private void digestDoFinal(byte[] result) {
   digest.doFinal(result, 0);
 }
Пример #3
0
 private void digestUpdate(byte[] inSeed) {
   digest.update(inSeed, 0, inSeed.length);
 }
Пример #4
0
 private void digestAddCounter(long seed) {
   for (int i = 0; i != 8; i++) {
     digest.update((byte) seed);
     seed >>>= 8;
   }
 }