Java 类org.bouncycastle.crypto.digests.ShortenedDigest 实例源码

项目:gwt-crypto    文件:MGF1GeneratorTest.java   
public void performTest()
{
    checkMask(1, new MGF1BytesGenerator(new ShortenedDigest(new SHA256Digest(), 20)), seed1, mask1);
    checkMask(2, new MGF1BytesGenerator(new SHA1Digest()), seed2, mask2);
    checkMask(3, new MGF1BytesGenerator(new ShortenedDigest(new SHA256Digest(), 20)), seed3, mask3);

    try
    {
        new MGF1BytesGenerator(new SHA1Digest()).generateBytes(new byte[10], 0, 20);

        fail("short input array not caught");
    }
    catch (DataLengthException e)
    {
        // expected 
    }
}
项目:gwt-crypto    文件:KDF1GeneratorTest.java   
public void performTest()
{
    checkMask(1, new KDF1BytesGenerator(new ShortenedDigest(new SHA256Digest(), 20)), seed1, mask1);
    checkMask(2, new KDF1BytesGenerator(new SHA1Digest()), seed2, mask2);
    checkMask(3, new KDF1BytesGenerator(new ShortenedDigest(new SHA256Digest(), 20)), seed3, mask3);

    try
    {
        new KDF1BytesGenerator(new SHA1Digest()).generateBytes(new byte[10], 0, 20);

        fail("short input array not caught");
    }
    catch (DataLengthException e)
    {
        // expected 
    }
}
项目:gwt-crypto    文件:KDF2GeneratorTest.java   
public void performTest()
{
    checkMask(1, new KDF2BytesGenerator(new ShortenedDigest(new SHA256Digest(), 20)), seed1, mask1);
    checkMask(2, new KDF2BytesGenerator(new ShortenedDigest(new SHA256Digest(), 20)), seed2, mask2);
    checkMask(3, new KDF2BytesGenerator(new SHA256Digest()), seed2, adjustedMask2);
    checkMask(4, new KDF2BytesGenerator(new SHA1Digest()), seed2, sha1Mask);
    checkMask(5, new KDF2BytesGenerator(new SHA1Digest()), seed3, mask3);
    checkMask(6, new KDF2BytesGenerator(new SHA1Digest()), seed4, mask4);

    try
    {
        new KDF2BytesGenerator(new SHA1Digest()).generateBytes(new byte[10], 0, 20);

        fail("short input array not caught");
    }
    catch (DataLengthException e)
    {
        // expected 
    }
}
项目:irma_future_id    文件:MGF1GeneratorTest.java   
public void performTest()
{
    checkMask(1, new MGF1BytesGenerator(new ShortenedDigest(new SHA256Digest(), 20)), seed1, mask1);
    checkMask(2, new MGF1BytesGenerator(new SHA1Digest()), seed2, mask2);
    checkMask(3, new MGF1BytesGenerator(new ShortenedDigest(new SHA256Digest(), 20)), seed3, mask3);

    try
    {
        new MGF1BytesGenerator(new SHA1Digest()).generateBytes(new byte[10], 0, 20);

        fail("short input array not caught");
    }
    catch (DataLengthException e)
    {
        // expected 
    }
}
项目:irma_future_id    文件:KDF1GeneratorTest.java   
public void performTest()
{
    checkMask(1, new KDF1BytesGenerator(new ShortenedDigest(new SHA256Digest(), 20)), seed1, mask1);
    checkMask(2, new KDF1BytesGenerator(new SHA1Digest()), seed2, mask2);
    checkMask(3, new KDF1BytesGenerator(new ShortenedDigest(new SHA256Digest(), 20)), seed3, mask3);

    try
    {
        new KDF1BytesGenerator(new SHA1Digest()).generateBytes(new byte[10], 0, 20);

        fail("short input array not caught");
    }
    catch (DataLengthException e)
    {
        // expected 
    }
}
项目:irma_future_id    文件:KDF2GeneratorTest.java   
public void performTest()
{
    checkMask(1, new KDF2BytesGenerator(new ShortenedDigest(new SHA256Digest(), 20)), seed1, mask1);
    checkMask(2, new KDF2BytesGenerator(new ShortenedDigest(new SHA256Digest(), 20)), seed2, mask2);
    checkMask(3, new KDF2BytesGenerator(new SHA256Digest()), seed2, adjustedMask2);
    checkMask(4, new KDF2BytesGenerator(new SHA1Digest()), seed2, sha1Mask);
    checkMask(5, new KDF2BytesGenerator(new SHA1Digest()), seed3, mask3);
    checkMask(6, new KDF2BytesGenerator(new SHA1Digest()), seed4, mask4);

    try
    {
        new KDF2BytesGenerator(new SHA1Digest()).generateBytes(new byte[10], 0, 20);

        fail("short input array not caught");
    }
    catch (DataLengthException e)
    {
        // expected 
    }
}
项目:bc-java    文件:MGF1GeneratorTest.java   
public void performTest()
{
    checkMask(1, new MGF1BytesGenerator(new ShortenedDigest(new SHA256Digest(), 20)), seed1, mask1);
    checkMask(2, new MGF1BytesGenerator(new SHA1Digest()), seed2, mask2);
    checkMask(3, new MGF1BytesGenerator(new ShortenedDigest(new SHA256Digest(), 20)), seed3, mask3);

    try
    {
        new MGF1BytesGenerator(new SHA1Digest()).generateBytes(new byte[10], 0, 20);

        fail("short input array not caught");
    }
    catch (DataLengthException e)
    {
        // expected 
    }
}
项目:bc-java    文件:KDF1GeneratorTest.java   
public void performTest()
{
    checkMask(1, new KDF1BytesGenerator(new ShortenedDigest(new SHA256Digest(), 20)), seed1, mask1);
    checkMask(2, new KDF1BytesGenerator(new SHA1Digest()), seed2, mask2);
    checkMask(3, new KDF1BytesGenerator(new ShortenedDigest(new SHA256Digest(), 20)), seed3, mask3);

    try
    {
        new KDF1BytesGenerator(new SHA1Digest()).generateBytes(new byte[10], 0, 20);

        fail("short input array not caught");
    }
    catch (DataLengthException e)
    {
        // expected 
    }
}
项目:bc-java    文件:KDF2GeneratorTest.java   
public void performTest()
{
    checkMask(1, new KDF2BytesGenerator(new ShortenedDigest(new SHA256Digest(), 20)), seed1, mask1);
    checkMask(2, new KDF2BytesGenerator(new ShortenedDigest(new SHA256Digest(), 20)), seed2, mask2);
    checkMask(3, new KDF2BytesGenerator(new SHA256Digest()), seed2, adjustedMask2);
    checkMask(4, new KDF2BytesGenerator(new SHA1Digest()), seed2, sha1Mask);
    checkMask(5, new KDF2BytesGenerator(new SHA1Digest()), seed3, mask3);
    checkMask(6, new KDF2BytesGenerator(new SHA1Digest()), seed4, mask4);

    try
    {
        new KDF2BytesGenerator(new SHA1Digest()).generateBytes(new byte[10], 0, 20);

        fail("short input array not caught");
    }
    catch (DataLengthException e)
    {
        // expected 
    }
}