修复问题
This commit is contained in:
parent
6cfa9c24a5
commit
36b48af67d
@ -28,6 +28,10 @@ public class SydSM4Mac {
|
|||||||
this.api = api;
|
this.api = api;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setPcMac(String pcMac) {
|
||||||
|
this.pcMac = pcMac;
|
||||||
|
}
|
||||||
|
|
||||||
public void update(byte[] pcData) {
|
public void update(byte[] pcData) {
|
||||||
if (null == pcData || 0 == pcData.length) {
|
if (null == pcData || 0 == pcData.length) {
|
||||||
return;
|
return;
|
||||||
@ -45,15 +49,9 @@ public class SydSM4Mac {
|
|||||||
queue.push(pcData);
|
queue.push(pcData);
|
||||||
}
|
}
|
||||||
if (length % 16 != 0) {
|
if (length % 16 != 0) {
|
||||||
int remainder = length % 16;
|
queue.push(pcData);
|
||||||
int intercept = length - remainder;
|
byte[] pop = queue.pop(16, 0);
|
||||||
byte[] result = new byte[intercept];
|
pcdataResult=pop;
|
||||||
byte[] result2 = new byte[remainder];
|
|
||||||
System.arraycopy(pcData,0,result,0,intercept);
|
|
||||||
System.arraycopy(pcData,intercept,result,0,remainder);
|
|
||||||
queue.push(result2);
|
|
||||||
pcdataResult=result;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if (null == this.pcMac || "".equals(this.pcMac)) {
|
if (null == this.pcMac || "".equals(this.pcMac)) {
|
||||||
LongDataReturn<String, String> stringStringLongDataReturn = api.SYD_SM4Mac_LongData(iKeyIndex, pcdataResult, iPkgNum, pcProcData);
|
LongDataReturn<String, String> stringStringLongDataReturn = api.SYD_SM4Mac_LongData(iKeyIndex, pcdataResult, iPkgNum, pcProcData);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user