增加init/update/digest/finish长数据操作

This commit is contained in:
junj2.liang 2022-09-01 14:40:18 +08:00
parent 38a6da35d9
commit 40bb130ffc

View File

@ -44,6 +44,7 @@ public class SydApiSM4 {
bufferResult.put(sourceWrap);
bufferResult.put(pcData);
sourceWrap = bufferResult;
return new byte[0];
}
if (plength % 16 != 0) {
ByteBuffer buffer = ByteBuffer.wrap(pcData);
@ -99,11 +100,11 @@ public class SydApiSM4 {
else {
if (0 == sourceWrap.array().length) {
if (plength<16||plength/16<2){
api.SYD_SM4_LongData(iKeyIndex, new byte[0], iPkgNum, iFlag);
ByteBuffer bufferResult = ByteBuffer.allocate(sourceWrap.array().length + plength);
bufferResult.put(sourceWrap);
bufferResult.put(pcData);
sourceWrap = bufferResult;
return new byte[0];
}
ByteBuffer buffer = ByteBuffer.wrap(pcData);
int remainder = plength % 16;