将单文件ZUC256拆分为多文件,并封装init update final 方法
This commit is contained in:
@@ -1,16 +1,10 @@
|
||||
package com.zuc.zuc256;
|
||||
|
||||
/**
|
||||
* ZUC 内部状态:LFSR(16x31bit) + R1/R2。
|
||||
* Java 中用 int 保存(仅低 31 位有效)。
|
||||
* ZUC状态类
|
||||
*/
|
||||
public final class Zuc256State {
|
||||
public final int[] lfsr = new int[16]; // 线性反馈移位寄存器,31bit/项
|
||||
public int r1; // 32bit working register
|
||||
public int r2; // 32bit working register
|
||||
|
||||
public void reset() {
|
||||
for (int i = 0; i < lfsr.length; i++) lfsr[i] = 0;
|
||||
r1 = 0; r2 = 0;
|
||||
}
|
||||
int[] LFSR = new int[16]; // 线性反馈移位寄存器
|
||||
int R1; // 寄存器1
|
||||
int R2; // 寄存器2
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user