框架初始化
This commit is contained in:
16
src/com/zuc/zuc256/Zuc256State.java
Normal file
16
src/com/zuc/zuc256/Zuc256State.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package com.zuc.zuc256;
|
||||
|
||||
/**
|
||||
* ZUC 内部状态:LFSR(16x31bit) + R1/R2。
|
||||
* Java 中用 int 保存(仅低 31 位有效)。
|
||||
*/
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user