Re: random(4): use arc4random_ctx_buf() for large device reads

2020-05-25 Thread Sebastien Marie
On Mon, May 25, 2020 at 05:27:37PM +0200, Christian Weisgerber wrote: > Sebastien Marie: > > > > For large reads from /dev/random, use the arc4random_ctx_*() functions > > > instead of hand-rolling the same code to set up a temporary ChaCha > > > instance. > > > > Eventually, I would get ride of

Re: random(4): use arc4random_ctx_buf() for large device reads

2020-05-25 Thread Christian Weisgerber
Sebastien Marie: > > For large reads from /dev/random, use the arc4random_ctx_*() functions > > instead of hand-rolling the same code to set up a temporary ChaCha > > instance. > > Eventually, I would get ride of myctx, initialize lctx to NULL, and use > (lctx == NULL) to replace (myctx == 0).

Re: random(4): use arc4random_ctx_buf() for large device reads

2020-05-25 Thread Sebastien Marie
On Sun, May 24, 2020 at 09:33:27PM +0200, Christian Weisgerber wrote: > (This is in a different part of the file from Theo's current efforts.) > > For large reads from /dev/random, use the arc4random_ctx_*() functions > instead of hand-rolling the same code to set up a temporary ChaCha >

Re: random(4): use arc4random_ctx_buf() for large device reads

2020-05-24 Thread Theo de Raadt
Makes sense to me. Christian Weisgerber wrote: > (This is in a different part of the file from Theo's current efforts.) > > For large reads from /dev/random, use the arc4random_ctx_*() functions > instead of hand-rolling the same code to set up a temporary ChaCha > instance. > > ok? > > >

random(4): use arc4random_ctx_buf() for large device reads

2020-05-24 Thread Christian Weisgerber
(This is in a different part of the file from Theo's current efforts.) For large reads from /dev/random, use the arc4random_ctx_*() functions instead of hand-rolling the same code to set up a temporary ChaCha instance. ok? Index: rnd.c