signature_digest/SignatureDigest: convert vb2_crypto to hash algorithm

We were passing the wrong value to PrependDigestInfo. Let's also refactor
the function a little bit.

BRANCH=none
BUG=chromium:689371
TEST=make gentestcases; git status => no change

Change-Id: I0244c3f3de05b33b7ddd21e93a266faf34f2c239
Reviewed-on: https://chromium-review.googlesource.com/439086
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
1 file changed