lowRISC / lowRISC/opentitan

[rom,refactor] Behavior of getting SPX key when SPX is disabled

Open
#22,926 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
SystemVerilog
Stars
3.6k
Forks
1.1k
Avg merge
2d 22h
Merged PRs (30d)
141

Description

### Description

The `sigverify_spx_key_get` is the function ROM uses to get the SPX public key. When SPX is disabled, the function returns OK while the key pointer is set to NULL.

https://github.com/lowRISC/opentitan/blob/605da270ddcf70b2af5573e9524f9613bc89383d/sw/device/silicon_creator/rom/sigverify_keys_spx.c#L15-L38

---

Although this branch is currently unused in ROM, for a clearer API design, I would like to suggest returning an error when the SPX is disabled instead, so the function always returns a valid non-null key pointer when the status code is OK.

Contributor guide

Open the contributing guide

Research direction

Start by reading sigverify_keys_spx.c, especially sigverify_spx_key_get and the linked lines, to understand the disabled-SPX branch and its status return. Confirm the API behavior for disabled SPX and verify that an OK result always corresponds to a non-null key pointer.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
cryptography, security
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.