pub struct I32(pub i32);
Tuple Fields§
§0: i32
Implementations§
Source§impl I32
impl I32
pub fn classify<T>(x: T) -> I32
Sourcepub fn declassify(self) -> i32
pub fn declassify(self) -> i32
Warning: use with caution, breaks the constant-time guarantee.
pub fn zero() -> I32
pub fn one() -> I32
pub fn ones() -> I32
pub fn from_le_bytes(bytes: &[U8]) -> Vec<I32>
pub fn to_le_bytes(ints: &[I32]) -> Vec<U8>
pub fn from_be_bytes(bytes: &[U8]) -> Vec<I32>
pub fn to_be_bytes(ints: &[I32]) -> Vec<U8>
pub fn max_value() -> I32
Source§impl I32
impl I32
pub fn rotate_left(self, rotval: usize) -> I32
pub fn rotate_right(self, rotval: usize) -> I32
Source§impl I32
§Constant-time comparison operators
impl I32
§Constant-time comparison operators
pub fn comp_eq(self, rhs: I32) -> I32
Sourcepub fn comp_ne(self, rhs: I32) -> I32
pub fn comp_ne(self, rhs: I32) -> I32
Produces a new integer which is all ones if the first argument is different from the second argument, and all zeroes otherwise.
Sourcepub fn comp_gte(self, rhs: I32) -> I32
pub fn comp_gte(self, rhs: I32) -> I32
Produces a new integer which is all ones if the first argument is greater than or equal to the second argument, and all zeroes otherwise. With inspiration from
Sourcepub fn comp_gt(self, rhs: I32) -> I32
pub fn comp_gt(self, rhs: I32) -> I32
Produces a new integer which is all ones if the first argument is strictly greater than the second argument, and all zeroes otherwise.
Trait Implementations§
Source§impl AddAssign for I32
Warning: has wrapping semantics.
impl AddAssign for I32
Warning: has wrapping semantics.
Source§fn add_assign(&mut self, rhs: I32)
fn add_assign(&mut self, rhs: I32)
+=
operation. Read moreSource§impl BitAndAssign for I32
impl BitAndAssign for I32
Source§fn bitand_assign(&mut self, rhs: I32)
fn bitand_assign(&mut self, rhs: I32)
&=
operation. Read moreSource§impl BitOrAssign for I32
impl BitOrAssign for I32
Source§fn bitor_assign(&mut self, rhs: I32)
fn bitor_assign(&mut self, rhs: I32)
|=
operation. Read moreSource§impl BitXorAssign for I32
impl BitXorAssign for I32
Source§fn bitxor_assign(&mut self, rhs: I32)
fn bitxor_assign(&mut self, rhs: I32)
^=
operation. Read moreSource§impl Integer for I32
impl Integer for I32
Source§fn set_bit(self, b: Self, i: usize) -> Self
fn set_bit(self, b: Self, i: usize) -> Self
Set bit i
of this integer to b
and return the result.
Bit b
has to be 0
or 1
.
Source§fn set(self, pos: usize, y: Self, yi: usize) -> Self
fn set(self, pos: usize, y: Self, yi: usize) -> Self
Set bit pos
of this integer to bit yi
of integer y
.
const NUM_BITS: usize = 32usize
fn ZERO() -> Self
fn ONE() -> Self
fn TWO() -> Self
Source§fn from_literal(val: u128) -> Self
fn from_literal(val: u128) -> Self
val
.Source§fn from_hex_string(s: &String) -> Self
fn from_hex_string(s: &String) -> Self
Integer
.fn rotate_left(self, n: usize) -> Self
fn rotate_right(self, n: usize) -> Self
Source§impl ModNumeric for I32
impl ModNumeric for I32
Source§fn signed_modulo(self, n: Self) -> Self
fn signed_modulo(self, n: Self) -> Self
self % n
that always returns a positive integer
FIXME: not ct!
Source§impl MulAssign for I32
Warning: has wrapping semantics.
impl MulAssign for I32
Warning: has wrapping semantics.
Source§fn mul_assign(&mut self, rhs: I32)
fn mul_assign(&mut self, rhs: I32)
*=
operation. Read moreSource§impl Numeric for I32
impl Numeric for I32
Source§fn exp(self, exp: u32) -> Self
fn exp(self, exp: u32) -> Self
self ^ exp
where exp
is a u32
.
Note: the exponent exp
MUST NOT be secret.
Source§fn pow_self(self, _exp: Self) -> Self
fn pow_self(self, _exp: Self) -> Self
self ^ exp
where exp
is a Self
.
Here both, base and exponent, are secret.
TODO: implement
Source§fn greater_than(self, other: Self) -> bool
fn greater_than(self, other: Self) -> bool
Declassifies
Source§fn greater_than_or_equal(self, other: Self) -> bool
fn greater_than_or_equal(self, other: Self) -> bool
Declassifies
Source§fn less_than_or_equal(self, other: Self) -> bool
fn less_than_or_equal(self, other: Self) -> bool
Declassifies
fn wrap_add(self, rhs: Self) -> Self
fn wrap_sub(self, rhs: Self) -> Self
fn wrap_mul(self, rhs: Self) -> Self
fn wrap_div(self, _rhs: Self) -> Self
fn not_equal_bm(self, other: Self) -> Self
fn equal_bm(self, other: Self) -> Self
fn greater_than_bm(self, other: Self) -> Self
fn greater_than_or_equal_bm(self, other: Self) -> Self
fn less_than_bm(self, other: Self) -> Self
fn less_than_or_equal_bm(self, other: Self) -> Self
Source§impl SecretInteger for I32
impl SecretInteger for I32
type PublicVersion = i32
fn classify(x: Self::PublicVersion) -> Self
Source§impl SecretIntegerCopy for I32
impl SecretIntegerCopy for I32
type PublicVersionCopy = i32
fn classify(x: Self::PublicVersionCopy) -> Self
Source§impl ShlAssign<usize> for I32
impl ShlAssign<usize> for I32
Source§fn shl_assign(&mut self, rhs: usize)
fn shl_assign(&mut self, rhs: usize)
<<=
operation. Read moreSource§impl ShrAssign<usize> for I32
impl ShrAssign<usize> for I32
Source§fn shr_assign(&mut self, rhs: usize)
fn shr_assign(&mut self, rhs: usize)
>>=
operation. Read moreSource§impl SubAssign for I32
Warning: has wrapping semantics.
impl SubAssign for I32
Warning: has wrapping semantics.
Source§fn sub_assign(&mut self, rhs: I32)
fn sub_assign(&mut self, rhs: I32)
-=
operation. Read more