[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r35617 - gnunet/src/cadet
From: |
gnunet |
Subject: |
[GNUnet-SVN] r35617 - gnunet/src/cadet |
Date: |
Mon, 27 Apr 2015 21:15:08 +0200 |
Author: bartpolot
Date: 2015-04-27 21:15:08 +0200 (Mon, 27 Apr 2015)
New Revision: 35617
Modified:
gnunet/src/cadet/gnunet-service-cadet_tunnel.c
Log:
- implement ratchet advance
Modified: gnunet/src/cadet/gnunet-service-cadet_tunnel.c
===================================================================
--- gnunet/src/cadet/gnunet-service-cadet_tunnel.c 2015-04-27 19:15:06 UTC
(rev 35616)
+++ gnunet/src/cadet/gnunet-service-cadet_tunnel.c 2015-04-27 19:15:08 UTC
(rev 35617)
@@ -987,6 +987,26 @@
if (GNUNET_YES == ax->ratchet_flag)
{
/* Advance ratchet */
+ struct GNUNET_CRYPTO_SymmetricSessionKey keys[3];
+ struct GNUNET_HashCode dh;
+ struct GNUNET_HashCode hmac;
+ static const char ctx[] = "axolotl ratchet";
+
+ ax->DHRs = GNUNET_CRYPTO_ecdhe_key_create ();
+ ax->HKs = ax->NHKs;
+
+ /* RK, NHKs, CKs = KDF( HMAC-HASH(RK, DH(DHRs, DHRr)) ) */
+ GNUNET_CRYPTO_ecc_ecdh (&ax->DHRs, &ax->DHRr, &dh);
+ t_ax_hmac_hash (&ax->RK, &hmac, &dh, sizeof (dh));
+ GNUNET_CRYPTO_kdf (keys, sizeof (keys), ctx, sizeof (ctx),
+ &hmac, sizeof (hmac), NULL);
+ ax->RK = keys[0];
+ ax->NHKs = keys[1];
+ ax->CKs = keys[2];
+
+ ax->PNs = ax->Ns;
+ ax->Ns = 0;
+ ax->ratchet_flag = GNUNET_NO;
}
t_hmac_derive_key (&ax->CKs, &MK, "0", 1);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r35617 - gnunet/src/cadet,
gnunet <=