Skip to content

Latest commit

 

History

History
920 lines (690 loc) · 84.2 KB

File metadata and controls

920 lines (690 loc) · 84.2 KB

Code map (function and module index)

This document lists where Rust modules, types, and functions live in the Galdralag / Galdr workspace. Use it to navigate the tree before opening files. For protocol behaviour and cross-crate flows, see also:

  • ARCHITECTURE.md — Xous servers, RRAM layout, threat model
  • THREAT_MODEL.md — assets, threats, IPC access-control inventory
  • server.md — HTTP registry server design and galdra keyserver client config
  • API_REFERENCE.md — Shamir, ephemeral session, and major public APIs in prose
  • cargo doc -p <crate> --open — full signatures and trait bounds

Scope: workspace members under crates/, host apps (galdra, galdrad, galdra-gtk, galdra-core-host), xtask, and the Xous service services/galdralag. Excludes fuzz/ targets (listed in Fuzz targets), test-only modules, and the separately built baochip-openpgp workspace member (still indexed here).

Line links point at the definition line in each file (GitHub-style #Lnn anchors).


Workspace at a glance

Path Crate / binary Role
crates/vault galdr-vault RRAM vault, ciphers, Brainpool/RSA, Shamir, sealed keys
crates/pin-policy pin-policy PIN FSM, constant-time compare
crates/cipher-profile cipher-profile Named cipher stacks and registry
crates/usb-personality usb-personality CCID + OpenPGP card dispatch
crates/ephemeral-session ephemeral-session Authenticated ephemeral ECDH sessions
crates/galdr-core galdr-core HAL traits, shared errors
crates/cess cess CESS cascade encryption
crates/biometric-* biometric crates Device API and backends
crates/baochip-openpgp (separate manifest) Xous vault backend for OpenPGP
services/galdralag galdralag-service Xous CCID main loop
galdra-core-host galdra-core-host Host library (DB, device, crypto)
galdra galdra CLI
galdrad galdrad REST daemon
galdra-gtk galdra-gtk GTK UI
xtask xtask test-all, fuzz, embedded build helpers
flowchart TB
  subgraph host [Host]
    galdra[galdra CLI]
    galdrad[galdrad REST]
    gtk[galdra-gtk]
    corehost[galdra-core-host]
  end
  subgraph fw [Firmware logic crates]
    vault[vault]
    pin[pin-policy]
    usb[usb-personality]
    ephem[ephemeral-session]
    profile[cipher-profile]
  end
  subgraph xous [Xous device]
    svc[services/galdralag]
    bao[baochip-openpgp]
  end
  galdra --> corehost
  galdrad --> corehost
  gtk --> corehost
  corehost --> profile
  corehost --> vault
  svc --> usb
  svc --> bao
  bao --> vault
  usb --> vault
  usb --> pin
  ephem --> vault
Loading

Entry points

Binary / service File Main symbols
Xous firmware service services/galdralag/src/main.rs main, galdralag_ccid_main, ccid_serve_loop
Galdra CLI galdra/src/main.rs Cli, Commands, main (subcommands in *_cmds.rs, commands/)
Galdra REST galdrad/src/main.rs main, run; HTTP routes in router
Galdra GTK galdra-gtk/src/main.rs main
xtask xtask/src/main.rs main; test_all::run, timing_test::run
host-tools crates/host-tools/src/main.rs, provision.rs provisioning utilities
dudect harness crates/security-tests/src/bin/dudect_galdr.rs main

OpenPGP APDU dispatch hub: handle_apdu in usb-personality, wired from galdralag via OpenPgpCcidDispatcher.


Find by topic

Topic Start here
Shamir split/recover crates/vault/src/shamir.rs, galdra-core-host/src/shamir_ops.rs, galdra/src/shamir_cmds.rs
PIN policy crates/pin-policy/src/machine.rs, crates/vault/src/vault_pin_policy.rs
HKDF labels crates/vault/src/kdf_policy.rs, crates/ephemeral-session/src/hkdf_labels.rs
Ephemeral ECDH session crates/ephemeral-session/src/handshake.rs, protocol.rs, keys.rs
OpenPGP commands crates/usb-personality/src/openpgp/commands/ (sign, decipher, get_data, …)
Cipher profiles crates/cipher-profile/src/profile.rs, registry.rs
Host contacts / groups galdra-core-host/src/contacts.rs, groups.rs, db.rs
Fulla HTTP registry (galdra keyserver) galdra-core-host/src/registry.rs, galdra/src/commands/keyserver/
HKP / WKD public-key fetch galdra-core-host/src/keyserver.rs ([keyservers] in config)
Privileged IPC stubs (fail-closed) crates/vault/src/service.rs, crates/usb-personality/src/lib.rs, crates/galdr-core/src/error.rs
Firmware update mode gate services/galdralag/src/reboot.rs (UpdateModeAuthorization, privileged-reboot feature)
Constant-time tests crates/security-tests/src/dudect_harnesses.rs

Per-crate index

baochip-openpgp

Xous OpenPGP vault backend bridge (separate manifest).

Files: 1 | Public functions: 15 | Private functions: 22

crates/baochip-openpgp/src/xous_impl.rs

biometric-api

Biometric challenge/verify API surface.

Files: 1 | Public functions: 7 | Private functions: 7

crates/biometric-api/src/lib.rs

biometric-fingervein

Finger-vein device backend.

Files: 1 | Public functions: 4 | Private functions: 11

crates/biometric-fingervein/src/lib.rs

  • Public types: struct FingerVeinDevice, struct MockFingerVeinDevice
  • Public functions: new, connect, disconnect, new
  • Private functions: connected (L48), backend (L57), authenticate (L61), enroll (L73), device_pubkey (L81), probe (L85), backend (L122), authenticate (L126), enroll (L148), device_pubkey (L157), probe (L161)

biometric-sweet

SWEET platform biometric backend.

Files: 1 | Public functions: 3 | Private functions: 11

crates/biometric-sweet/src/lib.rs

  • Public types: struct SweetPlatform, struct MockSweetPlatform
  • Public functions: new, connect, new
  • Private functions: connected (L41), backend (L50), authenticate (L54), enroll (L66), device_pubkey (L74), probe (L78), backend (L121), authenticate (L125), enroll (L147), device_pubkey (L156), probe (L160)

biometric-vault

Vault integration for biometric templates.

Files: 1 | Public functions: 4 | Private functions: 3

crates/biometric-vault/src/lib.rs

  • Public types: const RRAM_TOTAL_BYTES, const BIOMETRIC_REGION_OFFSET, const BIOMETRIC_REGION_SIZE, const MAX_TEMPLATE_SIZE_BYTES, const MAX_ENROLLED_PERSONS, const SAMPLES_PER_ENROLLMENT, enum VaultError, type ZeroizingVec
  • Public functions: encrypt_template, decrypt_template, generate_session_token, verify_session_token
  • Private functions: derive_slot_key (L42), nonce_for_plaintext (L58), encrypt_decrypt_roundtrip_smoke (L176)

cess

CESS cascade encryption registry and wire format.

Files: 7 | Public functions: 16 | Private functions: 45

crates/cess/src/hkdf_blake3.rs

  • Public functions: hmac_blake3, hkdf_blake3, derive_k_outer
  • Private functions: normalize_hmac_key (L7), cess_vector_classical_only_32 (L80), cess_vector_explicit_salt_32_zero (L91), cess_vector_pin_wrap (L103), cess_vector_64_byte_expand (L114)

crates/cess/src/inner_info.rs

crates/cess/src/lib.rs

  • Modules: registry
  • Public types: const CESS_OUTER_ENVELOPE_INFO_UTF8, const SUITE_ID_RESERVED, const WIRE_CURVE_BRAINPOOL_P384, const CESS_CORE_DEFAULT_CHACHA, const CASCADE_CHACHA_INNER_SERPENT_OUTER_P384, const CASCADE_CHACHA_INNER_SERPENT_OUTER_P512
  • Public functions: suite_id_for_profile_name
  • Private functions: roundtrip_outer_plaintext (L85), reserved_suite_rejected (L94), builtin_profile_maps_to_registry_table (L99), registry_constants_match_listed_table (L131), gaps_in_table_are_unlisted (L142)

crates/cess/src/mode_a.rs

crates/cess/src/registry_ids.rs

  • Public types: const LISTED_SUITE_ID_RANGES
  • Public functions: is_listed_suite_id
  • Private functions: range_endpoints_are_listed (L42), documented_gaps_are_unlisted (L50), newly_allocated_classical_rows_are_listed (L61)

crates/cess/src/spec_tests.rs

  • Private functions: 21 (open file for full list)

crates/cess/src/wire.rs

cipher-profile

Named cipher stacks, curves, Shamir metadata, registry.

Files: 9 | Public functions: 36 | Private functions: 71

crates/cipher-profile/src/audit.rs

crates/cipher-profile/src/bin/cascade_kat_gen.rs

  • Private functions: main (L20)

crates/cipher-profile/src/cascade.rs

crates/cipher-profile/src/domain.rs

  • Public types: const MAX_CASCADE_PLAINTEXT
  • Public functions: layer_key_info, layer_nonce_info
  • Private functions: build_layer_info (L28), push_bytes (L60), tr (L73), domain_labels_differ_by_layer_index (L81), domain_labels_differ_by_cipher (L88), domain_labels_differ_by_profile (L95), domain_key_and_nonce_differ (L102)

crates/cipher-profile/src/error.rs

  • Public types: enum CipherProfileError

crates/cipher-profile/src/layer.rs

crates/cipher-profile/src/profile.rs

crates/cipher-profile/src/registry.rs

crates/cipher-profile/src/shamir_cfg.rs

  • Public types: struct ShamirConfig
  • Public functions: new, none, is_active
  • Private functions: shamir_valid (L48), shamir_k_zero (L59), shamir_k_gt_n (L67), shamir_n_zero (L75), shamir_none (L83)

ephemeral-session

Forward-secret ECDH handshake and session keys.

Files: 7 | Public functions: 28 | Private functions: 44

crates/ephemeral-session/src/curve_select.rs

  • Public types: enum SessionCurve
  • Public functions: wire_id, from_wire, public_key_len
  • Private functions: wire_id_roundtrip (L50), unknown_wire_id (L61)

crates/ephemeral-session/src/error.rs

  • Public types: enum EphemeralSessionError
  • Private functions: from (L50), from (L56), from (L64)

crates/ephemeral-session/src/handshake.rs

  • Public types: const INIT_PROTOCOL_VERSION, const RESP_PROTOCOL_VERSION, const MAX_SIG_BYTES, const MAX_HANDSHAKE_BYTES, struct InitMessage, struct ResponseMessage
  • Public functions: serialise, parse, encode_fingerprint_hex, decode_fingerprint_hex, serialise, parse
  • Private functions: hex_encode_32 (L38), hex_decode_64 (L48), val (L52), sample_init (L291), sample_resp (L307), init_message_serialise_parse_roundtrip (L329), response_message_serialise_parse_roundtrip (L341), parse_truncated_init_message (L357), parse_unknown_curve (L363), parse_version_mismatch (L371)

crates/ephemeral-session/src/hkdf_labels.rs

  • Modules: domain
  • Public types: const PAYLOAD_KEY_I2R, const PAYLOAD_KEY_R2I, const GDSS_MASK_KEY, const GDSS_SYNC_KEY, const GDSS_TIMING_KEY, const MAC_KEY
  • Private functions: domain_labels_all_distinct (L34), domain_labels_non_empty (L51)

crates/ephemeral-session/src/keys.rs

crates/ephemeral-session/src/protocol.rs

  • Public types: enum SessionRole, struct InitiatorSession, struct ResponderSession
  • Public functions: new, init, complete, respond
  • Private functions: complete_inner (L140), default (L232), init_sign_preimage (L317), response_sign_preimage (L325), sign_with_long_term (L339), verifying_sec1 (L375), verify_with_cert (L406)

crates/ephemeral-session/src/trust.rs

  • Public types: const MAX_SEC1, struct LongTermCert, trait TrustStore, struct InMemoryTrustStore
  • Public functions: fingerprint_of, fingerprint_ct_eq, new, add, remove
  • Private functions: lookup (L48), default (L90), lookup (L96), sample_cert (L121), test_lookup_found (L137), test_lookup_not_found (L147), test_store_full (L153), test_remove (L171)

galdr-core

HAL traits (TRNG, zeroise), shared errors.

Files: 8 | Public functions: 9 | Private functions: 38

crates/galdr-core/src/crypto_rfc.rs

  • Private functions: hkdf_sha256_rfc5869_appendix_a (L8), hkdf_sha512_expand_smoke (L28), chacha20poly1305_rfc8439_aead (L38), x25519_rfc7748 (L65), ed25519_rfc8032_sign_verify_smoke (L81), hmac_sha256_rfc4231_case_1 (L95), pbkdf2_hmac_sha1_rfc6070_count_1 (L110), aes256_gcm_nist_one_block (L121), sha3_256_empty (L143), blake2b512_known_vector (L152), blake3_deterministic (L164)

crates/galdr-core/src/error.rs

  • Public types: enum GaldrError (PrivilegedOperationDenied, is_permanent_denial), enum HalError
  • Public functions: is_permanent_denial

crates/galdr-core/src/fake_hal.rs

crates/galdr-core/src/hal.rs

  • Public types: trait MonotonicCounter, trait HardwareTrng, trait ZeroiseController, trait VaultStorage, trait RebootController
  • Private functions: read (L14), increment (L18), refund_on_success (L23), zeroise_region (L42), read (L50), write (L51), enter_update_mode (L81)

crates/galdr-core/src/hal_tests.rs

  • Private functions: read (L9), increment (L13), monotonic_counter_increments (L20)

crates/galdr-core/src/lib.rs

  • Modules: error, hal, fake_hal

crates/galdr-core/src/property_tests.rs

  • Private functions: read (L10), increment (L14), counter_never_decrements (L22)

crates/galdr-core/src/scaffold_todos.rs

  • Private functions: privileged_xous_server_scaffold_is_fail_closed (L11)

galdra

CLI (profiles, Shamir, EPK, identity, Fulla HTTP registry via keyserver).

Files: 13 | Public functions: 32 | Private functions: 48

galdra/src/commands/keyserver/client.rs

galdra/src/commands/keyserver/fetch.rs

  • Public types: struct FetchArgs
  • Public functions: normalize_fingerprint_hex, run_fetch
  • Private functions: parse_output_mode (L53), flatten_records (L63), write_stdout_or_file (L70), fingerprint_normalizes (L218), fingerprint_bad_length (L226), fingerprint_bad_char (L231)

galdra/src/commands/keyserver/mod.rs

  • Modules: client, fetch, push
  • Public types: enum KeyserverCmd
  • Public functions: run_keyserver

galdra/src/commands/keyserver/push.rs

  • Public types: struct PushArgs
  • Public functions: cert_emails_sorted, validate_dmr_id_range, resolve_email_for_push, run_push
  • Private functions: opt_trim_nonempty (L111), cert_to_armored (L188), load_cert_and_armor (L199), cert_with_emails (L359), cert_without_mail (L369), email_derivation_zero (L379), email_derivation_one (L385), email_derivation_many_without_flag (L394), email_derivation_many_with_flag (L400), dmr_id_validation (L410)

galdra/src/commands/mod.rs

  • Modules: keyserver

galdra/src/common.rs

galdra/src/crypto_cmds.rs

  • Public functions: run_encrypt, run_decrypt, run_sign, run_verify
  • Private functions: identity_to_cert (L24), collect_recipient_identities (L32), session_id_from_ciphertext (L60), run_encrypt_age (L230), run_decrypt_age (L424), verification_pool (L510)

galdra/src/epk_cmds.rs

  • Public functions: run_epk
  • Private functions: run_generate (L47), run_import (L79), run_status (L111), run_expire (L155), row_to_json (L197)

galdra/src/identity_cmds.rs

  • Public types: const GALDRA_FINGERPRINT_EPHEMERAL_ECDH_BLOCKED
  • Public functions: run_identity

galdra/src/main.rs

  • Public types: enum IdentityCmd, enum ProfileCmd, enum ShamirCmd, enum EpkCmd
  • Private functions: 13 (open file for full list)

galdra/src/profile_cmds.rs

  • Public functions: run_profile
  • Private functions: map_cipher (L12)

galdra/src/qr.rs

galdra/src/shamir_cmds.rs

galdra-core-host

Host library: device, DB, encrypt, Shamir, audit.

Files: 19 | Public functions: 115 | Private functions: 101

galdra-core-host/src/audit.rs

galdra-core-host/src/cipher_envelope.rs

galdra-core-host/src/config.rs

  • Public types: struct Config, struct KeyserverConfig, struct RegistryKeyserverConfig, struct RegistryNodeConfig, const MAX_REGISTRY_NODES, struct LdapConfig
  • Public functions: default_database_path, default_config_path, database_key_from_env, load_config
  • Private functions: default_key_expiry_warn_days (L30), default_keyservers (L46), default_timeout_seconds (L54), default (L59), default (L68), default_registry_enabled (L119), default_registry_failover (L123), default_registry_timeout_seconds (L127), home_dir (L215), data_dir_linux (L239)

galdra-core-host/src/contacts.rs

galdra-core-host/src/db.rs

galdra-core-host/src/device.rs

galdra-core-host/src/encrypt.rs

galdra-core-host/src/ephemeral_offers.rs

galdra-core-host/src/error.rs

  • Public types: enum GaldraError

galdra-core-host/src/galdra_fingerprint.rs

  • Public types: enum GaldraFingerprintParseError, struct GaldraFingerprint
  • Public functions: from_public_key_bytes, canonical, display
  • Private functions: eq (L24), normalize_input (L62), from_str (L87), fmt (L93), from_bytes_round_trip_canonical (L103), display_grouping (L113), parse_display_form (L122), inequality_different_key (L130), reject_wrong_prefix (L137), reject_wrong_length (L144), reject_non_hex (L149)

galdra-core-host/src/groups.rs

galdra-core-host/src/keyserver.rs

galdra-core-host/src/registry.rs

galdra-core-host/src/ldap.rs

  • Public functions: ldap_fetch_async
  • Private functions: ldap_escape_filter_value (L11), cert_from_ldap_value (L26)

galdra-core-host/src/lib.rs

  • Modules: audit, cipher_envelope, config, contacts, db, device, encrypt, ephemeral_offers, error, galdra_fingerprint, openpgp_pcsc, groups, keyserver, registry, ldap, profiles, shamir_ops, sign, sync

galdra-core-host/src/openpgp_pcsc.rs

galdra-core-host/src/profiles.rs

galdra-core-host/src/shamir_ops.rs

galdra-core-host/src/sign.rs

galdra-core-host/src/sync.rs

  • Public types: enum SyncImportMode
  • Public functions: sync_export, sync_import
  • Private functions: sqlite_path_for_attach (L23), copy_table (L28), pragma_identity_columns (L59), import_identities_sql (L71), export_import_merge (L182), import_replace_clears (L225)

galdra-gtk

GTK desktop UI for Galdra.

Files: 7 | Public functions: 33 | Private functions: 31

galdra-gtk/src/client.rs

galdra-gtk/src/crypto_ui.rs

  • Public functions: build
  • Private functions: text_view (L279), set_text_view (L291), scrolled (L295)

galdra-gtk/src/gtk_config.rs

  • Public types: struct GtkConfig
  • Public functions: config_path, load, save
  • Private functions: default (L15)

galdra-gtk/src/main.rs

  • Private functions: 15 (open file for full list)

galdra-gtk/src/profile_row.rs

galdra-gtk/src/profiles_ui.rs

  • Public types: enum EditorMode
  • Public functions: build
  • Private functions: col_lock (L50), col_text (L72), open_profile_editor (L251)

galdra-gtk/src/shamir_ui.rs

  • Public functions: build
  • Private functions: split_pem_blocks (L11), text_view (L192), set_text_view (L204), scrolled (L208)

galdrad

REST daemon over galdra-core-host.

Files: 5 | Public functions: 2 | Private functions: 35

galdrad/src/api.rs

  • Public types: struct ListContactsQuery, struct CreateContactBody, struct UpdateContactBody, struct CreateGroupBody, struct AddMembersBody, struct AuditQuery, struct EncryptBody, struct CreateProfileBody, struct ShamirSplitBody, struct ShamirRecoverBody, struct ShamirShareInfoQuery, struct DecryptBody, struct ApiDoc
  • Public functions: router
  • Private functions: 29 (open file for full list)

galdrad/src/error.rs

  • Public types: struct ApiError
  • Private functions: from (L12), into_response (L18)

galdrad/src/lib.rs

  • Modules: api, error, state

galdrad/src/main.rs

  • Private functions: load_app_config (L27), open_database (L36), main (L49), run (L56)

galdrad/src/state.rs

  • Public types: struct AppState
  • Public functions: new

host-tools

Provisioning helpers and vector generators.

Files: 5 | Public functions: 2 | Private functions: 9

crates/host-tools/src/bin/gen_serpent_vectors.rs

  • Private functions: ecb_encrypt (L9), main (L19)

crates/host-tools/src/lib.rs

crates/host-tools/src/main.rs

  • Private functions: main (L3)

crates/host-tools/src/property_tests.rs

  • Private functions: sha256_deterministic (L6)

crates/host-tools/src/provision.rs

  • Private functions: main (L34), run (L41), send_line (L85), wait_for_usb_reset_hint (L95)

pin-policy

PIN state machine, constant-time compare, zeroisation triggers.

Files: 4 | Public functions: 10 | Private functions: 3

crates/pin-policy/src/machine.rs

  • Public types: trait ZeroisationTrigger, const DEFAULT_MAX_PIN_ATTEMPTS, const MIN_PROVISIONED_PIN_ATTEMPTS, const MAX_PROVISIONED_PIN_ATTEMPTS, enum PinPolicyProvisionError, struct PinPolicyConfig, enum PinState, enum PinOutcome, struct PinPolicyMachine
  • Public functions: pin_compare, try_with_max_attempts, new, enter_locked_idle, submit_attempt, into_inner
  • Private functions: trigger_zeroisation (L18), default (L57)

crates/pin-policy/src/pin_input.rs

crates/pin-policy/src/property_tests.rs

  • Private functions: pin_compare_reflexive_equal (L6)

crates/pin-policy/src/zeroise_fsm.rs

security-tests

dudect timing harnesses and statistical tests.

Files: 12 | Public functions: 30 | Private functions: 34

crates/security-tests/src/bin/dudect_galdr.rs

  • Private functions: main (L8)

crates/security-tests/src/biometric_timing.rs

crates/security-tests/src/dudect_harnesses.rs

  • Public functions: run_all
  • Private functions: 24 (open file for full list)

crates/security-tests/src/dudect_sample_counts.rs

crates/security-tests/src/dudect_stats.rs

  • Public types: struct CtSummary, enum Class, struct CtRunner, struct CtCtx, const DUDECT_THRESHOLD, const DUDECT_SAMPLES, const DUDECT_SAMPLES_PBKDF2, const DUDECT_SAMPLES_SHA3, const DUDECT_SAMPLES_BRAINPOOL_SLOW, const DUDECT_SAMPLES_BRAINPOOL_REDUCED, const DUDECT_SAMPLES_EPHEMERAL_ECDH, const DUDECT_SAMPLES_SIGNATURE_VERIFY
  • Public functions: run_one, left_right, update_ct_stats
  • Private functions: local_cmp (L64), percentile_of_sorted (L77), prepare_percentiles (L93), compute_t (L161), update_test_left (L182), update_test_right (L189)

crates/security-tests/src/lib.rs

crates/security-tests/src/timing_blake2.rs

crates/security-tests/src/timing_blake3.rs

crates/security-tests/src/timing_cascade.rs

crates/security-tests/src/timing_pbkdf2.rs

crates/security-tests/src/timing_sha2.rs

crates/security-tests/src/timing_sha3.rs

services/galdralag

Xous firmware service: CCID + OpenPGP on Baochip.

Files: 4 | Public functions: 4 | Private functions: 18

services/galdralag/src/lib.rs

  • Modules: reboot
  • Re-exports: Bao1xRebootController, UpdateModeAuthorization

services/galdralag/src/main.rs

  • Private functions: main (L9), main (L15), galdralag_ccid_main (L20), build_id_aid (L142), ccid_pddb_provisioned (L152), read_pddb_key (L177), ccid_serve_loop (L188), usb_link_status (L240), ccid_rx_deferred (L252), ccid_tx (L275)

services/galdralag/src/reboot.rs

  • Public types: struct UpdateModeAuthorization, struct Bao1xRebootController
  • Public functions: for_operator_consent (privileged-reboot feature), new, enter_update_mode
  • Private functions: boot_wait_is_enabled (L84), boot_wait_ptr (L143), rcurst0_ptr (L153), read_boot_wait (L162), inc_boot_wait (L177), trigger_soft_reset (L189), default (L217), boot_wait_enable_detection (L252), fake_reboot_controller_records_request (L264), update_mode_requires_authorization_token_type (L273), hardware_addresses_are_sane (L285)

services/galdralag/src/usb_bao_ipc.rs

  • Public types: const SERVER_NAME_USB_DEVICE, const OP_LINK_STATUS, const OP_CCID_RX_DEFERRED, const OP_CCID_TX, struct CcidMsgIpc, enum CcidCode, enum UsbDeviceState
  • Public functions: from_scalar

subtle-vendored

Vendored subtle crate (constant-time helpers).

Files: 1 | Public functions: 14 | Private functions: 37

crates/subtle-vendored/src/lib.rs

usb-personality

CCID, OpenPGP card dispatch, provisioning hooks.

Files: 19 | Public functions: 60 | Private functions: 154

crates/usb-personality/src/ccid/command.rs

  • Public types: enum PcToRdr, enum CcidError
  • Public functions: parse_pc_to_rdr
  • Private functions: hdr (L102), parse_icc_power_on (L115), parse_xfr_block (L133), parse_unknown_type (L156), parse_truncated (L162)

crates/usb-personality/src/ccid/mod.rs

  • Modules: usb_class
  • Public types: const USB_DEVICE_CLASS, const USB_INTERFACE_CLASS_CCID, const USB_INTERFACE_SUBCLASS_CCID, const USB_INTERFACE_PROTOCOL_CCID, const USB_VID_GALDRALAG, const USB_PID_GALDRALAG_TOKEN, const STRING_INDEX_MANUFACTURER, const STRING_INDEX_PRODUCT, const STRING_INDEX_SERIAL, const USB_STRING_MANUFACTURER, const USB_STRING_PRODUCT, const CCID_BCD_CCID, const CCID_MAX_SLOT_INDEX, const CCID_VOLTAGE_SUPPORT, const CCID_DW_PROTOCOLS, const CCID_DW_DEFAULT_CLOCK, const CCID_DW_MAXIMUM_CLOCK, const CCID_DW_DATA_RATE, const CCID_DW_MAX_DATA_RATE, const CCID_DW_MAX_IFSD, const CCID_DW_SYNCH_PROTOCOLS, const CCID_DW_MECHANICAL, const CCID_DW_FEATURES, const CCID_MAX_MESSAGE_LENGTH, const CCID_CLASS_GET_RESPONSE, const CCID_CLASS_ENVELOPE, const CCID_LCD_LAYOUT, const CCID_PIN_SUPPORT, const CCID_MAX_BUSY_SLOTS, const CCID_BULK_MAX_PACKET, const CCID_INTERRUPT_MAX_PACKET, const CCID_INTERRUPT_INTERVAL_MS, const CCID_WIRE_BUF_SIZE
  • Public functions: ccid_class_descriptor_bytes

crates/usb-personality/src/ccid/response.rs

crates/usb-personality/src/ccid/usb_class.rs

crates/usb-personality/src/lib.rs

crates/usb-personality/src/openpgp/aid.rs

  • Public types: const OPENPGP_AID_PREFIX, const OPENPGP_CARD_VERSION_MAJOR, const OPENPGP_CARD_VERSION_MINOR
  • Public functions: build_aid, aid_matches_openpgp

crates/usb-personality/src/openpgp/apdu.rs

  • Public types: struct CommandApdu, enum ApduError, struct ResponseApdu
  • Public functions: parse, ok, ok_empty, error, to_bytes
  • Private functions: le_short (L147), parse_short_apdu_no_data_no_le (L209), parse_case2_apdu (L219), parse_case4_apdu (L226), parse_extended_apdu (L239), parse_truncated_apdu (L250), status_word_bytes (L260)

crates/usb-personality/src/openpgp/backend.rs

  • Public types: enum OpenPgpKeySlot, enum OpenPgpBackendError, trait OpenPgpAudit, struct NullAudit, trait OpenPgpBackend
  • Public functions: to_status_word
  • Private functions: 27 (open file for full list)

crates/usb-personality/src/openpgp/commands/decipher.rs

crates/usb-personality/src/openpgp/commands/mod.rs

  • Modules: auth, change_ref, decipher, generate_key, get_data, get_response, put_data, reset_retry, select, sign, verify

crates/usb-personality/src/openpgp/dispatch.rs

crates/usb-personality/src/openpgp/do_store.rs

  • Public types: const DO_STORE_MAGIC, const DO_STORE_REGION_BYTES, enum DoStoreError, struct DoStore
  • Public functions: new, probe, read, write, delete
  • Private functions: from (L29), init_if_needed (L57), read_slot (L70), write_slot (L82), write_read_round_trip (L167), uninitialised_read_returns_none (L176)

crates/usb-personality/src/openpgp/dos.rs

  • Modules: curve_oids
  • Public types: const BRAINPOOL_P256R1, const BRAINPOOL_P384R1, const BRAINPOOL_P512R1, const NIST_P256, const NIST_P384, const ED25519, const CURVE25519, enum AlgorithmAttributes
  • Public functions: to_bytes, parse, extended_capabilities_default, compute_v4_fingerprint, pin_bytes_to_verifier_digest
  • Private functions: algorithm_attributes_brainpool256_roundtrip (L172), algorithm_attributes_ed25519_roundtrip (L184), algorithm_attributes_rsa2048_roundtrip (L196), fingerprint_compute_known_vector (L208)

crates/usb-personality/src/openpgp/error.rs

  • Public types: enum StatusWord
  • Public functions: sw1, sw2
  • Private functions: status_word_bytes_cover_common_cases (L113)

crates/usb-personality/src/openpgp/mod.rs

  • Modules: aid, apdu, backend, dispatch, do_store, dos, error, state, vault_backend, commands
  • Public functions: on_token_lock

crates/usb-personality/src/openpgp/state.rs

crates/usb-personality/src/openpgp/vault_backend.rs

crates/usb-personality/src/property_tests.rs

  • Private functions: mass_storage_never_exposes_slice (L6)

crates/usb-personality/src/provisioning/mod.rs

  • Public types: const PROVISIONING_PIN_MAX, trait ProvisioningCommit, struct ProvisioningClass
  • Public functions: new, commit_succeeded
  • Private functions: 13 (open file for full list)

vault

RRAM vault, crypto, Shamir, sealed keys, Brainpool/RSA, sessions.

Files: 35 | Public functions: 219 | Private functions: 221

crates/vault/src/brainpool.rs

crates/vault/src/brainpool384.rs

crates/vault/src/brainpool_common.rs

  • Public types: enum BrainpoolError

crates/vault/src/camellia_cipher.rs

crates/vault/src/chacha_aead.rs

crates/vault/src/ecdsa_brainpool.rs

crates/vault/src/kdf_policy.rs

crates/vault/src/key_material.rs

crates/vault/src/layout.rs

  • Public types: const PUBLIC_KEY_TABLE_BYTES, const SEALED_BLOB_BYTES, const SEALED_SIG_OFFSET, const SEALED_DEC_OFFSET, const SEALED_AUT_OFFSET, const SEALED_KEY_REGION_END

crates/vault/src/lib.rs

  • Modules: brainpool, brainpool384, camellia_cipher, chacha_aead, ecdsa_brainpool, kdf_policy, key_material, layout, public_key_vault, rsa_keys, rsa_vault, sealed_key, serpent_cipher, service, session, session_long_term_signing, shamir, twofish_cipher, vault_pin_policy

crates/vault/src/public_key_vault.rs

crates/vault/src/rsa_keys.rs

crates/vault/src/rsa_vault.rs

  • Public types: struct RsaVaultStoreContext, struct KeySlot, enum RsaVaultError
  • Public functions: new, vault_store_rsa_key, vault_load_rsa_key, vault_delete_rsa_key
  • Private functions: slot_offset (L75), derive_wrap_key (L79), from (L181), vault_round_trip (L192), vault_overwrite_protection (L213), vault_delete (L232)

crates/vault/src/sealed_key.rs

  • Public types: struct SealedKeyBlob, enum SealedKeyError
  • Public functions: seal, unseal, unseal_from_storage_cell, as_slice, blob_len
  • Private functions: purpose_wire_id (L35), derive_wrapping_key (L44), build_aad (L61), unseal_inner (L124), seal_unseal_roundtrip (L225), tamper_tag (L250), tamper_purpose (L268), empty_cell (L278)

crates/vault/src/serpent_cipher.rs

crates/vault/src/service.rs

  • Public types: enum VaultRequest, struct VaultService
  • Public functions: new, dispatch (fail-closed: PrivilegedOperationDenied)
  • Private functions: default (L21), seal_stub_is_fail_closed (L49), unseal_stub_is_fail_closed (L56), zeroise_all_stub_is_fail_closed (L63)

crates/vault/src/session.rs

  • Public types: enum VaultSessionState

crates/vault/src/session_long_term_signing.rs

crates/vault/src/shamir.rs

crates/vault/src/twofish_cipher.rs

crates/vault/src/vault_pin_policy.rs

crates/vault/src/wycheproof_aes_gcm.rs

  • Private functions: aes_gcm_decrypt (L23), wycheproof_aes_gcm_json (L60)

crates/vault/src/wycheproof_brainpool256.rs

  • Private functions: hex_decode_tc (L7), decode_p256_private_scalar (L11), run_ecdh_case (L30), wycheproof_brainpool256_ecdh_json (L101)

crates/vault/src/wycheproof_brainpool384.rs

  • Private functions: hex_decode_tc (L10), decode_p384_private_scalar (L16), run_ecdh_case (L35), wycheproof_brainpool384_ecdh_json (L107), run_ecdsa_case (L125), wycheproof_brainpool384_ecdsa_sha384_json (L161)

crates/vault/src/wycheproof_chacha.rs

  • Private functions: wycheproof_chacha20_poly1305_json (L9)

crates/vault/src/wycheproof_ecdsa_brainpool256.rs

  • Private functions: hex_decode_tc (L6), run_ecdsa_case (L10), wycheproof_brainpool256_ecdsa_sha256_json (L46)

crates/vault/src/wycheproof_ed25519.rs

  • Private functions: hex_decode_tc (L5), wycheproof_ed25519_json (L10)

crates/vault/src/wycheproof_hkdf_sha256.rs

  • Private functions: wycheproof_hkdf_sha256_json (L7)

crates/vault/src/wycheproof_hkdf_sha512.rs

  • Private functions: wycheproof_hkdf_sha512_json (L7)

crates/vault/src/wycheproof_hmac_sha256.rs

  • Private functions: wycheproof_hmac_sha256_json (L10)

crates/vault/src/wycheproof_hmac_sha512.rs

  • Private functions: wycheproof_hmac_sha512_json (L10)

crates/vault/src/wycheproof_rsa.rs

  • Private functions: 13 (open file for full list)

crates/vault/src/wycheproof_x25519.rs

  • Private functions: hex_decode_tc (L5), run_case (L9), wycheproof_x25519_json (L40)

xtask

Build/test automation (test-all, fuzz, docs).

Files: 3 | Public functions: 2 | Private functions: 36

xtask/src/main.rs

  • Private functions: main (L12), workspace_root (L294), galdralag_xous_elf_logical_path (L300), run_galdralag_xous_cargo_build (L308), canonical_galdralag_elf_path (L337), parse_build_and_register_args (L354), format_command_for_display (L395), shell_join_for_hint (L401), fuzz_bin_name (L415), run_fuzz_target (L436), run_embedded (L464)

xtask/src/test_all.rs

  • Public functions: run
  • Private functions: 23 (open file for full list)

xtask/src/timing_test.rs

  • Public functions: run
  • Private functions: load_passing_harnesses (L170), merge_pass_results_into_cache (L184)

Fuzz targets

Target file Exercises
fuzz/fuzz_targets/shamir_split_recover.rs vault::shamir
fuzz/fuzz_targets/fuzz_ephemeral_handshake.rs ephemeral-session handshake
fuzz/fuzz_targets/openpgp_dispatch.rs OpenPGP APDU dispatch
fuzz/fuzz_targets/fuzz_cipher_profile.rs cipher-profile parsing
fuzz/fuzz_targets/chacha_roundtrip.rs ChaCha AEAD in vault
fuzz/fuzz_targets/camellia_aead.rs Camellia AEAD
fuzz/fuzz_targets/serpent_aead.rs Serpent AEAD
fuzz/fuzz_targets/twofish_aead.rs Twofish AEAD
fuzz/fuzz_targets/brainpool384_ecdh.rs Brainpool P-384 ECDH
fuzz/fuzz_targets/rsa_oaep_decrypt.rs RSA OAEP decrypt
fuzz/fuzz_targets/rsa_pss_verify.rs RSA PSS verify
fuzz/fuzz_targets/rsa_der_import.rs RSA DER import
fuzz/fuzz_targets/biometric_dispatch.rs Biometric API

Run via cargo xtask fuzz <target> (see xtask/src/main.rs).


Regenerating this index

From the repository root, the per-crate sections can be refreshed with a small Python scan of pub fn / pub mod / pub struct lines (test modules omitted). The generator script used for the initial version lives in repository history; after large refactors, re-run a similar scan or rely on cargo doc and rg '^pub fn'.

Last generated: 2026-05-29 (workspace snapshot).