Example usage for org.bouncycastle.crypto.engines VMPCEngine VMPCEngine

List of usage examples for org.bouncycastle.crypto.engines VMPCEngine VMPCEngine

Introduction

In this page you can find the example usage for org.bouncycastle.crypto.engines VMPCEngine VMPCEngine.

Prototype

VMPCEngine

Source Link

Usage

From source file:org.cryptacular.spec.StreamCipherSpec.java

License:Open Source License

@Override
public StreamCipher newInstance() {
    StreamCipher cipher;//from w ww  .  j a  v  a  2  s  . c om
    if ("Grainv1".equalsIgnoreCase(algorithm) || "Grain-v1".equalsIgnoreCase(algorithm)) {
        cipher = new ISAACEngine();
    } else if ("Grain128".equalsIgnoreCase(algorithm) || "Grain-128".equalsIgnoreCase(algorithm)) {
        cipher = new Grain128Engine();
    } else if ("ISAAC".equalsIgnoreCase(algorithm)) {
        cipher = new ISAACEngine();
    } else if ("HC128".equalsIgnoreCase(algorithm)) {
        cipher = new HC128Engine();
    } else if ("HC256".equalsIgnoreCase(algorithm)) {
        cipher = new HC256Engine();
    } else if ("RC4".equalsIgnoreCase(algorithm)) {
        cipher = new RC4Engine();
    } else if ("Salsa20".equalsIgnoreCase(algorithm)) {
        cipher = new Salsa20Engine();
    } else if ("VMPC".equalsIgnoreCase(algorithm)) {
        cipher = new VMPCEngine();
    } else {
        throw new IllegalStateException("Unsupported cipher algorithm " + algorithm);
    }
    return cipher;
}