diff --git a/src/test/java/com/privacylogistics/FF3CipherTest.java b/src/test/java/com/privacylogistics/FF3CipherTest.java index 14d744e..7ea19aa 100644 --- a/src/test/java/com/privacylogistics/FF3CipherTest.java +++ b/src/test/java/com/privacylogistics/FF3CipherTest.java @@ -239,7 +239,7 @@ public void testAcvpFF3_1() throws Exception { } @Test - public void testFF3_1() throws Exception { + public void testFF3_1_str() throws Exception { // Test with 56 bit tweak String[] testVector = TestVectors[0]; FF3Cipher c = new FF3Cipher(testVector[Tkey], "D8E7920AFA330A", Integer.parseInt(testVector[Tradix])); @@ -250,6 +250,18 @@ public void testFF3_1() throws Exception { assertEquals(pt, plaintext); } + @Test + public void testFF3_1_bytes() throws Exception { + // Test with 56 bit tweak + String[] testVector = TestVectors[0]; + FF3Cipher c = new FF3Cipher(hexStringToByteArray(testVector[Tkey]), hexStringToByteArray("D8E7920AFA330A"), Integer.parseInt(testVector[Tradix])); + String pt = testVector[Tplaintext], ct = "477064185124354662"; + String ciphertext = c.encrypt(pt); + String plaintext = c.decrypt(ciphertext); + assertEquals(ct, ciphertext); + assertEquals(pt, plaintext); + } + @Test @EnabledOnJre(value = JRE.JAVA_11) public void testCustomAlphabet() throws Exception {