Example usage for org.bouncycastle.crypto.prng.drbg SP80090DRBG generate

List of usage examples for org.bouncycastle.crypto.prng.drbg SP80090DRBG generate

Introduction

In this page you can find the example usage for org.bouncycastle.crypto.prng.drbg SP80090DRBG generate.

Prototype

int generate(byte[] output, byte[] additionalInput, boolean predictionResistant);

Source Link

Document

Populate a passed in array with random data.

Usage

From source file:org.cryptoworkshop.ximix.common.util.challenge.SeededChallenger.java

License:Apache License

private int makePositiveInt(SP80090DRBG drbg) {
    byte[] bytes = new byte[4];

    drbg.generate(bytes, null, false);

    return ((bytes[0] & 0x7f) << 24) | ((bytes[1] & 0xff) << 16) | ((bytes[2] & 0xff) << 8) | (bytes[3] & 0xff);
}