#
1.2 |
|
13-Jun-2020 |
riastradh |
Rework sun8i crypto.
- Preallocate tasks and DMA maps together for now, for 4k transfers. - Confine setup of the task descriptor to a single function, without bus_dmamap_t as an input; just use the preallocated DMA maps. - Take the DMA map part out of sun8i_crypto_buf. => Not much left here, just a dmamem segment and kva mapping.
This should make it easier to use with opencrypto.
|
#
1.1 |
|
09-Dec-2019 |
riastradh |
branches: 1.1.6; 1.1.10; 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!)
|
#
1.1 |
|
09-Dec-2019 |
riastradh |
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!)
|