Skip to content

Conversation

@holtrop-wolfssl
Copy link
Contributor

Description

Rust wrapper: add one-shot XChaCha20-Poly1305 encrypt/decrypt functions

Testing

CI / unit tests

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@holtrop-wolfssl holtrop-wolfssl self-assigned this Jan 7, 2026
const byte *inKey, word32 inKeySz,
const byte *inIV, word32 inIVSz,
const byte *nonce, word32 nonce_len,
const byte *key, word32 key_len,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter order was incorrect for this function. I talked with @douzzer about it and updating the prototype to match the implementation made the most sense.

I originally was planning to wrap this function with a chunking API for XChaCha20-Poly1305 but ended up not needing that right now and there are not corresponding encrypt/decrypt functions for XChaCha20-Poly1305 like there are for ChaCha20-Poly1305 so I am omitting a Rust wrapper for that at the moment.

@holtrop-wolfssl holtrop-wolfssl force-pushed the rust-xchacha20-poly1305 branch from 5a57fcd to a9b2e83 Compare January 7, 2026 16:43
@holtrop-wolfssl
Copy link
Contributor Author

retest this please (org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: 6493d207-3f8e-4bc5-8da5-109f99226a50
org.jenkinsci.plugins.workflow.support.steps.AgentOfflineException: Unable to create live FilePath for wolf-linux-cloud-node-aw79sv)

@holtrop-wolfssl holtrop-wolfssl marked this pull request as ready for review January 7, 2026 18:58
@devin-ai-integration
Copy link
Contributor

🛟 Devin Lifeguard found 1 likely issues in this PR

  • do-not-change-external-apis snippet: Keep the original wc_XChaCha20Poly1305_Init(...) prototype unchanged and add a new function (e.g., wc_XChaCha20Poly1305_Init_ex(...)) with the desired (nonce, nonce_len, key, key_len) order, having the old function call the new one after shuffling its parameters.

@holtrop-wolfssl
please take a look at the above issues which Devin flagged. Devin will not fix these issues automatically.


#[cfg(xchacha20_poly1305)]
pub struct XChaCha20Poly1305 {
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although this struct is empty right now, if we do go back and add the streaming/chunking API for XChaCha20Poly1305, a field will be added here. I set it up to use a struct to future-proof for this and to maintain symmetry with the ChaCha20Poly1305 interface above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant