Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | move arc4random prototype to systm.h. more appropriate for most code | 2014-11-18 | 1 | -2/+2 | |
| | | | | to include that than rdnvar.h. ok deraadt dlg | ||||
* | - use nitems(); no binary change | 2011-03-31 | 1 | -2/+2 | |
| | | | | ok claudio@ | ||||
* | rename arc4random_bytes => arc4random_buf to match libc's nicer name; | 2008-06-09 | 1 | -2/+2 | |
| | | | | ok deraadt@ | ||||
* | revert - I'm a dumbfuck who doesn't know his own API | 2008-03-15 | 1 | -2/+2 | |
| | |||||
* | off by one at end of array | 2008-03-15 | 1 | -2/+2 | |
| | |||||
* | Because the ip_id code initialisation is a specific case of shuffling | 2008-03-15 | 1 | -9/+10 | |
| | | | | | | | a set of incrementing integers (and not an arbitrary set of values) it is possible to populate the array as we shuffle it in a single forward pass. Clever optimisation from didickman AT gmail.com; ok deraadt@ mcbride@ | ||||
* | because arc4random_uniform is being used, the modulo bias is taken care of | 2008-03-02 | 1 | -2/+1 | |
| | |||||
* | Add a arc4random_uniform() that returns a uniformly distributed number | 2008-03-02 | 1 | -2/+2 | |
| | | | | | | | | | | in the range 0 <= x < upper_bound Please use this new API instead of "arc4random() % upper_bound", as it avoids the "modulo bias" that favours small results when upper_bound is not a power of two. feedback deraadt@ mcbride@; ok deraadt@ | ||||
* | replacement algorithm. initialize a 64K-short buffer using Durstenfeld | 2008-02-29 | 1 | -167/+59 | |
| | | | | | | | | | | | | shuffle. Upon allocation, swap-permute the new value to a random slot in the 0..32K-1 th entry of the buffer as we move forward, ensuring randomness but also satisfying the non-repeating property we need. Also avoid the value of 0, since IP ID's of 0 are special. Inspired by Dillon's implementation. We believe this is easier to read though, initializes with less bias, handles the ID of 0 properly, and wins speed tests. Thanks a lot to mcbride and djm for doing a bunch of statistical and speed analysis, and comments from nordin ok mcbride djm | ||||
* | typos; ok jmc@ | 2007-11-26 | 1 | -2/+2 | |
| | | | | | sys/netinet/in_pcb.c and sys/net/bridgestp.c ok henning@ sys/dev/pci/bktr/* ok jakemsr@ | ||||
* | remove more static to avoid confusing the profiler (and maybe ddb too) | 2007-05-27 | 1 | -5/+5 | |
| | | | | prodded by art@ ja ja claudio@ | ||||
* | First step towards more sane time handling in the kernel -- this changes | 2004-06-21 | 1 | -3/+3 | |
| | | | | | | | | things such that code that only need a second-resolution uptime or wall time, and used to get that from time.tv_secs or mono_time.tv_secs now get this from separate time_t globals time_second and time_uptime. ok art@ niklas@ nordin@ | ||||
* | spelling; jjy2+@pitt.edu | 2004-03-22 | 1 | -2/+2 | |
| | |||||
* | niels kindly dropped clause 3/4 from the license. tnx! | 2003-12-12 | 1 | -6/+1 | |
| | |||||
* | previous commit included bad hunk. sorry | 2003-12-12 | 1 | -2/+3 | |
| | |||||
* | no need to call arc4random() if we don't skip numbers in ip_randomid(). | 2003-12-12 | 1 | -4/+3 | |
| | | | | from markus | ||||
* | correct non-repetitive ID code, based on comments from niels provos. | 2003-12-10 | 1 | -2/+6 | |
| | | | | | | - seed2 is necessary, but use it as "seed2 + x" not "seed2 ^ x". - skipping number is not needed, so disable it for 16bit generator (makes the repetition period to 30000) | ||||
* | "exp" is a reserved symbol under gcc3/posix. mcbride ok | 2003-09-21 | 1 | -3/+3 | |
| | |||||
* | Kill #if __STDC__ used to do K&R vs. ANSI varargs/stdarg; just do things | 2002-03-15 | 1 | -7/+1 | |
| | | | | the ANSI way. | ||||
* | First round of __P removal in sys | 2002-03-14 | 1 | -4/+4 | |
| | |||||
* | Cut down on include files. | 2001-06-08 | 1 | -2/+1 | |
| | |||||
* | use faster arc4random() for small amounts fo data, some spaces; niels ok | 2001-06-04 | 1 | -34/+29 | |
| | |||||
* | add an inner xor to make prediction attacks against the ids harder, due | 1999-08-26 | 1 | -3/+5 | |
| | | | | to an attack pointed out by David Wagner. | ||||
* | make ip_id random but ensure that ids dont repeat for some period. | 1998-12-26 | 1 | -0/+199 | |