Skip to main content

BigIntModularNumeric

Struct BigIntModularNumeric 

Source
pub struct BigIntModularNumeric<const BYTES: usize>;
Expand description

Parametric N-byte modular-arithmetic impl of BigIntAxis.

BYTES is the operand width in bytes (8 * BYTES bits). Arithmetic is mod 2^(8 * BYTES) (wrapping). The supported range is [1, MAX_BIG_INT_BYTES] (512 bits at the upper bound).

Trait Implementations§

Source§

impl<const BYTES: usize> AxisExtension for BigIntModularNumeric<BYTES>

Source§

const AXIS_ADDRESS: &'static str = <BigIntModularNumeric<BYTES> as BigIntAxis>::AXIS_ADDRESS

ADR-017 content address of this axis trait. The SDK macro derives this from the trait name and method signatures.
Source§

const MAX_OUTPUT_BYTES: usize = <BigIntModularNumeric<BYTES> as BigIntAxis>::MAX_OUTPUT_BYTES

Maximum bytes any kernel of this axis returns.
Source§

fn dispatch_kernel( kernel_id: u32, input: &[u8], out: &mut [u8], ) -> Result<usize, ShapeViolation>

Dispatch the kernel identified by kernel_id against the evaluated input bytes. The implementation copies the kernel’s output into out and returns the written length. Read more
Source§

impl<const BYTES: usize> BigIntAxis for BigIntModularNumeric<BYTES>

Source§

const AXIS_ADDRESS: &'static str = "https://uor.foundation/axis/BigIntAxis/Modular"

ADR-017 content address.
Source§

const MAX_OUTPUT_BYTES: usize = BYTES

Operand byte-width (overridden per impl).
Source§

fn add(input: &[u8], out: &mut [u8]) -> Result<usize, ShapeViolation>

(a + b) mod 2^(8*N) — input is a || b (2N bytes). Read more
Source§

fn sub(input: &[u8], out: &mut [u8]) -> Result<usize, ShapeViolation>

(a - b) mod 2^(8*N) — input is a || b (2N bytes). Read more
Source§

fn mul(input: &[u8], out: &mut [u8]) -> Result<usize, ShapeViolation>

(a * b) mod 2^(8*N) — input is a || b (2N bytes). Read more
Source§

impl<const BYTES: usize> Clone for BigIntModularNumeric<BYTES>

Source§

fn clone(&self) -> BigIntModularNumeric<BYTES>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<const BYTES: usize> Debug for BigIntModularNumeric<BYTES>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<const BYTES: usize> Default for BigIntModularNumeric<BYTES>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<const BYTES: usize> SubstrateTermBody for BigIntModularNumeric<BYTES>

Source§

fn body_arena() -> &'static [Term]

The Term arena the kernel decomposes to. Empty slice signals a primitive-fast-path axis whose body the implementation may evaluate through dispatch_kernel directly per ADR-055’s optional fast-path.
Source§

impl<const BYTES: usize> Copy for BigIntModularNumeric<BYTES>

Source§

impl<const BYTES: usize> Sealed for BigIntModularNumeric<BYTES>

Auto Trait Implementations§

§

impl<const BYTES: usize> Freeze for BigIntModularNumeric<BYTES>

§

impl<const BYTES: usize> RefUnwindSafe for BigIntModularNumeric<BYTES>

§

impl<const BYTES: usize> Send for BigIntModularNumeric<BYTES>

§

impl<const BYTES: usize> Sync for BigIntModularNumeric<BYTES>

§

impl<const BYTES: usize> Unpin for BigIntModularNumeric<BYTES>

§

impl<const BYTES: usize> UnsafeUnpin for BigIntModularNumeric<BYTES>

§

impl<const BYTES: usize> UnwindSafe for BigIntModularNumeric<BYTES>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.