ivParam = (ParametersWithIV)param;
}
}
else if (params instanceof RC5ParameterSpec)
{
RC5ParameterSpec rc5Param = (RC5ParameterSpec)params;
param = new RC5Parameters(key.getEncoded(), ((RC5ParameterSpec)params).getRounds());
if (baseEngine.getAlgorithmName().startsWith("RC5"))
{
if (baseEngine.getAlgorithmName().equals("RC5-32"))
{
if (rc5Param.getWordSize() != 32)
{
throw new InvalidAlgorithmParameterException("RC5 already set up for a word size of 32 not " + rc5Param.getWordSize() + ".");
}
}
else if (baseEngine.getAlgorithmName().equals("RC5-64"))
{
if (rc5Param.getWordSize() != 64)
{
throw new InvalidAlgorithmParameterException("RC5 already set up for a word size of 64 not " + rc5Param.getWordSize() + ".");
}
}
}
else
{
throw new InvalidAlgorithmParameterException("RC5 parameters passed to a cipher that is not RC5.");
}
if ((rc5Param.getIV() != null) && (ivLength != 0))
{
param = new ParametersWithIV(param, rc5Param.getIV());
ivParam = (ParametersWithIV)param;
}
}
else
{