diff --git a/src/main/java/ch/fhnw/kry/SPN.java b/src/main/java/ch/fhnw/kry/SPN.java index 3b9ef91..a0f83b3 100644 --- a/src/main/java/ch/fhnw/kry/SPN.java +++ b/src/main/java/ch/fhnw/kry/SPN.java @@ -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); diff --git a/src/test/java/ch/fhnw/kry/SPNTest.java b/src/test/java/ch/fhnw/kry/SPNTest.java index 782408b..4c18b3f 100644 --- a/src/test/java/ch/fhnw/kry/SPNTest.java +++ b/src/test/java/ch/fhnw/kry/SPNTest.java @@ -63,7 +63,7 @@ class SPNTest { } @Test - void sp() { + void blockEncryptionDecryption() { var spn = new SPN(); int x = 0x128F ;