Examples of NtruEncryptKey


Examples of com.securityinnovation.jNeo.ntruencrypt.NtruEncryptKey

    @Test(expected=NoPrivateKeyException.class)
    public void test_decrypt_noPrivateKey()
        throws NtruException
    {
        NtruEncryptTestVector test = tests[0];
        NtruEncryptKey k = new NtruEncryptKey(getPubKeyBlob(test));
        k.decrypt(test.packedE);
    }
View Full Code Here

Examples of com.securityinnovation.jNeo.ntruencrypt.NtruEncryptKey

        throws NtruException
    {
        for (OID oid : OID.values())
        {
            NtruEncryptTestVector test  = findTest(oid);
            NtruEncryptKey k = new NtruEncryptKey(getPrivKeyBlob(test));
            assertArrayEquals(test.m, k.decrypt(test.packedE));
        }
    }
View Full Code Here

Examples of com.securityinnovation.jNeo.ntruencrypt.NtruEncryptKey

    // throws exception on error.
    boolean runFullTest(
        OID oid)
        throws NtruException
    {
        NtruEncryptKey keys = NtruEncryptKey.genKey(oid, defaultPrng);

        // Do encryption.
        byte m[] = new byte[10];
        byte ciphertext[] = keys.encrypt(m, defaultPrng);

        // Do decryption.
        byte m2[] = keys.decrypt(ciphertext);

        // Compare
        return Arrays.equals(m, m2);
    }
View Full Code Here

Examples of com.securityinnovation.jNeo.ntruencrypt.NtruEncryptKey

    {
        for (OID oid : OID.values())
        {
            NtruEncryptTestVector test  = findTest(oid);
            Random prng = new Random(test.keygenSeed);
            NtruEncryptKey keys = NtruEncryptKey.genKey(oid, prng);
            assertArrayEquals(getPrivKeyBlob(test), keys.getPrivKey());
        }
    }
View Full Code Here

Examples of com.securityinnovation.jNeo.ntruencrypt.NtruEncryptKey

    // Implements test case NEK-1.
    @Test(expected=NullPointerException.class)
    public void test_constructor_keyBlob_null()
        throws NtruException
    {
        new NtruEncryptKey((byte[])null);
    }
View Full Code Here

Examples of com.securityinnovation.jNeo.ntruencrypt.NtruEncryptKey

        catch (Throwable t)
        {
            fail("Unexpected exception " + t);
        }
        // Import
        new NtruEncryptKey(blob);
    }
View Full Code Here

Examples of com.securityinnovation.jNeo.ntruencrypt.NtruEncryptKey

        catch (Throwable t)
        {
            fail("Unexpected exception " + t);
        }
        // Import
        new NtruEncryptKey(blob);
    }
View Full Code Here

Examples of com.securityinnovation.jNeo.ntruencrypt.NtruEncryptKey

        catch (Throwable t)
        {
            fail("Unexpected exception " + t);
        }
        // Import
        new NtruEncryptKey(blob);
    }
View Full Code Here

Examples of com.securityinnovation.jNeo.ntruencrypt.NtruEncryptKey

        catch (Throwable t)
        {
            fail("Unexpected exception " + t);
        }
        // Import
        new NtruEncryptKey(blob);
    }
View Full Code Here

Examples of com.securityinnovation.jNeo.ntruencrypt.NtruEncryptKey

    /////////////////////////////////////////////////////////////////////////
    // Test the close method
    // Implements test cases NCL-1 and NCL-2.
    @Test public void test_close()
    {
        NtruEncryptKey k = null;
        try
        {
            NtruEncryptTestVector test    = findTest(OID.ees401ep1);
            k = new NtruEncryptKey(getPubKeyBlob(test));
        }
        catch (Throwable t)
        {
            fail("Unexpected exception " + t);
        }
        k.close();
        k.close();
    }
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.