crypto/chachapoly: add chacha20 stream cipher API#19319
Conversation
Expose chacha20 keystream operations on top of the private chacha implementation, so flat-build applications such as an SSH server can reuse the kernel cipher for the chacha20-poly1305 construction. Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
|
@FelipeMdeO but userspace apps(dropbear) should invoke crypto module through |
Hello @xiaoxiang781216 , I agree with you, I tried this approach to avoid change and maybe crash the crypto lib. But let me try follow your suggestion. Give me some time to try implement and test. |
|
Hello @xiaoxiang781216 I was able to "integrate" chacha into /dev/crypto using enviroments different than espressif. When I enable On the NuttX side they are in Note that How to reproduce on masterUsing a plain WiFi defconfig, no Dropbear and no extra patches: In menuconfig, enable: Then run |
|
Hello, please, don't merge this PR yet. @eren-terzioglu , @tmedicci , @fdcavalcanti can you take a look please? : espressif/esp-hal-3rdparty#13 |
|
Hello @xiaoxiang781216 , I am closing this PR to use other approach. 2 news drafts were opened: |
Summary
Expose a chacha20 keystream API with a 64-bit block counter on top of the existing private chacha implementation, so flat-build applications (e.g. an SSH server) can reuse the kernel cipher for chacha20-poly1305.
This is necessary in the next steps of Dropbear port where we will stop to use internal dropbear crypto em use NuttX Crypto.
Impact
No relevant impact. Only existing implementations are being shared as an API.
Testing
Build and OSTest