aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-01-17 17:18:53 +0100
committerChristian Grothoff <christian@grothoff.org>2017-01-17 17:18:53 +0100
commitf9b01d9c8eeac932db6357426f8a70bf525a4e07 (patch)
treef3023b6cfe959a38ed5d9ab131fc8e1c62d136ea /src/include
parent100e16ba31dac7138413bda3389d30b3575a8b8e (diff)
downloadgnunet-f9b01d9c8eeac932db6357426f8a70bf525a4e07.tar.gz
gnunet-f9b01d9c8eeac932db6357426f8a70bf525a4e07.zip
use new shortmap to simplify CADET logic a bit
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_cadet_service.h14
-rw-r--r--src/include/gnunet_common.h15
-rw-r--r--src/include/gnunet_crypto_lib.h23
3 files changed, 25 insertions, 27 deletions
diff --git a/src/include/gnunet_cadet_service.h b/src/include/gnunet_cadet_service.h
index c6b683370..c17cb983c 100644
--- a/src/include/gnunet_cadet_service.h
+++ b/src/include/gnunet_cadet_service.h
@@ -67,15 +67,6 @@ struct GNUNET_CADET_Channel;
67 */ 67 */
68struct GNUNET_CADET_Port; 68struct GNUNET_CADET_Port;
69 69
70/**
71 * Hash to be used in Cadet communication. Only 256 bits needed,
72 * instead of the 512 from `struct GNUNET_HashCode`.
73 */
74struct GNUNET_CADET_Hash
75{
76 unsigned char bits[256 / 8];
77};
78
79 70
80/** 71/**
81 * Channel options. Second line indicates filed in the 72 * Channel options. Second line indicates filed in the
@@ -255,8 +246,7 @@ GNUNET_CADET_disconnect (struct GNUNET_CADET_Handle *handle);
255struct GNUNET_CADET_Port * 246struct GNUNET_CADET_Port *
256GNUNET_CADET_open_port (struct GNUNET_CADET_Handle *h, 247GNUNET_CADET_open_port (struct GNUNET_CADET_Handle *h,
257 const struct GNUNET_HashCode *port, 248 const struct GNUNET_HashCode *port,
258 GNUNET_CADET_InboundChannelNotificationHandler 249 GNUNET_CADET_InboundChannelNotificationHandler new_channel,
259 new_channel,
260 void *new_channel_cls); 250 void *new_channel_cls);
261 251
262/** 252/**
@@ -496,7 +486,7 @@ typedef void
496 */ 486 */
497struct GNUNET_CADET_ConnectionTunnelIdentifier 487struct GNUNET_CADET_ConnectionTunnelIdentifier
498{ 488{
499 struct GNUNET_CADET_Hash connection_of_tunnel; 489 struct GNUNET_ShortHashCode connection_of_tunnel;
500}; 490};
501 491
502 492
diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h
index 62ae499e2..9ad604711 100644
--- a/src/include/gnunet_common.h
+++ b/src/include/gnunet_common.h
@@ -558,6 +558,19 @@ GNUNET_logger_remove (GNUNET_Logger logger,
558 558
559/** 559/**
560 * @ingroup logging 560 * @ingroup logging
561 * Convert a short hash value to a string (for printing debug messages).
562 * This is one of the very few calls in the entire API that is
563 * NOT reentrant!
564 *
565 * @param shc the hash code
566 * @return string
567 */
568const char *
569GNUNET_sh2s (const struct GNUNET_ShortHashCode *shc);
570
571
572/**
573 * @ingroup logging
561 * Convert a hash value to a string (for printing debug messages). 574 * Convert a hash value to a string (for printing debug messages).
562 * This is one of the very few calls in the entire API that is 575 * This is one of the very few calls in the entire API that is
563 * NOT reentrant! 576 * NOT reentrant!
@@ -655,7 +668,7 @@ GNUNET_error_type_to_string (enum GNUNET_ErrorType kind);
655/** 668/**
656 * @ingroup logging 669 * @ingroup logging
657 * Use this for fatal errors that cannot be handled 670 * Use this for fatal errors that cannot be handled
658 * 671 *
659 * @param cond Condition to evaluate 672 * @param cond Condition to evaluate
660 * @param comp Component string to use for logging 673 * @param comp Component string to use for logging
661 */ 674 */
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h
index b6875c5cf..43fd32a58 100644
--- a/src/include/gnunet_crypto_lib.h
+++ b/src/include/gnunet_crypto_lib.h
@@ -52,20 +52,6 @@ extern "C"
52#endif 52#endif
53 53
54/** 54/**
55 * @brief A 512-bit hashcode
56 */
57struct GNUNET_HashCode;
58
59/**
60 * The identity of the host (wraps the signing key of the peer).
61 */
62struct GNUNET_PeerIdentity;
63
64#include "gnunet_common.h"
65#include <gcrypt.h>
66
67
68/**
69 * @brief A 512-bit hashcode. These are the default length for GNUnet, using SHA-512. 55 * @brief A 512-bit hashcode. These are the default length for GNUnet, using SHA-512.
70 */ 56 */
71struct GNUNET_HashCode 57struct GNUNET_HashCode
@@ -86,6 +72,15 @@ struct GNUNET_ShortHashCode
86 72
87 73
88/** 74/**
75 * The identity of the host (wraps the signing key of the peer).
76 */
77struct GNUNET_PeerIdentity;
78
79#include "gnunet_common.h"
80#include <gcrypt.h>
81
82
83/**
89 * Maximum length of an ECC signature. 84 * Maximum length of an ECC signature.
90 * Note: round up to multiple of 8 minus 2 for alignment. 85 * Note: round up to multiple of 8 minus 2 for alignment.
91 */ 86 */