Class BaseCTRCipher

    • Field Detail

      • blocksProcessed

        private long blocksProcessed
    • Constructor Detail

      • BaseCTRCipher

        public BaseCTRCipher​(int ivsize,
                             int authSize,
                             int kdfSize,
                             java.lang.String algorithm,
                             int keySize,
                             java.lang.String transformation,
                             int blkSize)
    • Method Detail

      • update

        public void update​(byte[] input,
                           int inputOffset,
                           int inputLen)
                    throws java.lang.Exception
        Description copied from interface: Cipher
        Performs in-place encryption or decryption on the given data.
        Specified by:
        update in interface Cipher
        Overrides:
        update in class BaseCipher
        Parameters:
        input - The input/output bytes
        inputOffset - The offset of the data in the data buffer
        inputLen - The number of bytes to update, starting at the given offset; must be a multiple of the cipher's block size
        Throws:
        java.lang.Exception - If failed to execute
      • reInit

        protected void reInit​(byte[] processed,
                              int offset,
                              int length)
                       throws java.security.InvalidKeyException,
                              java.security.InvalidAlgorithmParameterException
        Overrides:
        reInit in class BaseCipher
        Throws:
        java.security.InvalidKeyException
        java.security.InvalidAlgorithmParameterException
      • determineNewParameters

        protected java.security.spec.AlgorithmParameterSpec determineNewParameters​(byte[] processed,
                                                                                   int offset,
                                                                                   int length)
        Overrides:
        determineNewParameters in class BaseCipher
      • addCarry

        private void addCarry​(byte[] iv,
                              int length,
                              int carry)