com.trilead.ssh2.crypto.cipher

Class CTRMode

Implemented Interfaces:
BlockCipher

public class CTRMode
extends java.lang.Object
implements BlockCipher

This is CTR mode as described in draft-ietf-secsh-newmodes-XY.txt

Constructor Summary

CTRMode(BlockCipher tc, byte[] iv, boolean doEnc)

Method Summary

int
getBlockSize()
void
init(boolean forEncryption, byte[] key)
void
transformBlock(byte[] src, int srcoff, byte[] dst, int dstoff)

Constructor Details

CTRMode

public CTRMode(BlockCipher tc,
               byte[] iv,
               boolean doEnc)
            throws IllegalArgumentException

Method Details

getBlockSize

public final int getBlockSize()
Specified by:
getBlockSize in interface BlockCipher

init

public void init(boolean forEncryption,
                 byte[] key)
Specified by:
init in interface BlockCipher

transformBlock

public final void transformBlock(byte[] src,
                                 int srcoff,
                                 byte[] dst,
                                 int dstoff)
Specified by:
transformBlock in interface BlockCipher