diff --git a/Src/com/cscn/Method.java b/Src/com/cscn/Method.java index 40a6bc5..532260c 100644 --- a/Src/com/cscn/Method.java +++ b/Src/com/cscn/Method.java @@ -10,9 +10,6 @@ import javacard.framework.Util; /** */ public class Method { - // ======= 已按你提供的数据填充 ======= - - // todo 写固定值在代码里了 // 加密密钥0: 32字节 private static final byte[] ZUC256_ENC_KEY_0 = { @@ -76,7 +73,7 @@ public class Method { // 输入数据缓冲区最大值 static final short MAX_DATA_BLOCK_SIZE = 128; - // 运行时缓冲:放RAM,避免写EEPROM + // 运行时缓冲 byte[] ctx_buf; short ctx_buflen; @@ -1541,7 +1538,6 @@ public class Method { // System.arraycopy(out, 4, newOut, 0, out.length - 4); // } // out = newOut; - // 这里C实现就是直接指针+4的。JavaSE实现搞这个new干嘛。。 outPos += 4; } } @@ -1616,8 +1612,6 @@ public class Method { } } - - // 清理上下文 // Arrays.fill(this.buf, (byte) 0); for(short i=0; i<4; i++) { @@ -1633,7 +1627,6 @@ public class Method { LFSR_hi[i] = 0; } - // this.state.R1 = 0; // this.state.R2 = 0; // R1、R2 清零 diff --git a/Src/com/cscn/XwSecurity.java b/Src/com/cscn/XwSecurity.java index f10e549..90f39b7 100644 --- a/Src/com/cscn/XwSecurity.java +++ b/Src/com/cscn/XwSecurity.java @@ -11,7 +11,6 @@ import javacard.framework.ISOException; * */ public class XwSecurity extends Applet { - //todo test // public static final byte INS_PROCESS_DATA_TEST = (byte)0xE3; diff --git a/Src/com/cscn/Zuc256Tables.java b/Src/com/cscn/Zuc256Tables.java index cbc6539..14e4ae0 100644 --- a/Src/com/cscn/Zuc256Tables.java +++ b/Src/com/cscn/Zuc256Tables.java @@ -2,12 +2,10 @@ package com.cscn; /** * 常量表:S0/S1 与 ZUC256_D。 - * 注意:JavaCard 目标环境建议将表定义为 static final 数组,按 int/short 存放。 - * 适配说明:已将 32bit int 数组改为 16bit short 数组,符合JavaCard 16bit能力要求 + * */ public final class Zuc256Tables { - // 私有构造函数:防止类被实例化 private Zuc256Tables() {} // S盒:S0, S1