cmac: enumerate cipher algorithms

Identify the CMAC ciphers with an enum instead of string.
This commit is contained in:
Miroslav Lichvar
2020-05-13 13:35:52 +02:00
parent a8c8f2f309
commit 972c476c5a
8 changed files with 52 additions and 19 deletions

12
util.c
View File

@@ -927,6 +927,18 @@ UTI_FloatHostToNetwork(double x)
/* ================================================== */
CMC_Algorithm
UTI_CmacNameToAlgorithm(const char *name)
{
if (strcmp(name, "AES128") == 0)
return CMC_AES128;
else if (strcmp(name, "AES256") == 0)
return CMC_AES256;
return CMC_INVALID;
}
/* ================================================== */
HSH_Algorithm
UTI_HashNameToAlgorithm(const char *name)
{