Skip to content

Support for constant-time ordering comparisons? #61

Closed
@gendx

Description

@gendx

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions