Add automatic linter (#4214)

This commit is contained in:
acbin
2023-06-09 20:05:14 +08:00
committed by GitHub
parent 00282efd8b
commit 415a04ea7f
188 changed files with 661 additions and 1133 deletions

View File

@@ -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();

View File

@@ -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) {

View File

@@ -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);
}
}