pub struct I64(pub i64);
Tuple Fields§
§0: i64
Implementations§
Source§impl I64
impl I64
pub fn classify<T>(x: T) -> I64
Sourcepub fn declassify(self) -> i64
pub fn declassify(self) -> i64
Warning: use with caution, breaks the constant-time guarantee.
pub fn zero() -> I64
pub fn one() -> I64
pub fn ones() -> I64
pub fn from_le_bytes(bytes: &[U8]) -> Vec<I64>
pub fn to_le_bytes(ints: &[I64]) -> Vec<U8>
pub fn from_be_bytes(bytes: &[U8]) -> Vec<I64>
pub fn to_be_bytes(ints: &[I64]) -> Vec<U8>
pub fn max_value() -> I64
Source§impl I64
impl I64
pub fn rotate_left(self, rotval: usize) -> I64
pub fn rotate_right(self, rotval: usize) -> I64
Source§impl I64
§Constant-time comparison operators
impl I64
§Constant-time comparison operators
pub fn comp_eq(self, rhs: I64) -> I64
Sourcepub fn comp_ne(self, rhs: I64) -> I64
pub fn comp_ne(self, rhs: I64) -> I64
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: I64) -> I64
pub fn comp_gte(self, rhs: I64) -> I64
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: I64) -> I64
pub fn comp_gt(self, rhs: I64) -> I64
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 I64
Warning: has wrapping semantics.
impl AddAssign for I64
Warning: has wrapping semantics.
Source§fn add_assign(&mut self, rhs: I64)
fn add_assign(&mut self, rhs: I64)
+=
operation. Read moreSource§impl BitAndAssign for I64
impl BitAndAssign for I64
Source§fn bitand_assign(&mut self, rhs: I64)
fn bitand_assign(&mut self, rhs: I64)
&=
operation. Read moreSource§impl BitOrAssign for I64
impl BitOrAssign for I64
Source§fn bitor_assign(&mut self, rhs: I64)
fn bitor_assign(&mut self, rhs: I64)
|=
operation. Read moreSource§impl BitXorAssign for I64
impl BitXorAssign for I64
Source§fn bitxor_assign(&mut self, rhs: I64)
fn bitxor_assign(&mut self, rhs: I64)
^=
operation. Read moreSource§impl Integer for I64
impl Integer for I64
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 = 64usize
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 I64
impl ModNumeric for I64
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 I64
Warning: has wrapping semantics.
impl MulAssign for I64
Warning: has wrapping semantics.
Source§fn mul_assign(&mut self, rhs: I64)
fn mul_assign(&mut self, rhs: I64)
*=
operation. Read moreSource§impl Numeric for I64
impl Numeric for I64
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 I64
impl SecretInteger for I64
type PublicVersion = i64
fn classify(x: Self::PublicVersion) -> Self
Source§impl SecretIntegerCopy for I64
impl SecretIntegerCopy for I64
type PublicVersionCopy = i64
fn classify(x: Self::PublicVersionCopy) -> Self
Source§impl ShlAssign<usize> for I64
impl ShlAssign<usize> for I64
Source§fn shl_assign(&mut self, rhs: usize)
fn shl_assign(&mut self, rhs: usize)
<<=
operation. Read moreSource§impl ShrAssign<usize> for I64
impl ShrAssign<usize> for I64
Source§fn shr_assign(&mut self, rhs: usize)
fn shr_assign(&mut self, rhs: usize)
>>=
operation. Read moreSource§impl SubAssign for I64
Warning: has wrapping semantics.
impl SubAssign for I64
Warning: has wrapping semantics.
Source§fn sub_assign(&mut self, rhs: I64)
fn sub_assign(&mut self, rhs: I64)
-=
operation. Read more