01: package org.bouncycastle.crypto.prng;
02:
03: /**
04: * Generic interface for objects generating random bytes.
05: */
06: public interface RandomGenerator {
07: /**
08: * Add more seed material to the generator.
09: *
10: * @param seed a byte array to be mixed into the generator's state.
11: */
12: void addSeedMaterial(byte[] seed);
13:
14: /**
15: * Add more seed material to the generator.
16: *
17: * @param seed a long value to be mixed into the generator's state.
18: */
19: void addSeedMaterial(long seed);
20:
21: /**
22: * Fill bytes with random values.
23: *
24: * @param bytes byte array to be filled.
25: */
26: void nextBytes(byte[] bytes);
27:
28: /**
29: * Fill part of bytes with random values.
30: *
31: * @param bytes byte array to be filled.
32: * @param start index to start filling at.
33: * @param len length of segment to fill.
34: */
35: void nextBytes(byte[] bytes, int start, int len);
36:
37: }
|