This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, next has been updated via c1201795da7e0b21e63c496ff632af02b10dc7d1 (commit) via d39b01ce075fa73386096d5960762741fb2805f6 (commit) via 253681892e97ee0f4f7a5c1c1a27b4b336833bcb (commit) via ffce96cbcdef44fe089746e9fc06f982ecdb1932 (commit) via af4a068fa640f50dd72ebcb5ac02ca1510d4119e (commit) via cd14a67e875c4edb809c5e9c4f1f3e9a018b3c91 (commit) via 4d619768d75e4e1c15bb1be7fe282dff532f166b (commit) from c951ba0386581a87675477456e3df0010f2eac66 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit c1201795da7e0b21e63c496ff632af02b10dc7d1 Author: Petri Savolainen petri.savolainen@linaro.org Date: Thu Mar 30 16:58:55 2017 +0300
test: crypto: remove references to deprecated crypto apis
Remove last remaining references to deprecated API definitions.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/example/ipsec/odp_ipsec_misc.h b/example/ipsec/odp_ipsec_misc.h index e0320eb4..45cb022e 100644 --- a/example/ipsec/odp_ipsec_misc.h +++ b/example/ipsec/odp_ipsec_misc.h @@ -98,10 +98,10 @@ int parse_key_string(char *keystring, key->length = key_bits_in / 8;
} else { - if ((alg->u.auth == ODP_AUTH_ALG_MD5_96) && + if ((alg->u.auth == ODP_AUTH_ALG_MD5_HMAC) && (KEY_BITS_MD5_96 == key_bits_in)) key->length = key_bits_in / 8; - else if ((alg->u.auth == ODP_AUTH_ALG_SHA256_128) && + else if ((alg->u.auth == ODP_AUTH_ALG_SHA256_HMAC) && (KEY_BITS_SHA256_128 == key_bits_in)) key->length = key_bits_in / 8; } diff --git a/example/ipsec/odp_ipsec_sa_db.c b/example/ipsec/odp_ipsec_sa_db.c index 28215b5b..10bbcb8f 100644 --- a/example/ipsec/odp_ipsec_sa_db.c +++ b/example/ipsec/odp_ipsec_sa_db.c @@ -111,11 +111,11 @@ int create_sa_db_entry(char *input, odp_bool_t cipher) } else { if (0 == strcmp(token, "md5")) { entry->alg.u.auth = - ODP_AUTH_ALG_MD5_96; + ODP_AUTH_ALG_MD5_HMAC; entry->icv_len = 12; } else if (!strcmp(token, "sha256")) { entry->alg.u.auth = - ODP_AUTH_ALG_SHA256_128; + ODP_AUTH_ALG_SHA256_HMAC; entry->icv_len = 16; } else { entry->alg.u.auth = ODP_AUTH_ALG_NULL; diff --git a/example/ipsec/odp_ipsec_stream.c b/example/ipsec/odp_ipsec_stream.c index 428ec04d..15087cbe 100644 --- a/example/ipsec/odp_ipsec_stream.c +++ b/example/ipsec/odp_ipsec_stream.c @@ -227,8 +227,8 @@ odp_packet_t create_ipv4_packet(stream_db_entry_t *stream, /* AH (if specified) */ if (entry && (entry == stream->input.entry) && (ODP_AUTH_ALG_NULL != entry->ah.alg)) { - if (entry->ah.alg != ODP_AUTH_ALG_MD5_96 && - entry->ah.alg != ODP_AUTH_ALG_SHA256_128) + if (entry->ah.alg != ODP_AUTH_ALG_MD5_HMAC && + entry->ah.alg != ODP_AUTH_ALG_SHA256_HMAC) abort();
ah = (odph_ahhdr_t *)data; @@ -424,7 +424,7 @@ odp_bool_t verify_ipv4_packet(stream_db_entry_t *stream, return FALSE; if (odp_be_to_cpu_32(ah->spi) != entry->ah.spi) return FALSE; - if (ODP_AUTH_ALG_MD5_96 != entry->ah.alg) + if (ODP_AUTH_ALG_MD5_HMAC != entry->ah.alg) abort(); } else { if (entry && (ODP_AUTH_ALG_NULL != entry->ah.alg)) diff --git a/test/common_plat/performance/odp_crypto.c b/test/common_plat/performance/odp_crypto.c index 954bdb79..b3857973 100644 --- a/test/common_plat/performance/odp_crypto.c +++ b/test/common_plat/performance/odp_crypto.c @@ -205,7 +205,7 @@ static crypto_alg_config_t algs_config[] = { .data = test_iv, .length = 8, }, - .auth_alg = ODP_AUTH_ALG_MD5_96, + .auth_alg = ODP_AUTH_ALG_MD5_HMAC, .auth_key = { .data = test_key16, .length = sizeof(test_key16) @@ -217,7 +217,7 @@ static crypto_alg_config_t algs_config[] = { .name = "null-hmac-md5-96", .session = { .cipher_alg = ODP_CIPHER_ALG_NULL, - .auth_alg = ODP_AUTH_ALG_MD5_96, + .auth_alg = ODP_AUTH_ALG_MD5_HMAC, .auth_key = { .data = test_key16, .length = sizeof(test_key16)
commit d39b01ce075fa73386096d5960762741fb2805f6 Author: Petri Savolainen petri.savolainen@linaro.org Date: Thu Mar 30 16:58:54 2017 +0300
api: deprecated: add configure option and macros
Added configuration option --enable-deprecated to control if deprecated APIs are enabled or disabled.
Added ODP_DEPRECATED_API macro into the API. Its value can be used to check if deprecated API definitions are enabled or disabled. Deprecated APIs are disabled by default. Deprecated APIs are meant to be removed completely in a later API version.
Added ODP_DEPRECATE() macro to enforce deprecation of API definitions. When deprecated APIs are disabled, the macro renames API definitions so that application cannot use those any more, but a single implementation library can serve applications built with both options.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/configure.ac b/configure.ac index 7569ebe0..0743f761 100644 --- a/configure.ac +++ b/configure.ac @@ -16,7 +16,8 @@ ODP_VERSION_API_MAJOR=odpapi_major_version AC_SUBST(ODP_VERSION_API_MAJOR) ODP_VERSION_API_MINOR=odpapi_minor_version AC_SUBST(ODP_VERSION_API_MINOR) -AC_CONFIG_FILES([include/odp/api/spec/version.h]) +AC_CONFIG_FILES([include/odp/api/spec/version.h + include/odp/api/spec/deprecated.h])
AM_INIT_AUTOMAKE([1.9 tar-pax subdir-objects]) AC_CONFIG_SRCDIR([helper/config.h.in]) @@ -283,7 +284,7 @@ ODP_CFLAGS="$ODP_CFLAGS -DODP_DEBUG=$ODP_DEBUG" ODP_ABI_COMPAT=1 abi_compat=yes AC_ARG_ENABLE([abi-compat], - [ --disable-abi-compat disables ABI compatible mode, enables inline code in header files], + [ --disable-abi-compat disables ABI compatible mode, enables inline code in header files], [if test "x$enableval" = "xno"; then ODP_ABI_COMPAT=0 abi_compat=no @@ -293,6 +294,19 @@ AC_ARG_ENABLE([abi-compat], AC_SUBST(ODP_ABI_COMPAT)
########################################################################## +# Enable/disable deprecated API definitions +########################################################################## +ODP_DEPRECATED_API=0 +deprecated=no +AC_ARG_ENABLE([deprecated], + [ --enable-deprecated enable deprecated API definitions], + [if test "x$enableval" = "xyes"; then + ODP_DEPRECATED_API=1 + deprecated=yes + fi]) +AC_SUBST(ODP_DEPRECATED_API) + +########################################################################## # Default warning setup ########################################################################## ODP_CFLAGS="$ODP_CFLAGS -W -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes" @@ -382,6 +396,7 @@ AC_MSG_RESULT([ static libraries: ${enable_static} shared libraries: ${enable_shared} ABI compatible: ${abi_compat} + Deprecated APIs: ${deprecated} cunit: ${cunit_support} test_vald: ${test_vald} test_perf: ${test_perf} diff --git a/doc/application-api-guide/api_guide_lines.dox b/doc/application-api-guide/api_guide_lines.dox index 394e9582..a6488c32 100644 --- a/doc/application-api-guide/api_guide_lines.dox +++ b/doc/application-api-guide/api_guide_lines.dox @@ -75,7 +75,7 @@ The former is a compile-time assertion and hence adds no additional path length. The latter is controlled by the ODP_NO_DEBUG compile-time switch and so is suitable for use in development/debug builds that can be compiled out for production use. Other mechanisms available to the implementer are: - ODP_ABORT() is provided for situations where further execution of the code must not occur and a level of tracing information should be left in the log. - - ODP_DEPRECATED() is used to signify that a call is planned for obsolescence. + - ODP_DEPRECATE() is used to signify that a call is planned for obsolescence. - ODP_LOG() is used to direct implementation messages to the application.
@@ -197,8 +197,8 @@ This is one of the reasons why some features MAY be defined as OPTIONAL. While allowed, the proliferation of OPTIONAL features SHOULD be avoided to enable broad application portability across many implementations. At the same time, a "least common denominator" approach MUST NOT be taken as that defeats the purpose of providing higher-level abstractions in APIs.
-@subsection odp_deprecated ODP DEPRECATED -A deprecated API will remain marked as such in the public API using #ODP_DEPRECATED for two release cycles for the #ODP_VERSION_API_MAJOR number. +@subsection odp_deprecate ODP DEPRECATE +A deprecated API will remain marked as such in the public API using #ODP_DEPRECATE() for two release cycles for the #ODP_VERSION_API_MAJOR number. For example an API marked as deprecated in 1.1.0 will still be present in 1.2.0 and removed in 1.3.0. A deprecated API will contain the doxygen tag @deprecated with a description of the reason for the change.
diff --git a/doc/platform-api-guide/Doxyfile b/doc/platform-api-guide/Doxyfile index 93f6edfe..12d356e3 100644 --- a/doc/platform-api-guide/Doxyfile +++ b/doc/platform-api-guide/Doxyfile @@ -17,4 +17,5 @@ PREDEFINED = __GNUC__ \ __LITTLE_ENDIAN_BITFIELD \ __x86_64__ \ ODP_PACKED \ + ODP_DEPRECATE(x)=x \ "ODP_HANDLE_T(type)=odp_handle_t type" diff --git a/doc/process-guide/release-guide.adoc b/doc/process-guide/release-guide.adoc index 8ea147af..595af91a 100644 --- a/doc/process-guide/release-guide.adoc +++ b/doc/process-guide/release-guide.adoc @@ -251,7 +251,7 @@ Deleting or changing the published API follows the normal <<anchor-1,process>>, * A deprecated indication is applied to the old API using the @deprecated doxygen syntax. * For a function change the old API it is additionally marked using the -ODP_DEPRECATED preprocessor macro. +ODP_DEPRECATE() preprocessor macro. * The CHANGELOG will have an entry in the API change section. * The Release Manager will resolve the duration for which the deprecated API. will be supported, and determine which future release it will be applied to. + @@ -275,7 +275,7 @@ The new API must have comparable coverage to the old API. * * @param name ... */ -odp_foo_t odp_foo_create(const char *name) ODP_DEPRECATED; +odp_foo_t ODP_DEPRECATE(odp_foo_create)(const char *name);
/** * Create a bar @@ -298,7 +298,7 @@ compiler warning. * * @param name ... */ -odp_foo_t odp_foo_create(const char *name) ODP_DEPRECATED; +odp_foo_t ODP_DEPRECATE(odp_foo_create)(const char *name); ----
=== Changing a struct member diff --git a/include/odp/api/spec/.gitignore b/include/odp/api/spec/.gitignore index 67020331..df9c87d9 100644 --- a/include/odp/api/spec/.gitignore +++ b/include/odp/api/spec/.gitignore @@ -1 +1,2 @@ +deprecated.h version.h diff --git a/include/odp/api/spec/deprecated.h.in b/include/odp/api/spec/deprecated.h.in new file mode 100644 index 00000000..224f60ff --- /dev/null +++ b/include/odp/api/spec/deprecated.h.in @@ -0,0 +1,50 @@ +/* Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * Macro for deprecated API definitions + */ + +#ifndef ODP_API_DEPRECATED_H_ +#define ODP_API_DEPRECATED_H_ +#include <odp/visibility_begin.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Deprecated API definitions + * + * Some API definitions may be deprecated by this or a previous API version. + * This macro controls if those are enabled (and visible to the application) + * or disabled. + * + * * 0: Deprecated API definitions are disabled (default) + * * 1: Deprecated API definitions are enabled + */ +#define ODP_DEPRECATED_API @ODP_DEPRECATED_API@ + +/** + * @def ODP_DEPRECATE + * + * Macro to deprecate API definitions + */ + +#if ODP_DEPRECATED_API +#define ODP_DEPRECATE(x) x +#else +#define ODP_DEPRECATE(x) _deprecated_ ## x +#endif + +#ifdef __cplusplus +} +#endif + +#include <odp/visibility_end.h> +#endif diff --git a/include/odp_api.h b/include/odp_api.h index ec7fcd2e..060ec888 100644 --- a/include/odp_api.h +++ b/include/odp_api.h @@ -18,6 +18,7 @@ extern "C" { #endif
+#include <odp/api/deprecated.h> #include <odp/api/version.h> #include <odp/api/std_types.h> #include <odp/api/compiler.h> diff --git a/platform/Makefile.inc b/platform/Makefile.inc index 7059d910..59a57724 100644 --- a/platform/Makefile.inc +++ b/platform/Makefile.inc @@ -29,6 +29,7 @@ odpapispecinclude_HEADERS = \ $(top_srcdir)/include/odp/api/spec/cpumask.h \ $(top_srcdir)/include/odp/api/spec/crypto.h \ $(top_srcdir)/include/odp/api/spec/debug.h \ + $(top_srcdir)/include/odp/api/spec/deprecated.h \ $(top_srcdir)/include/odp/api/spec/errno.h \ $(top_srcdir)/include/odp/api/spec/event.h \ $(top_srcdir)/include/odp/api/spec/hash.h \ diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 69fdf8b9..22c3247e 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -33,6 +33,7 @@ odpapiinclude_HEADERS = \ $(srcdir)/include/odp/api/cpumask.h \ $(srcdir)/include/odp/api/crypto.h \ $(srcdir)/include/odp/api/debug.h \ + $(srcdir)/include/odp/api/deprecated.h \ $(srcdir)/include/odp/api/errno.h \ $(srcdir)/include/odp/api/event.h \ $(srcdir)/include/odp/api/hash.h \ diff --git a/platform/linux-generic/include/odp/api/deprecated.h b/platform/linux-generic/include/odp/api/deprecated.h new file mode 100644 index 00000000..82797ebc --- /dev/null +++ b/platform/linux-generic/include/odp/api/deprecated.h @@ -0,0 +1,26 @@ +/* Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * Control deprecated API definitions + */ + +#ifndef ODP_PLAT_DEPRECATED_H_ +#define ODP_PLAT_DEPRECATED_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <odp/api/spec/deprecated.h> + +#ifdef __cplusplus +} +#endif + +#endif
commit 253681892e97ee0f4f7a5c1c1a27b4b336833bcb Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Thu May 4 14:30:50 2017 +0300
api: packet: introduce odp_packet_data_range_t
Rename odp_crypto_data_range_t to odp_packet_data_range_t, as it is relevant not only to the crypto interface.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h index 1f83e819..c47d3149 100644 --- a/include/odp/api/spec/crypto.h +++ b/include/odp/api/spec/crypto.h @@ -21,6 +21,8 @@ extern "C" { #endif
+#include <odp/api/packet.h> + /** @defgroup odp_crypto ODP CRYPTO * Macros, enums, types and operations to utilise crypto. * @{ @@ -243,15 +245,10 @@ typedef struct odp_crypto_iv {
/** * Crypto API data range specifier + * + * @deprecated Use odp_packet_data_range_t instead */ -typedef struct odp_crypto_data_range { - /** Offset from beginning of packet */ - uint32_t offset; - - /** Length of data to operate on */ - uint32_t length; - -} odp_crypto_data_range_t; +typedef odp_packet_data_range_t ODP_DEPRECATE(odp_crypto_data_range_t);
/** * Crypto API session creation parameters @@ -386,10 +383,10 @@ typedef struct odp_crypto_op_param_t { } aad;
/** Data range to apply cipher */ - odp_crypto_data_range_t cipher_range; + odp_packet_data_range_t cipher_range;
/** Data range to authenticate */ - odp_crypto_data_range_t auth_range; + odp_packet_data_range_t auth_range;
} odp_crypto_op_param_t;
diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h index 92c35ae6..79d8773e 100644 --- a/include/odp/api/spec/packet.h +++ b/include/odp/api/spec/packet.h @@ -71,6 +71,18 @@ extern "C" { * Packet is red */
+/** + * Packet API data range specifier + */ +typedef struct odp_packet_data_range { + /** Offset from beginning of packet */ + uint32_t offset; + + /** Length of data to operate on */ + uint32_t length; + +} odp_packet_data_range_t; + /* * * Alloc and free diff --git a/test/common_plat/validation/api/crypto/odp_crypto_test_inp.c b/test/common_plat/validation/api/crypto/odp_crypto_test_inp.c index a415f5c1..57e7c0e0 100644 --- a/test/common_plat/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/common_plat/validation/api/crypto/odp_crypto_test_inp.c @@ -72,8 +72,8 @@ static void alg_test(odp_crypto_op_t op, odp_crypto_key_t cipher_key, odp_auth_alg_t auth_alg, odp_crypto_key_t auth_key, - odp_crypto_data_range_t *cipher_range, - odp_crypto_data_range_t *auth_range, + odp_packet_data_range_t *cipher_range, + odp_packet_data_range_t *auth_range, const uint8_t *plaintext, unsigned int plaintext_len, const uint8_t *ciphertext, diff --git a/test/common_plat/validation/api/crypto/test_vectors.h b/test/common_plat/validation/api/crypto/test_vectors.h index da4610f3..a1cf4faf 100644 --- a/test/common_plat/validation/api/crypto/test_vectors.h +++ b/test/common_plat/validation/api/crypto/test_vectors.h @@ -139,14 +139,14 @@ static uint8_t aes128_gcm_reference_iv[][AES128_GCM_IV_LEN] = {
static uint32_t aes128_gcm_reference_length[] = { 84, 72, 72, 40};
-static odp_crypto_data_range_t aes128_gcm_cipher_range[] = { +static odp_packet_data_range_t aes128_gcm_cipher_range[] = { { .offset = 12, .length = 72 }, { .offset = 8, .length = 64 }, { .offset = 8, .length = 64 }, { .offset = 12, .length = 28 }, };
-static odp_crypto_data_range_t aes128_gcm_auth_range[] = { +static odp_packet_data_range_t aes128_gcm_auth_range[] = { { .offset = 0, .length = 84 }, { .offset = 0, .length = 72 }, { .offset = 0, .length = 72 },
commit ffce96cbcdef44fe089746e9fc06f982ecdb1932 Author: Petri Savolainen petri.savolainen@linaro.org Date: Thu May 4 15:55:57 2017 +0300
api: crypto: add AAD operation parameters
Authentication capabilities list supported AAD lengths per algorithm, but application did not have means to select which length is used. Also pointer to AAD is added, since it may be constructed also outside of packet data.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h index 76977204..1f83e819 100644 --- a/include/odp/api/spec/crypto.h +++ b/include/odp/api/spec/crypto.h @@ -375,6 +375,16 @@ typedef struct odp_crypto_op_param_t { */ uint32_t hash_result_offset;
+ /** Additional Authenticated Data (AAD) */ + struct { + /** Pointer to ADD */ + uint8_t *ptr; + + /** AAD length in bytes. Use odp_crypto_auth_capa() for + * supported AAD lengths. */ + uint32_t length; + } aad; + /** Data range to apply cipher */ odp_crypto_data_range_t cipher_range;
commit af4a068fa640f50dd72ebcb5ac02ca1510d4119e Author: Petri Savolainen petri.savolainen@linaro.org Date: Thu May 4 15:55:56 2017 +0300
api: crypto: add digest length session parameter
Authentication capabilities list supported digest lengths per algorithm, but application did not have means to select which length is used.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h index 181c0cc4..76977204 100644 --- a/include/odp/api/spec/crypto.h +++ b/include/odp/api/spec/crypto.h @@ -299,10 +299,16 @@ typedef struct odp_crypto_session_param_t {
/** Authentication key * - * Use odp_crypto_auth_capa() for supported digest and key lengths. + * Use odp_crypto_auth_capa() for supported key lengths. */ odp_crypto_key_t auth_key;
+ /** Authentication digest length in bytes + * + * Use odp_crypto_auth_capa() for supported digest lengths. + */ + uint32_t auth_digest_len; + /** Async mode completion event queue * * When odp_crypto_operation() is asynchronous, the completion queue is
commit cd14a67e875c4edb809c5e9c4f1f3e9a018b3c91 Author: Petri Savolainen petri.savolainen@linaro.org Date: Thu Mar 30 16:58:56 2017 +0300
api: crypto: enforce deprecated API status
Used ODP_DEPRECATE() to control if deprecated API definitions are visible in the API or not.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h index d30f050f..181c0cc4 100644 --- a/include/odp/api/spec/crypto.h +++ b/include/odp/api/spec/crypto.h @@ -15,6 +15,8 @@ #define ODP_API_CRYPTO_H_ #include <odp/visibility_begin.h>
+#include <odp/api/deprecated.h> + #ifdef __cplusplus extern "C" { #endif @@ -82,10 +84,10 @@ typedef enum { ODP_CIPHER_ALG_AES_GCM,
/** @deprecated Use ODP_CIPHER_ALG_AES_CBC instead */ - ODP_CIPHER_ALG_AES128_CBC, + ODP_DEPRECATE(ODP_CIPHER_ALG_AES128_CBC),
/** @deprecated Use ODP_CIPHER_ALG_AES_GCM instead */ - ODP_CIPHER_ALG_AES128_GCM + ODP_DEPRECATE(ODP_CIPHER_ALG_AES128_GCM)
} odp_cipher_alg_t;
@@ -127,13 +129,14 @@ typedef enum { ODP_AUTH_ALG_AES_GCM,
/** @deprecated Use ODP_AUTH_ALG_MD5_HMAC instead */ - ODP_AUTH_ALG_MD5_96, + ODP_DEPRECATE(ODP_AUTH_ALG_MD5_96),
/** @deprecated Use ODP_AUTH_ALG_SHA256_HMAC instead */ - ODP_AUTH_ALG_SHA256_128, + ODP_DEPRECATE(ODP_AUTH_ALG_SHA256_128),
/** @deprecated Use ODP_AUTH_ALG_AES_GCM instead */ - ODP_AUTH_ALG_AES128_GCM + ODP_DEPRECATE(ODP_AUTH_ALG_AES128_GCM) + } odp_auth_alg_t;
/** @@ -158,10 +161,11 @@ typedef union odp_crypto_cipher_algos_t { uint32_t aes_gcm : 1;
/** @deprecated Use aes_cbc instead */ - uint32_t aes128_cbc : 1; + uint32_t ODP_DEPRECATE(aes128_cbc) : 1;
/** @deprecated Use aes_gcm instead */ - uint32_t aes128_gcm : 1; + uint32_t ODP_DEPRECATE(aes128_gcm) : 1; + } bit;
/** All bits of the bit field structure @@ -196,13 +200,14 @@ typedef union odp_crypto_auth_algos_t { uint32_t aes_gcm : 1;
/** @deprecated Use md5_hmac instead */ - uint32_t md5_96 : 1; + uint32_t ODP_DEPRECATE(md5_96) : 1;
/** @deprecated Use sha256_hmac instead */ - uint32_t sha256_128 : 1; + uint32_t ODP_DEPRECATE(sha256_128) : 1;
/** @deprecated Use aes_gcm instead */ - uint32_t aes128_gcm : 1; + uint32_t ODP_DEPRECATE(aes128_gcm) : 1; + } bit;
/** All bits of the bit field structure @@ -317,7 +322,7 @@ typedef struct odp_crypto_session_param_t { } odp_crypto_session_param_t;
/** @deprecated Use odp_crypto_session_param_t instead */ -typedef odp_crypto_session_param_t odp_crypto_session_params_t; +typedef odp_crypto_session_param_t ODP_DEPRECATE(odp_crypto_session_params_t);
/** * Crypto API per packet operation parameters @@ -373,7 +378,7 @@ typedef struct odp_crypto_op_param_t { } odp_crypto_op_param_t;
/** @deprecated Use odp_crypto_op_param_t instead */ -typedef odp_crypto_op_param_t odp_crypto_op_params_t; +typedef odp_crypto_op_param_t ODP_DEPRECATE(odp_crypto_op_params_t);
/** * Crypto API session creation return code diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index c5473d95..7815a1ba 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -564,12 +564,13 @@ int odp_crypto_capability(odp_crypto_capability_t *capa) capa->auths.bit.sha256_hmac = 1; capa->auths.bit.aes_gcm = 1;
- /* Deprecated */ +#if ODP_DEPRECATED_API capa->ciphers.bit.aes128_cbc = 1; capa->ciphers.bit.aes128_gcm = 1; capa->auths.bit.md5_96 = 1; capa->auths.bit.sha256_128 = 1; capa->auths.bit.aes128_gcm = 1; +#endif
capa->max_sessions = MAX_SESSIONS;
@@ -660,6 +661,7 @@ odp_crypto_session_create(odp_crypto_session_param_t *param, { int rc; odp_crypto_generic_session_t *session; + int aes_gcm = 0;
/* Default to successful result */ *status = ODP_CRYPTO_SES_CREATE_ERR_NONE; @@ -703,17 +705,21 @@ odp_crypto_session_create(odp_crypto_session_param_t *param, rc = process_des_param(session); break; case ODP_CIPHER_ALG_AES_CBC: - /* deprecated */ +#if ODP_DEPRECATED_API case ODP_CIPHER_ALG_AES128_CBC: +#endif rc = process_aes_param(session); break; - case ODP_CIPHER_ALG_AES_GCM: - /* deprecated */ +#if ODP_DEPRECATED_API case ODP_CIPHER_ALG_AES128_GCM: + if (param->auth_alg == ODP_AUTH_ALG_AES128_GCM) + aes_gcm = 1; + /* Fallthrough */ +#endif + case ODP_CIPHER_ALG_AES_GCM: /* AES-GCM requires to do both auth and * cipher at the same time */ - if (param->auth_alg == ODP_AUTH_ALG_AES_GCM || - param->auth_alg == ODP_AUTH_ALG_AES128_GCM) + if (param->auth_alg == ODP_AUTH_ALG_AES_GCM || aes_gcm) rc = process_aes_gcm_param(session); else rc = -1; @@ -729,6 +735,8 @@ odp_crypto_session_create(odp_crypto_session_param_t *param, return -1; }
+ aes_gcm = 0; + /* Process based on auth */ switch (param->auth_alg) { case ODP_AUTH_ALG_NULL: @@ -736,22 +744,27 @@ odp_crypto_session_create(odp_crypto_session_param_t *param, rc = 0; break; case ODP_AUTH_ALG_MD5_HMAC: - /* deprecated */ +#if ODP_DEPRECATED_API case ODP_AUTH_ALG_MD5_96: +#endif rc = process_auth_param(session, 96, 16, EVP_md5()); break; case ODP_AUTH_ALG_SHA256_HMAC: - /* deprecated */ +#if ODP_DEPRECATED_API case ODP_AUTH_ALG_SHA256_128: +#endif rc = process_auth_param(session, 128, 32, EVP_sha256()); break; - case ODP_AUTH_ALG_AES_GCM: - /* deprecated */ +#if ODP_DEPRECATED_API case ODP_AUTH_ALG_AES128_GCM: + if (param->cipher_alg == ODP_CIPHER_ALG_AES128_GCM) + aes_gcm = 1; + /* Fallthrough */ +#endif + case ODP_AUTH_ALG_AES_GCM: /* AES-GCM requires to do both auth and * cipher at the same time */ - if (param->cipher_alg == ODP_CIPHER_ALG_AES_GCM || - param->cipher_alg == ODP_CIPHER_ALG_AES128_GCM) { + if (param->cipher_alg == ODP_CIPHER_ALG_AES_GCM || aes_gcm) { session->auth.func = null_crypto_routine; rc = 0; } else { @@ -777,10 +790,14 @@ odp_crypto_session_create(odp_crypto_session_param_t *param, int odp_crypto_session_destroy(odp_crypto_session_t session) { odp_crypto_generic_session_t *generic; + int aes_gcm = 0;
generic = (odp_crypto_generic_session_t *)(intptr_t)session; - if (generic->p.cipher_alg == ODP_CIPHER_ALG_AES128_GCM || - generic->p.cipher_alg == ODP_CIPHER_ALG_AES_GCM) +#if ODP_DEPRECATED_API + if (generic->p.cipher_alg == ODP_CIPHER_ALG_AES128_GCM) + aes_gcm = 1; +#endif + if (generic->p.cipher_alg == ODP_CIPHER_ALG_AES_GCM || aes_gcm) EVP_CIPHER_CTX_free(generic->cipher.data.aes_gcm.ctx); memset(generic, 0, sizeof(*generic)); free_session(generic);
commit 4d619768d75e4e1c15bb1be7fe282dff532f166b Author: Petri Savolainen petri.savolainen@linaro.org Date: Wed Feb 22 17:08:23 2017 +0200
api: crypto: add sha-1 and sha-512 enumerations
Added enumerations for HMAC-SHA-1 and HMAC-SHA-256 authentication algorithms.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h index 9855bf98..d30f050f 100644 --- a/include/odp/api/spec/crypto.h +++ b/include/odp/api/spec/crypto.h @@ -102,12 +102,24 @@ typedef enum { */ ODP_AUTH_ALG_MD5_HMAC,
+ /** HMAC-SHA-1 + * + * SHA-1 algorithm in HMAC mode + */ + ODP_AUTH_ALG_SHA1_HMAC, + /** HMAC-SHA-256 * * SHA-256 algorithm in HMAC mode */ ODP_AUTH_ALG_SHA256_HMAC,
+ /** HMAC-SHA-512 + * + * SHA-512 algorithm in HMAC mode + */ + ODP_AUTH_ALG_SHA512_HMAC, + /** AES in Galois/Counter Mode * * @note Must be paired with cipher ODP_CIPHER_ALG_AES_GCM @@ -171,9 +183,15 @@ typedef union odp_crypto_auth_algos_t { /** ODP_AUTH_ALG_MD5_HMAC */ uint32_t md5_hmac : 1;
+ /** ODP_AUTH_ALG_SHA1_HMAC */ + uint32_t sha1_hmac : 1; + /** ODP_AUTH_ALG_SHA256_HMAC */ uint32_t sha256_hmac : 1;
+ /** ODP_AUTH_ALG_SHA512_HMAC */ + uint32_t sha512_hmac : 1; + /** ODP_AUTH_ALG_AES_GCM */ uint32_t aes_gcm : 1;
-----------------------------------------------------------------------
Summary of changes: configure.ac | 19 ++++- doc/application-api-guide/api_guide_lines.dox | 6 +- doc/platform-api-guide/Doxyfile | 1 + doc/process-guide/release-guide.adoc | 6 +- example/ipsec/odp_ipsec_misc.h | 4 +- example/ipsec/odp_ipsec_sa_db.c | 4 +- example/ipsec/odp_ipsec_stream.c | 6 +- include/odp/api/spec/.gitignore | 1 + include/odp/api/spec/crypto.h | 82 ++++++++++++++++------ include/odp/api/spec/deprecated.h.in | 50 +++++++++++++ include/odp/api/spec/packet.h | 12 ++++ include/odp_api.h | 1 + platform/Makefile.inc | 1 + platform/linux-generic/Makefile.am | 1 + .../{odp_errno_define.h => odp/api/deprecated.h} | 8 +-- platform/linux-generic/odp_crypto.c | 45 ++++++++---- test/common_plat/performance/odp_crypto.c | 4 +- .../validation/api/crypto/odp_crypto_test_inp.c | 4 +- .../validation/api/crypto/test_vectors.h | 4 +- 19 files changed, 197 insertions(+), 62 deletions(-) create mode 100644 include/odp/api/spec/deprecated.h.in copy platform/linux-generic/include/{odp_errno_define.h => odp/api/deprecated.h} (60%)
hooks/post-receive