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.
For a secure boot implementation, this barely beats SLH-DSA in code size + public key size + signature size. For an application where long-term security is critical, I would strongly prefer a hash-based scheme (SLH) over a lattice-based scheme (Falcon).
Falcon does, however, win pretty dramatically in verification time, which will be important for some but not all applications. (Plenty of microcontroller applications would be fine with taking an extra second to boot as long as they mostly stay booted, entering a low-power mode instead of being turned off.)
FWIW, depending on how everything is laid out in ROM/flash and what parts of ROM/flash are covered by which hardware protections, there may be no security benefit to verifying the signature at boot time as opposed to verifying it at update time. If you can get away with storing a simple hash of a next-stage boot slot in a tamper-resistant area, then you can verify a signature in the trusted code that writes a new hash to the boot slot's descriptor.
In this case, I think Falcon loses basically all its advantages. The highly-secure storage needs to store the hash verifier, a hash per boot slot, and a public key or a public key hash. SLH public keys are already very short. The SLH verifier itself (which does not necessarily need to be stored in flash at all) is very little code beyond the underlying hash. The SLH signature is pretty big, but there is no particular need to store it in flash. The main downside is adding ~1s to the time needed for the actual update operation.
BUT!
All of the above assumes a software implementation. Most of Falcon verification is likely to be done as ordinary software. Most of SLH verification's cost is hash function evaluation, and a whole lot of current-gen microcontrollers have SHA-256 in hardware. And I think that also kills the time advantage of Falcon. (There's a bonus factor of 2 for the SHA-256 variants of SLH if the hardware gives a prepared-prefix SHA-256 operation, which is reasonably common - you get it naturally if the exposed operation is the compression function.)
So I would pretty strongly favor SLH-DSA-SHA2-128s for code signing :)
Very good point, prior to settling on FN-DSA I dug into LMS based on the NIST guidelines (LMS is awful). I was under that hash signing schemes were generally stateful so its nice to see SLH-DSA bucks that trend! I'll definitely look into supporting it!
Verifying at update time can be challenging and there's all sorts of atomicity issues, plus tamper evident storage usually means you are going to be needing some kind of signing or at least AEAD (which actually isn't too bad on hardware).
For the design of microtun-boot I choose to copy mcuboot architecturally, with modern boot rom and otp roots of trust perhaps its a dated design but I thought it was probably the most foolproof way of shipping something.
I've been involved in a lot of x86-specific architectural and security discussions, and for quite a few years I've thought that the whole Secure Boot architecture is ridiculous.
If I were designing a system along these lines, and I had the ability to influence the hardware design, I would do it very differently, like so:
Define a "super-secure" area of flash at the beginning. It has the rule that it's unlocked at reset and that it can be locked. Once locked, nothing (not SMM, not TrustZone, not magic hardware features, not debug -- literally nothing) can write to it until the next full reset. Furthermore, as added hardening, the non-super-secure flash cannot be executed until super-secure is locked.
In super-secure goes a small bootloader and descriptors for at least two boot slots, where each descriptor contains a hash and the location and length of the slot. (The slot's data lives in normal flash.) There is also a reference to an area of flash that can contain an update request.
On boot, the super-secure bootloader checks whether an update is requested, which it does by reading the data referenced by the update request descriptor. If there is one, it processes the update, which it does by reading the update data's hash, verifying the signature, copying the update data to the target boot slot [0] and then writing the verified hash to the corresponding super-secure descriptor.
Then the loader chooses a boot slot to boot, reads the (secure!) hash, verifies it against the data to be booted, sets the super-secure lock bit, and jumps.
In the modern world, I would formally verify the entire secure loader implementation -- it would be very little code and I think it's well within the scope of what current tools cal do.
This completely removes the exposure where untrustworthy code can try to directly attack running TrustZone or SMM code. And it completely removes the exposure where an attacker can try to bypass a complex flash locking scheme to write to supposedly secure space (I've lost count of how many times the latter has happened). (Keep in mind that, in the Secure Boot design as implemented in TianoCore, the OS can literally call into more-privileged code that is allowed to write to secure storage. Securing this is hard, and it's basically impossible given the outrageously low code quality of TianoCore.)
With this design, if you want to do something involving writing to secure storage, you first serialize the request and write it to ordinary insecure storage. Then you do a full reset, which means that the code with actual secure-write permission is running from a truly clean slate.
In this design, there is no point to verifying a signature at boot, as the hash is stored with equal security as the code verifying the hash.
[0] The copy is actually optional. An alternative design would be for non-secure code to put the data in its final location and then ask super-secure to just update the descriptor. This makes the super-secure code simpler but it’s also more fragile.
The git history was squashed prior to public release, this is a solid couple months of human labor.
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.
Maybe I am misunderstanding what this fixes, but doesn't this project work towards ensuring esp32's have a chain of trust implementation that uses crypto primitives which are considered safer after anthropic crypto releases earlier this week?
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 general argument is that the ESP32 and RP2350 boot roms implement similar functionality so why build an abstraction when you can just work directly with the vendor tools?
Quoting from elsewhere:
> The same could be said about U-Boot, MCUboot or wolfBoot. Microtun boot targets more than just the ESP32. Any chip with signature verification implemented in its boot rom (so that we can establish a trust root) can be targeted.
> Then there's the portable firmware image format, microtun-boot distributes updates as signed MCUboot TLV images.
> I'm personally working on an application that targets both the ESP32 and PICO 2W boards.
I'm working on a zero trust networking solution for the internet of things and needed a cross platform implementation of secure boot. Right now it supports the ESP32 (RISC-V) and Raspberry Pi Pico 2 but support for the STM32H573 (ST-iROT) is planned.
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!
Still waiting for HW roots of trust with PQ signature support to become commonly available.
Unfortunately it will probably be a number of years until that hardware IP finally makes its way into low cost / low power processors.
Post quantum signatures are huge, how much boot time does that cost on a pico
Compact signatures are the selling point of FALCON [1], for fn-dsa-512 (signatures: 666B, keys: 897B).
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...
For a secure boot implementation, this barely beats SLH-DSA in code size + public key size + signature size. For an application where long-term security is critical, I would strongly prefer a hash-based scheme (SLH) over a lattice-based scheme (Falcon).
Falcon does, however, win pretty dramatically in verification time, which will be important for some but not all applications. (Plenty of microcontroller applications would be fine with taking an extra second to boot as long as they mostly stay booted, entering a low-power mode instead of being turned off.)
FWIW, depending on how everything is laid out in ROM/flash and what parts of ROM/flash are covered by which hardware protections, there may be no security benefit to verifying the signature at boot time as opposed to verifying it at update time. If you can get away with storing a simple hash of a next-stage boot slot in a tamper-resistant area, then you can verify a signature in the trusted code that writes a new hash to the boot slot's descriptor.
In this case, I think Falcon loses basically all its advantages. The highly-secure storage needs to store the hash verifier, a hash per boot slot, and a public key or a public key hash. SLH public keys are already very short. The SLH verifier itself (which does not necessarily need to be stored in flash at all) is very little code beyond the underlying hash. The SLH signature is pretty big, but there is no particular need to store it in flash. The main downside is adding ~1s to the time needed for the actual update operation.
BUT!
All of the above assumes a software implementation. Most of Falcon verification is likely to be done as ordinary software. Most of SLH verification's cost is hash function evaluation, and a whole lot of current-gen microcontrollers have SHA-256 in hardware. And I think that also kills the time advantage of Falcon. (There's a bonus factor of 2 for the SHA-256 variants of SLH if the hardware gives a prepared-prefix SHA-256 operation, which is reasonably common - you get it naturally if the exposed operation is the compression function.)
So I would pretty strongly favor SLH-DSA-SHA2-128s for code signing :)
Very good point, prior to settling on FN-DSA I dug into LMS based on the NIST guidelines (LMS is awful). I was under that hash signing schemes were generally stateful so its nice to see SLH-DSA bucks that trend! I'll definitely look into supporting it!
Verifying at update time can be challenging and there's all sorts of atomicity issues, plus tamper evident storage usually means you are going to be needing some kind of signing or at least AEAD (which actually isn't too bad on hardware).
For the design of microtun-boot I choose to copy mcuboot architecturally, with modern boot rom and otp roots of trust perhaps its a dated design but I thought it was probably the most foolproof way of shipping something.
Thanks for the great feedback.
I've been involved in a lot of x86-specific architectural and security discussions, and for quite a few years I've thought that the whole Secure Boot architecture is ridiculous.
If I were designing a system along these lines, and I had the ability to influence the hardware design, I would do it very differently, like so:
Define a "super-secure" area of flash at the beginning. It has the rule that it's unlocked at reset and that it can be locked. Once locked, nothing (not SMM, not TrustZone, not magic hardware features, not debug -- literally nothing) can write to it until the next full reset. Furthermore, as added hardening, the non-super-secure flash cannot be executed until super-secure is locked.
In super-secure goes a small bootloader and descriptors for at least two boot slots, where each descriptor contains a hash and the location and length of the slot. (The slot's data lives in normal flash.) There is also a reference to an area of flash that can contain an update request.
On boot, the super-secure bootloader checks whether an update is requested, which it does by reading the data referenced by the update request descriptor. If there is one, it processes the update, which it does by reading the update data's hash, verifying the signature, copying the update data to the target boot slot [0] and then writing the verified hash to the corresponding super-secure descriptor.
Then the loader chooses a boot slot to boot, reads the (secure!) hash, verifies it against the data to be booted, sets the super-secure lock bit, and jumps.
In the modern world, I would formally verify the entire secure loader implementation -- it would be very little code and I think it's well within the scope of what current tools cal do.
This completely removes the exposure where untrustworthy code can try to directly attack running TrustZone or SMM code. And it completely removes the exposure where an attacker can try to bypass a complex flash locking scheme to write to supposedly secure space (I've lost count of how many times the latter has happened). (Keep in mind that, in the Secure Boot design as implemented in TianoCore, the OS can literally call into more-privileged code that is allowed to write to secure storage. Securing this is hard, and it's basically impossible given the outrageously low code quality of TianoCore.)
With this design, if you want to do something involving writing to secure storage, you first serialize the request and write it to ordinary insecure storage. Then you do a full reset, which means that the code with actual secure-write permission is running from a truly clean slate.
In this design, there is no point to verifying a signature at boot, as the hash is stored with equal security as the code verifying the hash.
[0] The copy is actually optional. An alternative design would be for non-secure code to put the data in its final location and then ask super-secure to just update the descriptor. This makes the super-secure code simpler but it’s also more fragile.
Keygen and signing needing FP doesn't sound ideal.
But I suppose embedded devices are mostly verification (and keygen once if ever).
It looks like NIST is looking towards the usage of fixed-point arithmetic [1] in the final standard (for keygen and signing).
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...
This is quite brilliant, matching MCUboot's format!
This is really cool!
LLM generating a source available project then slapping a non-commercial/contact for commercial use license on it is an interesting choice
The git history was squashed prior to public release, this is a solid couple months of human labor.
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.
The times are such that you can just ask for things.
‘Break P-256 ECC’, somewhere in a frontier lab, probably
‘Implement a bootloader with post quantum image signatures’, two days ago, anywhere
Talk about a problem that didn’t need solving
Maybe I am misunderstanding what this fixes, but doesn't this project work towards ensuring esp32's have a chain of trust implementation that uses crypto primitives which are considered safer after anthropic crypto releases earlier this week?
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 general argument is that the ESP32 and RP2350 boot roms implement similar functionality so why build an abstraction when you can just work directly with the vendor tools?
Quoting from elsewhere:
> The same could be said about U-Boot, MCUboot or wolfBoot. Microtun boot targets more than just the ESP32. Any chip with signature verification implemented in its boot rom (so that we can establish a trust root) can be targeted.
> Then there's the portable firmware image format, microtun-boot distributes updates as signed MCUboot TLV images.
> I'm personally working on an application that targets both the ESP32 and PICO 2W boards.
I'm working on a zero trust networking solution for the internet of things and needed a cross platform implementation of secure boot. Right now it supports the ESP32 (RISC-V) and Raspberry Pi Pico 2 but support for the STM32H573 (ST-iROT) is planned.
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!