Lines Matching refs:tfm

105 	int (*setkey)(struct crypto_skcipher *tfm, const u8 *key,
109 int (*init)(struct crypto_skcipher *tfm);
110 void (*exit)(struct crypto_skcipher *tfm);
123 * This performs a type-check against the "tfm" argument to make sure
124 * all users have the correct skcipher tfm for doing on-stack requests.
126 #define SYNC_SKCIPHER_REQUEST_ON_STACK(name, tfm) \
130 (typeof(tfm))1))) \
152 * For the symmetric key cipher API, the state is maintained with the tfm
153 * cipher handle. A single tfm can be used across multiple calls and in
165 struct crypto_tfm *tfm)
167 return container_of(tfm, struct crypto_skcipher, base);
191 struct crypto_skcipher *tfm)
193 return &tfm->base;
198 * @tfm: cipher handle to be freed
200 * If @tfm is a NULL or error pointer, this function does nothing.
202 static inline void crypto_free_skcipher(struct crypto_skcipher *tfm)
204 crypto_destroy_tfm(tfm, crypto_skcipher_tfm(tfm));
207 static inline void crypto_free_sync_skcipher(struct crypto_sync_skcipher *tfm)
209 crypto_free_skcipher(&tfm->base);
225 struct crypto_skcipher *tfm)
227 return crypto_tfm_alg_driver_name(crypto_skcipher_tfm(tfm));
231 struct crypto_skcipher *tfm)
233 return container_of(crypto_skcipher_tfm(tfm)->__crt_alg,
244 * @tfm: cipher handle
251 static inline unsigned int crypto_skcipher_ivsize(struct crypto_skcipher *tfm)
253 return crypto_skcipher_alg(tfm)->ivsize;
257 struct crypto_sync_skcipher *tfm)
259 return crypto_skcipher_ivsize(&tfm->base);
264 * @tfm: cipher handle
273 struct crypto_skcipher *tfm)
275 return crypto_tfm_alg_blocksize(crypto_skcipher_tfm(tfm));
286 * @tfm: cipher handle
296 struct crypto_skcipher *tfm)
298 return crypto_skcipher_alg_chunksize(crypto_skcipher_alg(tfm));
302 struct crypto_sync_skcipher *tfm)
304 return crypto_skcipher_blocksize(&tfm->base);
308 struct crypto_skcipher *tfm)
310 return crypto_tfm_alg_alignmask(crypto_skcipher_tfm(tfm));
313 static inline u32 crypto_skcipher_get_flags(struct crypto_skcipher *tfm)
315 return crypto_tfm_get_flags(crypto_skcipher_tfm(tfm));
318 static inline void crypto_skcipher_set_flags(struct crypto_skcipher *tfm,
321 crypto_tfm_set_flags(crypto_skcipher_tfm(tfm), flags);
324 static inline void crypto_skcipher_clear_flags(struct crypto_skcipher *tfm,
327 crypto_tfm_clear_flags(crypto_skcipher_tfm(tfm), flags);
331 struct crypto_sync_skcipher *tfm)
333 return crypto_skcipher_get_flags(&tfm->base);
337 struct crypto_sync_skcipher *tfm, u32 flags)
339 crypto_skcipher_set_flags(&tfm->base, flags);
343 struct crypto_sync_skcipher *tfm, u32 flags)
345 crypto_skcipher_clear_flags(&tfm->base, flags);
350 * @tfm: cipher handle
364 int crypto_skcipher_setkey(struct crypto_skcipher *tfm,
367 static inline int crypto_sync_skcipher_setkey(struct crypto_sync_skcipher *tfm,
370 return crypto_skcipher_setkey(&tfm->base, key, keylen);
374 struct crypto_skcipher *tfm)
376 return crypto_skcipher_alg(tfm)->min_keysize;
380 struct crypto_skcipher *tfm)
382 return crypto_skcipher_alg(tfm)->max_keysize;
397 return __crypto_skcipher_cast(req->base.tfm);
403 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
405 return container_of(tfm, struct crypto_sync_skcipher, base);
447 * @tfm: cipher handle
451 static inline unsigned int crypto_skcipher_reqsize(struct crypto_skcipher *tfm)
453 return tfm->reqsize;
459 * @tfm: cipher handle that shall be added to the request handle
465 struct crypto_skcipher *tfm)
467 req->base.tfm = crypto_skcipher_tfm(tfm);
471 struct crypto_sync_skcipher *tfm)
473 skcipher_request_set_tfm(req, &tfm->base);
484 * @tfm: cipher handle to be registered with the request
494 struct crypto_skcipher *tfm, gfp_t gfp)
499 crypto_skcipher_reqsize(tfm), gfp);
502 skcipher_request_set_tfm(req, tfm);
518 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
520 memzero_explicit(req, sizeof(*req) + crypto_skcipher_reqsize(tfm));