Examples of NtruEncryptTestVector


Examples of com.securityinnovation.testvectors.NtruEncryptTestVector

    @Test public void test_genKey_knownInput()
        throws NtruException
    {
        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.testvectors.NtruEncryptTestVector

        throws NtruException
    {
        byte blob[] = null;
        try {
            // Get test vector
            NtruEncryptTestVector test = tests[0];
            // get public key blob
            blob = getPubKeyBlob(test);
            // change tag
            blob[0] = 41;
        }
View Full Code Here

Examples of com.securityinnovation.testvectors.NtruEncryptTestVector

        throws NtruException
    {
        byte blob[] = null;
        try {
            // Get test vector
            NtruEncryptTestVector test = tests[0];
            // get public key blob
            blob = getPubKeyBlob(test);
            // change the OID
            blob[1] = 41;
        }
View Full Code Here

Examples of com.securityinnovation.testvectors.NtruEncryptTestVector

        throws NtruException
    {
        byte blob[] = null;
        try {
            // Get test vector
            NtruEncryptTestVector test = tests[0];
            // get public key blob
            byte blob2[] = getPubKeyBlob(test);
            // Make a short copy
            blob = new byte[blob2.length-2];
            System.arraycopy(blob2, 0, blob, 0, blob.length);
View Full Code Here

Examples of com.securityinnovation.testvectors.NtruEncryptTestVector

        throws NtruException
    {
        byte blob[] = null;
        try {
            // Get test vector
            NtruEncryptTestVector test = tests[0];
            // get public key blob
            byte blob2[] = getPubKeyBlob(test);
            // Make a short copy
            blob = new byte[blob2.length+2];
            System.arraycopy(blob2, 0, blob, 0, blob2.length);
View Full Code Here

Examples of com.securityinnovation.testvectors.NtruEncryptTestVector

    @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);
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

    @Test public void test_getPubKey_known_value()
        throws NtruException
    {
        for (OID oid : OID.values())
        {
            NtruEncryptTestVector test  = findTest(oid);
            byte blob[]      = getPubKeyBlob(test);
            NtruEncryptKey k = new NtruEncryptKey(blob);
            byte blob2[] = k.getPubKey();
            assertArrayEquals(blob2, blob);
            if (oid == OID.ees401ep1)
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));
            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
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.