opentitanlib/ownership/
mod.rs1use std::sync::atomic::{AtomicBool, Ordering};
6
7mod application_key;
8mod flash;
9mod flash_info;
10mod isfb;
11mod misc;
12pub mod owner;
13mod rescue;
14mod signature;
15
16pub use application_key::{ApplicationKeyDomain, OwnerApplicationKey};
17pub use flash::{FlashFlags, OwnerFlashConfig, OwnerFlashRegion};
18pub use flash_info::{OwnerFlashInfoConfig, OwnerInfoPage};
19pub use isfb::OwnerIsfbConfig;
20pub use misc::{
21 DetachedSignatureCommand, HybridRawPublicKey, KeyMaterial, OwnershipKeyAlg, TlvHeader, TlvTag,
22};
23pub use owner::{
24 MinSecurityVersion, OwnerBlock, OwnerConfigItem, OwnershipUpdateMode, SramExecMode,
25};
26pub use rescue::{CommandTag, OwnerRescueConfig, RescueProtocol};
27pub use signature::DetachedSignature;
28
29pub struct GlobalFlags;
30
31static DEBUG: AtomicBool = AtomicBool::new(false);
32
33impl GlobalFlags {
34 pub fn set_debug(v: bool) {
37 DEBUG.store(v, Ordering::Relaxed);
38 }
39
40 pub fn not_debug<T>(_: &T) -> bool {
42 !DEBUG.load(Ordering::Relaxed)
43 }
44}