summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTechnion <technion@lolware.net>2015-07-09 10:23:03 +0000
committerTechnion <technion@lolware.net>2015-07-09 10:23:03 +0000
commit02d53f0caf047cc128f51fd494551554f429970a (patch)
treee3ec5b102736ee4116cf4980af464aa0b8dd4f72
parent5296b0c52080a8d9f94b3cde1379ea8a6542843e (diff)
More fully document header length.
-rw-r--r--libscrypt.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/libscrypt.h b/libscrypt.h
index b7141f5..65cfdab 100644
--- a/libscrypt.h
+++ b/libscrypt.h
@@ -59,7 +59,17 @@ int libscrypt_check(char *mcf, const char *password);
* a blocker for insane defines
*/
#define SCRYPT_SALT_LEN 16 /* This is just a recommended size */
-#define SCRYPT_MCF_LEN 125 /* mcf is 120 byte + nul */
+/* Standard MCF is:
+ $s1 Identifier, three chars
+ $0e0810 Work order and separator, six chars
+ Formula for binary to base64 length = ceil(n/3)*4
+ $pcL+DWle903AXcKJVwMffA== Salt is 16 bytes, or 24 in Base64
+ $dn+9ujljVc5JTJMC2fYu1ZEHdJyqYkOurmcrBQbMHUfnD6qxbTmNiR075ohNBZjvp66E2aV1pfOrmyNHUefjMg== Hash is 64 bytes, or 88 in Base64.
+ Work order, salt and hash have separators (3)
+ 3 + 6 + 24 + 88 + 3 + null byte = 25
+ This is rounded up to a multiple of four for alignment
+*/
+#define SCRYPT_MCF_LEN 128
#define SCRYPT_MCF_ID "$s1"
#define SCRYPT_N 16384
#define SCRYPT_r 8