lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20211113060119.GA21020@gondor.apana.org.au>
Date:   Sat, 13 Nov 2021 14:01:19 +0800
From:   Herbert Xu <herbert@...dor.apana.org.au>
To:     Kai Ye <yekai13@...wei.com>
Cc:     linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
        wangzhou1@...ilicon.com, liulongfang@...wei.com
Subject: Re: [PATCH v3 2/6] crypto: hisilicon/sec - add ahash alg features
 for Kunpeng920

On Fri, Oct 22, 2021 at 05:10:51PM +0800, Kai Ye wrote:
>
> +static int sec_ahash_export(struct ahash_request *req, void *out)
> +{
> +	/*
> +	 * This function dumps the
> +	 * entire state of the ongoing transformation into a provided block of
> +	 * data so it can be @import'ed back later on.
> +	 */
> +	struct sec_req *sreq = ahash_request_ctx(req);
> +	struct sec_auth_ctx *a_ctx = &sreq->ctx->a_ctx;
> +	u8 mac_len = a_ctx->mac_len;
> +
> +	memcpy(out, &sreq->hash_req, sizeof(struct sec_ahash_req));

So this structure seems to contain a bunch of metadata but not
the actual hash state.

> +	/* Export the partial hash data */
> +	memcpy(out + sizeof(struct sec_ahash_req), a_ctx->metamac, mac_len);

This looks like it could be the hash state, but mac_len is clamped
at digest size so it's way too small to contain the entire hash
state.

How is this supposed to work?

Thanks,
-- 
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