ThePassionate opened a new pull request, #4113: URL: https://github.com/apache/nuttx-apps/pull/4113
## Summary `mbedtls_aes_crypt_ofb()/cfb128()/cfb8()` in the cryptodev `aes_alt` open a fresh session for every call, and the driver keeps the advanced IV to itself in these modes, so `iv[]` stayed at its initial value and a message split over several calls restarted the stream each time. Derive the next `iv[]` from the data after the call, the way `mbedtls_aes_crypt_cbc()` already does: * CFB128 chains on the last ciphertext block, * CFB8 on the last 16 bytes of `iv || ciphertext`, * OFB on the last keystream block, i.e. `output ^ input`. For CFB128/OFB this is only done when the call ends on a block boundary; continuing after a partial block is still not supported. Also set `crypt.ivlen` for these modes: the virtio crypto device only consumes the IV of a request when the length is given. ## Impact `apps/crypto/mbedtls` alt layer only. ## Testing Build-tested with sim:sim/crypto and `CONFIG_CRYPTO_MBEDTLS`; the existing crypto tests still pass. Not run on a virtio device. -- 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]
