logo

Crowdly

Наведений С код порівняння рядків  а і b виконується за константний час: ...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Наведений С код порівняння рядків а і b виконується за константний час:

bool secureStringCompare(const void *a, const void *b, size_t length) {

    const char *ca = a, *cb = b;

    uint8_t result = 0;

    for (size_t i = 0; i < length; i++) {

        result = result | (ca[i] ^ cb[i]);

    }

    return result == 0;

}

80%
20%
More questions like this

Want instant access to all verified answers on vns.lpnu.ua?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome