How bindkey-project/bindkey-tinyesp works
BindKey’s master firmware authenticates a user, initializes access to encrypted volumes, and presents them to a host as a USB mass-storage device. For disk I/O, the USB layer uses encrypted-disk handling, which applies AES-GCM and forwards physical-media operations over SPI to the slave MCU. Secure-element and volume-table modules support key handling and volume configuration; a UART task provides the desktop control channel. The README also describes an alternate BM-Lite fingerprint path and sharing capabilities. Some runtime wiring is unsampled, so uncertain links are omitted.
Main entry points: main.rs Firmware boot · encrypted_disk.rs Encrypted disk · fake_usb.rs USB MSC emulation · spi_master.rs SPI master transport
Components 21
Firmware and authentication
- Firmware boot
src/main.rs - R503 fingerprint
src/fingerprint/fingerprint_r503.rs - BM-Lite fingerprint
src/fingerprint/BMLite/include/bmlite_if.h
Encrypted storage
- Encrypted disk
src/crypto/encrypted_disk.rs - AES-GCM
src/crypto/aes.rs - Sector crypto
src/crypto/disk_crypto.rs - Disk layout
src/crypto/disk_layout.rs - Sector metadata
src/crypto/disk_meta.rs - Volume table
src/crypto/volume_table.rs - Secure-element operations
src/crypto/secure_element.rs
Device interfaces
- UART control
src/software_link/task.rs - USB MSC emulation
src/usb_emulation/fake_usb.rs - SPI storage API
src/spi_link/api_spi.rs - SPI master transport
src/spi_link/spi_master.rs - SPI protocol
src/spi_link/protocol.rs
Other components
- Host PC
- Desktop software
- Slave MCU and media
- R503 sensor
- BM-Lite sensor
- ATECC608A
Connections 24
- Host PC → USB MSC emulation: issues USB MSC I/O
- Firmware boot → R503 fingerprint: initializes and authenticates
src/main.rs - Firmware boot → BM-Lite fingerprint: selects alternate path
src/main.rs - R503 sensor → R503 fingerprint: provides fingerprint input
- BM-Lite sensor → BM-Lite fingerprint: provides fingerprint input
- Firmware boot → SPI master transport: initializes transport
src/main.rs - Firmware boot → Volume table: loads volume table
src/main.rs - Firmware boot → Secure-element operations: initializes session
src/main.rs - ATECC608A → Secure-element operations: performs crypto operations
- Firmware boot → Encrypted disk: initializes encrypted disk
src/main.rs - Firmware boot → USB MSC emulation: starts USB MSC
src/main.rs - Firmware boot → UART control: starts UART task
src/main.rs - Desktop software → UART control: sends control commands
- USB MSC emulation → Encrypted disk: handles encrypted I/O
src/usb_emulation/fake_usb.rs - USB MSC emulation → Volume table: loads and flushes table
src/usb_emulation/fake_usb.rs - Encrypted disk → AES-GCM: uses for sector encryption
src/crypto/encrypted_disk.rs - Encrypted disk → Sector crypto: delegates sector crypto
src/crypto/encrypted_disk.rs - Encrypted disk → Disk layout: uses sector layout
src/crypto/encrypted_disk.rs - Encrypted disk → Sector metadata: uses metadata
src/crypto/encrypted_disk.rs - Encrypted disk → SPI storage API: forwards media I/O
- Volume table → Secure-element operations: uses secure-element keys
src/crypto/volume_table.rs - SPI storage API → SPI master transport: dispatches commands
src/spi_link/api_spi.rs - SPI master transport → SPI protocol: frames SPI traffic
src/spi_link/spi_master.rs - SPI master transport → Slave MCU and media: transfers storage commands