Commit graph

7395 commits

Author SHA1 Message Date
bunnie
a360f3ee52 bump xous pins for RawTrng API 2024-06-13 15:49:35 +08:00
bunnie
9bfc4c51f6 add some trng build features 2024-06-13 15:43:42 +08:00
bunnie
76fb67dbe6 add global SFR setup for TRNG proper operation inside loader 2024-06-13 15:43:18 +08:00
bunnie
b24cf4fd8e add guardband code to driver 2024-06-13 15:42:58 +08:00
bunnie
6b9955c30e add raw-trng feature 2024-06-13 15:42:34 +08:00
bunnie
40651a37ea add RawTrng syscall implementation 2024-06-13 15:42:18 +08:00
bunnie
a5322eaa7a add sampling countermeasures to the kernel
this evolves the TRNG state further after reporting any raw samples
for QC to make it harder to reason about the TRNG state after QC.
2024-06-13 15:41:30 +08:00
bunnie
ed2b5ec84d add RawTrng SysCall to Xous API
This SysCall is introduced because not all hardware targets can
afford the luxury of a private TRNG port for the kernel.

In this case, an API is needed to exfiltrate random numbers from
the kernel so we can inspect them and check them for health.

If a TRNG is operating correctly, cherry-picking some values
out of it to QC the operation of the TRNG should be harmless.

Of course, nothing is truly stateless, and there is always a chance
that someone could construct a gadget using this to reduce the
potential state-space of the final random number generator. Therefore,
this API is (a) gated behind a feature flag and (b) any implementation
that plans to expose this should be coded with some countermeasures
to reduce data leakage after sampling.
2024-06-13 15:33:14 +08:00
bunnie
b99b545ef0 add raw test using new syscall 2024-06-13 15:32:51 +08:00
bunnie
34808beb8f remove unused dep 2024-06-13 15:32:34 +08:00
bunnie
3abb68cbdc adjust TRNG parameters to match hw reality 2024-06-13 15:32:06 +08:00
bunnie
82e5594da4 add auto-trng feature to the USB stack
for compact/quick testing of TRNG in a harness
2024-06-13 00:37:07 +08:00
bunnie
61ed5aa145 reduce debugging so USB serial works 2024-06-13 00:35:17 +08:00
bunnie
cf99fd99eb trng baseline test code 2024-06-13 00:35:02 +08:00
bunnie
9dc2b15d4f add xtask state 2024-06-12 14:17:16 +08:00
bunnie
1de497e3fe commit the todo 2024-06-12 14:16:49 +08:00
bunnie
4828d445bb remove boot delay on usb stack 2024-06-12 14:11:52 +08:00
bunnie
f1d9322c13 more time for windows to enumerate 2024-06-12 14:11:40 +08:00
bunnie
bbc7158dc1 cleanups to debug output
works under linux, not windows
2024-06-12 14:11:16 +08:00
bunnie
f0bde1064e
Merge pull request #553 from betrusted-io/fix-deps
fix broken build deps
2024-06-12 03:13:18 +08:00
bunnie
4ac5b1a597 fix broken build deps 2024-06-12 03:11:37 +08:00
bunnie
8029c30d31
Merge pull request #550 from betrusted-io/cram-usb
USB test integration for cramium target
2024-06-12 03:03:21 +08:00
bunnie
c84f4efba0
Merge pull request #552 from betrusted-io/fix-trng-dep
fix trng dep for tests
2024-06-12 01:07:53 +08:00
bunnie
2e502bd9ec fix trng dep for tests 2024-06-12 01:04:59 +08:00
bunnie
a425c863ae undo debug patch 2024-06-11 23:21:34 +08:00
bunnie
de5e5564c3 add usb dependency to the console 2024-06-11 23:19:27 +08:00
bunnie
91806a2030 add latest xtask state 2024-06-11 23:19:14 +08:00
bunnie
9a37ecc2d3 add a quick test shim for the keyboard emulator over USB 2024-06-11 23:18:49 +08:00
bunnie
f96ca0ee93 ok. finally, an end to end of HID: can send keys now to linux
windows still not working, it's fussier.
2024-06-11 23:18:13 +08:00
bunnie
7b2804eec5 endpoint enumeration now working
turns out that you *have* to enable the endpoints after your
address has been assigned. You can't do it before.

Very subtle one-liner in the docs that I missed until now. :-/
2024-06-11 22:30:55 +08:00
bunnie
f004c45f2a trying to debug ep activation problem
this commit hangs on a wait for ep to start running
2024-06-11 21:13:45 +08:00
bunnie
b08851b741 enumeration is now "mostly" working
- need to handle something with how stalls are handled
- need to handle responses to requests that don't exist
2024-06-11 16:38:34 +08:00
bunnie
cb12ee3769 first time we're seeing a handshake in xous. 2024-06-10 23:35:09 +08:00
bunnie
f7b4930209 part of the back-trace 2024-06-10 18:46:15 +08:00
bunnie
ac7b58b702 trying to back-trace to a working bootloader state 2024-06-10 18:45:44 +08:00
bunnie
3f75da8240 commits related to previous commit on demo 2024-06-09 23:53:55 +08:00
bunnie
99be442d16 working demo of first couple packets in loader 2024-06-09 23:51:30 +08:00
bunnie
546b12eda4 corresponding changes in usb service 2024-06-09 04:28:36 +08:00
bunnie
31e03a9bc7 add routines to move packets; refactor tricky bits
we're able to receive the setup packet, but still nothing is
being sent out of the core.
2024-06-09 04:27:31 +08:00
bunnie
26d15084a3 use a common device core for all views, with a lock on it for sharing
threading the needle between the USB device API requirments,
and our system's unique requirements.
2024-06-08 00:52:50 +08:00
bunnie
971bfea83d more telemetry on boot
also, it seems that some amount of boot setup is necessary
for stability? unsure, this has to be chased out, but later.
2024-06-08 00:52:11 +08:00
bunnie
a32a2f2395 more debug progress
- 2nd bank of magic numbers seems more stable-ish
- can now get to the point of a setup packet being received
and flagged
2024-06-08 00:51:13 +08:00
bunnie
ca8fd21c44 interrupts are minimally responsive now 2024-06-07 13:54:37 +08:00
bunnie
f313b8a866 cleanup test procedure and dependencies 2024-06-06 22:38:22 +08:00
bunnie
cafac2bda9 add stubs for trng testing 2024-06-06 22:26:45 +08:00
bunnie
d87f950da1 intermediate debug 2024-06-06 22:26:35 +08:00
bunnie
41d0364cf4 more debug 2024-06-06 22:26:16 +08:00
bunnie
9f43e1df0a fix edgecase in nocopy section
do not try to decrypt data for sections that are nocopy,
this can lead to spurious decryption errors
2024-06-06 22:19:42 +08:00
bunnie
529cdcc67d regenerate svd files for other targets 2024-06-06 18:07:08 +08:00
bunnie
2e2d4d423c compatibility cleanup 2024-06-06 18:05:51 +08:00