Lines Matching defs:req
144 struct ahash_request *req;
286 struct ahash_request *req = dd->req;
294 if ((dd->is_async || dd->force_complete) && req->base.complete)
295 ahash_request_complete(req, err);
426 static int atmel_sha_init(struct ahash_request *req)
428 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
430 struct atmel_sha_reqctx *ctx = ahash_request_ctx(req);
475 struct atmel_sha_reqctx *ctx = ahash_request_ctx(dd->req);
564 struct atmel_sha_reqctx *ctx = ahash_request_ctx(dd->req);
594 struct atmel_sha_reqctx *ctx = ahash_request_ctx(dd->req);
640 struct atmel_sha_reqctx *ctx = ahash_request_ctx(dd->req);
705 struct atmel_sha_reqctx *ctx = ahash_request_ctx(dd->req);
736 struct atmel_sha_reqctx *ctx = ahash_request_ctx(dd->req);
761 struct atmel_sha_reqctx *ctx = ahash_request_ctx(dd->req);
856 struct atmel_sha_reqctx *ctx = ahash_request_ctx(dd->req);
877 struct ahash_request *req = dd->req;
878 struct atmel_sha_reqctx *ctx = ahash_request_ctx(req);
898 struct ahash_request *req = dd->req;
899 struct atmel_sha_reqctx *ctx = ahash_request_ctx(req);
922 static void atmel_sha_copy_hash(struct ahash_request *req)
924 struct atmel_sha_reqctx *ctx = ahash_request_ctx(req);
953 static void atmel_sha_copy_ready_hash(struct ahash_request *req)
955 struct atmel_sha_reqctx *ctx = ahash_request_ctx(req);
957 if (!req->result)
963 memcpy(req->result, ctx->digest, SHA1_DIGEST_SIZE);
967 memcpy(req->result, ctx->digest, SHA224_DIGEST_SIZE);
971 memcpy(req->result, ctx->digest, SHA256_DIGEST_SIZE);
975 memcpy(req->result, ctx->digest, SHA384_DIGEST_SIZE);
979 memcpy(req->result, ctx->digest, SHA512_DIGEST_SIZE);
984 static int atmel_sha_finish(struct ahash_request *req)
986 struct atmel_sha_reqctx *ctx = ahash_request_ctx(req);
990 atmel_sha_copy_ready_hash(req);
998 static void atmel_sha_finish_req(struct ahash_request *req, int err)
1000 struct atmel_sha_reqctx *ctx = ahash_request_ctx(req);
1004 atmel_sha_copy_hash(req);
1006 err = atmel_sha_finish(req);
1055 struct ahash_request *req)
1064 if (req)
1065 ret = ahash_enqueue_request(&dd->queue, req);
1087 dd->req = ahash_request_cast(async_req);
1088 start_async = (dd->req != req);
1101 struct ahash_request *req = dd->req;
1102 struct atmel_sha_reqctx *ctx = ahash_request_ctx(req);
1105 dev_dbg(dd->dev, "handling new req, op: %lu, nbytes: %u\n",
1106 ctx->op, req->nbytes);
1143 atmel_sha_finish_req(req, err);
1150 static int atmel_sha_enqueue(struct ahash_request *req, unsigned int op)
1152 struct atmel_sha_reqctx *ctx = ahash_request_ctx(req);
1153 struct atmel_sha_ctx *tctx = crypto_tfm_ctx(req->base.tfm);
1158 return atmel_sha_handle_queue(dd, req);
1161 static int atmel_sha_update(struct ahash_request *req)
1163 struct atmel_sha_reqctx *ctx = ahash_request_ctx(req);
1165 if (!req->nbytes)
1168 ctx->total = req->nbytes;
1169 ctx->sg = req->src;
1180 return atmel_sha_enqueue(req, SHA_OP_UPDATE);
1183 static int atmel_sha_final(struct ahash_request *req)
1185 struct atmel_sha_reqctx *ctx = ahash_request_ctx(req);
1194 return atmel_sha_finish(req);
1196 return atmel_sha_enqueue(req, SHA_OP_FINAL);
1199 static int atmel_sha_finup(struct ahash_request *req)
1201 struct atmel_sha_reqctx *ctx = ahash_request_ctx(req);
1206 err1 = atmel_sha_update(req);
1208 (err1 == -EBUSY && (ahash_request_flags(req) &
1216 err2 = atmel_sha_final(req);
1221 static int atmel_sha_digest(struct ahash_request *req)
1223 return atmel_sha_init(req) ?: atmel_sha_finup(req);
1227 static int atmel_sha_export(struct ahash_request *req, void *out)
1229 const struct atmel_sha_reqctx *ctx = ahash_request_ctx(req);
1235 static int atmel_sha_import(struct ahash_request *req, const void *in)
1237 struct atmel_sha_reqctx *ctx = ahash_request_ctx(req);
1350 atmel_sha_finish_req(dd->req, err);
1393 struct ahash_request *req = dd->req;
1394 struct atmel_sha_reqctx *ctx = ahash_request_ctx(req);
1502 struct ahash_request *req = dd->req;
1503 struct atmel_sha_reqctx *ctx = ahash_request_ctx(req);
1556 struct ahash_request *req = dd->req;
1557 struct atmel_sha_reqctx *ctx = ahash_request_ctx(req);
1588 struct ahash_request *req = dd->req;
1589 struct atmel_sha_reqctx *ctx = ahash_request_ctx(req);
1686 struct ahash_request *req = dd->req;
1687 struct atmel_sha_reqctx *ctx = ahash_request_ctx(req);
1688 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
1748 struct ahash_request *req = dd->req;
1749 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
1751 struct atmel_sha_reqctx *ctx = ahash_request_ctx(req);
1765 struct ahash_request *req = dd->req;
1766 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
1768 struct atmel_sha_reqctx *ctx = ahash_request_ctx(req);
1785 struct ahash_request *req = dd->req;
1786 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
1788 struct atmel_sha_reqctx *ctx = ahash_request_ctx(req);
1801 struct ahash_request *req = dd->req;
1802 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
1804 struct atmel_sha_reqctx *ctx = ahash_request_ctx(req);
1816 struct ahash_request *req = dd->req;
1817 struct atmel_sha_reqctx *ctx = ahash_request_ctx(req);
1858 static int atmel_sha_hmac_init(struct ahash_request *req)
1862 err = atmel_sha_init(req);
1866 return atmel_sha_enqueue(req, SHA_OP_INIT);
1871 struct ahash_request *req = dd->req;
1872 struct atmel_sha_reqctx *ctx = ahash_request_ctx(req);
1873 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
1888 struct ahash_request *req = dd->req;
1889 struct atmel_sha_reqctx *ctx = ahash_request_ctx(req);
1890 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
1925 * req->result might not be sizeof(u32) aligned, so copy the
1927 * req->result.
1929 atmel_sha_copy_hash(dd->req);
1930 atmel_sha_copy_ready_hash(dd->req);
1934 static int atmel_sha_hmac_digest(struct ahash_request *req)
1938 err = atmel_sha_init(req);
1942 return atmel_sha_enqueue(req, SHA_OP_DIGEST);
1947 struct ahash_request *req = dd->req;
1948 struct atmel_sha_reqctx *ctx = ahash_request_ctx(req);
1949 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
1958 if (!req->nbytes) {
1959 req->nbytes = 0;
1979 if (req->nbytes > ATMEL_SHA_DMA_THRESHOLD &&
1980 atmel_sha_dma_check_aligned(dd, req->src, req->nbytes))
2001 atmel_sha_write(dd, SHA_MSR, req->nbytes);
2002 atmel_sha_write(dd, SHA_BCR, req->nbytes);
2007 if (!req->nbytes) {
2009 req->nbytes = ctx->bufcnt;
2011 sgbuf = req->src;
2016 return atmel_sha_dma_start(dd, sgbuf, req->nbytes,
2019 return atmel_sha_cpu_start(dd, sgbuf, req->nbytes, false, true,
2131 struct ahash_request *req = data;
2132 struct atmel_sha_authenc_reqctx *authctx = ahash_request_ctx(req);
2139 struct ahash_request *req = dd->req;
2140 struct atmel_sha_authenc_reqctx *authctx = ahash_request_ctx(req);
2144 * Force atmel_sha_complete() to call req->base.complete(), ie
2245 int atmel_sha_authenc_schedule(struct ahash_request *req,
2250 struct atmel_sha_authenc_reqctx *authctx = ahash_request_ctx(req);
2269 ahash_request_set_tfm(req, tfm);
2270 ahash_request_set_callback(req, 0, atmel_sha_authenc_complete, req);
2272 return atmel_sha_handle_queue(dd, req);
2276 int atmel_sha_authenc_init(struct ahash_request *req,
2282 struct atmel_sha_authenc_reqctx *authctx = ahash_request_ctx(req);
2284 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
2304 struct ahash_request *req = dd->req;
2305 struct atmel_sha_authenc_reqctx *authctx = ahash_request_ctx(req);
2307 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
2341 struct ahash_request *req = dd->req;
2342 struct atmel_sha_authenc_reqctx *authctx = ahash_request_ctx(req);
2347 int atmel_sha_authenc_final(struct ahash_request *req,
2352 struct atmel_sha_authenc_reqctx *authctx = ahash_request_ctx(req);
2393 struct ahash_request *req = dd->req;
2394 struct atmel_sha_authenc_reqctx *authctx = ahash_request_ctx(req);
2403 void atmel_sha_authenc_abort(struct ahash_request *req)
2405 struct atmel_sha_authenc_reqctx *authctx = ahash_request_ctx(req);
2409 /* Prevent atmel_sha_complete() from calling req->base.complete(). */