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--) {
|
for (int i = 3; i > 0; i--) {
|
||||||
x = substitution(x, SBOX_REVERSE);
|
x = substitution(x, SBOX_REVERSE);
|
||||||
x = permutation(x);
|
x = permutation(x);
|
||||||
x ^= k(key, i);
|
x ^= permutation(k(key, i));
|
||||||
}
|
}
|
||||||
|
|
||||||
x = substitution(x, SBOX_REVERSE);
|
x = substitution(x, SBOX_REVERSE);
|
||||||
|
@ -63,7 +63,7 @@ class SPNTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void sp() {
|
void blockEncryptionDecryption() {
|
||||||
var spn = new SPN();
|
var spn = new SPN();
|
||||||
|
|
||||||
int x = 0x128F ;
|
int x = 0x128F ;
|
||||||
|
Loading…
Reference in New Issue
Block a user