Mercurial > dropbear
diff dbutil.h @ 817:a625f9e135a4
Constant time memcmp for the hmac and password crypt
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 03 Oct 2013 22:25:30 +0800 |
parents | 504f33c684b5 |
children | 4095b6d7c9fc |
line wrap: on
line diff
--- a/dbutil.h Sat Sep 21 00:34:36 2013 +0800 +++ b/dbutil.h Thu Oct 03 22:25:30 2013 +0800 @@ -94,4 +94,7 @@ /* Dropbear assertion */ #define dropbear_assert(X) do { if (!(X)) { fail_assert(#X, __FILE__, __LINE__); } } while (0) +/* Returns 0 if a and b have the same contents */ +int constant_time_memcmp(const void* a, const void *b, size_t n); + #endif /* _DBUTIL_H_ */