Java 类org.bouncycastle.crypto.prng.drbg.SP80090DRBG 实例源码

项目:ximix    文件:SeededChallenger.java   
private int nextInt(SP80090DRBG drbg, int range)
{
    if ((range & -range) == range)  // i.e., range is a power of 2
    {
        return (int)((range * (long)makePositiveInt(drbg)) >> 31);
    }

    int bits, val;
    do
    {
        bits = makePositiveInt(drbg);
        val = bits % range;
    }
    while (bits - val + (range - 1) < 0);

    return val;
}
项目:ximix    文件:SeededChallenger.java   
private BitSet buildBitSet(int size, SP80090DRBG drbg)
{
    BitSet bitSet = new BitSet(size);
    int    nBits = size / 2;

    int upper = size - 1;
    int lower = 0;

    for (int i = 0; i != nBits; i++)
    {
        int nIndex = nextInt(drbg, upper - lower + 1) + lower;

        if (bitSet.get(nIndex))
        {
            if ((nIndex & 1) != 0)
            {
                while (bitSet.get(upper))
                {
                    upper--;
                }

                nIndex = upper--;
            }
            else
            {
                while (bitSet.get(lower))
                {
                    lower++;
                }

                nIndex = lower++;
            }
        }

        bitSet.set(nIndex);
    }

    return bitSet;
}
项目:ximix    文件:SeededChallenger.java   
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);
}
项目:ipack    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new HashSP800DRBG(digest, securityStrength, entropySource, personalizationString, nonce);
}
项目:ipack    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new DualECSP800DRBG(digest, securityStrength, entropySource, personalizationString, nonce);
}
项目:ipack    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new HMacSP800DRBG(hMac, securityStrength, entropySource, personalizationString, nonce);
}
项目:ipack    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new CTRSP800DRBG(blockCipher, keySizeInBits, securityStrength, entropySource, personalizationString, nonce);
}
项目:gwt-crypto    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new HashSP800DRBG(digest, securityStrength, entropySource, personalizationString, nonce);
}
项目:gwt-crypto    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new DualECSP800DRBG(digest, securityStrength, entropySource, personalizationString, nonce);
}
项目:gwt-crypto    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new DualECSP800DRBG(pointSet, digest, securityStrength, entropySource, personalizationString, nonce);
}
项目:gwt-crypto    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new HMacSP800DRBG(hMac, securityStrength, entropySource, personalizationString, nonce);
}
项目:gwt-crypto    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new CTRSP800DRBG(blockCipher, keySizeInBits, securityStrength, entropySource, personalizationString, nonce);
}
项目:Aki-SSL    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new HashSP800DRBG(digest, securityStrength, entropySource, personalizationString, nonce);
}
项目:Aki-SSL    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new DualECSP800DRBG(digest, securityStrength, entropySource, personalizationString, nonce);
}
项目:Aki-SSL    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new DualECSP800DRBG(pointSet, digest, securityStrength, entropySource, personalizationString, nonce);
}
项目:Aki-SSL    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new HMacSP800DRBG(hMac, securityStrength, entropySource, personalizationString, nonce);
}
项目:Aki-SSL    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new CTRSP800DRBG(blockCipher, keySizeInBits, securityStrength, entropySource, personalizationString, nonce);
}
项目:TinyTravelTracker    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new HashSP800DRBG(digest, securityStrength, entropySource, personalizationString, nonce);
}
项目:TinyTravelTracker    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new DualECSP800DRBG(digest, securityStrength, entropySource, personalizationString, nonce);
}
项目:TinyTravelTracker    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new DualECSP800DRBG(pointSet, digest, securityStrength, entropySource, personalizationString, nonce);
}
项目:TinyTravelTracker    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new HMacSP800DRBG(hMac, securityStrength, entropySource, personalizationString, nonce);
}
项目:TinyTravelTracker    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new CTRSP800DRBG(blockCipher, keySizeInBits, securityStrength, entropySource, personalizationString, nonce);
}
项目:CryptMeme    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new HashSP800DRBG(digest, securityStrength, entropySource, personalizationString, nonce);
}
项目:CryptMeme    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new DualECSP800DRBG(digest, securityStrength, entropySource, personalizationString, nonce);
}
项目:CryptMeme    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new DualECSP800DRBG(pointSet, digest, securityStrength, entropySource, personalizationString, nonce);
}
项目:CryptMeme    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new HMacSP800DRBG(hMac, securityStrength, entropySource, personalizationString, nonce);
}
项目:CryptMeme    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new CTRSP800DRBG(blockCipher, keySizeInBits, securityStrength, entropySource, personalizationString, nonce);
}
项目:irma_future_id    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new HashSP800DRBG(digest, securityStrength, entropySource, personalizationString, nonce);
}
项目:irma_future_id    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new DualECSP800DRBG(digest, securityStrength, entropySource, personalizationString, nonce);
}
项目:irma_future_id    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new HMacSP800DRBG(hMac, securityStrength, entropySource, personalizationString, nonce);
}
项目:irma_future_id    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new CTRSP800DRBG(blockCipher, keySizeInBits, securityStrength, entropySource, personalizationString, nonce);
}
项目:irma_future_id    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new HashSP800DRBG(digest, securityStrength, entropySource, personalizationString, nonce);
}
项目:irma_future_id    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new DualECSP800DRBG(digest, securityStrength, entropySource, personalizationString, nonce);
}
项目:irma_future_id    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new HMacSP800DRBG(hMac, securityStrength, entropySource, personalizationString, nonce);
}
项目:irma_future_id    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new CTRSP800DRBG(blockCipher, keySizeInBits, securityStrength, entropySource, personalizationString, nonce);
}
项目:bc-java    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new HashSP800DRBG(digest, securityStrength, entropySource, personalizationString, nonce);
}
项目:bc-java    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new DualECSP800DRBG(digest, securityStrength, entropySource, personalizationString, nonce);
}
项目:bc-java    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new HMacSP800DRBG(hMac, securityStrength, entropySource, personalizationString, nonce);
}
项目:bc-java    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new CTRSP800DRBG(blockCipher, keySizeInBits, securityStrength, entropySource, personalizationString, nonce);
}
项目:bc-java    文件:SP800SecureRandomBuilder.java   
public SP80090DRBG get(EntropySource entropySource)
{
    return new HashSP800DRBG(digest, securityStrength, entropySource, personalizationString, nonce);
}