diff options
author | Janne Peltonen <janne.peltonen@nokia.com> | 2021-06-21 13:54:13 +0300 |
---|---|---|
committer | Petri Savolainen <petri.savolainen@nokia.com> | 2021-07-08 15:53:53 +0300 |
commit | d390fe72999e3c06ff45d3c0c6cd569f4e5858c2 (patch) | |
tree | 765142ec5c9064701da0104cbd47c6a9104742ef /helper/include | |
parent | a454f3b8856bf30e191d28f665b195ee15555f1b (diff) |
helper: ipsec: check ICV length when checking auth capability
When checking IPsec algorithm support, check that the default ICV length
is supported. This patch does not add support for non-default ICV lengths
in the helper.
Add a helper function that returns the default ICV length for an algorithm.
Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com>
Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Anoob Joseph <anoobj@marvell.com>
Diffstat (limited to 'helper/include')
-rw-r--r-- | helper/include/odp/helper/ipsec.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/helper/include/odp/helper/ipsec.h b/helper/include/odp/helper/ipsec.h index 66bed5399..1b2dbb77b 100644 --- a/helper/include/odp/helper/ipsec.h +++ b/helper/include/odp/helper/ipsec.h @@ -1,4 +1,5 @@ /* Copyright (c) 2014-2018, Linaro Limited + * Copyright (c) 2021, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -74,9 +75,9 @@ ODP_STATIC_ASSERT(sizeof(odph_ahhdr_t) == ODPH_AHHDR_LEN, * Check IPSEC algorithm support * * Based on the capabilities exposed by the ODP implementation, check whether - * the specified IPSEC algorithm configuration is supported by the - * implementation. The caller provides the IPSEC capability structure as an - * argument to the helper function. + * the specified IPSEC algorithm configuration with the default ICV length + * is supported by the implementation. The caller provides the IPSEC + * capability structure as an argument to the helper function. * * @param capa IPSEC capability structure * @param cipher_alg Cipher algorithm @@ -94,6 +95,18 @@ int odph_ipsec_alg_check(odp_ipsec_capability_t capa, uint32_t auth_key_len); /** + * Return the default ICV length of an algorithm + * + * IPsec API specifies default ICV length for each authentication and + * combined mode algorithm. This function returns the default ICV length. + * + * @param auth_alg Authentication algorithm + * + * @return The default ICV length in bytes + */ +uint32_t odph_ipsec_auth_icv_len_default(odp_auth_alg_t auth_alg); + +/** * @} */ |