Re: RFR: 8296507: GCM using more memory than necessary with in-place operations [v3]

2022-12-01 Thread Valerie Peng
On Thu, 1 Dec 2022 04:19:37 GMT, Anthony Scarpino wrote: >> I would like a review of an update to the GCM code. A recent report showed >> that GCM memory usage for TLS was very large. This was a result of in-place >> buffers, which TLS uses, and how the code handled the combined intrinsic >>

Re: RFR: 8295803: Console should be usable in jshell and other environments [v2]

2022-12-01 Thread Weijun Wang
On Thu, 1 Dec 2022 19:30:29 GMT, Naoto Sato wrote: >> What's the expected behavior? > > I confirmed that the standalone `keytool` did not echo the input, which > should be OK for this IMO. If the console cannot be used anyway inside jshell, then this is good enough. - PR: https://

Re: RFR: 8297379: Enable the ByteBuffer path of Poly1305 optimizations [v3]

2022-12-01 Thread Sandhya Viswanathan
On Thu, 1 Dec 2022 18:23:45 GMT, Volodymyr Paprotski wrote: >> There is now an intrinsic for Poly1305, which is only enabled on the >> `engineUpdate([]byte)` path. This PR adds intrinsic support >> `engineUpdate(ByteBuffer)` (when the bytebuffer `hasArray`). >> >> Fuzzing test expanded to also

Re: RFR: 8297379: Enable the ByteBuffer path of Poly1305 optimizations [v3]

2022-12-01 Thread Sandhya Viswanathan
On Thu, 1 Dec 2022 18:23:45 GMT, Volodymyr Paprotski wrote: >> There is now an intrinsic for Poly1305, which is only enabled on the >> `engineUpdate([]byte)` path. This PR adds intrinsic support >> `engineUpdate(ByteBuffer)` (when the bytebuffer `hasArray`). >> >> Fuzzing test expanded to also

Re: RFR: 8296546: Add @spec tags to API [v4]

2022-12-01 Thread Naoto Sato
On Thu, 1 Dec 2022 19:37:28 GMT, Jonathan Gibbons wrote: >> src/java.base/share/classes/java/lang/Character.java line 172: >> >>> 170: * occur. For example, in a future release, synchronization may fail. >>> 171: * >>> 172: * @spec https://www.unicode.org/reports/tr27 Unicode 3.1.0 >> >> Thi

Re: RFR: 8296507: GCM using more memory than necessary with in-place operations [v2]

