Add initial crypto functionality
[libcontrac.git] / include / contrac / utils.h
1 /** \ingroup contrac
2 * @file
3 * @author David Llewellyn-Jones
4 * @version $(VERSION)
5 *
6 * @section LICENSE
7 *
8 *
9 *
10 * @brief
11 * @section DESCRIPTION
12 *
13 *
14 *
15 */
16
17
18 #ifndef __UTILS_H
19 #define __UTILS_H
20
21 // Includes
22
23 // Defines
24
25 #define MAX(a,b) \
26 ({ __typeof__ (a) _a = (a); \
27 __typeof__ (b) _b = (b); \
28 _a > _b ? _a : _b; })
29
30 #define MIN(a,b) \
31 ({ __typeof__ (a) _a = (a); \
32 __typeof__ (b) _b = (b); \
33 _a < _b ? _a : _b; })
34
35 // Structures
36
37 // Function prototypes
38
39 size_t base64_encode_size(size_t binary_input);
40 size_t base64_decode_size(size_t base64_input);
41 void base64_encode_binary_to_base64(unsigned char const *input, size_t input_size, unsigned char *output, size_t *output_size);
42 void base64_decode_base64_to_binary(unsigned char const *input, size_t input_size, unsigned char *output, size_t *output_size);
43
44 // Function definitions
45
46 #endif // __UTILS_H
47
48
49
50
51