Skip to main content

Hashcrypt

Struct Hashcrypt 

Source
pub struct Hashcrypt<State = Unknown> {
    pub _state: State,
    /* private fields */
}

Fields§

§_state: State

Implementations§

Source§

impl Hashcrypt

Source

pub unsafe fn steal() -> Self

§Safety

Must only be called once for the entire duration of the program

Source§

impl<State> Hashcrypt<State>

Source

pub fn release(self) -> HASHCRYPT

Source§

impl<State> Hashcrypt<State>

Source

pub fn enabled(self, syscon: &mut Syscon) -> Hashcrypt<Enabled>

Source

pub fn disabled(self, syscon: &mut Syscon) -> Hashcrypt<Disabled>

Source§

impl Hashcrypt<Enabled>

Source

pub fn sha1(&mut self) -> Sha1<'_>

SHA-1, as in RustCrypto digest trait

Source

pub fn sha256(&mut self) -> Sha256<'_>

SHA-256, as in RustCrypto digest trait

Source

pub fn aes128<'a>(&'a mut self, key: &[u8; 16]) -> Aes128<'a>

AES-128 “ECB”, as in RustCrypto block-cipher trait

Source

pub fn aes192<'a>(&'a mut self, key: &[u8; 24]) -> Aes192<'a>

AES-192 “ECB”, as in RustCrypto block-cipher trait

Source

pub fn aes256<'a>(&'a mut self, key: &[u8; 32]) -> Aes256<'a>

AES-256 “ECB”, as in RustCrypto block-cipher trait

Source

pub fn puf_aes(&mut self) -> Aes256<'_>

AES “ECB” with PUF key, for use as in RustCrypto block-cipher trait

DOES NOT PROPERLY CHECK IF PUF AES KEY IS SETUP YET! TODO: have user pass in some token signaling PUF AES key is setup

Trait Implementations§

Source§

impl<State> Deref for Hashcrypt<State>

Source§

type Target = RegisterBlock

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<'a, Size: OutputSize> From<&'a mut Hashcrypt<Enabled>> for Sha<'a, Size>

Source§

fn from(hashcrypt: &'a mut Hashcrypt<Enabled>) -> Self

Converts to this type from the input type.
Source§

impl From<HASHCRYPT> for Hashcrypt

Source§

fn from(raw: HASHCRYPT) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<State = Unknown> !Sync for Hashcrypt<State>

§

impl<State> Freeze for Hashcrypt<State>
where State: Freeze,

§

impl<State> RefUnwindSafe for Hashcrypt<State>
where State: RefUnwindSafe,

§

impl<State> Send for Hashcrypt<State>
where State: Send,

§

impl<State> Unpin for Hashcrypt<State>
where State: Unpin,

§

impl<State> UnsafeUnpin for Hashcrypt<State>
where State: UnsafeUnpin,

§

impl<State> UnwindSafe for Hashcrypt<State>
where State: 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> 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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.