Examples of NtruEncryptTestVector


Examples of com.securityinnovation.testvectors.NtruEncryptTestVector

    @Test public void test_getPrivKey_known_value()
        throws NtruException
    {
        for (OID oid : OID.values())
        {
            NtruEncryptTestVector test  = findTest(oid);
            byte blob[]      = getPrivKeyBlob(test);
            NtruEncryptKey k = new NtruEncryptKey(blob);
            byte blob2[] = k.getPrivKey();
            assertArrayEquals(blob2, blob);
        }
View Full Code Here

Examples of com.securityinnovation.testvectors.NtruEncryptTestVector

        throws NtruException
    {
        NtruEncryptKey k = null;
        try
        {
            NtruEncryptTestVector test    = findTest(OID.ees401ep1);
            k = new NtruEncryptKey(getPubKeyBlob(test));
            k.close();
        }
        catch (Throwable t)
        {
View Full Code Here

Examples of com.securityinnovation.testvectors.NtruEncryptTestVector

        throws NtruException
    {
        NtruEncryptKey k = null;
        try
        {
            NtruEncryptTestVector test    = findTest(OID.ees401ep1);
            k = new NtruEncryptKey(getPubKeyBlob(test));
        }
        catch (Throwable t)
        {
            fail("Unexpected exception " + t);
View Full Code Here

Examples of com.securityinnovation.testvectors.NtruEncryptTestVector

        throws NtruException
    {
        NtruEncryptKey k = null;
        try
        {
            NtruEncryptTestVector test    = findTest(OID.ees401ep1);
            k = new NtruEncryptKey(getPubKeyBlob(test));
        }
        catch (Throwable t)
        {
            fail("Unexpected exception " + t);
View Full Code Here

Examples of com.securityinnovation.testvectors.NtruEncryptTestVector

        throws NtruException
    {
        NtruEncryptKey k = null;
        try
        {
            NtruEncryptTestVector test    = findTest(OID.ees401ep1);
            k = new NtruEncryptKey(getPubKeyBlob(test));
        }
        catch (Throwable t)
        {
            fail("Unexpected exception " + t);
View Full Code Here

Examples of com.securityinnovation.testvectors.NtruEncryptTestVector

    public void test_encrypt_known_value()
        throws NtruException
    {
        for (OID oid : OID.values())
        {
            NtruEncryptTestVector test  = findTest(oid);
            NtruEncryptKey k = new NtruEncryptKey(getPubKeyBlob(test));
            defaultPrng.seed(test.encryptSeed);
            assertArrayEquals(test.packedE, k.encrypt(test.m, defaultPrng));
        }
    }
View Full Code Here

Examples of com.securityinnovation.testvectors.NtruEncryptTestVector

    {
        NtruEncryptKey k = null;
        byte           ct[] = null;
        try
        {
            NtruEncryptTestVector test    = findTest(OID.ees401ep1);
            k = new NtruEncryptKey(getPrivKeyBlob(test));
            k.close();
            ct = test.m;
        }
        catch (Throwable t)
View Full Code Here

Examples of com.securityinnovation.testvectors.NtruEncryptTestVector

        throws NtruException
    {
        NtruEncryptKey k = null;
        try
        {
            NtruEncryptTestVector test    = findTest(OID.ees401ep1);
            k = new NtruEncryptKey(getPrivKeyBlob(test));
        }
        catch (Throwable t)
        {
            fail("Unexpected exception " + t);
View Full Code Here

Examples of com.securityinnovation.testvectors.NtruEncryptTestVector

    // Implements test case NDC-3.
    @Test(expected=CiphertextBadLengthException.class)
    public void test_decrypt_ciphertext_short()
        throws NtruException
    {
        NtruEncryptTestVector test = tests[0];
        NtruEncryptKey k = new NtruEncryptKey(getPrivKeyBlob(test));
        byte ct[] = new byte[test.packedE.length-1];
        System.arraycopy(test.packedE, 0, ct, 0, ct.length);
        k.decrypt(ct);
    }
View Full Code Here

Examples of com.securityinnovation.testvectors.NtruEncryptTestVector

    }
    @Test(expected=CiphertextBadLengthException.class)
    public void test_decrypt_ciphertext_long()
        throws NtruException
    {
        NtruEncryptTestVector test = tests[0];
        NtruEncryptKey k = new NtruEncryptKey(getPrivKeyBlob(test));
        byte ct[] = new byte[test.packedE.length+1];
        System.arraycopy(test.packedE, 0, ct, 0, test.packedE.length);
        ct[ct.length-1] = 0;
        k.decrypt(ct);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.