cmac: Add selftest.
* cipher/mac-cmac.c (check_one, selftests_cmac_3des): New. (selftests_cmac_aes, cmac_selftest): New. (cmac_ops): Add cmac_selftest. * src/fips.c (run_mac_selftests): Add CMAC selftests.
Original work was libgcrypt-1.8.3-cmac-selftest.patch from Red Hat.
API of check_one function is taken from cipher/hmac-tests.c of
libgcrypt 1.8, copyrighted by Free Software Foundation, Inc., then
modified for CMAC.
Covering the test vectors of original work, we use exactly same test
vectors from tests/basic.c.
- Co-authored-by: Tomáš Mráz <firstname.lastname@example.org>
- Signed-off-by: NIIBE Yutaka <email@example.com>