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

Generalize the use of constant time ecdh::shared_secret_point #94

Merged
merged 5 commits into from
Jun 3, 2024

Conversation

Sosthene00
Copy link
Contributor

Build up on 629ca80 that removes the use of mul_tweak() and display 2 distincts calculate_shared_point() api in utils, one for sending and the other for receiving. While very similar I think that it will help implementors figure out what argument goes where when you're either on receiver or sender side.

Sosthene00 and others added 4 commits May 27, 2024 11:01
Using the `PublicKey` struct makes more sense for an api like this I
think. If people want to access the internaly byte array, they can use
the `PublicKey` serialize functions.
@Sosthene00
Copy link
Contributor Author

ACK, I think it makes sense and in case we need the full pubkey as byte array. I propose a small improvement: since shared_secret_point() can't fail and guarantee to return a valid point on the curve, I think it's safe to simply expect() the conversion to PublicKey, this way we don't need to return a Result and that can be more confortable for the caller (Result can be annoying in closure for example). But that's just a suggestion, if you'd rather not take the chance just drop the last commit and merge it as it is.

@cygnet3 cygnet3 merged commit f7eafdd into cygnet3:master Jun 3, 2024
2 checks passed
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.

2 participants