vboot: use vb2_safe_memcmp instead of SafeMemcmp

No need to have two implementations of this now.

BUG=chromium:611535
BRANCH=none
TEST=make runtests; emerge-kevin coreboot depthcharge

Change-Id: I18bac928eb09971c37f3e1d7cbfd2009999b1f31
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/400899
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
This commit is contained in:
Randall Spangler
2016-10-14 10:41:44 -07:00
parent bf6263d529
commit 49e517d818
8 changed files with 50 additions and 101 deletions

View File

@@ -46,18 +46,6 @@
/* Return the minimum of (a) or (b). */
#define Min(a, b) (((a) < (b)) ? (a) : (b))
/**
* Compare [n] bytes starting at [s1] with [s2] and return 0 if they
* match, 1 if they don't. Returns 0 if n=0, since no bytes mismatched.
*
* Time taken to perform the comparison is only dependent on [n] and
* not on the relationship of the match between [s1] and [s2].
*
* Note that unlike memcmp(), this only indicates inequality, not
* whether s1 is less than or greater than s2.
*/
int SafeMemcmp(const void *s1, const void *s2, size_t n);
/*
* Buffer size required to hold the longest possible output of Uint64ToString()
* - that is, Uint64ToString(~0, 2).