On Mon, 2 Oct 2023 23:01:13 GMT, Ben Perez <d...@openjdk.org> wrote: > > * Cipher.updateAAD(...) methods also calls checkCipherState(), so its > > javadoc should be updated as well? > > The current documentation for Cipher.updateAAD(...) is: > > "@throws IllegalStateException if this {@code Cipher} object is in a wrong > state (e.g., has not been initialized), does not accept AAD, or if operating > in either GCM or CCM mode and one of the {@code update} methods has already > been called for the active encryption/decryption operation" > > This seems fairly explicit, but I could change the wording to > > "@throws IllegalStateException if this {@code Cipher} object is in a wrong > state (e.g., has not been initialized, or is not in ENCRYPT_MODE or > DECRYPT_MODE)"
We still need the part of "does not accept AAD, or if operating in either GCM or CCM mode and one of the {@code update} methods has already been called for the active encryption/decryption operation". ------------- PR Comment: https://git.openjdk.org/jdk/pull/15727#issuecomment-1743939902