-
-.SH NOTES ON PASSWORD PROCESSING
-\fIFrom a file descriptor or a terminal\fR: Password processing is new-line sensitive, meaning the reading will stop after encountering \\n. It will process the read material (without newline) with the default hash or the hash given by \-\-hash. After hashing, it will be cropped to the key size given by \-s.
-
-\fIFrom stdin\fR: Reading will continue until EOF (so using e.g. /dev/random as stdin will not work), with the trailing newline stripped. After that the read data will be hashed with the default hash or the hash given by \-\-hash and the result will be cropped to the keysize given by \-s. If "plain" is used as an argument to the hash option, the input data will not be hashed.
-Instead, it will be zero padded (if shorter than the keysize) or truncated (if longer than the keysize) and used directly as the key. No warning will be given if the amount of data read from stdin is less than the keysize.
-
-\fIFrom a key file\fR: It will be cropped to the size given by \-s. If there is insufficient key material in the key file, cryptsetup will quit with an error.
-
-If \-\-key-file=- is used for reading the key from stdin, no trailing newline is stripped from the input. Without that option, cryptsetup strips trailing newlines from stdin input.
+.SH RETURN CODES
+Crypsetup returns 0 on success or non-zero on error.
+
+Error codes are: 1 wrong parameters, 2 no permission (bad passphrase),
+3 out of memory, 4 wrong device specified, 5 device already exists
+or device is busy.
+.SH NOTES ON PASSWORD PROCESSING FOR PLAIN MODE
+\fBFrom a terminal\fR: Password processing is new-line sensitive,
+meaning the reading will stop after encountering \\n.
+It will process the read material (without newline) with the default
+hash or the hash given by \-\-hash.
+After hashing, it will be cropped to the key size given by \-s.
+
+\fBFrom stdin\fR: Reading will continue until EOF (or until
+maximum input size is reached), with the trailing newline stripped.
+The maximum input size is defined by the same compiled-in default
+as for the maximum key file size or can be overwrittten
+using \-\-keysfile-size option.
+
+After that the read data will be hashed with the default hash
+or the hash given by \-\-hash and the result will be cropped
+to the keysize given by \-s.
+
+If "plain" is used as an argument to the hash option, the input
+data will not be hashed.
+Instead, it will be zero padded (if shorter than the keysize) or
+truncated (if longer than the keysize) and used directly as the key.
+No warning will be given if the amount of data read from stdin is
+less than the keysize.
+
+\fBFrom a key file\fR: It will be cropped to the size given by \-s.
+If there is insufficient key material in the key file, cryptsetup
+will quit with an error.
+
+If \-\-key-file=- is used for reading the key from stdin, no
+trailing newline is stripped from the input. Without that option,
+cryptsetup strips trailing newlines from stdin input.