注释改一改

This commit is contained in:
zcy
2025-09-09 19:56:51 +08:00
parent 506c89cc09
commit 4af4d3342e
3 changed files with 2 additions and 12 deletions

View File

@@ -10,9 +10,6 @@ import javacard.framework.Util;
/** /**
*/ */
public class Method { public class Method {
// ======= 已按你提供的数据填充 =======
// todo 写固定值在代码里了 // todo 写固定值在代码里了
// 加密密钥0: 32字节 // 加密密钥0: 32字节
private static final byte[] ZUC256_ENC_KEY_0 = { private static final byte[] ZUC256_ENC_KEY_0 = {
@@ -76,7 +73,7 @@ public class Method {
// 输入数据缓冲区最大值 // 输入数据缓冲区最大值
static final short MAX_DATA_BLOCK_SIZE = 128; static final short MAX_DATA_BLOCK_SIZE = 128;
// 运行时缓冲放RAM避免写EEPROM // 运行时缓冲
byte[] ctx_buf; byte[] ctx_buf;
short ctx_buflen; short ctx_buflen;
@@ -1541,7 +1538,6 @@ public class Method {
// System.arraycopy(out, 4, newOut, 0, out.length - 4); // System.arraycopy(out, 4, newOut, 0, out.length - 4);
// } // }
// out = newOut; // out = newOut;
// 这里C实现就是直接指针+4的。JavaSE实现搞这个new干嘛。。
outPos += 4; outPos += 4;
} }
} }
@@ -1616,8 +1612,6 @@ public class Method {
} }
} }
// 清理上下文 // 清理上下文
// Arrays.fill(this.buf, (byte) 0); // Arrays.fill(this.buf, (byte) 0);
for(short i=0; i<4; i++) { for(short i=0; i<4; i++) {
@@ -1633,7 +1627,6 @@ public class Method {
LFSR_hi[i] = 0; LFSR_hi[i] = 0;
} }
// this.state.R1 = 0; // this.state.R1 = 0;
// this.state.R2 = 0; // this.state.R2 = 0;
// R1、R2 清零 // R1、R2 清零

View File

@@ -11,7 +11,6 @@ import javacard.framework.ISOException;
* *
*/ */
public class XwSecurity extends Applet { public class XwSecurity extends Applet {
//todo test //todo test
// public static final byte INS_PROCESS_DATA_TEST = (byte)0xE3; // public static final byte INS_PROCESS_DATA_TEST = (byte)0xE3;

View File

@@ -2,12 +2,10 @@ package com.cscn;
/** /**
* 常量表S0/S1 与 ZUC256_D。 * 常量表S0/S1 与 ZUC256_D。
* 注意JavaCard 目标环境建议将表定义为 static final 数组,按 int/short 存放。 *
* 适配说明:已将 32bit int 数组改为 16bit short 数组符合JavaCard 16bit能力要求
*/ */
public final class Zuc256Tables { public final class Zuc256Tables {
// 私有构造函数:防止类被实例化
private Zuc256Tables() {} private Zuc256Tables() {}
// S盒S0, S1 // S盒S0, S1