bit Flipper im the making 🐬

This commit is contained in:
Simon Freiermuth 2022-03-17 15:03:39 +01:00
parent 0851f73c88
commit d631848d83
4 changed files with 27 additions and 0 deletions

View file

@ -33,4 +33,21 @@ class SPNTest {
// System.out.print(Integer.toHexString(spn.substitution(x)));
}
@Test
void swapBits() {
var spn = new SPN();
// given
int x = 0xA;
int r = 0xC;
// when
int y = spn.swapBits(x, 1, 2);
int yy = spn.swapBits(x, 2, 1);
// then
assertEquals(r, y);
assertEquals(r, yy);
}
}