H A D | gcm.c | 195 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); crypto_gcm_init_crypt() local 199 memset(pctx->auth_tag, 0, sizeof(pctx->auth_tag)); crypto_gcm_init_crypt() 202 sg_init_table(pctx->src, 2); crypto_gcm_init_crypt() 203 sg_set_buf(pctx->src, pctx->auth_tag, sizeof(pctx->auth_tag)); crypto_gcm_init_crypt() 204 scatterwalk_sg_chain(pctx->src, 2, req->src); crypto_gcm_init_crypt() 206 dst = pctx->src; crypto_gcm_init_crypt() 208 sg_init_table(pctx->dst, 2); crypto_gcm_init_crypt() 209 sg_set_buf(pctx->dst, pctx->auth_tag, sizeof(pctx->auth_tag)); crypto_gcm_init_crypt() 210 scatterwalk_sg_chain(pctx->dst, 2, req->dst); crypto_gcm_init_crypt() 211 dst = pctx->dst; crypto_gcm_init_crypt() 215 ablkcipher_request_set_crypt(ablk_req, pctx->src, dst, crypto_gcm_init_crypt() 216 cryptlen + sizeof(pctx->auth_tag), crypto_gcm_init_crypt() 230 struct crypto_gcm_req_priv_ctx *pctx, gcm_hash_update() 235 struct ahash_request *ahreq = &pctx->u.ahreq; gcm_hash_update() 245 struct crypto_gcm_req_priv_ctx *pctx, gcm_hash_remain() 249 struct ahash_request *ahreq = &pctx->u.ahreq; gcm_hash_remain() 253 sg_init_one(pctx->src, gcm_zeroes, remain); gcm_hash_remain() 254 ahash_request_set_crypt(ahreq, pctx->src, NULL, remain); gcm_hash_remain() 260 struct crypto_gcm_req_priv_ctx *pctx) gcm_hash_len() 262 struct ahash_request *ahreq = &pctx->u.ahreq; gcm_hash_len() 263 struct crypto_gcm_ghash_ctx *gctx = &pctx->ghash_ctx; gcm_hash_len() 268 memcpy(pctx->iauth_tag, &lengths, 16); gcm_hash_len() 269 sg_init_one(pctx->src, pctx->iauth_tag, 16); gcm_hash_len() 272 ahash_request_set_crypt(ahreq, pctx->src, gcm_hash_len() 279 struct crypto_gcm_req_priv_ctx *pctx) gcm_hash_final() 281 struct ahash_request *ahreq = &pctx->u.ahreq; gcm_hash_final() 285 ahash_request_set_crypt(ahreq, NULL, pctx->iauth_tag, 0); gcm_hash_final() 292 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); __gcm_hash_final_done() local 293 struct crypto_gcm_ghash_ctx *gctx = &pctx->ghash_ctx; __gcm_hash_final_done() 296 crypto_xor(pctx->auth_tag, pctx->iauth_tag, 16); __gcm_hash_final_done() 310 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); __gcm_hash_len_done() local 313 err = gcm_hash_final(req, pctx); __gcm_hash_len_done() 330 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); __gcm_hash_crypt_remain_done() local 333 err = gcm_hash_len(req, pctx); __gcm_hash_crypt_remain_done() 351 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); __gcm_hash_crypt_done() local 352 struct crypto_gcm_ghash_ctx *gctx = &pctx->ghash_ctx; __gcm_hash_crypt_done() 358 err = gcm_hash_remain(req, pctx, remain, __gcm_hash_crypt_done() 376 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); __gcm_hash_assoc_remain_done() local 377 struct crypto_gcm_ghash_ctx *gctx = &pctx->ghash_ctx; __gcm_hash_assoc_remain_done() 385 err = gcm_hash_update(req, pctx, compl, __gcm_hash_assoc_remain_done() 407 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); __gcm_hash_assoc_done() local 413 err = gcm_hash_remain(req, pctx, remain, __gcm_hash_assoc_done() 431 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); __gcm_hash_init_done() local 439 err = gcm_hash_update(req, pctx, compl, __gcm_hash_init_done() 459 struct crypto_gcm_req_priv_ctx *pctx) gcm_hash() 461 struct ahash_request *ahreq = &pctx->u.ahreq; gcm_hash() 462 struct crypto_gcm_ghash_ctx *gctx = &pctx->ghash_ctx; gcm_hash() 477 err = gcm_hash_update(req, pctx, compl, req->assoc, req->assoclen); gcm_hash() 481 err = gcm_hash_remain(req, pctx, remain, gcm_hash() 488 err = gcm_hash_update(req, pctx, compl, gctx->src, gctx->cryptlen); gcm_hash() 492 err = gcm_hash_remain(req, pctx, remain, gcm_hash() 497 err = gcm_hash_len(req, pctx); gcm_hash() 500 err = gcm_hash_final(req, pctx); gcm_hash() 508 struct crypto_gcm_req_priv_ctx *pctx) gcm_enc_copy_hash() 511 u8 *auth_tag = pctx->auth_tag; gcm_enc_copy_hash() 519 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); gcm_enc_hash_done() local 522 gcm_enc_copy_hash(req, pctx); gcm_enc_hash_done() 530 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); gcm_encrypt_done() local 533 err = gcm_hash(req, pctx); gcm_encrypt_done() 537 crypto_xor(pctx->auth_tag, pctx->iauth_tag, 16); gcm_encrypt_done() 538 gcm_enc_copy_hash(req, pctx); gcm_encrypt_done() 547 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); crypto_gcm_encrypt() local 548 struct ablkcipher_request *abreq = &pctx->u.abreq; crypto_gcm_encrypt() 549 struct crypto_gcm_ghash_ctx *gctx = &pctx->ghash_ctx; crypto_gcm_encrypt() 564 err = gcm_hash(req, pctx); crypto_gcm_encrypt() 568 crypto_xor(pctx->auth_tag, pctx->iauth_tag, 16); crypto_gcm_encrypt() 569 gcm_enc_copy_hash(req, pctx); crypto_gcm_encrypt() 575 struct crypto_gcm_req_priv_ctx *pctx) crypto_gcm_verify() 578 u8 *auth_tag = pctx->auth_tag; crypto_gcm_verify() 579 u8 *iauth_tag = pctx->iauth_tag; crypto_gcm_verify() 591 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); gcm_decrypt_done() local 594 err = crypto_gcm_verify(req, pctx); gcm_decrypt_done() 601 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); gcm_dec_hash_done() local 602 struct ablkcipher_request *abreq = &pctx->u.abreq; gcm_dec_hash_done() 603 struct crypto_gcm_ghash_ctx *gctx = &pctx->ghash_ctx; gcm_dec_hash_done() 613 err = crypto_gcm_verify(req, pctx); gcm_dec_hash_done() 622 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); crypto_gcm_decrypt() local 623 struct ablkcipher_request *abreq = &pctx->u.abreq; crypto_gcm_decrypt() 624 struct crypto_gcm_ghash_ctx *gctx = &pctx->ghash_ctx; crypto_gcm_decrypt() 637 err = gcm_hash(req, pctx); crypto_gcm_decrypt() 648 return crypto_gcm_verify(req, pctx); crypto_gcm_decrypt() 229 gcm_hash_update(struct aead_request *req, struct crypto_gcm_req_priv_ctx *pctx, crypto_completion_t compl, struct scatterlist *src, unsigned int len) gcm_hash_update() argument 244 gcm_hash_remain(struct aead_request *req, struct crypto_gcm_req_priv_ctx *pctx, unsigned int remain, crypto_completion_t compl) gcm_hash_remain() argument 259 gcm_hash_len(struct aead_request *req, struct crypto_gcm_req_priv_ctx *pctx) gcm_hash_len() argument 278 gcm_hash_final(struct aead_request *req, struct crypto_gcm_req_priv_ctx *pctx) gcm_hash_final() argument 458 gcm_hash(struct aead_request *req, struct crypto_gcm_req_priv_ctx *pctx) gcm_hash() argument 507 gcm_enc_copy_hash(struct aead_request *req, struct crypto_gcm_req_priv_ctx *pctx) gcm_enc_copy_hash() argument 574 crypto_gcm_verify(struct aead_request *req, struct crypto_gcm_req_priv_ctx *pctx) crypto_gcm_verify() argument
|