/** * Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation. * The data is encrypted or decrypted, depending on how this cipher was initialized. * * <p>The first <code>inputLen</code> bytes in the <code>input</code> buffer, starting at <code> * inputOffset</code>, and any input bytes that may have been buffered during a previous <code> * update</code> operation, are processed, with padding (if requested) being applied. The result * is stored in the <code>output</code> buffer, starting at <code>outputOffset</code>. * * <p>The cipher is reset to its initial state (uninitialized) after this call. * * @param input the input buffer * @param inputOffset the offset in <code>input</code> where the input starts * @param inputLen the input length * @param output the buffer for the result * @param outputOffset the offset in <code>output</code> where the result is stored * @return the number of bytes stored in <code>output</code> * @exception IllegalBlockSizeException if this cipher is a block cipher, no padding has been * requested (only in encryption mode), and the total input length of the data processed by * this cipher is not a multiple of block size * @exception ShortBufferException if the given output buffer is too small to hold the result * @exception BadPaddingException if decrypting and padding is choosen, but the last input data * does not have proper padding bytes. */ protected int engineDoFinal( byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws ShortBufferException, IllegalBlockSizeException, BadPaddingException { return core.doFinal(input, inputOffset, inputLen, output, outputOffset); }
/** * Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation. * The data is encrypted or decrypted, depending on how this cipher was initialized. * * <p>The first <code>inputLen</code> bytes in the <code>input</code> buffer, starting at <code> * inputOffset</code>, and any input bytes that may have been buffered during a previous <code> * update</code> operation, are processed, with padding (if requested) being applied. The result * is stored in a new buffer. * * <p>The cipher is reset to its initial state (uninitialized) after this call. * * @param input the input buffer * @param inputOffset the offset in <code>input</code> where the input starts * @param inputLen the input length * @return the new buffer with the result * @exception IllegalBlockSizeException if this cipher is a block cipher, no padding has been * requested (only in encryption mode), and the total input length of the data processed by * this cipher is not a multiple of block size * @exception BadPaddingException if decrypting and padding is choosen, but the last input data * does not have proper padding bytes. */ protected byte[] engineDoFinal(byte[] input, int inputOffset, int inputLen) throws IllegalBlockSizeException, BadPaddingException { return core.doFinal(input, inputOffset, inputLen); }