Modules§
cpumonitor
module provides access to the CPU execution monitor.frame
module contains logic for constructing frames (header and payload) according to the specified protocol.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.io
module contains basic input/output operations.led
module controls the LED on the TKey.timer
module provides access to the device’s countdown-timer.touch
represents the touch-sensor of the TKey.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.
Enums§
Constants§
- The maximum possible size of an application, i.e. the size of available RAM.
TK1_APP_ADDR
the address to the start of the application loaded into TKey.TK1_APP_SIZE
the size of the application loaded into TKey.TK1_BLAKE2S_ADDR
provides the address to theblake2s
function in TKey firmware.TK1_CDI
provides access to the (application-specific) CDI value. (32 bytes, contiguous)TK1_NAME0
is the address for the first 4-byte app-name.TK1_NAME1
is the address for the second 4-byte app-name.TK1_VERSION
is the address for the app version.
Functions§
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.blake2s
performs a Blake2s hash calculation with immediate result.done
enters an infinite loop, effectively halting execution.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 someseed
-entropy to get the buffer mixed up faster.read_cdi
reads the compound device identifier (CDI).read_name_version
reads the name addresses and the version address.sleep
for specified number of cycles (delay by virtue of volatile writes).