-
Notifications
You must be signed in to change notification settings - Fork 870
[opentitantool] SPHINCSPLUS refactoring #23730
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
Conversation
TODO:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This approach LGTM!
f960793
to
b2604bc
Compare
I've added domain handling to the I've also rewritten the headers on the existing PEM files to identify the keys as Passing CI is an effective test with the ROM. I've also tested with the HSM, although in order to do that, I need to change the version of the reference implementation we import to the ref-impl's |
915bad0
to
4b8343c
Compare
0a03c48
to
e40555e
Compare
Signed-off-by: Chris Frantz <cfrantz@google.com>
Rework the sphincsplus build to permit linking in multiple algorithm variants without C symbol clashes. 1. Patch the sphincsplus C library to allow namespacing the relevant symbol names. Since C does not have namespaces, we use the C preprocessor to token-paste a prefix onto the symbols. 2. Supply the namespace prefix in the `cc_library` build rules. Signed-off-by: Chris Frantz <cfrantz@google.com>
1. Refactor the low-level interface into a macro that can access the low-level C functions for each algorithm variant we want to support. 2. Refactor key types to carry the algorithm variant along with the key material. 3. Save the algorithm name into the PEM files used for saving key material to disk. Prefix the name with `RAW:` to convey that the PEM files are just raw bags of bytes with no internal structure. Signed-off-by: Chris Frantz <cfrantz@google.com>
… crate Signed-off-by: Chris Frantz <cfrantz@google.com>
Rewrite the SPX PEM key labels to identify the Sphincs+ algorithm variant for the keys. Signed-off-by: Chris Frantz <cfrantz@google.com>
The CI test failure is not related to this change. |
Refactor the SPHINCSPLUS library to support multiple algorithm variants.
cc_library
andrust_bindgen
rules through thedefines
orclang_flags
attributes of those rules.2a. Create an enum whose discriminants are the sphincsplus algorithm names. Create a
macro_rules!
macro that can expand an implementation for each discriminant that invokes the corresponding per-algorithm functions supplied by (1).2b. Create
Spx{Public,Secret}Key
structs to hold key material and their associated algorithm names. Create nice associated functions on these key types that provide nice interfaces to the lower-level functions supplied by (2a).2c. Add
{Encode,Decode}Key
traits that can serialize the key material to/from PEM files. Save the algorithm name into the PEM file so that when keys are loaded from files, they key material will get associated with the correct implementation functions.spx
module in favor of using the newsphincsplus
crate directly.