Examples of verifyMFormat()


Examples of com.securityinnovation.jNeo.ntruencrypt.NtruEncryptKey.verifyMFormat()

        NtruEncryptKey keys = new NtruEncryptKey(OID.ees401ep1);

        byte M[] = new byte[keyParams.N-2];
        java.util.Arrays.fill(M, (byte) 0);
        M[keyParams.db/8] = 1;
        assertEquals(-1, keys.verifyMFormat(M));
    }

    // Verify verifyMFormat generates an appropriate error when the
    // embedded mLen is invalid.
    @Test public void test_verifyMFormat_invalidMLen()
View Full Code Here

Examples of com.securityinnovation.jNeo.ntruencrypt.NtruEncryptKey.verifyMFormat()

        NtruEncryptKey keys = new NtruEncryptKey(OID.ees401ep1);

        byte M[] = new byte[keyParams.N];
        java.util.Arrays.fill(M, (byte) 0);
        M[keyParams.db/8] = (byte) 401;
        assertEquals(-1, keys.verifyMFormat(M));
    }

    // Verify verifyMFormat generates an appropriate error when p0 is incorrect
    @Test public void test_verifyMFormat_invalidp0()
        throws NtruException
View Full Code Here

Examples of com.securityinnovation.jNeo.ntruencrypt.NtruEncryptKey.verifyMFormat()

        byte M[] = new byte[keyParams.N];
        java.util.Arrays.fill(M, (byte) 0);
        M[keyParams.db/8] = 1;
        M[keyParams.db/8+keyParams.lLen+1+1] = 2;
        assertEquals(-1, keys.verifyMFormat(M));
    }

    // Verify the positive case of test_verifyMFormat()
    @Test public void test_verifyMFormat()
        throws NtruException
View Full Code Here

Examples of com.securityinnovation.jNeo.ntruencrypt.NtruEncryptKey.verifyMFormat()

                                keyParams.maxMsgLenBytes + 1];
            java.util.Arrays.fill(M, (byte) 0);
            M[keyParams.db/8] = (byte) 1;
            java.util.Arrays.fill(M, keyParams.db/8+keyParams.lLen,
                                  keyParams.db/8+keyParams.lLen+1, (byte) 22);
            assertEquals(1, keys.verifyMFormat(M));
        }
    }

    // A full passthrough for each test vector:
    // verify encrypt() produces the correct output
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.