hmac: Add HMAC to 2lib library
authorDaisuke Nojiri <dnojiri@chromium.org>
Fri, 6 May 2016 00:21:29 +0000 (17:21 -0700)
committerchrome-bot <chrome-bot@chromium.org>
Wed, 11 May 2016 02:41:46 +0000 (19:41 -0700)
commitf3f9e00ef037695c4e792948effa1253f680c118
treecb60549b87c41f99138ec69b7a9a403b048c612c
parent5319565988fc5b1862d649fad985859929946a91
hmac: Add HMAC to 2lib library

This patch adds HMAC. HMAC will be used to sign/verify NVM structures.
Hash algorithms can be selected from those supported
by enum vb2_hash_algorithm (i.e. SHA1, SHA256, or SHA512).

BUG=chrome-os-partner:51907
BRANCH=tot
TEST=make runtests

Change-Id: I6d349bc807874fe2a5512aabcd7fbf67a4eaa40a
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/342880
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Makefile
firmware/2lib/2hmac.c [new file with mode: 0644]
firmware/2lib/2sha_utility.c
firmware/2lib/include/2crypto.h
firmware/2lib/include/2hmac.h [new file with mode: 0644]
firmware/2lib/include/2sha.h
tests/hmac_test.c [new file with mode: 0644]
tests/vb2_sha_tests.c