diff --git a/.gitignore b/.gitignore index c6127b3..0ac0f15 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,6 @@ modules.order Module.symvers Mkfile.old dkms.conf + +ft_ssl +.vscode diff --git a/Makefile b/Makefile index 162c62e..7cccece 100644 --- a/Makefile +++ b/Makefile @@ -6,11 +6,10 @@ # By: cpieri +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2018/03/15 11:20:25 by cpieri #+# #+# # -# Updated: 2019/04/11 16:35:38 by cpieri ### ########.fr # +# Updated: 2020/02/04 10:12:31 by cpieri ### ########.fr # # # # **************************************************************************** # - NAME = ft_ssl CC = gcc @@ -27,31 +26,62 @@ SRC_PATH= srcs OBJ_PATH= obj -DEPS = Makefile \ - includes/ft_ssl.h \ - includes/define.h \ - includes/constant.h \ - includes/enum.h \ - includes/functions.h \ - includes/structure.h \ - includes/hash/sha256.h \ - includes/hash/hash.h \ - includes/hash/md5.h \ +DEPS = Makefile \ + includes/ft_ssl.h \ + includes/define.h \ + includes/enum.h \ + includes/functions.h \ + includes/structure.h \ + includes/hash/sha256.h \ + includes/hash/hash.h \ + includes/hash/md5.h \ + includes/hash/sha1.h \ + includes/hash/hmac.h \ + includes/base64/base64.h \ + includes/evp/pbkdf.h \ + includes/symmetric/symmetric.h \ + includes/symmetric/des/des.h \ libft/libft.a -SRC_NAME= main.c \ - clean.c \ - usage.c \ - parsing.c \ - get_data.c \ - lst_opt.c \ - hash/hash.c \ - hash/hash_parsing.c \ - hash/display_hash.c \ - hash/sha256/sha256.c \ - hash/sha256/sha256_utils.c \ - hash/md5/md5_utils.c \ - hash/md5/md5.c \ +SRC_NAME= main.c \ + parsing.c \ + dispatch.c \ + tools/clean.c \ + tools/usage.c \ + tools/error.c \ + tools/get_data.c \ + tools/get_data_1.c \ + tools/open_fd.c \ + tools/lst_opt.c \ + hash/hash_parsing.c \ + hash/display_hash.c \ + hash/hash_tools.c \ + hash/sha256/sha256.c \ + hash/sha256/sha256_utils.c \ + hash/md5/md5_utils.c \ + hash/md5/md5.c \ + hash/sha1/sha1.c \ + hash/sha1/sha1_utils.c \ + hash/hmac/hmac_utils.c \ + hash/hmac/hmac_md5.c \ + hash/hmac/hmac_sha1.c \ + hash/hmac/hmac_sha256.c \ + base64/base64.c \ + base64/base64_encode.c \ + base64/base64_decode.c \ + base64/base64_parsing.c \ + base64/base64_help_parsing.c \ + base64/base64_display.c \ + evp/pbkdf2.c \ + evp/pbkdf2_utils.c \ + evp/evp_struct.c \ + evp/evp_bytes2key.c \ + evp/evp_b2k_utils.c \ + symmetric/symmetric_usage.c \ + symmetric/symmetric_parsing.c \ + symmetric/symmetric_parsing_pt_f.c \ + symmetric/symmetric_parsing_pt_f_2.c \ + symmetric/des/des.c \ OBJ_NAME= $(SRC_NAME:.c=.o) @@ -67,7 +97,7 @@ BLUE = \033[34m MAGENTA = \033[35m CYAN = \033[36m -.PHONY: all clean fclean re echo norm +.PHONY: all clean fclean re echo all: LFT $(NAME) diff --git a/includes/base64/base64.h b/includes/base64/base64.h new file mode 100644 index 0000000..9efca65 --- /dev/null +++ b/includes/base64/base64.h @@ -0,0 +1,55 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* base64.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/04/12 11:59:40 by cpieri #+# #+# */ +/* Updated: 2019/05/08 13:03:15 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef BASE64_H +# define BASE64_H + +# include "../libft/include/libft.h" +# include "../structure.h" + +enum e_base64_flags +{ + e_base64_encode = 0x00000001, + e_base64_decode = 0x00000010, + e_base64_inputf = 0x00000100, + e_base64_outputf = 0x00001000, +}; + +typedef struct s_base64_encode +{ + uint8_t n0; + uint8_t n1; + uint8_t n2; + uint8_t n3; +} t_base64_encode; + +/* +** Encode/Decode Base64 +*/ +void *base64(void *opts, size_t len_opts); +uint8_t *base64_encode(uint8_t *msg, size_t len); +uint8_t *base64_decode(uint8_t *msg, size_t len); + +/* +** Functions for Print Base64 +*/ +void printing_base64(t_data *data, const char *hash_type, + t_flags flags); + +/* +** Funtions for Parse opts Base64 +*/ +t_opt *base64_opts(const int ac, char **av, t_opt *opts, int now); +void get_b64_ed(t_data **data, t_flags *flags, char *fd, char c); +void get_b64_i(t_data **data, t_flags *flags, char *fd, int *now); + +#endif diff --git a/includes/define.h b/includes/define.h index 18b1a9b..35738b3 100644 --- a/includes/define.h +++ b/includes/define.h @@ -6,11 +6,11 @@ /* By: cpieri +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/04/11 12:43:16 by cpieri #+# #+# */ -/* Updated: 2019/04/11 12:43:43 by cpieri ### ########.fr */ +/* Updated: 2019/12/17 09:31:11 by cpieri ### ########.fr */ /* */ /* ************************************************************************** */ -#ifndef DEFINE_H +#ifndef DEFINE_H # define DEFINE_H # define FAILURE -1 @@ -19,4 +19,13 @@ # define NO_CMD 1 # define INVALID_CMD 2 -#endif \ No newline at end of file +# define NONE "\033[0m" +# define RED "\033[31m" +# define GREEN "\033[32m" +# define YELLOW "\033[33m" +# define BLUE "\033[34m" +# define MAGENTA "\033[35m" +# define CYAN "\033[36m" +# define PINK "\033[38;5;206m" + +#endif diff --git a/includes/enum.h b/includes/enum.h index 688055f..7cf0ce8 100644 --- a/includes/enum.h +++ b/includes/enum.h @@ -6,11 +6,11 @@ /* By: cpieri +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/04/11 14:34:08 by cpieri #+# #+# */ -/* Updated: 2019/04/11 16:11:35 by cpieri ### ########.fr */ +/* Updated: 2019/05/08 12:45:48 by cpieri ### ########.fr */ /* */ /* ************************************************************************** */ -#ifndef ENUM_H +#ifndef ENUM_H # define ENUM_H enum e_algo @@ -19,12 +19,4 @@ enum e_algo e_cipher, }; -enum e_cipher_flags -{ - e_base64_encode = 1, - e_base64_decode, - e_base64_inputf, - e_base64_outputf, -}; - -#endif \ No newline at end of file +#endif diff --git a/includes/evp/evp.h b/includes/evp/evp.h new file mode 100644 index 0000000..d6796d0 --- /dev/null +++ b/includes/evp/evp.h @@ -0,0 +1,46 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* evp.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/03 09:13:54 by cpieri #+# #+# */ +/* Updated: 2020/04/20 10:42:41 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef EVP_H +# define EVP_H + +# include "../../libft/include/libft.h" +# include "../structure.h" +# include "../functions.h" +# include "../hash/hash.h" +# include + +typedef struct s_evp +{ + void *pass; + void *salt; + void *key; + void *vect; + size_t pass_len; + size_t salt_len; + size_t dk_len; + size_t iv_len; +} t_evp; + +typedef struct s_evp_size +{ + size_t key_len; + size_t iv_len; + size_t dk_len; +} t_evp_size; + +t_evp *new_t_evp(uint8_t *pass, void *salt, void *key, void *vect); +void print_evp(t_evp *to_print); +void free_evp(t_evp **to_free); +void free_vevp(void **to_free); + +#endif diff --git a/includes/evp/evp_bytes2key.h b/includes/evp/evp_bytes2key.h new file mode 100644 index 0000000..328cc03 --- /dev/null +++ b/includes/evp/evp_bytes2key.h @@ -0,0 +1,39 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* evp_bytes2key.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/04 10:03:30 by cpieri #+# #+# */ +/* Updated: 2020/04/20 10:26:35 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef EVP_BYTES2KEY_H +# define EVP_BYTES2KEY_H + +# include "./evp.h" +# include "../hash/md5.h" +# include "../hash/sha1.h" +# include "../hash/sha256.h" + +enum e_hash_f +{ + EVP_MD5 = 0x000000001, + EVP_SHA1 = 0x000000010, + EVP_SHA256 = 0x000000100 +}; + +typedef struct s_evp_hash +{ + enum e_hash_f hash_f; + void *(*f)(void *, size_t); + size_t nb_word; +} t_evp_hash; + +t_evp_hash evp_get_hashf(enum e_hash_f name); +void *evp_bytes2key(t_evp *k, uint32_t c, + t_evp_size full_size, int func); + +#endif diff --git a/includes/evp/pbkdf.h b/includes/evp/pbkdf.h new file mode 100644 index 0000000..435c835 --- /dev/null +++ b/includes/evp/pbkdf.h @@ -0,0 +1,37 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* pbkdf.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/05/20 10:11:40 by cpieri #+# #+# */ +/* Updated: 2020/04/20 10:26:56 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef PBKDF_H +# define PBKDF_H + +# include "./evp.h" +# include "../hash/hmac.h" + +enum e_prf +{ + HMAC_MD5 = 0x000000001, + HMAC_SHA1 = 0x000000010, + HMAC_SHA256 = 0x000000100 +}; + +typedef struct s_prf +{ + enum e_prf prf; + void *(*f)(void *, size_t, void *, size_t); + size_t nb_word; +} t_prf; + +t_prf pbkdf2_get_prf(enum e_prf name); +void pbkdf2_xor_dgst(void const *dgst1, void const *dgst2, size_t n); +void *pbkdf2(t_evp *k, uint32_t c, t_evp_size full_size, int func); + +#endif diff --git a/includes/ft_ssl.h b/includes/ft_ssl.h index 9218dc4..fb24615 100644 --- a/includes/ft_ssl.h +++ b/includes/ft_ssl.h @@ -6,7 +6,7 @@ /* By: cpieri +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/03/06 12:40:02 by cpieri #+# #+# */ -/* Updated: 2019/04/11 16:36:18 by cpieri ### ########.fr */ +/* Updated: 2019/12/30 09:01:15 by cpieri ### ########.fr */ /* */ /* ************************************************************************** */ @@ -15,11 +15,13 @@ # include "../libft/include/libft.h" # include "./hash/md5.h" +# include "./hash/sha1.h" # include "./hash/sha256.h" +# include "./base64/base64.h" +# include "./symmetric/symmetric.h" # include "define.h" # include "enum.h" # include "structure.h" # include "functions.h" -# include "constant.h" #endif diff --git a/includes/functions.h b/includes/functions.h index 3a7df2b..cc89f82 100644 --- a/includes/functions.h +++ b/includes/functions.h @@ -6,43 +6,55 @@ /* By: cpieri +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/04/11 12:44:05 by cpieri #+# #+# */ -/* Updated: 2019/04/11 16:34:44 by cpieri ### ########.fr */ +/* Updated: 2020/02/04 09:47:01 by cpieri ### ########.fr */ /* */ /* ************************************************************************** */ -#ifndef FUNCTIONS_H +#ifndef FUNCTIONS_H # define FUNCTIONS_H /* -** Functions for Parsing +** Functions Dispatchers */ -t_parse parsing(const int ac, char **av); -t_opt *hash_opts(const int ac, char **av, t_opt *opts, int now); -int open_fd(const char *file); -t_data *get_data(const int fd, const char *fd_name); -t_data *get_file(const int fd, const char *fd_name); -t_data *get_string(char *s); +t_parse parsing(const int ac, char **av); +void dispatch(t_parse *parse); /* -** Functions for Lst_opt +** Functions for Open and Close */ -t_opt *new_opt(t_flags flags, t_data *data); -void add_to_end_lst(t_opt *new, t_opt **lst); -void print_lst(t_opt **lst); +int open_fd(const char *file); +int open_write_fd(const char *file); +int close_fd(const int fd); +int reopen_fd(const int current_fd, const char *file); /* -** Functions for Hashing msg and display final hash +** Functions for get File, Data, or String +*/ +t_data *new_data(void); +t_data *get_data(const int fd, const char *fd_name); +t_data *get_file(const int fd, const char *fd_name); +t_data *get_string(char *s); +void *get_random(void); +uint8_t *get_pass(const char *prompt); + +/* +** Functions for Lst_opt */ -void hashing(t_parse *parse); -void printing_hash(t_data *data, const char *hash_type, t_flags flags); +t_opt *new_opt_fd(t_flags flags, t_data *data, char *fd); +t_opt *new_opt(t_flags flags, t_data *data); +void add_to_end_lst(t_opt *new, t_opt **lst); +void print_lst(t_opt **lst); /* ** Functions for Exit, Clean, Error */ -void exit_error(void); -void exit_error_free(void **to_free); -void print_error(const char *msg_1); -void print_usage(const int usage_int, const char *command); -void clean_prog(t_parse *parse); +void exit_error(void); +void exit_msg(const char *msg); +void exit_error_msg(const char *msg); +void exit_error_free(void **to_free); +void print_error(const char *msg); +void print_usage(const int usage_int, const char *command); +void clean_prog(t_parse *parse); +void clean_data(t_data **data); -#endif \ No newline at end of file +#endif diff --git a/includes/hash/hash.h b/includes/hash/hash.h index 367482a..90bb109 100644 --- a/includes/hash/hash.h +++ b/includes/hash/hash.h @@ -6,14 +6,15 @@ /* By: cpieri +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/03/08 11:41:09 by cpieri #+# #+# */ -/* Updated: 2019/04/11 12:46:06 by cpieri ### ########.fr */ +/* Updated: 2019/12/12 14:37:23 by cpieri ### ########.fr */ /* */ /* ************************************************************************** */ #ifndef HASH_H # define HASH_H -# include "../libft/include/libft.h" +# include "../../libft/include/libft.h" +# include "../structure.h" typedef struct s_hash { @@ -30,4 +31,10 @@ typedef struct s_padding uint8_t *msg8; } t_padding; +t_opt *hash_opts(const int ac, char **av, t_opt *opts, int now); +char *hex2sum(uint32_t *h, size_t nb_h); +char *one_sum(uint32_t *h, size_t nb_h); +void printing_hash(t_data *data, const char *hash_type, + t_flags flags); + #endif diff --git a/includes/hash/hmac.h b/includes/hash/hmac.h new file mode 100644 index 0000000..2601491 --- /dev/null +++ b/includes/hash/hmac.h @@ -0,0 +1,31 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* hmac.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/12/31 08:17:41 by cpieri #+# #+# */ +/* Updated: 2019/12/31 13:33:46 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef HMAC_H +# define HMAC_H + +# include "hash.h" + +# define I_PAD 0x36 +# define O_PAD 0x5c +# define HMAC_BLOCK_SIZE_512 64 +# define HMAC_BLOCK_SIZE_1024 128 + +void *hmac_512_padding_key(void *key, size_t *key_len); +void *hmac_512_xor_ipad(void const *key, size_t key_len); +void *hmac_512_xor_opad(void const *key, size_t key_len); + +void *hmac_sha1(void *pwd, size_t pwd_len, void *key, size_t key_len); +void *hmac_sha256(void *pwd, size_t pwd_len, void *key, size_t key_len); +void *hmac_md5(void *pwd, size_t pwd_len, void *key, size_t key_len); + +#endif diff --git a/includes/hash/md5.h b/includes/hash/md5.h index a1e17a8..f49e164 100644 --- a/includes/hash/md5.h +++ b/includes/hash/md5.h @@ -6,7 +6,7 @@ /* By: cpieri +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/03/06 12:16:22 by cpieri #+# #+# */ -/* Updated: 2019/04/11 14:11:08 by cpieri ### ########.fr */ +/* Updated: 2019/12/30 08:36:13 by cpieri ### ########.fr */ /* */ /* ************************************************************************** */ @@ -20,28 +20,6 @@ # define MD5_H2 0x98BADCFE # define MD5_H3 0x10325476 -static const uint32_t g_r_md5[64] = { - 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, - 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, 23, 4, - 11, 16, 23, 4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, - 10, 15, 21 -}; - -static const uint32_t g_k_md5[64] = { - 3614090360, 3905402710, 606105819, 3250441966, 4118548399, 1200080426, - 2821735955, 4249261313, 1770035416, 2336552879, 4294925233, 2304563134, - 1804603682, 4254626195, 2792965006, 1236535329, 4129170786, 3225465664, - 643717713, 3921069994, 3593408605, 38016083, 3634488961, 3889429448, - 568446438, 3275163606, 4107603335, 1163531501, 2850285829, 4243563512, - 1735328473, 2368359562, 4294588738, 2272392833, 1839030562, 4259657740, - 2763975236, 1272893353, 4139469664, 3200236656, 681279174, 3936430074, - 3572445317, 76029189, 3654602809, 3873151461, 530742520, 3299628645, - 4096336452, 1126891415, 2878612391, 4237533241, 1700485571, 2399980690, - 4293915773, 2240044497, 1873313359, 4264355552, 2734768916, 1309151649, - 4149444226, 3174756917, 718787259, 3951481745 -}; - - typedef struct s_md5_utils { uint32_t f; @@ -62,10 +40,10 @@ typedef struct s_md5 uint32_t *w; } t_md5; -t_md5_utils func_f(uint32_t b, uint32_t c, uint32_t d, int i); -t_md5_utils func_g(uint32_t b, uint32_t c, uint32_t d, int i); -t_md5_utils func_h(uint32_t b, uint32_t c, uint32_t d, int i); -t_md5_utils func_i(uint32_t b, uint32_t c, uint32_t d, int i); +t_md5_utils func_md5_f(uint32_t b, uint32_t c, uint32_t d, int i); +t_md5_utils func_md5_g(uint32_t b, uint32_t c, uint32_t d, int i); +t_md5_utils func_md5_h(uint32_t b, uint32_t c, uint32_t d, int i); +t_md5_utils func_md5_i(uint32_t b, uint32_t c, uint32_t d, int i); t_hash *set_hash2md5(t_md5 *e); void *md5(void *data, size_t len_data); diff --git a/includes/hash/sha1.h b/includes/hash/sha1.h new file mode 100644 index 0000000..e7d851f --- /dev/null +++ b/includes/hash/sha1.h @@ -0,0 +1,53 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* sha1.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/12/30 08:05:02 by cpieri #+# #+# */ +/* Updated: 2019/12/31 13:33:56 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef SHA1_H +# define SHA1_H + +# include "hash.h" + +# define SHA1_H0 0x67452301 +# define SHA1_H1 0xEFCDAB89 +# define SHA1_H2 0x98BADCFE +# define SHA1_H3 0x10325476 +# define SHA1_H4 0xC3D2E1F0 + +typedef struct s_sha1_utils +{ + uint32_t f; + uint32_t k; +} t_sha1_utils; + +typedef struct s_sha1 +{ + t_padding p; + uint32_t a; + uint32_t b; + uint32_t c; + uint32_t d; + uint32_t e; + uint32_t h0; + uint32_t h1; + uint32_t h2; + uint32_t h3; + uint32_t h4; + uint32_t *w; +} t_sha1; + +t_sha1_utils func_sha1_f(uint32_t b, uint32_t c, uint32_t d); +t_sha1_utils func_sha1_g(uint32_t b, uint32_t c, uint32_t d); +t_sha1_utils func_sha1_h(uint32_t b, uint32_t c, uint32_t d); +t_sha1_utils func_sha1_i(uint32_t b, uint32_t c, uint32_t d); +void *sha1(void *data, size_t len_data); +t_hash *set_hash2sha1(t_sha1 *e); + +#endif diff --git a/includes/hash/sha256.h b/includes/hash/sha256.h index 3849c9c..01a1609 100644 --- a/includes/hash/sha256.h +++ b/includes/hash/sha256.h @@ -6,7 +6,7 @@ /* By: cpieri +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/03/08 13:15:42 by cpieri #+# #+# */ -/* Updated: 2019/04/11 14:11:18 by cpieri ### ########.fr */ +/* Updated: 2019/12/31 08:47:28 by cpieri ### ########.fr */ /* */ /* ************************************************************************** */ @@ -24,20 +24,6 @@ # define SHA256_H6 0x1F83D9AB # define SHA256_H7 0x5BE0CD19 -static const uint32_t g_k_sha256[64] = { - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, - 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, - 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, - 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, - 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, - 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, - 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, - 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, - 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 -}; - typedef struct s_sha256_utils { uint32_t s0; diff --git a/includes/structure.h b/includes/structure.h index fb8bc61..f0fb6e0 100644 --- a/includes/structure.h +++ b/includes/structure.h @@ -6,7 +6,7 @@ /* By: cpieri +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/04/11 12:27:48 by cpieri #+# #+# */ -/* Updated: 2019/04/11 16:34:57 by cpieri ### ########.fr */ +/* Updated: 2019/05/08 12:46:04 by cpieri ### ########.fr */ /* */ /* ************************************************************************** */ @@ -15,11 +15,13 @@ typedef struct s_data { + const char *fd_output; const char *fd_name; char *data; size_t len_data; int mall; - t_hash *f_hash; + void *pass; + void *data_2_print; } t_data; typedef struct s_flags @@ -28,6 +30,8 @@ typedef struct s_flags int q; int r; int s; + uint32_t b64_flags; + uint64_t sym_flags; } t_flags; typedef struct s_opt @@ -48,5 +52,4 @@ typedef struct s_parse t_opt *lst_opts; } t_parse; - -#endif \ No newline at end of file +#endif diff --git a/includes/symmetric/des/des.h b/includes/symmetric/des/des.h new file mode 100644 index 0000000..11ca4a7 --- /dev/null +++ b/includes/symmetric/des/des.h @@ -0,0 +1,21 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* des.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/05/06 10:13:19 by cpieri #+# #+# */ +/* Updated: 2019/05/20 08:09:22 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef DES_H +# define DES_H + +# include "../../../libft/include/libft.h" +# include "../../structure.h" + +void *des(void *opt, size_t len_opt); + +#endif diff --git a/includes/symmetric/symmetric.h b/includes/symmetric/symmetric.h new file mode 100644 index 0000000..3c1782f --- /dev/null +++ b/includes/symmetric/symmetric.h @@ -0,0 +1,68 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* symmetric.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/05/06 10:11:43 by cpieri #+# #+# */ +/* Updated: 2020/02/05 10:11:54 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef SYMMETRIC_H +# define SYMMETRIC_H + +# include "./des/des.h" +# include "../evp/pbkdf.h" +# include "../evp/evp_bytes2key.h" + +enum e_sym_opt +{ + e_sym_opt_a = 0x000000001, + e_sym_opt_d = 0x000000010, + e_sym_opt_e = 0x000000100, + e_sym_opt_i = 0x000001000, + e_sym_opt_o = 0x000010000, + e_sym_opt_k = 0x000100000, + e_sym_opt_p = 0x001000000, + e_sym_opt_s = 0x010000000, + e_sym_opt_v = 0x100000000 +}; + +typedef struct s_sym_opt +{ + char opt; + uint64_t flag; + void (*sym_opt_fun)(char **, int *, t_opt *, t_evp **); +} t_sym_opt; + +typedef struct s_evp_f +{ + void *(*f)(t_evp*, uint32_t, t_evp_size, int); + t_evp_size full_size; + uint c; + uint prf; +} t_evp_f; + +/* +** Functions for get options in parsing +*/ +t_opt *symmetric_opts(const int ac, char **av, t_opt *opts, int now); +void get_sym_opt_a(char **av, int *now, t_opt *opt, t_evp **k); +void get_sym_opt_d(char **av, int *now, t_opt *opt, t_evp **k); +void get_sym_opt_e(char **av, int *now, t_opt *opt, t_evp **k); +void get_sym_opt_i(char **av, int *now, t_opt *opt, t_evp **k); +void get_sym_opt_o(char **av, int *now, t_opt *opt, t_evp **k); +void get_sym_opt_k(char **av, int *now, t_opt *opt, t_evp **k); +void get_sym_opt_s(char **av, int *now, t_opt *opt, t_evp **k); +void get_sym_opt_p(char **av, int *now, t_opt *opt, t_evp **k); +void get_sym_opt_v(char **av, int *now, t_opt *opt, t_evp **k); +void get_sym_stdin(t_opt *opt, t_evp **k); + +/* +** Usage +*/ +void sym_usage(const char *opt); + +#endif diff --git a/libft/Makefile b/libft/Makefile index a344063..49e428d 100644 --- a/libft/Makefile +++ b/libft/Makefile @@ -6,7 +6,7 @@ # By: cpieri +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2017/11/07 18:38:31 by tmilon #+# #+# # -# Updated: 2019/04/11 11:16:46 by cpieri ### ########.fr # +# Updated: 2020/01/06 12:49:31 by cpieri ### ########.fr # # # # **************************************************************************** # @@ -35,6 +35,7 @@ DEPS = Makefile \ SRCS = ft_atoi.c \ ft_bzero.c \ ft_ishexa_color.c \ + ft_ishexa.c \ ft_isspace.c \ ft_isalnum.c \ ft_isalpha.c \ @@ -42,6 +43,7 @@ SRCS = ft_atoi.c \ ft_isdigit.c \ ft_isprint.c \ ft_itoa.c \ + ft_memput.c \ ft_memalloc.c \ ft_memccpy.c \ ft_memchr.c \ @@ -58,9 +60,13 @@ SRCS = ft_atoi.c \ ft_putendl_fd.c \ ft_putnbr.c \ ft_puthexa.c \ + ft_put64hexa.c \ + ft_put32hexa.c \ ft_putnbr_fd.c \ ft_putstr.c \ ft_putstr_fd.c \ + ft_hex64_to_char.c \ + ft_hex32_to_char.c \ ft_strcat.c \ ft_strchr.c \ ft_strclr.c \ @@ -109,6 +115,7 @@ SRCS = ft_atoi.c \ get_next_line.c \ ft_abort.c \ ftb_hex2int.c \ + hex2uint64t.c \ ftb_free_multiarray.c \ ftb_find_closest_offset.c \ ftb_abs.c \ @@ -117,9 +124,11 @@ SRCS = ft_atoi.c \ ft_atol.c \ ft_strbits.c \ ft_membits.c \ + ft_left_shift.c \ ft_left_rotate.c \ ft_right_rotate.c \ ft_swap_uint32t.c \ + ft_swap_uint64t.c \ ft_putbits.c OBJS = $(SRCS:.c=.o) diff --git a/libft/include/libft.h b/libft/include/libft.h index 90ca735..552dbee 100644 --- a/libft/include/libft.h +++ b/libft/include/libft.h @@ -3,10 +3,10 @@ /* ::: :::::::: */ /* libft.h :+: :+: :+: */ /* +:+ +:+ +:+ */ -/* By: tmilon +#+ +:+ +#+ */ +/* By: cpieri +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ -/* Created: 2017/11/09 16:47:24 by tmilon #+# #+# */ -/* Updated: 2019/03/22 15:27:05 by cpieri ### ########.fr */ +/* Created: 2017/11/09 16:47:24 by cpieri #+# #+# */ +/* Updated: 2020/01/06 12:53:34 by cpieri ### ########.fr */ /* */ /* ************************************************************************** */ @@ -25,11 +25,11 @@ typedef struct s_list struct s_list *next; } t_list; -int get_next_line(const int fd, char **line); -int *find_closest_offset(int x, int y, int tx, int ty); -int ftb_abs(int n); -char **ft_strsplit(char const *s, char c); -char *ft_itoa(int n); +/* +** Functions for Strings +*/ +char *ft_hex32_to_char(uint32_t hex); +char *ft_hex64_to_char(uint64_t hex); char *ft_strcat(char *s1, const char *s2); char *ft_strchr(const char *s, int c); char *ft_strchr(const char *s, int c); @@ -48,32 +48,27 @@ char *ft_strstr(const char *haystack, const char *needle); char *ft_strsub(char const *s, unsigned int start, size_t len); char *ft_strtrim(char const *s); char *ftb_trimtodigit(const char *str); -int ft_atoi(const char *str); -int ft_isalnum(int c); -int ft_isalpha(int c); -int ft_isascii(int c); -int ft_isdigit(int c); -int ft_isprint(int c); -int ft_isspace(int c); -int ft_memcmp(const void *s1, const void *s2, size_t n); +char **ft_strsplit(char const *s, char c); +int get_next_line(const int fd, char **line); int ft_strcmp(const char *s1, const char *s2); int ft_strequ(char const *s1, char const *s2); int ft_strncmp(const char *s1, const char *s2, size_t n); int ft_strnequ(char const *s1, char const *s2, size_t n); +int ft_countstrtab(char **tab); int ft_tolower(int c); int ft_toupper(int c); -int ftb_adjustmagn(unsigned int toadjust, unsigned int goal); -int ftb_intlen(int n); -int ftb_pow(int n, int pow); -int hex2int(char *hex); -int ftb_rand(unsigned int min, - unsigned int max, unsigned int seed); size_t ft_strlcat(char *dst, const char *src, size_t size); size_t ft_strlen(const char *s); -t_list *ft_lstmap(t_list *lst, t_list *(*f)(t_list *elem)); -t_list *ft_lstnew(void const *content, size_t content_size); -void ft_membits(void *s, size_t len, size_t size); -void ft_memdel(void **ap); +void ft_strclr(char *s); +void ft_striter(char *s, void (*f)(char *)); +void ft_strdel(char **as); +void ft_striteri(char *s, void (*f)(unsigned int, char *)); +void ft_strbits(char *s); +void free_multiarray(char **array); + +/* +** Functions for Mem +*/ void *ft_memalloc(size_t size); void *ft_memccpy(void *dst, const void *src, int c, size_t n); void *ft_memchr(const void *s, int c, size_t n); @@ -81,14 +76,43 @@ void *ft_memcpy(void *dst, const void *src, size_t n); void *ft_memmove(void *dst, const void *src, size_t len); void *ft_memset(void *b, int c, size_t len); void *ft_memdup(const void *s1, size_t len); +void *ftb_backwardmemcpy(void *dst, const void *src, size_t len); void *ft_memjoin(const void *s1, const void *s2, size_t len1, size_t len2); -void *ftb_backwardmemcpy(void *dst, const void *src, size_t len); void ft_bzero(void *s, size_t n); +void ft_memdel(void **ap); +int ft_memcmp(const void *s1, const void *s2, size_t n); +void ft_membits(void *s, size_t len, size_t size); +void ft_memput(void *s, size_t len); + +/* +** Functions for check is ?... +*/ +int ft_isalnum(int c); +int ft_isalpha(int c); +int ft_isascii(int c); +int ft_isdigit(int c); +int ft_isprint(int c); +int ft_isspace(char c); +int ft_ishexa_color(char *s); +int ft_ishexa(char *s); + +/* +** Functions for Linked List +*/ +t_list *ft_lstmap(t_list *lst, t_list *(*f)(t_list *elem)); +t_list *ft_lstnew(void const *content, size_t content_size); void ft_lstadd(t_list **alst, t_list *new); void ft_lstdel(t_list **alst, void (*del)(void *, size_t)); void ft_lstdelone(t_list **alst, void (*del)(void *, size_t)); void ft_lstiter(t_list *lst, void (*f)(t_list *elem)); +void ftb_lstpush(t_list **alst, t_list *new); +void ftb_lstlastpop(t_list **alst, void (*del)(void *, size_t)); +void debug_print_list(t_list **alst, char *name); + +/* +** Functions for print +*/ void ft_putchar(char c); void ft_putchar_fd(char c, int fd); void ft_putendl(char const *s); @@ -96,27 +120,43 @@ void ft_putendl_fd(char const *s, int fd); void ft_putnbr(int n); void ft_putnbr_fd(int n, int fd); void ft_puthexa(int nb); +void ft_put64hexa(uint64_t nb); +void ft_put32hexa(uint32_t nb); void ft_putstr(char const *s); void ft_putstr_fd(char const *s, int fd); -void ft_strclr(char *s); -void ft_strdel(char **as); -void ft_striter(char *s, void (*f)(char *)); -void ft_striteri(char *s, void (*f)(unsigned int, char *)); -void ftb_lstpush(t_list **alst, t_list *new); -void ftb_lstlastpop(t_list **alst, void (*del)(void *, size_t)); -void free_multiarray(char **array); -void debug_print_list(t_list **alst, char *name); +void ft_putbits(unsigned char octet); void ft_abort(char *msg); + +/* +** Functions for Int +*/ +char *ft_itoa(int n); +long ft_atol(const char *str); +int ft_atoi(const char *str); +int ftb_intlen(int n); int ft_sqrt(int n); -int ft_ishexa_color(char *s); -int ft_countstrtab(char **tab); +int ftb_abs(int n); +int ftb_pow(int n, int pow); +int *find_closest_offset(int x, int y, int tx, int ty); +uint64_t hex2uint64t(char *hex); +int hex2int(char *hex); +int ftb_rand(unsigned int min, + unsigned int max, unsigned int seed); +int ftb_adjustmagn(unsigned int toadjust, unsigned int goal); + +/* +** Functions for Double +*/ double ft_atof(const char *str); double ftb_clamp(double toclamp, double min, double max); -long ft_atol(const char *str); -void ft_putbits(unsigned char octet); -void ft_strbits(char *s); + +/* +** Functions for Bitwise +*/ +uint32_t left_shift(uint32_t x, uint32_t nb); uint32_t left_rotate(uint32_t x, uint32_t nb); uint32_t right_rotate(uint32_t x, uint32_t nb); uint32_t swap_uint32t(uint32_t nb); +uint64_t swap_uint64t(uint64_t nb); #endif diff --git a/libft/srcs/ft_hex32_to_char.c b/libft/srcs/ft_hex32_to_char.c new file mode 100644 index 0000000..b8dd5dc --- /dev/null +++ b/libft/srcs/ft_hex32_to_char.c @@ -0,0 +1,51 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_hex32_to_char.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/05/20 21:21:06 by cpieri #+# #+# */ +/* Updated: 2020/01/06 09:14:04 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +static void conv_32hexa(char **s, long len_s, uint32_t hex) +{ + uint32_t nb; + long i; + char tmp; + + nb = 0; + i = 0; + while (i < len_s) + { + nb = hex % 16; + if (nb < 10) + (*s)[i] = (nb) % 10 + '0'; + else + (*s)[i] = (nb) + 'a' - 10; + if ((i % 2) != 0) + { + tmp = (*s)[i]; + (*s)[i] = (*s)[i - 1]; + (*s)[i - 1] = tmp; + } + hex /= 16; + i++; + } +} + +char *ft_hex32_to_char(uint32_t hex) +{ + char *s; + + if (!(s = (char*)ft_memalloc(sizeof(char) * (8 + 1)))) + return (NULL); + if (hex < 16) + s[0] = '0'; + conv_32hexa(&s, 8, hex); + return (s); +} diff --git a/libft/srcs/ft_hex64_to_char.c b/libft/srcs/ft_hex64_to_char.c new file mode 100644 index 0000000..368b0f1 --- /dev/null +++ b/libft/srcs/ft_hex64_to_char.c @@ -0,0 +1,51 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_hex64_to_char.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/05/20 21:21:06 by cpieri #+# #+# */ +/* Updated: 2020/01/06 09:14:27 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +static void conv_32hexa(char **s, long len_s, uint64_t hex) +{ + uint32_t nb; + long i; + char tmp; + + nb = 0; + i = 0; + while (i < len_s) + { + nb = hex % 16; + if (nb < 10) + (*s)[i] = (nb) % 10 + '0'; + else + (*s)[i] = (nb) + 'a' - 10; + if ((i % 2) != 0) + { + tmp = (*s)[i]; + (*s)[i] = (*s)[i - 1]; + (*s)[i - 1] = tmp; + } + hex /= 16; + i++; + } +} + +char *ft_hex64_to_char(uint64_t hex) +{ + char *s; + + if (!(s = (char*)ft_memalloc(sizeof(char) * (16 + 1)))) + return (NULL); + if (hex < 16) + s[0] = '0'; + conv_32hexa(&s, 16, hex); + return (s); +} diff --git a/libft/srcs/ft_ishexa.c b/libft/srcs/ft_ishexa.c new file mode 100644 index 0000000..a3ad2dd --- /dev/null +++ b/libft/srcs/ft_ishexa.c @@ -0,0 +1,24 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_ishexa.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2018/01/22 14:49:31 by cpieri #+# #+# */ +/* Updated: 2020/04/17 15:06:17 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +int ft_ishexa(char *s) +{ + while (*s != 0) + { + if ((*s < 48 || *s > 57) && (*s < 'A' || *s > 'F')) + return (0); + s++; + } + return (1); +} diff --git a/libft/srcs/ft_isspace.c b/libft/srcs/ft_isspace.c index bcb1378..4733a14 100644 --- a/libft/srcs/ft_isspace.c +++ b/libft/srcs/ft_isspace.c @@ -3,19 +3,19 @@ /* ::: :::::::: */ /* ft_isspace.c :+: :+: :+: */ /* +:+ +:+ +:+ */ -/* By: cpieri +#+ +:+ +#+ */ +/* By: cpieri +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/11/10 16:36:02 by cpieri #+# #+# */ -/* Updated: 2019/03/22 15:33:06 by cpieri ### ########.fr */ +/* Updated: 2019/04/30 11:21:02 by cpieri ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" -int ft_isspace(int c) +int ft_isspace(char c) { - if (c == '\t' || c == '\n' || c == '\v' || c == '\f' || c == '\r' - || c == ' ') + if (c == ' ' || c == '\t' || c == '\n' || c == '\v' || + c == '\f' || c == '\r') return (1); return (0); } diff --git a/libft/srcs/ft_left_shift.c b/libft/srcs/ft_left_shift.c new file mode 100644 index 0000000..b43dd21 --- /dev/null +++ b/libft/srcs/ft_left_shift.c @@ -0,0 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_left_shift.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/12/30 09:37:01 by cpieri #+# #+# */ +/* Updated: 2020/01/06 09:13:47 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +uint32_t left_shift(uint32_t x, uint32_t nb) +{ + return (x << nb); +} diff --git a/libft/srcs/ft_membits.c b/libft/srcs/ft_membits.c index ff52405..7d2bc4c 100644 --- a/libft/srcs/ft_membits.c +++ b/libft/srcs/ft_membits.c @@ -3,10 +3,10 @@ /* ::: :::::::: */ /* ft_membits.c :+: :+: :+: */ /* +:+ +:+ +:+ */ -/* By: cpieri +#+ +:+ +#+ */ +/* By: cpieri +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/03/07 18:08:47 by cpieri #+# #+# */ -/* Updated: 2019/03/13 16:22:23 by cpieri ### ########.fr */ +/* Updated: 2019/12/17 11:12:29 by cpieri ### ########.fr */ /* */ /* ************************************************************************** */ @@ -21,7 +21,7 @@ void ft_membits(void *s, size_t len, size_t size) data = (unsigned char*)s; i = 0; - while (i <= len) + while (i < (len * size)) { y = 0; while (y < size) diff --git a/libft/srcs/ft_memput.c b/libft/srcs/ft_memput.c new file mode 100644 index 0000000..6f436f9 --- /dev/null +++ b/libft/srcs/ft_memput.c @@ -0,0 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_memput.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/04/11 19:12:05 by cpieri #+# #+# */ +/* Updated: 2019/04/12 15:34:06 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +void ft_memput(void *s, size_t len) +{ + write(1, (char*)s, len); +} diff --git a/libft/srcs/ft_put32hexa.c b/libft/srcs/ft_put32hexa.c new file mode 100644 index 0000000..343b521 --- /dev/null +++ b/libft/srcs/ft_put32hexa.c @@ -0,0 +1,31 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_put32hexa.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/05/20 11:09:54 by cpieri #+# #+# */ +/* Updated: 2019/05/20 11:10:33 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +static void put_32hexa(uint32_t nb) +{ + if (nb > 15) + put_32hexa(nb / 16); + nb %= 16; + if (nb < 10) + ft_putnbr(nb); + else + ft_putchar(nb + 'a' - 10); +} + +void ft_put32hexa(uint32_t nb) +{ + if (nb < 16) + ft_putchar('0'); + put_32hexa(nb); +} diff --git a/libft/srcs/ft_put64hexa.c b/libft/srcs/ft_put64hexa.c new file mode 100644 index 0000000..ab26cbc --- /dev/null +++ b/libft/srcs/ft_put64hexa.c @@ -0,0 +1,31 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_put64hexa.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/05/20 10:59:05 by cpieri #+# #+# */ +/* Updated: 2019/05/20 11:10:21 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +static void put_64hexa(uint64_t nb) +{ + if (nb > 15) + put_64hexa(nb / 16); + nb %= 16; + if (nb < 10) + ft_putnbr(nb); + else + ft_putchar(nb + 'a' - 10); +} + +void ft_put64hexa(uint64_t nb) +{ + if (nb < 16) + ft_putchar('0'); + put_64hexa(nb); +} diff --git a/libft/srcs/ft_strdup.c b/libft/srcs/ft_strdup.c index 0ac8397..49c3418 100644 --- a/libft/srcs/ft_strdup.c +++ b/libft/srcs/ft_strdup.c @@ -3,10 +3,10 @@ /* ::: :::::::: */ /* ft_strdup.c :+: :+: :+: */ /* +:+ +:+ +:+ */ -/* By: cpieri +#+ +:+ +#+ */ +/* By: cpieri +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/11/09 09:31:10 by cpieri #+# #+# */ -/* Updated: 2018/01/12 10:07:58 by cpieri ### ########.fr */ +/* Updated: 2019/05/06 15:09:18 by cpieri ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/libft/srcs/ft_swap_uint32t.c b/libft/srcs/ft_swap_uint32t.c index e9a49fd..2987154 100644 --- a/libft/srcs/ft_swap_uint32t.c +++ b/libft/srcs/ft_swap_uint32t.c @@ -3,10 +3,10 @@ /* ::: :::::::: */ /* ft_swap_uint32t.c :+: :+: :+: */ /* +:+ +:+ +:+ */ -/* By: cpieri +#+ +:+ +#+ */ +/* By: cpieri +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/03/18 15:42:06 by cpieri #+# #+# */ -/* Updated: 2019/03/18 15:45:17 by cpieri ### ########.fr */ +/* Updated: 2020/01/06 08:46:42 by cpieri ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/libft/srcs/ft_swap_uint64t.c b/libft/srcs/ft_swap_uint64t.c new file mode 100644 index 0000000..07e3154 --- /dev/null +++ b/libft/srcs/ft_swap_uint64t.c @@ -0,0 +1,21 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_swap_uint64t.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/03/18 15:42:06 by cpieri #+# #+# */ +/* Updated: 2020/01/06 08:55:43 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +uint64_t swap_uint64t(uint64_t nb) +{ + nb = (nb & 0x00000000FFFFFFFF) << 32 | (nb & 0xFFFFFFFF00000000) >> 32; + nb = (nb & 0x0000FFFF0000FFFF) << 16 | (nb & 0xFFFF0000FFFF0000) >> 16; + nb = (nb & 0x00FF00FF00FF00FF) << 8 | (nb & 0xFF00FF00FF00FF00) >> 8; + return (nb); +} diff --git a/libft/srcs/hex2uint64t.c b/libft/srcs/hex2uint64t.c new file mode 100644 index 0000000..fb0f394 --- /dev/null +++ b/libft/srcs/hex2uint64t.c @@ -0,0 +1,34 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* hex2uint64t.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/05/08 11:10:23 by cpieri #+# #+# */ +/* Updated: 2019/05/08 13:05:10 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +uint64_t hex2uint64t(char *hex) +{ + uint64_t val; + int byte; + + val = 0; + while (*hex) + { + byte = *hex; + if (byte >= '0' && byte <= '9') + byte = byte - '0'; + else if (byte >= 'a' && byte <= 'f') + byte = byte - 'a' + 10; + else if (byte >= 'A' && byte <= 'F') + byte = byte - 'A' + 10; + val = (val << 4) | (byte & 0xF); + hex++; + } + return (val); +} diff --git a/srcs/base64/base64.c b/srcs/base64/base64.c new file mode 100644 index 0000000..938ff89 --- /dev/null +++ b/srcs/base64/base64.c @@ -0,0 +1,29 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* base64.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/04/12 16:53:29 by cpieri #+# #+# */ +/* Updated: 2019/05/03 11:34:47 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "ft_ssl.h" +#include "base64/base64.h" + +void *base64(void *opts, size_t len_opts) +{ + t_opt *opt; + uint8_t *ret; + + (void)len_opts; + ret = NULL; + opt = (t_opt*)opts; + if ((opt->flags.b64_flags & e_base64_encode) == e_base64_encode) + ret = base64_encode((uint8_t*)opt->data->data, opt->data->len_data); + else if ((opt->flags.b64_flags & e_base64_decode) == e_base64_decode) + ret = base64_decode((uint8_t*)opt->data->data, opt->data->len_data); + return (ret); +} diff --git a/srcs/base64/base64_decode.c b/srcs/base64/base64_decode.c new file mode 100644 index 0000000..7b83065 --- /dev/null +++ b/srcs/base64/base64_decode.c @@ -0,0 +1,110 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* base64_decode.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/04/15 13:41:31 by cpieri #+# #+# */ +/* Updated: 2019/05/03 11:31:53 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "base64/base64.h" + +static const unsigned char g_base64_d[] = { + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 62, 64, 64, 64, 63, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 64, 64, 64, 65, 64, 64, 64, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 64, 64, + 64, 64, 64, 64, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64 +}; + +static size_t b64_decode_len(uint8_t *msg, size_t len) +{ + size_t i; + size_t soft_len; + size_t new_len; + + soft_len = 0; + i = -1; + while (++i < len) + if (!ft_isspace(msg[i])) + soft_len++; + new_len = (soft_len / 4) * 3; + len -= (ft_isspace(msg[len - 1])) ? 2 : 1; + while (msg[len--] == '=') + new_len--; + return (new_len); +} + +static uint32_t b64_decode_val(uint8_t *msg, size_t *i) +{ + uint32_t tmp; + uint16_t l_shift; + size_t j; + size_t p; + + j = *i; + p = 0; + l_shift = 18; + tmp = 0; + while (p < 4) + { + if (!ft_isspace(msg[j])) + { + tmp += g_base64_d[msg[j]] << l_shift; + l_shift += (l_shift == 0) ? 18 : -6; + p++; + } + j++; + } + *i = j; + return (tmp); +} + +static void b64_decode_end(uint8_t *msg_d, uint32_t tmp, int len, int j) +{ + if ((j + 1) < len) + msg_d[j++] = (tmp >> 16) & 0xff; + if ((j + 2) < len) + msg_d[j++] = (tmp >> 8) & 0xff; + if ((j + 3) < len) + msg_d[j++] = tmp & 0xff; +} + +uint8_t *base64_decode(uint8_t *msg, size_t len) +{ + uint8_t *msg_d; + uint32_t tmp; + size_t len_plain; + size_t i; + size_t j; + + i = 0; + j = 0; + tmp = 0; + len_plain = b64_decode_len(msg, len); + if (!(msg_d = (uint8_t*)ft_memalloc(sizeof(uint8_t) * len_plain))) + return (NULL); + while ((j + 3) <= len_plain) + { + tmp = b64_decode_val(msg, &i); + msg_d[j++] = (tmp >> 16) & 0xff; + msg_d[j++] = (tmp >> 8) & 0xff; + msg_d[j++] = tmp & 0xff; + } + tmp = b64_decode_val(msg, &i); + b64_decode_end(msg_d, tmp, len_plain, j); + return (msg_d); +} diff --git a/srcs/base64/base64_display.c b/srcs/base64/base64_display.c new file mode 100644 index 0000000..5c38c3d --- /dev/null +++ b/srcs/base64/base64_display.c @@ -0,0 +1,31 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* base64_display.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/04/29 12:13:14 by cpieri #+# #+# */ +/* Updated: 2019/04/30 14:28:28 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "ft_ssl.h" + +void printing_base64(t_data *data, const char *name, t_flags flags) +{ + const char *msg_print; + int fd; + + fd = 1; + (void)name; + msg_print = (const char *)data->data_2_print; + if ((flags.b64_flags & e_base64_outputf) == e_base64_outputf + && data->fd_output != NULL) + fd = open_write_fd(data->fd_output); + if (fd == FAILURE) + print_error(data->fd_output); + ft_putendl_fd(msg_print, fd); + if ((flags.b64_flags & e_base64_outputf) == e_base64_outputf) + close_fd(fd); +} diff --git a/srcs/base64/base64_encode.c b/srcs/base64/base64_encode.c new file mode 100644 index 0000000..d103db7 --- /dev/null +++ b/srcs/base64/base64_encode.c @@ -0,0 +1,83 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* base64_encode.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/04/15 11:29:50 by cpieri #+# #+# */ +/* Updated: 2019/04/26 11:34:05 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "base64/base64.h" + +static const char g_base64_c[] = +{ + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', + 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', + 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', '+', '/' +}; + +static size_t b64_len_encode(size_t len) +{ + return (((len + 2) / 3 * 4) + 1); +} + +static void b64_encode_value(t_base64_encode *n, uint8_t *msg, size_t i) +{ + n->n0 = ((msg[i] >> 2) & 0x3f); + n->n1 = ((((msg[i] & 0x3) << 4) | ((msg[i + 1] & 0xf0) >> 4))) & 0x3f; + n->n2 = (((msg[i + 1] & 0xf) << 2) | ((msg[i + 2] & 0xc0) >> 6)) & 0x3f; + n->n3 = ((msg[i + 2]) & 0x3f); +} + +static void b64_encode_padding(uint8_t *new_s, uint8_t *msg, size_t i, + size_t len) +{ + uint8_t n; + + if (i < len) + { + *new_s++ = g_base64_c[((msg[i] >> 2) & 0x3f)]; + if (i == (len - 1)) + { + *new_s++ = g_base64_c[((msg[i] & 0x3) << 4)]; + *new_s++ = '='; + } + else + { + n = ((((msg[i] & 0x3) << 4) | ((msg[i + 1] & 0xf0) >> 4))) & 0x3f; + *new_s++ = g_base64_c[n]; + *new_s++ = g_base64_c[((msg[i + 1] & 0xf) << 2)]; + } + *new_s++ = '='; + } +} + +uint8_t *base64_encode(uint8_t *msg, size_t len) +{ + size_t i; + uint8_t *new_s; + uint8_t *tmp; + t_base64_encode n; + + i = 0; + n = (t_base64_encode){0, 0, 0, 0}; + if (!(new_s = (uint8_t*)ft_memalloc(sizeof(uint8_t) * b64_len_encode(len)))) + return (NULL); + tmp = new_s; + while (i < (len - 2)) + { + b64_encode_value(&n, msg, i); + *tmp++ = g_base64_c[n.n0]; + *tmp++ = g_base64_c[n.n1]; + *tmp++ = g_base64_c[n.n2]; + *tmp++ = g_base64_c[n.n3]; + i += 3; + } + b64_encode_padding(tmp, msg, i, len); + return (new_s); +} diff --git a/srcs/base64/base64_help_parsing.c b/srcs/base64/base64_help_parsing.c new file mode 100644 index 0000000..fefa444 --- /dev/null +++ b/srcs/base64/base64_help_parsing.c @@ -0,0 +1,41 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* base64_help_parsing.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/04/12 11:39:36 by cpieri #+# #+# */ +/* Updated: 2019/05/03 11:39:50 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "ft_ssl.h" +#include "base64/base64.h" + +void get_b64_ed(t_data **data, t_flags *flags, char *fd, char c) +{ + if (*data != NULL && fd != NULL) + clean_data(data); + if (c == 'd') + { + flags->b64_flags |= e_base64_decode; + if ((flags->b64_flags & e_base64_encode) == e_base64_encode) + flags->b64_flags = (flags->b64_flags ^ e_base64_encode); + } + else if (c == 'e' && (flags->b64_flags & e_base64_decode) == 0) + flags->b64_flags |= e_base64_encode; + if (fd == NULL && *data == NULL) + *data = get_data(0, NULL); + else if (*data == NULL && fd != NULL) + *data = get_file(open_fd(fd), fd); +} + +void get_b64_i(t_data **data, t_flags *flags, char *fd, int *now) +{ + flags->b64_flags |= e_base64_inputf; + if (*data != NULL && fd != NULL) + clean_data(data); + *data = get_data(open_fd(fd), fd); + (*now)++; +} diff --git a/srcs/base64/base64_parsing.c b/srcs/base64/base64_parsing.c new file mode 100644 index 0000000..692594c --- /dev/null +++ b/srcs/base64/base64_parsing.c @@ -0,0 +1,66 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* base64_parsing.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/04/11 16:56:03 by cpieri #+# #+# */ +/* Updated: 2019/05/07 09:58:44 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "ft_ssl.h" +#include "base64/base64.h" + +static void get_b64_opt(char **av, int *now, t_opt *t_o, char **output) +{ + size_t len_now; + size_t i; + + i = 0; + len_now = ft_strlen(av[*now]); + while (++i < len_now) + { + if (av[*now][i] == 'e' || av[*now][i] == 'd') + get_b64_ed(&(t_o->data), &(t_o->flags), + (av[*now + 1] != NULL ? av[*now + 1] : NULL), av[*now][i]); + else if (av[*now][i] == 'i') + get_b64_i(&(t_o->data), &(t_o->flags), av[(*now) + 1], now); + else if (av[*now][i] == 'o') + { + t_o->flags.b64_flags |= e_base64_outputf; + *output = (av[(*now) + 1] != NULL) ? av[(*now) + 1] : NULL; + (*now)++; + } + } +} + +static t_opt *get_base64_args(const int ac, char **av, int now) +{ + t_opt t_o; + char *fd_output; + + fd_output = NULL; + t_o = (t_opt){NULL, {0, 0, 0, 0, 0, 0}, NULL}; + while (now < ac) + { + if (av[now][0] == '-') + get_b64_opt(av, &now, &t_o, &fd_output); + else + get_b64_ed(&(t_o.data), &(t_o.flags), av[now], 'e'); + now++; + } + if (t_o.data == NULL) + get_b64_ed(&(t_o.data), &(t_o.flags), NULL, 'e'); + return (new_opt_fd(t_o.flags, t_o.data, fd_output)); +} + +t_opt *base64_opts(const int ac, char **av, t_opt *opts, int now) +{ + t_opt *new; + + new = get_base64_args(ac, av, now); + add_to_end_lst(new, &opts); + return (opts); +} diff --git a/srcs/hash/hash.c b/srcs/dispatch.c similarity index 77% rename from srcs/hash/hash.c rename to srcs/dispatch.c index 4ff6f8e..a6a4013 100644 --- a/srcs/hash/hash.c +++ b/srcs/dispatch.c @@ -1,18 +1,18 @@ /* ************************************************************************** */ /* */ /* ::: :::::::: */ -/* hash.c :+: :+: :+: */ +/* dispatch.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: cpieri +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/02/12 13:01:28 by cpieri #+# #+# */ -/* Updated: 2019/04/11 15:10:23 by cpieri ### ########.fr */ +/* Updated: 2019/05/22 10:52:46 by cpieri ### ########.fr */ /* */ /* ************************************************************************** */ #include "ft_ssl.h" -void hashing(t_parse *parse) +void dispatch(t_parse *parse) { t_opt *lst; @@ -20,9 +20,10 @@ void hashing(t_parse *parse) while (lst != NULL) { if (parse->is_ciphash == e_hash) - lst->data->f_hash = (t_hash*)parse->func(lst->data->data, lst->data->len_data); + lst->data->data_2_print = (t_hash*)parse->func(lst->data->data, + lst->data->len_data); else if (parse->is_ciphash == e_cipher) - parse->func(lst, 0); + lst->data->data_2_print = parse->func(lst, 0); if (parse->fprint != NULL) parse->fprint(lst->data, parse->name, lst->flags); lst = lst->next; diff --git a/includes/constant.h b/srcs/evp/evp_b2k_utils.c similarity index 53% rename from includes/constant.h rename to srcs/evp/evp_b2k_utils.c index 5710249..0e54736 100644 --- a/includes/constant.h +++ b/srcs/evp/evp_b2k_utils.c @@ -1,39 +1,35 @@ /* ************************************************************************** */ /* */ /* ::: :::::::: */ -/* constant.h :+: :+: :+: */ +/* evp_b2k_utils.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: cpieri +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ -/* Created: 2019/04/11 12:15:35 by cpieri #+# #+# */ -/* Updated: 2019/04/11 16:34:37 by cpieri ### ########.fr */ +/* Created: 2020/02/04 10:11:43 by cpieri #+# #+# */ +/* Updated: 2020/02/04 13:05:03 by cpieri ### ########.fr */ /* */ /* ************************************************************************** */ -#ifndef CONSTANT_H -# define CONSTANT_H +#include "evp/evp_bytes2key.h" -static const t_parse g_all_cmd[] = -{ - {"md5", "MD5", e_hash, md5, hash_opts, printing_hash, NULL}, - {"sha256", "SHA256", e_hash, sha256, hash_opts, printing_hash, NULL}, - {NULL, NULL, 0, NULL, NULL, NULL, NULL}, +static const t_evp_hash g_evp_hash[4] = { + {EVP_MD5, md5, 16}, + {EVP_SHA1, sha1, 20}, + {EVP_SHA256, sha256, 32}, + {0, NULL, 0} }; -static const char * g_hash_cmd[] = +t_evp_hash evp_get_hashf(enum e_hash_f name) { - "md5", - "sha256", - NULL -}; - -static const char * g_cipher_cmd[] = -{ - "base64", - "des", - "des-ecb", - "des-cbc", - NULL -}; + t_evp_hash ret; + size_t i; -#endif \ No newline at end of file + i = 0; + while (i < 4) + { + if (g_evp_hash[i].hash_f == name) + ret = g_evp_hash[i]; + i++; + } + return (ret); +} diff --git a/srcs/evp/evp_bytes2key.c b/srcs/evp/evp_bytes2key.c new file mode 100644 index 0000000..1c15062 --- /dev/null +++ b/srcs/evp/evp_bytes2key.c @@ -0,0 +1,70 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* evp_bytes2key.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/03 09:10:42 by cpieri #+# #+# */ +/* Updated: 2020/04/20 10:59:11 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "symmetric/symmetric.h" +#include "evp/evp_bytes2key.h" + +static void *evp_loop(t_evp *k, size_t i, char *key, t_evp_hash hash_f) +{ + char *data; + char *tmp; + void *ret; + t_hash *digest; + size_t len; + + data = ft_memjoin(k->pass, k->salt, k->pass_len, k->salt_len); + len = k->pass_len + k->salt_len; + tmp = data; + if (i != 1) + { + tmp = ft_memjoin(key, data, (hash_f.nb_word * (i - 1)), len); + len += (hash_f.nb_word * (i - 1)); + } + digest = hash_f.f(tmp, len); + ret = one_sum(digest->h, digest->nb_word); + if (len > (k->pass_len + k->salt_len)) + ft_memdel((void**)&tmp); + ft_memdel((void**)&data); + ft_memdel((void**)&(digest->h)); + ft_memdel((void**)&digest); + return (ret); +} + +void *evp_bytes2key(t_evp *k, uint32_t c, t_evp_size full_size, + int func) +{ + size_t i; + size_t l; + t_evp_hash hash_f; + void *tmp; + char *ret; + + i = 1; + (void)c; + hash_f = evp_get_hashf(func); + l = ceil((double)(full_size.dk_len / hash_f.nb_word)) + 1; + if (!(ret = (char*)ft_memalloc(sizeof(char) * (full_size.dk_len + 1)))) + return (NULL); + while (i <= l) + { + tmp = evp_loop(k, i, ret, hash_f); + ft_memcpy(ret + ((i - 1) * hash_f.nb_word), tmp, + (i == l) ? full_size.dk_len % hash_f.nb_word : hash_f.nb_word); + ft_memdel(&tmp); + i++; + } + k->key = ret; + k->vect = ft_memdup(ret + full_size.key_len, full_size.iv_len); + k->iv_len = full_size.iv_len; + k->dk_len = full_size.key_len; + return (ret); +} diff --git a/srcs/evp/evp_struct.c b/srcs/evp/evp_struct.c new file mode 100644 index 0000000..618256d --- /dev/null +++ b/srcs/evp/evp_struct.c @@ -0,0 +1,72 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* evp_struct.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/04 09:23:01 by cpieri #+# #+# */ +/* Updated: 2020/04/20 10:56:22 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "evp/evp.h" + +t_evp *new_t_evp(uint8_t *pass, void *salt, void *key, void *vect) +{ + t_evp *new; + + if (!(new = (t_evp*)malloc(sizeof(t_evp)))) + return (NULL); + new->pass = pass; + new->pass_len = ft_strlen((char*)new->pass); + new->salt = (salt != NULL) ? salt : get_random(); + new->salt_len = ft_strlen((char*)new->salt); + new->key = key; + new->vect = vect; + return (new); +} + +void print_evp(t_evp *k) +{ + char *key; + char *vect; + + if (k == NULL) + { + ft_putendl("k is null"); + return ; + } + ft_putstr("pass: "); + ft_putendl((char*)k->pass); + ft_putstr("salt: "); + ft_put64hexa(swap_uint64t(((uint64_t*)k->salt)[0])); + ft_putchar('\n'); + ft_putstr("key: "); + key = hex2sum(k->key, k->dk_len / 4); + ft_putendl(key); + ft_memdel((void**)&key); + ft_putstr("vect: "); + vect = hex2sum(k->vect, k->iv_len / 4); + ft_putendl(vect); + ft_memdel((void**)&vect); +} + +void free_evp(t_evp **to_free) +{ + ft_memdel((void**)&((*to_free)->pass)); + ft_memdel((void**)&((*to_free)->salt)); + ft_memdel((void**)&((*to_free)->key)); + ft_memdel((void**)(to_free)); +} + +void free_vevp(void **to_free) +{ + t_evp **to_del; + + to_del = (t_evp**)to_free; + ft_memdel((void**)&((*to_del)->pass)); + ft_memdel((void**)&((*to_del)->salt)); + ft_memdel((void**)&((*to_del)->key)); + ft_memdel((void**)(to_del)); +} diff --git a/srcs/evp/pbkdf2.c b/srcs/evp/pbkdf2.c new file mode 100644 index 0000000..e5c1a3c --- /dev/null +++ b/srcs/evp/pbkdf2.c @@ -0,0 +1,83 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* pbkdf2.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/12/31 13:29:35 by cpieri #+# #+# */ +/* Updated: 2020/04/17 15:47:51 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "symmetric/symmetric.h" +#include "evp/pbkdf.h" + +static void *first_i(t_evp *k, size_t y, t_prf prf) +{ + void *buff; + void *ret; + + if (!(buff = ft_memalloc(k->salt_len + 4))) + return (NULL); + ft_memcpy(buff, k->salt, k->salt_len); + *(uint32_t*)(buff + k->salt_len) = swap_uint32t((uint32_t)y); + ret = prf.f(buff, k->salt_len + 4, k->pass, k->pass_len); + ft_memdel(&buff); + return (ret); +} + +static void *pbkdf2_f(t_evp *k, uint32_t c, t_prf prf, size_t y) +{ + size_t i; + char *ret; + char **blocks; + + i = 0; + if (!(blocks = (char**)ft_memalloc(sizeof(char*) * c))) + return (NULL); + while (i < c) + { + if (i == 0) + blocks[0] = first_i(k, y, prf); + else + { + blocks[i] = prf.f(blocks[i - 1], prf.nb_word, k->pass, k->pass_len); + pbkdf2_xor_dgst(blocks[0], blocks[i], prf.nb_word); + } + i++; + } + ret = ft_memdup(blocks[0], prf.nb_word); + while (--i > 0) + ft_memdel((void**)&(blocks[i])); + ft_memdel((void**)blocks); + return (ret); +} + +void *pbkdf2(t_evp *k, uint32_t c, t_evp_size full_size, int func) +{ + size_t i; + size_t l; + void *tmp; + char *ret; + t_prf prf; + + i = 1; + prf = pbkdf2_get_prf(func); + l = ceil((double)(full_size.dk_len / prf.nb_word)) + 1; + if (!(ret = (char*)ft_memalloc(sizeof(char) * (full_size.dk_len + 1)))) + return (NULL); + while (i <= l) + { + tmp = pbkdf2_f(k, c, prf, i); + ft_memcpy(ret + ((i - 1) * prf.nb_word), tmp, + (i == l) ? full_size.dk_len % prf.nb_word : prf.nb_word); + ft_memdel(&tmp); + i++; + } + k->key = ret; + k->vect = ft_memdup(ret + full_size.key_len, full_size.iv_len); + k->iv_len = full_size.iv_len; + k->dk_len = full_size.key_len; + return (ret); +} diff --git a/srcs/evp/pbkdf2_utils.c b/srcs/evp/pbkdf2_utils.c new file mode 100644 index 0000000..148c575 --- /dev/null +++ b/srcs/evp/pbkdf2_utils.c @@ -0,0 +1,51 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* pbkdf2_utils.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/12/31 13:31:54 by cpieri #+# #+# */ +/* Updated: 2020/04/20 10:30:49 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "evp/pbkdf.h" + +static const t_prf g_prf[4] = { + {HMAC_MD5, hmac_md5, 16}, + {HMAC_SHA1, hmac_sha1, 20}, + {HMAC_SHA256, hmac_sha256, 32}, + {0, NULL, 0} +}; + +t_prf pbkdf2_get_prf(enum e_prf name) +{ + t_prf ret; + size_t i; + + i = 0; + while (i < 4) + { + if (g_prf[i].prf == name) + ret = g_prf[i]; + i++; + } + return (ret); +} + +void pbkdf2_xor_dgst(void const *dgst1, void const *dgst2, size_t n) +{ + char *dgst1_cpy; + char *dgst2_cpy; + size_t i; + + i = 0; + dgst1_cpy = (char*)dgst1; + dgst2_cpy = (char*)dgst2; + while (i < n) + { + dgst1_cpy[i] ^= dgst2_cpy[i]; + i++; + } +} diff --git a/srcs/hash/display_hash.c b/srcs/hash/display_hash.c index 21f4e4b..f6ae3c2 100644 --- a/srcs/hash/display_hash.c +++ b/srcs/hash/display_hash.c @@ -1,12 +1,12 @@ /* ************************************************************************** */ /* */ /* ::: :::::::: */ -/* display.c :+: :+: :+: */ +/* display_hash.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: cpieri +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/03/06 12:14:10 by cpieri #+# #+# */ -/* Updated: 2019/04/11 12:30:48 by cpieri ### ########.fr */ +/* Updated: 2019/12/31 11:14:52 by cpieri ### ########.fr */ /* */ /* ************************************************************************** */ @@ -24,24 +24,12 @@ static void print_name(const char *fd_name, t_flags flags) ft_putstr(fd_name); } -static void print_hash(t_hash *f_hash) -{ - size_t y; - uint8_t *p; - int i; - - y = -1; - while (++y < f_hash->nb_word) - { - i = -1; - p = (uint8_t*)&f_hash->h[y]; - while (++i < 4) - ft_puthexa(p[i]); - } -} - void printing_hash(t_data *data, const char *hash_type, t_flags flags) { + t_hash *f_hash; + char *sum; + + f_hash = (t_hash*)data->data_2_print; if (flags.r == 0 && flags.q == 0 && data->fd_name != NULL) { ft_putstr(hash_type); @@ -51,7 +39,9 @@ void printing_hash(t_data *data, const char *hash_type, t_flags flags) } else if (flags.p == 1) ft_putstr(data->data); - print_hash(data->f_hash); + sum = hex2sum(f_hash->h, f_hash->nb_word); + ft_putstr(sum); + ft_memdel((void**)&sum); if (flags.r == 1) { ft_putchar(' '); diff --git a/srcs/hash/hash_parsing.c b/srcs/hash/hash_parsing.c index 7c978e0..dd1bba2 100644 --- a/srcs/hash/hash_parsing.c +++ b/srcs/hash/hash_parsing.c @@ -3,16 +3,16 @@ /* ::: :::::::: */ /* hash_parsing.c :+: :+: :+: */ /* +:+ +:+ +:+ */ -/* By: cpieri +#+ +:+ +#+ */ +/* By: cpieri +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/03/22 14:00:59 by cpieri #+# #+# */ -/* Updated: 2019/03/26 15:41:05 by cpieri ### ########.fr */ +/* Updated: 2019/05/07 09:58:41 by cpieri ### ########.fr */ /* */ /* ************************************************************************** */ #include "ft_ssl.h" -static t_opt *check_flags(size_t len, t_flags *flags, char **av, int now) +static t_opt *check_ha_flags(size_t len, t_flags *flags, char **av, int now) { t_opt *new; size_t i; @@ -41,7 +41,7 @@ static t_opt *check_flags(size_t len, t_flags *flags, char **av, int now) return (new); } -static t_opt *get_args(char **av, int now) +static t_opt *get_hash_args(char **av, int now) { t_opt *new; t_flags flags; @@ -50,11 +50,11 @@ static t_opt *get_args(char **av, int now) tmp = NULL; new = NULL; - flags = (t_flags){0, 0, 0, 0}; + flags = (t_flags){0, 0, 0, 0, 0, 0}; if (av[now][0] == '-') { len = ft_strlen(av[now]); - new = check_flags(len, &flags, av, now); + new = check_ha_flags(len, &flags, av, now); if (new == NULL && av[now + 1] == NULL) new = new_opt(flags, get_data(0, NULL)); else if (new == NULL && av[now + 1][0] != '-' && av[now][1] != 'p') @@ -73,9 +73,9 @@ t_opt *hash_opts(const int ac, char **av, t_opt *opts, int now) t_opt *new; if (ac < 3) - new = new_opt((t_flags){0, 0, 0, 0}, get_data(0, NULL)); + new = new_opt((t_flags){0, 0, 0, 0, 0, 0}, get_data(0, NULL)); else - new = get_args(av, now); + new = get_hash_args(av, now); add_to_end_lst(new, &opts); now++; if (now < ac) diff --git a/srcs/hash/hash_tools.c b/srcs/hash/hash_tools.c new file mode 100644 index 0000000..0d5541f --- /dev/null +++ b/srcs/hash/hash_tools.c @@ -0,0 +1,42 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* hash_tools.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/05/22 09:12:05 by cpieri #+# #+# */ +/* Updated: 2020/04/20 10:58:44 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "hash/hash.h" + +char *one_sum(uint32_t *h, size_t nb_h) +{ + char *sum; + + if (!(sum = (char*)ft_memdup(h, (nb_h * sizeof(uint32_t))))) + return (NULL); + return (sum); +} + +char *hex2sum(uint32_t *h, size_t nb_h) +{ + char *sum; + char *tmp; + size_t i; + + i = -1; + if (!(sum = (char*)ft_memalloc(sizeof(char) * ((nb_h * 8) + 1)))) + return (NULL); + while (++i < nb_h) + { + if ((tmp = ft_hex32_to_char(h[i])) == NULL) + break ; + ft_strncpy((sum + ft_strlen(sum)), tmp, ft_strlen(tmp)); + ft_memdel((void**)&tmp); + } + ft_memdel((void**)&h); + return (sum); +} diff --git a/srcs/hash/hmac/hmac_md5.c b/srcs/hash/hmac/hmac_md5.c new file mode 100644 index 0000000..ef36900 --- /dev/null +++ b/srcs/hash/hmac/hmac_md5.c @@ -0,0 +1,58 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* hmac_md5.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/12/31 12:29:58 by cpieri #+# #+# */ +/* Updated: 2020/04/20 10:58:36 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "hash/hmac.h" +#include "hash/md5.h" + +static void *hmac_md5_digest(void *c1, void *c2, size_t l_c1, size_t l_c2) +{ + void *data_2_hash; + size_t new_len; + t_hash *digest; + char *char_digest; + + data_2_hash = ft_memjoin(c1, c2, l_c1, l_c2); + new_len = l_c1 + l_c2; + digest = (t_hash*)md5(data_2_hash, new_len); + ft_memdel(&data_2_hash); + char_digest = one_sum(digest->h, digest->nb_word); + ft_memdel((void**)&(digest->h)); + ft_memdel((void**)&digest); + return (char_digest); +} + +void *hmac_md5(void *data, size_t data_len, void *key, size_t key_len) +{ + void *digest; + void *tmp_digest; + void *new_key; + void *i_key_pad; + void *o_key_pad; + + if (key_len > HMAC_BLOCK_SIZE_512) + { + new_key = hmac_md5_digest(key, NULL, key_len, 0); + key_len = 16; + } + else if (key_len < HMAC_BLOCK_SIZE_512) + if (!(new_key = hmac_512_padding_key(key, &key_len))) + return (NULL); + i_key_pad = hmac_512_xor_ipad(new_key, key_len); + o_key_pad = hmac_512_xor_opad(new_key, key_len); + tmp_digest = hmac_md5_digest(i_key_pad, data, key_len, data_len); + ft_memdel(&i_key_pad); + digest = hmac_md5_digest(o_key_pad, tmp_digest, key_len, 16); + ft_memdel(&tmp_digest); + ft_memdel(&o_key_pad); + ft_memdel(&new_key); + return (digest); +} diff --git a/srcs/hash/hmac/hmac_sha1.c b/srcs/hash/hmac/hmac_sha1.c new file mode 100644 index 0000000..df1e8a2 --- /dev/null +++ b/srcs/hash/hmac/hmac_sha1.c @@ -0,0 +1,58 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* hmac_sha1.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/12/31 08:16:56 by cpieri #+# #+# */ +/* Updated: 2019/12/31 12:23:27 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "hash/hmac.h" +#include "hash/sha1.h" + +static void *hmac_sha1_digest(void *c1, void *c2, size_t len_c1, size_t len_c2) +{ + void *data_2_hash; + size_t new_len; + t_hash *digest; + char *char_digest; + + data_2_hash = ft_memjoin(c1, c2, len_c1, len_c2); + new_len = len_c1 + len_c2; + digest = (t_hash*)sha1(data_2_hash, new_len); + ft_memdel(&data_2_hash); + char_digest = one_sum(digest->h, digest->nb_word); + ft_memdel((void**)&(digest->h)); + ft_memdel((void**)&digest); + return (char_digest); +} + +void *hmac_sha1(void *data, size_t data_len, void *key, size_t key_len) +{ + void *digest; + void *tmp_digest; + void *new_key; + void *i_key_pad; + void *o_key_pad; + + if (key_len > HMAC_BLOCK_SIZE_512) + { + new_key = hmac_sha1_digest(key, NULL, key_len, 0); + key_len = 20; + } + else if (key_len < HMAC_BLOCK_SIZE_512) + if (!(new_key = hmac_512_padding_key(key, &key_len))) + return (NULL); + i_key_pad = hmac_512_xor_ipad(new_key, key_len); + o_key_pad = hmac_512_xor_opad(new_key, key_len); + tmp_digest = hmac_sha1_digest(i_key_pad, data, key_len, data_len); + ft_memdel(&i_key_pad); + digest = hmac_sha1_digest(o_key_pad, tmp_digest, key_len, 20); + ft_memdel(&tmp_digest); + ft_memdel(&o_key_pad); + ft_memdel(&new_key); + return (digest); +} diff --git a/srcs/hash/hmac/hmac_sha256.c b/srcs/hash/hmac/hmac_sha256.c new file mode 100644 index 0000000..e262b7e --- /dev/null +++ b/srcs/hash/hmac/hmac_sha256.c @@ -0,0 +1,58 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* hmac_sha256.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/12/31 12:21:07 by cpieri #+# #+# */ +/* Updated: 2019/12/31 12:28:08 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "hash/hmac.h" +#include "hash/sha256.h" + +static void *hmac_sha256_digest(void *c1, void *c2, size_t l_c1, size_t l_c2) +{ + void *data_2_hash; + size_t new_len; + t_hash *digest; + char *char_digest; + + data_2_hash = ft_memjoin(c1, c2, l_c1, l_c2); + new_len = l_c1 + l_c2; + digest = (t_hash*)sha256(data_2_hash, new_len); + ft_memdel(&data_2_hash); + char_digest = one_sum(digest->h, digest->nb_word); + ft_memdel((void**)&(digest->h)); + ft_memdel((void**)&digest); + return (char_digest); +} + +void *hmac_sha256(void *data, size_t data_len, void *key, size_t key_len) +{ + void *digest; + void *tmp_digest; + void *new_key; + void *i_key_pad; + void *o_key_pad; + + if (key_len > HMAC_BLOCK_SIZE_512) + { + new_key = hmac_sha256_digest(key, NULL, key_len, 0); + key_len = 32; + } + else if (key_len < HMAC_BLOCK_SIZE_512) + if (!(new_key = hmac_512_padding_key(key, &key_len))) + return (NULL); + i_key_pad = hmac_512_xor_ipad(new_key, key_len); + o_key_pad = hmac_512_xor_opad(new_key, key_len); + tmp_digest = hmac_sha256_digest(i_key_pad, data, key_len, data_len); + ft_memdel(&i_key_pad); + digest = hmac_sha256_digest(o_key_pad, tmp_digest, key_len, 32); + ft_memdel(&tmp_digest); + ft_memdel(&o_key_pad); + ft_memdel(&new_key); + return (digest); +} diff --git a/srcs/hash/hmac/hmac_utils.c b/srcs/hash/hmac/hmac_utils.c new file mode 100644 index 0000000..5759fc4 --- /dev/null +++ b/srcs/hash/hmac/hmac_utils.c @@ -0,0 +1,56 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* hmac_utils.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/12/31 12:22:16 by cpieri #+# #+# */ +/* Updated: 2019/12/31 12:24:41 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "hash/hmac.h" + +void *hmac_512_padding_key(void *key, size_t *key_len) +{ + uint8_t *new_key; + size_t size; + + size = HMAC_BLOCK_SIZE_512 * sizeof(uint8_t); + if (!(new_key = (uint8_t*)ft_memalloc(size))) + return (NULL); + new_key = ft_memcpy(new_key, key, *key_len); + *key_len = HMAC_BLOCK_SIZE_512; + return (new_key); +} + +void *hmac_512_xor_ipad(void const *key, size_t key_len) +{ + char *i_pad; + char *key_cpy; + size_t i; + + key_cpy = (char*)key; + if (!(i_pad = (char*)ft_memalloc(key_len * sizeof(char)))) + return (NULL); + i = -1; + while (++i < HMAC_BLOCK_SIZE_512) + i_pad[i] = key_cpy[i] ^ I_PAD; + return (i_pad); +} + +void *hmac_512_xor_opad(void const *key, size_t key_len) +{ + char *o_pad; + char *key_cpy; + size_t i; + + key_cpy = (char*)key; + if (!(o_pad = (char*)ft_memalloc(key_len * sizeof(char)))) + return (NULL); + i = -1; + while (++i < HMAC_BLOCK_SIZE_512) + o_pad[i] = key_cpy[i] ^ O_PAD; + return (o_pad); +} diff --git a/srcs/hash/md5/md5.c b/srcs/hash/md5/md5.c index 8306c52..292ab14 100644 --- a/srcs/hash/md5/md5.c +++ b/srcs/hash/md5/md5.c @@ -6,12 +6,33 @@ /* By: cpieri +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/01/25 15:18:34 by cpieri #+# #+# */ -/* Updated: 2019/04/11 14:12:25 by cpieri ### ########.fr */ +/* Updated: 2020/04/20 10:58:24 by cpieri ### ########.fr */ /* */ /* ************************************************************************** */ #include "hash/md5.h" +static const uint32_t g_r_md5[64] = { + 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, + 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, 23, 4, + 11, 16, 23, 4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, + 10, 15, 21 +}; + +static const uint32_t g_k_md5[64] = { + 3614090360, 3905402710, 606105819, 3250441966, 4118548399, 1200080426, + 2821735955, 4249261313, 1770035416, 2336552879, 4294925233, 2304563134, + 1804603682, 4254626195, 2792965006, 1236535329, 4129170786, 3225465664, + 643717713, 3921069994, 3593408605, 38016083, 3634488961, 3889429448, + 568446438, 3275163606, 4107603335, 1163531501, 2850285829, 4243563512, + 1735328473, 2368359562, 4294588738, 2272392833, 1839030562, 4259657740, + 2763975236, 1272893353, 4139469664, 3200236656, 681279174, 3936430074, + 3572445317, 76029189, 3654602809, 3873151461, 530742520, 3299628645, + 4096336452, 1126891415, 2878612391, 4237533241, 1700485571, 2399980690, + 4293915773, 2240044497, 1873313359, 4264355552, 2734768916, 1309151649, + 4149444226, 3174756917, 718787259, 3951481745 +}; + static void padding_md5(t_padding *p, char *data, size_t len) { int i; @@ -23,7 +44,7 @@ static void padding_md5(t_padding *p, char *data, size_t len) p->new_len += p->nb_bits + 64 + 1; p->new_len /= 8; if (!(p->msg8 = (uint8_t*)ft_memalloc(sizeof(uint8_t) * p->new_len))) - ft_abort("malloc failed"); + ft_abort("ft_ssl: md5: malloc failed"); ft_memcpy(p->msg8, data, len); p->msg8[len] |= 1 << 7; ft_memcpy(p->msg8 + p->new_len - 8, &p->nb_bits, 8); @@ -41,13 +62,13 @@ static void calc_sum(t_md5 *e) while (i < 64) { if (i >= 0 && i <= 15) - tool = func_f(e->b, e->c, e->d, i); + tool = func_md5_f(e->b, e->c, e->d, i); else if (i >= 16 && i <= 31) - tool = func_g(e->b, e->c, e->d, i); + tool = func_md5_g(e->b, e->c, e->d, i); else if (i >= 32 && i <= 47) - tool = func_h(e->b, e->c, e->d, i); + tool = func_md5_h(e->b, e->c, e->d, i); else if (i >= 48 && i <= 63) - tool = func_i(e->b, e->c, e->d, i); + tool = func_md5_i(e->b, e->c, e->d, i); tmp = e->d; e->d = e->c; e->c = e->b; @@ -62,7 +83,7 @@ static void calc_sum(t_md5 *e) void *md5(void *data, size_t len_data) { t_md5 e; - t_hash *f_hash; + t_hash *sum; e = (t_md5){.h0 = MD5_H0, .h1 = MD5_H1, .h2 = MD5_H2, .h3 = MD5_H3}; padding_md5(&(e.p), data, len_data); @@ -80,6 +101,6 @@ void *md5(void *data, size_t len_data) e.h3 += e.d; e.p.offest += 64; } - f_hash = set_hash2md5(&e); - return (f_hash); + sum = set_hash2md5(&e); + return (sum); } diff --git a/srcs/hash/md5/md5_utils.c b/srcs/hash/md5/md5_utils.c index 0616ab1..201217f 100644 --- a/srcs/hash/md5/md5_utils.c +++ b/srcs/hash/md5/md5_utils.c @@ -6,13 +6,13 @@ /* By: cpieri +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/02/13 13:34:11 by cpieri #+# #+# */ -/* Updated: 2019/04/11 11:58:15 by cpieri ### ########.fr */ +/* Updated: 2019/12/30 08:36:03 by cpieri ### ########.fr */ /* */ /* ************************************************************************** */ #include "hash/md5.h" -t_md5_utils func_f(uint32_t b, uint32_t c, uint32_t d, int i) +t_md5_utils func_md5_f(uint32_t b, uint32_t c, uint32_t d, int i) { t_md5_utils ret; @@ -21,7 +21,7 @@ t_md5_utils func_f(uint32_t b, uint32_t c, uint32_t d, int i) return (ret); } -t_md5_utils func_g(uint32_t b, uint32_t c, uint32_t d, int i) +t_md5_utils func_md5_g(uint32_t b, uint32_t c, uint32_t d, int i) { t_md5_utils ret; @@ -30,7 +30,7 @@ t_md5_utils func_g(uint32_t b, uint32_t c, uint32_t d, int i) return (ret); } -t_md5_utils func_h(uint32_t b, uint32_t c, uint32_t d, int i) +t_md5_utils func_md5_h(uint32_t b, uint32_t c, uint32_t d, int i) { t_md5_utils ret; @@ -39,7 +39,7 @@ t_md5_utils func_h(uint32_t b, uint32_t c, uint32_t d, int i) return (ret); } -t_md5_utils func_i(uint32_t b, uint32_t c, uint32_t d, int i) +t_md5_utils func_md5_i(uint32_t b, uint32_t c, uint32_t d, int i) { t_md5_utils ret; @@ -62,6 +62,5 @@ t_hash *set_hash2md5(t_md5 *e) ret->h[1] = e->h1; ret->h[2] = e->h2; ret->h[3] = e->h3; - ft_memdel((void**)&(e->p.msg8)); return (ret); } diff --git a/srcs/hash/sha1/sha1.c b/srcs/hash/sha1/sha1.c new file mode 100644 index 0000000..35e1a35 --- /dev/null +++ b/srcs/hash/sha1/sha1.c @@ -0,0 +1,109 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* sha1.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/12/30 08:04:36 by cpieri #+# #+# */ +/* Updated: 2019/12/31 08:14:52 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "hash/sha1.h" + +static void padding_sha1(t_padding *p, char *data, size_t len) +{ + int i; + + i = -1; + p->init_len = len; + p->nb_bits = len * 8; + p->new_len = (448 - (p->nb_bits + 1)) % 512; + p->new_len += p->nb_bits + 64 + 1; + p->new_len /= 8; + if (!(p->msg8 = (uint8_t*)ft_memalloc(sizeof(uint8_t) * p->new_len))) + ft_abort("ft_ssl: sha1: malloc failed"); + ft_memcpy(p->msg8, data, len); + p->msg8[len] |= 1 << 7; + while (++i < 8) + p->msg8[p->new_len - 8 + i] = ((uint8_t*)&(p->nb_bits))[7 - i]; + p->offest = 0; +} + +static void calc_sha1(t_sha1 *e) +{ + int i; + uint32_t tmp; + t_sha1_utils tool; + + i = 0; + while (i < 80) + { + if (i >= 0 && i <= 19) + tool = func_sha1_f(e->b, e->c, e->d); + else if (i >= 20 && i <= 39) + tool = func_sha1_g(e->b, e->c, e->d); + else if (i >= 40 && i <= 59) + tool = func_sha1_h(e->b, e->c, e->d); + else if (i >= 60 && i <= 79) + tool = func_sha1_i(e->b, e->c, e->d); + tmp = left_rotate(e->a, 5) + tool.f + e->e + tool.k + e->w[i]; + e->e = e->d; + e->d = e->c; + e->c = left_rotate(e->b, 30); + e->b = e->a; + e->a = tmp; + i++; + } +} + +static uint32_t *create_sha1_w(void *msg_8, size_t offest) +{ + int i; + uint32_t *w; + + if (!(w = (uint32_t*)ft_memalloc(sizeof(uint32_t) * 80))) + return (NULL); + i = -1; + while (++i < 16) + { + ft_memcpy(&(w[i]), msg_8 + offest + (i * 4), sizeof(uint32_t)); + w[i] = swap_uint32t(w[i]); + } + while (i < 80) + { + w[i] = left_rotate((w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]), 1); + i++; + } + return (w); +} + +void *sha1(void *data, size_t len_data) +{ + t_sha1 e; + t_hash *sum; + + e = (t_sha1){.h0 = SHA1_H0, .h1 = SHA1_H1, .h2 = SHA1_H2, .h3 = SHA1_H3, + .h4 = SHA1_H4, .w = NULL}; + padding_sha1(&(e.p), data, len_data); + while (e.p.offest < e.p.new_len) + { + e.a = e.h0; + e.b = e.h1; + e.c = e.h2; + e.d = e.h3; + e.e = e.h4; + e.w = create_sha1_w(e.p.msg8, e.p.offest); + calc_sha1(&e); + ft_memdel((void**)&(e.w)); + e.h0 += e.a; + e.h1 += e.b; + e.h2 += e.c; + e.h3 += e.d; + e.h4 += e.e; + e.p.offest += 64; + } + sum = set_hash2sha1(&e); + return (sum); +} diff --git a/srcs/hash/sha1/sha1_utils.c b/srcs/hash/sha1/sha1_utils.c new file mode 100644 index 0000000..ec590d5 --- /dev/null +++ b/srcs/hash/sha1/sha1_utils.c @@ -0,0 +1,67 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* sha1_utils.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/12/30 08:42:25 by cpieri #+# #+# */ +/* Updated: 2019/12/31 08:14:54 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "hash/sha1.h" + +t_sha1_utils func_sha1_f(uint32_t b, uint32_t c, uint32_t d) +{ + t_sha1_utils ret; + + ret.f = ((b & c) | ((~b) & d)); + ret.k = 0x5a827999; + return (ret); +} + +t_sha1_utils func_sha1_g(uint32_t b, uint32_t c, uint32_t d) +{ + t_sha1_utils ret; + + ret.f = (b ^ c ^ d); + ret.k = 0x6ed9eba1; + return (ret); +} + +t_sha1_utils func_sha1_h(uint32_t b, uint32_t c, uint32_t d) +{ + t_sha1_utils ret; + + ret.f = ((b & c) | (b & d) | (c & d)); + ret.k = 0x8f1bbcdc; + return (ret); +} + +t_sha1_utils func_sha1_i(uint32_t b, uint32_t c, uint32_t d) +{ + t_sha1_utils ret; + + ret.f = (b ^ c ^ d); + ret.k = 0xca62c1d6; + return (ret); +} + +t_hash *set_hash2sha1(t_sha1 *e) +{ + t_hash *ret; + + ft_memdel((void**)&e->p.msg8); + if (!(ret = (t_hash*)malloc(sizeof(t_hash)))) + return (NULL); + if (!(ret->h = (uint32_t*)malloc(sizeof(uint32_t) * 5))) + return (NULL); + ret->nb_word = 5; + ret->h[0] = swap_uint32t(e->h0); + ret->h[1] = swap_uint32t(e->h1); + ret->h[2] = swap_uint32t(e->h2); + ret->h[3] = swap_uint32t(e->h3); + ret->h[4] = swap_uint32t(e->h4); + return (ret); +} diff --git a/srcs/hash/sha256/sha256.c b/srcs/hash/sha256/sha256.c index 7ff21b0..7ce363e 100644 --- a/srcs/hash/sha256/sha256.c +++ b/srcs/hash/sha256/sha256.c @@ -6,12 +6,26 @@ /* By: cpieri +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/03/18 10:47:43 by cpieri #+# #+# */ -/* Updated: 2019/04/11 14:12:18 by cpieri ### ########.fr */ +/* Updated: 2019/05/22 11:11:53 by cpieri ### ########.fr */ /* */ /* ************************************************************************** */ #include "hash/sha256.h" +static const uint32_t g_k_sha256[64] = { + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, + 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, + 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, + 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, + 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, + 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, + 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, + 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, + 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 +}; + static void padding_sha256(t_padding *p, void *data, size_t len) { int i; @@ -23,7 +37,7 @@ static void padding_sha256(t_padding *p, void *data, size_t len) p->new_len += p->nb_bits + 64 + 1; p->new_len /= 8; if (!(p->msg8 = (uint8_t*)ft_memalloc(sizeof(uint8_t) * p->new_len))) - ft_abort("malloc failed"); + ft_abort("ft_ssl: sha256: malloc failed"); ft_memcpy(p->msg8, data, len); p->msg8[len] |= 1 << 7; while (++i < 8) @@ -108,7 +122,7 @@ static void calc_sha256(t_sha256 *t) void *sha256(void *data, size_t len_data) { - t_hash *f_hash; + t_hash *sum; t_sha256 t; t = (t_sha256){.h0 = SHA256_H0, .h1 = SHA256_H1, .h2 = SHA256_H2, @@ -130,6 +144,6 @@ void *sha256(void *data, size_t len_data) ft_memdel((void**)&(t.w)); t.p.offest += 64; } - f_hash = set_hash2sha256(&t); - return (f_hash); + sum = set_hash2sha256(&t); + return (sum); } diff --git a/srcs/hash/sha256/sha256_utils.c b/srcs/hash/sha256/sha256_utils.c index a0ecd96..897b972 100644 --- a/srcs/hash/sha256/sha256_utils.c +++ b/srcs/hash/sha256/sha256_utils.c @@ -6,7 +6,7 @@ /* By: cpieri +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/03/08 15:40:50 by cpieri #+# #+# */ -/* Updated: 2019/04/11 11:57:33 by cpieri ### ########.fr */ +/* Updated: 2019/05/22 10:54:22 by cpieri ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/srcs/main.c b/srcs/main.c index 2d167e1..62011be 100644 --- a/srcs/main.c +++ b/srcs/main.c @@ -3,10 +3,10 @@ /* ::: :::::::: */ /* main.c :+: :+: :+: */ /* +:+ +:+ +:+ */ -/* By: cpieri +#+ +:+ +#+ */ +/* By: cpieri +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/01/24 17:05:16 by cpieri #+# #+# */ -/* Updated: 2019/03/20 19:52:57 by cpieri ### ########.fr */ +/* Updated: 2020/01/02 11:00:17 by cpieri ### ########.fr */ /* */ /* ************************************************************************** */ @@ -19,7 +19,7 @@ int main(int ac, char **av) if (ac < 2) print_usage(1, NULL); parse = parsing(ac, av); - hashing(&parse); - clean_prog(&parse); + dispatch(&parse); + // clean_prog(&parse); return (0); } diff --git a/srcs/parsing.c b/srcs/parsing.c index 509556f..21cf755 100644 --- a/srcs/parsing.c +++ b/srcs/parsing.c @@ -6,12 +6,22 @@ /* By: cpieri +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/01/24 17:29:57 by cpieri #+# #+# */ -/* Updated: 2019/04/11 15:10:03 by cpieri ### ########.fr */ +/* Updated: 2019/12/30 09:00:08 by cpieri ### ########.fr */ /* */ /* ************************************************************************** */ #include "ft_ssl.h" +static const t_parse g_all_cmd[] = +{ + {"md5", "MD5", e_hash, md5, hash_opts, printing_hash, NULL}, + {"sha1", "SHA1", e_hash, sha1, hash_opts, printing_hash, NULL}, + {"sha256", "SHA256", e_hash, sha256, hash_opts, printing_hash, NULL}, + {"base64", "base64", e_cipher, base64, base64_opts, printing_base64, NULL}, + {"des", "des", e_cipher, des, symmetric_opts, NULL, NULL}, + {NULL, NULL, 0, NULL, NULL, NULL, NULL}, +}; + t_parse parsing(const int ac, char **av) { t_parse parse; diff --git a/srcs/symmetric/cbc.c b/srcs/symmetric/cbc.c new file mode 100644 index 0000000..888127f --- /dev/null +++ b/srcs/symmetric/cbc.c @@ -0,0 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* cbc.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/05/06 10:09:17 by cpieri #+# #+# */ +/* Updated: 2019/05/06 12:15:39 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "symmetric/symmetric.h" + +void *cbc(void *msg, void *key, size_t msg_len, size_t key_len); diff --git a/srcs/symmetric/des/des.c b/srcs/symmetric/des/des.c new file mode 100644 index 0000000..1627800 --- /dev/null +++ b/srcs/symmetric/des/des.c @@ -0,0 +1,20 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* des.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/05/06 10:05:42 by cpieri #+# #+# */ +/* Updated: 2019/05/20 08:09:40 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "symmetric/des/des.h" +#include "symmetric/symmetric.h" + +void *des(void *opt, size_t len_opt) +{ + (void)len_opt; + return (opt); +} \ No newline at end of file diff --git a/srcs/symmetric/symmetric_parsing.c b/srcs/symmetric/symmetric_parsing.c new file mode 100644 index 0000000..06073d1 --- /dev/null +++ b/srcs/symmetric/symmetric_parsing.c @@ -0,0 +1,120 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* symmetric_parsing.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/05/06 12:04:37 by cpieri #+# #+# */ +/* Updated: 2020/04/20 11:12:14 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "ft_ssl.h" +#include "symmetric/symmetric.h" +#include + +static const t_sym_opt g_sym_opt[] = +{ + {'a', e_sym_opt_a, get_sym_opt_a}, + {'d', e_sym_opt_d, get_sym_opt_d}, + {'e', e_sym_opt_e, get_sym_opt_e}, + {'i', e_sym_opt_i, get_sym_opt_i}, + {'o', e_sym_opt_o, get_sym_opt_o}, + {'k', e_sym_opt_k, get_sym_opt_k}, + {'s', e_sym_opt_s, get_sym_opt_s}, + {'p', e_sym_opt_p, get_sym_opt_p}, + {'v', e_sym_opt_v, get_sym_opt_v}, + {0, 0, NULL} +}; + +static const t_evp_f g_evp_f[] = +{ + {evp_bytes2key, {8, 8, 32}, 1, EVP_MD5}, + {pbkdf2, {8, 8, 16}, 10000, HMAC_SHA256}, + {NULL, {0, 0, 0}, 0, 0} +}; + +static void check_pbkdf2(t_evp **k, uint do_pbkdf2) +{ + t_evp_f evp_f; + + evp_f = (do_pbkdf2 == 1) ? g_evp_f[1] : g_evp_f[0]; + if (*k != NULL) + { + if ((*k)->pass == NULL) + { + (*k)->pass = get_pass("enter your password: "); + (*k)->pass_len = ft_strlen((*k)->pass); + if ((*k)->salt == NULL) + { + (*k)->salt = get_random(); + (*k)->salt_len = ft_strlen((char*)(*k)->salt); + } + } + if ((*k)->key != 0 && (*k)->vect == 0) + exit_msg("iv undefined"); + else if ((*k)->key == 0 && (*k)->vect == 0) + evp_f.f(*k, evp_f.c, evp_f.full_size, evp_f.prf); + } + else + { + *k = new_t_evp(get_pass("enter your password: "), 0, 0, 0); + evp_f.f(*k, evp_f.c, evp_f.full_size, evp_f.prf); + } +} + +static void get_sym_opt(char **av, int *now, t_opt *opt, t_evp **k) +{ + size_t len_now; + size_t i; + size_t y; + + i = 0; + len_now = ft_strlen(av[*now]); + while (++i < len_now) + { + y = 0; + while (g_sym_opt[y].opt != 0) + { + if (g_sym_opt[y].opt == av[*now][i]) + if (g_sym_opt[y].sym_opt_fun != NULL) + g_sym_opt[y].sym_opt_fun(av, now, opt, k); + y++; + } + } +} + +static t_opt *get_sym_args(const int ac, char **av, int now) +{ + t_opt opt; + uint do_pbkdf2; + t_evp *k; + + k = NULL; + do_pbkdf2 = 0; + opt = (t_opt){NULL, {0, 0, 0, 0, 0, 0}, NULL}; + while (now < ac) + { + if (ft_strcmp(av[now], "-pbkdf2") == 0) + do_pbkdf2 = 1; + else if (av[now][0] == '-') + get_sym_opt(av, &now, &opt, &k); + now++; + } + check_pbkdf2(&k, do_pbkdf2); + // print_evp(k); + get_sym_stdin(&opt, &k); + return (new_opt(opt.flags, opt.data)); +} + +t_opt *symmetric_opts(const int ac, char **av, t_opt *opts, int now) +{ + t_opt *new; + + new = get_sym_args(ac, av, now); + add_to_end_lst(new, &opts); + // print_lst(&opts); + // while (1); + return (opts); +} diff --git a/srcs/symmetric/symmetric_parsing_pt_f.c b/srcs/symmetric/symmetric_parsing_pt_f.c new file mode 100644 index 0000000..ed12007 --- /dev/null +++ b/srcs/symmetric/symmetric_parsing_pt_f.c @@ -0,0 +1,77 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* symmetric_parsing_pt_f.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/05/07 09:34:06 by cpieri #+# #+# */ +/* Updated: 2020/02/04 09:58:35 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "symmetric/symmetric.h" +#include "ft_ssl.h" + +void get_sym_opt_i(char **av, int *now, t_opt *opt, t_evp **k) +{ + char *fd; + const char *fd_output; + + (void)k; + fd_output = NULL; + if ((fd = av[*now + 1]) == NULL || fd[0] == '-') + sym_usage(av[*now]); + opt->flags.sym_flags |= e_sym_opt_i; + if (opt->data != NULL && fd != NULL) + { + if (opt->data->fd_output != NULL) + fd_output = opt->data->fd_output; + clean_data(&(opt->data)); + } + opt->data = get_data(open_fd(fd), fd); + ft_putstr((char*)opt->data); + opt->data->fd_output = fd_output; + (*now)++; +} + +void get_sym_opt_o(char **av, int *now, t_opt *opt, t_evp **k) +{ + char *fd_output; + + (void)k; + if ((fd_output = av[*now + 1]) == NULL || fd_output[0] == '-') + sym_usage(av[*now]); + opt->flags.sym_flags |= e_sym_opt_o; + if (opt->data == NULL) + opt->data = new_data(); + opt->data->fd_output = fd_output; + (*now)++; +} + +void get_sym_opt_a(char **av, int *now, t_opt *opt, t_evp **k) +{ + (void)av; + (void)now; + (void)k; + opt->flags.sym_flags |= e_sym_opt_a; +} + +void get_sym_opt_d(char **av, int *now, t_opt *opt, t_evp **k) +{ + (void)k; + (void)now; + (void)av; + if ((opt->flags.sym_flags & e_sym_opt_e) == e_sym_opt_e) + opt->flags.sym_flags ^= e_sym_opt_e; + opt->flags.sym_flags |= e_sym_opt_d; +} + +void get_sym_opt_e(char **av, int *now, t_opt *opt, t_evp **k) +{ + (void)k; + (void)now; + (void)av; + if ((opt->flags.sym_flags & e_sym_opt_d) != e_sym_opt_d) + opt->flags.sym_flags |= e_sym_opt_e; +} diff --git a/srcs/symmetric/symmetric_parsing_pt_f_2.c b/srcs/symmetric/symmetric_parsing_pt_f_2.c new file mode 100644 index 0000000..e0806d0 --- /dev/null +++ b/srcs/symmetric/symmetric_parsing_pt_f_2.c @@ -0,0 +1,122 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* symmetric_parsing_pt_f_2.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/05/08 10:21:15 by cpieri #+# #+# */ +/* Updated: 2020/04/20 10:58:16 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "symmetric/symmetric.h" +#include "ft_ssl.h" + +void get_sym_opt_p(char **av, int *now, t_opt *opt, t_evp **k) +{ + char *pass; + + if ((pass = av[*now + 1]) == NULL || pass[0] == '-') + sym_usage(av[*now]); + if ((opt->flags.sym_flags & e_sym_opt_k) != e_sym_opt_k) + { + opt->flags.sym_flags |= e_sym_opt_p; + if (*k == NULL) + *k = new_t_evp((uint8_t*)pass, 0, 0, 0); + else + (*k)->pass = (uint8_t*)pass; + (*k)->pass_len = ft_strlen(pass); + (*now)++; + } +} + +void get_sym_opt_s(char **av, int *now, t_opt *opt, t_evp **k) +{ + char *salt; + uint64_t nb; + + nb = 0; + if ((salt = av[*now + 1]) == NULL || av[*now + 1][0] == '-') + sym_usage(av[*now]); + if ((opt->flags.sym_flags & e_sym_opt_k) != e_sym_opt_k) + { + if (ft_ishexa(salt) == 1) + { + nb = swap_uint64t(hex2uint64t(salt)); + salt = ft_memdup(&nb, sizeof(uint64_t)); + } + else + exit_msg("ft_ssl: invalid hex salt value"); + opt->flags.sym_flags |= e_sym_opt_s; + if (*k == NULL) + *k = new_t_evp(NULL, salt, 0, 0); + else + (*k)->salt = salt; + (*k)->salt_len = 8; + (*now)++; + } +} + +void get_sym_opt_k(char **av, int *now, t_opt *opt, t_evp **k) +{ + uint64_t key_uint; + char *key; + + if ((key = av[*now + 1]) == NULL || av[*now + 1][0] == '-') + sym_usage(av[*now]); + if (ft_ishexa(key) == 1) + { + key_uint = swap_uint64t(hex2uint64t(key)); + key = ft_memdup(&key_uint, sizeof(uint64_t)); + } + opt->flags.sym_flags |= e_sym_opt_k; + if ((opt->flags.sym_flags & e_sym_opt_s) == e_sym_opt_s) + opt->flags.sym_flags ^= e_sym_opt_s; + if (*k == NULL) + *k = new_t_evp(NULL, 0, key, 0); + else + (*k)->key = key; + (*k)->dk_len = 8; + (*now)++; +} + +void get_sym_opt_v(char **av, int *now, t_opt *opt, t_evp **k) +{ + char *vect; + uint64_t vector; + + vector = 0; + if ((vect = av[*now + 1]) == NULL || av[*now + 1][0] == '-') + sym_usage(av[*now]); + if (ft_ishexa(vect) == 1) + { + vector = swap_uint64t(hex2uint64t(vect)); + vect = ft_memdup(&vector, sizeof(uint64_t)); + } + opt->flags.sym_flags |= e_sym_opt_v; + if (*k == NULL) + *k = new_t_evp(NULL, 0, 0, vect); + else + (*k)->vect = vect; + (*k)->iv_len = 8; + (*now)++; +} + +void get_sym_stdin(t_opt *opt, t_evp **k) +{ + const char *fd_output; + + fd_output = NULL; + if (opt->data == NULL) + opt->data = new_data(); + if (opt->data->fd_output != NULL) + fd_output = opt->data->fd_output; + if (opt->data != NULL && opt->data->data == NULL) + { + clean_data(&(opt->data)); + opt->data = get_data(0, NULL); + } + opt->data->fd_output = fd_output; + opt->data->pass = *k; +} diff --git a/srcs/symmetric/symmetric_usage.c b/srcs/symmetric/symmetric_usage.c new file mode 100644 index 0000000..388b2d4 --- /dev/null +++ b/srcs/symmetric/symmetric_usage.c @@ -0,0 +1,30 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* symmetric_usage.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/05/07 11:15:38 by cpieri #+# #+# */ +/* Updated: 2019/05/07 16:15:07 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "ft_ssl.h" + +void sym_usage(const char *opt) +{ + ft_putstr_fd("ft_ssl: Error options: ", 2); + ft_putendl_fd(opt, 2); + ft_putendl_fd("-e Encrypt (default mode)", 2); + ft_putendl_fd("-d Decrypt", 2); + ft_putstr_fd("-a Base64 encode/decode,", 2); + ft_putendl_fd(" depending on encryption flag", 2); + ft_putendl_fd("-i Input file", 2); + ft_putendl_fd("-o Output file", 2); + ft_putendl_fd("-k Key in hex is the next arg", 2); + ft_putendl_fd("-s Salt in hex is the next arg", 2); + ft_putendl_fd("-p Password in ascii is the next arg", 2); + ft_putendl_fd("-v Init vector in ascii is the next arg", 2); + exit(FAILURE); +} diff --git a/srcs/clean.c b/srcs/tools/clean.c similarity index 72% rename from srcs/clean.c rename to srcs/tools/clean.c index f88d00a..3853c5a 100644 --- a/srcs/clean.c +++ b/srcs/tools/clean.c @@ -3,15 +3,27 @@ /* ::: :::::::: */ /* clean.c :+: :+: :+: */ /* +:+ +:+ +:+ */ -/* By: cpieri +#+ +:+ +#+ */ +/* By: cpieri +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/03/15 12:07:14 by cpieri #+# #+# */ -/* Updated: 2019/03/26 18:23:52 by cpieri ### ########.fr */ +/* Updated: 2019/05/22 11:00:56 by cpieri ### ########.fr */ /* */ /* ************************************************************************** */ #include "ft_ssl.h" +void clean_data(t_data **data) +{ + if (*data != NULL) + { + if ((*data)->mall == 1) + ft_memdel((void**)&((*data)->data)); + if ((*data)->data_2_print != NULL) + ft_memdel((void**)&((*data)->data_2_print)); + ft_memdel((void**)data); + } +} + void clean_prog(t_parse *parse) { t_opt *next; @@ -22,8 +34,7 @@ void clean_prog(t_parse *parse) { if (lst->data->mall == 1) ft_memdel((void**)&(lst->data->data)); - ft_memdel((void**)&(lst->data->f_hash->h)); - ft_memdel((void**)&(lst->data->f_hash)); + ft_memdel((void**)&(lst->data->data_2_print)); ft_memdel((void**)&(lst->data)); next = lst->next; ft_memdel((void**)&(lst)); diff --git a/srcs/tools/error.c b/srcs/tools/error.c new file mode 100644 index 0000000..0eaec37 --- /dev/null +++ b/srcs/tools/error.c @@ -0,0 +1,64 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* error.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/05/06 14:35:34 by cpieri #+# #+# */ +/* Updated: 2019/05/07 16:14:37 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "ft_ssl.h" +#include + +void print_error(const char *msg) +{ + char *error; + + ft_putstr_fd("ft_ssl: ", 2); + ft_putstr_fd(msg, 2); + ft_putstr_fd(": ", 2); + error = strerror(errno); + ft_putendl_fd(error, 2); +} + +void exit_error_free(void **to_free) +{ + char *error; + + ft_putstr_fd("ft_ssl: ", 2); + error = strerror(errno); + ft_putendl_fd(error, 2); + ft_memdel(to_free); + exit(FAILURE); +} + +void exit_error(void) +{ + char *error; + + ft_putstr_fd("ft_ssl: ", 2); + error = strerror(errno); + ft_putendl_fd(error, 2); + exit(FAILURE); +} + +void exit_error_msg(const char *msg) +{ + char *error; + + ft_putstr_fd("ft_ssl: ", 2); + ft_putstr_fd(msg, 2); + ft_putstr_fd(": ", 2); + error = strerror(errno); + ft_putendl_fd(error, 2); + exit(FAILURE); +} + +void exit_msg(const char *msg) +{ + ft_putendl_fd(msg, 2); + exit(FAILURE); +} diff --git a/srcs/get_data.c b/srcs/tools/get_data.c similarity index 76% rename from srcs/get_data.c rename to srcs/tools/get_data.c index 9e60290..a383f59 100644 --- a/srcs/get_data.c +++ b/srcs/tools/get_data.c @@ -3,65 +3,35 @@ /* ::: :::::::: */ /* get_data.c :+: :+: :+: */ /* +:+ +:+ +:+ */ -/* By: cpieri +#+ +:+ +#+ */ +/* By: cpieri +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/02/08 12:03:54 by cpieri #+# #+# */ -/* Updated: 2019/04/05 13:58:14 by cpieri ### ########.fr */ +/* Updated: 2020/01/09 12:57:25 by cpieri ### ########.fr */ /* */ /* ************************************************************************** */ -#include #include "ft_ssl.h" -t_data *get_string(char *s) +t_data *new_data(void) { t_data *ret; - ret = NULL; if (!(ret = (t_data*)malloc(sizeof(t_data)))) exit_error(); - ret->fd_name = s; - ret->data = s; - ret->len_data = ft_strlen(s); - ret->mall = 0; - s = NULL; + *ret = (t_data){NULL, NULL, NULL, 0, 0, NULL, NULL}; return (ret); } -int open_fd(const char *file) -{ - int fd; - char *tmp; - - fd = open(file, O_RDONLY); - tmp = NULL; - if (fd == FAILURE) - { - print_error(file); - return (FAILURE); - } - if (read(fd, tmp, 0) == FAILURE) - { - if (close(fd) != 0) - exit_error(); - print_error(file); - return (FAILURE); - } - return (fd); -} - -static int reopen_fd(const int current_fd, const char *file) +t_data *get_string(char *s) { - int new_fd; + t_data *ret; - if (close(current_fd) != 0) + ret = NULL; + if (!(ret = (t_data*)malloc(sizeof(t_data)))) exit_error(); - if ((new_fd = open(file, O_RDONLY)) == FAILURE) - { - print_error(file); - return (FAILURE); - } - return (new_fd); + *ret = (t_data){NULL, s, s, ft_strlen(s), 0, NULL, NULL}; + s = NULL; + return (ret); } t_data *get_file(const int fd, const char *fd_name) @@ -118,3 +88,20 @@ t_data *get_data(const int fd, const char *fd_name) (ret->data == NULL) ? ft_memdel((void**)&(ret->data)) : NULL; return (ret); } + +void *get_random(void) +{ + unsigned char *ret; + uint64_t random_value; + int dev_random_fd; + int nb_read; + + random_value = FAILURE; + dev_random_fd = open_fd("/dev/random"); + nb_read = read(dev_random_fd, &random_value, sizeof(uint64_t)); + random_value = swap_uint64t(random_value); + ret = ft_memdup(&random_value, sizeof(uint64_t)); + if (nb_read == FAILURE) + print_error("get_random"); + return (ret); +} diff --git a/srcs/tools/get_data_1.c b/srcs/tools/get_data_1.c new file mode 100644 index 0000000..3ec8995 --- /dev/null +++ b/srcs/tools/get_data_1.c @@ -0,0 +1,33 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* get_data_1.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/01/09 12:54:47 by cpieri #+# #+# */ +/* Updated: 2020/04/20 10:24:39 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "ft_ssl.h" + +uint8_t *get_pass(const char *prompt) +{ + char *pass; + char *conf_prompt; + char *conf_pass; + + conf_prompt = ft_strjoin("Verifying - ", prompt); + pass = ft_strdup(getpass(prompt)); + conf_pass = getpass(conf_prompt); + ft_memdel((void**)&conf_prompt); + if (!pass || !conf_pass) + exit_error_msg("getpass"); + if (ft_strcmp(conf_pass, pass) != 0) + { + ft_memdel((void**)&pass); + exit_msg("Verifying Failure"); + } + return ((uint8_t*)pass); +} diff --git a/srcs/lst_opt.c b/srcs/tools/lst_opt.c similarity index 58% rename from srcs/lst_opt.c rename to srcs/tools/lst_opt.c index f35e12f..2c48230 100644 --- a/srcs/lst_opt.c +++ b/srcs/tools/lst_opt.c @@ -1,12 +1,12 @@ /* ************************************************************************** */ /* */ /* ::: :::::::: */ -/* utils.c :+: :+: :+: */ +/* lst_opt.c :+: :+: :+: */ /* +:+ +:+ +:+ */ -/* By: cpieri +#+ +:+ +#+ */ +/* By: cpieri +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/02/08 17:29:55 by cpieri #+# #+# */ -/* Updated: 2019/03/26 15:35:59 by cpieri ### ########.fr */ +/* Updated: 2020/02/04 09:58:54 by cpieri ### ########.fr */ /* */ /* ************************************************************************** */ @@ -19,11 +19,16 @@ void print_lst(t_opt **lst) tmp = *lst; while (tmp != NULL) { - ft_putendl(tmp->data->data); - if (tmp->next != NULL) - tmp = tmp->next; - else - break ; + ft_putstr("data to crypt: "); + ft_memput(tmp->data->data, tmp->data->len_data); + ft_membits(&tmp->flags.sym_flags, 0, sizeof(uint64_t)); + print_evp((t_evp*)(tmp->data->pass)); + if (tmp->data->fd_output != NULL) + { + ft_putstr("fd to output: "); + ft_putendl(tmp->data->fd_output); + } + tmp = tmp->next; } } @@ -53,5 +58,22 @@ t_opt *new_opt(t_flags flags, t_data *data) new->next = NULL; new->data = data; new->flags = flags; + if (data->fd_output == NULL) + new->data->fd_output = NULL; + return (new); +} + +t_opt *new_opt_fd(t_flags flags, t_data *data, char *fd) +{ + t_opt *new; + + if (data == NULL) + return (NULL); + if (!(new = (t_opt*)malloc(sizeof(t_opt)))) + return (NULL); + new->next = NULL; + new->data = data; + new->flags = flags; + new->data->fd_output = (fd != NULL) ? fd : NULL; return (new); } diff --git a/srcs/tools/open_fd.c b/srcs/tools/open_fd.c new file mode 100644 index 0000000..9e8cc9c --- /dev/null +++ b/srcs/tools/open_fd.c @@ -0,0 +1,77 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* help.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cpieri +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/04/29 13:37:15 by cpieri #+# #+# */ +/* Updated: 2019/04/30 14:27:02 by cpieri ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include +#include "ft_ssl.h" + +int open_write_fd(const char *file) +{ + int fd; + + fd = open(file, O_WRONLY); + if (fd == FAILURE) + { + fd = open(file, O_CREAT | O_WRONLY); + if (fd == FAILURE) + { + print_error(file); + return (FAILURE); + } + } + return (fd); +} + +int open_fd(const char *file) +{ + int fd; + char *tmp; + + fd = open(file, O_RDONLY); + tmp = NULL; + if (fd == FAILURE) + { + print_error(file); + return (FAILURE); + } + if (read(fd, tmp, 0) == FAILURE) + { + if (close(fd) != 0) + exit_error(); + print_error(file); + return (FAILURE); + } + return (fd); +} + +int reopen_fd(const int current_fd, const char *file) +{ + int new_fd; + + if (close(current_fd) != 0) + exit_error(); + if ((new_fd = open(file, O_RDONLY)) == FAILURE) + { + print_error(file); + return (FAILURE); + } + return (new_fd); +} + +int close_fd(const int fd) +{ + if (close(fd) != 0) + { + print_error("base64 close"); + return (FAILURE); + } + return (SUCCESS); +} diff --git a/srcs/usage.c b/srcs/tools/usage.c similarity index 72% rename from srcs/usage.c rename to srcs/tools/usage.c index 73a8cda..02db9ea 100644 --- a/srcs/usage.c +++ b/srcs/tools/usage.c @@ -6,13 +6,28 @@ /* By: cpieri +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/01/24 17:06:36 by cpieri #+# #+# */ -/* Updated: 2019/04/11 14:11:59 by cpieri ### ########.fr */ +/* Updated: 2019/12/30 09:06:45 by cpieri ### ########.fr */ /* */ /* ************************************************************************** */ #include "ft_ssl.h" -#include -#include + +static const char *g_hash_cmd[] = +{ + "md5", + "sha1", + "sha256", + NULL +}; + +static const char *g_cipher_cmd[] = +{ + "base64", + "des", + "des-ecb", + "des-cbc", + NULL +}; static void invalid_command(const char *command) { @@ -43,35 +58,3 @@ void print_usage(const int usage_int, const char *command) invalid_command(command); exit(FAILURE); } - -void print_error(const char *msg_1) -{ - char *error; - - ft_putstr_fd("ft_ssl: ", 2); - ft_putstr_fd(msg_1, 2); - ft_putstr_fd(": ", 2); - error = strerror(errno); - ft_putendl_fd(error, 2); -} - -void exit_error_free(void **to_free) -{ - char *error; - - ft_putstr_fd("ft_ssl: ", 2); - error = strerror(errno); - ft_putendl_fd(error, 2); - ft_memdel(to_free); - exit(FAILURE); -} - -void exit_error(void) -{ - char *error; - - ft_putstr_fd("ft_ssl: ", 2); - error = strerror(errno); - ft_putendl_fd(error, 2); - exit(FAILURE); -} diff --git a/test/logs/trace_Invalid_command_01 b/test/logs/trace_Invalid_command_01 deleted file mode 100644 index 7f6a1e0..0000000 --- a/test/logs/trace_Invalid_command_01 +++ /dev/null @@ -1,9 +0,0 @@ -ft_ssl: Error: x is an invalid command. - -Standard commands: - -Message Digest commands: -md5 -sha256 - -Cipher commands: diff --git a/test/logs/trace_Invalid_command_02 b/test/logs/trace_Invalid_command_02 deleted file mode 100644 index 7f6a1e0..0000000 --- a/test/logs/trace_Invalid_command_02 +++ /dev/null @@ -1,9 +0,0 @@ -ft_ssl: Error: x is an invalid command. - -Standard commands: - -Message Digest commands: -md5 -sha256 - -Cipher commands: diff --git a/test/logs/trace_Invalid_command_03 b/test/logs/trace_Invalid_command_03 deleted file mode 100644 index 7f6a1e0..0000000 --- a/test/logs/trace_Invalid_command_03 +++ /dev/null @@ -1,9 +0,0 @@ -ft_ssl: Error: x is an invalid command. - -Standard commands: - -Message Digest commands: -md5 -sha256 - -Cipher commands: diff --git a/test/logs/trace_Invalid_command_04 b/test/logs/trace_Invalid_command_04 deleted file mode 100644 index 7f6a1e0..0000000 --- a/test/logs/trace_Invalid_command_04 +++ /dev/null @@ -1,9 +0,0 @@ -ft_ssl: Error: x is an invalid command. - -Standard commands: - -Message Digest commands: -md5 -sha256 - -Cipher commands: diff --git a/test/logs/trace_Invalid_command_05 b/test/logs/trace_Invalid_command_05 deleted file mode 100644 index 7f6a1e0..0000000 --- a/test/logs/trace_Invalid_command_05 +++ /dev/null @@ -1,9 +0,0 @@ -ft_ssl: Error: x is an invalid command. - -Standard commands: - -Message Digest commands: -md5 -sha256 - -Cipher commands: diff --git a/test/logs/trace_directory b/test/logs/trace_directory deleted file mode 100644 index 42ce5e6..0000000 --- a/test/logs/trace_directory +++ /dev/null @@ -1 +0,0 @@ -ft_ssl: resources/folder: No such file or directory diff --git a/test/logs/trace_file_not_found b/test/logs/trace_file_not_found deleted file mode 100644 index 91fd3a6..0000000 --- a/test/logs/trace_file_not_found +++ /dev/null @@ -1 +0,0 @@ -ft_ssl: resources/testing_everything: No such file or directory diff --git a/test/logs/trace_md5_binary_file_arg b/test/logs/trace_md5_binary_file_arg deleted file mode 100644 index 100283b..0000000 --- a/test/logs/trace_md5_binary_file_arg +++ /dev/null @@ -1 +0,0 @@ -MD5 (resources/binary_file) = 46c0e7f4f1cbd004431f176ad87b5d46 diff --git a/test/logs/trace_md5_binary_file_stdin b/test/logs/trace_md5_binary_file_stdin deleted file mode 100644 index 15fb0e7..0000000 --- a/test/logs/trace_md5_binary_file_stdin +++ /dev/null @@ -1 +0,0 @@ -46c0e7f4f1cbd004431f176ad87b5d46 diff --git a/test/logs/trace_md5_empty_file_arg b/test/logs/trace_md5_empty_file_arg deleted file mode 100644 index aaeda2c..0000000 --- a/test/logs/trace_md5_empty_file_arg +++ /dev/null @@ -1 +0,0 @@ -MD5 (resources/empty_file) = d41d8cd98f00b204e9800998ecf8427e diff --git a/test/logs/trace_md5_empty_file_stdin b/test/logs/trace_md5_empty_file_stdin deleted file mode 100644 index df9edc4..0000000 --- a/test/logs/trace_md5_empty_file_stdin +++ /dev/null @@ -1 +0,0 @@ -d41d8cd98f00b204e9800998ecf8427e diff --git a/test/logs/trace_md5_large_file_arg b/test/logs/trace_md5_large_file_arg deleted file mode 100644 index b3087bb..0000000 --- a/test/logs/trace_md5_large_file_arg +++ /dev/null @@ -1 +0,0 @@ -MD5 (resources/text_file_large) = 3347b7ed7e69584b7dfa1ec24cbfff1e diff --git a/test/logs/trace_md5_large_file_stdin b/test/logs/trace_md5_large_file_stdin deleted file mode 100644 index dc8ebde..0000000 --- a/test/logs/trace_md5_large_file_stdin +++ /dev/null @@ -1 +0,0 @@ -3347b7ed7e69584b7dfa1ec24cbfff1e diff --git a/test/logs/trace_md5_medium_file_arg b/test/logs/trace_md5_medium_file_arg deleted file mode 100644 index 87ff323..0000000 --- a/test/logs/trace_md5_medium_file_arg +++ /dev/null @@ -1 +0,0 @@ -MD5 (resources/text_file_medium) = f4cb1efa2c4eebe3589d7405f4174577 diff --git a/test/logs/trace_md5_medium_file_stdin b/test/logs/trace_md5_medium_file_stdin deleted file mode 100644 index 5b4a791..0000000 --- a/test/logs/trace_md5_medium_file_stdin +++ /dev/null @@ -1 +0,0 @@ -f4cb1efa2c4eebe3589d7405f4174577 diff --git a/test/logs/trace_md5_option_s_448_chars_edge_case b/test/logs/trace_md5_option_s_448_chars_edge_case deleted file mode 100644 index 0105571..0000000 --- a/test/logs/trace_md5_option_s_448_chars_edge_case +++ /dev/null @@ -1 +0,0 @@ -MD5 ("A very long text with 448 chars, but i need to add more!") = 68554f041dad94d228b0013872e4ac99 diff --git a/test/logs/trace_md5_option_s_basic_string b/test/logs/trace_md5_option_s_basic_string deleted file mode 100644 index a67120d..0000000 --- a/test/logs/trace_md5_option_s_basic_string +++ /dev/null @@ -1 +0,0 @@ -MD5 ("Foo bar") = d05ebcd9fba6aee3e8411771c083b3db diff --git a/test/logs/trace_md5_option_s_empty_string b/test/logs/trace_md5_option_s_empty_string deleted file mode 100644 index 6cfa5d5..0000000 --- a/test/logs/trace_md5_option_s_empty_string +++ /dev/null @@ -1 +0,0 @@ -MD5 ("") = d41d8cd98f00b204e9800998ecf8427e diff --git a/test/logs/trace_md5_option_s_unicode b/test/logs/trace_md5_option_s_unicode deleted file mode 100644 index 8b49e40..0000000 --- a/test/logs/trace_md5_option_s_unicode +++ /dev/null @@ -1 +0,0 @@ -MD5 ("你吃饭了吗? Nǐ chīfàn le ma? Literally: Have you eaten?") = 052fe420c44f836e2c087d1e6bc8fc35 diff --git a/test/logs/trace_md5_small_file_arg b/test/logs/trace_md5_small_file_arg deleted file mode 100644 index 370cd93..0000000 --- a/test/logs/trace_md5_small_file_arg +++ /dev/null @@ -1 +0,0 @@ -MD5 (resources/text_file_small) = f0ef7081e1539ac00ef5b761b4fb01b3 diff --git a/test/logs/trace_md5_small_file_stdin b/test/logs/trace_md5_small_file_stdin deleted file mode 100644 index 971886c..0000000 --- a/test/logs/trace_md5_small_file_stdin +++ /dev/null @@ -1 +0,0 @@ -f0ef7081e1539ac00ef5b761b4fb01b3 diff --git a/test/logs/trace_no_argument_01 b/test/logs/trace_no_argument_01 deleted file mode 100644 index df6c0fb..0000000 --- a/test/logs/trace_no_argument_01 +++ /dev/null @@ -1 +0,0 @@ -usage: ft_ssl command [command opts] [command args] diff --git a/test/logs/trace_no_argument_02 b/test/logs/trace_no_argument_02 deleted file mode 100644 index df6c0fb..0000000 --- a/test/logs/trace_no_argument_02 +++ /dev/null @@ -1 +0,0 @@ -usage: ft_ssl command [command opts] [command args] diff --git a/test/logs/trace_option_s_without_arg b/test/logs/trace_option_s_without_arg deleted file mode 100644 index df9edc4..0000000 --- a/test/logs/trace_option_s_without_arg +++ /dev/null @@ -1 +0,0 @@ -d41d8cd98f00b204e9800998ecf8427e diff --git a/test/logs/trace_original_md5_binary_file_arg b/test/logs/trace_original_md5_binary_file_arg deleted file mode 100644 index 100283b..0000000 --- a/test/logs/trace_original_md5_binary_file_arg +++ /dev/null @@ -1 +0,0 @@ -MD5 (resources/binary_file) = 46c0e7f4f1cbd004431f176ad87b5d46 diff --git a/test/logs/trace_original_md5_binary_file_stdin b/test/logs/trace_original_md5_binary_file_stdin deleted file mode 100644 index 15fb0e7..0000000 --- a/test/logs/trace_original_md5_binary_file_stdin +++ /dev/null @@ -1 +0,0 @@ -46c0e7f4f1cbd004431f176ad87b5d46 diff --git a/test/logs/trace_original_md5_empty_file_arg b/test/logs/trace_original_md5_empty_file_arg deleted file mode 100644 index aaeda2c..0000000 --- a/test/logs/trace_original_md5_empty_file_arg +++ /dev/null @@ -1 +0,0 @@ -MD5 (resources/empty_file) = d41d8cd98f00b204e9800998ecf8427e diff --git a/test/logs/trace_original_md5_empty_file_stdin b/test/logs/trace_original_md5_empty_file_stdin deleted file mode 100644 index df9edc4..0000000 --- a/test/logs/trace_original_md5_empty_file_stdin +++ /dev/null @@ -1 +0,0 @@ -d41d8cd98f00b204e9800998ecf8427e diff --git a/test/logs/trace_original_md5_large_file_arg b/test/logs/trace_original_md5_large_file_arg deleted file mode 100644 index b3087bb..0000000 --- a/test/logs/trace_original_md5_large_file_arg +++ /dev/null @@ -1 +0,0 @@ -MD5 (resources/text_file_large) = 3347b7ed7e69584b7dfa1ec24cbfff1e diff --git a/test/logs/trace_original_md5_large_file_stdin b/test/logs/trace_original_md5_large_file_stdin deleted file mode 100644 index dc8ebde..0000000 --- a/test/logs/trace_original_md5_large_file_stdin +++ /dev/null @@ -1 +0,0 @@ -3347b7ed7e69584b7dfa1ec24cbfff1e diff --git a/test/logs/trace_original_md5_medium_file_arg b/test/logs/trace_original_md5_medium_file_arg deleted file mode 100644 index 87ff323..0000000 --- a/test/logs/trace_original_md5_medium_file_arg +++ /dev/null @@ -1 +0,0 @@ -MD5 (resources/text_file_medium) = f4cb1efa2c4eebe3589d7405f4174577 diff --git a/test/logs/trace_original_md5_medium_file_stdin b/test/logs/trace_original_md5_medium_file_stdin deleted file mode 100644 index 5b4a791..0000000 --- a/test/logs/trace_original_md5_medium_file_stdin +++ /dev/null @@ -1 +0,0 @@ -f4cb1efa2c4eebe3589d7405f4174577 diff --git a/test/logs/trace_original_md5_option_s_448_chars_edge_case b/test/logs/trace_original_md5_option_s_448_chars_edge_case deleted file mode 100644 index 0105571..0000000 --- a/test/logs/trace_original_md5_option_s_448_chars_edge_case +++ /dev/null @@ -1 +0,0 @@ -MD5 ("A very long text with 448 chars, but i need to add more!") = 68554f041dad94d228b0013872e4ac99 diff --git a/test/logs/trace_original_md5_option_s_basic_string b/test/logs/trace_original_md5_option_s_basic_string deleted file mode 100644 index a67120d..0000000 --- a/test/logs/trace_original_md5_option_s_basic_string +++ /dev/null @@ -1 +0,0 @@ -MD5 ("Foo bar") = d05ebcd9fba6aee3e8411771c083b3db diff --git a/test/logs/trace_original_md5_option_s_empty_string b/test/logs/trace_original_md5_option_s_empty_string deleted file mode 100644 index 6cfa5d5..0000000 --- a/test/logs/trace_original_md5_option_s_empty_string +++ /dev/null @@ -1 +0,0 @@ -MD5 ("") = d41d8cd98f00b204e9800998ecf8427e diff --git a/test/logs/trace_original_md5_option_s_unicode b/test/logs/trace_original_md5_option_s_unicode deleted file mode 100644 index 8b49e40..0000000 --- a/test/logs/trace_original_md5_option_s_unicode +++ /dev/null @@ -1 +0,0 @@ -MD5 ("你吃饭了吗? Nǐ chīfàn le ma? Literally: Have you eaten?") = 052fe420c44f836e2c087d1e6bc8fc35 diff --git a/test/logs/trace_original_md5_small_file_arg b/test/logs/trace_original_md5_small_file_arg deleted file mode 100644 index 370cd93..0000000 --- a/test/logs/trace_original_md5_small_file_arg +++ /dev/null @@ -1 +0,0 @@ -MD5 (resources/text_file_small) = f0ef7081e1539ac00ef5b761b4fb01b3 diff --git a/test/logs/trace_original_md5_small_file_stdin b/test/logs/trace_original_md5_small_file_stdin deleted file mode 100644 index 971886c..0000000 --- a/test/logs/trace_original_md5_small_file_stdin +++ /dev/null @@ -1 +0,0 @@ -f0ef7081e1539ac00ef5b761b4fb01b3 diff --git a/test/logs/trace_original_sha256_binary_file_stdin b/test/logs/trace_original_sha256_binary_file_stdin deleted file mode 100644 index 0907a07..0000000 --- a/test/logs/trace_original_sha256_binary_file_stdin +++ /dev/null @@ -1 +0,0 @@ -0c21850620f7f42e3c4ea6117a901023fef10a835f3b5ee43f6235762c798d8f diff --git a/test/logs/trace_original_sha256_empty_file_stdin b/test/logs/trace_original_sha256_empty_file_stdin deleted file mode 100644 index c306804..0000000 --- a/test/logs/trace_original_sha256_empty_file_stdin +++ /dev/null @@ -1 +0,0 @@ -e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 diff --git a/test/logs/trace_original_sha256_large_file_stdin b/test/logs/trace_original_sha256_large_file_stdin deleted file mode 100644 index 507373f..0000000 --- a/test/logs/trace_original_sha256_large_file_stdin +++ /dev/null @@ -1 +0,0 @@ -bb530fe35cad305dfcba486dbde298a1aee6fa59ad27afd05f7d9181c5e84963 diff --git a/test/logs/trace_original_sha256_medium_file_stdin b/test/logs/trace_original_sha256_medium_file_stdin deleted file mode 100644 index fed68c6..0000000 --- a/test/logs/trace_original_sha256_medium_file_stdin +++ /dev/null @@ -1 +0,0 @@ -56005170a8bb77de9cefa181aff0a7457064ff39c17f269f5a852860109c7f6a diff --git a/test/logs/trace_original_sha256_option_s_basic_string b/test/logs/trace_original_sha256_option_s_basic_string deleted file mode 100644 index b69fb06..0000000 --- a/test/logs/trace_original_sha256_option_s_basic_string +++ /dev/null @@ -1 +0,0 @@ -2fb9f1e447f906641b665b02538a0320efb3e0b667a2655b3f9e041a3b2f815d diff --git a/test/logs/trace_original_sha256_option_s_empty_string b/test/logs/trace_original_sha256_option_s_empty_string deleted file mode 100644 index c306804..0000000 --- a/test/logs/trace_original_sha256_option_s_empty_string +++ /dev/null @@ -1 +0,0 @@ -e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 diff --git a/test/logs/trace_original_sha256_option_s_unicode b/test/logs/trace_original_sha256_option_s_unicode deleted file mode 100644 index bdc5c25..0000000 --- a/test/logs/trace_original_sha256_option_s_unicode +++ /dev/null @@ -1 +0,0 @@ -498951833d0ae08fdbd6138b5ce91db88d5b278c3e60a58929309e87b357f3fa diff --git a/test/logs/trace_original_sha256_small_file_stdin b/test/logs/trace_original_sha256_small_file_stdin deleted file mode 100644 index 2d16219..0000000 --- a/test/logs/trace_original_sha256_small_file_stdin +++ /dev/null @@ -1 +0,0 @@ -1894a19c85ba153acbf743ac4e43fc004c891604b26f8c69e1e83ea2afc7c48f diff --git a/test/logs/trace_permission_denied b/test/logs/trace_permission_denied deleted file mode 100644 index 3256fef..0000000 --- a/test/logs/trace_permission_denied +++ /dev/null @@ -1 +0,0 @@ -ft_ssl: resources/permissions: Permission denied diff --git a/test/logs/trace_sha256_binary_file_stdin b/test/logs/trace_sha256_binary_file_stdin deleted file mode 100644 index 0907a07..0000000 --- a/test/logs/trace_sha256_binary_file_stdin +++ /dev/null @@ -1 +0,0 @@ -0c21850620f7f42e3c4ea6117a901023fef10a835f3b5ee43f6235762c798d8f diff --git a/test/logs/trace_sha256_empty_file_stdin b/test/logs/trace_sha256_empty_file_stdin deleted file mode 100644 index c306804..0000000 --- a/test/logs/trace_sha256_empty_file_stdin +++ /dev/null @@ -1 +0,0 @@ -e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 diff --git a/test/logs/trace_sha256_large_file_stdin b/test/logs/trace_sha256_large_file_stdin deleted file mode 100644 index 507373f..0000000 --- a/test/logs/trace_sha256_large_file_stdin +++ /dev/null @@ -1 +0,0 @@ -bb530fe35cad305dfcba486dbde298a1aee6fa59ad27afd05f7d9181c5e84963 diff --git a/test/logs/trace_sha256_medium_file_stdin b/test/logs/trace_sha256_medium_file_stdin deleted file mode 100644 index fed68c6..0000000 --- a/test/logs/trace_sha256_medium_file_stdin +++ /dev/null @@ -1 +0,0 @@ -56005170a8bb77de9cefa181aff0a7457064ff39c17f269f5a852860109c7f6a diff --git a/test/logs/trace_sha256_option_s_basic_string b/test/logs/trace_sha256_option_s_basic_string deleted file mode 100644 index b69fb06..0000000 --- a/test/logs/trace_sha256_option_s_basic_string +++ /dev/null @@ -1 +0,0 @@ -2fb9f1e447f906641b665b02538a0320efb3e0b667a2655b3f9e041a3b2f815d diff --git a/test/logs/trace_sha256_option_s_empty_string b/test/logs/trace_sha256_option_s_empty_string deleted file mode 100644 index c306804..0000000 --- a/test/logs/trace_sha256_option_s_empty_string +++ /dev/null @@ -1 +0,0 @@ -e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 diff --git a/test/logs/trace_sha256_option_s_unicode b/test/logs/trace_sha256_option_s_unicode deleted file mode 100644 index bdc5c25..0000000 --- a/test/logs/trace_sha256_option_s_unicode +++ /dev/null @@ -1 +0,0 @@ -498951833d0ae08fdbd6138b5ce91db88d5b278c3e60a58929309e87b357f3fa diff --git a/test/logs/trace_sha256_small_file_stdin b/test/logs/trace_sha256_small_file_stdin deleted file mode 100644 index 2d16219..0000000 --- a/test/logs/trace_sha256_small_file_stdin +++ /dev/null @@ -1 +0,0 @@ -1894a19c85ba153acbf743ac4e43fc004c891604b26f8c69e1e83ea2afc7c48f diff --git a/test/logs/trace_subject_test_01 b/test/logs/trace_subject_test_01 deleted file mode 100644 index 31a7dad..0000000 --- a/test/logs/trace_subject_test_01 +++ /dev/null @@ -1 +0,0 @@ -c5e433c1dbd7ba01e3763a9483e74b04 diff --git a/test/logs/trace_subject_test_02 b/test/logs/trace_subject_test_02 deleted file mode 100644 index 2a69d07..0000000 --- a/test/logs/trace_subject_test_02 +++ /dev/null @@ -1,2 +0,0 @@ -Do not pity the dead, Harry. -2d95365bc44bf0a298e09a3ab7b34d2f diff --git a/test/logs/trace_subject_test_03 b/test/logs/trace_subject_test_03 deleted file mode 100644 index 7f6c887..0000000 --- a/test/logs/trace_subject_test_03 +++ /dev/null @@ -1 +0,0 @@ -e20c3b973f63482a778f3fd1869b7f25 diff --git a/test/logs/trace_subject_test_04 b/test/logs/trace_subject_test_04 deleted file mode 100644 index 2353546..0000000 --- a/test/logs/trace_subject_test_04 +++ /dev/null @@ -1 +0,0 @@ -MD5 (file) = 53d53ea94217b259c11a5a2d104ec58a diff --git a/test/logs/trace_subject_test_05 b/test/logs/trace_subject_test_05 deleted file mode 100644 index 8a1a2c5..0000000 --- a/test/logs/trace_subject_test_05 +++ /dev/null @@ -1 +0,0 @@ -53d53ea94217b259c11a5a2d104ec58a file diff --git a/test/logs/trace_subject_test_06 b/test/logs/trace_subject_test_06 deleted file mode 100644 index a6192d7..0000000 --- a/test/logs/trace_subject_test_06 +++ /dev/null @@ -1 +0,0 @@ -MD5 ("pity those that aren't following baerista on spotify.") = a3c990a1964705d9bf0e602f44572f5f diff --git a/test/logs/trace_subject_test_07 b/test/logs/trace_subject_test_07 deleted file mode 100644 index 347f5cf..0000000 --- a/test/logs/trace_subject_test_07 +++ /dev/null @@ -1,3 +0,0 @@ -be sure to handle edge cases carefully -3553dc7dc5963b583c056d1b9fa3349c -MD5 (file) = 53d53ea94217b259c11a5a2d104ec58a diff --git a/test/logs/trace_subject_test_08 b/test/logs/trace_subject_test_08 deleted file mode 100644 index 8a7fc05..0000000 --- a/test/logs/trace_subject_test_08 +++ /dev/null @@ -1,3 +0,0 @@ -but eventually you will understand -dcdd84e0f635694d2a943fa8d3905281 -53d53ea94217b259c11a5a2d104ec58a file diff --git a/test/logs/trace_subject_test_09 b/test/logs/trace_subject_test_09 deleted file mode 100644 index 76c84ab..0000000 --- a/test/logs/trace_subject_test_09 +++ /dev/null @@ -1,4 +0,0 @@ -GL HF let's go -d1e3cc342b6da09480b27ec57ff243e2 -MD5 ("foo") = acbd18db4cc2f85cedef654fccc4a4d8 -MD5 (file) = 53d53ea94217b259c11a5a2d104ec58a diff --git a/test/logs/trace_subject_test_10 b/test/logs/trace_subject_test_10 deleted file mode 100644 index 93893fb..0000000 --- a/test/logs/trace_subject_test_10 +++ /dev/null @@ -1,5 +0,0 @@ -one more thing -a0bd1876c6f011dd50fae52827f445f5 -MD5 ("foo") = acbd18db4cc2f85cedef654fccc4a4d8 -MD5 (file) = 53d53ea94217b259c11a5a2d104ec58a -MD5 ("bar") = 37b51d194a7513e45b56f6524f2d51f2 diff --git a/test/logs/trace_subject_test_11 b/test/logs/trace_subject_test_11 deleted file mode 100644 index dc26290..0000000 --- a/test/logs/trace_subject_test_11 +++ /dev/null @@ -1,4 +0,0 @@ -just to be extra clear -3ba35f1ea0d170cb3b9a752e3360286c -MD5 ("foo") = acbd18db4cc2f85cedef654fccc4a4d8 -MD5 (file) = 53d53ea94217b259c11a5a2d104ec58a diff --git a/test/logs/trace_valgrind_Invalid_command_01 b/test/logs/trace_valgrind_Invalid_command_01 deleted file mode 100644 index 20ebae6..0000000 --- a/test/logs/trace_valgrind_Invalid_command_01 +++ /dev/null @@ -1,44 +0,0 @@ -==23184== Memcheck, a memory error detector -==23184== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23184== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23184== Command: ./../ft_ssl x -==23184== -ft_ssl: Error: x is an invalid command. - -Standard commands: - -Message Digest commands: -md5 -sha256 - -Cipher commands: -==23184== -==23184== HEAP SUMMARY: -==23184== in use at exit: 18,178 bytes in 162 blocks -==23184== total heap usage: 178 allocs, 16 frees, 24,322 bytes allocated -==23184== -==23184== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23184== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23184== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23184== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23184== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23184== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23184== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23184== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23184== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23184== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23184== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23184== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23184== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23184== -==23184== LEAK SUMMARY: -==23184== definitely lost: 0 bytes in 0 blocks -==23184== indirectly lost: 0 bytes in 0 blocks -==23184== possibly lost: 72 bytes in 3 blocks -==23184== still reachable: 200 bytes in 6 blocks -==23184== suppressed: 17,906 bytes in 153 blocks -==23184== Reachable blocks (those to which a pointer was found) are not shown. -==23184== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23184== -==23184== For counts of detected and suppressed errors, rerun with: -v -==23184== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_Invalid_command_02 b/test/logs/trace_valgrind_Invalid_command_02 deleted file mode 100644 index 20f2fce..0000000 --- a/test/logs/trace_valgrind_Invalid_command_02 +++ /dev/null @@ -1,44 +0,0 @@ -==23195== Memcheck, a memory error detector -==23195== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23195== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23195== Command: ./../ft_ssl x -==23195== -ft_ssl: Error: x is an invalid command. - -Standard commands: - -Message Digest commands: -md5 -sha256 - -Cipher commands: -==23195== -==23195== HEAP SUMMARY: -==23195== in use at exit: 18,178 bytes in 162 blocks -==23195== total heap usage: 178 allocs, 16 frees, 24,322 bytes allocated -==23195== -==23195== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23195== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23195== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23195== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23195== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23195== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23195== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23195== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23195== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23195== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23195== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23195== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23195== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23195== -==23195== LEAK SUMMARY: -==23195== definitely lost: 0 bytes in 0 blocks -==23195== indirectly lost: 0 bytes in 0 blocks -==23195== possibly lost: 72 bytes in 3 blocks -==23195== still reachable: 200 bytes in 6 blocks -==23195== suppressed: 17,906 bytes in 153 blocks -==23195== Reachable blocks (those to which a pointer was found) are not shown. -==23195== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23195== -==23195== For counts of detected and suppressed errors, rerun with: -v -==23195== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_Invalid_command_03 b/test/logs/trace_valgrind_Invalid_command_03 deleted file mode 100644 index 9989b95..0000000 --- a/test/logs/trace_valgrind_Invalid_command_03 +++ /dev/null @@ -1,44 +0,0 @@ -==23205== Memcheck, a memory error detector -==23205== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23205== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23205== Command: ./../ft_ssl x Invalid command 03 -==23205== -ft_ssl: Error: x is an invalid command. - -Standard commands: - -Message Digest commands: -md5 -sha256 - -Cipher commands: -==23205== -==23205== HEAP SUMMARY: -==23205== in use at exit: 18,178 bytes in 162 blocks -==23205== total heap usage: 178 allocs, 16 frees, 24,322 bytes allocated -==23205== -==23205== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23205== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23205== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23205== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23205== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23205== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23205== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23205== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23205== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23205== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23205== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23205== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23205== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23205== -==23205== LEAK SUMMARY: -==23205== definitely lost: 0 bytes in 0 blocks -==23205== indirectly lost: 0 bytes in 0 blocks -==23205== possibly lost: 72 bytes in 3 blocks -==23205== still reachable: 200 bytes in 6 blocks -==23205== suppressed: 17,906 bytes in 153 blocks -==23205== Reachable blocks (those to which a pointer was found) are not shown. -==23205== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23205== -==23205== For counts of detected and suppressed errors, rerun with: -v -==23205== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_Invalid_command_04 b/test/logs/trace_valgrind_Invalid_command_04 deleted file mode 100644 index f7fefd2..0000000 --- a/test/logs/trace_valgrind_Invalid_command_04 +++ /dev/null @@ -1,44 +0,0 @@ -==23216== Memcheck, a memory error detector -==23216== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23216== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23216== Command: ./../ft_ssl x Invalid command 04 -==23216== -ft_ssl: Error: x is an invalid command. - -Standard commands: - -Message Digest commands: -md5 -sha256 - -Cipher commands: -==23216== -==23216== HEAP SUMMARY: -==23216== in use at exit: 18,178 bytes in 162 blocks -==23216== total heap usage: 178 allocs, 16 frees, 24,322 bytes allocated -==23216== -==23216== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23216== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23216== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23216== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23216== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23216== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23216== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23216== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23216== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23216== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23216== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23216== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23216== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23216== -==23216== LEAK SUMMARY: -==23216== definitely lost: 0 bytes in 0 blocks -==23216== indirectly lost: 0 bytes in 0 blocks -==23216== possibly lost: 72 bytes in 3 blocks -==23216== still reachable: 200 bytes in 6 blocks -==23216== suppressed: 17,906 bytes in 153 blocks -==23216== Reachable blocks (those to which a pointer was found) are not shown. -==23216== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23216== -==23216== For counts of detected and suppressed errors, rerun with: -v -==23216== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_Invalid_command_05 b/test/logs/trace_valgrind_Invalid_command_05 deleted file mode 100644 index 45ce74c..0000000 --- a/test/logs/trace_valgrind_Invalid_command_05 +++ /dev/null @@ -1,44 +0,0 @@ -==23227== Memcheck, a memory error detector -==23227== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23227== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23227== Command: ./../ft_ssl x -s Invalid command 05 -==23227== -ft_ssl: Error: x is an invalid command. - -Standard commands: - -Message Digest commands: -md5 -sha256 - -Cipher commands: -==23227== -==23227== HEAP SUMMARY: -==23227== in use at exit: 18,178 bytes in 162 blocks -==23227== total heap usage: 178 allocs, 16 frees, 24,322 bytes allocated -==23227== -==23227== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23227== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23227== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23227== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23227== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23227== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23227== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23227== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23227== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23227== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23227== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23227== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23227== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23227== -==23227== LEAK SUMMARY: -==23227== definitely lost: 0 bytes in 0 blocks -==23227== indirectly lost: 0 bytes in 0 blocks -==23227== possibly lost: 72 bytes in 3 blocks -==23227== still reachable: 200 bytes in 6 blocks -==23227== suppressed: 17,906 bytes in 153 blocks -==23227== Reachable blocks (those to which a pointer was found) are not shown. -==23227== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23227== -==23227== For counts of detected and suppressed errors, rerun with: -v -==23227== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_directory b/test/logs/trace_valgrind_directory deleted file mode 100644 index 836aeba..0000000 --- a/test/logs/trace_valgrind_directory +++ /dev/null @@ -1,36 +0,0 @@ -==23285== Memcheck, a memory error detector -==23285== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23285== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23285== Command: ./../ft_ssl md5 resources/folder -==23285== -ft_ssl: resources/folder: No such file or directory -==23285== -==23285== HEAP SUMMARY: -==23285== in use at exit: 20,226 bytes in 163 blocks -==23285== total heap usage: 179 allocs, 16 frees, 26,370 bytes allocated -==23285== -==23285== 72 bytes in 3 blocks are possibly lost in loss record 26 of 43 -==23285== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23285== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23285== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23285== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23285== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23285== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23285== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23285== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23285== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23285== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23285== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23285== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23285== -==23285== LEAK SUMMARY: -==23285== definitely lost: 0 bytes in 0 blocks -==23285== indirectly lost: 0 bytes in 0 blocks -==23285== possibly lost: 72 bytes in 3 blocks -==23285== still reachable: 2,248 bytes in 7 blocks -==23285== suppressed: 17,906 bytes in 153 blocks -==23285== Reachable blocks (those to which a pointer was found) are not shown. -==23285== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23285== -==23285== For counts of detected and suppressed errors, rerun with: -v -==23285== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_file_not_found b/test/logs/trace_valgrind_file_not_found deleted file mode 100644 index 0bf8872..0000000 --- a/test/logs/trace_valgrind_file_not_found +++ /dev/null @@ -1,36 +0,0 @@ -==23263== Memcheck, a memory error detector -==23263== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23263== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23263== Command: ./../ft_ssl md5 resources/testing_everything -==23263== -ft_ssl: resources/testing_everything: No such file or directory -==23263== -==23263== HEAP SUMMARY: -==23263== in use at exit: 20,226 bytes in 163 blocks -==23263== total heap usage: 179 allocs, 16 frees, 26,370 bytes allocated -==23263== -==23263== 72 bytes in 3 blocks are possibly lost in loss record 26 of 43 -==23263== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23263== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23263== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23263== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23263== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23263== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23263== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23263== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23263== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23263== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23263== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23263== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23263== -==23263== LEAK SUMMARY: -==23263== definitely lost: 0 bytes in 0 blocks -==23263== indirectly lost: 0 bytes in 0 blocks -==23263== possibly lost: 72 bytes in 3 blocks -==23263== still reachable: 2,248 bytes in 7 blocks -==23263== suppressed: 17,906 bytes in 153 blocks -==23263== Reachable blocks (those to which a pointer was found) are not shown. -==23263== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23263== -==23263== For counts of detected and suppressed errors, rerun with: -v -==23263== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_md5_binary_file_arg b/test/logs/trace_valgrind_md5_binary_file_arg deleted file mode 100644 index 3759db0..0000000 --- a/test/logs/trace_valgrind_md5_binary_file_arg +++ /dev/null @@ -1,36 +0,0 @@ -==23499== Memcheck, a memory error detector -==23499== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23499== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23499== Command: ./../ft_ssl md5 resources/binary_file -==23499== -MD5 (resources/binary_file) = 46c0e7f4f1cbd004431f176ad87b5d46 -==23499== -==23499== HEAP SUMMARY: -==23499== in use at exit: 18,178 bytes in 162 blocks -==23499== total heap usage: 184 allocs, 22 frees, 185,035 bytes allocated -==23499== -==23499== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23499== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23499== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23499== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23499== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23499== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23499== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23499== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23499== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23499== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23499== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23499== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23499== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23499== -==23499== LEAK SUMMARY: -==23499== definitely lost: 0 bytes in 0 blocks -==23499== indirectly lost: 0 bytes in 0 blocks -==23499== possibly lost: 72 bytes in 3 blocks -==23499== still reachable: 200 bytes in 6 blocks -==23499== suppressed: 17,906 bytes in 153 blocks -==23499== Reachable blocks (those to which a pointer was found) are not shown. -==23499== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23499== -==23499== For counts of detected and suppressed errors, rerun with: -v -==23499== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_md5_binary_file_stdin b/test/logs/trace_valgrind_md5_binary_file_stdin deleted file mode 100644 index 2bda367..0000000 --- a/test/logs/trace_valgrind_md5_binary_file_stdin +++ /dev/null @@ -1,36 +0,0 @@ -==23511== Memcheck, a memory error detector -==23511== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23511== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23511== Command: ./../ft_ssl md5 -==23511== -46c0e7f4f1cbd004431f176ad87b5d46 -==23511== -==23511== HEAP SUMMARY: -==23511== in use at exit: 18,178 bytes in 162 blocks -==23511== total heap usage: 185 allocs, 23 frees, 250,572 bytes allocated -==23511== -==23511== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23511== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23511== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23511== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23511== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23511== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23511== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23511== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23511== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23511== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23511== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23511== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23511== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23511== -==23511== LEAK SUMMARY: -==23511== definitely lost: 0 bytes in 0 blocks -==23511== indirectly lost: 0 bytes in 0 blocks -==23511== possibly lost: 72 bytes in 3 blocks -==23511== still reachable: 200 bytes in 6 blocks -==23511== suppressed: 17,906 bytes in 153 blocks -==23511== Reachable blocks (those to which a pointer was found) are not shown. -==23511== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23511== -==23511== For counts of detected and suppressed errors, rerun with: -v -==23511== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_md5_empty_file_arg b/test/logs/trace_valgrind_md5_empty_file_arg deleted file mode 100644 index 6048a10..0000000 --- a/test/logs/trace_valgrind_md5_empty_file_arg +++ /dev/null @@ -1,36 +0,0 @@ -==23523== Memcheck, a memory error detector -==23523== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23523== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23523== Command: ./../ft_ssl md5 resources/empty_file -==23523== -MD5 (resources/empty_file) = d41d8cd98f00b204e9800998ecf8427e -==23523== -==23523== HEAP SUMMARY: -==23523== in use at exit: 18,178 bytes in 162 blocks -==23523== total heap usage: 184 allocs, 22 frees, 24,491 bytes allocated -==23523== -==23523== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23523== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23523== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23523== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23523== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23523== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23523== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23523== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23523== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23523== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23523== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23523== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23523== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23523== -==23523== LEAK SUMMARY: -==23523== definitely lost: 0 bytes in 0 blocks -==23523== indirectly lost: 0 bytes in 0 blocks -==23523== possibly lost: 72 bytes in 3 blocks -==23523== still reachable: 200 bytes in 6 blocks -==23523== suppressed: 17,906 bytes in 153 blocks -==23523== Reachable blocks (those to which a pointer was found) are not shown. -==23523== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23523== -==23523== For counts of detected and suppressed errors, rerun with: -v -==23523== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_md5_empty_file_stdin b/test/logs/trace_valgrind_md5_empty_file_stdin deleted file mode 100644 index 596cc62..0000000 --- a/test/logs/trace_valgrind_md5_empty_file_stdin +++ /dev/null @@ -1,36 +0,0 @@ -==23535== Memcheck, a memory error detector -==23535== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23535== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23535== Command: ./../ft_ssl md5 -==23535== -d41d8cd98f00b204e9800998ecf8427e -==23535== -==23535== HEAP SUMMARY: -==23535== in use at exit: 18,178 bytes in 162 blocks -==23535== total heap usage: 183 allocs, 21 frees, 24,490 bytes allocated -==23535== -==23535== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23535== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23535== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23535== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23535== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23535== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23535== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23535== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23535== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23535== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23535== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23535== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23535== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23535== -==23535== LEAK SUMMARY: -==23535== definitely lost: 0 bytes in 0 blocks -==23535== indirectly lost: 0 bytes in 0 blocks -==23535== possibly lost: 72 bytes in 3 blocks -==23535== still reachable: 200 bytes in 6 blocks -==23535== suppressed: 17,906 bytes in 153 blocks -==23535== Reachable blocks (those to which a pointer was found) are not shown. -==23535== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23535== -==23535== For counts of detected and suppressed errors, rerun with: -v -==23535== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_md5_large_file_arg b/test/logs/trace_valgrind_md5_large_file_arg deleted file mode 100644 index 2e8f8b6..0000000 --- a/test/logs/trace_valgrind_md5_large_file_arg +++ /dev/null @@ -1,36 +0,0 @@ -==23595== Memcheck, a memory error detector -==23595== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23595== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23595== Command: ./../ft_ssl md5 resources/text_file_large -==23595== -MD5 (resources/text_file_large) = 3347b7ed7e69584b7dfa1ec24cbfff1e -==23595== -==23595== HEAP SUMMARY: -==23595== in use at exit: 18,178 bytes in 162 blocks -==23595== total heap usage: 184 allocs, 22 frees, 1,563,862 bytes allocated -==23595== -==23595== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23595== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23595== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23595== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23595== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23595== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23595== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23595== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23595== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23595== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23595== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23595== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23595== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23595== -==23595== LEAK SUMMARY: -==23595== definitely lost: 0 bytes in 0 blocks -==23595== indirectly lost: 0 bytes in 0 blocks -==23595== possibly lost: 72 bytes in 3 blocks -==23595== still reachable: 200 bytes in 6 blocks -==23595== suppressed: 17,906 bytes in 153 blocks -==23595== Reachable blocks (those to which a pointer was found) are not shown. -==23595== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23595== -==23595== For counts of detected and suppressed errors, rerun with: -v -==23595== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_md5_large_file_stdin b/test/logs/trace_valgrind_md5_large_file_stdin deleted file mode 100644 index 7a9d8ae..0000000 --- a/test/logs/trace_valgrind_md5_large_file_stdin +++ /dev/null @@ -1,36 +0,0 @@ -==23607== Memcheck, a memory error detector -==23607== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23607== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23607== Command: ./../ft_ssl md5 -==23607== -3347b7ed7e69584b7dfa1ec24cbfff1e -==23607== -==23607== HEAP SUMMARY: -==23607== in use at exit: 18,178 bytes in 162 blocks -==23607== total heap usage: 195 allocs, 33 frees, 5,889,249 bytes allocated -==23607== -==23607== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23607== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23607== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23607== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23607== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23607== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23607== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23607== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23607== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23607== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23607== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23607== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23607== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23607== -==23607== LEAK SUMMARY: -==23607== definitely lost: 0 bytes in 0 blocks -==23607== indirectly lost: 0 bytes in 0 blocks -==23607== possibly lost: 72 bytes in 3 blocks -==23607== still reachable: 200 bytes in 6 blocks -==23607== suppressed: 17,906 bytes in 153 blocks -==23607== Reachable blocks (those to which a pointer was found) are not shown. -==23607== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23607== -==23607== For counts of detected and suppressed errors, rerun with: -v -==23607== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_md5_medium_file_arg b/test/logs/trace_valgrind_md5_medium_file_arg deleted file mode 100644 index 7b03899..0000000 --- a/test/logs/trace_valgrind_md5_medium_file_arg +++ /dev/null @@ -1,36 +0,0 @@ -==23571== Memcheck, a memory error detector -==23571== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23571== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23571== Command: ./../ft_ssl md5 resources/text_file_medium -==23571== -MD5 (resources/text_file_medium) = f4cb1efa2c4eebe3589d7405f4174577 -==23571== -==23571== HEAP SUMMARY: -==23571== in use at exit: 18,178 bytes in 162 blocks -==23571== total heap usage: 184 allocs, 22 frees, 57,937 bytes allocated -==23571== -==23571== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23571== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23571== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23571== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23571== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23571== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23571== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23571== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23571== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23571== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23571== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23571== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23571== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23571== -==23571== LEAK SUMMARY: -==23571== definitely lost: 0 bytes in 0 blocks -==23571== indirectly lost: 0 bytes in 0 blocks -==23571== possibly lost: 72 bytes in 3 blocks -==23571== still reachable: 200 bytes in 6 blocks -==23571== suppressed: 17,906 bytes in 153 blocks -==23571== Reachable blocks (those to which a pointer was found) are not shown. -==23571== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23571== -==23571== For counts of detected and suppressed errors, rerun with: -v -==23571== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_md5_medium_file_stdin b/test/logs/trace_valgrind_md5_medium_file_stdin deleted file mode 100644 index a1f1044..0000000 --- a/test/logs/trace_valgrind_md5_medium_file_stdin +++ /dev/null @@ -1,36 +0,0 @@ -==23583== Memcheck, a memory error detector -==23583== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23583== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23583== Command: ./../ft_ssl md5 -==23583== -f4cb1efa2c4eebe3589d7405f4174577 -==23583== -==23583== HEAP SUMMARY: -==23583== in use at exit: 18,178 bytes in 162 blocks -==23583== total heap usage: 184 allocs, 22 frees, 57,937 bytes allocated -==23583== -==23583== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23583== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23583== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23583== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23583== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23583== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23583== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23583== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23583== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23583== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23583== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23583== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23583== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23583== -==23583== LEAK SUMMARY: -==23583== definitely lost: 0 bytes in 0 blocks -==23583== indirectly lost: 0 bytes in 0 blocks -==23583== possibly lost: 72 bytes in 3 blocks -==23583== still reachable: 200 bytes in 6 blocks -==23583== suppressed: 17,906 bytes in 153 blocks -==23583== Reachable blocks (those to which a pointer was found) are not shown. -==23583== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23583== -==23583== For counts of detected and suppressed errors, rerun with: -v -==23583== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_md5_option_s_448_chars_edge_case b/test/logs/trace_valgrind_md5_option_s_448_chars_edge_case deleted file mode 100644 index e71696f..0000000 --- a/test/logs/trace_valgrind_md5_option_s_448_chars_edge_case +++ /dev/null @@ -1,36 +0,0 @@ -==23477== Memcheck, a memory error detector -==23477== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23477== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23477== Command: ./../ft_ssl md5 -s A\ very\ long\ text\ with\ 448\ chars,\ but\ i\ need\ to\ add\ more! -==23477== -MD5 ("A very long text with 448 chars, but i need to add more!") = 68554f041dad94d228b0013872e4ac99 -==23477== -==23477== HEAP SUMMARY: -==23477== in use at exit: 18,178 bytes in 162 blocks -==23477== total heap usage: 183 allocs, 21 frees, 24,554 bytes allocated -==23477== -==23477== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23477== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23477== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23477== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23477== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23477== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23477== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23477== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23477== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23477== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23477== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23477== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23477== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23477== -==23477== LEAK SUMMARY: -==23477== definitely lost: 0 bytes in 0 blocks -==23477== indirectly lost: 0 bytes in 0 blocks -==23477== possibly lost: 72 bytes in 3 blocks -==23477== still reachable: 200 bytes in 6 blocks -==23477== suppressed: 17,906 bytes in 153 blocks -==23477== Reachable blocks (those to which a pointer was found) are not shown. -==23477== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23477== -==23477== For counts of detected and suppressed errors, rerun with: -v -==23477== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_md5_option_s_basic_string b/test/logs/trace_valgrind_md5_option_s_basic_string deleted file mode 100644 index fbf890b..0000000 --- a/test/logs/trace_valgrind_md5_option_s_basic_string +++ /dev/null @@ -1,36 +0,0 @@ -==23466== Memcheck, a memory error detector -==23466== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23466== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23466== Command: ./../ft_ssl md5 -s Foo\ bar -==23466== -MD5 ("Foo bar") = d05ebcd9fba6aee3e8411771c083b3db -==23466== -==23466== HEAP SUMMARY: -==23466== in use at exit: 18,178 bytes in 162 blocks -==23466== total heap usage: 183 allocs, 21 frees, 24,490 bytes allocated -==23466== -==23466== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23466== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23466== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23466== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23466== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23466== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23466== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23466== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23466== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23466== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23466== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23466== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23466== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23466== -==23466== LEAK SUMMARY: -==23466== definitely lost: 0 bytes in 0 blocks -==23466== indirectly lost: 0 bytes in 0 blocks -==23466== possibly lost: 72 bytes in 3 blocks -==23466== still reachable: 200 bytes in 6 blocks -==23466== suppressed: 17,906 bytes in 153 blocks -==23466== Reachable blocks (those to which a pointer was found) are not shown. -==23466== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23466== -==23466== For counts of detected and suppressed errors, rerun with: -v -==23466== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_md5_option_s_empty_string b/test/logs/trace_valgrind_md5_option_s_empty_string deleted file mode 100644 index 665f8aa..0000000 --- a/test/logs/trace_valgrind_md5_option_s_empty_string +++ /dev/null @@ -1,36 +0,0 @@ -==23455== Memcheck, a memory error detector -==23455== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23455== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23455== Command: ./../ft_ssl md5 -s -==23455== -MD5 ("") = d41d8cd98f00b204e9800998ecf8427e -==23455== -==23455== HEAP SUMMARY: -==23455== in use at exit: 18,178 bytes in 162 blocks -==23455== total heap usage: 183 allocs, 21 frees, 24,490 bytes allocated -==23455== -==23455== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23455== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23455== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23455== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23455== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23455== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23455== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23455== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23455== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23455== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23455== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23455== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23455== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23455== -==23455== LEAK SUMMARY: -==23455== definitely lost: 0 bytes in 0 blocks -==23455== indirectly lost: 0 bytes in 0 blocks -==23455== possibly lost: 72 bytes in 3 blocks -==23455== still reachable: 200 bytes in 6 blocks -==23455== suppressed: 17,906 bytes in 153 blocks -==23455== Reachable blocks (those to which a pointer was found) are not shown. -==23455== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23455== -==23455== For counts of detected and suppressed errors, rerun with: -v -==23455== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_md5_option_s_unicode b/test/logs/trace_valgrind_md5_option_s_unicode deleted file mode 100644 index 8dd047e..0000000 --- a/test/logs/trace_valgrind_md5_option_s_unicode +++ /dev/null @@ -1,36 +0,0 @@ -==23488== Memcheck, a memory error detector -==23488== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23488== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23488== Command: ./../ft_ssl md5 -s __________________\ N__\ ch__f__n\ le\ ma?\ Literally:\ Have\ you\ eaten? -==23488== -MD5 ("你吃饭了吗? Nǐ chīfàn le ma? Literally: Have you eaten?") = 052fe420c44f836e2c087d1e6bc8fc35 -==23488== -==23488== HEAP SUMMARY: -==23488== in use at exit: 18,178 bytes in 162 blocks -==23488== total heap usage: 183 allocs, 21 frees, 24,554 bytes allocated -==23488== -==23488== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23488== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23488== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23488== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23488== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23488== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23488== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23488== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23488== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23488== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23488== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23488== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23488== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23488== -==23488== LEAK SUMMARY: -==23488== definitely lost: 0 bytes in 0 blocks -==23488== indirectly lost: 0 bytes in 0 blocks -==23488== possibly lost: 72 bytes in 3 blocks -==23488== still reachable: 200 bytes in 6 blocks -==23488== suppressed: 17,906 bytes in 153 blocks -==23488== Reachable blocks (those to which a pointer was found) are not shown. -==23488== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23488== -==23488== For counts of detected and suppressed errors, rerun with: -v -==23488== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_md5_small_file_arg b/test/logs/trace_valgrind_md5_small_file_arg deleted file mode 100644 index 337a5f4..0000000 --- a/test/logs/trace_valgrind_md5_small_file_arg +++ /dev/null @@ -1,36 +0,0 @@ -==23547== Memcheck, a memory error detector -==23547== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23547== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23547== Command: ./../ft_ssl md5 resources/text_file_small -==23547== -MD5 (resources/text_file_small) = f0ef7081e1539ac00ef5b761b4fb01b3 -==23547== -==23547== HEAP SUMMARY: -==23547== in use at exit: 18,178 bytes in 162 blocks -==23547== total heap usage: 184 allocs, 22 frees, 24,503 bytes allocated -==23547== -==23547== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23547== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23547== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23547== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23547== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23547== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23547== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23547== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23547== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23547== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23547== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23547== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23547== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23547== -==23547== LEAK SUMMARY: -==23547== definitely lost: 0 bytes in 0 blocks -==23547== indirectly lost: 0 bytes in 0 blocks -==23547== possibly lost: 72 bytes in 3 blocks -==23547== still reachable: 200 bytes in 6 blocks -==23547== suppressed: 17,906 bytes in 153 blocks -==23547== Reachable blocks (those to which a pointer was found) are not shown. -==23547== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23547== -==23547== For counts of detected and suppressed errors, rerun with: -v -==23547== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_md5_small_file_stdin b/test/logs/trace_valgrind_md5_small_file_stdin deleted file mode 100644 index 935ef2b..0000000 --- a/test/logs/trace_valgrind_md5_small_file_stdin +++ /dev/null @@ -1,36 +0,0 @@ -==23559== Memcheck, a memory error detector -==23559== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23559== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23559== Command: ./../ft_ssl md5 -==23559== -f0ef7081e1539ac00ef5b761b4fb01b3 -==23559== -==23559== HEAP SUMMARY: -==23559== in use at exit: 18,178 bytes in 162 blocks -==23559== total heap usage: 184 allocs, 22 frees, 24,503 bytes allocated -==23559== -==23559== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23559== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23559== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23559== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23559== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23559== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23559== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23559== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23559== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23559== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23559== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23559== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23559== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23559== -==23559== LEAK SUMMARY: -==23559== definitely lost: 0 bytes in 0 blocks -==23559== indirectly lost: 0 bytes in 0 blocks -==23559== possibly lost: 72 bytes in 3 blocks -==23559== still reachable: 200 bytes in 6 blocks -==23559== suppressed: 17,906 bytes in 153 blocks -==23559== Reachable blocks (those to which a pointer was found) are not shown. -==23559== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23559== -==23559== For counts of detected and suppressed errors, rerun with: -v -==23559== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_no_argument_01 b/test/logs/trace_valgrind_no_argument_01 deleted file mode 100644 index b91789f..0000000 --- a/test/logs/trace_valgrind_no_argument_01 +++ /dev/null @@ -1,36 +0,0 @@ -==23163== Memcheck, a memory error detector -==23163== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23163== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23163== Command: ./../ft_ssl -==23163== -usage: ft_ssl command [command opts] [command args] -==23163== -==23163== HEAP SUMMARY: -==23163== in use at exit: 18,178 bytes in 162 blocks -==23163== total heap usage: 178 allocs, 16 frees, 24,322 bytes allocated -==23163== -==23163== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23163== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23163== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23163== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23163== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23163== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23163== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23163== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23163== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23163== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23163== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23163== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23163== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23163== -==23163== LEAK SUMMARY: -==23163== definitely lost: 0 bytes in 0 blocks -==23163== indirectly lost: 0 bytes in 0 blocks -==23163== possibly lost: 72 bytes in 3 blocks -==23163== still reachable: 200 bytes in 6 blocks -==23163== suppressed: 17,906 bytes in 153 blocks -==23163== Reachable blocks (those to which a pointer was found) are not shown. -==23163== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23163== -==23163== For counts of detected and suppressed errors, rerun with: -v -==23163== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_no_argument_02 b/test/logs/trace_valgrind_no_argument_02 deleted file mode 100644 index 7c6049a..0000000 --- a/test/logs/trace_valgrind_no_argument_02 +++ /dev/null @@ -1,36 +0,0 @@ -==23174== Memcheck, a memory error detector -==23174== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23174== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23174== Command: ./../ft_ssl -==23174== -usage: ft_ssl command [command opts] [command args] -==23174== -==23174== HEAP SUMMARY: -==23174== in use at exit: 18,178 bytes in 162 blocks -==23174== total heap usage: 178 allocs, 16 frees, 24,322 bytes allocated -==23174== -==23174== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23174== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23174== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23174== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23174== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23174== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23174== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23174== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23174== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23174== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23174== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23174== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23174== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23174== -==23174== LEAK SUMMARY: -==23174== definitely lost: 0 bytes in 0 blocks -==23174== indirectly lost: 0 bytes in 0 blocks -==23174== possibly lost: 72 bytes in 3 blocks -==23174== still reachable: 200 bytes in 6 blocks -==23174== suppressed: 17,906 bytes in 153 blocks -==23174== Reachable blocks (those to which a pointer was found) are not shown. -==23174== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23174== -==23174== For counts of detected and suppressed errors, rerun with: -v -==23174== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_option_s_without_arg b/test/logs/trace_valgrind_option_s_without_arg deleted file mode 100644 index 9b93ddd..0000000 --- a/test/logs/trace_valgrind_option_s_without_arg +++ /dev/null @@ -1,36 +0,0 @@ -==23295== Memcheck, a memory error detector -==23295== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23295== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23295== Command: ./../ft_ssl md5 -s -==23295== -d41d8cd98f00b204e9800998ecf8427e -==23295== -==23295== HEAP SUMMARY: -==23295== in use at exit: 18,178 bytes in 162 blocks -==23295== total heap usage: 183 allocs, 21 frees, 24,490 bytes allocated -==23295== -==23295== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23295== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23295== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23295== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23295== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23295== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23295== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23295== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23295== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23295== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23295== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23295== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23295== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23295== -==23295== LEAK SUMMARY: -==23295== definitely lost: 0 bytes in 0 blocks -==23295== indirectly lost: 0 bytes in 0 blocks -==23295== possibly lost: 72 bytes in 3 blocks -==23295== still reachable: 200 bytes in 6 blocks -==23295== suppressed: 17,906 bytes in 153 blocks -==23295== Reachable blocks (those to which a pointer was found) are not shown. -==23295== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23295== -==23295== For counts of detected and suppressed errors, rerun with: -v -==23295== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_permission_denied b/test/logs/trace_valgrind_permission_denied deleted file mode 100644 index 62169c9..0000000 --- a/test/logs/trace_valgrind_permission_denied +++ /dev/null @@ -1,36 +0,0 @@ -==23275== Memcheck, a memory error detector -==23275== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23275== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23275== Command: ./../ft_ssl md5 resources/permissions -==23275== -ft_ssl: resources/permissions: Permission denied -==23275== -==23275== HEAP SUMMARY: -==23275== in use at exit: 20,226 bytes in 163 blocks -==23275== total heap usage: 179 allocs, 16 frees, 26,370 bytes allocated -==23275== -==23275== 72 bytes in 3 blocks are possibly lost in loss record 26 of 43 -==23275== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23275== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23275== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23275== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23275== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23275== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23275== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23275== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23275== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23275== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23275== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23275== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23275== -==23275== LEAK SUMMARY: -==23275== definitely lost: 0 bytes in 0 blocks -==23275== indirectly lost: 0 bytes in 0 blocks -==23275== possibly lost: 72 bytes in 3 blocks -==23275== still reachable: 2,248 bytes in 7 blocks -==23275== suppressed: 17,906 bytes in 153 blocks -==23275== Reachable blocks (those to which a pointer was found) are not shown. -==23275== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23275== -==23275== For counts of detected and suppressed errors, rerun with: -v -==23275== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_sha256_binary_file_stdin b/test/logs/trace_valgrind_sha256_binary_file_stdin deleted file mode 100644 index 01dde32..0000000 --- a/test/logs/trace_valgrind_sha256_binary_file_stdin +++ /dev/null @@ -1,36 +0,0 @@ -==23663== Memcheck, a memory error detector -==23663== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23663== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23663== Command: ./../ft_ssl sha256 -==23663== -0c21850620f7f42e3c4ea6117a901023fef10a835f3b5ee43f6235762c798d8f -==23663== -==23663== HEAP SUMMARY: -==23663== in use at exit: 18,178 bytes in 162 blocks -==23663== total heap usage: 1,440 allocs, 1,278 frees, 571,868 bytes allocated -==23663== -==23663== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23663== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23663== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23663== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23663== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23663== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23663== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23663== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23663== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23663== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23663== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23663== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23663== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23663== -==23663== LEAK SUMMARY: -==23663== definitely lost: 0 bytes in 0 blocks -==23663== indirectly lost: 0 bytes in 0 blocks -==23663== possibly lost: 72 bytes in 3 blocks -==23663== still reachable: 200 bytes in 6 blocks -==23663== suppressed: 17,906 bytes in 153 blocks -==23663== Reachable blocks (those to which a pointer was found) are not shown. -==23663== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23663== -==23663== For counts of detected and suppressed errors, rerun with: -v -==23663== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_sha256_empty_file_stdin b/test/logs/trace_valgrind_sha256_empty_file_stdin deleted file mode 100644 index 0088510..0000000 --- a/test/logs/trace_valgrind_sha256_empty_file_stdin +++ /dev/null @@ -1,36 +0,0 @@ -==23676== Memcheck, a memory error detector -==23676== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23676== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23676== Command: ./../ft_ssl sha256 -==23676== -e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 -==23676== -==23676== HEAP SUMMARY: -==23676== in use at exit: 18,178 bytes in 162 blocks -==23676== total heap usage: 184 allocs, 22 frees, 24,762 bytes allocated -==23676== -==23676== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23676== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23676== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23676== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23676== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23676== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23676== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23676== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23676== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23676== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23676== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23676== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23676== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23676== -==23676== LEAK SUMMARY: -==23676== definitely lost: 0 bytes in 0 blocks -==23676== indirectly lost: 0 bytes in 0 blocks -==23676== possibly lost: 72 bytes in 3 blocks -==23676== still reachable: 200 bytes in 6 blocks -==23676== suppressed: 17,906 bytes in 153 blocks -==23676== Reachable blocks (those to which a pointer was found) are not shown. -==23676== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23676== -==23676== For counts of detected and suppressed errors, rerun with: -v -==23676== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_sha256_large_file_stdin b/test/logs/trace_valgrind_sha256_large_file_stdin deleted file mode 100644 index 0738654..0000000 --- a/test/logs/trace_valgrind_sha256_large_file_stdin +++ /dev/null @@ -1,36 +0,0 @@ -==23715== Memcheck, a memory error detector -==23715== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23715== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23715== Command: ./../ft_ssl sha256 -==23715== -bb530fe35cad305dfcba486dbde298a1aee6fa59ad27afd05f7d9181c5e84963 -==23715== -==23715== HEAP SUMMARY: -==23715== in use at exit: 18,178 bytes in 162 blocks -==23715== total heap usage: 12,222 allocs, 12,060 frees, 8,968,177 bytes allocated -==23715== -==23715== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23715== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23715== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23715== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23715== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23715== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23715== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23715== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23715== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23715== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23715== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23715== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23715== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23715== -==23715== LEAK SUMMARY: -==23715== definitely lost: 0 bytes in 0 blocks -==23715== indirectly lost: 0 bytes in 0 blocks -==23715== possibly lost: 72 bytes in 3 blocks -==23715== still reachable: 200 bytes in 6 blocks -==23715== suppressed: 17,906 bytes in 153 blocks -==23715== Reachable blocks (those to which a pointer was found) are not shown. -==23715== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23715== -==23715== For counts of detected and suppressed errors, rerun with: -v -==23715== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_sha256_medium_file_stdin b/test/logs/trace_valgrind_sha256_medium_file_stdin deleted file mode 100644 index 2113aa2..0000000 --- a/test/logs/trace_valgrind_sha256_medium_file_stdin +++ /dev/null @@ -1,36 +0,0 @@ -==23702== Memcheck, a memory error detector -==23702== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23702== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23702== Command: ./../ft_ssl sha256 -==23702== -56005170a8bb77de9cefa181aff0a7457064ff39c17f269f5a852860109c7f6a -==23702== -==23702== HEAP SUMMARY: -==23702== in use at exit: 18,178 bytes in 162 blocks -==23702== total heap usage: 446 allocs, 284 frees, 125,025 bytes allocated -==23702== -==23702== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23702== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23702== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23702== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23702== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23702== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23702== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23702== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23702== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23702== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23702== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23702== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23702== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23702== -==23702== LEAK SUMMARY: -==23702== definitely lost: 0 bytes in 0 blocks -==23702== indirectly lost: 0 bytes in 0 blocks -==23702== possibly lost: 72 bytes in 3 blocks -==23702== still reachable: 200 bytes in 6 blocks -==23702== suppressed: 17,906 bytes in 153 blocks -==23702== Reachable blocks (those to which a pointer was found) are not shown. -==23702== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23702== -==23702== For counts of detected and suppressed errors, rerun with: -v -==23702== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_sha256_option_s_basic_string b/test/logs/trace_valgrind_sha256_option_s_basic_string deleted file mode 100644 index 9c18b8b..0000000 --- a/test/logs/trace_valgrind_sha256_option_s_basic_string +++ /dev/null @@ -1,36 +0,0 @@ -==23637== Memcheck, a memory error detector -==23637== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23637== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23637== Command: ./../ft_ssl sha256 -==23637== -2fb9f1e447f906641b665b02538a0320efb3e0b667a2655b3f9e041a3b2f815d -==23637== -==23637== HEAP SUMMARY: -==23637== in use at exit: 18,178 bytes in 162 blocks -==23637== total heap usage: 185 allocs, 23 frees, 24,770 bytes allocated -==23637== -==23637== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23637== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23637== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23637== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23637== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23637== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23637== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23637== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23637== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23637== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23637== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23637== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23637== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23637== -==23637== LEAK SUMMARY: -==23637== definitely lost: 0 bytes in 0 blocks -==23637== indirectly lost: 0 bytes in 0 blocks -==23637== possibly lost: 72 bytes in 3 blocks -==23637== still reachable: 200 bytes in 6 blocks -==23637== suppressed: 17,906 bytes in 153 blocks -==23637== Reachable blocks (those to which a pointer was found) are not shown. -==23637== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23637== -==23637== For counts of detected and suppressed errors, rerun with: -v -==23637== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_sha256_option_s_empty_string b/test/logs/trace_valgrind_sha256_option_s_empty_string deleted file mode 100644 index eef7f1e..0000000 --- a/test/logs/trace_valgrind_sha256_option_s_empty_string +++ /dev/null @@ -1,36 +0,0 @@ -==23622== Memcheck, a memory error detector -==23622== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23622== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23622== Command: ./../ft_ssl sha256 -==23622== -e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 -==23622== -==23622== HEAP SUMMARY: -==23622== in use at exit: 18,178 bytes in 162 blocks -==23622== total heap usage: 184 allocs, 22 frees, 24,762 bytes allocated -==23622== -==23622== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23622== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23622== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23622== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23622== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23622== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23622== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23622== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23622== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23622== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23622== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23622== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23622== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23622== -==23622== LEAK SUMMARY: -==23622== definitely lost: 0 bytes in 0 blocks -==23622== indirectly lost: 0 bytes in 0 blocks -==23622== possibly lost: 72 bytes in 3 blocks -==23622== still reachable: 200 bytes in 6 blocks -==23622== suppressed: 17,906 bytes in 153 blocks -==23622== Reachable blocks (those to which a pointer was found) are not shown. -==23622== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23622== -==23622== For counts of detected and suppressed errors, rerun with: -v -==23622== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_sha256_option_s_unicode b/test/logs/trace_valgrind_sha256_option_s_unicode deleted file mode 100644 index 41b4d96..0000000 --- a/test/logs/trace_valgrind_sha256_option_s_unicode +++ /dev/null @@ -1,36 +0,0 @@ -==23650== Memcheck, a memory error detector -==23650== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23650== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23650== Command: ./../ft_ssl sha256 -==23650== -498951833d0ae08fdbd6138b5ce91db88d5b278c3e60a58929309e87b357f3fa -==23650== -==23650== HEAP SUMMARY: -==23650== in use at exit: 18,178 bytes in 162 blocks -==23650== total heap usage: 186 allocs, 24 frees, 25,148 bytes allocated -==23650== -==23650== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23650== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23650== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23650== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23650== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23650== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23650== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23650== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23650== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23650== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23650== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23650== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23650== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23650== -==23650== LEAK SUMMARY: -==23650== definitely lost: 0 bytes in 0 blocks -==23650== indirectly lost: 0 bytes in 0 blocks -==23650== possibly lost: 72 bytes in 3 blocks -==23650== still reachable: 200 bytes in 6 blocks -==23650== suppressed: 17,906 bytes in 153 blocks -==23650== Reachable blocks (those to which a pointer was found) are not shown. -==23650== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23650== -==23650== For counts of detected and suppressed errors, rerun with: -v -==23650== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_sha256_small_file_stdin b/test/logs/trace_valgrind_sha256_small_file_stdin deleted file mode 100644 index 528b5ce..0000000 --- a/test/logs/trace_valgrind_sha256_small_file_stdin +++ /dev/null @@ -1,36 +0,0 @@ -==23689== Memcheck, a memory error detector -==23689== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23689== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23689== Command: ./../ft_ssl sha256 -==23689== -1894a19c85ba153acbf743ac4e43fc004c891604b26f8c69e1e83ea2afc7c48f -==23689== -==23689== HEAP SUMMARY: -==23689== in use at exit: 18,178 bytes in 162 blocks -==23689== total heap usage: 185 allocs, 23 frees, 24,775 bytes allocated -==23689== -==23689== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23689== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23689== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23689== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23689== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23689== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23689== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23689== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23689== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23689== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23689== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23689== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23689== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23689== -==23689== LEAK SUMMARY: -==23689== definitely lost: 0 bytes in 0 blocks -==23689== indirectly lost: 0 bytes in 0 blocks -==23689== possibly lost: 72 bytes in 3 blocks -==23689== still reachable: 200 bytes in 6 blocks -==23689== suppressed: 17,906 bytes in 153 blocks -==23689== Reachable blocks (those to which a pointer was found) are not shown. -==23689== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23689== -==23689== For counts of detected and suppressed errors, rerun with: -v -==23689== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_subject_test_01 b/test/logs/trace_valgrind_subject_test_01 deleted file mode 100644 index ac0e8c0..0000000 --- a/test/logs/trace_valgrind_subject_test_01 +++ /dev/null @@ -1,36 +0,0 @@ -==23307== Memcheck, a memory error detector -==23307== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23307== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23307== Command: ./../ft_ssl md5 -==23307== -c5e433c1dbd7ba01e3763a9483e74b04 -==23307== -==23307== HEAP SUMMARY: -==23307== in use at exit: 18,178 bytes in 162 blocks -==23307== total heap usage: 184 allocs, 22 frees, 24,503 bytes allocated -==23307== -==23307== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23307== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23307== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23307== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23307== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23307== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23307== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23307== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23307== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23307== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23307== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23307== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23307== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23307== -==23307== LEAK SUMMARY: -==23307== definitely lost: 0 bytes in 0 blocks -==23307== indirectly lost: 0 bytes in 0 blocks -==23307== possibly lost: 72 bytes in 3 blocks -==23307== still reachable: 200 bytes in 6 blocks -==23307== suppressed: 17,906 bytes in 153 blocks -==23307== Reachable blocks (those to which a pointer was found) are not shown. -==23307== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23307== -==23307== For counts of detected and suppressed errors, rerun with: -v -==23307== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_subject_test_02 b/test/logs/trace_valgrind_subject_test_02 deleted file mode 100644 index b41febe..0000000 --- a/test/logs/trace_valgrind_subject_test_02 +++ /dev/null @@ -1,37 +0,0 @@ -==23318== Memcheck, a memory error detector -==23318== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23318== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23318== Command: ./../ft_ssl md5 -p -==23318== -Do not pity the dead, Harry. -2d95365bc44bf0a298e09a3ab7b34d2f -==23318== -==23318== HEAP SUMMARY: -==23318== in use at exit: 18,178 bytes in 162 blocks -==23318== total heap usage: 184 allocs, 22 frees, 24,520 bytes allocated -==23318== -==23318== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23318== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23318== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23318== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23318== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23318== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23318== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23318== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23318== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23318== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23318== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23318== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23318== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23318== -==23318== LEAK SUMMARY: -==23318== definitely lost: 0 bytes in 0 blocks -==23318== indirectly lost: 0 bytes in 0 blocks -==23318== possibly lost: 72 bytes in 3 blocks -==23318== still reachable: 200 bytes in 6 blocks -==23318== suppressed: 17,906 bytes in 153 blocks -==23318== Reachable blocks (those to which a pointer was found) are not shown. -==23318== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23318== -==23318== For counts of detected and suppressed errors, rerun with: -v -==23318== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_subject_test_03 b/test/logs/trace_valgrind_subject_test_03 deleted file mode 100644 index 5cc748c..0000000 --- a/test/logs/trace_valgrind_subject_test_03 +++ /dev/null @@ -1,36 +0,0 @@ -==23330== Memcheck, a memory error detector -==23330== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23330== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23330== Command: ./../ft_ssl md5 -q -r -==23330== -e20c3b973f63482a778f3fd1869b7f25 -==23330== -==23330== HEAP SUMMARY: -==23330== in use at exit: 18,178 bytes in 162 blocks -==23330== total heap usage: 184 allocs, 22 frees, 24,508 bytes allocated -==23330== -==23330== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23330== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23330== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23330== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23330== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23330== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23330== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23330== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23330== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23330== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23330== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23330== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23330== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23330== -==23330== LEAK SUMMARY: -==23330== definitely lost: 0 bytes in 0 blocks -==23330== indirectly lost: 0 bytes in 0 blocks -==23330== possibly lost: 72 bytes in 3 blocks -==23330== still reachable: 200 bytes in 6 blocks -==23330== suppressed: 17,906 bytes in 153 blocks -==23330== Reachable blocks (those to which a pointer was found) are not shown. -==23330== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23330== -==23330== For counts of detected and suppressed errors, rerun with: -v -==23330== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_subject_test_04 b/test/logs/trace_valgrind_subject_test_04 deleted file mode 100644 index cc70424..0000000 --- a/test/logs/trace_valgrind_subject_test_04 +++ /dev/null @@ -1,36 +0,0 @@ -==23342== Memcheck, a memory error detector -==23342== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23342== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23342== Command: ./../ft_ssl md5 file -==23342== -MD5 (file) = 53d53ea94217b259c11a5a2d104ec58a -==23342== -==23342== HEAP SUMMARY: -==23342== in use at exit: 18,178 bytes in 162 blocks -==23342== total heap usage: 184 allocs, 22 frees, 24,506 bytes allocated -==23342== -==23342== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23342== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23342== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23342== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23342== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23342== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23342== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23342== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23342== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23342== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23342== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23342== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23342== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23342== -==23342== LEAK SUMMARY: -==23342== definitely lost: 0 bytes in 0 blocks -==23342== indirectly lost: 0 bytes in 0 blocks -==23342== possibly lost: 72 bytes in 3 blocks -==23342== still reachable: 200 bytes in 6 blocks -==23342== suppressed: 17,906 bytes in 153 blocks -==23342== Reachable blocks (those to which a pointer was found) are not shown. -==23342== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23342== -==23342== For counts of detected and suppressed errors, rerun with: -v -==23342== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_subject_test_05 b/test/logs/trace_valgrind_subject_test_05 deleted file mode 100644 index 50e51da..0000000 --- a/test/logs/trace_valgrind_subject_test_05 +++ /dev/null @@ -1,36 +0,0 @@ -==23352== Memcheck, a memory error detector -==23352== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23352== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23352== Command: ./../ft_ssl md5 -r file -==23352== -53d53ea94217b259c11a5a2d104ec58a file -==23352== -==23352== HEAP SUMMARY: -==23352== in use at exit: 18,178 bytes in 162 blocks -==23352== total heap usage: 184 allocs, 22 frees, 24,506 bytes allocated -==23352== -==23352== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23352== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23352== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23352== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23352== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23352== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23352== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23352== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23352== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23352== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23352== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23352== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23352== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23352== -==23352== LEAK SUMMARY: -==23352== definitely lost: 0 bytes in 0 blocks -==23352== indirectly lost: 0 bytes in 0 blocks -==23352== possibly lost: 72 bytes in 3 blocks -==23352== still reachable: 200 bytes in 6 blocks -==23352== suppressed: 17,906 bytes in 153 blocks -==23352== Reachable blocks (those to which a pointer was found) are not shown. -==23352== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23352== -==23352== For counts of detected and suppressed errors, rerun with: -v -==23352== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_subject_test_06 b/test/logs/trace_valgrind_subject_test_06 deleted file mode 100644 index d907f6a..0000000 --- a/test/logs/trace_valgrind_subject_test_06 +++ /dev/null @@ -1,36 +0,0 @@ -==23362== Memcheck, a memory error detector -==23362== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23362== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23362== Command: ./../ft_ssl md5 -s pity\ those\ that\ aren't\ following\ baerista\ on\ spotify. -==23362== -MD5 ("pity those that aren't following baerista on spotify.") = a3c990a1964705d9bf0e602f44572f5f -==23362== -==23362== HEAP SUMMARY: -==23362== in use at exit: 18,178 bytes in 162 blocks -==23362== total heap usage: 183 allocs, 21 frees, 24,490 bytes allocated -==23362== -==23362== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23362== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23362== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23362== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23362== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23362== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23362== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23362== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23362== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23362== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23362== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23362== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23362== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23362== -==23362== LEAK SUMMARY: -==23362== definitely lost: 0 bytes in 0 blocks -==23362== indirectly lost: 0 bytes in 0 blocks -==23362== possibly lost: 72 bytes in 3 blocks -==23362== still reachable: 200 bytes in 6 blocks -==23362== suppressed: 17,906 bytes in 153 blocks -==23362== Reachable blocks (those to which a pointer was found) are not shown. -==23362== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23362== -==23362== For counts of detected and suppressed errors, rerun with: -v -==23362== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_subject_test_07 b/test/logs/trace_valgrind_subject_test_07 deleted file mode 100644 index e681da2..0000000 --- a/test/logs/trace_valgrind_subject_test_07 +++ /dev/null @@ -1,38 +0,0 @@ -==23373== Memcheck, a memory error detector -==23373== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23373== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23373== Command: ./../ft_ssl md5 -p file -==23373== -be sure to handle edge cases carefully -3553dc7dc5963b583c056d1b9fa3349c -MD5 (file) = 53d53ea94217b259c11a5a2d104ec58a -==23373== -==23373== HEAP SUMMARY: -==23373== in use at exit: 18,178 bytes in 162 blocks -==23373== total heap usage: 190 allocs, 28 frees, 24,714 bytes allocated -==23373== -==23373== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23373== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23373== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23373== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23373== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23373== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23373== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23373== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23373== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23373== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23373== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23373== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23373== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23373== -==23373== LEAK SUMMARY: -==23373== definitely lost: 0 bytes in 0 blocks -==23373== indirectly lost: 0 bytes in 0 blocks -==23373== possibly lost: 72 bytes in 3 blocks -==23373== still reachable: 200 bytes in 6 blocks -==23373== suppressed: 17,906 bytes in 153 blocks -==23373== Reachable blocks (those to which a pointer was found) are not shown. -==23373== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23373== -==23373== For counts of detected and suppressed errors, rerun with: -v -==23373== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_subject_test_08 b/test/logs/trace_valgrind_subject_test_08 deleted file mode 100644 index 003e918..0000000 --- a/test/logs/trace_valgrind_subject_test_08 +++ /dev/null @@ -1,38 +0,0 @@ -==23397== Memcheck, a memory error detector -==23397== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23397== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23397== Command: ./../ft_ssl md5 -p -r file -==23397== -but eventually you will understand -dcdd84e0f635694d2a943fa8d3905281 -53d53ea94217b259c11a5a2d104ec58a file -==23397== -==23397== HEAP SUMMARY: -==23397== in use at exit: 18,178 bytes in 162 blocks -==23397== total heap usage: 190 allocs, 28 frees, 24,710 bytes allocated -==23397== -==23397== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23397== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23397== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23397== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23397== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23397== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23397== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23397== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23397== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23397== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23397== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23397== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23397== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23397== -==23397== LEAK SUMMARY: -==23397== definitely lost: 0 bytes in 0 blocks -==23397== indirectly lost: 0 bytes in 0 blocks -==23397== possibly lost: 72 bytes in 3 blocks -==23397== still reachable: 200 bytes in 6 blocks -==23397== suppressed: 17,906 bytes in 153 blocks -==23397== Reachable blocks (those to which a pointer was found) are not shown. -==23397== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23397== -==23397== For counts of detected and suppressed errors, rerun with: -v -==23397== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_subject_test_09 b/test/logs/trace_valgrind_subject_test_09 deleted file mode 100644 index 08cee33..0000000 --- a/test/logs/trace_valgrind_subject_test_09 +++ /dev/null @@ -1,39 +0,0 @@ -==23410== Memcheck, a memory error detector -==23410== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23410== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23410== Command: ./../ft_ssl md5 -p -s foo file -==23410== -GL HF let's go -d1e3cc342b6da09480b27ec57ff243e2 -MD5 ("foo") = acbd18db4cc2f85cedef654fccc4a4d8 -MD5 (file) = 53d53ea94217b259c11a5a2d104ec58a -==23410== -==23410== HEAP SUMMARY: -==23410== in use at exit: 18,178 bytes in 162 blocks -==23410== total heap usage: 195 allocs, 33 frees, 24,858 bytes allocated -==23410== -==23410== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23410== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23410== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23410== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23410== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23410== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23410== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23410== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23410== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23410== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23410== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23410== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23410== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23410== -==23410== LEAK SUMMARY: -==23410== definitely lost: 0 bytes in 0 blocks -==23410== indirectly lost: 0 bytes in 0 blocks -==23410== possibly lost: 72 bytes in 3 blocks -==23410== still reachable: 200 bytes in 6 blocks -==23410== suppressed: 17,906 bytes in 153 blocks -==23410== Reachable blocks (those to which a pointer was found) are not shown. -==23410== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23410== -==23410== For counts of detected and suppressed errors, rerun with: -v -==23410== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_subject_test_10 b/test/logs/trace_valgrind_subject_test_10 deleted file mode 100644 index 1479371..0000000 --- a/test/logs/trace_valgrind_subject_test_10 +++ /dev/null @@ -1,40 +0,0 @@ -==23424== Memcheck, a memory error detector -==23424== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23424== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23424== Command: ./../ft_ssl md5 -r -p -s foo file -s bar -==23424== -one more thing -a0bd1876c6f011dd50fae52827f445f5 -MD5 ("foo") = acbd18db4cc2f85cedef654fccc4a4d8 -MD5 (file) = 53d53ea94217b259c11a5a2d104ec58a -MD5 ("bar") = 37b51d194a7513e45b56f6524f2d51f2 -==23424== -==23424== HEAP SUMMARY: -==23424== in use at exit: 18,178 bytes in 162 blocks -==23424== total heap usage: 200 allocs, 38 frees, 25,026 bytes allocated -==23424== -==23424== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23424== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23424== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23424== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23424== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23424== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23424== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23424== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23424== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23424== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23424== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23424== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23424== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23424== -==23424== LEAK SUMMARY: -==23424== definitely lost: 0 bytes in 0 blocks -==23424== indirectly lost: 0 bytes in 0 blocks -==23424== possibly lost: 72 bytes in 3 blocks -==23424== still reachable: 200 bytes in 6 blocks -==23424== suppressed: 17,906 bytes in 153 blocks -==23424== Reachable blocks (those to which a pointer was found) are not shown. -==23424== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23424== -==23424== For counts of detected and suppressed errors, rerun with: -v -==23424== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test/logs/trace_valgrind_subject_test_11 b/test/logs/trace_valgrind_subject_test_11 deleted file mode 100644 index 53e2064..0000000 --- a/test/logs/trace_valgrind_subject_test_11 +++ /dev/null @@ -1,39 +0,0 @@ -==23440== Memcheck, a memory error detector -==23440== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==23440== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==23440== Command: ./../ft_ssl md5 -r -q -p -s foo file -==23440== -just to be extra clear -3ba35f1ea0d170cb3b9a752e3360286c -MD5 ("foo") = acbd18db4cc2f85cedef654fccc4a4d8 -MD5 (file) = 53d53ea94217b259c11a5a2d104ec58a -==23440== -==23440== HEAP SUMMARY: -==23440== in use at exit: 18,178 bytes in 162 blocks -==23440== total heap usage: 195 allocs, 33 frees, 24,866 bytes allocated -==23440== -==23440== 72 bytes in 3 blocks are possibly lost in loss record 26 of 42 -==23440== at 0x10009CC8A: calloc (in /Users/cpieri/.brew/Cellar/valgrind/3.14.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so) -==23440== by 0x1005B6832: map_images_nolock (in /usr/lib/libobjc.A.dylib) -==23440== by 0x1005C9D6A: map_images (in /usr/lib/libobjc.A.dylib) -==23440== by 0x10000B03B: dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*), bool, bool) (in /usr/lib/dyld) -==23440== by 0x10000B255: dyld::registerObjCNotifiers(void (*)(unsigned int, char const* const*, mach_header const* const*), void (*)(char const*, mach_header const*), void (*)(char const*, mach_header const*)) (in /usr/lib/dyld) -==23440== by 0x10020400A: _dyld_objc_notify_register (in /usr/lib/system/libdyld.dylib) -==23440== by 0x1005B6072: _objc_init (in /usr/lib/libobjc.A.dylib) -==23440== by 0x10019768D: _os_object_init (in /usr/lib/system/libdispatch.dylib) -==23440== by 0x10019763A: libdispatch_init (in /usr/lib/system/libdispatch.dylib) -==23440== by 0x1000AB9D5: libSystem_initializer (in /usr/lib/libSystem.B.dylib) -==23440== by 0x10001BA1A: ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23440== by 0x10001BC1D: ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) (in /usr/lib/dyld) -==23440== -==23440== LEAK SUMMARY: -==23440== definitely lost: 0 bytes in 0 blocks -==23440== indirectly lost: 0 bytes in 0 blocks -==23440== possibly lost: 72 bytes in 3 blocks -==23440== still reachable: 200 bytes in 6 blocks -==23440== suppressed: 17,906 bytes in 153 blocks -==23440== Reachable blocks (those to which a pointer was found) are not shown. -==23440== To see them, rerun with: --leak-check=full --show-leak-kinds=all -==23440== -==23440== For counts of detected and suppressed errors, rerun with: -v -==23440== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 12 from 12) diff --git a/test.sh b/test/test_des/test.sh similarity index 100% rename from test.sh rename to test/test_des/test.sh diff --git a/test/test_des/test_base64/encode_auteur b/test/test_des/test_base64/encode_auteur new file mode 100644 index 0000000..03e44fa --- /dev/null +++ b/test/test_des/test_base64/encode_auteur @@ -0,0 +1 @@ +Y3BpZXJpCg== diff --git a/test/test_des/test_base64/encode_clean_c b/test/test_des/test_base64/encode_clean_c new file mode 100644 index 0000000..0b273df --- /dev/null +++ b/test/test_des/test_base64/encode_clean_c @@ -0,0 +1 @@ +LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDo6OiAgICAgIDo6Ojo6Ojo6ICAgKi8KLyogICBjbGVhbi5jICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6KzogICAgICA6KzogICAgOis6ICAgKi8KLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKzorICs6KyAgICAgICAgICs6KyAgICAgKi8KLyogICBCeTogY3BpZXJpIDxjcGllcmlAc3R1ZGVudC40Mi5mcj4gICAgICAgICAgICAgICsjKyAgKzorICAgICAgICsjKyAgICAgICAgKi8KLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIysjKyMrIysjKyAgICsjKyAgICAgICAgICAgKi8KLyogICBDcmVhdGVkOiAyMDE5LzAzLzE1IDEyOjA3OjE0IGJ5IGNwaWVyaSAgICAgICAgICAgICMrIyAgICAjKyMgICAgICAgICAgICAgKi8KLyogICBVcGRhdGVkOiAyMDE5LzA0LzEyIDEwOjI1OjA5IGJ5IGNwaWVyaSAgICAgICAgICAgIyMjICAgIyMjIyMjIyMuZnIgICAgICAgKi8KLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KCiNpbmNsdWRlICJmdF9zc2wuaCIKCnZvaWQJY2xlYW5fZGF0YSh0X2RhdGEgKipkYXRhKQp7CglpZiAoKmRhdGEgIT0gTlVMTCkKCXsKCQlpZiAoKCpkYXRhKS0+bWFsbCA9PSAxKQoJCQlmdF9tZW1kZWwoKHZvaWQqKikmKCgqZGF0YSktPmRhdGEpKTsKCQlpZiAoKCpkYXRhKS0+Zl9oYXNoICE9IE5VTEwpCgkJewoJCQlmdF9tZW1kZWwoKHZvaWQqKikmKCgqZGF0YSktPmZfaGFzaC0+aCkpOwoJCQlmdF9tZW1kZWwoKHZvaWQqKikmKCgqZGF0YSktPmZfaGFzaCkpOwoJCX0KCQlmdF9tZW1kZWwoKHZvaWQqKilkYXRhKTsKCX0KfQoKdm9pZAljbGVhbl9wcm9nKHRfcGFyc2UgKnBhcnNlKQp7Cgl0X29wdAkqbmV4dDsKCXRfb3B0CSpsc3Q7CgoJbHN0ID0gcGFyc2UtPmxzdF9vcHRzOwoJd2hpbGUgKGxzdCAhPSBOVUxMKQoJewoJCWlmIChsc3QtPmRhdGEtPm1hbGwgPT0gMSkKCQkJZnRfbWVtZGVsKCh2b2lkKiopJihsc3QtPmRhdGEtPmRhdGEpKTsKCQlmdF9tZW1kZWwoKHZvaWQqKikmKGxzdC0+ZGF0YS0+Zl9oYXNoLT5oKSk7CgkJZnRfbWVtZGVsKCh2b2lkKiopJihsc3QtPmRhdGEtPmZfaGFzaCkpOwoJCWZ0X21lbWRlbCgodm9pZCoqKSYobHN0LT5kYXRhKSk7CgkJbmV4dCA9IGxzdC0+bmV4dDsKCQlmdF9tZW1kZWwoKHZvaWQqKikmKGxzdCkpOwoJCWxzdCA9IG5leHQ7Cgl9CglwYXJzZS0+bHN0X29wdHMgPSBOVUxMOwp9Cg== diff --git a/test/test_des/test_base64/encode_mfile b/test/test_des/test_base64/encode_mfile new file mode 100644 index 0000000..c486271 --- /dev/null +++ b/test/test_des/test_base64/encode_mfile @@ -0,0 +1 @@ +IyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICMKIyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICMKIyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDo6OiAgICAgIDo6Ojo6Ojo6ICAgICMKIyAgICBNYWtlZmlsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6KzogICAgICA6KzogICAgOis6ICAgICMKIyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKzorICs6KyAgICAgICAgICs6KyAgICAgICMKIyAgICBCeTogY3BpZXJpIDxjcGllcmlAc3R1ZGVudC40Mi5mcj4gICAgICAgICAgICAgICsjKyAgKzorICAgICAgICsjKyAgICAgICAgICMKIyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIysjKyMrIysjKyAgICsjKyAgICAgICAgICAgICMKIyAgICBDcmVhdGVkOiAyMDE4LzAzLzE1IDExOjIwOjI1IGJ5IGNwaWVyaSAgICAgICAgICAgICMrIyAgICAjKyMgICAgICAgICAgICAgICMKIyAgICBVcGRhdGVkOiAyMDE5LzA0LzE1IDEzOjQ3OjMxIGJ5IGNwaWVyaSAgICAgICAgICAgIyMjICAgIyMjIyMjIyMuZnIgICAgICAgICMKIyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICMKIyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICMKCk5BTUUJPQlmdF9zc2wKCkNDCQk9CWdjYwoKRVJST1IJPQktZzMgLWZsdG8gLWZzYW5pdGl6ZT1hZGRyZXNzIC1mbm8tb21pdC1mcmFtZS1wb2ludGVyCgpvdmVycmlkZSBDRkxBR1MJKz0JLVdhbGwgLVdleHRyYSAtV2Vycm9yCgpDUFBGTEFHUz0JLUlpbmNsdWRlcwoKRkxBR1NGVAk9CS1MLi9saWJmdCAtbGZ0CgpTUkNfUEFUSD0Jc3JjcwoKT0JKX1BBVEg9CW9iagoKREVQUyA9CQlNYWtlZmlsZQkJCQlcCgkJCWluY2x1ZGVzL2Z0X3NzbC5oCQlcCgkJCWluY2x1ZGVzL2RlZmluZS5oCQlcCgkJCWluY2x1ZGVzL2NvbnN0YW50LmgJCVwKCQkJaW5jbHVkZXMvZW51bS5oCQkJXAoJCQlpbmNsdWRlcy9mdW5jdGlvbnMuaAlcCgkJCWluY2x1ZGVzL3N0cnVjdHVyZS5oCVwKCQkJaW5jbHVkZXMvaGFzaC9zaGEyNTYuaAlcCgkJCWluY2x1ZGVzL2hhc2gvaGFzaC5oCVwKCQkJaW5jbHVkZXMvaGFzaC9tZDUuaAkJXAoJCQlsaWJmdC9saWJmdC5hCgpTUkNfTkFNRT0gCW1haW4uYwkJCQkJCQlcCgkJCWNsZWFuLmMJCQkJCQkJXAoJCQl1c2FnZS5jCQkJCQkJCVwKCQkJcGFyc2luZy5jCQkJCQkJXAoJCQlnZXRfZGF0YS5jCQkJCQkJXAoJCQlsc3Rfb3B0LmMJCQkJCQlcCgkJCWhhc2gvaGFzaC5jCQkJCQkJXAoJCQloYXNoL2hhc2hfcGFyc2luZy5jCQkJCVwKCQkJaGFzaC9kaXNwbGF5X2hhc2guYwkJCQlcCgkJCWhhc2gvc2hhMjU2L3NoYTI1Ni5jCQkJXAoJCQloYXNoL3NoYTI1Ni9zaGEyNTZfdXRpbHMuYwkJXAoJCQloYXNoL21kNS9tZDVfdXRpbHMuYwkJCVwKCQkJaGFzaC9tZDUvbWQ1LmMJCQkJCVwKCQkJYmFzZTY0L2Jhc2U2NC5jCQkJCQlcCgkJCWJhc2U2NC9iYXNlNjRfZW5jb2RlLmMJCQlcCgkJCWJhc2U2NC9iYXNlNjRfZGVjb2RlLmMJCQlcCgkJCWJhc2U2NC9iYXNlNjRfcGFyc2luZy5jCQkJXAoJCQliYXNlNjQvYmFzZTY0X2hlbHBfcGFyc2luZy5jCVwKCk9CSl9OQU1FPQkkKFNSQ19OQU1FOi5jPS5vKQoKU1JDCQk9CSQoYWRkcHJlZml4ICQoU1JDX1BBVEgpLywkKFNSQ19OQU1FKSkKCk9CSgkJPQkkKGFkZHByZWZpeCAkKE9CSl9QQVRIKS8sJChPQkpfTkFNRSkpCgpOT05FID0gXDAzM1swbQpSRUQgPSBcMDMzWzMxbQpHUkVFTiA9IFwwMzNbMzJtCllFTExPVyA9IFwwMzNbMzNtCkJMVUUgPSBcMDMzWzM0bQpNQUdFTlRBID0gXDAzM1szNW0KQ1lBTiA9IFwwMzNbMzZtCgouUEhPTlk6CWFsbCBjbGVhbiBmY2xlYW4gcmUgZWNobyBub3JtCgphbGw6CQlMRlQgJChOQU1FKQoKJChOQU1FKToJbGliZnQgZWNobyAkKE9CSikKCQkJQCQoQ0MpICQoQ0ZMQUdTKSAkKEZMQUdTRlQpIC1vICQoTkFNRSkgJChPQkopICQoQ1BQRkxBR1MpCgkJCUBlY2hvICJcbiQoR1JFRU4pJChOQU1FKSByZWFkeSEkKE5PTkUpIgoKZWNobzoKCQkJQCBlY2hvIC1uIEdldHRpbmcgJChOQU1FKSByZWFkeQoKJChPQkpfUEFUSCkvJS5vOiAkKFNSQ19QQVRIKS8lLmMgJChERVBTKQoJCQlAbWtkaXIgJChkaXIgJEApIDI+IC9kZXYvbnVsbCB8fCB0cnVlCgkJCUAkKENDKSAkKENGTEFHUykgJChDUFBGTEFHUykgLWMgJDwgLW8gJEAKCQkJQGVjaG8gLW4gLgoKY2xlYW46CgkJCUBlY2hvICIkKFlFTExPVylDbGVhbmluZy4uLiQoTk9ORSkiCgkJCUBtYWtlIGNsZWFuIC1DIC4vbGliZnQvCgkJCUAvYmluL3JtIC1mICQoT0JKKQoJCQlAcm0gLXJmICQoT0JKX1BBVEgpIDI+IC9kZXYvbnVsbCB8fCB0cnVlCgpmY2xlYW46CQljbGVhbgoJCQlAbWFrZSBmY2xlYW4gLUMgLi9saWJmdC8KCQkJQGVjaG8gIiQoUkVEKUxpYmZ0LmEgZGVsZXRlZCQoTk9ORSkiCgkJCUAvYmluL3JtIC1mICQoTkFNRSkKCQkJQGVjaG8gIiQoUkVEKSQoTkFNRSkgZGVsZXRlZCAhJChOT05FKSIKCnJlOgkJCWZjbGVhbiBhbGwKCkxGVDoKCQlAbWFrZSAtQyAuL2xpYmZ0LzsKCQlAZWNobyAiXG4kKEdSRUVOKUxpYmZ0IHJlYWR5ISQoTk9ORSkiOwo= diff --git a/test/test_des/test_base64/size_file b/test/test_des/test_base64/size_file new file mode 100644 index 0000000..b70e7d6 --- /dev/null +++ b/test/test_des/test_base64/size_file @@ -0,0 +1,6 @@ +[ft_ssl] cat auteur | wc -c des ✗ ✭ ✱ + 7 +[ft_ssl] cat Makefile | wc -c des ✗ ✭ ✱ + 2822 +[ft_ssl] cat srcs/clean.c | wc -c des ✗ ✭ ✱ + 1591