Skip to main content

qualia_core_db/net/qdnf/biometrics/
mod.rs

1//! QDNF E15 biometric protection and privacy-preserving verification.
2//!
3//! Capture, templates, match results and identity assertions are distinct
4//! objects. A biometric match never grants network authority. Remote matching
5//! stays unselectable until independent qualification criteria exist and pass;
6//! synthetic fixtures do not establish operational accuracy. The existing
7//! linear-algebra privacy engine is not a qualified biometric matcher.
8//!
9//! Honest non-claims: this library does not implement operational FAR/FRR,
10//! liveness, unlinkability proofs, or SMPC biometric recognition.
11
12pub mod capture;
13pub mod match_local;
14pub mod policy;
15pub mod remote;
16pub mod template;
17
18pub use capture::{retain_raw_as_network_id, Modality, RawCapture};
19pub use match_local::{
20    execution_permit_from_match, match_grants_network_authority, match_local, MatchDecision,
21    MatchResult,
22};
23pub use policy::{
24    assert_identity_from_match, cross_purpose_link, publish_template, recover_with_key_ref,
25    recover_with_pin, recovery_without_biometric, reuse_template, silent_identify,
26    unsalted_reusable_hash, unsalted_reusable_hash_allowed, IdentityAssertion, ReuseIntent,
27};
28pub use remote::{
29    admit_remote_processing, qualify_remote, remote_matching_selectable, smpc_matching_qualified,
30    synthetic_accuracy_is_operational, EncryptedRemoteObject, QualificationCriteria,
31    RemoteBoundFields,
32};
33pub use template::{
34    derive_template, revoke_template, CancellableId, DerivedTemplate, MAX_TEMPLATE_SLOTS,
35};
36
37/// Discriminator for the four E15.1 object kinds. Not a wire opcode.
38#[repr(u8)]
39#[derive(Clone, Copy, Debug, PartialEq, Eq)]
40pub enum BiometricObjectKind {
41    RawCapture = 1,
42    DerivedTemplate = 2,
43    MatchResult = 3,
44    IdentityAssertion = 4,
45}
46
47#[cfg(test)]
48mod tests {
49    use super::*;
50
51    #[test]
52    fn four_object_kinds_are_distinct() {
53        let kinds = [
54            BiometricObjectKind::RawCapture,
55            BiometricObjectKind::DerivedTemplate,
56            BiometricObjectKind::MatchResult,
57            BiometricObjectKind::IdentityAssertion,
58        ];
59        let mut i = 0usize;
60        while i < kinds.len() {
61            let mut j = i + 1;
62            while j < kinds.len() {
63                assert_ne!(kinds[i], kinds[j]);
64                j += 1;
65            }
66            i += 1;
67        }
68    }
69
70    #[test]
71    fn reexported_honest_gates() {
72        assert!(!match_grants_network_authority());
73        assert!(!remote_matching_selectable());
74        assert!(recovery_without_biometric());
75        assert!(!unsalted_reusable_hash_allowed());
76        assert!(!smpc_matching_qualified());
77        assert!(!synthetic_accuracy_is_operational());
78    }
79}