use of org.bouncycastle.crypto.engines.CamelliaEngine in project rxlib by RockyLOMO.
the class CamelliaCrypt method getCipher.
@Override
protected StreamBlockCipher getCipher(boolean isEncrypted) throws InvalidAlgorithmParameterException {
CamelliaEngine engine = new CamelliaEngine();
StreamBlockCipher cipher;
if (_name.equals(CIPHER_CAMELLIA_128_CFB)) {
cipher = new CFBBlockCipher(engine, getIVLength() * 8);
} else if (_name.equals(CIPHER_CAMELLIA_192_CFB)) {
cipher = new CFBBlockCipher(engine, getIVLength() * 8);
} else if (_name.equals(CIPHER_CAMELLIA_256_CFB)) {
cipher = new CFBBlockCipher(engine, getIVLength() * 8);
} else {
throw new InvalidAlgorithmParameterException(_name);
}
return cipher;
}
Aggregations