pub fn convert_key_usage(operation: &psa_key_attributes::UsageFlags) -> psa_key_usage_t {
    let mut usage: psa_key_usage_t = 0;

    // Build up the individual usage flags in the OpKeyCreateBase, and use them to bitwise-combine the equivalent flags
    // in the PSA definition.

    if operation.decrypt {
        usage |= PSA_KEY_USAGE_DECRYPT;
    }

    if operation.encrypt {
        usage |= PSA_KEY_USAGE_ENCRYPT;
    }

    if operation.export {
        usage |= PSA_KEY_USAGE_EXPORT;
    }

    if operation.sign_message || operation.sign_hash {
        usage |= PSA_KEY_USAGE_SIGN;
    }

    if operation.verify_message || operation.verify_hash {
        usage |= PSA_KEY_USAGE_VERIFY;
    }

    if operation.derive {
        usage |= PSA_KEY_USAGE_DERIVE;
    }

    usage
}
/// Converts between native and Mbed Crypto key usage values.
Converts between native and Mbed Crypto key usage values.
Converts between native and Mbed Crypto key usage values .
pub fn convert_key_usage(operation: &psa_key_attributes::UsageFlags) -> psa_key_usage_t {
    let mut usage: psa_key_usage_t = 0;
    // Build up the individual usage flags in the OpKeyCreateBase, and use them to bitwise-combine the equivalent flags
    // in the PSA definition.
    if operation.decrypt {
        usage |= PSA_KEY_USAGE_DECRYPT;
    }
    if operation.encrypt {
        usage |= PSA_KEY_USAGE_ENCRYPT;
    }
    if operation.export {
        usage |= PSA_KEY_USAGE_EXPORT;
    }
    if operation.sign_message || operation.sign_hash {
        usage |= PSA_KEY_USAGE_SIGN;
    }
    if operation.verify_message || operation.verify_hash {
        usage |= PSA_KEY_USAGE_VERIFY;
    }
    if operation.derive {
        usage |= PSA_KEY_USAGE_DERIVE;
    }
    usage
}
pub fn convert_key_usage ( operation : & psa_key_attributes :: UsageFlags ) -> psa_key_usage_t { let mut usage : psa_key_usage_t = 0 ; // Build up the individual usage flags in the OpKeyCreateBase, and use them to bitwise-combine the equivalent flags // in the PSA definition. if operation . decrypt { usage |= PSA_KEY_USAGE_DECRYPT ; } if operation . encrypt { usage |= PSA_KEY_USAGE_ENCRYPT ; } if operation . export { usage |= PSA_KEY_USAGE_EXPORT ; } if operation . sign_message || operation . sign_hash { usage |= PSA_KEY_USAGE_SIGN ; } if operation . verify_message || operation . verify_hash { usage |= PSA_KEY_USAGE_VERIFY ; } if operation . derive { usage |= PSA_KEY_USAGE_DERIVE ; } usage }
Converts between native and Mbed Crypto key usage values.
Converts between native and Mbed Crypto key usage values .
operation
&psa_key_attributes::UsageFlags
operation
&psa_key_attributes::UsageFlags