Skip to content

Commit afddce1

Browse files
committed
crypto: api - Add reqsize to crypto_alg
Add a reqsize field to crypto_alg with the intention of replacing the type-specific reqsize field currently used by ahash and acomp. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 6eed1e3 commit afddce1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

include/linux/crypto.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ struct cipher_alg {
276276
* to the alignmask of the algorithm being used, in order to
277277
* avoid the API having to realign them. Note: the alignmask is
278278
* not supported for hash algorithms and is always 0 for them.
279+
* @cra_reqsize: Size of the request context for this algorithm.
279280
* @cra_priority: Priority of this transformation implementation. In case
280281
* multiple transformations with same @cra_name are available to
281282
* the Crypto API, the kernel will use the one with highest
@@ -322,6 +323,7 @@ struct crypto_alg {
322323
unsigned int cra_blocksize;
323324
unsigned int cra_ctxsize;
324325
unsigned int cra_alignmask;
326+
unsigned int cra_reqsize;
325327

326328
int cra_priority;
327329
refcount_t cra_refcnt;
@@ -441,6 +443,11 @@ static inline unsigned int crypto_tfm_alg_alignmask(struct crypto_tfm *tfm)
441443
return tfm->__crt_alg->cra_alignmask;
442444
}
443445

446+
static inline unsigned int crypto_tfm_alg_reqsize(struct crypto_tfm *tfm)
447+
{
448+
return tfm->__crt_alg->cra_reqsize;
449+
}
450+
444451
static inline u32 crypto_tfm_get_flags(struct crypto_tfm *tfm)
445452
{
446453
return tfm->crt_flags;

0 commit comments

Comments
 (0)