ThePassionate opened a new pull request, #4071:
URL: https://github.com/apache/nuttx-apps/pull/4071
## Summary
Extend the `rsa` test with a case for private keys given as n/e/d only,
without the CRT components:
* A 2048-bit n/e/d key signs SHA-256("abc") with PKCS#1 v1.5 through
CRK_MOD_EXP (the d-only path, which must fall back to plain x^d mod n - no CRT).
* The signature is cross-checked byte-for-byte against a python cryptography
reference implementation (independently re-computed with pow()).
* The signature is then verified through CRK_RSA_PKCS15_VERIFY, and a
tampered signature must be rejected.
Also generalizes the key handling of the existing cases (heap buffers
instead of fixed arrays) and replaces the 4-byte-alignment-dependent byte order
helper with a plain reverse.
## Impact
* Testing only; no functional change to cases 1 and 2.
## Testing
Depends on apache/nuttx#21939 (the constant-time RSA core). On
sim:sim/crypto with that kernel PR:
```
rsa test case 1 success
rsa test case 2 success
rsa test case 3 success <- the new d-only case
rsa test success
```
All three cases complete in well under a second; on plain master case 1
alone needs ~25 minutes and case 2 does not finish.
`tools/checkpatch.sh -c -u -m -g <base>..HEAD` (via the paired nuttx tree)
passes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]