gpio provides only the constants for addressing the appropriate memory region. The GPIO pins
are not exposed in the ready-sold TKeys, so they are only of benefit for the unlocked versions.
trng is the module for the true-RNG. Note that this RNG is not guaranteed cryptographically-
secure and it is recommended to mix the entropy from the TRNG with cryptographically-suitable
mechanisms.
ROM_SIZE is not specified in tk1 memory model. Instead, this is the maximum allowed size that
is made available in EBR (Embedded Block RAM) in the verilog model. See
hw/application_fpg/core/rom/rtl/rom.v in the tillitis-key1 repository containing the
hardware, fpga and firmware content.
abort enters infinite loop, effectively aborting execution, with blinking red LED.
It uses 400,000 cycles for sleeps, therefore flashes at about twice as rapid as CPU halt on
illegal instruction.
EXPERIMENTAL!hash_firmware_rom computes the Blake2s hash-value of the TKey firmware in ROM.
The ROM is monitored for execution once the program-binary is loaded to prevent malicious
activity, but it is still readable. A checksum of the firmware may be useful to determine what
exact firmware is running on the device. Especially if (minor) changes are made to the
(memory-mapped) API.
random produces (reasonably) cryptographically-secure (needs to be verified/proved) random
bytes, using the TRNG, Blake2s and optionally seed data. If strong randomness is needed from
very first use, it is recommended to contribute some seed-entropy to get the buffer mixed up
faster.