implemented sha2_hasher which supports SHA-256, SHA-384 and SHA-512
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include "hasher.h"
|
||||
|
||||
#include <crypto/hashers/sha1_hasher.h>
|
||||
#include <crypto/hashers/sha2_hasher.h>
|
||||
#include <crypto/hashers/md5_hasher.h>
|
||||
|
||||
/**
|
||||
@@ -51,6 +52,12 @@ hasher_t *hasher_create(hash_algorithm_t hash_algorithm)
|
||||
{
|
||||
return (hasher_t*)sha1_hasher_create();
|
||||
}
|
||||
case HASH_SHA256:
|
||||
case HASH_SHA384:
|
||||
case HASH_SHA512:
|
||||
{
|
||||
return (hasher_t*)sha2_hasher_create(hash_algorithm);
|
||||
}
|
||||
case HASH_MD5:
|
||||
{
|
||||
return (hasher_t*)md5_hasher_create();
|
||||
|
||||
Reference in New Issue
Block a user