Skip to content

Conversation

@tarcieri
Copy link
Member

These were added in #1266 to simplify a migration from subtle::Choice with a TODO to eventually remove them. They're used in tests, including it seems, the ones for ctutils.

They're problematic because the goal of Choice is to be an opaque boolean-alternative for use in constant-time code, but especially a derived Partial(Eq) can peek inside them and bypass the encapsulation they're trying to provide in a way that's easy to branch on.

Now that crypto-bigint has actually been migrated to ctutils, we can followup on removing these as part of some final breaking changes.

These were added in #1266 to simplify a migration from `subtle::Choice`
with a TODO to eventually remove them. They're used in tests, including
it seems, the ones for `ctutils`.

They're problematic because the goal of `Choice` is to be an opaque
boolean-alternative for use in constant-time code, but especially a
derived `Partial(Eq)` can peek inside them and bypass the encapsulation
they're trying to provide in a way that's easy to branch on.

Now that `crypto-bigint` has actually been migrated to `ctutils`, we can
followup on removing these as part of some final breaking changes.
@tarcieri tarcieri force-pushed the ctutils/remove-choice-partial-eq-impls branch from df24fb3 to fd07f8c Compare December 29, 2025 21:33
@tarcieri tarcieri merged commit b639b2f into master Dec 29, 2025
13 checks passed
@tarcieri tarcieri deleted the ctutils/remove-choice-partial-eq-impls branch December 29, 2025 22:03
@tarcieri tarcieri mentioned this pull request Dec 29, 2025
tarcieri added a commit that referenced this pull request Dec 29, 2025
### Removed
- `Choice::new` (#1314)
- `(Partial)Eq` impls for `Choice` (#1315)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants