subtle
subtle copied to clipboard
Support for constant-time ordering comparisons?
For now, the library only supports constant-time equality comparison.
Could it be extended to support constant-time ordering comparisons (https://doc.rust-lang.org/std/cmp/trait.Ord.html)? In particular for slices of the same length (using lexicographical comparison).
One application would be private key generation for curves like P-256 using rejection sampling, where the rejection requires an ordering comparison between the generated secret and the curve order.
I'm not sure whether it would make sense to extend the Choice type to support three states, or to just expose a less-than API returning a boolean choice.
Backreference: #20 -- as yet there hasn't been a compelling use-case for this functionality.
This should be available now as of #102