mirror of
https://github.com/TheAlgorithms/Java.git
synced 2026-03-13 08:40:43 +08:00
Add automatic linter (#4214)
This commit is contained in:
@@ -6,8 +6,7 @@ import java.util.BitSet;
|
||||
public class A5Cipher {
|
||||
|
||||
private final A5KeyStreamGenerator keyStreamGenerator;
|
||||
private static final int KEY_STREAM_LENGTH
|
||||
= 228; // 28.5 bytes so we need to pad bytes or something
|
||||
private static final int KEY_STREAM_LENGTH = 228; // 28.5 bytes so we need to pad bytes or something
|
||||
|
||||
public A5Cipher(BitSet sessionKey, BitSet frameCounter) {
|
||||
keyStreamGenerator = new A5KeyStreamGenerator();
|
||||
|
||||
@@ -9,8 +9,7 @@ public class A5KeyStreamGenerator extends CompositeLFSR {
|
||||
private BitSet frameCounter;
|
||||
private BitSet sessionKey;
|
||||
private static final int INITIAL_CLOCKING_CYCLES = 100;
|
||||
private static final int KEY_STREAM_LENGTH
|
||||
= 228; // 28.5 bytes so we need to pad bytes or something
|
||||
private static final int KEY_STREAM_LENGTH = 228; // 28.5 bytes so we need to pad bytes or something
|
||||
|
||||
@Override
|
||||
public void initialize(BitSet sessionKey, BitSet frameCounter) {
|
||||
|
||||
@@ -29,8 +29,7 @@ public abstract class CompositeLFSR implements BaseLFSR {
|
||||
bitCount.put(false, 0);
|
||||
bitCount.put(true, 0);
|
||||
|
||||
registers.forEach(
|
||||
lfsr -> bitCount.put(lfsr.getClockBit(), bitCount.get(lfsr.getClockBit()) + 1));
|
||||
registers.forEach(lfsr -> bitCount.put(lfsr.getClockBit(), bitCount.get(lfsr.getClockBit()) + 1));
|
||||
return bitCount.get(false) <= bitCount.get(true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user