func TestCreateCert(t *testing.T) {
assert := assert.New(t)
cert, _ := CreateCert()
parsedCert, _ := x509.ParseCertificate(cert)
assert.Equal("Foo 1983", parsedCert.Subject.Organization[0], "Organization should be Foo 1983")
assert.Equal(x509.SignatureAlgorithm(17), parsedCert.SignatureAlgorithm, "SignatureAlgorithm should be x509.SignatureAlgorithm(17)")
assert.Equal("Ed448-Dilithium3", parsedCert.SignatureAlgorithm.String(), "SignatureAlgorithm should be Ed448-Dilithium3")
assert.Equal(x509.PublicKeyAlgorithm(5), parsedCert.PublicKeyAlgorithm, "PublicKeyAlgorithm should be x509.PublicKeyAlgorithm(5)")
assert.Equal("Ed448-Dilithium3", parsedCert.PublicKeyAlgorithm.String(), "PublicKeyAlgorithm should be Ed448-Dilithium3")
}
go test
--- FAIL: TestCreateCert (0.00s)
Error: Not equal:
expected: "Ed448-Dilithium3"
actual : "Ed25519-Dilithium3"
Test: TestCreateCert
Messages: PublicKeyAlgorithm should be Ed448-Dilithium3
Thanks for this. We didn't properly update this Go fork after we updated our Dilithium implementation in CIRCL. Dilithium3 was renamed to Dilithium2. I'll create a fix.
Description:
The
ParseCertificate
function is generating a certificate with incorrectPublicKeyAlgorithm.String()
values.Steps to reproduce:
TestCreateCert
test in theapp_test.go
file.PublicKeyAlgorithm.String()
values do not match the expected values.Expected result:
The
ParseCertificate
function should generate a certificate withPublicKeyAlgorithm.String()
set toEd448-Dilithium3
.Actual result:
The
ParseCertificate
function generates a certificate withPublicKeyAlgorithm.String()
set toEd25519-Dilithium3
.Code snippet:
The relevant code snippet is:
https://github.com/cloudflare/circl/blob/75b28edc25ec569e6353a2b944b0b83d48a9c2e8/sign/eddilithium3/eddilithium.go#L31
app.go
app_test.go
go test