<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/libkern/arc4random.c, branch releng/12.0</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=releng%2F12.0</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=releng%2F12.0'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2017-04-16T09:11:02Z</updated>
<entry>
<title>Replace the RC4 algorithm for generating in-kernel secure random</title>
<updated>2017-04-16T09:11:02Z</updated>
<author>
<name>Mark Murray</name>
<email>markm@FreeBSD.org</email>
</author>
<published>2017-04-16T09:11:02Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=150890b0c677625d2a6ca0aec375e33814e60679'/>
<id>urn:sha1:150890b0c677625d2a6ca0aec375e33814e60679</id>
<content type='text'>
numbers with Chacha20. Keep the API, though, as that is what the
other *BSD's have done.

Use the boot-time entropy stash (if present) to bootstrap the
in-kernel entropy source.

Reviewed by: delphij,rwatson
Approved by: so(delphij)
MFC after: 2 months
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D10048
</content>
</entry>
<entry>
<title>Discard first 3072 bytes of RC4 keystream, this is a bandaid</title>
<updated>2017-03-14T06:00:44Z</updated>
<author>
<name>Xin LI</name>
<email>delphij@FreeBSD.org</email>
</author>
<published>2017-03-14T06:00:44Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=91868665a935a40a2ec41dcd15213269e7d57a73'/>
<id>urn:sha1:91868665a935a40a2ec41dcd15213269e7d57a73</id>
<content type='text'>
that allows us to work on switching to a more modern PRNG.

Submitted by:	Steven Chamberlain &lt;steven pyro eu org&gt;
Approved by:	so
</content>
</entry>
<entry>
<title>Update r309143 to prevent false sharing.</title>
<updated>2016-11-25T17:20:23Z</updated>
<author>
<name>Fabien Thomas</name>
<email>fabient@FreeBSD.org</email>
</author>
<published>2016-11-25T17:20:23Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=cdaf963483a3f8b8e0745268b31af227ca90c429'/>
<id>urn:sha1:cdaf963483a3f8b8e0745268b31af227ca90c429</id>
<content type='text'>
Reported by:	mjg
Approved by:	so
MFC after:	1 month
</content>
</entry>
<entry>
<title>In a dual processor system (2*6 cores) during IPSec throughput tests,</title>
<updated>2016-11-25T13:49:33Z</updated>
<author>
<name>Fabien Thomas</name>
<email>fabient@FreeBSD.org</email>
</author>
<published>2016-11-25T13:49:33Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=dcf3302859e24b26f3b1dff2c8e104fdbe976825'/>
<id>urn:sha1:dcf3302859e24b26f3b1dff2c8e104fdbe976825</id>
<content type='text'>
we see a lot of contention on the arc4 lock, used to generate the IV
of the ESP output packets.

The idea of this patch is to split this mutex in order to reduce the
contention on this lock.

Reviewed by:	delphij, markm, ache
Approved by:	so
Obtained from: emeric.poupon@stormshield.eu
MFC after: 1 month
Sponsored by:	Stormshield
Differential Revision:	https://reviews.freebsd.org/D8130
</content>
</entry>
<entry>
<title>Huge cleanup of random(4) code.</title>
<updated>2015-06-30T17:00:45Z</updated>
<author>
<name>Mark Murray</name>
<email>markm@FreeBSD.org</email>
</author>
<published>2015-06-30T17:00:45Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=d1b06863fbc7b142d7afdf2d399087e2fab40f16'/>
<id>urn:sha1:d1b06863fbc7b142d7afdf2d399087e2fab40f16</id>
<content type='text'>
* GENERAL
- Update copyright.
- Make kernel options for RANDOM_YARROW and RANDOM_DUMMY. Set
  neither to ON, which means we want Fortuna
- If there is no 'device random' in the kernel, there will be NO
  random(4) device in the kernel, and the KERN_ARND sysctl will
  return nothing. With RANDOM_DUMMY there will be a random(4) that
  always blocks.
- Repair kern.arandom (KERN_ARND sysctl). The old version went
  through arc4random(9) and was a bit weird.
- Adjust arc4random stirring a bit - the existing code looks a little
  suspect.
- Fix the nasty pre- and post-read overloading by providing explictit
  functions to do these tasks.
- Redo read_random(9) so as to duplicate random(4)'s read internals.
  This makes it a first-class citizen rather than a hack.
- Move stuff out of locked regions when it does not need to be
  there.
- Trim RANDOM_DEBUG printfs. Some are excess to requirement, some
  behind boot verbose.
- Use SYSINIT to sequence the startup.
- Fix init/deinit sysctl stuff.
- Make relevant sysctls also tunables.
- Add different harvesting "styles" to allow for different requirements
  (direct, queue, fast).
- Add harvesting of FFS atime events. This needs to be checked for
  weighing down the FS code.
- Add harvesting of slab allocator events. This needs to be checked for
  weighing down the allocator code.
- Fix the random(9) manpage.
- Loadable modules are not present for now. These will be re-engineered
  when the dust settles.
- Use macros for locks.
- Fix comments.

* src/share/man/...
- Update the man pages.

* src/etc/...
- The startup/shutdown work is done in D2924.

* src/UPDATING
- Add UPDATING announcement.

* src/sys/dev/random/build.sh
- Add copyright.
- Add libz for unit tests.

* src/sys/dev/random/dummy.c
- Remove; no longer needed. Functionality incorporated into randomdev.*.

* live_entropy_sources.c live_entropy_sources.h
- Remove; content moved.
- move content to randomdev.[ch] and optimise.

