Add initial crypto functionality
[libcontrac.git] / include / contrac / utils.h
diff --git a/include/contrac/utils.h b/include/contrac/utils.h
new file mode 100644 (file)
index 0000000..38b0c3f
--- /dev/null
@@ -0,0 +1,51 @@
+/** \ingroup contrac
+ * @file
+ * @author     David Llewellyn-Jones
+ * @version    $(VERSION)
+ *
+ * @section LICENSE
+ *
+ *
+ *
+ * @brief
+ * @section DESCRIPTION
+ *
+ *
+ *
+ */
+
+
+#ifndef __UTILS_H
+#define __UTILS_H
+
+// Includes
+
+// Defines
+
+#define MAX(a,b) \
+       ({ __typeof__ (a) _a = (a); \
+               __typeof__ (b) _b = (b); \
+               _a > _b ? _a : _b; })
+
+#define MIN(a,b) \
+       ({ __typeof__ (a) _a = (a); \
+               __typeof__ (b) _b = (b); \
+               _a < _b ? _a : _b; })
+
+// Structures
+
+// Function prototypes
+
+size_t base64_encode_size(size_t binary_input);
+size_t base64_decode_size(size_t base64_input);
+void base64_encode_binary_to_base64(unsigned char const *input, size_t input_size, unsigned char *output, size_t *output_size);
+void base64_decode_base64_to_binary(unsigned char const *input, size_t input_size, unsigned char *output, size_t *output_size);
+
+// Function definitions
+
+#endif // __UTILS_H
+
+
+
+
+