-
Notifications
You must be signed in to change notification settings - Fork 34
Speedup phase 2 #27
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
base: develop
Are you sure you want to change the base?
Speedup phase 2 #27
Conversation
franziskuskiefer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| for _ in 0..n { | ||
| match d.u8()? { | ||
| 0 => uniq!("IdentityKey::public_key", public_key, PublicKey::decode(d)?), | ||
| 0 => uniq!( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This macro really sholdn't exist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, but that would require refactoring on a larger scale because it is not specific to this PR.
| match version { | ||
| 1 => Ok(IdentityKeyPair { | ||
| version, | ||
| secret_key: to_field!(secret_key_v1_option, "IdentityKeyPair::secret_key_v2"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh, another macro that needs to go 😬
| } | ||
|
|
||
| pub fn signed(ident: &IdentityKeyPair, key: &PreKey) -> PreKeyBundle { | ||
| let ratchet_key = key.key_pair.public_key.clone(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this need cloning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DHPublicKey doesn't implement Copy because it depends on GroupElement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I guess my main question was why this key needs to be copied. That implies that it is changed in some way, which is not really what we want. The clone should probably happen further down when the key is copied to the PreKeyBundle. Not crucial though, also nothing you actually touched 😉
| // DHPublicKey //////////////////////////////////////////////////////////////// | ||
|
|
||
| #[derive(PartialEq, Eq, Debug, Clone)] | ||
| pub struct DHPublicKey { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't a type be sufficient here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I wanted to keep the symmetry with the other keys

No description provided.