History log of /openbsd-src/lib/libc/crypt/arc4random.c (Results 26 – 50 of 58)
Revision Date Author Comments
# 953a29a8 13-Jun-2014 deraadt <deraadt@openbsd.org>

For now... assume success of getentropy() just like we assumed success
of sysctl(). Mark it with XXX while we consider.


# 7e46e095 13-Jun-2014 deraadt <deraadt@openbsd.org>

use getgentropy() call. If it fails, things are pretty bad --
call abort().
this direction discussed at length with miod beck tedu matthew etc


# 928d7176 31-May-2014 jca <jca@openbsd.org>

Delete the extraneous "return" statement at the end of a void function.
From Fritjof Bornebusch.


# 0dc651d6 06-May-2014 tedu <tedu@openbsd.org>

missing NULL checks to see if init is needed. found hard way by deraadt.


# 367165dc 06-May-2014 tedu <tedu@openbsd.org>

clear a stack buffer with explicit_bzero


# c8f7bca9 06-May-2014 tedu <tedu@openbsd.org>

move chacha context and buffer out of bss and allow mmap to place them
wherever it decides it would like them. first step. ok deraadt dlg djm


# 92baf7bb 04-May-2014 deraadt <deraadt@openbsd.org>

delete useless test code


# e1968c99 21-Oct-2013 deraadt <deraadt@openbsd.org>

Remove arc4random_stir() and arc4random_addrandom(), which none should
be using directly. Well, a few rare people cloned it upstream and it
will take a bit of time for them to learn.
ok various


# 90c1fad7 01-Oct-2013 markus <markus@openbsd.org>

replace rc4 with ChaCha20; inspired by Nick Mathewson's work on libottery;
feedback and ok djm@


# bef9f719 11-Jun-2013 deraadt <deraadt@openbsd.org>

spacing


# 728918cb 24-Jun-2012 matthew <matthew@openbsd.org>

Change arc4random_uniform() to calculate ``2**32 % upper_bound'' as
``-upper_bound % upper_bound''. Simplifies the code and makes it the
same on both ILP32 and LP64 architectures, and also slightly

Change arc4random_uniform() to calculate ``2**32 % upper_bound'' as
``-upper_bound % upper_bound''. Simplifies the code and makes it the
same on both ILP32 and LP64 architectures, and also slightly faster on
LP64 architectures by using a 32-bit remainder instead of a 64-bit
remainder.

Pointed out by Jorden Verwer on tech@
ok deraadt; no objections from djm or otto

show more ...


# f8b5512d 22-Dec-2010 otto <otto@openbsd.org>

remove comment that hasn't been true for quite a while now;
ok deraadt@ djm@


# 2e3c4f77 15-Dec-2009 guenther <guenther@openbsd.org>

No point in refreshing the pid from inside arc4_stir() when that
doesn't test it, so factor out the two places that test it into a
routine and do the refreshing there. With this, arch4random_buf()
d

No point in refreshing the pid from inside arc4_stir() when that
doesn't test it, so factor out the two places that test it into a
routine and do the refreshing there. With this, arch4random_buf()
doesn't trigger superfluous calls to getpid() when filling large
buffers.

ok deraadt@, "looks nicer indeed" otto@

show more ...


# bae062b7 03-Oct-2008 otto <otto@openbsd.org>

zap __arc4_getbyte(), it was only used by the old malloc; ok millert@
kurt@


# eef9a7c1 04-Jun-2008 djm <djm@openbsd.org>

fix math screwup that reintroduced a bias for upper_bounds in range
(2^30,2^31). Nothing in the tree yet requests random numbers bounded
by this range.

report jakob!deraadt; ok deraadt@


# f7b5bfc7 16-Mar-2008 otto <otto@openbsd.org>

diff from djm@ committed at his request:

introduce two new APIs for requesting strong random numbers:

arc4random_buf() - fill an arbitrary memory range with random numbers

arc4random_uniform() - r

diff from djm@ committed at his request:

introduce two new APIs for requesting strong random numbers:

arc4random_buf() - fill an arbitrary memory range with random numbers

arc4random_uniform() - return a uniformly distributed random number
below
a specified upper bound, avoiding the bias that comes from a naive
"arc4random() % upper_bound" construction.

these mirror similarly-named functions in the kernel;
lots of discussion deraadt@ mcbride@

show more ...


# 229f4f6e 01-Jan-2008 kurt <kurt@openbsd.org>

- make arc4random*() functions thread safe. Use a custom spinlock function
instead of the generic pthread macros since free(3) uses __arc4_getbyte()
when freeing small sized allocations and the gener

- make arc4random*() functions thread safe. Use a custom spinlock function
instead of the generic pthread macros since free(3) uses __arc4_getbyte()
when freeing small sized allocations and the generic pthread macros call
malloc(3).
- eliminate passing pointers to a static variable with global scope (rs)
for additional code clarity and reduction.
- shlib minor bumps for libc and libpthread due to new functions.
From andreas@ with some bits from me. okay tedu@ marc@ w/some spot
checking from millert@

show more ...


# 5a41b3be 12-Feb-2007 otto <otto@openbsd.org>

provide an libc internal interface to get random bytes, to be used by malloc
to get random data without calling getpid(), ok millert@ deraadt@


# 05aaf954 30-Nov-2005 otto <otto@openbsd.org>

Use sysctl(KERN_ARND) to get n bytes, instead of just 4 at a time
and remove fallback code. If somebody is dumb enough to make the
sysctl fail using systrace, he deserves what he gets. Saves 7 syscal

Use sysctl(KERN_ARND) to get n bytes, instead of just 4 at a time
and remove fallback code. If somebody is dumb enough to make the
sysctl fail using systrace, he deserves what he gets. Saves 7 syscalls
on process startup.
looks good miod@ ok deraadt@ tedu@

show more ...


# b9472f3e 06-Jun-2005 kjell <kjell@openbsd.org>

Change email address for author, at his request.


# e6ea6f36 06-Jun-2005 kjell <kjell@openbsd.org>

Change license to standard OpenBSD boilerplate, with permission
from original author (David Mazieres)


# 88108e22 04-Jun-2005 tedu <tedu@openbsd.org>

use the new fat random sysctl to get initial state. (fallback to looping).
stir after eating 400000 words. ok + input deraadt


# 8f83e642 02-Nov-2004 hshoexer <hshoexer@openbsd.org>

kill spaces

ok djm@


# 84310223 26-Nov-2003 djm <djm@openbsd.org>

Discard first 256 bytes of keystream, as per recommendation in
"Weaknesses in the Key Scheduling Algorithm of RC4", Fluhrer, Mantin and
Shamir. ok itojun@


# b3cc64f9 16-Aug-2003 tedu <tedu@openbsd.org>

just use sysctl for stirring. thread safe and can't fail.
ok deraadt and co.


123