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

generic curve25519 encode/decode API #8128

Closed
wants to merge 4 commits into from

Conversation

bigbrett
Copy link
Contributor

@bigbrett bigbrett commented Oct 30, 2024

Adds API for curve25519 der import/export that can handle both private and public keys in one step. I realize that typically curve25519 keys are distributed as public/private only, since you can recover the public key from the private key, but this API simplifies usage for some cases in that it doesn't require multiple import attempts if you don't know at runtime what the contents of a der key holds.

This API is particularly useful for wolfHSM, where the server doesn't know the contents of a der contain when it loads from NVM, but needs to import the key into a curve25519_key struct that then will have the proper public/private key fields set. The current API doesn't provide a straightforward way to do this.

Added doxygen, and will update the manual/docs once this merges

Testing

  • Added test to ensure new API can handle private only/public only keys in the same exact way as the existing API
  • Added test to ensure a combined keypair import/export yields the same exported der as public/private only

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@bigbrett bigbrett closed this Oct 30, 2024
@bigbrett bigbrett deleted the curve25519-generic-keyparsing branch October 30, 2024 20:07
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

Successfully merging this pull request may close these issues.

1 participant