mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-12-29 17:25:38 +00:00
crypto: skcipher - Allow sync algorithms with large request contexts
Some sync algorithms may require a large amount of temporary space during its operations. There is no reason why they should be limited just because some legacy users want to place all temporary data on the stack. Such algorithms can now set a flag to indicate that they need extra request context, which will cause them to be invisible to users that go through the sync_skcipher interface. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
cc7710d0d4
commit
e6cb02bd0a
@ -763,7 +763,7 @@ struct crypto_sync_skcipher *crypto_alloc_sync_skcipher(
|
||||
struct crypto_skcipher *tfm;
|
||||
|
||||
/* Only sync algorithms allowed. */
|
||||
mask |= CRYPTO_ALG_ASYNC;
|
||||
mask |= CRYPTO_ALG_ASYNC | CRYPTO_ALG_SKCIPHER_REQSIZE_LARGE;
|
||||
|
||||
tfm = crypto_alloc_tfm(alg_name, &crypto_skcipher_type, type, mask);
|
||||
|
||||
|
@ -14,6 +14,14 @@
|
||||
#include <linux/list.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
/*
|
||||
* Set this if your algorithm is sync but needs a reqsize larger
|
||||
* than MAX_SYNC_SKCIPHER_REQSIZE.
|
||||
*
|
||||
* Reuse bit that is specific to hash algorithms.
|
||||
*/
|
||||
#define CRYPTO_ALG_SKCIPHER_REQSIZE_LARGE CRYPTO_ALG_OPTIONAL_KEY
|
||||
|
||||
struct aead_request;
|
||||
struct rtattr;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user