Created
March 18, 2019 15:33
-
-
Save Markonis/66e6905c13f6e9a2482d0526e8fccce5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TeaTest { | |
@Test | |
public void testEncryptDecryptBlock() { | |
Configuration config = new Configuration(); | |
config.set("blockLength", "8"); | |
config.set("key", "111 222 333 444"); | |
Tea instance = new Tea(config); | |
for(int i = 0; i < 1024; i++){ | |
int[] inputBlock = new int[8]; | |
for(int j = 0; j < 8; j++) | |
inputBlock[j] = (int) Math.floor(Math.random() * 256); | |
int[] encryptedBlock = instance.encryptBlock(inputBlock); | |
int[] decryptedBlock = instance.decryptBlock(encryptedBlock); | |
Assert.assertArrayEquals(inputBlock, decryptedBlock); | |
} | |
} | |
// Rest of the code deleted for brevity... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment