MCPcopy Create free account
hub / github.com/TheAlgorithms/Java / clock

Method clock

src/test/java/com/thealgorithms/ciphers/a5/LFSRTest.java:54–81  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52 }
53
54 @Test
55 void clock() {
56 BitSet sessionKey = BitSet.valueOf(sessionKeyBytes);
57 BitSet frameCounter = BitSet.valueOf(frameCounterBytes);
58
59 LFSR lfsr0 = new LFSR(19, 8, new int[] {13, 16, 17, 18});
60 lfsr0.initialize(sessionKey, frameCounter);
61
62 BitSet expected = new BitSet(19);
63 expected.set(0);
64 expected.set(1);
65 expected.set(2);
66 expected.set(4);
67 expected.set(5);
68 expected.set(6);
69 expected.set(8);
70 expected.set(10);
71 expected.set(11);
72 expected.set(12);
73 expected.set(13);
74 expected.set(14);
75 expected.set(16);
76 expected.set(17);
77 expected.set(18);
78
79 lfsr0.clock();
80 assertEquals(expected.toString(), lfsr0.toString());
81 }
82
83 @Test
84 void getClockBit() {

Callers

nothing calls this directly

Calls 5

initializeMethod · 0.95
clockMethod · 0.95
toStringMethod · 0.95
setMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected