mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8297972: Poly1305 Endianness on ByteBuffer not enforced
Reviewed-by: jnimeh
This commit is contained in:
parent
facd41511b
commit
9d44dd0cca
2 changed files with 5 additions and 5 deletions
|
@ -127,6 +127,8 @@ public final class IntegerPolynomial1305 extends IntegerPolynomial {
|
|||
@Override
|
||||
protected void encode(ByteBuffer buf, int length, byte highByte,
|
||||
long[] result) {
|
||||
ByteOrder currOrder = buf.order();
|
||||
buf.order(ByteOrder.LITTLE_ENDIAN);
|
||||
if (length == 16) {
|
||||
long low = buf.getLong();
|
||||
long high = buf.getLong();
|
||||
|
@ -134,6 +136,7 @@ public final class IntegerPolynomial1305 extends IntegerPolynomial {
|
|||
} else {
|
||||
super.encode(buf, length, highByte, result);
|
||||
}
|
||||
buf.order(currOrder);
|
||||
}
|
||||
|
||||
protected void encode(long high, long low, byte highByte, long[] result) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue