Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure JCE names are accurate #33

Closed
str4d opened this issue Feb 25, 2017 · 3 comments
Closed

Ensure JCE names are accurate #33

str4d opened this issue Feb 25, 2017 · 3 comments
Milestone

Comments

@str4d
Copy link
Owner

str4d commented Feb 25, 2017

This is a blocker for the 0.2 release which includes a Provider, meaning that the names become part of the API.

@str4d str4d added this to the 0.2 milestone Feb 25, 2017
@str4d
Copy link
Owner Author

str4d commented Feb 25, 2017

@str4d
Copy link
Owner Author

str4d commented Feb 25, 2017

In #19 the default Ed25519 name was change from ed25519-sha-512 to SHA512withEd25519. This has several inconsistencies with the JCA Signature naming scheme of <digest>with<encryption>:

  • <digest> is the name of the algorithm applied to the message before signing. Most signature algorithms require the message to have a specific size or format, and so the digest is used to generate a message representative. EdDSA includes an internal digest H that means it can sign arbitrary messages, but this shouldn't be specified in the <digest> field, as it is a parameter of the signature algorithm. <digest> should be used to specify the hash function for HashEdDSA (Implement HashEdDSA #34).
  • Based on the apparent convention, <encryption> should be the algorithm family (ie. EdDSA), not the name of the specific instantiation.
  • Names in a named curve table should be the curve name, not the signature instantiation.

Thus the algorithm name should be NONEwithEdDSA, but the curve name should be ed25519-sha-512 (aliased to Ed25519 as the common name).

@str4d
Copy link
Owner Author

str4d commented Apr 2, 2017

Section 8 of https://tools.ietf.org/html/draft-ietf-curdle-pkix-04 provides additional instructions for naming:

8.  Human Readable Algorithm Names

   For the purpose of consistent cross-implementation naming this
   section establishes human readable names for the algorithms specified
   in this document.  Implementations SHOULD use these names when
   referring to the algorithms.  If there is a strong reason to deviate
   from these names -- for example, if the implementation has a
   different naming convention and wants to maintain internal
   consistency -- it is encouraged to deviate as little as possible from
   the names given here.

[snip]

   Use the string "EdDSA" when referring to a signing public key or
   signature when the curve is not known or relevant.

   When the curve is known, use a more specific string.  For the id-
   EdDSA25519 value use the string "Ed25519".  For id-EdDSA448 use
   "Ed448".

Based on this, and the fact that SHA-512 is a parameter of the Ed25519 curve rather than an additional input, I'm opting to wholesale-rename the curve from ed25519-sha-512 to Ed25519. This may be a minor inconvenience to some downstream users of the library, but they can migrate when they upgrade their dependency, as it is only a human-identifiable name (unlike the OID / encoding changes in #22). There should be no dynamic dependencies downstream yet, as the Provider has not been released before now.

str4d added a commit that referenced this issue Apr 2, 2017
Use the canonical name "Ed25519" in the named curve table

Finishes #33.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant