ThePassionate opened a new pull request, #4007: URL: https://github.com/apache/nuttx-apps/pull/4007
## Summary Five test additions for algorithms the software crypto driver already supports, in the same plain `main()` style as the existing tests: * **Poly1305 MAC** (new `poly1305` test): the RFC 8439 section 2.5.2 and A.3 test vectors, each run twice - one-shot and as a 1-byte + rest split - 24 checks. * **CAST-128 CBC** (new `castcbc` test): the RFC 2144 B.1 vectors with 128/80/40-bit keys, encrypt and decrypt directions compared against the expected output. * **Blowfish CBC** (new `blfcbc` test): six standard vectors, each run as a one-shot operation and as an 8-byte-per-block `COP_FLAG_UPDATE` chain; key lengths outside 4..56 bytes are rejected at session creation. * **HMAC-SHA384, HMAC-SHA512 and HMAC-RIPEMD160**: the `hmac` test gains the three algorithms on the five inputs it already uses. The HMAC-SHA224 expected values are intentionally left untouched; a separate PR (#3996) fixes them. * **SHA-384 and RIPEMD-160**: the `hash` test gains the two algorithms. Following the per-algorithm DISABLE pattern of that file, `TESTING_CRYPTO_HASH_DISABLE_SHA384` and `TESTING_CRYPTO_HASH_DISABLE_RIPEMD160` are added. ## Impact * Testing only, no functional change. * New options `TESTING_CRYPTO_POLY1305`, `TESTING_CRYPTO_CAST_CBC`, `TESTING_CRYPTO_BLF_CBC` (default n) and the two DISABLE switches inside the hash test. ## Testing Board: sim:crypto, nuttx master 66bad554049, this branch on top of apps master ee3d67104. ``` nsh> poly1305 OK test vector 0..11 (one-shot) OK test vector 0..11 (1-byte + rest split) poly1305: all tests passed nsh> castcbc OK test vector 0..2 (encrypt + decrypt) castcbc: all tests passed nsh> blfcbc OK test vector 0..5 (one-shot + 8-byte COP_FLAG_UPDATE chain) OK invalid key length 4 rejected OK invalid key length 57 rejected blfcbc: all tests passed nsh> hmac hmac md5/sha1/sha224/sha256 success (5 each, pre-existing) hmac sha384 success (5) hmac sha512 success (5) hmac ripemd160 success (5) nsh> hash (pre-existing md5/sha1/sha224/sha256/sha512, huge-block and unaligned cases pass) hash sha384 success (3) hash ripemd160 success (8) ``` All expected values are transcribed from the corresponding RFCs / reference vectors and were cross-checked byte-by-byte during extraction. `tools/checkpatch.sh -c -u -m -g ee3d67104d..HEAD` 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]
