Package org.bouncycastle.pqc.crypto.test
Class NISTSecureRandom
java.lang.Object
java.util.Random
java.security.SecureRandom
org.bouncycastle.pqc.crypto.test.NISTSecureRandom
- All Implemented Interfaces:
Serializable,java.util.random.RandomGenerator
for producing FixedSecureRandom objects for use with testing
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.random.RandomGenerator
java.util.random.RandomGenerator.ArbitrarilyJumpableGenerator, java.util.random.RandomGenerator.JumpableGenerator, java.util.random.RandomGenerator.LeapableGenerator, java.util.random.RandomGenerator.SplittableGenerator, java.util.random.RandomGenerator.StreamableGenerator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FixedSecureRandomgetFixed(byte[] seed, byte[] personalization, int strength, int discard, int size) static FixedSecureRandomgetFixed(byte[] seed, int strength) Return a seeded FixedSecureRandom representing the result of processing a CMCE test seed with the CMCE RandomNumberGenerator.static FixedSecureRandomgetFixedNoDiscard(byte[] seed, int strength) voidnextBytes(byte[] x) Methods inherited from class java.security.SecureRandom
generateSeed, getAlgorithm, getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getInstanceStrong, getParameters, getProvider, getSeed, next, nextBytes, reseed, reseed, setSeed, setSeed, toStringMethods inherited from class java.util.Random
doubles, doubles, doubles, doubles, ints, ints, ints, ints, longs, longs, longs, longs, nextBoolean, nextDouble, nextFloat, nextGaussian, nextInt, nextInt, nextLongMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.random.RandomGenerator
isDeprecated, nextDouble, nextDouble, nextExponential, nextFloat, nextFloat, nextGaussian, nextInt, nextLong, nextLong
-
Constructor Details
-
NISTSecureRandom
public NISTSecureRandom(byte[] seed, byte[] personalization)
-
-
Method Details
-
getFixed
Return a seeded FixedSecureRandom representing the result of processing a CMCE test seed with the CMCE RandomNumberGenerator.- Parameters:
seed- original CMCE seedstrength- bit-strength of the RNG required.- Returns:
- a FixedSecureRandom containing the correct amount of seed material for use with Java.
-
getFixed
public static FixedSecureRandom getFixed(byte[] seed, byte[] personalization, int strength, int discard, int size) -
getFixedNoDiscard
-
nextBytes
public void nextBytes(byte[] x) - Specified by:
nextBytesin interfacejava.util.random.RandomGenerator- Overrides:
nextBytesin classSecureRandom
-