aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/crypto_ipsecmb/ipsecmb.c
diff options
context:
space:
mode:
authorFan Zhang <roy.fan.zhang@intel.com>2019-11-22 11:40:23 +0000
committerDamjan Marion <dmarion@me.com>2019-11-22 18:37:10 +0000
commita7f81b75e60418a95988c0aac88c222f3cac38ba (patch)
tree1d531bf990b3457f6531aa086795c674b6755dcc /src/plugins/crypto_ipsecmb/ipsecmb.c
parent9ce35233658d6c19a4458ec7e728b6ee75fd3ace (diff)
crypto-ipsecmb: use single GCM API
Type: refactor Use ipsecmb single GCM enc/dec API to furthuer improve single buffer performance for small packets. Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com> Change-Id: I2d34ff50d34b09f194fc0c88b6e9a3928a86fc33
Diffstat (limited to 'src/plugins/crypto_ipsecmb/ipsecmb.c')
-rw-r--r--src/plugins/crypto_ipsecmb/ipsecmb.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/plugins/crypto_ipsecmb/ipsecmb.c b/src/plugins/crypto_ipsecmb/ipsecmb.c
index 30f53389553..a9edd98e87f 100644
--- a/src/plugins/crypto_ipsecmb/ipsecmb.c
+++ b/src/plugins/crypto_ipsecmb/ipsecmb.c
@@ -279,9 +279,8 @@ ipsecmb_ops_gcm_cipher_enc_##a (vlib_main_t * vm, vnet_crypto_op_t * ops[], \
vnet_crypto_op_t *op = ops[i]; \
\
kd = (struct gcm_key_data *) imbm->key_data[op->key_index]; \
- IMB_AES##b##_GCM_INIT(m, kd, &ctx, op->iv, op->aad, op->aad_len); \
- IMB_AES##b##_GCM_ENC_UPDATE(m, kd, &ctx, op->dst, op->src, op->len); \
- IMB_AES##b##_GCM_ENC_FINALIZE(m, kd, &ctx, op->tag, op->tag_len); \
+ IMB_AES##b##_GCM_ENC (m, kd, &ctx, op->dst, op->src, op->len, op->iv, \
+ op->aad, op->aad_len, op->tag, op->tag_len); \
\
op->status = VNET_CRYPTO_OP_STATUS_COMPLETED; \
} \
@@ -307,9 +306,8 @@ ipsecmb_ops_gcm_cipher_dec_##a (vlib_main_t * vm, vnet_crypto_op_t * ops[], \
u8 scratch[64]; \
\
kd = (struct gcm_key_data *) imbm->key_data[op->key_index]; \
- IMB_AES##b##_GCM_INIT(m, kd, &ctx, op->iv, op->aad, op->aad_len); \
- IMB_AES##b##_GCM_DEC_UPDATE(m, kd, &ctx, op->dst, op->src, op->len); \
- IMB_AES##b##_GCM_DEC_FINALIZE(m, kd, &ctx, scratch, op->tag_len); \
+ IMB_AES##b##_GCM_DEC (m, kd, &ctx, op->dst, op->src, op->len, op->iv, \
+ op->aad, op->aad_len, scratch, op->tag_len); \
\
if ((memcmp (op->tag, scratch, op->tag_len))) \
{ \