- esp_main_t *em = &esp_main;
- u32 thread_index = vlib_get_thread_index ();
-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
- HMAC_CTX *ctx = em->per_thread_data[thread_index].hmac_ctx;
-#else
- HMAC_CTX *ctx = &(em->per_thread_data[thread_index].hmac_ctx);
-#endif
- const EVP_MD *md = NULL;
- unsigned int len;
-
- ASSERT (alg < IPSEC_INTEG_N_ALG);
-
- if (PREDICT_FALSE (em->esp_integ_algs[alg].md == 0))
- return 0;
-
- if (PREDICT_FALSE (alg != em->per_thread_data[thread_index].last_integ_alg))
- {
- md = em->esp_integ_algs[alg].md;
- em->per_thread_data[thread_index].last_integ_alg = alg;
- }
-
- HMAC_Init_ex (ctx, key, key_len, md, NULL);
-
- HMAC_Update (ctx, data, data_len);
-
- if (PREDICT_TRUE (use_esn))
- HMAC_Update (ctx, (u8 *) & seq_hi, sizeof (seq_hi));
- HMAC_Final (ctx, signature, &len);
-
- return em->esp_integ_algs[alg].trunc_size;
-}
+ /* esp post node index for async crypto */
+ u32 esp4_post_next;
+ u32 esp6_post_next;
+ u32 esp4_tun_post_next;
+ u32 esp6_tun_post_next;
+ u32 esp_mpls_tun_post_next;
+} esp_async_post_next_t;
+
+extern esp_async_post_next_t esp_encrypt_async_next;
+extern esp_async_post_next_t esp_decrypt_async_next;