Class CTRMode

  • All 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
    Version:
    $Id: CTRMode.java,v 1.1 2007/10/15 12:49:55 cplattne Exp $
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) BlockCipher bc  
      (package private) int blockSize  
      (package private) int count  
      (package private) boolean doEncrypt  
      (package private) byte[] X  
      (package private) byte[] Xenc  
    • Constructor Summary

      Constructors 
      Constructor Description
      CTRMode​(BlockCipher tc, byte[] iv, boolean doEnc)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getBlockSize()  
      void init​(boolean forEncryption, byte[] key)  
      void transformBlock​(byte[] src, int srcoff, byte[] dst, int dstoff)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • X

        byte[] X
      • Xenc

        byte[] Xenc
      • blockSize

        int blockSize
      • doEncrypt

        boolean doEncrypt
      • count

        int count
    • Constructor Detail

      • CTRMode

        public CTRMode​(BlockCipher tc,
                       byte[] iv,
                       boolean doEnc)
                throws java.lang.IllegalArgumentException
        Throws:
        java.lang.IllegalArgumentException
    • Method Detail

      • 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