|
EDGESEC
0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
|
MD5 hash implementation and interface functions. More...
#include <stdint.h>#include <sys/types.h>#include <unistd.h>#include "utils/allocs.h"#include "utils/os.h"#include "md5_internal.h"Macros | |
| #define | byteReverse(buf, len) /* Nothing */ |
| #define | F1(x, y, z) (z ^ (x & (y ^ z))) |
| #define | F2(x, y, z) F1(z, x, y) |
| #define | F3(x, y, z) (x ^ y ^ z) |
| #define | F4(x, y, z) (y ^ (x | ~z)) |
| #define | MD5STEP(f, w, x, y, z, data, s) (w += f(x, y, z) + data, w = w << s | w >> (32 - s), w += x) |
Typedefs | |
| typedef struct MD5Context | MD5_CTX |
Functions | |
| int | edge_md5_vector (size_t num_elem, const uint8_t *addr[], const size_t *len, uint8_t *mac) |
MD5 hash implementation and interface functions.
| #define byteReverse | ( | buf, | |
| len | |||
| ) | /* Nothing */ |
| #define F1 | ( | x, | |
| y, | |||
| z | |||
| ) | (z ^ (x & (y ^ z))) |
| #define F2 | ( | x, | |
| y, | |||
| z | |||
| ) | F1(z, x, y) |
| #define F3 | ( | x, | |
| y, | |||
| z | |||
| ) | (x ^ y ^ z) |
| #define F4 | ( | x, | |
| y, | |||
| z | |||
| ) | (y ^ (x | ~z)) |
| #define MD5STEP | ( | f, | |
| w, | |||
| x, | |||
| y, | |||
| z, | |||
| data, | |||
| s | |||
| ) | (w += f(x, y, z) + data, w = w << s | w >> (32 - s), w += x) |
| typedef struct MD5Context MD5_CTX |
| int edge_md5_vector | ( | size_t | num_elem, |
| const uint8_t * | addr[], | ||
| const size_t * | len, | ||
| uint8_t * | mac | ||
| ) |
MD5 hash for data vector
| num_elem | Number of elements in the data vector | |
| addr | Pointers to the data areas | |
| len | Lengths of the data blocks | |
| [out] | mac | Buffer for the hash |
| 0 | on success |
| -1 | on failure |
md5_internal() in commit 0a5d68aba50c385e316a30d834d5b6174a4041d2 in src/crypto/md5-internal.c of the hostap project, see https://w1.fi/cgit/hostap/tree/src/crypto/md5-internal.c?id=0a5d68aba50c385e316a30d834d5b6174a4041d2#n34