diff options
author | Bart Polot <bart@net.in.tum.de> | 2013-12-29 15:24:23 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2013-12-29 15:24:23 +0000 |
commit | c86189f006cdc1022cbdba8acb3710b04c4e9a30 (patch) | |
tree | eb3471c72f8e10b63f4f8f619a9f5423b35bd434 /src/mesh/gnunet-service-mesh_tunnel.c | |
parent | 120ba95916ae09a62baa52af3e6cd12ef72f5d6d (diff) | |
download | gnunet-c86189f006cdc1022cbdba8acb3710b04c4e9a30.tar.gz gnunet-c86189f006cdc1022cbdba8acb3710b04c4e9a30.zip |
- timing log
Diffstat (limited to 'src/mesh/gnunet-service-mesh_tunnel.c')
-rw-r--r-- | src/mesh/gnunet-service-mesh_tunnel.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/mesh/gnunet-service-mesh_tunnel.c b/src/mesh/gnunet-service-mesh_tunnel.c index 61a66a7b2..3224c9939 100644 --- a/src/mesh/gnunet-service-mesh_tunnel.c +++ b/src/mesh/gnunet-service-mesh_tunnel.c | |||
@@ -507,9 +507,15 @@ t_encrypt (struct MeshTunnel3 *t, | |||
507 | size_t size, uint32_t iv) | 507 | size_t size, uint32_t iv) |
508 | { | 508 | { |
509 | struct GNUNET_CRYPTO_SymmetricInitializationVector siv; | 509 | struct GNUNET_CRYPTO_SymmetricInitializationVector siv; |
510 | size_t out_size; | ||
510 | 511 | ||
511 | GNUNET_CRYPTO_symmetric_derive_iv (&siv, &t->e_key, &iv, sizeof (uint32_t), NULL); | 512 | LOG (GNUNET_ERROR_TYPE_DEBUG, " t_encrypt start\n"); |
512 | return GNUNET_CRYPTO_symmetric_encrypt (src, size, &t->e_key, &siv, dst); | 513 | GNUNET_CRYPTO_symmetric_derive_iv (&siv, &t->e_key, &iv, sizeof (iv), NULL); |
514 | LOG (GNUNET_ERROR_TYPE_DEBUG, " t_encrypt IV derived\n"); | ||
515 | out_size = GNUNET_CRYPTO_symmetric_encrypt (src, size, &t->e_key, &siv, dst); | ||
516 | LOG (GNUNET_ERROR_TYPE_DEBUG, " t_encrypt end\n"); | ||
517 | |||
518 | return out_size; | ||
513 | } | 519 | } |
514 | 520 | ||
515 | 521 | ||
@@ -529,7 +535,9 @@ t_decrypt (struct MeshTunnel3 *t, | |||
529 | { | 535 | { |
530 | struct GNUNET_CRYPTO_SymmetricInitializationVector siv; | 536 | struct GNUNET_CRYPTO_SymmetricInitializationVector siv; |
531 | struct GNUNET_CRYPTO_SymmetricSessionKey *key; | 537 | struct GNUNET_CRYPTO_SymmetricSessionKey *key; |
538 | size_t out_size; | ||
532 | 539 | ||
540 | LOG (GNUNET_ERROR_TYPE_DEBUG, " t_decrypt start\n"); | ||
533 | if (t->estate == MESH_TUNNEL3_KEY_OK || t->estate == MESH_TUNNEL3_KEY_PING) | 541 | if (t->estate == MESH_TUNNEL3_KEY_OK || t->estate == MESH_TUNNEL3_KEY_PING) |
534 | { | 542 | { |
535 | key = &t->d_key; | 543 | key = &t->d_key; |
@@ -548,8 +556,13 @@ t_decrypt (struct MeshTunnel3 *t, | |||
548 | return 0; | 556 | return 0; |
549 | } | 557 | } |
550 | 558 | ||
551 | GNUNET_CRYPTO_symmetric_derive_iv (&siv, key, &iv, sizeof (uint32_t), NULL); | 559 | LOG (GNUNET_ERROR_TYPE_DEBUG, " t_decrypt iv\n"); |
552 | return GNUNET_CRYPTO_symmetric_decrypt (src, size, key, &siv, dst); | 560 | GNUNET_CRYPTO_symmetric_derive_iv (&siv, key, &iv, sizeof (iv), NULL); |
561 | LOG (GNUNET_ERROR_TYPE_DEBUG, " t_decrypt iv done\n"); | ||
562 | out_size = GNUNET_CRYPTO_symmetric_decrypt (src, size, key, &siv, dst); | ||
563 | LOG (GNUNET_ERROR_TYPE_DEBUG, " t_decrypt end\n"); | ||
564 | |||
565 | return out_size; | ||
553 | } | 566 | } |
554 | 567 | ||
555 | 568 | ||