This commit is contained in:
junj2.liang
2022-09-13 15:57:21 +08:00
parent 53c1e93115
commit 4e2f6b3ac4
5 changed files with 79 additions and 52 deletions
@@ -26,6 +26,19 @@ public class SydApi4Database extends SydApiBaseFunction {
}
@Override
public List<byte[]> SYD_SM4_BatchData(int[] iKeyIndex, List<byte[]> pcData, int iFlag) {
if ( null == iKeyIndex || null == pcData ) {
throw new IllegalArgumentException("批量输入数据为 null");
}
if ( iKeyIndex.length != pcData.size() ) {
throw new IllegalArgumentException("批量输入数据密钥和数据数量不等");
}
if ( 0 == iKeyIndex.length ) {
return new ArrayList<>();
}
// 将数据进行分组,防止超长。
List<List<byte[]>> dataGroups = new ArrayList<>();
List<List<Integer>> keyGroups = new ArrayList<>();
@@ -72,6 +85,19 @@ public class SydApi4Database extends SydApiBaseFunction {
@Override
public String[] SYD_SM4Mac_BatchData(int[] iKeyIndex, List<byte[]> pcData) {
if ( null == iKeyIndex || null == pcData ) {
throw new IllegalArgumentException("批量输入数据为 null");
}
if ( iKeyIndex.length != pcData.size() ) {
throw new IllegalArgumentException("批量输入数据密钥和数据数量不等");
}
if ( 0 == iKeyIndex.length ) {
return new String[0];
}
// 将数据进行分组,防止超长。
List<List<byte[]>> dataGroups = new ArrayList<>();
List<List<Integer>> keyGroups = new ArrayList<>();
@@ -116,6 +142,19 @@ public class SydApi4Database extends SydApiBaseFunction {
@Override
public boolean[] SYD_SM4Mac_BatchData(int[] iKeyIndex, List<byte[]> pcData, String[] pcMac) {
if ( null == iKeyIndex || null == pcData ) {
throw new IllegalArgumentException("批量输入数据为 null");
}
if ( iKeyIndex.length != pcData.size() ) {
throw new IllegalArgumentException("批量输入数据密钥和数据数量不等");
}
if ( 0 == iKeyIndex.length ) {
return new boolean[0];
}
// 将数据进行分组,防止超长。
List<List<byte[]>> dataGroups = new ArrayList<>();
List<List<Integer>> keyGroups = new ArrayList<>();
@@ -172,6 +172,18 @@ public class SydApiLongLinkWrap implements SydApi {
@Override
public List<byte[]> SYD_SM4_BatchData(int[] iKeyIndex, List<byte[]> pcData, int iFlag) {
if ( null == iKeyIndex || null == pcData ) {
throw new IllegalArgumentException("批量输入数据为 null");
}
if ( iKeyIndex.length != pcData.size() ) {
throw new IllegalArgumentException("批量输入数据密钥和数据数量不等");
}
if ( 0 == iKeyIndex.length ) {
return new ArrayList<>();
}
// 将数据进行分组,防止超长。
List<List<byte[]>> dataGroups = new ArrayList<>();
List<List<Integer>> keyGroups = new ArrayList<>();
@@ -236,6 +248,18 @@ public class SydApiLongLinkWrap implements SydApi {
@Override
public String[] SYD_SM4Mac_BatchData(int[] iKeyIndex, List<byte[]> pcData) {
if ( null == iKeyIndex || null == pcData ) {
throw new IllegalArgumentException("批量输入数据为 null");
}
if ( iKeyIndex.length != pcData.size() ) {
throw new IllegalArgumentException("批量输入数据密钥和数据数量不等");
}
if ( 0 == iKeyIndex.length ) {
return new String[0];
}
// 将数据进行分组,防止超长。
List<List<byte[]>> dataGroups = new ArrayList<>();
List<List<Integer>> keyGroups = new ArrayList<>();
@@ -299,6 +323,20 @@ public class SydApiLongLinkWrap implements SydApi {
@Override
public boolean[] SYD_SM4Mac_BatchData(int[] iKeyIndex, List<byte[]> pcData, String[] pcMac) {
if ( null == iKeyIndex || null == pcData ) {
throw new IllegalArgumentException("批量输入数据为 null");
}
if ( iKeyIndex.length != pcData.size() ) {
throw new IllegalArgumentException("批量输入数据密钥和数据数量不等");
}
if ( 0 == iKeyIndex.length ) {
return new boolean[0];
}
// 将数据进行分组,防止超长。
List<List<byte[]>> dataGroups = new ArrayList<>();
List<List<Integer>> keyGroups = new ArrayList<>();