Skip to content

Conversation

@tarcieri
Copy link
Member

@tarcieri tarcieri commented Dec 20, 2025

Adds traits for computing greater than/less than in constant time.

Uses borrowing overflowing subtraction as the implementation strategy for unsigned integers.

Also adds impls for cmp::Ordering.

@tarcieri
Copy link
Member Author

tarcieri commented Dec 20, 2025

Ugh, MSRV is killing me here. Seems like borrowing_sub wasn't stabilized until 1.91.

Edit: aah, I want overflowing_sub anyway.

Adds traits for computing greater than/less than in constant time.

Uses borrowing subtraction as the implementation strategy for unsigned
integers.

Also adds impls for `cmp::Ordering`.
@tarcieri tarcieri force-pushed the ctutils/add-ct-gt-and-ct-lt branch from afa3c4c to 488f9b7 Compare December 20, 2025 02:53
@tarcieri tarcieri merged commit 14297e2 into master Dec 20, 2025
11 checks passed
@tarcieri tarcieri deleted the ctutils/add-ct-gt-and-ct-lt branch December 20, 2025 02:56
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