]> git.codecow.com Git - Monocypher.git/commitdiff
Removed "cannot fail" from the manual
authorLoup Vaillant <loup@loup-vaillant.fr>
Sat, 21 Apr 2018 18:31:22 +0000 (20:31 +0200)
committerLoup Vaillant <loup@loup-vaillant.fr>
Sat, 21 Apr 2018 18:31:22 +0000 (20:31 +0200)
This is C we're talking about.  Functions that return void cannot fail
only if they're used correctly.  Incorrect inputs can still trigger
undefined behaviour.  In this sense, those functions _can_ fail.

Returning void should be an obvious enough hint that the function
requires no error handling. At least it is if you're familiar enough
with C. (If one is not, one is not qualified to use a crypto library in
an unsafe language.)

An unqualified "cannot fail" give any more information than `void`, and
may even mislead some users.  Better stay on the safe side.

doc/man/man3/crypto_argon2i.3monocypher
doc/man/man3/crypto_blake2b.3monocypher
doc/man/man3/crypto_chacha20_H.3monocypher
doc/man/man3/crypto_chacha20_encrypt.3monocypher
doc/man/man3/crypto_key_exchange.3monocypher
doc/man/man3/crypto_lock.3monocypher
doc/man/man3/crypto_lock_init.3monocypher
doc/man/man3/crypto_poly1305.3monocypher
doc/man/man3/crypto_sign.3monocypher
doc/man/man3/crypto_sign_init_first_pass.3monocypher
doc/man/man3/crypto_wipe.3monocypher

index fb63c7a912e654658027344398d84aac78615cbc..073c757ded0ab4357a54da699f6ba2d28a95bdfa 100644 (file)
@@ -182,7 +182,6 @@ Must be zero if there is no additional data.
 .El
 .Sh RETURN VALUES
 These functions return nothing.
-They cannot fail.
 .Sh EXAMPLES
 This example shows how to hash a password with the recommended baseline
 parameters:
index a224c38cbc4a4bec2c9b90d632567c92cfae0ced..7c0f4c92e19ff8215e0e3440e72e6ad73b841580 100644 (file)
@@ -155,7 +155,6 @@ specifies a 64-byte hash and no key.
 This is considered a good default.
 .Sh RETURN VALUES
 These functions return nothing.
-They cannot fail.
 .Sh EXAMPLES
 Hashing a message all at once:
 .Bd -literal -offset indent
index fcda0d7f56951fce4602205c276f2fbb9732c15e..b46026119f8ca73e7494100cddae77576f60a9f5 100644 (file)
@@ -39,7 +39,6 @@ X25519 shared secrets have enough entropy.
 .El
 .Sh RETURN VALUES
 This function returns nothing.
-It cannot fail.
 .Sh EXAMPLES
 Simple hash:
 .Bd -literal -offset indent
index eb811d5dd2fe4b91621a952cd4e964d1030d4f65..e75d024b8926bb916254795dd90f38376f1a6ac0 100644 (file)
@@ -181,7 +181,6 @@ Be careful when using this not to accidentally reuse parts of the
 random stream as that would destroy confidentiality.
 .Sh RETURN VALUES
 These functions return nothing.
-They cannot fail.
 .Sh EXAMPLES
 Simple encryption:
 .Bd -literal -offset indent
index bbcbfe2ea7d6bb1688dfeb683b024a515148111a..6a072403498a342ec5d064d01f6b02340edf514a 100644 (file)
@@ -58,7 +58,6 @@ process are not known to be trustworthy, check the return value.
 .Pp
 .Fn crypto_key_exchange_public_key
 returns nothing.
-It cannot fail.
 .Sh EXAMPLES
 Generate a public key from a randomly generated secret key:
 .Bd -literal -offset indent
index 325e5be24363fe5729e8a7de7682e40545c789e4..559fd5680b551aa58f93b89b8733bf094751c108 100644 (file)
@@ -161,7 +161,6 @@ An incremental interface is available; see
 and
 .Fn crypto_lock_aead
 return nothing.
-They cannot fail.
 .Fn crypto_unlock
 and
 .Fn crypto_unlock_aead
index e7a41f662f496e219350e1580b96326c725808a3..201594c4ca065fb4ac25ff9f35e38fc4364a7de7 100644 (file)
@@ -133,7 +133,6 @@ Verify the MAC with
 and
 .Fn crypto_lock_final
 return nothing.
-They cannot fail.
 .Pp
 .Fn crypto_unlock_final
 returns 0 on success or -1 if the message was corrupted.
index fccbd1ad412d844d8b59412fb5475db53448cd81..8e85e5b0914f8d29c9bb1af2dfbbd5969b41f92a 100644 (file)
@@ -85,7 +85,6 @@ Once the message is entirely processed,
 yields the message authentication code.
 .Sh RETURN VALUES
 These functions return nothing.
-They cannot fail.
 .Sh EXAMPLES
 To authenticate a message:
 .Bd -literal -offset indent
index 8c2d02ff1f86b3596bd6a9988c4d32906f490db3..bc36cc09dcd15abeeee5380961b56785444f0ec0 100644 (file)
@@ -94,7 +94,6 @@ An incremental interface is available; see
 and
 .Fn crypto_sign
 return nothing.
-They cannot fail.
 .Pp
 .Fn crypto_check
 returns 0 for legitimate messages and -1 for forgeries.
index 2687bded78d2767d2d907c87951ba80ae160a61f..6a8a7b1153fa2a8b3870958f748db6197678bc40 100644 (file)
@@ -112,7 +112,6 @@ Signature verification with
 and
 .Fn crypto_check_update
 return nothing.
-They cannot fail.
 .Pp
 .Fn crypto_check_final
 returns 0 for legitimate messages and -1 for forgeries.
index b8f12b092e3d53f12d139e6f99e37294b7c203c5..6f215dab61cbde1f419826af62245ea7783e5484 100644 (file)
@@ -50,6 +50,5 @@ Refer to
 for instructions on how to lock down memory on common operating systems.
 .Sh RETURN VALUES
 This function returns nothing.
-It cannot fail.
 .Sh SEE ALSO
 .Xr intro 3monocypher