Skip to main content

Alg

Struct Alg 

Source
#[repr(transparent)]
pub struct Alg(pub u16);
Expand description

Algorithms defined by either the TPM_ALG_ID listing in Part 2 of the [TPM2 Specification] or the TCG_ALG_ID list in the TCG Algorithm Registry.

Tuple Fields§

§0: u16

Implementations§

Source§

impl Alg

Source

pub const Rsa: Self

Source

pub const Tdes: Self

Source

pub const Sha1: Self

Source

pub const Hmac: Self

Source

pub const Aes: Self

Source

pub const Mgf1: Self

Source

pub const KeyedHash: Self

Source

pub const Null: Self

Source

pub const Xor: Self

Source

pub const Sha256: Self

Source

pub const Sha384: Self

Source

pub const Sha512: Self

Source

pub const Sm3_256: Self

Source

pub const Sm4: Self

Source

pub const RsaSsa: Self

Source

pub const RsaEs: Self

Source

pub const RsaPss: Self

Source

pub const Oaep: Self

Source

pub const Ecdsa: Self

Source

pub const Ecdh: Self

Source

pub const Ecdaa: Self

Source

pub const Sm2: Self

Source

pub const EcSchnorr: Self

Source

pub const Ecmqv: Self

Source

pub const Kdf1Sp800_56A: Self

Source

pub const Kdf2: Self

Source

pub const Kdf1Sp800_108: Self

Source

pub const Ecc: Self

Source

pub const SymCipher: Self

Source

pub const Camellia: Self

Source

pub const Sha3_256: Self

Source

pub const Sha3_384: Self

Source

pub const Sha3_512: Self

Source

pub const Ctr: Self

Source

pub const Ofb: Self

Source

pub const Cbc: Self

Source

pub const Cfb: Self

Source

pub const Ecb: Self

Trait Implementations§

Source§

impl Clone for Alg

Source§

fn clone(&self) -> Alg

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 From<TpmiAlgHash> for Alg

Source§

fn from(h: TpmiAlgHash) -> Alg

Converts to this type from the input type.
Source§

impl MarshalArray for Alg

Source§

const SIZE: usize = 2

Source§

type Array = [u8; 2]

This type will always be [u8; Self::SIZE]. However, until the min_generic_const_args feature is stabilized, we need this type to write the signature of marshal_array.
Source§

fn marshal_array(&self, arr: &mut [u8; 2])

Infallible as we statically know the buffer is long enough
Source§

impl PartialEq for Alg

Source§

fn eq(&self, other: &Alg) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TryFrom<Alg> for TpmiAlgHash

Source§

type Error = HashError

The type returned in the event of a conversion error.
Source§

fn try_from(a: Alg) -> Result<TpmiAlgHash, Self::Error>

Performs the conversion.
Source§

impl UnmarshalArray for Alg

Source§

type Error = Infallible

Source§

fn unmarshal_array(arr: &[u8; 2]) -> Result<Self, Infallible>

This can still fail if the source buffer has a bad value, but we know we have a buffer of the correct length.
Source§

impl Copy for Alg

Source§

impl Eq for Alg

Source§

impl StructuralPartialEq for Alg

Auto Trait Implementations§

§

impl Freeze for Alg

§

impl RefUnwindSafe for Alg

§

impl Send for Alg

§

impl Sync for Alg

§

impl Unpin for Alg

§

impl UnsafeUnpin for Alg

§

impl UnwindSafe for Alg

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, const N: usize> Marshal for T
where T: MarshalArray<Array = [u8; N]>,

Source§

fn marshal<'dst>( &self, _: impl Limits, buf: &'dst mut [u8], ) -> Result<&'dst mut [u8], MarshalError>

Source§

fn marshaled_size(&self) -> usize

Source§

fn marshaled_size_max(_: impl Limits) -> usize

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.
Source§

impl<'src, T, const N: usize> Unmarshal<'src> for T
where T: UnmarshalArray<Array = [u8; N]>, UnmarshalError: From<<T as UnmarshalArray>::Error>,

Source§

fn unmarshal( &mut self, _: impl Limits, buf: &'src [u8], ) -> Result<&'src [u8], UnmarshalError>