diff options
| author | Eric Biggers <[email protected]> | 2020-07-10 06:20:38 +0000 |
|---|---|---|
| committer | Herbert Xu <[email protected]> | 2020-07-16 11:49:08 +0000 |
| commit | 7bcb2c99f8ed032cfb3f5596b4dccac6b1f501df (patch) | |
| tree | 7d8e914c0368036db8f1d99a923387833546330a /drivers/crypto/inside-secure/safexcel_cipher.c | |
| parent | crypto: seqiv - remove seqiv_create() (diff) | |
| download | kernel-7bcb2c99f8ed032cfb3f5596b4dccac6b1f501df.tar.gz kernel-7bcb2c99f8ed032cfb3f5596b4dccac6b1f501df.zip | |
crypto: algapi - use common mechanism for inheriting flags
The flag CRYPTO_ALG_ASYNC is "inherited" in the sense that when a
template is instantiated, the template will have CRYPTO_ALG_ASYNC set if
any of the algorithms it uses has CRYPTO_ALG_ASYNC set.
We'd like to add a second flag (CRYPTO_ALG_ALLOCATES_MEMORY) that gets
"inherited" in the same way. This is difficult because the handling of
CRYPTO_ALG_ASYNC is hardcoded everywhere. Address this by:
- Add CRYPTO_ALG_INHERITED_FLAGS, which contains the set of flags that
have these inheritance semantics.
- Add crypto_algt_inherited_mask(), for use by template ->create()
methods. It returns any of these flags that the user asked to be
unset and thus must be passed in the 'mask' to crypto_grab_*().
- Also modify crypto_check_attr_type() to handle computing the 'mask'
so that most templates can just use this.
- Make crypto_grab_*() propagate these flags to the template instance
being created so that templates don't have to do this themselves.
Make crypto/simd.c propagate these flags too, since it "wraps" another
algorithm, similar to a template.
Based on a patch by Mikulas Patocka <[email protected]>
(https://lore.kernel.org/r/alpine.LRH.2.02.2006301414580.30526@file01.intranet.prod.int.rdu2.redhat.com).
Signed-off-by: Eric Biggers <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
Diffstat (limited to 'drivers/crypto/inside-secure/safexcel_cipher.c')
0 files changed, 0 insertions, 0 deletions
