1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2016-2017 Intel Corporation
5 #ifndef _AESNI_GCM_OPS_H_
6 #define _AESNI_GCM_OPS_H_
12 #include <intel-ipsec-mb.h>
14 /** Supported vector modes */
15 enum aesni_gcm_vector_mode {
16 RTE_AESNI_GCM_NOT_SUPPORTED = 0,
21 RTE_AESNI_GCM_VECTOR_NUM
31 typedef void (*aesni_gcm_t)(const struct gcm_key_data *gcm_key_data,
32 struct gcm_context_data *gcm_ctx_data, uint8_t *out,
33 const uint8_t *in, uint64_t plaintext_len, const uint8_t *iv,
34 const uint8_t *aad, uint64_t aad_len,
35 uint8_t *auth_tag, uint64_t auth_tag_len);
37 typedef void (*aesni_gcm_pre_t)(const void *key, struct gcm_key_data *gcm_data);
39 typedef void (*aesni_gcm_init_t)(const struct gcm_key_data *gcm_key_data,
40 struct gcm_context_data *gcm_ctx_data,
45 typedef void (*aesni_gcm_update_t)(const struct gcm_key_data *gcm_key_data,
46 struct gcm_context_data *gcm_ctx_data,
49 uint64_t plaintext_len);
51 typedef void (*aesni_gcm_finalize_t)(const struct gcm_key_data *gcm_key_data,
52 struct gcm_context_data *gcm_ctx_data,
54 uint64_t auth_tag_len);
56 /** GCM library function pointer table */
57 struct aesni_gcm_ops {
58 aesni_gcm_t enc; /**< GCM encode function pointer */
59 aesni_gcm_t dec; /**< GCM decode function pointer */
60 aesni_gcm_pre_t pre; /**< GCM pre-compute */
61 aesni_gcm_init_t init;
62 aesni_gcm_update_t update_enc;
63 aesni_gcm_update_t update_dec;
64 aesni_gcm_finalize_t finalize_enc;
65 aesni_gcm_finalize_t finalize_dec;
68 #endif /* _AESNI_GCM_OPS_H_ */