Hardware Security

What must be observed when implementing cryptographic code in constant time?

  1. AThe whole operation must always finish in exactly one second
  2. BThe clock must be stopped during processing
  3. CBranch directions, loop counts and memory addresses accessed must not depend on secret values
Show answer and explanation

Answer: C. Branch directions, loop counts and memory addresses accessed must not depend on secret values

Constant time means processing time does not vary with secret values. If a secret determines which way an if goes, timing changes; if a secret selects an array index, cache traces change. So code computes both outcomes and selects with bit operations instead of branching, and never indexes tables with secrets. It is also necessary to confirm that compiler optimizations do not reintroduce branches.

  • A. It does not mean a fixed number of seconds.
  • B. The clock is not stopped.
  • C. Correct. It decouples timing and cache traces from secrets.
Practice this topic Back to topic

More Hardware Security questions

  1. What is the idea of partitioning a shared cache as a countermeasure to cache side channels?
  2. Why do some systems handling confidential work disable the CPU's simultaneous multithreading (SMT)?
  3. What countermeasure protects against external devices connected to a PC using DMA to read or write main memory without permission?
  4. What is the idea of "defense in depth," emphasized in hardware and software security?
  5. When manufacturing many devices, why give each device its own key instead of the same key in all of them?