human_key 0.1.0-alpha.1

Pure Rust implementation of human-derived attribute fingerprinting for cryptographic key derivation.
Documentation
use std::fmt::Debug;

/// Marker trait for attribute kind labels.
/// Blanket-implemented for any `Ord + Copy` type.
pub trait AttributeKind: Ord + Copy + Debug {}

impl<T: Ord + Copy + Debug> AttributeKind for T {}

/// Default set of human-derived attributes usable as key derivation input.
#[non_exhaustive]
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub enum Attribute {
    /// **Name** - Surname, last name, or family name.
    /// - Category: Name
    Name,

    /// **Birth Name** - Surname at birth (maiden name or birth family name).
    /// - Category: Name
    BirthName,

    /// **Given Name** - First name or forename.
    /// - Category: Name
    GivenName,

    /// **Additional Given Names** - Middle names or secondary given names.
    /// - Category: Name
    AdditionalGivenNames,

    /// **Date of Birth** - Full date of birth.
    /// - Category: Birth
    DateOfBirth,

    /// **Mother's Name** - Mother's surname, last name, or family name.
    /// - Category: Parentage
    MotherName,

    /// **Mother's Birth Name** - Mother's surname at birth.
    /// - Category: Parentage
    MotherBirthName,

    /// **Mother's Given Name** - Mother's first name or forename.
    /// - Category: Parentage
    MotherGivenName,

    /// **Mother's Additional Given Names** - Mother's middle names or
    /// secondary given names.
    /// - Category: Parentage
    MotherAdditionalGivenNames,

    /// **Father's Name** - Father's surname, last name, or family name.
    /// - Category: Parentage
    FatherName,

    /// **Father's Birth Name** - Father's surname at birth.
    /// - Category: Parentage
    FatherBirthName,

    /// **Father's Given Name** - Father's first name or forename.
    /// - Category: Parentage
    FatherGivenName,

    /// **Father's Additional Given Names** - Father's middle names or
    /// secondary given names.
    /// - Category: Parentage
    FatherAdditionalGivenNames,

    /// **Marital Status** - Current legal marital status (e.g. single,
    /// married, divorced, widowed).
    /// - Category: Civil Status
    MaritalStatus,

    /// **Spouse's Name** - Spouse's surname, last name, or family name.
    /// - Category: Civil Status
    SpouseName,

    /// **Spouse's Birth Name** - Spouse's surname at birth (maiden name or
    /// birth family name).
    /// - Category: Civil Status
    SpouseBirthName,

    /// **Spouse's Given Name** - Spouse's first name or forename.
    /// - Category: Civil Status
    SpouseGivenName,

    /// **Spouse's Additional Given Names** - Spouse's middle names or
    /// secondary given names.
    /// - Category: Civil Status
    SpouseAdditionalGivenNames,

    /// **Date of Marriage** - Full date of marriage.
    /// - Category: Civil Status
    DateOfMarriage,

    /// **Native Language** - First language or mother tongue.
    /// - Category: Language
    NativeLanguage,

    /// **Race** - Self-identified racial categorisation.
    /// - Category: Ethnicity
    Race,

    /// **Ethnicity** - Self-identified ethnic or ancestral group.
    /// - Category: Ethnicity
    Ethnicity,

    /// **Religious Affiliation** - Religious identity or practice.
    /// - Category: Cultural
    Religion,

    /// **Cultural Identity** - Cultural group identification beyond ethnicity
    /// or nationality.
    /// - Category: Cultural
    CulturalIdentity,

    /// **Tribe** - Tribal affiliation.
    /// - Category: Cultural
    Tribe,

    /// **Gender** - Gender identity, which may differ from biological sex.
    /// - Category: Social
    Gender,

    /// **Sex** - Biological sex (e.g. male, female, intersex).
    /// - Category: Biological
    Sex,

    /// **Blood Group** - ABO blood group classification (A, B, AB, or O).
    /// - Category: Biological
    BloodGroup,

    /// **Rhesus Factor** - Rh blood type antigen factor.
    /// - Category: Biological
    RhesusFactor,

    /// **Y-DNA Haplogroup** - Paternal lineage haplogroup derived from
    /// Y-chromosome DNA.
    /// - Category: Genetic
    YDnaHaplogroup,

    /// **Mt-DNA Haplogroup** - Maternal lineage haplogroup derived from
    /// mitochondrial DNA.
    /// - Category: Genetic
    MtDnaHaplogroup,

    /// **Eye Color** - Pigmentation color of the iris.
    /// - Category: Physical
    EyeColor,

    /// **Hair Color** - Natural hair pigmentation color.
    /// - Category: Physical
    HairColor,

    /// **Height** - Standing height.
    /// - Category: Physical
    Height,

    /// **Weight** - Body weight.
    /// - Category: Physical
    Weight,

    /// **Fingerprint Right Index** - Right index finger minutiae and image
    /// data (ISO/IEC 19794-2, 19794-4). Finger position encoded numerically;
    /// right index = position 2.
    /// - Category: Friction Ridge
    FingerprintRightIndex,

    /// **Fingerprint Left Index** - Left index finger minutiae and image data
    /// (ISO/IEC 19794-2, 19794-4). Finger position encoded numerically; left
    /// index = position 7.
    /// - Category: Friction Ridge
    FingerprintLeftIndex,

    /// **Palm Print Right** - Right palm image data, covered by ISO/IEC
    /// 19794-4 (palm image areas) and ISO/IEC 19794-15 (palm crease image
    /// data).
    /// - Category: Friction Ridge
    PalmPrintRight,

    /// **Palm Print Left** - Left palm image data, covered by ISO/IEC
    /// 19794-4 (palm image areas) and ISO/IEC 19794-15 (palm crease image
    /// data).
    /// - Category: Friction Ridge
    PalmPrintLeft,

    /// **Iris Right** - Right iris image data as defined by ISO/IEC 19794-6.
    /// - Category: Ocular
    IrisRight,

    /// **Iris Left** - Left iris image data as defined by ISO/IEC 19794-6.
    /// - Category: Ocular
    IrisLeft,

    /// **Facial Geometry** - Processed geometric facial template. The
    /// underlying face image modality is defined in ISO/IEC 19794-5; the
    /// geometric template representation is not defined by that standard.
    /// - Category: Facial
    FacialGeometry,

    /// **Voice Print** - Voice biometric data as specified by ISO/IEC
    /// 19794-13.
    /// - Category: Voice
    VoicePrint,

    /// **Occupation** - Current job title or profession.
    /// - Category: Occupation
    Occupation,

    /// **Employer** - Current or most notable employer or organization.
    /// - Category: Occupation
    Employer,

    /// **Industry** - Sector or field of work.
    /// - Category: Occupation
    Industry,

    /// *Educational Institution* - Name of the university, college, or school
    /// attended.
    /// - Category: Education
    EduInstitution,

    /// **Field of Study** - Degree major or field of study.
    /// - Category: Education
    FieldOfStudy,

    /// **Education Level** - Highest level of education attained.
    /// - Category: Education
    EducationLevel,

    /// **City of Birth** - City or municipality of birth.
    /// - Category: Birth Location
    CityOfBirth,

    /// **Region of Birth** - Region, state, or province of birth.
    /// - Category: Birth Location
    RegionOfBirth,

    /// **Country of Birth** - Country of birth.
    /// - Category: Birth Location
    CountryOfBirth,

    /// **City of Residence** - City or municipality of current residence.
    /// - Category: Residence
    CityOfResidence,

    /// **Region of Residence** - Region, state, or province of current
    /// residence.
    /// - Category: Residence
    RegionOfResidence,

    /// **Country of Residence** - Country of current residence.
    /// - Category: Residence
    CountryOfResidence,

    /// **Address** - Full street address of current residence.
    /// - Category: Residence
    Address,

    /// **Nationality** - Nationality or citizenship.
    /// - Category: Nationality
    Nationality,

    /// **Secondary Nationality** - Second nationality or citizenship.
    /// - Category: Nationality
    SecondaryNationality,

    /// **Tertiary Nationality** - Third nationality or citizenship.
    /// - Category: Nationality
    TertiaryNationality,

    /// **Passport Number** - Passport document number.
    /// - Category: Identity Document
    PassportNumber,

    /// **Identity Number** - National identity or citizen identification
    /// number.
    /// - Category: Identity Document
    IdentityNumber,

    /// **License Number** - Government-issued license number (e.g. driving,
    /// professional).
    /// - Category: Identity Document
    LicenseNumber,
}

#[cfg(test)]
mod tests {
    use super::*;

    /// Compile-time proof that `Attribute` satisfies `AttributeKind`.
    fn assert_attribute_kind<K: AttributeKind>() {}

    #[test]
    fn attribute_implements_attribute_kind() {
        assert_attribute_kind::<Attribute>();
    }

    #[test]
    fn eq_and_copy_are_reflexive() {
        let a = Attribute::Name;
        let b = a;
        assert_eq!(a, b);
    }
}