public class EntropyUtil
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
EntropyUtil.WindowStats |
Constructor and Description |
---|
EntropyUtil() |
Modifier and Type | Method and Description |
---|---|
static EntropyUtil.WindowStats |
createStats()
Create an initial stats object.
|
static byte[] |
generateSeed(EntropySource entropySource,
int numBytes)
Generate numBytes worth of entropy from the passed in entropy source.
|
static java.lang.String |
isNotStuck(byte prev,
byte[] current)
SP 800-90B, 4.4.1: Return true if the entropy source is stuck.
|
static java.lang.String |
isProportionate(EntropyUtil.WindowStats stats,
byte[] current)
SP 800-90B, 4.4.2: Return true if the entropy is proportionate.
|
public static byte[] generateSeed(EntropySource entropySource, int numBytes)
entropySource
- the entropy source to request the data from.numBytes
- the number of bytes of entropy requested.public static java.lang.String isNotStuck(byte prev, byte[] current)
prev
- the last byte of the previous buffer.current
- the current set of entropy samples.public static java.lang.String isProportionate(EntropyUtil.WindowStats stats, byte[] current)
current
- the current sampling of entropy to scan.public static EntropyUtil.WindowStats createStats()