Home | History | Annotate | Download | only in include
History log of /src/sys/arch/x86/include/via_padlock.h
RevisionDateAuthorComments
 1.10  29-Jun-2020  riastradh padlock(4): Remove legacy rijndael API use.

This doesn't actually need to compute AES -- it just needs the
standard AES key schedule, so use the BearSSL constant-time key
schedule implementation.

XXX Compile-tested only.
XXX The byte-order business here seems highly questionable.
 1.9  27-Feb-2016  tls Remove callout-based RNG support in VIA crypto driver; add VIA RNG backend for cpu_rng.
 1.8  13-Apr-2015  riastradh Convert arch/x86 to use <sys/rnd*.h>. Omit needless includes.
 1.7  19-Nov-2011  tls branches: 1.7.8; 1.7.26;
First step of random number subsystem rework described in
<20111022023242.BA26F14A158@mail.netbsd.org>. This change includes
the following:

An initial cleanup and minor reorganization of the entropy pool
code in sys/dev/rnd.c and sys/dev/rndpool.c. Several bugs are
fixed. Some effort is made to accumulate entropy more quickly at
boot time.

A generic interface, "rndsink", is added, for stream generators to
request that they be re-keyed with good quality entropy from the pool
as soon as it is available.

The arc4random()/arc4randbytes() implementation in libkern is
adjusted to use the rndsink interface for rekeying, which helps
address the problem of low-quality keys at boot time.

An implementation of the FIPS 140-2 statistical tests for random
number generator quality is provided (libkern/rngtest.c). This
is based on Greg Rose's implementation from Qualcomm.

A new random stream generator, nist_ctr_drbg, is provided. It is
based on an implementation of the NIST SP800-90 CTR_DRBG by
Henric Jungheim. This generator users AES in a modified counter
mode to generate a backtracking-resistant random stream.

An abstraction layer, "cprng", is provided for in-kernel consumers
of randomness. The arc4random/arc4randbytes API is deprecated for
in-kernel use. It is replaced by "cprng_strong". The current
cprng_fast implementation wraps the existing arc4random
implementation. The current cprng_strong implementation wraps the
new CTR_DRBG implementation. Both interfaces are rekeyed from
the entropy pool automatically at intervals justifiable from best
current cryptographic practice.

In some quick tests, cprng_fast() is about the same speed as
the old arc4randbytes(), and cprng_strong() is about 20% faster
than rnd_extract_data(). Performance is expected to improve.

The AES code in src/crypto/rijndael is no longer an optional
kernel component, as it is required by cprng_strong, which is
not an optional kernel component.

The entropy pool output is subjected to the rngtest tests at
startup time; if it fails, the system will reboot. There is
approximately a 3/10000 chance of a false positive from these
tests. Entropy pool _input_ from hardware random numbers is
subjected to the rngtest tests at attach time, as well as the
FIPS continuous-output test, to detect bad or stuck hardware
RNGs; if any are detected, they are detached, but the system
continues to run.

A problem with rndctl(8) is fixed -- datastructures with
pointers in arrays are no longer passed to userspace (this
was not a security problem, but rather a major issue for
compat32). A new kernel will require a new rndctl.

The sysctl kern.arandom() and kern.urandom() nodes are hooked
up to the new generators, but the /dev/*random pseudodevices
are not, yet.

Manual pages for the new kernel interfaces are forthcoming.
 1.6  19-Feb-2011  jmcneill branches: 1.6.4;
modularize VIA PadLock support
- retire options VIA_PADLOCK, replace with 'padlock0 at cpu0'
- driver supports attach & detach
- support building as a module
 1.5  01-Apr-2009  drochner branches: 1.5.4; 1.5.6; 1.5.8;
sort out what is needed for crash(8) and what not, should fix
recent build errors
 1.4  01-Apr-2009  tls Fix probe for VIA C3 and successors -- these are CPU family 6, not 5.
The broken probe was causing the VIA padlock driver to never attach!
Now we can see that its AES appears to be broken -- it makes FAST_IPSEC
ESP not work, on systems where it works fine with cryptosoft.

Rework code to detect and (if necessary) enable VIA crypto and RNG.
Add RNG support to VIA padlock driver. In the process, have a quick
go at debugging the AES support but no luck thus far.
 1.3  07-Mar-2009  ad Expose more stuff if _KMEMUSER is defined.
 1.2  16-Apr-2008  cegger branches: 1.2.4; 1.2.12; 1.2.18;
- use aprint_*_dev and device_xname
- use POSIX integer types
 1.1  17-Feb-2007  daniel branches: 1.1.2; 1.1.4; 1.1.46;
Add an opencrypto provider for the AES xcrypt instructions found on VIA
C5P and later cores (also known as 'ACE', which is part of the VIA PadLock
security engine). Ported from OpenBSD.

Reviewed on tech-crypto and port-i386, no objections to commiting this.
 1.1.46.1  02-Jun-2008  mjf Sync with HEAD.
 1.1.4.2  26-Feb-2007  yamt sync with head.
 1.1.4.1  17-Feb-2007  yamt file via_padlock.h was added on branch yamt-lazymbuf on 2007-02-26 09:08:49 +0000
 1.1.2.2  17-Feb-2007  daniel Add an opencrypto provider for the AES xcrypt instructions found on VIA
C5P and later cores (also known as 'ACE', which is part of the VIA PadLock
security engine). Ported from OpenBSD.

Reviewed on tech-crypto and port-i386, no objections to commiting this.
 1.1.2.1  17-Feb-2007  daniel file via_padlock.h was added on branch yamt-idlelwp on 2007-02-17 00:28:26 +0000
 1.2.18.3  28-Mar-2011  jym Sync with HEAD. TODO before merge:
- shortcut for suspend code in sysmon, when powerd(8) is not running.
Borrow ``xs_watch'' thread context?
- bug hunting in xbd + xennet resume. Rings are currently thrashed upon
resume, so current implementation force flush them on suspend. It's not
really needed.
 1.2.18.2  01-Nov-2009  jym Sync with HEAD.
 1.2.18.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.2.12.1  28-Apr-2009  skrll Sync with HEAD.
 1.2.4.1  04-May-2009  yamt sync with head.
 1.5.8.1  05-Mar-2011  bouyer Sync with HEAD
 1.5.6.1  06-Jun-2011  jruoho Sync with HEAD.
 1.5.4.1  05-Mar-2011  rmind sync with head
 1.6.4.1  17-Apr-2012  yamt sync with head
 1.7.26.2  19-Mar-2016  skrll Sync with HEAD
 1.7.26.1  06-Jun-2015  skrll Sync with HEAD
 1.7.8.1  03-Dec-2017  jdolecek update from HEAD

RSS XML Feed