-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfun_md5.c
38 lines (32 loc) · 1.29 KB
/
fun_md5.c
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
26
27
28
29
30
31
32
33
34
35
36
37
38
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* fun_md5.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: kdenisov <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/05/20 11:07:07 by kdenisov #+# #+# */
/* Updated: 2019/05/20 11:07:10 by kdenisov ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_ssl.h"
unsigned fun_f(unsigned x, unsigned y, unsigned z)
{
return ((x & y) | (~x & z));
}
unsigned fun_g(unsigned x, unsigned y, unsigned z)
{
return ((x & z) | (~z & y));
}
unsigned fun_h(unsigned x, unsigned y, unsigned z)
{
return (x ^ y ^ z);
}
unsigned fun_i(unsigned x, unsigned y, unsigned z)
{
return (y ^ (~z | x));
}
unsigned rl(unsigned x, unsigned n)
{
return ((x << n) | (x >> (32 - n)));
}