Class StreamBlockCipher

    • Constructor Detail

      • StreamBlockCipher

        protected StreamBlockCipher​(BlockCipher cipher)
    • Method Detail

      • getUnderlyingCipher

        public BlockCipher getUnderlyingCipher()
        return the underlying block cipher that we are wrapping.
        Returns:
        the underlying block cipher that we are wrapping.
      • returnByte

        public final byte returnByte​(byte in)
        Description copied from interface: StreamCipher
        encrypt/decrypt a single byte returning the result.
        Specified by:
        returnByte in interface StreamCipher
        Parameters:
        in - the byte to be processed.
        Returns:
        the result of processing the input byte.
      • processBytes

        public int processBytes​(byte[] in,
                                int inOff,
                                int len,
                                byte[] out,
                                int outOff)
                         throws DataLengthException
        Description copied from interface: StreamCipher
        process a block of bytes from in putting the result into out.
        Specified by:
        processBytes in interface StreamCipher
        Parameters:
        in - the input byte array.
        inOff - the offset into the in array where the data to be processed starts.
        len - the number of bytes to be processed.
        out - the output buffer the processed bytes go into.
        outOff - the offset into the output byte array the processed data starts at.
        Returns:
        the number of bytes produced - should always be len.
        Throws:
        DataLengthException - if the output buffer is too small.
      • calculateByte

        protected abstract byte calculateByte​(byte b)