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

API Redesign & Ergonomics #68

Open
3 of 12 tasks
mberry opened this issue Mar 14, 2023 · 1 comment
Open
3 of 12 tasks

API Redesign & Ergonomics #68

mberry opened this issue Mar 14, 2023 · 1 comment

Comments

@mberry
Copy link
Member

mberry commented Mar 14, 2023

The current API emulates the NIST code to follow along with the standardisation process. Now that is all done we can do a proper cleanup to make it more idiomatic along with general quality of life improvements. A non-comprehensive list of to-do's:

  • Keypair with no visible fields
  • Remove redundant public key field from Keypair
  • Runtime public key function to extract from secret key
  • Generate new Keypair struct from existing private key
  • Generate new Keypair struct from 64 byte seed
  • Encapsulation/Decapsulation function arguments accepting impl AsRef<PublicKey> / impl AsRef<SecretKey>
  • Keypair - impl Hash - For public key only, non-cryptographic hashes often used
  • Keypair - impl Debug - For public key only, elide secret key from any possible logging
  • Keypair - impl PartialEq - For public key only, make note in docs that it is not constant time
  • Keypair - impl Eq
  • Keypair - impl Zeroize - will require an alternative api using Pin/ Box along with documentation. Needs a locally instantiated SecretBuffer by the end user to prevent return value optimisations copying everything willynilly.
  • Replace type alias for SharedSecret with a concrete type, implement the same traits as for Keypair above.

Related to #59, it's preferable to get this all wrapped up into one release.

@mberry
Copy link
Member Author

mberry commented Mar 14, 2023

Quite a few of these already exist in the draft PR here: #67

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