Crate rustkey

source ·

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§

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 some seed-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).