Expand description
Checked arithmetic: None on overflow.
CT tier B (caller-leaky) for the branchless checked atoms
(add/sub/mul/neg/shifts/abs): the Option return invites branching on
secret-derived data at the call site. Masked counterparts live in ops::ct
(cargo feature ct). CheckedDiv/CheckedRem are CT-hostile (data-dependent
division) and CheckedPow is exponent-dependent — Tier C for secret inputs.
Traits§
- Checked
Abs - Computes the absolute value, returning
Noneif it can’t be represented. - Checked
Add - Performs addition, returning
Noneif overflow occurred. - Checked
Div - Performs division, returning
Noneon division by zero or if overflow occurred. - Checked
Mul - Performs multiplication, returning
Noneif overflow occurred. - Checked
Neg - Performs negation, returning
Noneif the result can’t be represented. - Checked
Pow - Performs exponentiation, returning
Noneif overflow occurred. - Checked
Rem - Performs integral remainder, returning
Noneon division by zero or if overflow occurred. - Checked
Shl - Performs shift left, returning
Noneon shifts larger than or equal to the type width. - Checked
Shr - Performs shift right, returning
Noneon shifts larger than or equal to the type width. - Checked
Sub - Performs subtraction, returning
Noneif overflow occurred.