移植中

This commit is contained in:
zcy
2025-09-05 15:55:46 +08:00
parent 2310d0aca1
commit 747ac56a68
5 changed files with 65 additions and 27 deletions

View File

@@ -1,15 +1,31 @@
package com.cscn;
/**
* MAC上下文类
* MAC上下文类JavaCard版int 拆分为两个 short
*/
public final class Zuc256MacCtx {
int[] LFSR = new int[16];
int R1;
int R2;
// LFSR: 原本 int[16],拆成 hi/lo 各 16 short
short[] LFSR_hi = new short[16];
short[] LFSR_lo = new short[16];
// R1、R2: 原本 int拆成 hi/lo
short R1_hi;
short R1_lo;
short R2_hi;
short R2_lo;
// 缓冲区
byte[] buf = new byte[4];
int buflen;
int[] T = new int[4];
int[] K0 = new int[4];
int macbits;
short buflen;
// T: 原本 int[4],拆成 hi/lo
short[] T_hi = new short[4];
short[] T_lo = new short[4];
// K0: 原本 int[4],拆成 hi/lo
short[] K0_hi = new short[4];
short[] K0_lo = new short[4];
// macbits: 原本 int改成 short 足够
short macbits;
}