From 6eec5b018db390a7e5b3f3b0017a7eb363a66062 Mon Sep 17 00:00:00 2001 From: Gregory Date: Wed, 27 Mar 2019 12:55:47 +0200 Subject: [PATCH] remove ft_sha.h from ft_pbkdf2.h --- inc/ft_pbkdf2.h | 12 +++++++++--- src/pbkdf2/ft_hmac_sha256.c | 1 + t/pbkdf2_tests.c | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/inc/ft_pbkdf2.h b/inc/ft_pbkdf2.h index f2f1ab36..e8e64270 100644 --- a/inc/ft_pbkdf2.h +++ b/inc/ft_pbkdf2.h @@ -1,10 +1,14 @@ -#include "ft_sha.h" + +#ifndef FT_PBKDF2_H +# define FT_PBKDF2_H + +#define FT_PBKDF2_RESULT 32 typedef struct s_hmac_sha256_ctx { unsigned char *key; unsigned char *msg; - unsigned char out[FT_SHA256_DIGEST_LENGTH_BYTE]; + unsigned char out[FT_PBKDF2_RESULT]; unsigned int key_size; unsigned int msg_size; } t_hmac_sha256_ctx; @@ -17,4 +21,6 @@ void ft_hmac_sha256_init_ctx void ft_hmac_sha256 ( t_hmac_sha256_ctx *ctx -); \ No newline at end of file +); + +#endif \ No newline at end of file diff --git a/src/pbkdf2/ft_hmac_sha256.c b/src/pbkdf2/ft_hmac_sha256.c index d99eebf6..22737f45 100644 --- a/src/pbkdf2/ft_hmac_sha256.c +++ b/src/pbkdf2/ft_hmac_sha256.c @@ -1,5 +1,6 @@ #include "ft_pbkdf2.h" #include "libft.h" +#include "ft_sha.h" static void set_padding ( diff --git a/t/pbkdf2_tests.c b/t/pbkdf2_tests.c index 8473ff31..61814eff 100644 --- a/t/pbkdf2_tests.c +++ b/t/pbkdf2_tests.c @@ -1,6 +1,7 @@ #include "t.h" #include "tests.h" #include "ft_pbkdf2.h" +#include "ft_sha.h" static int init_hmac_sha256_ctx() {