Commit cf0840cc authored by Harald Freudenberger's avatar Harald Freudenberger Committed by Herbert Xu
Browse files

crypto: skcipher - Add new helper function crypto_skcipher_tested



Add a new helper function crypto_skcipher_tested() which evaluates
the CRYPTO_ALG_TESTED flag from the tfm base cra_flags field.

Signed-off-by: default avatarHarald Freudenberger <freude@linux.ibm.com>
Reviewed-by: default avatarHolger Dengler <dengler@linux.ibm.com>
Reviewed-by: default avatarIngo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 9c5582db
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -242,6 +242,13 @@ static inline void *crypto_skcipher_ctx_dma(struct crypto_skcipher *tfm)
	return crypto_tfm_ctx_dma(&tfm->base);
}

static inline bool crypto_skcipher_tested(struct crypto_skcipher *tfm)
{
	struct crypto_tfm *tfm_base = crypto_skcipher_tfm(tfm);

	return tfm_base->__crt_alg->cra_flags & CRYPTO_ALG_TESTED;
}

static inline void *skcipher_request_ctx(struct skcipher_request *req)
{
	return req->__ctx;