-
Notifications
You must be signed in to change notification settings - Fork 568
Implement Lizard encoding/decoding #826
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
Conversation
|
Any chance on this being merged/released soon? |
|
Yes apologies. I reckon we can merge this week. I need to address Jordan’s points above |
|
I think the build failures are due to changes between As a general recommendation, I think we should check in Cargo.lock to keep the build deterministic. Otherwise changes in prerelease crates like that will cause random breakages like this in unrelated PRs. Otherwise I can prepare a PR to do the upgrade. |
|
Oh wait, |
|
@jrose-signal Before we merge this (and once the build is working again), do you wanna do a cargo patch for libsignal, do the necessary edits, and see that all tests pass? That way we can keep all the fixes in this branch |
|
The good news: adoption was straightforward and ran into no unexpected trouble: signalapp/libsignal#636 The bad news: I'm going to do a bit of profiling and see if there's an obvious culprit—maybe the negations are noticeable in the profile, maybe it's something else. |
|
Aha, I think that's almost entirely due to the repeated |
… its inverse return 16 elements
e823d8a to
b7f7cc8
Compare
|
Alright @jrose-signal, I fixed the unnecessary recalculation and rebased the branch on main. Lmk if the benchmarks are improved. |
|
@tarcieri one last organizational thing: what do you think about making |
|
We are down to a 2% regression for |
@rozbb sounds fine to me.
@jrose-signal 2% is definitely in the range where very subtle things unrelated to the particular change can be happening, like link order changes, and unless there's an obvious culprit it probably isn't worth worrying about |
jrose-signal
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.
(copyediting)
|
Any plans on when this will also be released? |
|
@rozbb any plans on when this will be released? |
The Lizard encoding/decoding algorithms specify a map from 16-byte strings to the Ristretto group, and back. This is useful for ElGamal encryption, where plaintexts are group elements.
Signal relies on Lizard, and has been vendoring
curve25519-dalekfor years now (bc we don't exportFieldElement). I figured upstreaming would be a valuable addition to dalek, so long as it is extensively documented so as to be maintainable. It also doesn't add any new dependencies.Some highlights of this PR:
map_to_curvealgorithms necessary for downstream. Most of this is from the Signal repoThis was prepared jointly with @rolfe-signal and with input from @jrose-signal. Thank you all so much for your work on this!