aboutsummaryrefslogtreecommitdiff
path: root/libcmix-crypto
diff options
context:
space:
mode:
authorDennis Brentjes <d.brentjes@gmail.com>2016-11-28 15:48:59 +0100
committerDennis Brentjes <d.brentjes@gmail.com>2016-11-28 15:48:59 +0100
commita4a912873058e50060561c21e965b4fec1d9b08b (patch)
tree564432cf3f760483a9acfa64f109f5f42be469c1 /libcmix-crypto
parentb8d2fe28870d1f54aad1fd9fce04e57caa85ba0b (diff)
downloadcmix-a4a912873058e50060561c21e965b4fec1d9b08b.tar.gz
cmix-a4a912873058e50060561c21e965b4fec1d9b08b.tar.bz2
cmix-a4a912873058e50060561c21e965b4fec1d9b08b.zip
Cleans up and documents the whole cmix protocol.
Diffstat (limited to 'libcmix-crypto')
-rw-r--r--libcmix-crypto/CMakeLists.txt2
-rw-r--r--libcmix-crypto/groupelement.h7
-rw-r--r--libcmix-crypto/message.h78
3 files changed, 8 insertions, 79 deletions
diff --git a/libcmix-crypto/CMakeLists.txt b/libcmix-crypto/CMakeLists.txt
index 08036f4..7fa0d29 100644
--- a/libcmix-crypto/CMakeLists.txt
+++ b/libcmix-crypto/CMakeLists.txt
@@ -9,7 +9,7 @@ set(interface_sources
${CMAKE_CURRENT_SOURCE_DIR}/api.h
${CMAKE_CURRENT_SOURCE_DIR}/keypair.h
${CMAKE_CURRENT_SOURCE_DIR}/sharedkey.h
- ${CMAKE_CURRENT_SOURCE_DIR}/message.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/groupelement.h
)
target_sources(cmix-crypto-interface
diff --git a/libcmix-crypto/groupelement.h b/libcmix-crypto/groupelement.h
index 60c6b21..353e525 100644
--- a/libcmix-crypto/groupelement.h
+++ b/libcmix-crypto/groupelement.h
@@ -4,6 +4,13 @@
extern "C" {
#endif
+/*!
+ * \file
+ */
+
+/*!
+ * \brief GroupElement Token te represent group elements.
+ */
typedef void* GroupElement;
#ifdef __cplusplus
diff --git a/libcmix-crypto/message.h b/libcmix-crypto/message.h
deleted file mode 100644
index b1c3b87..0000000
--- a/libcmix-crypto/message.h
+++ /dev/null
@@ -1,78 +0,0 @@
-#pragma once
-
-/**
- * \file
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stddef.h>
-#include <stdlib.h>
-
-/*!
- * Defines how a cMix Buffer allocater should look like.
- */
-typedef char*(*CmixBufferAllocator)(size_t);
-/*!
- * Defines how a cMix Buffer deallocater should look like.
- */
-typedef void(*CmixBufferDeallocator)(void*);
-/*!
- * Defines how the function looks like that returns the length of one message in this buffer implementation.
- */
-typedef size_t(*CmixBufferMessageLength)();
-
-/*!
- * \brief The CmixBufferImpl struct
- */
-struct CmixBufferImpl {
- CmixBufferAllocator allocate_cmix_buffer; ///< pointer to function to implementation specific allocater.
- CmixBufferDeallocator deallocate_cmix_buffer; ///< pointer to function to implementation specific deallocater.
- CmixBufferMessageLength message_length; ///< pointer to function to implementation specific function returning message length.
-};
-
-/*!
- * \def DEFINE_CIPHER(NAME, MESSAGE_SIZE)
- * Generates some cipher specific boilerplate for manipulating the message buffer.
- */
-
-#define DEFINE_CIPHER(NAME, MESSAGE_SIZE)\
-typedef char NAME ## Message[MESSAGE_SIZE];\
-\
-char* allocate_ ## NAME ## _cmix_buffer(size_t size){\
- return (char*) calloc(size, sizeof(NAME ## Message));\
-}\
-\
-void deallocate_ ## NAME ## _cmix_buffer(void* buffer) {\
- free(buffer);\
-}\
-\
-size_t NAME ## _message_length() {\
- return sizeof(NAME ## Message);\
-}\
-\
-struct CmixBufferImpl get_cmix_ ## NAME ## _buffer_implementation() {\
- return (struct CmixBufferImpl) {\
- allocate_ ## NAME ## _cmix_buffer,\
- deallocate_ ## NAME ## _cmix_buffer,\
- NAME ## _message_length\
- };\
-}
-
-/*!
- * #DEFINE_CIPHER(Null, 0)
- */
-DEFINE_CIPHER(Null, 0)
-
-/*!
- * #DEFINE_CIPHER(Curve25519, 31)
- */
-DEFINE_CIPHER(Curve25519, 31)
-
-#undef DEFINE_CIPHER
-
-#ifdef __cplusplus
-} // extern "C"
-#endif