]> git.codecow.com Git - Monocypher.git/commitdiff
Documentation: Address Loup's review via GitHub PR #137
authorFabio Scotoni <34964387+fscoto@users.noreply.github.com>
Fri, 6 Dec 2019 07:23:06 +0000 (08:23 +0100)
committerFabio Scotoni <34964387+fscoto@users.noreply.github.com>
Fri, 6 Dec 2019 07:23:06 +0000 (08:23 +0100)
- 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.

doc/man/man3/crypto_sign_init_first_pass_custom_hash.3monocypher
doc/man/man3/optional/crypto_hmac_sha512.3monocypher

index 901b1c7990178237e1c101aaee9be11c275c3a7b..1cb64b22a6f2f7ef2a1d6b72fcf780f32c3ae22d 100644 (file)
@@ -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));
index a77b358dd374818cb42ef6cfa2178d05cee39837..a52bc4c7b967a300e08b8f0207e103115ba5ba7b 100644 (file)
@@ -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