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

Add binding for SHA256 ECDH #43

Merged
merged 1 commit into from
Sep 15, 2020
Merged

Add binding for SHA256 ECDH #43

merged 1 commit into from
Sep 15, 2020

Conversation

matsjj
Copy link
Contributor

@matsjj matsjj commented Sep 10, 2020

No description provided.

@matsjj
Copy link
Contributor Author

matsjj commented Sep 10, 2020

@paulo-bc do I need to increase some version for this to be included into iOS? Obviously we don't want random changes like this to pop up downstream without us explicitly opting into it.

@Sjors
Copy link
Owner

Sjors commented Sep 10, 2020

Lgtm, but I only looked very superficially. This PR strictly adds the ecdh method, so nobody would accidentally use it.

Copy link
Contributor

@jackpooleybc jackpooleybc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -254,6 +254,35 @@ public struct Key {
return PubKey(Data(bytes: bytes_out, count: Int(EC_PUBLIC_KEY_LEN)), network, compressed: true)!
}
}

public func ecdh(pubKey: PubKey) -> Data? {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be nice to either make this throw or return a Result here which could provide specific error.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm right, but this seems to be consistent with the rest of the library.

@matsjj matsjj merged commit b6774a8 into master Sep 15, 2020
@matsjj matsjj deleted the ecdh branch September 15, 2020 12:32
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.

3 participants