Skip to content

Commit

Permalink
crypto: replace encoding/binary in favour of internal/byteorder
Browse files Browse the repository at this point in the history
Updates #54097

Change-Id: I827a5efd1736ce057b76f079466f2d9ead225898
GitHub-Last-Rev: 40af10469d85ce9f4bef4b40025589d9e44f43d6
GitHub-Pull-Request: golang/go#67321
Reviewed-on: https://go-review.googlesource.com/c/go/+/585017
Reviewed-by: Keith Randall <[email protected]>
Reviewed-by: Keith Randall <[email protected]>
Auto-Submit: Keith Randall <[email protected]>
Commit-Queue: Ian Lance Taylor <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Auto-Submit: Ian Lance Taylor <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
  • Loading branch information
mateusz834 authored and adotkhan committed Dec 10, 2024
1 parent bdcc985 commit ac04883
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/mlkem768/mlkem768.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ package mlkem768
import (
"crypto/rand"
"crypto/subtle"
"encoding/binary"
"errors"
"internal/byteorder"

"golang.org/x/crypto/sha3"
)
Expand Down Expand Up @@ -864,8 +864,8 @@ func sampleNTT(rho []byte, ii, jj byte) nttElement {
B.Read(buf[:])
off = 0
}
d1 := binary.LittleEndian.Uint16(buf[off:]) & 0b1111_1111_1111
d2 := binary.LittleEndian.Uint16(buf[off+1:]) >> 4
d1 := byteorder.LeUint16(buf[off:]) & 0b1111_1111_1111
d2 := byteorder.LeUint16(buf[off+1:]) >> 4
off += 3
if d1 < q {
a[j] = fieldElement(d1)
Expand Down

0 comments on commit ac04883

Please sign in to comment.