You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Branching off of #220, specifically 3e91ba0 , where @burdges suggested adding
#[derive(Ord, PartialOrd, Hash)]
to CompressedRistretto. This allows using a CompressedRistretto as the key to a BTreeMap, which requires Ord (hence PartialOrd), and with HashMap, which requires Hash.
This seems like a useful use-case, for instance looking up information by a public key.
Some questions that would be good to cross off answers to:
Does it make sense to derive Ord for encodings of points? Unlike scalars, there's no meaningful ordering on points, so we could only do something like ordering the bytestrings.
Does it make sense to do this also for CompressedEdwardsY as well as CompressedRistretto? In particular, is there any potential for ambiguity/non-uniqueness?
Is there a problem with using the derived implementations? For instance, if we derive Hash, will it do something like hash one byte at a time?
What's the stability impact of adding new derives? I think this is probably fine (it's just adding new traits) but we should check.
The text was updated successfully, but these errors were encountered:
I never suggested this for CompressedEdwardsY out of anti-cofactor prejudice, but actually the cofactor could be managed reasonably for at least multi-signatures, so sure whatever.
I think these derives produce very thin wrappers, so the question boils down to [u8;32]:
Branching off of #220, specifically 3e91ba0 , where @burdges suggested adding
to
CompressedRistretto
. This allows using aCompressedRistretto
as the key to aBTreeMap
, which requiresOrd
(hencePartialOrd
), and withHashMap
, which requiresHash
.This seems like a useful use-case, for instance looking up information by a public key.
Some questions that would be good to cross off answers to:
Does it make sense to derive
Ord
for encodings of points? Unlike scalars, there's no meaningful ordering on points, so we could only do something like ordering the bytestrings.Does it make sense to do this also for
CompressedEdwardsY
as well asCompressedRistretto
? In particular, is there any potential for ambiguity/non-uniqueness?Is there a problem with using the derived implementations? For instance, if we derive
Hash
, will it do something like hash one byte at a time?What's the stability impact of adding new derives? I think this is probably fine (it's just adding new traits) but we should check.
The text was updated successfully, but these errors were encountered: