diff options
author | Janne Peltonen <janne.peltonen@nokia.com> | 2023-03-10 09:20:21 +0200 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2023-04-12 15:52:37 +0300 |
commit | e366a2ec3d0de6e738f9abf9028cdf11582c1d87 (patch) | |
tree | 97fa998cf70372eb7b0910fded41b18be7bd5238 /include | |
parent | bbc1e1c795ca8ea74ca1f8ae315dea9289ac92eb (diff) |
api: crypto: reguire zero crypto range for null algs in OOP op type
Require that cipher range and auth range have zero offset and zero
length when used with null cipher and null auth algorithm, respectively,
with the out-of-place operation type.
This makes handling of ranges in the out-of-place operation type more
regular in that what gets copied to the output packet does not need to
treat null algorithms as a special case. This makes it also possible
to later allow non-null ranges with to-be-defined semantics with the OOP
op type in a backward compatible way.
Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com>
Reviewed-by: Anoob Joseph <anoobj@marvell.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/odp/api/spec/crypto_types.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/include/odp/api/spec/crypto_types.h b/include/odp/api/spec/crypto_types.h index 45bc222da..46d9ae3f7 100644 --- a/include/odp/api/spec/crypto_types.h +++ b/include/odp/api/spec/crypto_types.h @@ -723,14 +723,25 @@ typedef struct odp_crypto_packet_op_param_t { */ const uint8_t *aad_ptr; - /** Data range to be ciphered. Ignored by the null cipher. */ + /** Data range to be ciphered. + * + * Ignored by the null cipher with operation types other than + * ODP_CRYPTO_OP_TYPE_OOP. Must be set to zero range (zero offset + * and zero length) with the null cipher used with the out-of-place + * operation type. + **/ odp_packet_data_range_t cipher_range; /** Data range to be authenticated * * The value is ignored with authenticated encryption algorithms, * such as AES-GCM, which authenticate data in the cipher range - * and the AAD. The value is also ignored by the null algorithm. + * and the AAD. + * + * Ignored by the null auth algorithm with operation types other than + * ODP_CRYPTO_OP_TYPE_OOP. Must be set to zero range (zero offset + * and zero length) with the null cipher used with the out-of-place + * operation type. * * As a special case AES-GMAC uses this field instead of aad_ptr * for the data bytes to be authenticated. |