experimental SHA2 HMAC and PRF implementations

This commit is contained in:
Martin Willi
2007-03-08 00:14:17 +00:00
parent 40695383ae
commit 3243e90188
5 changed files with 40 additions and 4 deletions
+11 -1
View File
@@ -34,7 +34,11 @@ ENUM_NEXT(integrity_algorithm_names, AUTH_HMAC_MD5_96, AUTH_AES_XCBC_96, AUTH_HM
"DES_MAC",
"KPDK_MD5",
"AES_XCBC_96");
ENUM_END(integrity_algorithm_names, AUTH_AES_XCBC_96);
ENUM_NEXT(integrity_algorithm_names, AUTH_HMAC_SHA2_256_128, AUTH_HMAC_SHA2_512_256, AUTH_AES_XCBC_96,
"AUTH_HMAC_SHA2_256_128",
"AUTH_HMAC_SHA2_384_192",
"AUTH_HMAC_SHA2_512_256");
ENUM_END(integrity_algorithm_names, AUTH_HMAC_SHA2_512_256);
/*
* Described in header.
@@ -49,6 +53,12 @@ signer_t *signer_create(integrity_algorithm_t integrity_algorithm)
return (signer_t *)hmac_signer_create(HASH_SHA1, 16);
case AUTH_HMAC_MD5_96:
return (signer_t *)hmac_signer_create(HASH_MD5, 12);
case AUTH_HMAC_SHA2_256_128:
return (signer_t *)hmac_signer_create(HASH_SHA256, 16);
case AUTH_HMAC_SHA2_384_192:
return (signer_t *)hmac_signer_create(HASH_SHA384, 24);
case AUTH_HMAC_SHA2_512_256:
return (signer_t *)hmac_signer_create(HASH_SHA512, 32);
default:
return NULL;
}
@@ -46,6 +46,12 @@ enum integrity_algorithm_t {
AUTH_KPDK_MD5 = 4,
AUTH_AES_XCBC_96 = 5,
/** Implemented via hmac_signer_t */
AUTH_HMAC_SHA2_256_128 = 12,
/** Implemented via hmac_signer_t */
AUTH_HMAC_SHA2_384_192 = 13,
/** Implemented via hmac_signer_t */
AUTH_HMAC_SHA2_512_256 = 14,
/** Implemented via hmac_signer_t */
AUTH_HMAC_SHA1_128 = 1025,
};