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

Method clock

src/main/java/com/thealgorithms/ciphers/a5/LFSR.java:26–33  ·  view source on GitHub ↗
(BitSet key, int keyLength)

Source from the content-addressed store, hash-verified

24 }
25
26 private void clock(BitSet key, int keyLength) {
27 // We start from reverse because LFSR 0 index is the left most bit
28 // while key 0 index is right most bit, so we reverse it
29 for (int i = keyLength - 1; i >= 0; --i) {
30 var newBit = key.get(i) ^ xorTappingBits();
31 pushBit(newBit);
32 }
33 }
34
35 @Override
36 public boolean clock() {

Callers 2

clockMethod · 0.95
initializeMethod · 0.95

Calls 3

xorTappingBitsMethod · 0.95
pushBitMethod · 0.95
getMethod · 0.45

Tested by 1

clockMethod · 0.76