tss_esapi/attributes/
algorithm.rs1use crate::tss2_esys::TPMA_ALGORITHM;
5use bitfield::bitfield;
6
7bitfield! {
8 #[derive(Copy, Clone, Eq, PartialEq)]
10 pub struct AlgorithmAttributes(TPMA_ALGORITHM);
11 impl Debug;
12
13 pub asymmetric, _: 0;
14 pub symmetric, _: 1;
15 pub hash, _: 2;
16 pub object, _: 3;
17 pub signing, _: 8;
19 pub encrypting, _: 9;
20 pub method, _: 10;
21 }
23
24impl From<TPMA_ALGORITHM> for AlgorithmAttributes {
25 fn from(tpma_algorithm: TPMA_ALGORITHM) -> Self {
26 AlgorithmAttributes(tpma_algorithm)
27 }
28}
29
30impl From<AlgorithmAttributes> for TPMA_ALGORITHM {
31 fn from(algorithm_attributes: AlgorithmAttributes) -> Self {
32 algorithm_attributes.0
33 }
34}