Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/sys/arch



Module Name:    src
Committed By:   riastradh
Date:           Mon Dec  9 04:51:04 UTC 2019

Modified Files:
        src/sys/arch/arm/sunxi: files.sunxi
        src/sys/arch/evbarm/conf: GENERIC64
Added Files:
        src/sys/arch/arm/sunxi: sun8i_crypto.c sun8i_crypto.h

Log Message:
Draft driver for Allwinner Crypto Engine.

Found on, e.g., the Pinebook.

Only used for TRNG at the moment, but hooking it up to opencrypto(9)
shouldn't be too hard if anyone still cares about that these days.

The distribution of the alleged TRNG is very nonuniform distributed
seems to alternate between toward runs with exceptionally high
fractions of 0 bits and runs with exceptionally high fractions of 1
bits -- initially all my samples were mostly 0's, and then all my
samples were mostly 1's, and now I'm seeing more oscillation between
these runs.

So I've wired it up as RND_TYPE_UNKNOWN, not RND_TYPE_RNG (it will
immediately flunk our rngtest and be disabled), and I estimated it to
provide at most one bit of entropy per byte of data -- which may
still be optimistic.  I also added a sysctl node hw.sun8icryptoN.rng
to read out 1024-byte samples for analysis, and I left the driver
commented out in GENERIC64 for now.

(If anyone has contacts at Allwinner who can tell us about how the
alleged TRNG is supposed to work, please let me know!)


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/arm/sunxi/files.sunxi
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/sunxi/sun8i_crypto.c \
    src/sys/arch/arm/sunxi/sun8i_crypto.h
cvs rdiff -u -r1.115 -r1.116 src/sys/arch/evbarm/conf/GENERIC64

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index