Repository navigation
research(railgun): add Shell cryptography and hardware benchmarks - #235
0xterricola wants to merge 16 commits into
Conversation
Daybreak Blue — Independent Security Review Follow-upCompleted an independent, read-only review of the RAILGUN research implementation at Findings and follow-ups
Validation All four targeted native test suites pass. The unsigned Cortex-M33 firmware links successfully. The expanded QR report fits the 320-byte buffer in representative worst-case size testing. |
(cherry picked from commit 70e45fbb41cc5a5515b63a5dd0c364c8e20782f7)
(cherry picked from commit f6bcc9d31fa45187b0d207c52d9275af0cea25fb)
(cherry picked from commit e43cc52a754de15c2cc104a5f700b919333f43f5)
(cherry picked from commit 36ff99c00eed25ec92a8074278ae31c1824ffa2e)
(cherry picked from commit deca99e6c656db1a05226749931e40212733284f)
(cherry picked from commit f5ed427d9af991732e3ee998d21529382ce724c2)
(cherry picked from commit 5542d884ab1672ecd001d3ed18c2b354477d3171)
e9cccc7 to
0506470
Compare
|
Quick update following the initial hardware feedback: I've rebased PR #235 onto upstream The updated developer-signed firmware now boots successfully on my physical Shell. I also completed 10 consecutive hardware diagnostic runs using revision
I've updated the PR description with the full benchmark results, implementation details, and current limitations. |
Summary
Experimental RAILGUN cryptographic research for Keycard Shell, exploring the feasibility of executing RAILGUN-compatible arithmetic on the STM32H573 Cortex-M33 MCU using its hardware Public Key Accelerator (PKA).
Current status: Physical hardware validation completed — 10/10 runs passed, 50/50 diagnostic checks successful.
This is a research integration, not a production RAILGUN wallet implementation.
Implementation
Introduces the following experimental components:
On-device navigation
Extras → Kohaku Research → RAILGUN DiagnosticsThe diagnostics execute entirely on the Shell MCU, without accessing private keys or communicating with the Keycard secure element.
Maintainer Feedback and Firmware Updates
Following hardware feedback from @mikkoph:
v1.5.3.app/FreeRTOSConfig.hto the upstream configuration.stack_freefield from QR exports.An earlier experimental firmware build failed to boot on the maintainer's development device.
After these changes, the updated developer-signed firmware booted successfully on my physical Shell and completed all hardware diagnostics.
The exact cause of the original boot failure has not been independently isolated.
Validated revision:
0506470Physical Hardware Validation
Hardware: Keycard Shell (STM32H573)
Firmware base:
v1.5.3Revision:
0506470Test runs: 10 consecutive complete runs
Diagnostic checks: 50
Failures: 0
Benchmark Results
Observations
The
0 msboundary measurements reflect millisecond timer resolution, not zero computation time.Representative Hardware Output
{ "v": 1, "rev": "0506470", "bn64": {"s": "pass", "ms": 4}, "bnedge": {"s": "pass", "ms": 0}, "p6": {"s": "pass", "ms": 158}, "bj2": {"s": "pass", "ms": 2}, "bj256": {"s": "pass", "ms": 281} }Build and Test Validation
All four targeted native regression suites pass:
bignumrailgun_babyjubjubrailgun_poseidonrailgun_blake512The unsigned STM32H573 Cortex-M33 ELF also builds and links successfully.
Firmware Memory
text + data)data + BSS)These measurements include existing firmware infrastructure, including the camera framebuffer and memory pool.
The remaining RAM margin warrants consideration before expanding the implementation.
Custom FreeRTOS stack instrumentation has been removed to preserve upstream configuration compatibility.
Security Review and Limitations
Initial independent research review identified additional coverage requirements, including:
Regression coverage was added for the relevant arithmetic cases.
This work does not provide:
The public-scalar arithmetic implementation is variable-time and must not be reused for secret scalars without further security engineering.
Hardware validation confirms the tested public-vector arithmetic operations only. It does not establish production readiness or long-term hardware reliability.
Current Status
v1.5.3Open Questions / Next Steps
I'd appreciate maintainer feedback on whether these diagnostics are useful to retain upstream as experimental research.
Areas where guidance would be especially valuable:
I'd prefer to align on the architecture and scope before expanding the implementation further.
Status: Draft — experimental cryptographic research, not production wallet functionality.