RFR: 8297972: Poly1305 Endianness on ByteBuffer not enforced

Volodymyr Paprotski duke at openjdk.org
Thu Dec 1 18:36:42 UTC 2022


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/jdk/pull/11338 which compares Poly1305 MAC between `ByteBuffer` and `[]byte`

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

Commit messages:
 - enforce reading input as little_endian numbers

Changes: https://git.openjdk.org/jdk/pull/11463/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=11463&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8297972
  Stats: 3 lines in 1 file changed: 3 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/11463.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/11463/head:pull/11463

PR: https://git.openjdk.org/jdk/pull/11463



More information about the security-dev mailing list