Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] SLH-DSA Updates for Earl Grey #23144

Closed
moidx opened this issue May 16, 2024 · 4 comments
Closed

[RFC] SLH-DSA Updates for Earl Grey #23144

moidx opened this issue May 16, 2024 · 4 comments
Assignees

Comments

@moidx
Copy link
Contributor

moidx commented May 16, 2024

Description

This document proposes updates to the SLH-DSA (Sphincs+) implementation used in secure boot to provide configuration options that will simplify integration with offline and cloud based code signing infrastructure, while providing additional performance improvements in secure boot.

@moidx moidx self-assigned this May 16, 2024
@moidx moidx added this to the Earlgrey-PROD.ROM milestone May 16, 2024
@andreaskurth andreaskurth added the RFC:TC Review tagging as requesting review from Technical Committee label May 16, 2024
@jadephilipoom jadephilipoom added the Hotlist:Security Security Opinion Needed label May 17, 2024
@jadephilipoom
Copy link
Contributor

Here's some context that might be helpful:

  • SPHINCS+ supports parameter sets with either SHAKE or SHA-2 as the underlying hash function.
  • The current implementation uses SHAKE, although the reasons for that are not super strong. They include:
    • for signing or keygen in the future we'd want to use SHAKE, since it has SCA protection
    • NIST was previously considering dropping the SHA-2 parameter sets, but has since decided to keep them, so this no longer really matters
    • the algorithm instantiation is a little more ergonomic for SHAKE than SHA2; while the SHAKE version just uses SHAKE for everything, the SHA2 version needs HMAC and MFG1 as well.
  • Now, there are some reasons emerging why we may want to use SHA-2 instead, or at least make it possible:
    • signing infrastructure might support SHA-2 faster than it supports SHAKE
    • SHA-2 is slightly faster than SHAKE on OpenTitan because the implementation is not masked (10.5ms vs 12.5ms based on some quick ballpark benchmarks)

In addition to the SHAKE vs SHA-2 question, there's a separate but related question: should we allow a "pre-hashed" option (via an OTP setting or similar) in which the message we sign with SPHINCS+ is the hash of the ROM_EXT image, rather than the image directly? If we did this and used SHA-2, it would reduce boot time for large images because ECDSA and SPHINCS+ could use the same digest (although arguably it would also have an effect on the fault attack difficulty -- see the doc for some discussion).

I'm a little ambivalent on these options myself to be honest; I think there aren't a lot of terrible choices here, and the balance to strike is keeping ROM code as simple as possible while also retaining flexibility as much as we can. Either way, though, if we want to make it for ROM freeze we need to decide on this one pretty quickly. It's a not huge but also not trivial amount of implementation effort.

@moidx moidx added RFC:Approved and removed RFC:Proposal RFC:TC Review tagging as requesting review from Technical Committee labels Jun 3, 2024
@johannheyszl
Copy link
Contributor

removing Hotlist label since approved by TC

@timothytrippel
Copy link
Contributor

Can this be closed now?

@jadephilipoom
Copy link
Contributor

Yes! I thought that "Resolves" would link it in this comment but I guess it didn't: #23765 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants