-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCargo.toml
More file actions
100 lines (85 loc) · 3.2 KB
/
Copy pathCargo.toml
File metadata and controls
100 lines (85 loc) · 3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
[workspace.package]
version = "0.1.0"
edition = "2024"
authors = ["Tuloup Simon <perso@simontuloup.fr>"]
repository = "https://forge.simontuloup.fr/Simon/Mini-HSM"
license = "GPL-3.0-or-later"
[workspace]
resolver = "2"
members = [
"crates/atecc608b",
"crates/hsm-crypto-service",
"crates/hsm-usb-protocol",
"crates/hsm-firmware",
"crates/hsm-firmware-logic",
"tools/hsm-host",
"tools/config-generator",
]
# The firmware crate must be cross-compiled for thumbv6m-none-eabi. Pulling it
# into the default workspace selection would force cortex-m and embassy-rp to
# build for the host, which is impossible (inline ARM asm). Excluding it from
# the default selection means that bare `cargo check`, `cargo test`, and
# `cargo build` from the workspace root only operate on the host-compatible
# crates. The firmware is built explicitly with the alias `cargo firmware`
# defined in `.cargo/config.toml`, or via `cargo check -p hsm-firmware
# --target thumbv6m-none-eabi`.
default-members = [
"crates/atecc608b",
"crates/hsm-crypto-service",
"crates/hsm-usb-protocol",
"crates/hsm-firmware-logic",
"tools/hsm-host",
"tools/config-generator",
]
# Profile applied to firmware (target = thumbv6m-none-eabi).
# Debug build keeps symbols for defmt + probe-rs.
[profile.dev]
codegen-units = 1
debug = 2
debug-assertions = true
incremental = false
opt-level = "s"
overflow-checks = true
[profile.release]
codegen-units = 1
debug = 2
debug-assertions = false
incremental = false
lto = "fat"
opt-level = "s"
overflow-checks = false
[workspace.dependencies]
# Embassy ecosystem
embassy-executor = { version = "0.10", default-features = false }
embassy-time = { version = "0.5", default-features = false }
embassy-sync = { version = "0.8", default-features = false }
embassy-futures = { version = "0.1", default-features = false }
embassy-rp = { version = "0.10", default-features = false }
embassy-usb = { version = "0.6", default-features = false }
embassy-usb-driver = { version = "0.2", default-features = false }
# USB HID layer on top of embassy-usb.
usbd-hid = { version = "0.10", default-features = false }
# Crypto primitives. Used for off-chip ECDSA verification during tests and
# for SHA-256 of the PIN before CheckMac on the chip.
p256 = { version = "0.13", default-features = false, features = ["ecdsa"] }
sha2 = { version = "0.11", default-features = false }
# Embedded HAL traits
embedded-hal = "1.0"
embedded-hal-async = "1.0"
# Heapless containers for no_std payload buffers.
heapless = { version = "0.9", default-features = false }
# Static-allocation cell, replaces unsafe `static mut` for one-shot init
# of large structures borrowed by embassy tasks.
static_cell = "2"
# Logging / panic.
defmt = "1.1"
defmt-rtt = "1.2"
panic-probe = { version = "1.0", features = ["print-defmt"] }
# Cortex-M support.
cortex-m = { version = "0.7", features = ["inline-asm"] }
cortex-m-rt = "0.7"
# Host-side (std) tooling.
hidapi = "2.6"
clap = { version = "4", features = ["derive"] }
anyhow = "1"
hex = "0.4"