@@ -0,0 +1,1033 @@
+package selectvoting.tests;%0A%0Aimport junit.framework.TestCase;%0A%0Aimport org.junit.Test;%0A%0Aimport selectvoting.lib.crypto.CryptoLib;%0Aimport selectvoting.utils.Utilities;%0Aimport static selectvoting.utils.MessageTools.equal;%0A%0A%0Apublic class TestCryptoLib extends TestCase %7B%0A%0A%09private static byte%5B%5D key = Utilities.hexStringToByteArray(%22dbd08d5190d1c0207450176b386b6f28%22);%0A%09private static byte%5B%5D encrypted_message = Utilities.hexStringToByteArray(%221693e24f26f49c096e7cf5e73800d5ded1aac5bbfc3ee9dc586a1244a2ce5a%22);%0A%09private static byte%5B%5D encrypted_plaintext = Utilities.hexStringToByteArray(%223f2267%22);%0A%0A%0A%09private void log(byte%5B%5D b) %7B%0A%09%09System.out.println(Utilities.byteArrayToHexString(b));%0A%09%7D%0A%0A%09@Test%0A%09public void testSymEnc() %7B%0A%09%09byte%5B%5D plaintext = %7B0x3f,0x22%7D;%0A%0A%09%09byte%5B%5D c = CryptoLib.symkey_encrypt(key, plaintext);%09%0A%09%09byte%5B%5D m = CryptoLib.symkey_decrypt(key, c);%0A%09%09log(m);%0A%09%09assertTrue( equal(plaintext,m) );%0A%0A%09%09byte%5B%5D m1 = CryptoLib.symkey_decrypt(key, encrypted_message);%0A%09%09assertTrue( equal(m1, encrypted_plaintext));%0A%09%09log(m1);%0A%09%7D%0A%7D%0A

add a simple test for symmetric encryption