summaryrefslogtreecommitdiff
path: root/src/drivers/ao_trng_send.c
Commit message (Collapse)AuthorAge
* altos/stmf0: Use double buffering for ChaosKeyKeith Packard2018-01-07
| | | | | | | This improves the USB performance of ChaosKey so that it doesn't NAK during data transfers at all. Signed-off-by: Keith Packard <keithp@keithp.com>
* chaoskey: Wait for input data to stabilize before using itKeith Packard2017-09-12
| | | | | | | The ADC data takes a while to start working after power on; wait for the range of input values to look reasonable before using the data. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/arm: Align data so that gcc 5.4 doesn't do byte-accesses. Add -Wcast-alignKeith Packard2016-12-17
| | | | | | | | | | | | | | | | | | | | | | Gcc 5.4.1 tracks alignment of data through assignments, so that a uint32_t pointer which comes from byte-aligned uint8_t data: extern uint8_t foo[]; uint32_t *q = (void *) foo; Fetches and stores through this pointer are done bytewise. This is slow (meh), but if q references a device register, things to bad very quickly. This patch works around this bug in the compiler by adding __attribute__((aligned(4))) tags to some variables, or changing them from uint8_t to uint32_t. Places doing this will now be caught as I've added -Wcast-align to the compiler flags. That required adding (void *) casts, after the relevant code was checked to make sure the compiler could tell that the addresses were aligned. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Use standard FIPS testing for chaoskeyKeith Packard2016-08-02
| | | | | | | Check to make sure we aren't repeating a block coming from the unwhitened source, which is the standard online FIPS test for RNGs. Signed-off-by: Keith Packard <keithp@keithp.com>
* Switch from GPLv2 to GPLv2+Keith Packard2016-07-12
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altosuilib: Fill preload map on site or lat/lon changeKeith Packard2016-05-27
| | | | | | | | This loads the map view with the selected area when the site entry is changed or the user hits return in the lat/lon fields. This lets you see the target launch site without having to load the whole preload set. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/chaoskey: Add another USB endpoint to read raw dataKeith Packard2016-03-02
| | | | | | | | | | | This replaces having the single output switch based on a pin value and allows us to box the device and still fetch raw data. For now, this will use a special libusb2 program, ao-chaosread, to pull bits as I haven't figure out how to make linux provide two /dev entries for one USB device. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add simple stats test to TRNG codeKeith Packard2016-02-07
| | | | | | | This detects broken hardware by making sure the standard deviation in the raw values used to compute each buffer is at least 128. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Delay TRNG ADC long enough for HV supply to stabilizeKeith Packard2016-02-07
| | | | | | | Looks like it takes about 70ms for the supply to start running right, so delay after powering it up for that long. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add power management to TRNG driverKeith Packard2016-02-07
| | | | | | | Support suspend/resume of the TRNG power supply, delaying after resume to wait for it to stabilize. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/chaoskey: Delay ADC reading for 250ms at startupKeith Packard2016-01-28
| | | | | | This lets the HV supply stabilize before we start sampling values. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/chaoskey: Add support for flipping between raw and cooked bitsKeith Packard2016-01-28
| | | | | | | | Plug the 'force bootloader' thing onto the board while it's running and it will generate raw bits instead of running them through the CRC to whiten. Useful for validating the raw hardware. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Have fast ADC ring buffer code use wrap-aroundKeith Packard2015-03-20
| | | | | | | | | Instead of requiring that the whole set of returned values fit precisely in the ring, allow for wrap-around so that we can fetch an odd number of ADC values. The previous version required that the fetch amount always be a factor of the ADC buffer size. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add chaoskey flash loaderKeith Packard2015-02-28
Signed-off-by: Keith Packard <keithp@keithp.com>