Lines Matching refs:aead

34 static int nitrox_aes_gcm_setkey(struct crypto_aead *aead, const u8 *key,  in nitrox_aes_gcm_setkey()  argument
38 struct nitrox_crypto_ctx *nctx = crypto_aead_ctx(aead); in nitrox_aes_gcm_setkey()
44 crypto_aead_set_flags(aead, CRYPTO_TFM_RES_BAD_KEY_LEN); in nitrox_aes_gcm_setkey()
61 static int nitrox_aead_setauthsize(struct crypto_aead *aead, in nitrox_aead_setauthsize() argument
64 struct nitrox_crypto_ctx *nctx = crypto_aead_ctx(aead); in nitrox_aead_setauthsize()
72 aead->authsize = authsize; in nitrox_aead_setauthsize()
191 struct crypto_aead *aead = crypto_aead_reqtfm(areq); in nitrox_aes_gcm_enc() local
192 struct nitrox_crypto_ctx *nctx = crypto_aead_ctx(aead); in nitrox_aes_gcm_enc()
203 rctx->dstlen = rctx->srclen + aead->authsize; in nitrox_aes_gcm_enc()
222 struct crypto_aead *aead = crypto_aead_reqtfm(areq); in nitrox_aes_gcm_dec() local
223 struct nitrox_crypto_ctx *nctx = crypto_aead_ctx(aead); in nitrox_aes_gcm_dec()
231 rctx->cryptlen = areq->cryptlen - aead->authsize; in nitrox_aes_gcm_dec()
234 rctx->dstlen = rctx->srclen - aead->authsize; in nitrox_aes_gcm_dec()
251 static int nitrox_aead_init(struct crypto_aead *aead) in nitrox_aead_init() argument
253 struct nitrox_crypto_ctx *nctx = crypto_aead_ctx(aead); in nitrox_aead_init()
275 static int nitrox_gcm_common_init(struct crypto_aead *aead) in nitrox_gcm_common_init() argument
278 struct nitrox_crypto_ctx *nctx = crypto_aead_ctx(aead); in nitrox_gcm_common_init()
281 ret = nitrox_aead_init(aead); in nitrox_gcm_common_init()
296 static int nitrox_aes_gcm_init(struct crypto_aead *aead) in nitrox_aes_gcm_init() argument
300 ret = nitrox_gcm_common_init(aead); in nitrox_aes_gcm_init()
304 crypto_aead_set_reqsize(aead, in nitrox_aes_gcm_init()
311 static void nitrox_aead_exit(struct crypto_aead *aead) in nitrox_aead_exit() argument
313 struct nitrox_crypto_ctx *nctx = crypto_aead_ctx(aead); in nitrox_aead_exit()
329 static int nitrox_rfc4106_setkey(struct crypto_aead *aead, const u8 *key, in nitrox_rfc4106_setkey() argument
332 struct nitrox_crypto_ctx *nctx = crypto_aead_ctx(aead); in nitrox_rfc4106_setkey()
340 ret = nitrox_aes_gcm_setkey(aead, key, keylen); in nitrox_rfc4106_setkey()
348 static int nitrox_rfc4106_setauthsize(struct crypto_aead *aead, in nitrox_rfc4106_setauthsize() argument
360 return nitrox_aead_setauthsize(aead, authsize); in nitrox_rfc4106_setauthsize()
412 struct crypto_aead *aead = crypto_aead_reqtfm(areq); in nitrox_rfc4106_enc() local
413 struct nitrox_crypto_ctx *nctx = crypto_aead_ctx(aead); in nitrox_rfc4106_enc()
422 aead_rctx->dstlen = aead_rctx->srclen + aead->authsize; in nitrox_rfc4106_enc()
444 struct crypto_aead *aead = crypto_aead_reqtfm(areq); in nitrox_rfc4106_dec() local
445 struct nitrox_crypto_ctx *nctx = crypto_aead_ctx(aead); in nitrox_rfc4106_dec()
451 aead_rctx->cryptlen = areq->cryptlen - aead->authsize; in nitrox_rfc4106_dec()
455 aead_rctx->dstlen = aead_rctx->srclen - aead->authsize; in nitrox_rfc4106_dec()
475 static int nitrox_rfc4106_init(struct crypto_aead *aead) in nitrox_rfc4106_init() argument
479 ret = nitrox_gcm_common_init(aead); in nitrox_rfc4106_init()
483 crypto_aead_set_reqsize(aead, sizeof(struct aead_request) + in nitrox_rfc4106_init()