This commit is contained in:
liulu 2024-12-20 10:37:59 +08:00
parent e3bf63ddef
commit b982446dab

View File

@ -72,9 +72,9 @@ public class TMKContextFactory extends BasePooledObjectFactory<TMKContext> {
}
try {
byte[] encData = sdfApiAdapter.symEncrypt(handle.getSessionHandle(),
handle.getKeyHandle(), AlgId.SGD_SM4_CBC, CryptoConst.iv, checkData);
handle.getKeyHandle(), AlgId.SGD_SM4_CBC, CryptoConst.iv(), checkData);
byte[] decData = sdfApiAdapter.symDecrypt(handle.getSessionHandle(),
handle.getKeyHandle(), AlgId.SGD_SM4_CBC, CryptoConst.iv, encData);
handle.getKeyHandle(), AlgId.SGD_SM4_CBC, CryptoConst.iv(), encData);
Assert.isTrue(Arrays.equals(checkData, decData), "密码机加解密异常");
return true;
} catch (Exception e) {