Remove unnecessary alloc/copy
import org.bouncycastle.crypto.params.KeyParameter;
import org.bouncycastle.crypto.params.ParametersWithIV;
import org.bouncycastle.crypto.util.DigestFactory;
-import org.bouncycastle.util.Arrays;
/**
* Generator for PBE derived keys and ivs as defined by PKCS 5 V2.0 Scheme 2.
@@ -113,7 +112,7 @@ public CipherParameters generateDerivedParameters(
{
keySize = keySize / 8;
- byte[] dKey = Arrays.copyOfRange(generateDerivedKey(keySize), 0, keySize);
+ byte[] dKey = generateDerivedKey(keySize);
return new KeyParameter(dKey, 0, keySize);
}
