增加init/update/digest/finish长数据操作
This commit is contained in:
parent
77e49a327c
commit
38a6da35d9
@ -98,7 +98,7 @@ public class SydApiSM4 {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (0 == sourceWrap.array().length) {
|
if (0 == sourceWrap.array().length) {
|
||||||
if (plength<16){
|
if (plength<16||plength/16<2){
|
||||||
api.SYD_SM4_LongData(iKeyIndex, new byte[0], iPkgNum, iFlag);
|
api.SYD_SM4_LongData(iKeyIndex, new byte[0], iPkgNum, iFlag);
|
||||||
ByteBuffer bufferResult = ByteBuffer.allocate(sourceWrap.array().length + plength);
|
ByteBuffer bufferResult = ByteBuffer.allocate(sourceWrap.array().length + plength);
|
||||||
bufferResult.put(sourceWrap);
|
bufferResult.put(sourceWrap);
|
||||||
@ -125,7 +125,7 @@ public class SydApiSM4 {
|
|||||||
return api.SYD_SM4_LongData(iKeyIndex, pcdataResult, iPkgNum, iFlag);
|
return api.SYD_SM4_LongData(iKeyIndex, pcdataResult, iPkgNum, iFlag);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (16 > pcData.length + sourceWrap.array().length) {
|
if (16 > pcData.length + sourceWrap.array().length||(pcData.length + sourceWrap.array().length)/16<2) {
|
||||||
ByteBuffer bufferResult = ByteBuffer.allocate(sourceWrap.array().length + plength);
|
ByteBuffer bufferResult = ByteBuffer.allocate(sourceWrap.array().length + plength);
|
||||||
bufferResult.put(sourceWrap.array());
|
bufferResult.put(sourceWrap.array());
|
||||||
bufferResult.put(pcData);
|
bufferResult.put(pcData);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user