Struct SecurityContext

Source
pub struct SecurityContext<AEADBLKCIPH, KEYDESCLO>
where AEADBLKCIPH: NewBlockCipher + BlockCipher<BlockSize = U16>, KEYDESCLO: KeyDescriptorLookup<AEADBLKCIPH::KeySize>,
{ pub euid: u64, pub frame_counter: u32, pub key_provider: KEYDESCLO, /* private fields */ }
Expand description

A context that used to keep track of cryptographic properties that are necessary for securing/unsecuring frames

AEAD is the type that will provide an AEAD instance to be used for the encryption/decryption process

NONCEGEN is the type that will convert the nonce created using the 802.15.4 standard into a nonce of the size that can be accepted by the provided AEAD algorithm

Fields§

§euid: u64

The EUID used for calculating the nonce of outgoing frames

§frame_counter: u32

The current frame counter

§key_provider: KEYDESCLO

The key descriptor lookup to use to look up keys

Implementations§

Source§

impl<AEADBLKCIPH, KEYDESCLO> SecurityContext<AEADBLKCIPH, KEYDESCLO>
where AEADBLKCIPH: NewBlockCipher + BlockCipher<BlockSize = U16>, KEYDESCLO: KeyDescriptorLookup<AEADBLKCIPH::KeySize>,

Source

pub fn new(euid: u64, frame_counter: u32, key_provider: KEYDESCLO) -> Self

Create a new security context using the provided key provider and frame counter

Source§

impl SecurityContext<Unimplemented, Unimplemented>

Source

pub fn no_security() -> Self

A security context that is not actually capable of providing any security

Trait Implementations§

Source§

impl<AEADBLKCIPH, KEYDESCLO> Clone for SecurityContext<AEADBLKCIPH, KEYDESCLO>
where AEADBLKCIPH: NewBlockCipher + BlockCipher<BlockSize = U16> + Clone, KEYDESCLO: KeyDescriptorLookup<AEADBLKCIPH::KeySize> + Clone,

Source§

fn clone(&self) -> SecurityContext<AEADBLKCIPH, KEYDESCLO>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<AEADBLKCIPH, KEYDESCLO> TryWrite<&SecurityContext<AEADBLKCIPH, KEYDESCLO>> for AuxiliarySecurityHeader
where AEADBLKCIPH: NewBlockCipher + BlockCipher<BlockSize = U16>, KEYDESCLO: KeyDescriptorLookup<AEADBLKCIPH::KeySize>,

Source§

fn try_write( self, bytes: &mut [u8], sec_ctx: &SecurityContext<AEADBLKCIPH, KEYDESCLO>, ) -> Result<usize>

Try to write to a byte slice using a specific context. Read more
Source§

impl<AEADBLKCIPH, KEYDESCLO> Copy for SecurityContext<AEADBLKCIPH, KEYDESCLO>
where AEADBLKCIPH: NewBlockCipher + BlockCipher<BlockSize = U16> + Copy, KEYDESCLO: KeyDescriptorLookup<AEADBLKCIPH::KeySize> + Copy,

Auto Trait Implementations§

§

impl<AEADBLKCIPH, KEYDESCLO> Freeze for SecurityContext<AEADBLKCIPH, KEYDESCLO>
where KEYDESCLO: Freeze,

§

impl<AEADBLKCIPH, KEYDESCLO> RefUnwindSafe for SecurityContext<AEADBLKCIPH, KEYDESCLO>
where KEYDESCLO: RefUnwindSafe, AEADBLKCIPH: RefUnwindSafe,

§

impl<AEADBLKCIPH, KEYDESCLO> Send for SecurityContext<AEADBLKCIPH, KEYDESCLO>
where KEYDESCLO: Send, AEADBLKCIPH: Send,

§

impl<AEADBLKCIPH, KEYDESCLO> Sync for SecurityContext<AEADBLKCIPH, KEYDESCLO>
where KEYDESCLO: Sync, AEADBLKCIPH: Sync,

§

impl<AEADBLKCIPH, KEYDESCLO> Unpin for SecurityContext<AEADBLKCIPH, KEYDESCLO>
where KEYDESCLO: Unpin, AEADBLKCIPH: Unpin,

§

impl<AEADBLKCIPH, KEYDESCLO> UnwindSafe for SecurityContext<AEADBLKCIPH, KEYDESCLO>
where KEYDESCLO: UnwindSafe, AEADBLKCIPH: UnwindSafe,

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> Same for T

Source§

type Output = T

Should always be Self
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.