summaryrefslogtreecommitdiff
path: root/sys/src/9/port/random.c
AgeCommit message (Collapse)Author
2016-09-11kernel: rekey chacha state on each randomread() invocationcinap_lenrek
we can encrypt the 256 bit chacha key on each invocation making it hard to reconstruct previous outputs of the generator given the current state (backtracking resiatance).
2016-09-11kernel: better nonce partitioning for chacha random number generatorcinap_lenrek
leave the block counter to chacha_encrypt() and increment the 96 bit iv instead.
2016-09-11kernel: xoroshiro128+ generator for rand()/nrand()cinap_lenrek
the kernels custom rand() and nrand() functions where not working as specified in rand(2). now we just use libc's rand() and nrand() functions but provide a custom lrand() impelmenting the xoroshiro128+ algorithm as proposed by aiju.
2016-09-11kernel: make randomread() fault reentrantcinap_lenrek
we now access the user buffer in randomread() outside of the lock, only copying and advancing the chacha state under the lock. this means we can use randomread() within the fault handling path now without fearing deadlock. this also allows multiple readers to generate random numbers in parallel.
2016-08-27kernel: switch to fast portable chacha based seed-once random number generatorcinap_lenrek
2013-11-22kernel: kproc error and exitcinap_lenrek
catch the error() that can be thrown by sleep() and tsleep() in kprocs. add missing pexit() calls. always set the freemem argument to pexit() from kproc otherwise the process gets added to the broken list.
2012-05-03kernel: move duplicated random.c to portcinap_lenrek