constant-time-zero? ( seq -- ? )
Cryptographic utilities

Prev:constant-time= ( a b -- ? )
Next:constant-time-select ( flag a b -- a/b )


Vocabulary
crypto.utils

Inputs
seqa sequence


Outputs
?t if all zeros, f otherwise


Word description
Checks if all bytes in a sequence are zero in constant time. Always examines all bytes regardless of where non-zero bytes occur.

Examples
USING: byte-arrays crypto.utils ; B{ 0 0 0 0 } constant-time-zero?
! => t

USING: byte-arrays crypto.utils ; B{ 0 0 1 0 } constant-time-zero?
! => f


Definition