summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko2006-12-12 17:14:56 +0000
committerDenis Vlasenko2006-12-12 17:14:56 +0000
commitdb2b52425dced7665cc33cc9fb6ade688fcbce4a (patch)
tree7908c90b12aeaf408181298fdda430d858ac9506
parent900406c359c319100c892a38be2bb5d76a8f85b9 (diff)
downloadbusybox-db2b52425dced7665cc33cc9fb6ade688fcbce4a.zip
busybox-db2b52425dced7665cc33cc9fb6ade688fcbce4a.tar.gz
passwd: added comment
-rw-r--r--loginutils/passwd.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/loginutils/passwd.c b/loginutils/passwd.c
index a062596..c28e9b8 100644
--- a/loginutils/passwd.c
+++ b/loginutils/passwd.c
@@ -34,10 +34,15 @@ static void crypt_make_salt(char *p, int cnt)
x += getpid() + time(NULL) + clock();
do {
- /* x = (x*1664525 + 1013904223) mod 2^32 generator is lame
+ /* x = (x*1664525 + 1013904223) % 2^32 generator is lame
* (low-order bit is not "random", etc...),
* but for our purposes it is good enough */
x = x*1664525 + 1013904223;
+ /* BTW, Park and Miller's "minimal standard generator" is
+ * x = x*16807 % ((2^31)-1)
+ * It has no problem with visibly alternating lowest bit
+ * but is also weak in cryptographic sense + needs div,
+ * which needs more code (and slower) on many CPUs */
*p++ = i64c(x >> 16);
*p++ = i64c(x >> 22);
} while (--cnt);