On Fri, 28 Oct 2022 21:55:59 GMT, Jamil Nimeh <jni...@openjdk.org> wrote:
>> I flipped-flopped on this.. I already had the code for the exception.. and >> already described the potential fix. So rather then remove the code, pushed >> the described fix. Its always easier to remove the extra field I added. Let >> me know what you think about the 'backdoor' field. > > Well, what you're doing achieves what we're looking for, thanks for making > that change. I think I'd like to see that value set on construction and not > be mutable from outside the object. Something like this: > > - place a `private final boolean checkWeakKey` up near where all the other > fields are defined. > - the no-args Poly1305 is implemented as `this(true)` > - an additional constructor is created `Poly1305(boolean checkKey)` which > sets `checkWeakKey` true or false as provided by the parameter. > - in setRSVals you should be able to wrap lines 296-310 inside a single `if > (checkWeakKey)` block. > - In the Poly1305KAT the `new Poly1305()` becomes `new Poly1305(false)`. done ------------- PR: https://git.openjdk.org/jdk/pull/10582