From: Fabio Scotoni <34964387+fscoto@users.noreply.github.com> Date: Fri, 6 Dec 2019 07:23:06 +0000 (+0100) Subject: Documentation: Address Loup's review via GitHub PR #137 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=23556e4dc039bf23c23a6ea762c893bb403cd57a;p=Monocypher.git Documentation: Address Loup's review via GitHub PR #137 - Fix typo in crypto_sign_init_first_pass_custom_hash(3monocypher) - Wipe sk in crypto_sign_init_first_pass_custom_hash(3monocypher); while it is just a test program, it is arguably good form to do so in any case, especially in documentation code that people might be copying and pasting. - Note that HMACs can be safely truncated. --- diff --git a/doc/man/man3/crypto_sign_init_first_pass_custom_hash.3monocypher b/doc/man/man3/crypto_sign_init_first_pass_custom_hash.3monocypher index 901b1c7..1cb64b2 100644 --- a/doc/man/man3/crypto_sign_init_first_pass_custom_hash.3monocypher +++ b/doc/man/man3/crypto_sign_init_first_pass_custom_hash.3monocypher @@ -108,7 +108,7 @@ and .Fa final members. .It Fa init -Function that initialises the hash context an outer signing context. +Function that initialises the hash context of an outer signing context. .It Fa update Function that updates the hash context of an outer signing context. It must be able to handle message sizes of at least 32 bytes. @@ -207,6 +207,7 @@ main(void) struct outer_ctx ctx; crypto_sign_init_first_pass_custom_hash((void*)&ctx, sk, NULL, &my_vtable); + crypto_wipe(sk, sizeof(sk)); crypto_sign_update( (void*)&ctx, msg, sizeof(msg)); crypto_sign_init_second_pass((void*)&ctx); crypto_sign_update( (void*)&ctx, msg, sizeof(msg)); diff --git a/doc/man/man3/optional/crypto_hmac_sha512.3monocypher b/doc/man/man3/optional/crypto_hmac_sha512.3monocypher index a77b358..a52bc4c 100644 --- a/doc/man/man3/optional/crypto_hmac_sha512.3monocypher +++ b/doc/man/man3/optional/crypto_hmac_sha512.3monocypher @@ -107,9 +107,13 @@ performs and .Fn crypto_hmac_sha512_final . .Pp -Use -.Xr crypto_verify64 3monocypher -to compare MACs. +MACs may be truncated safely down to at most 16 bytes; +the +.Xr crypto_verify64 3monocypher , +.Xr crypto_verify32 3monocypher , +and +.Xr crypto_verify16 3monocypher . +functions can be used to to compare (possibly truncated) MACs. .Sh RETURN VALUES These functions return nothing. .Sh EXAMPLES