Struct scuttlebutt::Block
source · #[repr(transparent)]pub struct Block(pub U8x16);
Expand description
A 128-bit chunk.
Tuple Fields§
§0: U8x16
Implementations§
source§impl Block
impl Block
sourcepub fn clmul(self, rhs: Self) -> (Self, Self)
pub fn clmul(self, rhs: Self) -> (Self, Self)
Carryless multiplication.
This code is adapted from the EMP toolkit’s implementation.
sourcepub fn hash_pt(tweak: u128, pt: &RistrettoPoint) -> Self
pub fn hash_pt(tweak: u128, pt: &RistrettoPoint) -> Self
Hash an elliptic curve point pt
and tweak tweak
.
Computes the hash by computing E_{pt}(tweak)
, where E
is AES-256.
sourcepub fn try_from_slice(bytes_slice: &[u8]) -> Option<Self>
pub fn try_from_slice(bytes_slice: &[u8]) -> Option<Self>
Try to create a Block
from a slice of bytes. The slice must have exactly 16 bytes.
Trait Implementations§
source§impl BitAndAssign for Block
impl BitAndAssign for Block
source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
Performs the
&=
operation. Read moresource§impl BitXorAssign for Block
impl BitXorAssign for Block
source§fn bitxor_assign(&mut self, rhs: Self)
fn bitxor_assign(&mut self, rhs: Self)
Performs the
^=
operation. Read moresource§impl ConditionallySelectable for Block
impl ConditionallySelectable for Block
source§impl Distribution<Block> for Standard
impl Distribution<Block> for Standard
source§impl Ord for Block
impl Ord for Block
source§impl PartialEq for Block
impl PartialEq for Block
source§impl PartialOrd for Block
impl PartialOrd for Block
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl TransparentWrapper<U8x16> for Block
impl TransparentWrapper<U8x16> for Block
§fn wrap_ref(s: &Inner) -> &Self
fn wrap_ref(s: &Inner) -> &Self
Convert a reference to the inner type into a reference to the wrapper
type.
§fn wrap_mut(s: &mut Inner) -> &mut Self
fn wrap_mut(s: &mut Inner) -> &mut Self
Convert a mutable reference to the inner type into a mutable reference to
the wrapper type.
§fn wrap_slice(s: &[Inner]) -> &[Self]where
Self: Sized,
fn wrap_slice(s: &[Inner]) -> &[Self]where
Self: Sized,
Convert a slice to the inner type into a slice to the wrapper type.
§fn wrap_slice_mut(s: &mut [Inner]) -> &mut [Self]where
Self: Sized,
fn wrap_slice_mut(s: &mut [Inner]) -> &mut [Self]where
Self: Sized,
Convert a mutable slice to the inner type into a mutable slice to the
wrapper type.
§fn peel_ref(s: &Self) -> &Inner
fn peel_ref(s: &Self) -> &Inner
Convert a reference to the wrapper type into a reference to the inner
type.
§fn peel_mut(s: &mut Self) -> &mut Inner
fn peel_mut(s: &mut Self) -> &mut Inner
Convert a mutable reference to the wrapper type into a mutable reference
to the inner type.
§fn peel_slice(s: &[Self]) -> &[Inner]where
Self: Sized,
fn peel_slice(s: &[Self]) -> &[Inner]where
Self: Sized,
Convert a slice to the wrapped type into a slice to the inner type.
§fn peel_slice_mut(s: &mut [Self]) -> &mut [Inner]where
Self: Sized,
fn peel_slice_mut(s: &mut [Self]) -> &mut [Inner]where
Self: Sized,
Convert a mutable slice to the wrapped type into a mutable slice to the
inner type.
impl Copy for Block
impl Eq for Block
impl Pod for Block
impl StructuralPartialEq for Block
Auto Trait Implementations§
impl Freeze for Block
impl RefUnwindSafe for Block
impl Send for Block
impl Sync for Block
impl Unpin for Block
impl UnwindSafe for Block
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.