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::{OwnerBlock, OwnerConfigItem, SramExecMode};
24pub use rescue::{CommandTag, OwnerRescueConfig, RescueProtocol};
25pub use signature::DetachedSignature;
26
27pub struct GlobalFlags;
28
29static DEBUG: AtomicBool = AtomicBool::new(false);
30
31impl GlobalFlags {
32 pub fn set_debug(v: bool) {
35 DEBUG.store(v, Ordering::Relaxed);
36 }
37
38 pub fn not_debug<T>(_: &T) -> bool {
40 !DEBUG.load(Ordering::Relaxed)
41 }
42}