Show HN:用于 ESP32 和 Pico 2 的后量子安全启动
Show HN: Post-quantum secure boot for the ESP32 and Pico 2

原始链接: https://github.com/microtun/microtun-boot

microtun boot 是一个实验性的 Rust 安全启动引导程序,采用 MCUboot 的闪存镜像格式,并使用基于 SHA-256 的 FN-DSA-512 后量子签名。它在每次启动时验证应用,执行待处理的升级,并拒绝无效、加密或压缩的镜像。签名需要 microtun-signer;imgtool 和原版 MCUboot 无法处理这些镜像。支持的升级模式包括带暂存区的交换模式、仅覆盖模式和直接 XIP 模式,并支持降级防护、最低版本、防回滚计数器和 imgtool VID/CID 检查等策略。支持的目标平台包括 ESP32-C3/C5/C6、RP2350 Pico 2 开发板以及用于测试的 QEMU。它独立于 MCUboot,面向原型开发;在产品中使用前请阅读 SECURITY.md 和 THREAT-MODEL.md。环境准备需要 Rust 1.95+、imgtool 和 microtun-signer。从 board/example 目录使用 cargo run --release 构建并烧录;NO_FLASH=1 会在签名后停止。构建嵌入式镜像时避免使用 cargo build --workspace。测试使用主机测试、QEMU 回归测试和开发板冒烟测试。参与贡献需要签署 CLA。许可采用源码可用的 PolyForm Noncommercial 或单独的商业协议。

HN 帖子讨论了“microtun boot”,这是一个面向 ESP32 和 Raspberry Pi Pico 2 的跨平台安全启动项目,使用后量子 FN-DSA-512 签名和兼容 MCUboot 的镜像。作者为零信任物联网网络构建了它,并报告称在 Pico 2 上验证很快:约 4.8 毫秒、约 7 KiB SRAM,闪存占用也小于 P-256。 批评者指出,Pico 2 并非真正的端到端后量子方案:其 ROM 仍以 secp256k1 作为信任锚点,因此攻破该算法可能绕过 FN-DSA 环节。他们还质疑启动时验证相较于更新时检查的价值,并讨论了安全闪存、OTP 限制、物理攻击和闪存加密。ESP32 的 RSA-3072 信任根被认为更具韧性,而计划中的 STM32H573 支持面临 P-256 信任根问题。 评论者围绕 FN-DSA 与基于哈希的 SLH-DSA 展开争论,一些人尽管认为其验证较慢,仍出于长期安全性偏好 SLH。另一些人质疑许可证和 AI 辅助开发;作者表示,其中包含了数月的人工设计和硬件测试。
相关文章

原文

microtun boot mascot: a microchip superhero with a security shield climbing toward an upgrade arrow

A secure boot bootloader written in Rust, using MCUboot's on-flash formats (image header, TLVs, trailer) with a post-quantum signature. On every boot it authenticates the application before starting it, carries out any pending upgrade, and never boots an image that fails verification.

  • Signatures: FN-DSA-512 over SHA-256 only, using microtun-signer's experimental fn-dsa-512-exp profile (pre-standard FIPS 206 draft). Images are built by imgtool and signed by the board tools through microtun-signer; imgtool and stock MCUboot cannot sign or verify them. Encrypted and compressed images are rejected.
  • Upgrade strategies: swap-using-scratch (test/permanent, revert, power-fail resume), overwrite-only, direct-XIP with or without revert.
  • Policy: downgrade prevention, minimum version, hardware security counter (anti-rollback; temporarily disabled on ESP32-C5), imgtool --vid/--cid.
  • Boards: ESP32-C3, ESP32-C5, ESP32-C6, RP2350 Pico 2 / Pico 2 W and QEMU (tests only); see the board index.

microtun boot is an experimental prototype and an independent project, not affiliated with MCUboot. Read SECURITY.md and THREAT-MODEL.md before using it in a product.

  • Run an application on a released bootloader: follow a blinky example.
  • Build and flash your own bootloader: follow the board index.
  • Try it without hardware: use the QEMU board.

You need Rust 1.95+, imgtool and the microtun-signer CLI (0.16+) on your PATH. Each board README lists its Rust target and any extra tools.

python3 -m pip install imgtool
cargo test            # host-side tests; no hardware needed

All signing goes through microtun-signer, using development keys on your machine by default or a signer service for release keys. See SIGNING.md.

Build embedded images from inside a board or example directory, which selects the right target. cargo run --release there builds, signs and flashes; NO_FLASH=1 stops after signing:

cd boards/esp32-c3-mini-1/firmware
NO_FLASH=1 cargo run --release

Never use cargo build --workspace for embedded images: it mixes incompatible targets.

microtun-boot-hil flashes complete boot chains and checks the boot output. The full regression suite runs under QEMU; physical boards run a smoke suite and need an expendable board.

Contributions are welcome. Before a contribution can be merged, the contributor must complete the applicable Contributor License Agreement (CLA). Contributions made on behalf of an employer or other organization may also require an entity CLA or equivalent authorization. See CONTRIBUTING.md, the Individual CLA, and the Entity CLA for details.

microtun boot is dual-licensed:

  • Noncommercial license: the PolyForm Noncommercial License 1.0.0, including its provisions for qualifying noncommercial organizations. This is a source-available license, not an open-source license.
  • Commercial license: a separate written agreement, available on request. Commercial rights come only from that agreement, not from the PolyForm Noncommercial License and not merely from making a request.
联系我们 contact @ memedata.com