LoupVaillant / Monocypher

An easy to use, easy to deploy crypto library
https://monocypher.org
Other
614 stars 80 forks source link

Document & test overlapping of key_exchange. #159

Closed richwalm closed 4 years ago

richwalm commented 4 years ago

As discussed with Loup via e-mail, document and create a test for overlapping the shared_key & your_secret_key buffers for crypto_key_exchange().

Useful as in my application, there's no reason to keep around the secret key after obtaining a shared key, avoiding locking and wiping an extra buffer.

fscoto commented 4 years ago

The documentation change seems good to me. As for the test code, maybe it would be worthwhile to have a buf[64] and loop from 0 to 32, offsetting one of the arguments by i to test partial overlapping.

(Suggestion for in-tree change: Add the same wording to crypto_x25519 as well.)

I'd like to request that you add yourself with a copyright line and to the "Written by" line for the files you've changed, or that you make an explicit comment here for @LoupVaillant to do that after merging, explicitly acknowledging that you subject your work to BSD-2-clause and CC-0.

richwalm commented 4 years ago

Thanks. I've made those suggestions as mentioned.

LoupVaillant commented 4 years ago

Perfect, merging right away, thanks!