cybersecurity · beginner · ~15 min

Which compare is timing-safe?

Identify the timing-safe comparison strategy.

Challenge

Implement int is_timing_safe(const char *method) returning 1 for "xor-accumulate" and 0 for "early-return-memcmp".

Starter code

#include <string.h>

int is_timing_safe(const char *method) {
    /* TODO */
    return 0;
}

Solve this exercise in the browser editor — compile and run against the test harness, no setup required.