| * i64c was also put here, this is the only function that uses it. |
| * Lifted from loginutils/passwd.c by Thomas Lundquist <thomasez@zelow.no> |
| int crypt_make_salt(char *p, int cnt, int x) |
| x += getpid() + time(NULL); |
| /* 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 */ |