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

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

Introduction

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

Prototype

HC128Engine

Source Link

Usage

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

License:Open Source License

@Override
public StreamCipher newInstance() {
    StreamCipher cipher;//from   w w w. j  a v  a 2s  .c o  m
    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;
}