Struct optee_utee::arithmetical::BigInt

source ·
pub struct BigInt(/* private fields */);

Implementations§

source§

impl BigInt

source

pub fn data_ptr(&self) -> *const u32

source

pub fn size_in_u32(size: u32) -> u32

source

pub fn new(bits: u32) -> Self

source

pub fn convert_from_octet_string( &mut self, buffer: &[u8], sign: i32 ) -> Result<()>

source

pub fn convert_to_octet_string(&self) -> Result<Vec<u8>>

source

pub fn convert_from_s32(&mut self, short_val: i32)

source

pub fn convert_to_s32(&self) -> Result<i32>

source

pub fn compare_big_int(&self, target: &Self) -> i32

source

pub fn compare_s32(&self, target: i32) -> i32

source

pub fn shift_right(&mut self, op: &Self, bits: usize)

source

pub fn get_bit(&self, bit_index: u32) -> bool

source

pub fn get_bit_count(&self) -> u32

source

pub fn add(op1: &Self, op2: &Self) -> Self

source

pub fn sub(op1: &Self, op2: &Self) -> Self

source

pub fn neg(op: &Self) -> Self

source

pub fn multiply(op1: &Self, op2: &Self) -> Self

source

pub fn square(op: &Self) -> Self

source

pub fn divide(op1: &Self, op2: &Self) -> (Self, Self)

source

pub fn module(op: &Self, n: &Self) -> Self

source

pub fn add_mod(op1: &Self, op2: &Self, n: &Self) -> Self

source

pub fn sub_mod(op1: &Self, op2: &Self, n: &Self) -> Self

source

pub fn mul_mod(op1: &Self, op2: &Self, n: &Self) -> Self

source

pub fn square_mod(op: &Self, n: &Self) -> Self

source

pub fn inv_mod(op: &Self, n: &Self) -> Self

source

pub fn relative_prime(op1: &Self, op2: &Self) -> bool

source

pub fn is_probable_prime(&self, confidence_level: u32) -> i32

source

pub fn convert_from_big_int_fmm( &mut self, src: &BigIntFMM, n: &BigInt, context: BigIntFMMContext )

Trait Implementations§

source§

impl Display for BigInt

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for BigInt

§

impl RefUnwindSafe for BigInt

§

impl Send for BigInt

§

impl Sync for BigInt

§

impl Unpin for BigInt

§

impl UnwindSafe for BigInt

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.