Skip to main content

keys_eq

Function keys_eq 

Source
pub fn keys_eq(a: &[u8; 32], b: &[u8; 32]) -> bool
Expand description

Fast 32-byte key equality using 4 x u64 word comparison.

Short-circuits on the first differing 8-byte chunk. Equivalent to a == b on the arrays but avoids the bytewise loop; this is the single word-compare body every key check in the runtime routes through (address_eq, Address == Address, the require_keys_eq! / require_keys_neq! macros, and the token precondition helpers).