netutils/dropbear: back chacha20-poly1305 with NuttX /dev/crypto - #3664
Merged
acassis merged 1 commit intoJul 26, 2026
Merged
Conversation
Replace the bundled libtomcrypt chacha20-poly1305 implementation with an adapter that drives the NuttX crypto device: the SSH construction maps onto CRYPTO_CHACHA20_DJB (the original 64-bit counter/nonce ChaCha20 parameterization used by chacha20-poly1305@openssh.com) for the packet length and payload streams, and onto CRYPTO_POLY1305 for the authentication tag (plain MACs are driven in two steps through /dev/crypto: COP_FLAG_UPDATE feeds the data, a final call retrieves the tag). Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
cederom
approved these changes
Jul 25, 2026
cederom
left a comment
Contributor
There was a problem hiding this comment.
Thank you @FelipeMdeO :-)
cederom
requested review from
acassis,
linguini1,
raiden00pl,
simbit18 and
xiaoxiang781216
July 25, 2026 11:18
xiaoxiang781216
approved these changes
Jul 25, 2026
acassis
approved these changes
Jul 25, 2026
Contributor
Author
|
Hello @simbit18 , do you know what is this pipeline issue? |
Contributor
@FelipeMdeO @simbit18 I issued Re-run task and it still failing |
Contributor
|
Since the issue is in CI and not in PR, I think it is safe to merge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace Dropbear's bundled libtomcrypt
chacha20-poly1305implementation withan adapter that drives the NuttX crypto device (
/dev/crypto). The SSHchacha20-poly1305@openssh.comconstruction maps ontoCRYPTO_CHACHA20_DJB(the original 64-bit counter/nonce ChaCha20 parameterization the protocol
uses) for the packet-length and payload keystreams, and onto
CRYPTO_POLY1305for the authentication tag. Plain (non-HMAC) MACs are driven in two steps
through
/dev/crypto:COP_FLAG_UPDATEfeeds the data, then a final callretrieves the tag. The bundled
chachapoly.cis dropped from the build.This is the successor to the merged
hmac-sha2-256adapter (#3640).Impact
NETUTILS_DROPBEARis enabled; then thechacha20-poly1305@openssh.comcipher runs through/dev/cryptoinstead ofthe bundled libtomcrypt code.
NETUTILS_DROPBEARnow depends on the cryptodev options above.Testing
Tested on the NuttX simulator (
sim:dropbear) and on realSTM32F746G-DISCO hardware. A host OpenSSH client connects forcing
chacha20-poly1305@openssh.com, so the new adapter (cipher + embedded Poly1305tag) runs on every packet.
STM32F746G-DISCO (software
/dev/cryptobackend)Board side (serial console):
PC side (note
cipher: chacha20-poly1305@openssh.comnegotiated in bothdirections):