Skip to content

Commit 420f18a

Browse files
committed
Add support for X25519MLKEM768. (#179)
1 parent b00fc31 commit 420f18a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+2492
-66
lines changed

src/crypto/tls/cfkem.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ var (
4242
X25519Kyber768Draft00 = CurveID(0x6399)
4343
X25519Kyber768Draft00Old = CurveID(0xfe31)
4444
P256Kyber768Draft00 = CurveID(0xfe32)
45+
X25519MLKEM768 = CurveID(0x11ec)
4546
invalidCurveID = CurveID(0)
4647

4748
// A key agreeement similar in size but purposefully incompatible with
@@ -64,6 +65,8 @@ func curveIdToCirclScheme(id CurveID) kem.Scheme {
6465
return hybrid.Kyber768X25519()
6566
case P256Kyber768Draft00:
6667
return hybrid.P256Kyber768Draft00()
68+
case X25519MLKEM768:
69+
return hybrid.X25519MLKEM768()
6770
case DummyKex:
6871
return hpke.KEM_X25519_HKDF_SHA256.Scheme()
6972
}

src/crypto/tls/cfkem_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ func TestHybridKEX(t *testing.T) {
9595
X25519Kyber768Draft00,
9696
X25519Kyber768Draft00Old,
9797
P256Kyber768Draft00,
98+
X25519MLKEM768,
9899
DummyKex,
99100
} {
100101
run(curveID, true, true, false, false)

src/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module std
33
go 1.22
44

55
require (
6-
github.com/cloudflare/circl v1.3.8-0.20240208083452-454cfdc0f6c7
6+
github.com/cloudflare/circl v1.4.1-0.20240905130006-2d6cd9871f69
77
golang.org/x/crypto v0.16.1-0.20231129163542-152cdb1503eb
88
golang.org/x/net v0.19.1-0.20240412193750-db050b07227e
99
)

src/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
github.com/cloudflare/circl v1.3.8-0.20240208083452-454cfdc0f6c7 h1:nRedc5Iqg+cBRSKkA3c7+IUFgK9qdw87kz/McP3HnLs=
2-
github.com/cloudflare/circl v1.3.8-0.20240208083452-454cfdc0f6c7/go.mod h1:uAwUTm6m3uQF5fuJKR6LvFqgxn2wyID+kF6KJAUcZl8=
1+
github.com/cloudflare/circl v1.4.1-0.20240905130006-2d6cd9871f69 h1:AYiEIB+pGooAgRNMQtk3dCcp+D2x0UioEaKELFIxkx4=
2+
github.com/cloudflare/circl v1.4.1-0.20240905130006-2d6cd9871f69/go.mod h1:PDRU+oXvdD7KCtgKxW95M5Z8BpSCJXQORiZFnBQS5QU=
33
golang.org/x/crypto v0.16.1-0.20231129163542-152cdb1503eb h1:1ceSY7sk6sJuiDREHpfyrqDnDljsLfEP2GuTClhBBfI=
44
golang.org/x/crypto v0.16.1-0.20231129163542-152cdb1503eb/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
55
golang.org/x/net v0.19.1-0.20240412193750-db050b07227e h1:oDnvqaqHo3ho8OChMtkQbQAyp9eqnm3J7JRtt0+Cabc=

src/go/build/deps_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,9 @@ var depsRules = `
455455
crypto/boring, crypto/internal/edwards25519/field
456456
< crypto/ecdh;
457457
458+
# Unfortunately, stuck with reflect via encoding/binary.
459+
encoding/binary, crypto/boring < golang.org/x/crypto/sha3;
460+
458461
crypto/aes,
459462
crypto/des,
460463
crypto/ecdh,
@@ -464,7 +467,8 @@ var depsRules = `
464467
crypto/rc4,
465468
crypto/sha1,
466469
crypto/sha256,
467-
crypto/sha512
470+
crypto/sha512,
471+
golang.org/x/crypto/sha3
468472
< CRYPTO;
469473
470474
CGO, fmt, net !< CRYPTO;

src/vendor/github.com/cloudflare/circl/dh/x25519/curve_amd64.s

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/vendor/github.com/cloudflare/circl/dh/x448/curve_amd64.s

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/vendor/github.com/cloudflare/circl/ecc/p384/arith.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/vendor/github.com/cloudflare/circl/ecc/p384/arith_amd64.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/vendor/github.com/cloudflare/circl/ecc/p384/arith_amd64.s

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)