]> Cypherpunks repositories - gostls13.git/commit
crypto/mlkem: swap order of return values of Encapsulate
authorAlec Bakholdin <alecbakholdin@gmail.com>
Mon, 23 Dec 2024 01:36:59 +0000 (20:36 -0500)
committerGopher Robot <gobot@golang.org>
Thu, 26 Dec 2024 20:33:05 +0000 (12:33 -0800)
commitcce75da30b6a1a58f7265401279cab707d403dcf
treedcb29fd34224b8b665314812bbfb8dda9ddd3ae2
parent772f024c615ec13c6cd28bf024e9d6be852201b6
crypto/mlkem: swap order of return values of Encapsulate

Per FIPS 203 (https://csrc.nist.gov/pubs/fips/203/final), the order of return values should be sharedKey, ciphertext. This commit simply swaps those return values and updates any consumers of the Encapsulate() method to respect the new order.

Fixes #70950

Change-Id: I2a0d605e3baf7fe69510d60d3d35bbac18f883c9
Reviewed-on: https://go-review.googlesource.com/c/go/+/638376
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Austin Clements <austin@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/crypto/internal/fips140/mlkem/cast.go
src/crypto/internal/fips140/mlkem/mlkem1024.go
src/crypto/internal/fips140/mlkem/mlkem768.go
src/crypto/mlkem/mlkem1024.go
src/crypto/mlkem/mlkem768.go
src/crypto/mlkem/mlkem_test.go
src/crypto/tls/handshake_server_tls13.go