aboutsummaryrefslogtreecommitdiff
path: root/crypto.c
diff options
context:
space:
mode:
authorMarkus Teich <markus.teich@stusta.mhn.de>2016-08-16 20:58:20 +0200
committerMarkus Teich <markus.teich@stusta.mhn.de>2016-08-16 20:58:20 +0200
commitfe7b13889217f4268d87d3712cb9ffe265e6a4e2 (patch)
tree59a17a13bdd9f22281bb0a59d8056675814a0cfd /crypto.c
parent01c2b8d710ff5a526d1ae2ed2a7fafdec0b1f973 (diff)
downloadlibbrandt-fe7b13889217f4268d87d3712cb9ffe265e6a4e2.tar.gz
libbrandt-fe7b13889217f4268d87d3712cb9ffe265e6a4e2.zip
some stuff
- finish BRANDT_destroy() - fix include mess related to platform.h and brandt_config.h - add first brandt.c testcase
Diffstat (limited to 'crypto.c')
-rw-r--r--crypto.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/crypto.c b/crypto.c
index 4b6419a..64d4920 100644
--- a/crypto.c
+++ b/crypto.c
@@ -20,15 +20,15 @@
20 * @author Markus Teich 20 * @author Markus Teich
21 */ 21 */
22 22
23#include "brandt_config.h" 23#include "platform.h"
24 24
25#include <arpa/inet.h>
26#include <gcrypt.h> 25#include <gcrypt.h>
27 26
28#include "crypto.h" 27#include "crypto.h"
29#include "internals.h" 28#include "internals.h"
30#include "util.h" 29#include "util.h"
31 30
31
32#define CURVE "Ed25519" 32#define CURVE "Ed25519"
33 33
34 34
@@ -377,7 +377,7 @@ ec_point_parse (gcry_mpi_point_t dst, const struct ec_mpi *src)
377 * @param[in,out] dst The 1 dimensional array to clean up 377 * @param[in,out] dst The 1 dimensional array to clean up
378 * @param[in] size1 size of the first dimension 378 * @param[in] size1 size of the first dimension
379 */ 379 */
380static void 380void
381smc_free1 (gcry_mpi_point_t *dst, uint16_t size1) 381smc_free1 (gcry_mpi_point_t *dst, uint16_t size1)
382{ 382{
383 if (NULL == dst) 383 if (NULL == dst)
@@ -399,7 +399,7 @@ smc_free1 (gcry_mpi_point_t *dst, uint16_t size1)
399 * @return a pointer to the array or NULL on error. 399 * @return a pointer to the array or NULL on error.
400 * If not used anymore use smc_free2 to reclaim the memory. 400 * If not used anymore use smc_free2 to reclaim the memory.
401 */ 401 */
402static gcry_mpi_point_t * 402gcry_mpi_point_t *
403smc_init1 (uint16_t size1) 403smc_init1 (uint16_t size1)
404{ 404{
405 gcry_mpi_point_t *ret; 405 gcry_mpi_point_t *ret;
@@ -427,7 +427,7 @@ smc_init1 (uint16_t size1)
427 * @param[in] size1 size of the first dimension 427 * @param[in] size1 size of the first dimension
428 * @param[in] size2 size of the second dimension 428 * @param[in] size2 size of the second dimension
429 */ 429 */
430static void 430void
431smc_free2 (gcry_mpi_point_t **dst, uint16_t size1, uint16_t size2) 431smc_free2 (gcry_mpi_point_t **dst, uint16_t size1, uint16_t size2)
432{ 432{
433 if (NULL == dst) 433 if (NULL == dst)
@@ -451,7 +451,7 @@ smc_free2 (gcry_mpi_point_t **dst, uint16_t size1, uint16_t size2)
451 * @return a pointer to the array or NULL on error. 451 * @return a pointer to the array or NULL on error.
452 * If not used anymore use smc_free2 to reclaim the memory. 452 * If not used anymore use smc_free2 to reclaim the memory.
453 */ 453 */
454static gcry_mpi_point_t ** 454gcry_mpi_point_t **
455smc_init2 (uint16_t size1, uint16_t size2) 455smc_init2 (uint16_t size1, uint16_t size2)
456{ 456{
457 gcry_mpi_point_t **ret; 457 gcry_mpi_point_t **ret;
@@ -490,7 +490,7 @@ smc_init2 (uint16_t size1, uint16_t size2)
490 * @param[in] size2 size of the second dimension 490 * @param[in] size2 size of the second dimension
491 * @param[in] size3 size of the third dimension 491 * @param[in] size3 size of the third dimension
492 */ 492 */
493static void 493void
494smc_free3 (gcry_mpi_point_t ***dst, 494smc_free3 (gcry_mpi_point_t ***dst,
495 uint16_t size1, 495 uint16_t size1,
496 uint16_t size2, 496 uint16_t size2,
@@ -519,7 +519,7 @@ smc_free3 (gcry_mpi_point_t ***dst,
519 * @return a pointer to the array or NULL on error. 519 * @return a pointer to the array or NULL on error.
520 * If not used anymore use smc_free3 to reclaim the memory. 520 * If not used anymore use smc_free3 to reclaim the memory.
521 */ 521 */
522static gcry_mpi_point_t *** 522gcry_mpi_point_t ***
523smc_init3 (uint16_t size1, uint16_t size2, uint16_t size3) 523smc_init3 (uint16_t size1, uint16_t size2, uint16_t size3)
524{ 524{
525 gcry_mpi_point_t ***ret; 525 gcry_mpi_point_t ***ret;