ThePassionate opened a new pull request, #21624:
URL: https://github.com/apache/nuttx/pull/21624

   ## Summary
   
   Add `include/crypto/asn1.h`, a small self-contained DER reader/writer 
covering the ASN.1 subset that RSA keys need:
   
   * tag and length parsing and writing (including the long-form length)
   * INTEGER values
   * MPI values: big-endian, unsigned, with the leading-zero stripping and the 
0x80 sign-extension byte handled on both read and write
   
   The helpers only depend on `errno.h`, `string.h` and `sys/endian.h`.
   
   ## Impact
   
   * New header only. Nothing includes it yet and no build system file changes, 
so no configuration or behavior change for any existing build.
   * The header is a prerequisite for the crypto transport drivers (rpmsg / 
virtio / vhost crypto) that receive RSA keys as DER blobs and need to split 
them into n, e, d, p, q, dp, dq and qinv before handing them to the bignum 
layer. Those drivers are prepared as separate PRs and will be the first users.
   
   ## Testing
   
   * `tools/checkpatch.sh -c -u -m -g $(git merge-base origin/master 
HEAD)..HEAD` passes (nxstyle, codespell and commit message checks).
   * Host compile of the header in the full NuttX include context: `gcc 
-fsyntax-only -Wall` with the sim:crypto configuration header, no warnings.
   * The same helper code is used in production by the Xiaomi Vela tree, where 
it parses the RSA keys handed to the rpmsg and virtio-crypto transports.
   


-- 
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]

Reply via email to