Page MenuHomeFreeBSD

arc4random(3): Reduce diff with OpenBSD.
ClosedPublic

Authored by delphij on Aug 9 2022, 6:48 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Aug 18, 2:16 PM
Unknown Object (File)
Sun, Aug 10, 5:26 AM
Unknown Object (File)
Sat, Aug 2, 4:02 AM
Unknown Object (File)
Wed, Jul 23, 1:17 AM
Unknown Object (File)
Jul 21 2025, 7:26 AM
Unknown Object (File)
Jul 21 2025, 4:44 AM
Unknown Object (File)
Jun 28 2025, 9:26 PM
Unknown Object (File)
Jun 26 2025, 3:42 PM
Subscribers

Details

Summary

The main change was v1.57 by djm@:

Randomise the rekey interval a little. Previously, the chacha20
instance would be rekeyed every 1.6MB. This makes it happen at a
random point somewhere in the 1-2MB range.

MFC after: 2 weeks

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 46801
Build 43690: arc lint + arc unit

Event Timeline

r1.56 -- Not revalent to us
r1.57 -- the main change
r1.58 -- indent fix (follow up of r1.57)

This is mostly for diff reduction; the rs_count value of 1600000 was an arbitrary value.

With the change, we would use the entropy obtained from kernel to create a "fuzz" value for the initial rs_count when doing stir, the new rs_count would now be in range of [1048576,2097151]. This makes the stir interval less predicable for a very small cost for each stir.

This revision is now accepted and ready to land.Aug 9 2022, 8:12 AM
cem added a subscriber: cem.

As mentioned in email, we might also consider publishing a seed generation to the VDSO page from Fortuna.

This revision was automatically updated to reflect the committed changes.