Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/crypto/tls/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ const (
signatureRSAPSS
signatureECDSA
signatureEd25519
signatureEdDilithium2
signatureEdDilithium3
)

Expand Down
2 changes: 2 additions & 0 deletions src/crypto/tls/tls_cf.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package tls
import (
circlPki "github.com/cloudflare/circl/pki"
circlSign "github.com/cloudflare/circl/sign"
"github.com/cloudflare/circl/sign/eddilithium2"
"github.com/cloudflare/circl/sign/eddilithium3"
)

Expand All @@ -20,6 +21,7 @@ var circlSchemes = [...]struct {
sigType uint8
scheme circlSign.Scheme
}{
{signatureEdDilithium2, eddilithium2.Scheme()},
{signatureEdDilithium3, eddilithium3.Scheme()},
}

Expand Down
8 changes: 4 additions & 4 deletions src/crypto/tls/tls_cf_circl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import (
"time"

"github.com/cloudflare/circl/sign"
"github.com/cloudflare/circl/sign/eddilithium3"
"github.com/cloudflare/circl/sign/eddilithium2"
)

func TestPQSignatureSchemes(t *testing.T) {
pqCert := createPQCert(t, eddilithium3.Scheme())
pqCert := createPQCert(t, eddilithium2.Scheme())
rsaCert := Certificate{
Certificate: [][]byte{testRSACertificate},
PrivateKey: testRSAPrivateKey,
Expand Down Expand Up @@ -47,13 +47,13 @@ func TestPQSignatureSchemes(t *testing.T) {
clientPQ: true,
serverPQ: false,
serverCerts: pqAndRsaCerts,
expectedCertSigAlg: x509.PureEdDilithium3,
expectedCertSigAlg: x509.PureEdDilithium2,
},
{
clientPQ: true,
serverPQ: true,
serverCerts: pqAndRsaCerts,
expectedCertSigAlg: x509.PureEdDilithium3,
expectedCertSigAlg: x509.PureEdDilithium2,
},
{
clientPQ: true,
Expand Down
5 changes: 4 additions & 1 deletion src/crypto/x509/x509.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ const (
SHA384WithRSAPSS
SHA512WithRSAPSS
PureEd25519
PureEdDilithium2
PureEdDilithium3
)

Expand Down Expand Up @@ -270,6 +271,7 @@ const (
DSA // Only supported for parsing.
ECDSA
Ed25519
EdDilithium2
EdDilithium3
)

Expand All @@ -278,7 +280,8 @@ var publicKeyAlgoName = [...]string{
DSA: "DSA",
ECDSA: "ECDSA",
Ed25519: "Ed25519",
EdDilithium3: "Ed25519-Dilithium3",
EdDilithium2: "Ed25519-Dilithium2",
EdDilithium3: "Ed448-Dilithium3",
Comment on lines +283 to +284
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nits: should these be named differently, like Ed25519Dilithium2 and Ed448Dilithium3?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want to break current users. Let's reconsider naming when we add Ed25519-ML-DSA-44.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it worth creating aliases which are more precise?

}

func (algo PublicKeyAlgorithm) String() string {
Expand Down
2 changes: 2 additions & 0 deletions src/crypto/x509/x509_cf.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
circlPki "github.com/cloudflare/circl/pki"
circlSign "github.com/cloudflare/circl/sign"
"github.com/cloudflare/circl/sign/eddilithium3"
"github.com/cloudflare/circl/sign/eddilithium2"
)

// To add a signature scheme from Circl
Expand All @@ -21,6 +22,7 @@ var circlSchemes = [...]struct {
alg PublicKeyAlgorithm
scheme circlSign.Scheme
}{
{PureEdDilithium2, EdDilithium2, eddilithium2.Scheme()},
{PureEdDilithium3, EdDilithium3, eddilithium3.Scheme()},
}

Expand Down