Trait crypto_bigint::Encoding

source ·
pub trait Encoding: Sized {
    type Repr: AsRef<[u8]> + AsMut<[u8]> + Copy + Clone + Sized;

    // Required methods
    fn from_be_bytes(bytes: Self::Repr) -> Self;
    fn from_le_bytes(bytes: Self::Repr) -> Self;
    fn to_be_bytes(&self) -> Self::Repr;
    fn to_le_bytes(&self) -> Self::Repr;
}
Expand description

Encoding support.

Required Associated Types§

source

type Repr: AsRef<[u8]> + AsMut<[u8]> + Copy + Clone + Sized

Byte array representation.

Required Methods§

source

fn from_be_bytes(bytes: Self::Repr) -> Self

Decode from big endian bytes.

source

fn from_le_bytes(bytes: Self::Repr) -> Self

Decode from little endian bytes.

source

fn to_be_bytes(&self) -> Self::Repr

Encode to big endian bytes.

source

fn to_le_bytes(&self) -> Self::Repr

Encode to little endian bytes.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Encoding for Limb

source§

type Repr = [u8; 8]

source§

impl Encoding for U64

source§

type Repr = [u8; 8]

source§

impl Encoding for U128

source§

type Repr = [u8; 16]

source§

impl Encoding for U192

source§

type Repr = [u8; 24]

source§

impl Encoding for U256

source§

type Repr = [u8; 32]

source§

impl Encoding for U320

source§

type Repr = [u8; 40]

source§

impl Encoding for U384

source§

type Repr = [u8; 48]

source§

impl Encoding for U448

source§

type Repr = [u8; 56]

source§

impl Encoding for U512

source§

type Repr = [u8; 64]

source§

impl Encoding for U576

source§

type Repr = [u8; 72]

source§

impl Encoding for U640

source§

type Repr = [u8; 80]

source§

impl Encoding for U704

source§

type Repr = [u8; 88]

source§

impl Encoding for U768

source§

type Repr = [u8; 96]

source§

impl Encoding for U832

source§

type Repr = [u8; 104]

source§

impl Encoding for U896

source§

type Repr = [u8; 112]

source§

impl Encoding for U960

source§

type Repr = [u8; 120]

source§

impl Encoding for U1024

source§

type Repr = [u8; 128]

source§

impl Encoding for U1280

source§

type Repr = [u8; 160]

source§

impl Encoding for U1536

source§

type Repr = [u8; 192]

source§

impl Encoding for U1792

source§

type Repr = [u8; 224]

source§

impl Encoding for U2048

source§

type Repr = [u8; 256]

source§

impl Encoding for U3072

source§

type Repr = [u8; 384]

source§

impl Encoding for U3584

source§

type Repr = [u8; 448]

source§

impl Encoding for U4096

source§

type Repr = [u8; 512]

source§

impl Encoding for U4224

source§

type Repr = [u8; 528]

source§

impl Encoding for U4352

source§

type Repr = [u8; 544]

source§

impl Encoding for U6144

source§

type Repr = [u8; 768]

source§

impl Encoding for U8192

source§

type Repr = [u8; 1024]

source§

impl Encoding for U16384

source§

type Repr = [u8; 2048]

source§

impl Encoding for U32768

source§

type Repr = [u8; 4096]