diff options
author | Markus Teich <markus.teich@stusta.mhn.de> | 2016-08-16 20:58:20 +0200 |
---|---|---|
committer | Markus Teich <markus.teich@stusta.mhn.de> | 2016-08-16 20:58:20 +0200 |
commit | fe7b13889217f4268d87d3712cb9ffe265e6a4e2 (patch) | |
tree | 59a17a13bdd9f22281bb0a59d8056675814a0cfd /crypto.c | |
parent | 01c2b8d710ff5a526d1ae2ed2a7fafdec0b1f973 (diff) | |
download | libbrandt-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.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -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 | */ |
380 | static void | 380 | void |
381 | smc_free1 (gcry_mpi_point_t *dst, uint16_t size1) | 381 | smc_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 | */ |
402 | static gcry_mpi_point_t * | 402 | gcry_mpi_point_t * |
403 | smc_init1 (uint16_t size1) | 403 | smc_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 | */ |
430 | static void | 430 | void |
431 | smc_free2 (gcry_mpi_point_t **dst, uint16_t size1, uint16_t size2) | 431 | smc_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 | */ |
454 | static gcry_mpi_point_t ** | 454 | gcry_mpi_point_t ** |
455 | smc_init2 (uint16_t size1, uint16_t size2) | 455 | smc_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 | */ |
493 | static void | 493 | void |
494 | smc_free3 (gcry_mpi_point_t ***dst, | 494 | smc_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 | */ |
522 | static gcry_mpi_point_t *** | 522 | gcry_mpi_point_t *** |
523 | smc_init3 (uint16_t size1, uint16_t size2, uint16_t size3) | 523 | smc_init3 (uint16_t size1, uint16_t size2, uint16_t size3) |
524 | { | 524 | { |
525 | gcry_mpi_point_t ***ret; | 525 | gcry_mpi_point_t ***ret; |