keys that are not 0 or r need to be permutated during encryption 🤦
This commit is contained in:
parent
18515ea4cd
commit
2d53d98437
@ -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);
|
||||
|
@ -63,7 +63,7 @@ class SPNTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void sp() {
|
||||
void blockEncryptionDecryption() {
|
||||
var spn = new SPN();
|
||||
|
||||
int x = 0x128F ;
|
||||
|
Loading…
Reference in New Issue
Block a user