* src/sys/dev/random/random_adaptors.c src/sys/dev/random/random_adaptors.h
- Remove; plugability is no longer used. Compile-time algorithm
  selection is the way to go.

* src/sys/dev/random/random_harvestq.c src/sys/dev/random/random_harvestq.h
- Add early (re)boot-time randomness caching.

* src/sys/dev/random/randomdev_soft.c src/sys/dev/random/randomdev_soft.h
- Remove; no longer needed.

* src/sys/dev/random/uint128.h
- Provide a fake uint128_t; if a real one ever arrived, we can use
  that instead. All that is needed here is N=0, N++, N==0, and some
  localised trickery is used to manufacture a 128-bit 0ULLL.

* src/sys/dev/random/unit_test.c src/sys/dev/random/unit_test.h
- Improve unit tests; previously the testing human needed clairvoyance;
  now the test will do a basic check of compressibility. Clairvoyant
  talent is still a good idea.
- This is still a long way off a proper unit test.

* src/sys/dev/random/fortuna.c src/sys/dev/random/fortuna.h
- Improve messy union to just uint128_t.
- Remove unneeded 'static struct fortuna_start_cache'.
- Tighten up up arithmetic.
- Provide a method to allow eternal junk to be introduced; harden
  it against blatant by compress/hashing.
- Assert that locks are held correctly.
- Fix the nasty pre- and post-read overloading by providing explictit
  functions to do these tasks.
- Turn into self-sufficient module (no longer requires randomdev_soft.[ch])

* src/sys/dev/random/yarrow.c src/sys/dev/random/yarrow.h
- Improve messy union to just uint128_t.
- Remove unneeded 'staic struct start_cache'.
- Tighten up up arithmetic.
- Provide a method to allow eternal junk to be introduced; harden
  it against blatant by compress/hashing.
- Assert that locks are held correctly.
- Fix the nasty pre- and post-read overloading by providing explictit
  functions to do these tasks.
- Turn into self-sufficient module (no longer requires randomdev_soft.[ch])
- Fix some magic numbers elsewhere used as FAST and SLOW.

Differential Revision: https://reviews.freebsd.org/D2025
Reviewed by: vsevolod,delphij,rwatson,trasz,jmg
Approved by: so (delphij)
</content>
</entry>
<entry>
<title>Attempt to mitigate poor initialization of arc4 by one-shot</title>
<updated>2013-04-19T00:30:52Z</updated>
<author>
<name>Andrey A. Chernov</name>
<email>ache@FreeBSD.org</email>
</author>
<published>2013-04-19T00:30:52Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=2b50ce65be6c97b3507d45275133df39e95752e8'/>
<id>urn:sha1:2b50ce65be6c97b3507d45275133df39e95752e8</id>
<content type='text'>
reinitialization from yarrow right after good entropy is harvested.

Approved by:    secteam (delphij)
MFC after:      1 week
</content>
</entry>
<entry>
<title>Return arc4_i = arc4_j = 0; line from previous backing out since</title>
<updated>2008-07-26T16:42:45Z</updated>
<author>
<name>Andrey A. Chernov</name>
<email>ache@FreeBSD.org</email>
</author>
<published>2008-07-26T16:42:45Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=b834665cd5ce6141136f2f7c63d1e495790cf82a'/>
<id>urn:sha1:b834665cd5ce6141136f2f7c63d1e495790cf82a</id>
<content type='text'>
just found it in OpenBSD, see their sys/crypto/arc4.c, function
rc4_keysetup, line ctx-&gt;x = ctx-&gt;y = 0;

Obtained from:  OpenBSD
</content>
</entry>
<entry>
<title>Per rwatson's request:</title>
<updated>2008-07-25T15:53:32Z</updated>
<author>
<name>Andrey A. Chernov</name>
<email>ache@FreeBSD.org</email>
</author>
<published>2008-07-25T15:53:32Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=fff6495ea645e54b761d6d0eb9c7137e64c756b7'/>
<id>urn:sha1:fff6495ea645e54b761d6d0eb9c7137e64c756b7</id>
<content type='text'>
"If you don't get a review within a day or two, I would firmly recommend
backing out the changes"

back out all my changes as unreviewed by secteam@ yet.
</content>
</entry>
<entry>
<title>1) Initialize arc4_i and arc4_j to 0 after key mixing as recommended in</title>
<updated>2008-07-22T16:16:51Z</updated>
<author>
<name>Andrey A. Chernov</name>
<email>ache@FreeBSD.org</email>
</author>
<published>2008-07-22T16:16:51Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=d16863efa66ca857d48eeb1b1918457a7556eadb'/>
<id>urn:sha1:d16863efa66ca857d48eeb1b1918457a7556eadb</id>
<content type='text'>
draft-kaukonen-cipher-arcfour-03.txt (3.1.5)

2) Drop first 768 bytes as standard RC4-drop(768)
</content>
</entry>
<entry>
<title>Lock down arc4random so it can be safely called w/o Giant.</title>
<updated>2003-08-15T06:34:47Z</updated>
<author>
<name>Mike Silbersack</name>
<email>silby@FreeBSD.org</email>
</author>
<published>2003-08-15T06:34:47Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=2f823fa326f4b593bb8b9e74606e70a864c25426'/>
<id>urn:sha1:2f823fa326f4b593bb8b9e74606e70a864c25426</id>
<content type='text'>
Minor code reorganization was required, but the only functional
change was that the first 1024 bytes of output are thrown out
after each reseed, rather than just the initial seed.
</content>
</entry>
</feed>
