Class SICBlockCipher

    • Constructor Detail

      • SICBlockCipher

        public SICBlockCipher​(BlockCipher c)
        Basic constructor.
        Parameters:
        c - the block cipher to be used.
    • Method Detail

      • getBlockSize

        public int getBlockSize()
        Description copied from interface: BlockCipher
        Return the block size for this cipher (in bytes).
        Specified by:
        getBlockSize in interface BlockCipher
        Returns:
        the block size for this cipher in bytes.
      • processBlock

        public int processBlock​(byte[] in,
                                int inOff,
                                byte[] out,
                                int outOff)
                         throws DataLengthException,
                                IllegalStateException
        Description copied from interface: BlockCipher
        Process one block of input from the array in and write it to the out array.
        Specified by:
        processBlock in interface BlockCipher
        Parameters:
        in - the array containing the input data.
        inOff - offset into the in array the data starts at.
        out - the array the output data will be copied into.
        outOff - the offset into the out array the output will start at.
        Returns:
        the number of bytes processed and produced.
        Throws:
        DataLengthException - if there isn't enough data in in, or space in out.
        IllegalStateException - if the cipher isn't initialised.
      • reset

        public void reset()
        Description copied from interface: StreamCipher
        reset the cipher. This leaves it in the same state it was at after the last init (if there was one).
        Specified by:
        reset in interface BlockCipher
        Specified by:
        reset in interface StreamCipher
      • skip

        public long skip​(long numberOfBytes)
        Description copied from interface: SkippingCipher
        Skip numberOfBytes forwards, or backwards.
        Specified by:
        skip in interface SkippingCipher
        Parameters:
        numberOfBytes - the number of bytes to skip (positive forward, negative backwards).
        Returns:
        the number of bytes actually skipped.
      • seekTo

        public long seekTo​(long position)
        Description copied from interface: SkippingCipher
        Reset the cipher and then skip forward to a given position.
        Specified by:
        seekTo in interface SkippingCipher
        Parameters:
        position - the number of bytes in to set the cipher state to.
        Returns:
        the byte position moved to.
      • getPosition

        public long getPosition()
        Description copied from interface: SkippingCipher
        Return the current "position" of the cipher
        Specified by:
        getPosition in interface SkippingCipher
        Returns:
        the current byte position.