Skip to content

Conversation

@tarcieri
Copy link
Member

This is the main way subtle constructs Choice so it's important for backwards compatibility.

It seems like if we had from_u8_lsb, we could avoid the panic condition by always masking the input u8. We don't yet, but this commit also leaves a comment to consider deprecating both this From<u8> impl and Choice::new in the future.

This is the main way `subtle` constructs `Choice` so it's important for
backwards compatibility.

It seems like if we had `from_u8_lsb`, we could avoid the panic
condition by always masking the input `u8`. We don't yet, but this
commit also leaves a comment to consider deprecating both this
`From<u8>` impl and `Choice::new` in the future.
@tarcieri tarcieri merged commit e4a593d into master Dec 29, 2025
13 checks passed
@tarcieri tarcieri deleted the ctutils/impl-from-u8-for-choice branch December 29, 2025 16:54
@tarcieri tarcieri mentioned this pull request Dec 29, 2025
tarcieri added a commit that referenced this pull request Dec 29, 2025
### Added
- Impl `From<u8>` for `Choice` (#1309)
- `Choice::from_u8*` and `from_u16*` (#1311)

### Changed
- Deprecate `Choice::new` (#1312)
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