implemented sha2_hasher which supports SHA-256, SHA-384 and SHA-512

This commit is contained in:
Martin Willi
2006-09-19 14:49:47 +00:00
parent 462129d332
commit e698dc4559
7 changed files with 741 additions and 50 deletions
+6 -11
View File
@@ -32,12 +32,12 @@
* String mappings for encryption_algorithm_t.
*/
mapping_t pseudo_random_function_m[] = {
{PRF_UNDEFINED, "PRF_UNDEFINED"},
{PRF_HMAC_MD5, "PRF_HMAC_MD5"},
{PRF_HMAC_SHA1, "PRF_HMAC_SHA1"},
{PRF_HMAC_TIGER, "PRF_HMAC_TIGER"},
{PRF_AES128_CBC, "PRF_AES128_CBC"},
{MAPPING_END, NULL}
{PRF_UNDEFINED, "PRF_UNDEFINED"},
{PRF_HMAC_MD5, "PRF_HMAC_MD5"},
{PRF_HMAC_SHA1, "PRF_HMAC_SHA1"},
{PRF_HMAC_TIGER, "PRF_HMAC_TIGER"},
{PRF_AES128_CBC, "PRF_AES128_CBC"},
{MAPPING_END, NULL}
};
/*
@@ -61,8 +61,3 @@ prf_t *prf_create(pseudo_random_function_t pseudo_random_function)
return NULL;
}
}
+6 -11
View File
@@ -31,7 +31,7 @@ typedef enum pseudo_random_function_t pseudo_random_function_t;
/**
* @brief Pseudo random function, as in IKEv2 RFC 3.3.2.
*
* Currently only the following algorithms are implemented and therefore supported:
* Currently only the following algorithms are implemented:
* - PRF_HMAC_MD5
* - PRF_HMAC_SHA1
*
@@ -39,16 +39,12 @@ typedef enum pseudo_random_function_t pseudo_random_function_t;
*/
enum pseudo_random_function_t {
PRF_UNDEFINED = 1024,
/**
* Implemented in class hmac_prf_t.
*/
/** Implemented via hmac_prf_t. */
PRF_HMAC_MD5 = 1,
/**
* Implemented in class hmac_prf_t.
*/
/** Implemented via hmac_prf_t. */
PRF_HMAC_SHA1 = 2,
PRF_HMAC_TIGER = 3,
PRF_AES128_CBC = 4
PRF_AES128_CBC = 4,
};
/**
@@ -72,9 +68,8 @@ typedef struct prf_t prf_t;
*/
struct prf_t {
/**
* @brief Generates pseudo random bytes and writes them
* in the buffer.
*
* @brief Generates pseudo random bytes and writes them in the buffer.
*
* @param this calling object
* @param seed a chunk containing the seed for the next bytes
* @param[out] buffer pointer where the generated bytes will be written