Eric Biggers
7bcb2c99f8
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 <mpatocka@redhat.com >
(https://lore.kernel.org/r/alpine.LRH.2.02.2006301414580.30526@file01.intranet.prod.int.rdu2.redhat.com ).
Signed-off-by: Eric Biggers <ebiggers@google.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2020-07-16 21:49:08 +10:00
..
2019-12-12 23:45:16 +02:00
2019-06-05 17:37:06 +02:00
2019-05-30 11:26:37 -07:00
2020-07-09 18:25:23 +10:00
2020-07-16 21:49:08 +10:00
2020-01-09 11:30:58 +08:00
2020-01-09 11:30:53 +08:00
2019-10-26 02:06:05 +11:00
2019-10-26 02:06:05 +11:00
2019-08-30 18:05:30 +10:00
2020-01-09 11:30:53 +08:00
2019-07-26 14:55:33 +10:00
2020-07-09 18:25:22 +10:00
2020-01-09 11:30:58 +08:00
2020-01-09 11:30:58 +08:00
2020-07-16 21:49:08 +10:00
2020-06-15 17:38:54 +10:00
2020-06-18 17:19:44 +10:00
2020-06-18 17:09:54 +10:00
2020-04-24 17:42:16 +10:00
2020-06-18 17:19:44 +10:00
2019-05-24 17:27:12 +02:00
2020-01-09 11:30:53 +08:00
2020-07-09 18:25:23 +10:00
2019-07-08 20:57:08 -07:00
2020-07-16 21:49:08 +10:00
2020-07-16 21:49:08 +10:00
2020-05-15 16:15:00 +10:00
2020-01-09 11:30:53 +08:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2020-01-09 11:30:53 +08:00
2019-05-30 11:25:16 -07:00
2020-01-09 11:30:53 +08:00
2019-05-24 17:27:12 +02:00
2019-12-27 18:18:04 +08:00
2020-07-16 21:49:08 +10:00
2019-12-27 18:18:04 +08:00
2020-07-16 21:49:08 +10:00
2019-11-22 18:48:39 +08:00
2020-01-09 11:30:53 +08:00
2020-07-16 21:49:08 +10:00
2019-12-11 16:37:01 +08:00
2020-01-09 11:30:53 +08:00
2020-01-09 11:30:53 +08:00
2013-09-12 15:31:34 +10:00
2019-04-18 22:15:03 +08:00
2020-07-16 21:49:08 +10:00
2020-05-28 17:27:52 +10:00
2019-07-08 20:57:08 -07:00
2019-12-20 14:58:35 +08:00
2019-11-01 13:38:32 +08:00
2020-07-16 21:49:08 +10:00
2020-07-16 21:49:08 +10:00
2019-11-17 09:02:43 +08:00
2019-07-08 20:57:08 -07:00
2020-01-09 11:30:53 +08:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2020-06-15 17:38:54 +10:00
2019-12-27 18:18:04 +08:00
2019-04-18 22:15:02 +08:00
2019-11-17 09:02:42 +08:00
2019-04-18 22:15:02 +08:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2020-07-16 21:49:07 +10:00
2019-04-18 22:15:02 +08:00
2019-04-18 22:15:02 +08:00
2019-04-18 22:15:02 +08:00
2019-04-18 22:15:02 +08:00
2020-07-16 21:49:08 +10:00
2019-06-13 14:31:39 +08:00
2019-07-26 14:51:57 +10:00
2020-07-16 21:49:08 +10:00
2020-07-16 21:49:08 +10:00
2017-12-22 19:52:40 +11:00
2020-01-09 11:30:53 +08:00
2020-02-18 07:35:49 -05:00
2020-07-16 21:49:08 +10:00
2020-07-09 18:25:23 +10:00
2020-04-24 17:42:17 +10:00
2020-04-24 17:42:17 +10:00
2019-10-18 18:49:40 +11:00
2020-06-10 14:46:54 -07:00
2019-12-27 18:18:04 +08:00
2019-06-13 14:31:39 +08:00
2019-05-30 11:26:32 -07:00
2020-07-16 21:49:08 +10:00
2019-07-08 20:57:08 -07:00
2019-07-08 20:57:08 -07:00
2019-07-08 20:57:08 -07:00
2019-07-08 20:57:08 -07:00
2019-11-17 09:02:49 +08:00
2019-06-13 14:31:39 +08:00
2020-02-28 08:43:21 +08:00
2013-12-09 20:09:12 +08:00
2020-01-09 11:30:53 +08:00
2020-01-16 15:18:12 +08:00
2019-12-27 18:18:04 +08:00
2019-12-27 18:18:04 +08:00
2020-07-16 21:49:08 +10:00
2020-01-16 15:18:12 +08:00
2020-02-13 17:05:26 +08:00
2017-11-02 11:10:55 +01:00
2019-07-08 20:57:08 -07:00
2019-07-08 20:57:08 -07:00
2019-07-08 20:57:08 -07:00
2019-07-08 20:57:08 -07:00
2020-02-13 16:58:09 +08:00
2019-05-30 11:26:32 -07:00
2020-07-16 21:49:08 +10:00
2019-05-24 17:27:11 +02:00
2016-07-05 23:05:26 +08:00
2015-10-14 22:23:16 +08:00
2019-04-18 22:15:03 +08:00
2019-05-30 11:26:32 -07:00
2019-12-20 14:58:35 +08:00
2019-05-30 11:26:32 -07:00
2020-07-16 21:49:08 +10:00
2019-12-11 16:36:54 +08:00
2020-05-08 15:32:17 +10:00
2019-05-30 11:26:32 -07:00
2020-05-08 15:32:12 +10:00
2019-05-24 17:27:12 +02:00
2020-05-08 15:32:12 +10:00
2020-07-16 21:49:08 +10:00
2020-07-16 21:49:08 +10:00
2019-06-19 17:09:07 +02:00
2020-01-09 11:30:53 +08:00
2019-08-15 21:52:14 +10:00
2020-02-13 17:05:26 +08:00
2019-05-30 11:26:32 -07:00
2019-07-08 20:57:08 -07:00
2020-04-01 14:47:40 -07:00
2019-12-11 16:37:01 +08:00
2019-11-15 13:44:17 +08:00
2020-01-09 11:30:53 +08:00
2019-05-21 11:28:45 +02:00
2020-07-16 21:49:08 +10:00
2019-06-13 14:31:39 +08:00
2020-07-16 21:49:08 +10:00
2019-05-24 17:27:13 +02:00
2020-07-16 21:49:08 +10:00
2020-01-09 11:30:53 +08:00
2019-07-08 20:57:08 -07:00