From c49e3f49e741cf75f9d25fc1f0911a6e715e2c17 Mon Sep 17 00:00:00 2001 From: Fabio Scotoni <34964387+fscoto@users.noreply.github.com> Date: Mon, 2 Mar 2020 08:33:38 +0100 Subject: [PATCH] crypto_sha512 example overhaul Just gives it a message to hash, matching crypto_blake2b(3monocypher). Nothing to randomize. --- doc/man/man3/optional/crypto_sha512.3monocypher | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/man/man3/optional/crypto_sha512.3monocypher b/doc/man/man3/optional/crypto_sha512.3monocypher index 7684f59..0fdb603 100644 --- a/doc/man/man3/optional/crypto_sha512.3monocypher +++ b/doc/man/man3/optional/crypto_sha512.3monocypher @@ -161,15 +161,15 @@ These functions return nothing. .Sh EXAMPLES Hashing a message all at once: .Bd -literal -offset indent -uint8_t hash [ 64]; /* Output hash (64 bytes) */ -uint8_t message[500]; /* Message to hash */ -crypto_sha512(hash, message, 500); +uint8_t hash [64]; /* Output hash (64 bytes) */ +uint8_t message[12] = "Lorem ipsum"; /* Message to hash */ +crypto_sha512(hash, message, 12); .Ed .Pp Hashing a message incrementally: .Bd -literal -offset indent uint8_t hash [ 64]; /* Output hash (64 bytes) */ -uint8_t message[500]; /* Message to hash */ +uint8_t message[500] = {1}; /* Message to hash */ crypto_sha512_ctx ctx; crypto_sha512_init(&ctx); for (size_t i = 0; i < 500; i += 100) { -- 2.47.3