Skip to content

Testing Edwards curves #559

@johughes99

Description

@johughes99

I'm just adding in some tests for Edwards curves in my testing tool. Just want to raise a few points (which did get me confused for a while).

  • When generating a keypair for Edwards curves you must specify the CKK_EC_EDWARDS key type in the public and private key templates. Unfortunately the latest version of the 3.0 PKCS#11 current mechanism spec specifies that you should use CKK_EC.

  • I generated a edwards25519 curve key pair successfully - but only using the OID specified in RFC8410. However, the method of using a printable string (as shown in the PKCS#11 current mechanism example) causes a CKR_GENERAL_ERROR. Not sure whether the printable string CHOICE is not supported at all in SoftHSMv2. If it is then the curveName "edwards25519" is not supported.

  • CK_MECHANISM_INFO reports a min key size of 256 and 456 (256 = curve 25519 and 456 = curve 448). However, this does not match the values of 255 and 448 specified in section 2.3.10 of the 3.0 PKCS#11 current mechanisms. RFC 8072 says the private key sizes should be 32 and 57 bytes respectively - which matches what SoftHSMv2 reports. So is the PKCS#11 spec is wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions