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()
59 static int nitrox_aead_setauthsize(struct crypto_aead *aead, in nitrox_aead_setauthsize() argument
62 struct nitrox_crypto_ctx *nctx = crypto_aead_ctx(aead); in nitrox_aead_setauthsize()
70 aead->authsize = authsize; in nitrox_aead_setauthsize()
75 static int nitrox_aes_gcm_setauthsize(struct crypto_aead *aead, in nitrox_aes_gcm_setauthsize() argument
91 return nitrox_aead_setauthsize(aead, authsize); in nitrox_aes_gcm_setauthsize()
216 struct crypto_aead *aead = crypto_aead_reqtfm(areq); in nitrox_aes_gcm_enc() local
217 struct nitrox_crypto_ctx *nctx = crypto_aead_ctx(aead); in nitrox_aes_gcm_enc()
231 rctx->dstlen = rctx->srclen + aead->authsize; in nitrox_aes_gcm_enc()
250 struct crypto_aead *aead = crypto_aead_reqtfm(areq); in nitrox_aes_gcm_dec() local
251 struct nitrox_crypto_ctx *nctx = crypto_aead_ctx(aead); in nitrox_aes_gcm_dec()
262 rctx->cryptlen = areq->cryptlen - aead->authsize; in nitrox_aes_gcm_dec()
265 rctx->dstlen = rctx->srclen - aead->authsize; in nitrox_aes_gcm_dec()
282 static int nitrox_aead_init(struct crypto_aead *aead) in nitrox_aead_init() argument
284 struct nitrox_crypto_ctx *nctx = crypto_aead_ctx(aead); in nitrox_aead_init()
306 static int nitrox_gcm_common_init(struct crypto_aead *aead) in nitrox_gcm_common_init() argument
309 struct nitrox_crypto_ctx *nctx = crypto_aead_ctx(aead); in nitrox_gcm_common_init()
312 ret = nitrox_aead_init(aead); in nitrox_gcm_common_init()
327 static int nitrox_aes_gcm_init(struct crypto_aead *aead) in nitrox_aes_gcm_init() argument
331 ret = nitrox_gcm_common_init(aead); in nitrox_aes_gcm_init()
335 crypto_aead_set_reqsize(aead, in nitrox_aes_gcm_init()
342 static void nitrox_aead_exit(struct crypto_aead *aead) in nitrox_aead_exit() argument
344 struct nitrox_crypto_ctx *nctx = crypto_aead_ctx(aead); in nitrox_aead_exit()
360 static int nitrox_rfc4106_setkey(struct crypto_aead *aead, const u8 *key, in nitrox_rfc4106_setkey() argument
363 struct nitrox_crypto_ctx *nctx = crypto_aead_ctx(aead); in nitrox_rfc4106_setkey()
371 ret = nitrox_aes_gcm_setkey(aead, key, keylen); in nitrox_rfc4106_setkey()
379 static int nitrox_rfc4106_setauthsize(struct crypto_aead *aead, in nitrox_rfc4106_setauthsize() argument
391 return nitrox_aead_setauthsize(aead, authsize); in nitrox_rfc4106_setauthsize()
443 struct crypto_aead *aead = crypto_aead_reqtfm(areq); in nitrox_rfc4106_enc() local
444 struct nitrox_crypto_ctx *nctx = crypto_aead_ctx(aead); in nitrox_rfc4106_enc()
453 aead_rctx->dstlen = aead_rctx->srclen + aead->authsize; in nitrox_rfc4106_enc()
475 struct crypto_aead *aead = crypto_aead_reqtfm(areq); in nitrox_rfc4106_dec() local
476 struct nitrox_crypto_ctx *nctx = crypto_aead_ctx(aead); in nitrox_rfc4106_dec()
482 aead_rctx->cryptlen = areq->cryptlen - aead->authsize; in nitrox_rfc4106_dec()
486 aead_rctx->dstlen = aead_rctx->srclen - aead->authsize; in nitrox_rfc4106_dec()
506 static int nitrox_rfc4106_init(struct crypto_aead *aead) in nitrox_rfc4106_init() argument
510 ret = nitrox_gcm_common_init(aead); in nitrox_rfc4106_init()
514 crypto_aead_set_reqsize(aead, sizeof(struct aead_request) + in nitrox_rfc4106_init()