2022-12-01 Thread Valerie Peng
On Thu, 1 Dec 2022 04:10:32 GMT, Anthony Scarpino wrote: >> src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java >> line 778: >> >>> 776: gctr, ghash); >>> 777: } else { >>> 778: int ofs = src.arrayOff

Re: RFR: 8296546: Add @spec tags to API [v3]

2022-12-01 Thread Jonathan Gibbons
On Wed, 23 Nov 2022 23:04:36 GMT, Joe Wang wrote: >> Jonathan Gibbons has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Remove updates from unexported files > > src/java.xml/share/classes/javax/xml/XMLConstants.java line 35: > >> 33: * @

Re: RFR: 8296546: Add @spec tags to API [v4]

2022-12-01 Thread Jonathan Gibbons
On Thu, 10 Nov 2022 23:51:19 GMT, Naoto Sato wrote: >> Jonathan Gibbons has updated the pull request with a new target base due to >> a merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contains five additional >> commi

Re: RFR: 8296546: Add @spec tags to API [v4]

2022-12-01 Thread Jonathan Gibbons
> Please review a "somewhat automated" change to insert `@spec` tags into doc > comments, as appropriate, to leverage the recent new javadoc feature to > generate a new page listing the references to all external specifications > listed in the `@spec` tags. > > "Somewhat automated" means that I

Re: RFR: 8295803: Console should be usable in jshell and other environments [v2]

2022-12-01 Thread Naoto Sato
On Thu, 1 Dec 2022 17:53:58 GMT, Weijun Wang wrote: >> I can still see the password on screen. Here `in` is a >> `jdk.jshell.execution.Util` so the updated check on line 58 above failed. >> >> $ jshell -C--add-exports -Cjava.base/sun.security.tools.keytool=ALL-UNNAMED >> -R--add-exports -Rjava

Re: RFR: 8297379: Enable the ByteBuffer path of Poly1305 optimizations [v3]

2022-12-01 Thread Volodymyr Paprotski
> There is now an intrinsic for Poly1305, which is only enabled on the > `engineUpdate([]byte)` path. This PR adds intrinsic support > `engineUpdate(ByteBuffer)` (when the bytebuffer `hasArray`). > > Fuzzing test expanded to also include ByteBuffer payloads. > > Performance is now matched: > >

Re: RFR: 8296507: GCM using more memory than necessary with in-place operations [v3]

2022-12-01 Thread Jamil Nimeh
On Thu, 1 Dec 2022 04:19:37 GMT, Anthony Scarpino wrote: >> I would like a review of an update to the GCM code. A recent report showed >> that GCM memory usage for TLS was very large. This was a result of in-place >> buffers, which TLS uses, and how the code handled the combined intrinsic >>

Re: RFR: 8297379: Enable the ByteBuffer path of Poly1305 optimizations [v3]

2022-12-01 Thread Volodymyr Paprotski
On Tue, 29 Nov 2022 01:16:28 GMT, Sandhya Viswanathan wrote: >> Volodymyr Paprotski has updated the pull request incrementally with one >> additional commit since the last revision: >> >> remove comment > > src/java.base/share/classes/com/sun/crypto/provider/Poly1305.java line 260: > >> 258

Re: RFR: 8297379: Enable the ByteBuffer path of Poly1305 optimizations [v3]

2022-12-01 Thread Volodymyr Paprotski
On Thu, 24 Nov 2022 18:42:01 GMT, Jatin Bhateja wrote: >> Volodymyr Paprotski has updated the pull request incrementally with one >> additional commit since the last revision: >> >> remove comment > > src/java.base/share/classes/com/sun/crypto/provider/Poly1305.java line 268: > >> 266:

Re: RFR: 8297379: Enable the ByteBuffer path of Poly1305 optimizations [v3]

2022-12-01 Thread Volodymyr Paprotski
On Thu, 1 Dec 2022 18:41:42 GMT, Volodymyr Paprotski wrote: >> src/java.base/share/classes/com/sun/crypto/provider/Poly1305.java line 268: >> >>> 266: } else { >>> 267: while (blockMultipleLength > 0) { >>> 268: processBlock(buf, BLOCK_LENGTH); >> >> For nati

RFR: 8297972: Poly1305 Endianness on ByteBuffer not enforced

2022-12-01 Thread Volodymyr Paprotski
Per rfc7539 Section 2.5, "Read the block as a little-endian number." sun.security.util.math.intpoly.IntegerPolynomial1305 enforces this on input when input is provided as `[]byte` but not when input is in `ByteBuffer` Tested with `Poly1305IntrinsicFuzzTest.java` from https://github.com/openjdk/

Re: RFR: 8295803: Console should be usable in jshell and other environments [v2]

2022-12-01 Thread Weijun Wang
On Thu, 1 Dec 2022 16:08:39 GMT, Weijun Wang wrote: >> Sure. Trying out now... > > I can still see the password on screen. Here `in` is a > `jdk.jshell.execution.Util` so the updated check on line 58 above failed. > > $ jshell -C--add-exports -Cjava.base/sun.security.tools.keytool=ALL-UNNAMED

Re: RFR: 8297379: Enable the ByteBuffer path of Poly1305 optimizations [v2]

2022-12-01 Thread Volodymyr Paprotski
> Regarding mainline: > - I decided not to 'unroll' the top while loop (i.e. `engineUpdate(byte[] > input, int offset, int len)` is unrolled) >- It is debatable which version is easier to understand. If this version > is 'too complex', I can unroll the top while loop. > - I do think this ver

RFR: 8267617: Certificate's IP x509 NameConstraints raises ArrayIndexOutOfBoundsException

2022-12-01 Thread Daniel JeliƄski
This patch fixes the exceptions that may occur when merging IP address NameConstraints from different certificates in a chain. The included test reports 3 exceptions without the fix, passes with the fix applied. Tiers 1-3 continue to pass. - Commit messages: - Add test - Fix nam

Re: RFR: 8295803: Console should be usable in jshell and other environments [v2]

2022-12-01 Thread Weijun Wang
On Thu, 1 Dec 2022 15:49:30 GMT, Weijun Wang wrote: >> src/java.base/share/classes/sun/security/util/Password.java line 63: >> >>> 61: // readPassword returns "" if you just press ENTER with >>> the built-in Console, >>> 62: // to be compatible with old Password

Re: RFR: 8295803: Console should be usable in jshell and other environments [v2]

2022-12-01 Thread Weijun Wang
On Thu, 1 Dec 2022 15:16:29 GMT, Alan Bateman wrote: >> Naoto Sato has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Adds a test >> - Removed JavaIOAccess.charset() which is no longer needed > > src/java.base/share/classes/sun/security/

Re: RFR: 8295803: Console should be usable in jshell and other environments [v2]

2022-12-01 Thread Alan Bateman
On Wed, 30 Nov 2022 20:44:30 GMT, Naoto Sato wrote: >> This is to allow Console to be used even when it is not attached to the >> platform provided terminal, such as the case when the standard input is >> redirected. `System.console()` now returns a Console implementation based on >> `jdk.inte

Re: RFR: 8295803: Console should be usable in jshell and other environments [v2]

2022-12-01 Thread Alan Bateman
On Wed, 30 Nov 2022 20:44:30 GMT, Naoto Sato wrote: >> This is to allow Console to be used even when it is not attached to the >> platform provided terminal, such as the case when the standard input is >> redirected. `System.console()` now returns a Console implementation based on >> `jdk.inte

Re: RFR: 8295803: Console should be usable in jshell and other environments [v2]

2022-12-01 Thread Alan Bateman
On Wed, 30 Nov 2022 20:44:30 GMT, Naoto Sato wrote: >> This is to allow Console to be used even when it is not attached to the >> platform provided terminal, such as the case when the standard input is >> redirected. `System.console()` now returns a Console implementation based on >> `jdk.inte

Re: RFR: 8295803: Console should be usable in jshell and other environments [v2]

2022-12-01 Thread Jim Laskey
On Wed, 30 Nov 2022 20:44:30 GMT, Naoto Sato wrote: >> This is to allow Console to be used even when it is not attached to the >> platform provided terminal, such as the case when the standard input is >> redirected. `System.console()` now returns a Console implementation based on >> `jdk.inte