Hardware Security
What must be observed when implementing cryptographic code in constant time?
- AThe whole operation must always finish in exactly one second
- BThe clock must be stopped during processing
- 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.