changed print to an exception
import java.math.BigInteger;
import java.security.SecureRandom;
-import java.util.logging.Level;
import org.bouncycastle.crypto.AsymmetricCipherKeyPair;
import org.bouncycastle.crypto.AsymmetricCipherKeyPairGenerator;
@@ -249,7 +248,7 @@ public AsymmetricCipherKeyPair DeriveKeyPair(byte[] ikm)
{
if (ikm.length < Nsk)
{
- System.out.println("WARNING: the input keying material should have length at least " + Nsk + "bytes.");
+ throw new IllegalArgumentException("WARNING: the input keying material should have length at least " + Nsk + "bytes.");
}
byte[] suiteID = Arrays.concatenate(Strings.toByteArray("KEM"), Pack.shortToBigEndian(kemId));
switch (kemId)
