整理测试代码
This commit is contained in:
@@ -242,7 +242,7 @@ public class SydApiBaseFunction implements SydApi {
|
||||
if (LogFactory.iLogLevel == 3) {
|
||||
log.debug("SYD_SM4_ShortData方法接收参数:iKeyIndex:{},pcData:{},iFlag:{}", iKeyIndex, Arrays.toString(pcData), iFlag);
|
||||
}
|
||||
if (iFlag == Consts.ECB_DEC && null == pcData || pcData.length == 0) {
|
||||
if (iFlag == Consts.ECB_DEC && null == pcData) {
|
||||
throw new SydApiException(19);
|
||||
}
|
||||
if (null == this.hsms || this.hsms.length < 1) {
|
||||
@@ -793,6 +793,10 @@ public class SydApiBaseFunction implements SydApi {
|
||||
|
||||
@Override
|
||||
public DataAndMac SYD_SM4_EncryptAndMac_ShortData(int iEncKeyIndex, int iMacKeyIndex, byte[] pcData) {
|
||||
if ( null == pcData || pcData.length > 1024 ) {
|
||||
throw new SydApiException(19);
|
||||
}
|
||||
|
||||
byte[] enData = SYD_SM4_ShortData(iEncKeyIndex, pcData, Consts.ECB_ENC);
|
||||
String mac = SYD_SM4Mac_ShortData(iMacKeyIndex, enData);
|
||||
return new DataAndMac(enData, mac);
|
||||
|
||||
Reference in New Issue
Block a user