crypto/internal/mlkem768: move to crypto/internal/fips/mlkem

In the process, replace out-of-module imports with their FIPS versions.

For #69536

Change-Id: I83e900b7c38ecf760382e5dca7fd0b1eaa5a5589
Reviewed-on: https://go-review.googlesource.com/c/go/+/626879
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
This commit is contained in:
yuhan6665
2025-05-04 21:57:47 -04:00
parent f63b058d4a
commit 3833e8e2cb
14 changed files with 1703 additions and 902 deletions
+2 -2
View File
@@ -22,7 +22,7 @@ import (
"slices"
"time"
"github.com/xtls/reality/mlkem768"
"github.com/xtls/reality/mlkem"
"github.com/xtls/reality/tls13"
)
@@ -276,7 +276,7 @@ func (hs *serverHandshakeStateTLS13) processClientHello() error {
ecdhData := clientKeyShare.data
if selectedGroup == x25519Kyber768Draft00 {
ecdhGroup = X25519
if len(ecdhData) != x25519PublicKeySize+mlkem768.EncapsulationKeySize768 {
if len(ecdhData) != x25519PublicKeySize+mlkem.EncapsulationKeySize768 {
c.sendAlert(alertIllegalParameter)
return errors.New("tls: invalid Kyber client key share")
}