Skip to content
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

Add ConstantTimeSelect and ConstantTimeClone traits #118

Closed

Commits on Nov 29, 2023

  1. Add ConstantTimeSelect and ConstantTimeClone traits

    `ConstantTimeSelect` is intended as a replacement to
    `ConditionallySelectable`, which is preserved but deprecated. It
    replaces the previous `Copy` bound with a bound on a new
    `ConstantTimeClone` marker trait, which allows the trait to be impl'd
    for heap-allocated types.
    
    No existing impls of `ConditionallySelectable` have been removed,
    however a blanket impl of `ConstantTimeSelect` for
    `T: ConditionallySelectable` has been added, allowing the two traits to
    interoperate and for `ConstantTimeSelect` to work on all types which
    currently impl `ConditionallySelectable`.
    
    `ConstantTimeClone` likewise has a blanket impl for all types which impl
    `Copy`.
    
    `CtOption`'s combinator methods have been changed to bound on
    `ConstantTimeSelect` which unlocks using them with heap-allocated types,
    which otherwise is a major limitation. In theory these changes are all
    backwards compatible due to the blanket impl, which should allow all
    types which previously worked to continue to do so.
    
    Closes dalek-cryptography#63, dalek-cryptography#94
    tarcieri committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    3a8e7ca View commit details
    Browse the repository at this point in the history