xsalsa20poly1305: improve usage documentation#373
xsalsa20poly1305: improve usage documentation#373touilleMan wants to merge 1 commit intoRustCrypto:masterfrom
Conversation
|
Hi there, thanks for contributing! Indeed providing RNG advice across the many, many crates we maintain has been a bit of an ongoing problem. In some places we have taken the approach you're suggesting, albeit with
I'd say this approach has still left people confused with how to import For this reason we began re-exporting I would suggest documenting things in terms of the re-exported
Yes, while we haven't given great advice about nonces, we've been hesitant to explicitly add a happy path for using random data for 96-bit nonces as used by ChaCha20Poly1305, as this has a birthday bound of 2^48, which while large is still within the realm of possibility in any multi-user scenario. Indeed the XSalsa20Poly1305 nonce is 192-bits to make it safe to use in this capacity. It would be safe to add such an API for XChaCha20Poly1305. I would be okay with well-written generally useful documentation about nonce management, but that should probably go in the |
|
This is a nice direction, but the API is changing and this PR is stale. Please reopen if you'd like to continue it. |
As a new user of this library, I found surprisingly hard to understand how to use it 🤔
I think the documentation would benefit from providing an example closer to reality, hence I've changed the documentation to generate real key and nonce.
The drawback is this add the
randcreate todoc-requirements.I wanted to to a similar change in
chacha20poly1305(considering the two crates should be really similar), but they don't share the same API (at leastchacha20poly1305::generate_noncedoesn't exist) is this expected ?