Merge remote-tracking branch 'origin/dev-1.0' into dev-1.0
# Conflicts: # src/main/java/com/sunyard/sge/database/SydApiSM4.java # src/main/java/com/sunyard/sge/database/SydSM4Mac.java
This commit is contained in:
commit
75e9b091a8
@ -12,7 +12,7 @@ public class SydApiSM4 {
|
|||||||
private int iPkgNum = 1;
|
private int iPkgNum = 1;
|
||||||
private int iFlag;
|
private int iFlag;
|
||||||
private boolean is_finished = false;
|
private boolean is_finished = false;
|
||||||
private ByteBuffer sourceWrap = ByteBuffer.wrap(new byte[0]);
|
ByteBuffer sourceWrap = ByteBuffer.wrap(new byte[0]);
|
||||||
|
|
||||||
|
|
||||||
public SydApiSM4(SydApi api, int iKeyIndex, int endeFlag) {
|
public SydApiSM4(SydApi api, int iKeyIndex, int endeFlag) {
|
||||||
@ -21,87 +21,77 @@ public class SydApiSM4 {
|
|||||||
this.iKeyIndex = iKeyIndex;
|
this.iKeyIndex = iKeyIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte[] update(byte[] pcData) {
|
public void update(byte[] pcData) {
|
||||||
try {
|
this.pcdataResult = pcData;
|
||||||
this.pcdataResult = pcData;
|
if (null == pcData || pcData.length == 0) {
|
||||||
if (null == pcData || pcData.length == 0) {
|
return;
|
||||||
return new byte[0];
|
}
|
||||||
}
|
int plength = pcData.length;
|
||||||
int plength = pcData.length;
|
if (is_finished) {
|
||||||
if (is_finished) {
|
throw new SydApiException(0);
|
||||||
throw new SydApiException(0);
|
}
|
||||||
}
|
if (plength > 4064) {
|
||||||
if (plength > 4064) {
|
throw new SydApiException(0);
|
||||||
throw new SydApiException(0);
|
}
|
||||||
}
|
if (0 == sourceWrap.array().length) {
|
||||||
if (0 == sourceWrap.array().length) {
|
//加密
|
||||||
//加密
|
if (plength < 16) {
|
||||||
if (plength < 16) {
|
api.SYD_SM4_LongData(iKeyIndex, new byte[0], iPkgNum, iFlag);
|
||||||
api.SYD_SM4_LongData(iKeyIndex, new byte[0], iPkgNum, iFlag);
|
if (iFlag == 0 && 1 == iPkgNum) {
|
||||||
if (iFlag == 0 && 1 == iPkgNum) {
|
throw new SydApiException("解密的首包不能小于 16 字节", 0);
|
||||||
throw new SydApiException("解密的首包不能小于 16 字节", 0);
|
}
|
||||||
}
|
ByteBuffer bufferResult = ByteBuffer.allocate(sourceWrap.array().length + plength);
|
||||||
ByteBuffer bufferResult = ByteBuffer.allocate(sourceWrap.array().length + plength);
|
bufferResult.put(sourceWrap);
|
||||||
bufferResult.put(sourceWrap);
|
bufferResult.put(pcData);
|
||||||
bufferResult.put(pcData);
|
sourceWrap = bufferResult;
|
||||||
sourceWrap = bufferResult;
|
}
|
||||||
}
|
if (plength % 16 != 0) {
|
||||||
if (plength % 16 != 0) {
|
ByteBuffer buffer = ByteBuffer.wrap(pcData);
|
||||||
ByteBuffer buffer = ByteBuffer.wrap(pcData);
|
int remainder = plength % 16;
|
||||||
int remainder = plength % 16;
|
int intercept = plength - remainder;
|
||||||
int intercept = plength - remainder;
|
byte[] bytes = new byte[intercept];
|
||||||
byte[] bytes = new byte[intercept];
|
ByteBuffer byteBuffer = buffer.get(bytes, 0, intercept);
|
||||||
ByteBuffer byteBuffer = buffer.get(bytes, 0, intercept);
|
byte[] bytes1 = new byte[remainder];
|
||||||
byte[] bytes1 = new byte[remainder];
|
byteBuffer.get(bytes1);
|
||||||
byteBuffer.get(bytes1);
|
this.pcdataResult = bytes;
|
||||||
this.pcdataResult = bytes;
|
ByteBuffer bufferResult = ByteBuffer.allocate(sourceWrap.array().length + remainder);
|
||||||
ByteBuffer bufferResult = ByteBuffer.allocate(sourceWrap.array().length + remainder);
|
bufferResult.put(bytes1);
|
||||||
bufferResult.put(bytes1);
|
sourceWrap = bufferResult;
|
||||||
sourceWrap = bufferResult;
|
}
|
||||||
}
|
byte[] bytes = api.SYD_SM4_LongData(iKeyIndex, pcdataResult, iPkgNum, iFlag);
|
||||||
iPkgNum = 2;
|
iPkgNum = 2;
|
||||||
return api.SYD_SM4_LongData(iKeyIndex, pcdataResult, iPkgNum, iFlag);
|
} else {
|
||||||
|
if (16 > pcData.length + sourceWrap.array().length) {
|
||||||
} else {
|
ByteBuffer bufferResult = ByteBuffer.allocate(sourceWrap.array().length + plength);
|
||||||
if (16 > pcData.length + sourceWrap.array().length) {
|
bufferResult.put(sourceWrap);
|
||||||
ByteBuffer bufferResult = ByteBuffer.allocate(sourceWrap.array().length + plength);
|
bufferResult.put(pcData);
|
||||||
bufferResult.put(sourceWrap);
|
sourceWrap = bufferResult;
|
||||||
bufferResult.put(pcData);
|
} else if ((pcData.length + sourceWrap.array().length) % 16 == 0) {
|
||||||
sourceWrap = bufferResult;
|
ByteBuffer bufferResult = ByteBuffer.allocate(sourceWrap.array().length + plength);
|
||||||
} else if ((pcData.length + sourceWrap.array().length) % 16 == 0) {
|
bufferResult.put(SydSM4Mac.bytebuffer2ByteArray(sourceWrap));
|
||||||
ByteBuffer bufferResult = ByteBuffer.allocate(sourceWrap.array().length + plength);
|
bufferResult.put(pcData);
|
||||||
bufferResult.put(sourceWrap);
|
byte[] bytes = SydSM4Mac.bytebuffer2ByteArray(bufferResult);
|
||||||
bufferResult.put(pcData);
|
api.SYD_SM4_LongData(iKeyIndex, bytes, iPkgNum, iFlag);
|
||||||
byte[] bytes = SydSM4Mac.bytebuffer2ByteArray(bufferResult);
|
} else {
|
||||||
return api.SYD_SM4_LongData(iKeyIndex, bytes, iPkgNum, iFlag);
|
ByteBuffer bufferResult = ByteBuffer.allocate(sourceWrap.array().length + plength);
|
||||||
} else {
|
bufferResult.put(SydSM4Mac.bytebuffer2ByteArray(sourceWrap));
|
||||||
ByteBuffer bufferResult = ByteBuffer.allocate(sourceWrap.array().length + plength);
|
bufferResult.put(pcData);
|
||||||
bufferResult.put(sourceWrap);
|
byte[] bytes = SydSM4Mac.bytebuffer2ByteArray(bufferResult);
|
||||||
bufferResult.put(pcData);
|
ByteBuffer buffer = ByteBuffer.wrap(bytes);
|
||||||
byte[] bytes = SydSM4Mac.bytebuffer2ByteArray(bufferResult);
|
int remainder = bytes.length % 16;
|
||||||
ByteBuffer buffer = ByteBuffer.wrap(bytes);
|
int intercept = bytes.length - remainder;
|
||||||
int remainder = bytes.length % 16;
|
byte[] pcdataByte = new byte[intercept];
|
||||||
int intercept = bytes.length - remainder;
|
ByteBuffer byteBuffer = buffer.get(pcdataByte, 0, intercept);
|
||||||
byte[] pcdataByte = new byte[intercept];
|
byte[] bytes1 = new byte[remainder];
|
||||||
ByteBuffer byteBuffer = buffer.get(pcdataByte, 0, intercept);
|
byteBuffer.get(bytes1);
|
||||||
byte[] bytes1 = new byte[remainder];
|
this.pcdataResult = pcdataByte;
|
||||||
byteBuffer.get(bytes1);
|
ByteBuffer bufferResults = ByteBuffer.allocate(remainder);
|
||||||
this.pcdataResult = pcdataByte;
|
bufferResults.put(bytes1);
|
||||||
ByteBuffer bufferResults = ByteBuffer.allocate(remainder);
|
sourceWrap = bufferResults;
|
||||||
bufferResults.put(bytes1);
|
api.SYD_SM4_LongData(iKeyIndex, pcdataResult, iPkgNum, iFlag);
|
||||||
sourceWrap = bufferResults;
|
iPkgNum = 2;
|
||||||
iPkgNum = 2;
|
}
|
||||||
return api.SYD_SM4_LongData(iKeyIndex, pcdataResult, iPkgNum, iFlag);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
throw e;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte[] finish() {
|
public byte[] finish() {
|
||||||
|
|||||||
@ -3,22 +3,25 @@ package com.sunyard.sge.database;
|
|||||||
import com.sunyard.SydApiException;
|
import com.sunyard.SydApiException;
|
||||||
|
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.security.MessageDigest;
|
||||||
|
|
||||||
public class SydSM4Mac {
|
public class SydSM4Mac {
|
||||||
private SydApi api;
|
private SydApi api;
|
||||||
|
private byte[] last_in_data;
|
||||||
private int iKeyIndex;
|
private int iKeyIndex;
|
||||||
private int iPkgNum = 1;
|
private int iPkgNum = 1;
|
||||||
private boolean isFinished;
|
|
||||||
|
|
||||||
// 中间数据
|
|
||||||
private String pcProcData;
|
private String pcProcData;
|
||||||
|
private boolean is_finished;
|
||||||
|
private String pcMac;
|
||||||
private ByteBuffer sourceWrap = ByteBuffer.wrap(new byte[0]);
|
private byte[] pcdataResult = new byte[0];
|
||||||
|
ByteBuffer sourceWrap = ByteBuffer.wrap(new byte[0]);
|
||||||
|
|
||||||
public SydSM4Mac(SydApi api, int iKeyIndex) {
|
public SydSM4Mac(SydApi api, int iKeyIndex) {
|
||||||
this.api = api;
|
this.api = api;
|
||||||
this.iKeyIndex = iKeyIndex;
|
this.iKeyIndex = iKeyIndex;
|
||||||
|
this.pcProcData = pcProcData;
|
||||||
|
this.pcMac=pcMac;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SydSM4Mac(SydApi api) {
|
public SydSM4Mac(SydApi api) {
|
||||||
@ -26,47 +29,94 @@ public class SydSM4Mac {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public SydSM4Mac update(byte[] pcData) {
|
public SydSM4Mac update(byte[] pcData) {
|
||||||
|
if (null == pcData || 0 == pcData.length) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
int length = pcData.length;
|
||||||
|
this.pcdataResult = pcData;
|
||||||
|
if (is_finished) {
|
||||||
|
throw new SydApiException(0);
|
||||||
|
}
|
||||||
|
if (length > 4064) {
|
||||||
|
throw new SydApiException(0);
|
||||||
|
}
|
||||||
|
if (0 == sourceWrap.array().length) {
|
||||||
|
if (length < 16) {
|
||||||
|
ByteBuffer bufferResult = ByteBuffer.allocate(sourceWrap.array().length + length);
|
||||||
|
bufferResult.put(sourceWrap);
|
||||||
|
bufferResult.put(pcData);
|
||||||
|
sourceWrap = bufferResult;
|
||||||
|
if (null == this.pcMac || "".equals(this.pcMac)) {
|
||||||
|
LongDataReturn<String, String> stringStringLongDataReturn = api.SYD_SM4Mac_LongData(iKeyIndex, pcdataResult, 0, pcProcData);
|
||||||
|
pcProcData = stringStringLongDataReturn.getProcData();
|
||||||
|
} else {
|
||||||
|
LongDataReturn<String, Boolean> stringBooleanLongDataReturn = api.SYD_SM4Mac_LongData(iKeyIndex, pcdataResult, 0, pcProcData, pcMac);
|
||||||
|
pcProcData = stringBooleanLongDataReturn.getProcData();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (length % 16 != 0) {
|
||||||
|
ByteBuffer buffer = ByteBuffer.wrap(pcData);
|
||||||
|
int remainder = length % 16;
|
||||||
|
int intercept = length - remainder;
|
||||||
|
byte[] bytes = new byte[intercept];
|
||||||
|
ByteBuffer byteBuffer = buffer.get(bytes, 0, intercept);
|
||||||
|
byte[] bytes1 = new byte[remainder];
|
||||||
|
byteBuffer.get(bytes1);
|
||||||
|
this.pcdataResult = bytes;
|
||||||
|
ByteBuffer bufferResult = ByteBuffer.allocate(sourceWrap.array().length + remainder);
|
||||||
|
bufferResult.put(bytes1);
|
||||||
|
sourceWrap = bufferResult;
|
||||||
|
}
|
||||||
|
if (null == this.pcMac || "".equals(this.pcMac)) {
|
||||||
|
LongDataReturn<String, String> stringStringLongDataReturn = api.SYD_SM4Mac_LongData(iKeyIndex, pcdataResult, iPkgNum, pcProcData);
|
||||||
|
pcProcData = stringStringLongDataReturn.getProcData();
|
||||||
|
iPkgNum = 2;
|
||||||
|
} else {
|
||||||
|
LongDataReturn<String, Boolean> stringBooleanLongDataReturn = api.SYD_SM4Mac_LongData(iKeyIndex, pcdataResult, iPkgNum, pcProcData, pcMac);
|
||||||
|
pcProcData = stringBooleanLongDataReturn.getProcData();
|
||||||
|
iPkgNum = 2;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (16 > (pcData.length + sourceWrap.array().length)) {
|
||||||
|
ByteBuffer bufferResult = ByteBuffer.allocate(sourceWrap.array().length + pcData.length);
|
||||||
|
bufferResult.put(sourceWrap);
|
||||||
|
bufferResult.put(pcData);
|
||||||
|
sourceWrap = bufferResult;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
else if (16<=(pcData.length + sourceWrap.array().length)&&(pcData.length + sourceWrap.array().length) % 16 == 0) {
|
||||||
if (null == pcData || 0 == pcData.length) {
|
int k2 = sourceWrap.array().length+pcData.length;
|
||||||
return this;
|
ByteBuffer bufferResult = ByteBuffer.allocate(sourceWrap.array().length + pcData.length);
|
||||||
}
|
byte[] bytes1 = bytebuffer2ByteArray(sourceWrap);
|
||||||
int length = pcData.length;
|
bufferResult.put(bytes1);
|
||||||
this.pcdataResult = pcData;
|
bufferResult.put(pcData);
|
||||||
if (isFinished) {
|
byte[] bytes = SydSM4Mac.bytebuffer2ByteArray(bufferResult);
|
||||||
throw new SydApiException(0);
|
if (null == this.pcMac || "".equals(this.pcMac)) {
|
||||||
}
|
LongDataReturn<String, String> stringStringLongDataReturn = api.SYD_SM4Mac_LongData(iKeyIndex, bytes, iPkgNum, pcProcData);
|
||||||
if (length > 4064) {
|
pcProcData = stringStringLongDataReturn.getProcData();
|
||||||
throw new SydApiException(0);
|
iPkgNum = 2;
|
||||||
}
|
} else {
|
||||||
if (0 == sourceWrap.array().length) {
|
LongDataReturn<String, Boolean> stringBooleanLongDataReturn = api.SYD_SM4Mac_LongData(iKeyIndex, bytes, iPkgNum, pcProcData, pcMac);
|
||||||
if (length < 16) {
|
pcProcData = stringBooleanLongDataReturn.getProcData();
|
||||||
ByteBuffer bufferResult = ByteBuffer.allocate(sourceWrap.array().length + length);
|
iPkgNum = 2;
|
||||||
bufferResult.put(sourceWrap);
|
|
||||||
bufferResult.put(pcData);
|
|
||||||
sourceWrap = bufferResult;
|
|
||||||
if (null == this.pcMac || "".equals(this.pcMac)) {
|
|
||||||
LongDataReturn<String, String> stringStringLongDataReturn = api.SYD_SM4Mac_LongData(iKeyIndex, pcdataResult, 0, pcProcData);
|
|
||||||
pcProcData = stringStringLongDataReturn.getProcData();
|
|
||||||
} else {
|
|
||||||
LongDataReturn<String, Boolean> stringBooleanLongDataReturn = api.SYD_SM4Mac_LongData(iKeyIndex, pcdataResult, 0, pcProcData, pcMac);
|
|
||||||
pcProcData = stringBooleanLongDataReturn.getProcData();
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (length % 16 != 0) {
|
|
||||||
ByteBuffer buffer = ByteBuffer.wrap(pcData);
|
|
||||||
int remainder = length % 16;
|
|
||||||
int intercept = length - remainder;
|
|
||||||
byte[] bytes = new byte[intercept];
|
|
||||||
ByteBuffer byteBuffer = buffer.get(bytes, 0, intercept);
|
|
||||||
byte[] bytes1 = new byte[remainder];
|
|
||||||
byteBuffer.get(bytes1);
|
|
||||||
this.pcdataResult = bytes;
|
|
||||||
ByteBuffer bufferResult = ByteBuffer.allocate(sourceWrap.array().length + remainder);
|
|
||||||
bufferResult.put(bytes1);
|
|
||||||
sourceWrap = bufferResult;
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
ByteBuffer bufferResult = ByteBuffer.allocate(sourceWrap.array().length + length);
|
||||||
|
bufferResult.put(bytebuffer2ByteArray(sourceWrap));
|
||||||
|
bufferResult.put(pcData);
|
||||||
|
byte[] bytes = SydSM4Mac.bytebuffer2ByteArray(bufferResult);
|
||||||
|
ByteBuffer buffer = ByteBuffer.wrap(bytes);
|
||||||
|
int remainder = bytes.length % 16;
|
||||||
|
int intercept = bytes.length - remainder;
|
||||||
|
byte[] pcdataByte = new byte[intercept];
|
||||||
|
ByteBuffer byteBuffer = buffer.get(pcdataByte, 0, intercept);
|
||||||
|
byte[] bytes1 = new byte[remainder];
|
||||||
|
byteBuffer.get(bytes1);
|
||||||
|
this.pcdataResult = pcdataByte;
|
||||||
|
ByteBuffer bufferResults = ByteBuffer.allocate(remainder);
|
||||||
|
bufferResults.put(bytes1);
|
||||||
|
sourceWrap = bufferResults;
|
||||||
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);
|
||||||
pcProcData = stringStringLongDataReturn.getProcData();
|
pcProcData = stringStringLongDataReturn.getProcData();
|
||||||
@ -76,68 +126,16 @@ public class SydSM4Mac {
|
|||||||
pcProcData = stringBooleanLongDataReturn.getProcData();
|
pcProcData = stringBooleanLongDataReturn.getProcData();
|
||||||
iPkgNum = 2;
|
iPkgNum = 2;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if (16 > pcData.length + sourceWrap.array().length) {
|
|
||||||
ByteBuffer bufferResult = ByteBuffer.allocate(sourceWrap.array().length + length);
|
|
||||||
bufferResult.put(sourceWrap);
|
|
||||||
bufferResult.put(pcData);
|
|
||||||
sourceWrap = bufferResult;
|
|
||||||
} else if ((pcData.length + sourceWrap.array().length) % 16 == 0) {
|
|
||||||
ByteBuffer bufferResult = ByteBuffer.allocate(sourceWrap.array().length + length);
|
|
||||||
bufferResult.put(sourceWrap);
|
|
||||||
bufferResult.put(pcData);
|
|
||||||
byte[] bytes = SydSM4Mac.bytebuffer2ByteArray(bufferResult);
|
|
||||||
if (null == this.pcMac || "".equals(this.pcMac)) {
|
|
||||||
LongDataReturn<String, String> stringStringLongDataReturn = api.SYD_SM4Mac_LongData(iKeyIndex, bytes, iPkgNum, pcProcData);
|
|
||||||
pcProcData = stringStringLongDataReturn.getProcData();
|
|
||||||
iPkgNum = 2;
|
|
||||||
} else {
|
|
||||||
LongDataReturn<String, Boolean> stringBooleanLongDataReturn = api.SYD_SM4Mac_LongData(iKeyIndex, bytes, iPkgNum, pcProcData, pcMac);
|
|
||||||
pcProcData = stringBooleanLongDataReturn.getProcData();
|
|
||||||
iPkgNum = 2;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
ByteBuffer bufferResult = ByteBuffer.allocate(sourceWrap.array().length + length);
|
|
||||||
bufferResult.put(sourceWrap);
|
|
||||||
bufferResult.put(pcData);
|
|
||||||
byte[] bytes = SydSM4Mac.bytebuffer2ByteArray(bufferResult);
|
|
||||||
ByteBuffer buffer = ByteBuffer.wrap(bytes);
|
|
||||||
int remainder = bytes.length % 16;
|
|
||||||
int intercept = bytes.length - remainder;
|
|
||||||
byte[] pcdataByte = new byte[intercept];
|
|
||||||
ByteBuffer byteBuffer = buffer.get(pcdataByte, 0, intercept);
|
|
||||||
byte[] bytes1 = new byte[remainder];
|
|
||||||
byteBuffer.get(bytes1);
|
|
||||||
this.pcdataResult = pcdataByte;
|
|
||||||
ByteBuffer bufferResults = ByteBuffer.allocate(remainder);
|
|
||||||
bufferResults.put(bytes1);
|
|
||||||
sourceWrap = bufferResults;
|
|
||||||
if (null == this.pcMac || "".equals(this.pcMac)) {
|
|
||||||
LongDataReturn<String, String> stringStringLongDataReturn = api.SYD_SM4Mac_LongData(iKeyIndex, pcdataResult, iPkgNum, pcProcData);
|
|
||||||
pcProcData = stringStringLongDataReturn.getProcData();
|
|
||||||
iPkgNum = 2;
|
|
||||||
} else {
|
|
||||||
LongDataReturn<String, Boolean> stringBooleanLongDataReturn = api.SYD_SM4Mac_LongData(iKeyIndex, pcdataResult, iPkgNum, pcProcData, pcMac);
|
|
||||||
pcProcData = stringBooleanLongDataReturn.getProcData();
|
|
||||||
iPkgNum = 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return this;
|
|
||||||
}catch ( Exception e ) {
|
|
||||||
e.printStackTrace();
|
|
||||||
throw e;
|
|
||||||
}
|
}
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public LongDataReturn disget() {
|
public LongDataReturn disget() {
|
||||||
|
|
||||||
if (isFinished) {
|
if (is_finished) {
|
||||||
throw new SydApiException(0);
|
throw new SydApiException(0);
|
||||||
}
|
}
|
||||||
this.isFinished = true;
|
this.is_finished = true;
|
||||||
if (1 == this.iPkgNum) {
|
if (1 == this.iPkgNum) {
|
||||||
this.iPkgNum = 0;
|
this.iPkgNum = 0;
|
||||||
} else if (2 == this.iPkgNum) {
|
} else if (2 == this.iPkgNum) {
|
||||||
@ -150,6 +148,7 @@ public class SydSM4Mac {
|
|||||||
LongDataReturn<String, Boolean> stringBooleanLongDataReturn = api.SYD_SM4Mac_LongData(iKeyIndex, this.pcdataResult, iPkgNum, pcProcData, pcMac);
|
LongDataReturn<String, Boolean> stringBooleanLongDataReturn = api.SYD_SM4Mac_LongData(iKeyIndex, this.pcdataResult, iPkgNum, pcProcData, pcMac);
|
||||||
return stringBooleanLongDataReturn;
|
return stringBooleanLongDataReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static byte[] bytebuffer2ByteArray(ByteBuffer buffer) {
|
public static byte[] bytebuffer2ByteArray(ByteBuffer buffer) {
|
||||||
@ -165,4 +164,5 @@ public class SydSM4Mac {
|
|||||||
}
|
}
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user