unsigned long flags;
unsigned long op;
+ u8 digest[SHA1_DIGEST_SIZE];
size_t digcnt;
u8 *buffer;
size_t bufcnt;
static void omap_sham_copy_hash(struct ahash_request *req, int out)
{
struct omap_sham_reqctx *ctx = ahash_request_ctx(req);
- u32 *hash = (u32 *)req->result;
+ u32 *hash = (u32 *)ctx->digest;
int i;
if (likely(ctx->flags & FLAGS_SHA1)) {
ctx->flags |= FLAGS_CLEAN;
spin_unlock_irqrestore(&dd->lock, flags);
- if (ctx->digcnt)
+ if (ctx->digcnt) {
clk_disable(dd->iclk);
+ memcpy(req->result, ctx->digest, (ctx->flags & FLAGS_SHA1) ?
+ SHA1_DIGEST_SIZE : MD5_DIGEST_SIZE);
+ }
if (ctx->dma_addr)
dma_unmap_single(dd->dev, ctx->dma_addr, ctx->buflen,
static int omap_sham_finish_req_hmac(struct ahash_request *req)
{
+ struct omap_sham_reqctx *ctx = ahash_request_ctx(req);
struct omap_sham_ctx *tctx = crypto_tfm_ctx(req->base.tfm);
struct omap_sham_hmac_ctx *bctx = tctx->base;
int bs = crypto_shash_blocksize(bctx->shash);
return crypto_shash_init(&desc.shash) ?:
crypto_shash_update(&desc.shash, bctx->opad, bs) ?:
- crypto_shash_finup(&desc.shash, req->result, ds, req->result);
+ crypto_shash_finup(&desc.shash, ctx->digest, ds, ctx->digest);
}
static void omap_sham_finish_req(struct ahash_request *req, int err)