FileDocCategorySizeDatePackage
NullEngine.javaAPI DocAndroid 1.5 API2086Wed May 06 22:41:06 BST 2009org.bouncycastle.crypto.engines

NullEngine

public class NullEngine extends Object implements org.bouncycastle.crypto.BlockCipher
The no-op engine that just copies bytes through, irrespective of whether encrypting and decrypting. Provided for the sake of completeness.

Fields Summary
protected static final int
BLOCK_SIZE
Constructors Summary
public NullEngine()
Standard constructor.

    
           
     
    
        super();
    
Methods Summary
public java.lang.StringgetAlgorithmName()

        return "Null";
    
public intgetBlockSize()

        return BLOCK_SIZE;
    
public voidinit(boolean forEncryption, org.bouncycastle.crypto.CipherParameters params)

        // we don't mind any parameters that may come in
    
public intprocessBlock(byte[] in, int inOff, byte[] out, int outOff)

            if ((inOff + BLOCK_SIZE) > in.length)
            {
                throw new DataLengthException("input buffer too short");
            }

            if ((outOff + BLOCK_SIZE) > out.length)
            {
                throw new DataLengthException("output buffer too short");
            }
            
            for (int i = 0; i < BLOCK_SIZE; ++i)
            {
                out[outOff + i] = in[inOff + i];
            }
            
            return BLOCK_SIZE;
    
public voidreset()

        // nothing needs to be done