Alternative flexible AEAD API better suited for dynamic scenarios #51
Closed
tomekmarchi
started this conversation in
Ideas
Replies: 1 comment 4 replies
-
Just make a 1 line helper function if you like your idea of API.
There is no "non-flexibility". You can make any custom function. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I will focus on xChacha as the context. The current API returns a compiled object with encrypt/decrypt where it would require re-generating in dynamic scenarios. This leaves the API less flexible than say the xChaCha API we find in sodium-native/libsodium which allows greater flexibility for such cases where these initial arguments change.
The main thing to point out is related to additional data arg here's a simple context:
Your additional data is unique per packet
This would require modifying the existing Additional Data buffer (even though you already have a specific buffer for additional data anyway - could also possibly have multiple ADD Buffers at a given time) that was already used initially to generate the encrypt/decrypt functions or to regenerate the cipher object entirely.
Preferably all initial args key, nonce, ADD would be moved to encrypt/decrypt functions. I can see the benefits of pre-computing functions/methods. However, it would be nice to expose a more flexible alternative API that is more viable for specific dynamic scenarios.
Beta Was this translation helpful? Give feedback.
All reactions