use crate::tss2_esys::TPMA_ALGORITHM;
use bitfield::bitfield;
bitfield! {
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct AlgorithmAttributes(TPMA_ALGORITHM);
impl Debug;
pub asymmetric, _: 0;
pub symmetric, _: 1;
pub hash, _: 2;
pub object, _: 3;
pub signing, _: 8;
pub encrypting, _: 9;
pub method, _: 10;
}
impl From<TPMA_ALGORITHM> for AlgorithmAttributes {
fn from(tpma_algorithm: TPMA_ALGORITHM) -> Self {
AlgorithmAttributes(tpma_algorithm)
}
}
impl From<AlgorithmAttributes> for TPMA_ALGORITHM {
fn from(algorithm_attributes: AlgorithmAttributes) -> Self {
algorithm_attributes.0
}
}