#include <stdint.h>
-#define CADET_DEBUG GNUNET_YES
+#if !defined(GNUNET_CULL_LOGGING)
+ #define CADET_TIMING_START \
+ struct GNUNET_TIME_Absolute __timestamp;\
+ __timestamp = GNUNET_TIME_absolute_get()
+
+ #define CADET_TIMING_END \
+ struct GNUNET_TIME_Relative __duration;\
+ __duration = GNUNET_TIME_absolute_get_duration (__timestamp);\
+ LOG (GNUNET_ERROR_TYPE_INFO, " %s duration %s\n",\
+ __FUNCTION__,\
+ GNUNET_STRINGS_relative_time_to_string (__duration, GNUNET_YES));
+#else
+ #define CADET_TIMING_START
+ #define CADET_TIMING_END
+#endif
+
#include "platform.h"
#include "gnunet_util_lib.h"
#define REKEY_WAIT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 5)
#if !defined(GNUNET_CULL_LOGGING)
-#define DUMP_KEYS_TO_STDERR GNUNET_YES
+ #define DUMP_KEYS_TO_STDERR GNUNET_YES
#else
-#define DUMP_KEYS_TO_STDERR GNUNET_YES
+ #define DUMP_KEYS_TO_STDERR GNUNET_NO
#endif
#define MIN_TUNNEL_BUFFER 8
#define AX_HEADER_SIZE (sizeof (uint32_t) * 2\
+ sizeof (struct GNUNET_CRYPTO_EcdhePublicKey))
-
/******************************************************************************/
/******************************** STRUCTS **********************************/
/******************************************************************************/
struct GNUNET_CRYPTO_SymmetricInitializationVector iv;
struct CadetTunnelAxolotl *ax;
size_t out_size;
- struct GNUNET_TIME_Absolute start_time;
- struct GNUNET_TIME_Relative duration;
- LOG (GNUNET_ERROR_TYPE_DEBUG, " t_ax_encrypt start\n");
- start_time = GNUNET_TIME_absolute_get ();
+ CADET_TIMING_START;
+ LOG (GNUNET_ERROR_TYPE_DEBUG, " t_ax_encrypt start\n");
ax = t->ax;
-
ax->ratchet_counter++;
if (GNUNET_YES == ax->ratchet_allowed
&& (ratchet_messages <= ax->ratchet_counter
#endif
out_size = GNUNET_CRYPTO_symmetric_encrypt (src, size, &MK, &iv, dst);
-
t_hmac_derive_key (&ax->CKs, &ax->CKs, "1", 1);
- duration = GNUNET_TIME_absolute_get_duration (start_time);
- LOG (GNUNET_ERROR_TYPE_DEBUG, " t_ax_encrypt duration %s\n",
- GNUNET_STRINGS_relative_time_to_string (duration, GNUNET_YES));
- LOG (GNUNET_ERROR_TYPE_DEBUG, " t_ax_encrypt end\n");
+ CADET_TIMING_END;
return out_size;
}
const struct GNUNET_PeerIdentity *pid;
int am_I_alice;
+ CADET_TIMING_START;
+
LOG (GNUNET_ERROR_TYPE_INFO, "<== { KX} on %s\n", GCT_2s (t));
if (NULL == t->ax)
ax->PNs = 0;
ax->Nr = 0;
ax->Ns = 0;
+
GCT_change_estate (t, CADET_TUNNEL_KEY_PING);
send_queued_data (t);
+
+ CADET_TIMING_END;
}
/**