Commit graph

216 commits

Author SHA1 Message Date
bunnie
d0bd60d93c fix USB handling
- statics origin set correctly
- debug prints on USB stack go to DUART to avoid a Tx storm
when debugging e.g. Tx packets on USB
2025-09-29 14:49:06 +08:00
bunnie
59ae767741 fix statics origin in boot0 2025-09-29 14:48:48 +08:00
bunnie
7b5c4e1cd8 add a draft boot1
boot1 contains all the ideas up to and including the console.

however, the actual file transfer bits are yet to be implemented.

onward!
2025-09-29 13:52:38 +08:00
bunnie
75022f0b63 track API change for location of combohash bits 2025-09-29 13:51:00 +08:00
bunnie
4375bf43d0 remove debug as a default option for ed25519 2025-09-29 13:49:39 +08:00
bunnie
8cbdb75dc8 cleanup boot0 code
remove things that we don't need in boot0. Boot0 originated from
a much larger, more featureful space and needs to be whittled down
to remove attack surface and space for bugs.

Some further cleanup to do would include:

- hardening the PLL setting. Right now it's done computationally
based on the demanded frequency. But in practice, because the
target frequency is hard-coded, we could just compute the actual PLL value
results and jam them into the register and lose a whole bunch of
code.

Actually I think that's all that needs to be cleaned up off the
top of my head.
2025-09-29 13:46:42 +08:00
bunnie
728072ebae add documentation of the boot0/boot1 flows 2025-09-29 13:39:37 +08:00
bunnie
63e2834e9d return the key index that passed from sigcheck 2025-09-27 00:31:24 +08:00
bunnie
6768f87ce8 vendor in the curve25519-dalek for bao1x boot
The *only* change is to make fiat-crypto a non-optional dependency.
For some reason the .cargo/config.toml only half-activates the
feature, in that in the .rs code files the feature is included
but in the Cargo.toml file the dependency is, for some reason,
not enabled.
2025-09-27 00:30:10 +08:00
bunnie
2d0c456929 add vendored-in ed25519-dalek crate for boot environment
Light-fingered changes include:

- debug UART integration for debugging things
- patching the sha2 crate to use hardware acceleration

Most changes are in Cargo.toml, with the exception of the debug.rs
module that was introduced for print-debugging.
2025-09-27 00:29:09 +08:00
bunnie
2f3cf06c16 helps to actually copy the data into the hash engine 2025-09-26 22:57:10 +08:00
bunnie
f76b85c95e signature checking now works
also some light benchmarking code.
2025-09-26 22:56:49 +08:00
bunnie
afba3040b3 cleanup print debugs in sha2 for bootloader 2025-09-25 16:13:25 +08:00
bunnie
a035bb669c add initial signature check code on bao1x 2025-09-25 16:13:09 +08:00
bunnie
c1ab8972fa update boot offsets to handle embedded signature block 2025-09-25 00:00:13 +08:00
bunnie
39142b4c18 add scaffolding for bao1x-boot and also the sha2 implementation for baremetal 2025-09-24 01:02:07 +08:00