+/**
+ * Derive an IV from packet information
+ */
+static void
+derive_iv (struct GNUNET_CRYPTO_AesInitializationVector *iv,
+ const struct GNUNET_CRYPTO_AesSessionKey *skey, uint32_t seed,
+ const struct GNUNET_PeerIdentity *identity)
+{
+ static char ctx[] = "initialization vector";
+
+ GNUNET_CRYPTO_aes_derive_iv (iv,
+ skey,
+ &seed,
+ sizeof(seed),
+ &identity->hashPubKey.bits,
+ sizeof(identity->hashPubKey.bits),
+ ctx,
+ sizeof(ctx), NULL);
+}
+
+/**
+ * Derive an IV from pong packet information
+ */
+static void
+derive_pong_iv (struct GNUNET_CRYPTO_AesInitializationVector *iv,
+ const struct GNUNET_CRYPTO_AesSessionKey *skey, uint32_t seed,
+ uint32_t challenge, const struct GNUNET_PeerIdentity *identity)
+{
+ static char ctx[] = "pong initialization vector";
+
+ GNUNET_CRYPTO_aes_derive_iv (iv,
+ skey,
+ &seed,
+ sizeof(seed),
+ &identity->hashPubKey.bits,
+ sizeof(identity->hashPubKey.bits),
+ &challenge,
+ sizeof(challenge),
+ ctx,
+ sizeof(ctx), NULL);
+}
+
+