Lines Matching refs:req_ctx

1090 	struct artpec6_crypto_request_context *req_ctx = NULL;
1094 req_ctx = skcipher_request_ctx(req);
1100 req_ctx->decrypt = 0;
1115 ret = artpec6_crypto_common_init(&req_ctx->common,
1124 artpec6_crypto_common_destroy(&req_ctx->common);
1128 return artpec6_crypto_submit(&req_ctx->common);
1136 struct artpec6_crypto_request_context *req_ctx = NULL;
1139 req_ctx = skcipher_request_ctx(req);
1145 req_ctx->decrypt = 1;
1161 ret = artpec6_crypto_common_init(&req_ctx->common, &req->base,
1169 artpec6_crypto_common_destroy(&req_ctx->common);
1173 return artpec6_crypto_submit(&req_ctx->common);
1265 struct artpec6_crypto_aead_req_ctx *req_ctx = aead_request_ctx(req);
1267 req_ctx->decrypt = false;
1268 ret = artpec6_crypto_common_init(&req_ctx->common, &req->base,
1276 artpec6_crypto_common_destroy(&req_ctx->common);
1280 return artpec6_crypto_submit(&req_ctx->common);
1286 struct artpec6_crypto_aead_req_ctx *req_ctx = aead_request_ctx(req);
1288 req_ctx->decrypt = true;
1292 ret = artpec6_crypto_common_init(&req_ctx->common,
1301 artpec6_crypto_common_destroy(&req_ctx->common);
1305 return artpec6_crypto_submit(&req_ctx->common);
1311 struct artpec6_hash_request_context *req_ctx = ahash_request_ctx(areq);
1316 struct artpec6_crypto_req_common *common = &req_ctx->common;
1327 if (req_ctx->hash_flags & HASH_FLAG_HMAC) {
1329 req_ctx->key_md = FIELD_PREP(A6_CRY_MD_OPER,
1332 req_ctx->key_md = FIELD_PREP(A7_CRY_MD_OPER,
1337 memcpy(req_ctx->key_buffer, ctx->hmac_key,
1339 memset(req_ctx->key_buffer + ctx->hmac_key_length, 0,
1343 (void *)&req_ctx->key_md,
1344 sizeof(req_ctx->key_md), false, false);
1349 req_ctx->key_buffer, blocksize,
1355 if (!(req_ctx->hash_flags & HASH_FLAG_INIT_CTX)) {
1364 req_ctx->hash_md &= ~A6_CRY_MD_HASH_SEL_CTX;
1365 req_ctx->hash_md |= FIELD_PREP(A6_CRY_MD_HASH_SEL_CTX, sel_ctx);
1368 if (req_ctx->hash_flags & HASH_FLAG_FINALIZE)
1369 req_ctx->hash_md |= A6_CRY_MD_HASH_HMAC_FIN;
1371 req_ctx->hash_md &= ~A7_CRY_MD_HASH_SEL_CTX;
1372 req_ctx->hash_md |= FIELD_PREP(A7_CRY_MD_HASH_SEL_CTX, sel_ctx);
1375 if (req_ctx->hash_flags & HASH_FLAG_FINALIZE)
1376 req_ctx->hash_md |= A7_CRY_MD_HASH_HMAC_FIN;
1381 (void *)&req_ctx->hash_md,
1382 sizeof(req_ctx->hash_md), false, false);
1392 req_ctx->digeststate,
1399 if (req_ctx->hash_flags & HASH_FLAG_UPDATE) {
1401 size_t total_bytes = areq->nbytes + req_ctx->partial_bytes;
1406 if (req_ctx->partial_bytes && ready_bytes) {
1411 memcpy(req_ctx->partial_buffer_out,
1412 req_ctx->partial_buffer,
1413 req_ctx->partial_bytes);
1416 req_ctx->partial_buffer_out,
1417 req_ctx->partial_bytes,
1423 done_bytes += req_ctx->partial_bytes;
1424 req_ctx->partial_bytes = 0;
1440 req_ctx->partial_buffer +
1441 req_ctx->partial_bytes,
1444 req_ctx->partial_bytes += sg_rem;
1447 req_ctx->digcnt += ready_bytes;
1448 req_ctx->hash_flags &= ~(HASH_FLAG_UPDATE);
1452 if (req_ctx->hash_flags & HASH_FLAG_FINALIZE) {
1458 oper = FIELD_GET(A6_CRY_MD_OPER, req_ctx->hash_md);
1460 oper = FIELD_GET(A7_CRY_MD_OPER, req_ctx->hash_md);
1463 if (req_ctx->partial_bytes) {
1464 memcpy(req_ctx->partial_buffer_out,
1465 req_ctx->partial_buffer,
1466 req_ctx->partial_bytes);
1468 req_ctx->partial_buffer_out,
1469 req_ctx->partial_bytes,
1474 req_ctx->digcnt += req_ctx->partial_bytes;
1475 req_ctx->partial_bytes = 0;
1478 if (req_ctx->hash_flags & HASH_FLAG_HMAC)
1479 digest_bits = 8 * (req_ctx->digcnt + blocksize);
1481 digest_bits = 8 * req_ctx->digcnt;
1484 hash_pad_len = create_hash_pad(oper, req_ctx->pad_buffer,
1485 req_ctx->digcnt, digest_bits);
1487 req_ctx->pad_buffer,
1490 req_ctx->digcnt = 0;
1508 req_ctx->digeststate,
1515 req_ctx->hash_flags &= ~(HASH_FLAG_INIT_CTX | HASH_FLAG_UPDATE |
1666 struct artpec6_crypto_request_context *req_ctx = NULL;
1676 req_ctx = skcipher_request_ctx(areq);
1677 common = &req_ctx->common;
1696 req_ctx->cipher_md = 0;
1723 cipher_decr = req_ctx->decrypt;
1728 cipher_decr = req_ctx->decrypt;
1738 cipher_decr = req_ctx->decrypt;
1741 req_ctx->cipher_md |= A6_CRY_MD_CIPHER_DSEQ;
1743 req_ctx->cipher_md |= A7_CRY_MD_CIPHER_DSEQ;
1753 req_ctx->cipher_md |= FIELD_PREP(A6_CRY_MD_OPER, oper);
1754 req_ctx->cipher_md |= FIELD_PREP(A6_CRY_MD_CIPHER_LEN,
1757 req_ctx->cipher_md |= A6_CRY_MD_CIPHER_DECR;
1759 req_ctx->cipher_md |= FIELD_PREP(A7_CRY_MD_OPER, oper);
1760 req_ctx->cipher_md |= FIELD_PREP(A7_CRY_MD_CIPHER_LEN,
1763 req_ctx->cipher_md |= A7_CRY_MD_CIPHER_DECR;
1767 &req_ctx->cipher_md,
1768 sizeof(req_ctx->cipher_md),
1833 struct artpec6_crypto_aead_req_ctx *req_ctx = aead_request_ctx(areq);
1835 struct artpec6_crypto_req_common *common = &req_ctx->common;
1860 req_ctx->cipher_md = 0;
1877 req_ctx->cipher_md |= FIELD_PREP(A6_CRY_MD_OPER,
1879 req_ctx->cipher_md |= FIELD_PREP(A6_CRY_MD_CIPHER_LEN,
1881 if (req_ctx->decrypt)
1882 req_ctx->cipher_md |= A6_CRY_MD_CIPHER_DECR;
1884 req_ctx->cipher_md |= FIELD_PREP(A7_CRY_MD_OPER,
1886 req_ctx->cipher_md |= FIELD_PREP(A7_CRY_MD_CIPHER_LEN,
1888 if (req_ctx->decrypt)
1889 req_ctx->cipher_md |= A7_CRY_MD_CIPHER_DECR;
1893 (void *) &req_ctx->cipher_md,
1894 sizeof(req_ctx->cipher_md), false,
1905 if (req_ctx->decrypt)
1909 req_ctx->hw_ctx.aad_length_bits =
1912 req_ctx->hw_ctx.text_length_bits =
1915 memcpy(req_ctx->hw_ctx.J0, areq->iv, crypto_aead_ivsize(cipher));
1917 memcpy(req_ctx->hw_ctx.J0 + GCM_AES_IV_SIZE, "\x00\x00\x00\x01", 4);
1919 ret = artpec6_crypto_setup_out_descr(common, &req_ctx->hw_ctx,
1970 if (req_ctx->decrypt)
2001 if (req_ctx->decrypt) {
2003 req_ctx->decryption_tag, AES_BLOCK_SIZE, false);
2187 struct artpec6_crypto_aead_req_ctx *req_ctx = aead_request_ctx(areq);
2189 if (req_ctx->decrypt) {
2200 if (crypto_memneq(req_ctx->decryption_tag,
2207 req_ctx->decryption_tag,
2262 struct artpec6_hash_request_context *req_ctx = ahash_request_ctx(req);
2265 memset(req_ctx, 0, sizeof(*req_ctx));
2267 req_ctx->hash_flags = HASH_FLAG_INIT_CTX;
2269 req_ctx->hash_flags |= (HASH_FLAG_HMAC | HASH_FLAG_UPDATE_KEY);
2284 req_ctx->hash_md = FIELD_PREP(A6_CRY_MD_OPER, oper);
2286 req_ctx->hash_md = FIELD_PREP(A7_CRY_MD_OPER, oper);
2293 struct artpec6_hash_request_context *req_ctx = ahash_request_ctx(req);
2296 if (!req_ctx->common.dma) {
2297 ret = artpec6_crypto_common_init(&req_ctx->common,
2309 ret = artpec6_crypto_submit(&req_ctx->common);
2317 artpec6_crypto_common_destroy(&req_ctx->common);
2326 struct artpec6_hash_request_context *req_ctx = ahash_request_ctx(req);
2328 req_ctx->hash_flags |= HASH_FLAG_FINALIZE;
2335 struct artpec6_hash_request_context *req_ctx = ahash_request_ctx(req);
2337 req_ctx->hash_flags |= HASH_FLAG_UPDATE;
2349 struct artpec6_hash_request_context *req_ctx = ahash_request_ctx(req);
2353 req_ctx->hash_flags |= HASH_FLAG_UPDATE | HASH_FLAG_FINALIZE;
2365 struct artpec6_hash_request_context *req_ctx = ahash_request_ctx(req);
2368 req_ctx->hash_flags |= HASH_FLAG_UPDATE | HASH_FLAG_FINALIZE;
2380 struct artpec6_hash_request_context *req_ctx = ahash_request_ctx(req);
2383 req_ctx->hash_flags |= HASH_FLAG_UPDATE | HASH_FLAG_FINALIZE;