-
Notifications
You must be signed in to change notification settings - Fork 478
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
Improve points being used in data structures #220
Conversation
Also removes the chi function since Ristretto elligator merges it with the square root.
There are enough things that require both together that this looks convenient. There is minimal cost to calling as_point when you want a poiont form so I have not added arithmatic traits, but maybe they'd help in places. These should only exist for data being comitted to transcripts, like compressed points, so I implemented many traits using only the compressed form, not the point form with extra constant time assurances.
These should make serde and the optional multiscalar stuff play nicely, but maybe another route would work better.
We could add TryFrom going the other way, except no error type is defined.
Thanks for this PR. The additional derives for I'm not sure if we want to add the |
Cool. Yeah cosmetic things like this should wait until any relevant developments get sorted out. :) Yes, it's true protocol implementors could simply accept |
It might be a good idea - if it ends up being useful in a bunch of libraries that use curve25519-dalek, I wouldn't be opposed to adding it, I would just like to wait on it. |
There is a minor mistake in the |
I increasingly find this "both" approach slightly distasteful. It might be best to provide a both type but actually use some trait so that deserialization can be delayed until |
* Fixed bench when `batch` feature is not present * Added bench build regression test to CI * Fixed batch build more generally * Simplified batch cfg gates in benches * Updated criterion * Made CI batch-nondeterministic test use nostd * Fix batch_deterministic build * Removed bad compile error when batch and batch_deterministic are selected
In multi party protocols, there are situations where indexing some data structure with a public key comes in handy, so this adds various
#[derive(..)]
toCompressedRistretto
.In addition, this adds a
RistrettoBoth
both convenience type, which requires extensive boilerplate itself, but makes it easy to keep compressed and uncompressed forms together. If used properly, I believeRistrettoBoth
should reduce implementation errors, improve readability, simplify indexing data structure, and maybe facilitate performance improvements like dalek-cryptography/ed25519-dalek#61In essence,
RistrettoBoth
acts like aCompressedRistretto
that drags aroundRistrettoPoint
, which you access by calling.as_point()
. I therefore did not implement constant time or arithmetic operation traits for it, but..