diff options
author | Janne Peltonen <janne.peltonen@nokia.com> | 2021-12-21 16:46:41 +0200 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2022-01-28 10:09:30 +0200 |
commit | 4b219fbf2c1b6080c50c99b2e7d50062fabfe2d8 (patch) | |
tree | b2e9223cfe266f94faa2f7a953f08c985080d1cf /include/odp/api/spec/crypto.h | |
parent | 94316355d6081e951fa5ff58098f129af54ada8d (diff) |
api: crypto: do not require per-session IV if it will not be used
Currently the API requires that the crypto session creation parameters
always have a valid pointer to an IV when the IV length is non-zero,
even if an application never uses a per-session IV.
Since normally per-packet IVs are used, allow null IV data pointer in
the session creation and specify that it means that the IV will always
be provided for each packet in the per-crypto-op parameters. Specify
that the default value of the IV data pointer is null. This can
simplify applications and removes the need for storing unused IVs in
crypto session in the ODP implementation.
API validation tests already expect the behaviour that this API change
makes official as they pass null IV data pointer in session creation
when the IV data is going to be overridden in each crypto operation.
This change is also preparation for future deprecation of per-session
IV. With deprecated API enabled an ODP implementation must work
correctly regardless of whether an application uses the deprecated or
new API for the IV. Making null both an allowed value and the default
helps in this since an application using the new API does not set
the IV data pointer.
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/odp/api/spec/crypto.h')
-rw-r--r-- | include/odp/api/spec/crypto.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h index e2d506ca6..b743bf069 100644 --- a/include/odp/api/spec/crypto.h +++ b/include/odp/api/spec/crypto.h @@ -527,7 +527,15 @@ typedef struct odp_crypto_key { * Crypto API IV structure */ typedef struct odp_crypto_iv { - /** IV data */ + /** IV data + * + * Ignored when length is zero. Null value indicates that an + * IV will be provided for each packet through the crypto + * operation parameters. In that case the per-operation + * IV override parameter must always point to a valid IV. + * + * Default value is NULL. + */ uint8_t *data; /** IV length in bytes */ |