On Mon, 16 Nov 2020 19:23:20 GMT, Valerie Peng <valer...@openjdk.org> wrote:

>> You don't know what 'len', which includes ibuffer data, until this point in 
>> the code.
>
> Well, didn't you already calcuate the 'len' value in the beginning of the 
> copied-from-GCTR RuntimeException check?

I'm removing the runtime check in the next update, it was duplicate of the 
ShortBufferException.  Calculating 'len' through the if() above line 818 while 
it is prepares the bytebuffers is good enough.

>> I thought so too, but that isn't what GCTR returns.  All the GCTR checks are 
>> RuntimeExceptions.  This check was original inside of GCTR, but I had to 
>> bring it out because of the ibuffer lengths.  I don't mind changing, it's 
>> just a strange inconsistency.
>
> GaloisCounterMode is the caller class of GCTR and this API is meant to throw 
> ShortBufferException I think (based on the check at lines below at 820-822)...

Yes.. this check is not necessary given the ShortBufferException was already 
checked.  I am removing this as part of the next update

-------------

PR: https://git.openjdk.java.net/jdk/pull/411

Reply via email to