vboot2: move vb2_safe_memcmp() from rsa to common

This will be needed by other algorithms, so should not live inside the
rsa module.  Also added explicit unit tests for it.

BUG=chromium:423882
BRANCH=none
TEST=VBOOT2=1 make runtests

Change-Id: I92c8c6484964a93d755ac2ee93b57511794540e9
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/224111
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
4 files changed