This commit is contained in:
Looly
2020-12-02 04:37:06 +08:00
parent 77e6759d9a
commit 61f58a9b62
36 changed files with 132 additions and 126 deletions

View File

@@ -90,7 +90,7 @@ public class SM4 extends SymmetricCrypto{
* @param iv 偏移向量,加盐
*/
public SM4(Mode mode, Padding padding, SecretKey key, byte[] iv) {
this(mode, padding, key, ArrayUtil.isEmpty(iv) ? ((IvParameterSpec) null) : new IvParameterSpec(iv));
this(mode, padding, key, ArrayUtil.isEmpty(iv) ? null : new IvParameterSpec(iv));
}
/**
@@ -137,7 +137,7 @@ public class SM4 extends SymmetricCrypto{
public SM4(String mode, String padding, byte[] key, byte[] iv) {
this(mode, padding,//
SecureUtil.generateKey(ALGORITHM_NAME, key),//
ArrayUtil.isEmpty(iv) ? ((IvParameterSpec) null) : new IvParameterSpec(iv));
ArrayUtil.isEmpty(iv) ? null : new IvParameterSpec(iv));
}
/**