]> git.codecow.com Git - Monocypher.git/commitdiff
doc: crypto_sign: fat -> composite (in C code)
authorLoup Vaillant <loup@loup-vaillant.fr>
Mon, 11 Jul 2022 15:58:21 +0000 (17:58 +0200)
committerLoup Vaillant <loup@loup-vaillant.fr>
Mon, 11 Jul 2022 16:03:30 +0000 (18:03 +0200)
doc/man/man3/crypto_sign.3monocypher

index 0640f558101b9b786a7cec9581226539d749f451..6c94835b75429bbf4ba670ca3e3958dbbe5b7ced 100644 (file)
@@ -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);