module MessageVerifier::Util

Extended Modules

Defined in:

message_verifier/util.cr

Instance Method Summary

Instance Method Detail

def fixed_length_secure_compare(a, b) #

Constant time string comparison, for fixed length strings.

The values compared should be of fixed length, such as strings that have already been processed by HMAC. Raises in case of length mismatch.


[View source]
def secure_compare(a, b) #

Constant time string comparison, for variable length strings.

The values are first processed by SHA256, so that we don't leak length info via timing attacks.


[View source]