Lines Matching refs:tfm
127 int (*setkey)(struct crypto_skcipher *tfm, const u8 *key,
131 int (*init)(struct crypto_skcipher *tfm);
132 void (*exit)(struct crypto_skcipher *tfm);
149 * This performs a type-check against the "tfm" argument to make sure
150 * all users have the correct skcipher tfm for doing on-stack requests.
152 #define SYNC_SKCIPHER_REQUEST_ON_STACK(name, tfm) \
156 (typeof(tfm))1))) \
178 * For the symmetric key cipher API, the state is maintained with the tfm
179 * cipher handle. A single tfm can be used across multiple calls and in
191 struct crypto_tfm *tfm)
193 return container_of(tfm, struct crypto_skcipher, base);
217 struct crypto_skcipher *tfm)
219 return &tfm->base;
224 * @tfm: cipher handle to be freed
226 * If @tfm is a NULL or error pointer, this function does nothing.
228 static inline void crypto_free_skcipher(struct crypto_skcipher *tfm)
230 crypto_destroy_tfm(tfm, crypto_skcipher_tfm(tfm));
233 static inline void crypto_free_sync_skcipher(struct crypto_sync_skcipher *tfm)
235 crypto_free_skcipher(&tfm->base);
251 struct crypto_skcipher *tfm)
253 return crypto_tfm_alg_driver_name(crypto_skcipher_tfm(tfm));
257 struct crypto_skcipher *tfm)
259 return container_of(crypto_skcipher_tfm(tfm)->__crt_alg,
270 * @tfm: cipher handle
277 static inline unsigned int crypto_skcipher_ivsize(struct crypto_skcipher *tfm)
279 return crypto_skcipher_alg(tfm)->ivsize;
283 struct crypto_sync_skcipher *tfm)
285 return crypto_skcipher_ivsize(&tfm->base);
290 * @tfm: cipher handle
299 struct crypto_skcipher *tfm)
301 return crypto_tfm_alg_blocksize(crypto_skcipher_tfm(tfm));
312 * @tfm: cipher handle
322 struct crypto_skcipher *tfm)
324 return crypto_skcipher_alg_chunksize(crypto_skcipher_alg(tfm));
328 struct crypto_sync_skcipher *tfm)
330 return crypto_skcipher_blocksize(&tfm->base);
334 struct crypto_skcipher *tfm)
336 return crypto_tfm_alg_alignmask(crypto_skcipher_tfm(tfm));
339 static inline u32 crypto_skcipher_get_flags(struct crypto_skcipher *tfm)
341 return crypto_tfm_get_flags(crypto_skcipher_tfm(tfm));
344 static inline void crypto_skcipher_set_flags(struct crypto_skcipher *tfm,
347 crypto_tfm_set_flags(crypto_skcipher_tfm(tfm), flags);
350 static inline void crypto_skcipher_clear_flags(struct crypto_skcipher *tfm,
353 crypto_tfm_clear_flags(crypto_skcipher_tfm(tfm), flags);
357 struct crypto_sync_skcipher *tfm)
359 return crypto_skcipher_get_flags(&tfm->base);
363 struct crypto_sync_skcipher *tfm, u32 flags)
365 crypto_skcipher_set_flags(&tfm->base, flags);
369 struct crypto_sync_skcipher *tfm, u32 flags)
371 crypto_skcipher_clear_flags(&tfm->base, flags);
376 * @tfm: cipher handle
390 int crypto_skcipher_setkey(struct crypto_skcipher *tfm,
393 static inline int crypto_sync_skcipher_setkey(struct crypto_sync_skcipher *tfm,
396 return crypto_skcipher_setkey(&tfm->base, key, keylen);
400 struct crypto_skcipher *tfm)
402 return crypto_skcipher_alg(tfm)->min_keysize;
406 struct crypto_skcipher *tfm)
408 return crypto_skcipher_alg(tfm)->max_keysize;
423 return __crypto_skcipher_cast(req->base.tfm);
429 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
431 return container_of(tfm, struct crypto_sync_skcipher, base);
473 * @tfm: cipher handle
477 static inline unsigned int crypto_skcipher_reqsize(struct crypto_skcipher *tfm)
479 return tfm->reqsize;
485 * @tfm: cipher handle that shall be added to the request handle
491 struct crypto_skcipher *tfm)
493 req->base.tfm = crypto_skcipher_tfm(tfm);
497 struct crypto_sync_skcipher *tfm)
499 skcipher_request_set_tfm(req, &tfm->base);
510 * @tfm: cipher handle to be registered with the request
520 struct crypto_skcipher *tfm, gfp_t gfp)
525 crypto_skcipher_reqsize(tfm), gfp);
528 skcipher_request_set_tfm(req, tfm);
544 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
546 memzero_explicit(req, sizeof(*req) + crypto_skcipher_reqsize(tfm));