tweaked IV passing to use a parameter spec.
import javax.crypto.spec.RC2ParameterSpec;
import javax.crypto.spec.RC5ParameterSpec;
-import org.bouncycastle.asn1.DEROctetString;
import org.bouncycastle.asn1.cms.GCMParameters;
import org.bouncycastle.crypto.BlockCipher;
import org.bouncycastle.crypto.BufferedBlockCipher;
@@ -251,7 +250,7 @@ else if (ivParam != null)
try
{
engineParams = createParametersInstance(name);
- engineParams.init(new DEROctetString(ivParam.getIV()).getEncoded());
+ engineParams.init(new IvParameterSpec(ivParam.getIV()));
}
catch (Exception e)
{
