Skip to content

Commit

Permalink
Avoid overriding CipherSpi::engineDoFinal(ByteBuffer, ByteBuffer) (#302)
Browse files Browse the repository at this point in the history
  • Loading branch information
amirhosv authored May 26, 2023
1 parent 96fdeef commit 190b1ad
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/com/amazon/corretto/crypto/provider/AesGcmSpi.java
Original file line number Diff line number Diff line change
Expand Up @@ -926,22 +926,6 @@ protected int engineUpdate(ByteBuffer input, final ByteBuffer output)
}
}

@Override
protected int engineDoFinal(final ByteBuffer input, final ByteBuffer output)
throws ShortBufferException, IllegalBlockSizeException, BadPaddingException {
int initialPosition = output.position();

engineUpdate(input, output);

ShimArray shim = new ShimArray(output, engineGetOutputSize(0));
int finalBytes = engineDoFinal(EMPTY_ARRAY, 0, 0, shim.array, shim.offset);

shim.writeback();
output.position(output.position() + finalBytes);

return output.position() - initialPosition;
}

private void checkOutputBuffer(
final int inputLength, final byte[] output, final int outputOffset, final boolean doFinal)
throws ShortBufferException {
Expand Down

0 comments on commit 190b1ad

Please sign in to comment.