constantTimeEquals

Constant-time byte array comparison to prevent timing side-channel attacks.

Unlike ByteArray.contentEquals, this always compares every byte regardless of where the first mismatch occurs, preventing an attacker from inferring how many leading bytes match by measuring comparison time.

Return

true if both arrays have identical length and contents, false otherwise

Parameters

a

First byte array

b

Second byte array