From 575acfc2630339e70025600d44672eca4ab62d85 Mon Sep 17 00:00:00 2001 From: Loup Vaillant Date: Mon, 11 Jul 2022 17:58:21 +0200 Subject: [PATCH] doc: crypto_sign: fat -> composite (in C code) --- doc/man/man3/crypto_sign.3monocypher | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/man/man3/crypto_sign.3monocypher b/doc/man/man3/crypto_sign.3monocypher index 0640f55..6c94835 100644 --- a/doc/man/man3/crypto_sign.3monocypher +++ b/doc/man/man3/crypto_sign.3monocypher @@ -204,18 +204,18 @@ store it next to the private key .Pq Dq composite private key . Make sure you treat that key pair as a single unit: .Bd -literal -offset indent -uint8_t sk[64]; /* Fat secret key */ -uint8_t pk[32]; /* Public key */ -arc4random_buf(sk, 32); /* Secret half */ -crypto_sign_public_key(sk + 32, sk); /* Public half */ -memcpy(pk, sk + 32, 32); /* Copy public key */ +uint8_t sk[64]; /* Combined secret key */ +uint8_t pk[32]; /* Public key */ +arc4random_buf(sk, 32); /* Secret half */ +crypto_sign_public_key(sk + 32, sk); /* Public half */ +memcpy(pk, sk + 32, 32); /* Copy public key */ /* Wipe the secret key if it is no longer needed */ crypto_wipe(sk, 64); .Ed .Pp That way signing can use the composite private key alone: .Bd -literal -offset indent -uint8_t sk [64]; /* Fat secret key from above */ +uint8_t sk [64]; /* Combined secret key from above */ const uint8_t message [11] = "Lorem ipsu"; /* Message to sign */ uint8_t signature[64]; crypto_sign(signature, sk, sk + 32, message, 10); -- 2.47.3