83 points · by dpeckett · 16h ago · 29 comments
> Two independent keys protect the chain: the ROM checks microtun boot against the secp256k1 key in OTP,
> and microtun boot checks the application against the FN-DSA-512 (fn-dsa-512-exp) keys compiled into it.
So this is a chained bootloader, break secp256k1 and you can replace the microtun-boot bootloader in flash and the post-quantum signature check never even runs. That makes this entire bootloader pointless - either the attacker can modify flash and thus just remove your bootloader or you assume flash can only changed by the running program in which case you should check the signature of the firmware update at flash time, not during boot. It also doesn't seem to provide any of the features you'd want in such a bootloader, like encryption support or remote attestation.
In theory you could put this bootloader into OTP, but unfortunately the RP2350's bootrom is not designed for that at all. You basically lose all other boot options + hibernate if you do that, if you can manage to fit everything into OTP at all. Right now this bootloader seems to be around 60 KiB while the OTP has a bit under 8 KiB of free space available. I've written about the bootrom shortcomings a bit before on the raspberry forum: https://forums.raspberrypi.com/viewtopic.php?p=2312790#p2312...
I haven't looked at the ESP32 stuff, but I'm guessing it's going to have very similar issues.
We'll have to see if secp256k1 holds up differently than secp256r1 (P-256) but I'm going to assume the Pico 2's secure boot is thoroughly broken and we'll need a new silicon rev.
micro-ecc supports P-384, so maybe there's a reasonable boot rom migration path for the raspberry pi folks.
Unfortunately it will probably be a number of years until that hardware IP finally makes its way into low cost / low power processors.
There is OpenSK and OpenTitan made by Google originally - I suppose if there was a small USB stick sized thing with an arm CPU that was hardened to physical attacks you could maybe DIY something reasonably secure
Makes me wonder what Yubico is using for their beta of a supposedly quantum safe Yubikey
Benching fn-dsa-512 (NIST Level 1) on the Pico 2,
SIGNATURE VERIFICATION: 4.8ms (1.1ms pub key decoding + 3.7ms verification)
TOTAL SRAM: ~7KiB
As long as FALCON survives standardization, there's no way it doesn't become popular. Signing is a bit more expensive though so let's see if that holds it back.
1. https://csrc.nist.gov/csrc/media/Presentations/2024/falcon/i...
But I suppose embedded devices are mostly verification (and keygen once if ever).
It's early days in the post-quantum space so I guess these kind of teething issues are expected.
1. https://groups.google.com/a/list.nist.gov/g/pqc-forum/c/7z-y...
Yes LLMs were used, but also there was a ton of human design input (nothing agentic), lots of hardware-in-loop testing, and a good dash of manual refactoring.
The way I see it, LLMs just mean the quality bar has been lifted for everyone.
Vibe coded one-shots probably aren't worthy of copyright protection.
‘Break P-256 ECC’, somewhere in a frontier lab, probably
‘Implement a bootloader with post quantum image signatures’, two days ago, anywhere
Or are you implying that there isn't a need to move to post quantum crypto on esp32, or that the esp32 shouldn't have chain of trust implementation?
The ESP32 implementation has probably survived the latest security advisory, Espressif choose to thankfully use RSA 3072 in their trust root. The Raspberry Pi Pico 2 is more ambiguous as its based on secp256k1 (like bitcoin) which is 256-bit ECC.
FALCON (fn-dsa) is an incredible signature scheme, sadly its only experimental atm and standardization seems to be delayed. I actually ended up saving ~20KiB of flash versus a legacy P-256 implementation. Little more memory hungry but very modest. I am certain fn-dsa will come to dominate in this space.
If this is the kind of engineering that interests you, whether it's embedded systems, Rust, networking, or making unconventional things work together, I'd love to connect. I'm always looking for like-minded collaborators, especially people interested in building something together in the industrial IoT space, potentially even as co-founders. Feel free to reach out!
Curious about the planned STM32H573 (ST-iROT) port: do you plan to keep verification purely in software in the bootloader stage, or offload parts like SHAKE256/hashing to hardware crypto peripherals where available?
If I implement SLH-DSA support then presumably I'll have to use the SHA accelerator at some point for acceptable performance.
FN-DSA in software is totally fine for now (but it does look like the newer STM32 variants do have SHAKE256 acceleration).
Unfortunately ST-iROT is also P-256 based so is probably cooked for now.