diff options
| author | Dennis Brentjes <d.brentjes@gmail.com> | 2016-09-28 13:18:18 +0200 |
|---|---|---|
| committer | Dennis Brentjes <d.brentjes@gmail.com> | 2016-09-28 13:18:18 +0200 |
| commit | 3fe7a5b6a18b6841ae51f294dc58fe9c8df6d375 (patch) | |
| tree | 345583aaf457ce5076d0d5f7c158628dfd971360 /libcmix-crypto/message.h | |
| parent | 85d25eebd38bb278ad598a291a007938854945a4 (diff) | |
| download | cmix-3fe7a5b6a18b6841ae51f294dc58fe9c8df6d375.tar.gz cmix-3fe7a5b6a18b6841ae51f294dc58fe9c8df6d375.tar.bz2 cmix-3fe7a5b6a18b6841ae51f294dc58fe9c8df6d375.zip | |
Finally made a initial doxygen documentation pass over all files.
Diffstat (limited to 'libcmix-crypto/message.h')
| -rw-r--r-- | libcmix-crypto/message.h | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/libcmix-crypto/message.h b/libcmix-crypto/message.h index 7222d00..b1c3b87 100644 --- a/libcmix-crypto/message.h +++ b/libcmix-crypto/message.h @@ -1,5 +1,9 @@ #pragma once +/** + * \file + */ + #ifdef __cplusplus extern "C" { #endif @@ -7,16 +11,33 @@ extern "C" { #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; - CmixBufferDeallocator deallocate_cmix_buffer; - CmixBufferMessageLength message_length; + 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];\ \ @@ -40,8 +61,15 @@ struct CmixBufferImpl get_cmix_ ## NAME ## _buffer_implementation() {\ };\ } +/*! + * #DEFINE_CIPHER(Null, 0) + */ DEFINE_CIPHER(Null, 0) -DEFINE_CIPHER(Curve25519, 20); + +/*! + * #DEFINE_CIPHER(Curve25519, 31) + */ +DEFINE_CIPHER(Curve25519, 31) #undef DEFINE_CIPHER |
