keys that are not 0 or r need to be permutated during encryption 🤦

This commit is contained in:
Sebastian Hugentobler 2022-03-19 16:58:22 +01:00
parent 18515ea4cd
commit 2d53d98437
Signed by: shu
GPG Key ID: BB32CF3CA052C2F0
2 changed files with 2 additions and 2 deletions

View File

@ -88,7 +88,7 @@ public class SPN {
for (int i = 3; i > 0; i--) {
x = substitution(x, SBOX_REVERSE);
x = permutation(x);
x ^= k(key, i);
x ^= permutation(k(key, i));
}
x = substitution(x, SBOX_REVERSE);

View File

@ -63,7 +63,7 @@ class SPNTest {
}
@Test
void sp() {
void blockEncryptionDecryption() {
var spn = new SPN();
int x = 0x128F ;