Skip to content

cmov: implement a constant-time equality trait #872

@brxken128

Description

@brxken128

In #868, the idea of a constant-time equality trait within cmov was discussed.

Rust currently has quite a lot of constant-time equality traits, so I'm unsure if bringing a new one into the field is the best idea.

It's possible that we could add support for it within cmov, but then implement it into a crate such as subtle (likely behind a new feature). This approach means that we don't bring yet another CT-EQ trait into the field, but can still provide constant-time equality comparisons that won't be optimized away by the compiler. Current users of the subtle crate could also enable this with almost no-effort.

I have a working x86 PoC locally - it does not seem out of reach for Aarch64 either.

I'd love to hear any thoughts/ideas surrounding this, as there's a lot applications where this functionality would be beneficial.

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