aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2016-11-04 09:47:28 +0000
committerBart Polot <bart@net.in.tum.de>2016-11-04 09:47:28 +0000
commit33a50a0010510321ce14fefae297b7618c18b5dd (patch)
tree155e8a5d6a2971c629bb2c574b2622b19f6edbad
parent2e485ccc97cd07dac659cf37c9208cbf80fb18e0 (diff)
downloadgnunet-33a50a0010510321ce14fefae297b7618c18b5dd.tar.gz
gnunet-33a50a0010510321ce14fefae297b7618c18b5dd.zip
- use timing macro instead of log
-rw-r--r--src/cadet/gnunet-service-cadet_tunnel.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/cadet/gnunet-service-cadet_tunnel.c b/src/cadet/gnunet-service-cadet_tunnel.c
index e47d0bc96..5b07e42c0 100644
--- a/src/cadet/gnunet-service-cadet_tunnel.c
+++ b/src/cadet/gnunet-service-cadet_tunnel.c
@@ -734,7 +734,6 @@ t_ax_encrypt (struct CadetTunnel *t, void *dst, const void *src, size_t size)
734 734
735 CADET_TIMING_START; 735 CADET_TIMING_START;
736 736
737 LOG (GNUNET_ERROR_TYPE_DEBUG, " t_ax_encrypt start\n");
738 ax = t->ax; 737 ax = t->ax;
739 ax->ratchet_counter++; 738 ax->ratchet_counter++;
740 if (GNUNET_YES == ax->ratchet_allowed 739 if (GNUNET_YES == ax->ratchet_allowed
@@ -810,7 +809,7 @@ t_ax_decrypt (struct CadetTunnel *t, void *dst, const void *src, size_t size)
810 struct CadetTunnelAxolotl *ax; 809 struct CadetTunnelAxolotl *ax;
811 size_t out_size; 810 size_t out_size;
812 811
813 LOG (GNUNET_ERROR_TYPE_DEBUG, " t_ax_decrypt start\n"); 812 CADET_TIMING_START;
814 813
815 ax = t->ax; 814 ax = t->ax;
816 815
@@ -830,7 +829,7 @@ t_ax_decrypt (struct CadetTunnel *t, void *dst, const void *src, size_t size)
830 829
831 t_hmac_derive_key (&ax->CKr, &ax->CKr, "1", 1); 830 t_hmac_derive_key (&ax->CKr, &ax->CKr, "1", 1);
832 831
833 LOG (GNUNET_ERROR_TYPE_DEBUG, " t_ax_decrypt end\n"); 832 CADET_TIMING_END;
834 833
835 return out_size; 834 return out_size;
836} 835}
@@ -849,8 +848,7 @@ t_h_encrypt (struct CadetTunnel *t, struct GNUNET_CADET_Encrypted *msg)
849 struct CadetTunnelAxolotl *ax; 848 struct CadetTunnelAxolotl *ax;
850 size_t out_size; 849 size_t out_size;
851 850
852 LOG (GNUNET_ERROR_TYPE_DEBUG, " t_h_encrypt start\n"); 851 CADET_TIMING_START;
853
854 ax = t->ax; 852 ax = t->ax;
855 GNUNET_CRYPTO_symmetric_derive_iv (&iv, &ax->HKs, NULL, 0, NULL); 853 GNUNET_CRYPTO_symmetric_derive_iv (&iv, &ax->HKs, NULL, 0, NULL);
856 854
@@ -863,8 +861,7 @@ t_h_encrypt (struct CadetTunnel *t, struct GNUNET_CADET_Encrypted *msg)
863 &ax->HKs, &iv, &msg->Ns); 861 &ax->HKs, &iv, &msg->Ns);
864 862
865 GNUNET_assert (AX_HEADER_SIZE == out_size); 863 GNUNET_assert (AX_HEADER_SIZE == out_size);
866 864 CADET_TIMING_END;
867 LOG (GNUNET_ERROR_TYPE_DEBUG, " t_ax_encrypt end\n");
868} 865}
869 866
870 867
@@ -883,7 +880,7 @@ t_h_decrypt (struct CadetTunnel *t, const struct GNUNET_CADET_Encrypted *src,
883 struct CadetTunnelAxolotl *ax; 880 struct CadetTunnelAxolotl *ax;
884 size_t out_size; 881 size_t out_size;
885 882
886 LOG (GNUNET_ERROR_TYPE_DEBUG, " t_h_decrypt start\n"); 883 CADET_TIMING_START;
887 884
888 ax = t->ax; 885 ax = t->ax;
889 GNUNET_CRYPTO_symmetric_derive_iv (&iv, &ax->HKr, NULL, 0, NULL); 886 GNUNET_CRYPTO_symmetric_derive_iv (&iv, &ax->HKr, NULL, 0, NULL);
@@ -898,7 +895,7 @@ t_h_decrypt (struct CadetTunnel *t, const struct GNUNET_CADET_Encrypted *src,
898 895
899 GNUNET_assert (AX_HEADER_SIZE == out_size); 896 GNUNET_assert (AX_HEADER_SIZE == out_size);
900 897
901 LOG (GNUNET_ERROR_TYPE_DEBUG, " t_h_decrypt end\n"); 898 CADET_TIMING_END;
902} 899}
903 900
904 901