/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_ssl.h :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: bchanot +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2018/09/20 23:18:13 by bchanot #+# #+# */ /* Updated: 2018/10/14 04:07:26 by bchanot ### ########.fr */ /* */ /* ************************************************************************** */ #ifndef FT_SSL_H # define FT_SSL_H # define ROL64(a, b) (((a) << (b)) | ((a) >> (64 - (b)))) # define ROR64(a, b) (((a) >> (b)) | ((a) << (64 - (b)))) # define ROL32(a, b) (((a) << (b)) | ((a) >> (32 - (b)))) # define ROR32(a, b) (((a) >> (b)) | ((a) << (32 - (b)))) # define CH(x, y, z) (((x) & (y)) ^ (~(x) & (z))) # define MAJ(x, y, z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) # define HASH_FUNCTIONS sl_md5, sl_sha224, sl_sha256, sl_sha384, sl_sha512 # define HASH_TAB "md5", "sha224", "sha256", "sha384", "sha512" # define NB_HASH 5 # include "libft.h" typedef struct s_files { char *name; char *string; t_bool s_opt; struct s_files *next; } t_files; typedef struct s_inf { char **opts; char *hash_tag; void (*func)(const char *str); t_files *files; } t_inf; int sl_get_inf(t_inf *inf, int ac, char **av); void sl_choose_hash(t_inf *inf); void sl_prepare_launch(t_inf *inf); void sl_md5(const char *str); void sl_sha224(const char *str); void sl_sha256(const char *str); void sl_sha384(const char *str); void sl_sha512(const char *str); #endif