调整注释和readme

This commit is contained in:
zcy
2025-09-03 17:00:14 +08:00
parent 8880f2065e
commit 55332f6b3f
3 changed files with 21 additions and 103 deletions

View File

@@ -6,11 +6,9 @@ import static com.zuc.zuc256.Zuc256Util.extractIv;
import static com.zuc.zuc256.Zuc256Util.printHex;
// 一次性加密函数
/**
* 演示主函数:保持与你的单文件示例一致的调用路径。
* 演示主函数
*/
public final class Zuc256Demo {

View File

@@ -9,20 +9,26 @@ import static com.zuc.zuc256.Zuc256Util.putU32;
/**
* 分段加/解密上下文(流密码:同一流程)。
* 注意JavaCard 上尽量复用缓冲,避免额外分配。
* 加密上下文类
*/
public final class Zuc256EncryptCtx {
Zuc256State state = new Zuc256State();
byte[] buf = new byte[4];
Zuc256State state;
byte[] buf;
int buflen;
public Zuc256EncryptCtx(Zuc256State state, byte[] buf){
this.state = state;
this.buf = buf;
}
public Zuc256EncryptCtx(Zuc256State state){
this.state = state;
this.buf = new byte[4];
}
public Zuc256EncryptCtx(){
this.state = new Zuc256State();
this.buf = new byte[4];
}
// 初始化加密上下文