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] [thread-next>] [day] [month] [year] [list]
Message-ID: <7041bf01-d91f-3149-e8ba-5db4ba59f9bb@linux.microsoft.com>
Date:   Wed, 13 Jul 2022 00:24:45 -0700
From:   Dhananjay Phadke <dphadke@...ux.microsoft.com>
To:     Neal Liu <neal_liu@...eedtech.com>,
        Corentin Labbe <clabbe.montjoie@...il.com>,
        Christophe JAILLET <christophe.jaillet@...adoo.fr>,
        Randy Dunlap <rdunlap@...radead.org>,
        Herbert Xu <herbert@...dor.apana.org.au>,
        "David S . Miller" <davem@...emloft.net>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Joel Stanley <joel@....id.au>,
        Andrew Jeffery <andrew@...id.au>,
        Dhananjay Phadke <dhphadke@...rosoft.com>,
        Johnny Huang <johnny_huang@...eedtech.com>
Cc:     linux-aspeed@...ts.ozlabs.org, linux-crypto@...r.kernel.org,
        devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org, BMC-SW@...eedtech.com
Subject: Re: [PATCH v7 1/5] crypto: aspeed: Add HACE hash driver

On 7/12/2022 10:32 PM, Dhananjay Phadke wrote:
>> +static void aspeed_ahash_iV(struct aspeed_sham_reqctx *rctx)
>> +{
>> +    if (rctx->flags & SHA_FLAGS_SHA1)
>> +        memcpy(rctx->digest, sha1_iv, 32);
>> +    else if (rctx->flags & SHA_FLAGS_SHA224)
>> +        memcpy(rctx->digest, sha224_iv, 32);
>> +    else if (rctx->flags & SHA_FLAGS_SHA256)
>> +        memcpy(rctx->digest, sha256_iv, 32);
>> +    else if (rctx->flags & SHA_FLAGS_SHA384)
>> +        memcpy(rctx->digest, sha384_iv, 64);
>> +    else if (rctx->flags & SHA_FLAGS_SHA512)
>> +        memcpy(rctx->digest, sha512_iv, 64);
>> +    else if (rctx->flags & SHA_FLAGS_SHA512_224)
>> +        memcpy(rctx->digest, sha512_224_iv, 64);
>> +    else if (rctx->flags & SHA_FLAGS_SHA512_256)
>> +        memcpy(rctx->digest, sha512_256_iv, 64);
>> +}
> 
> Can use the "digsize" from reqctx to memcpy() instead lots of if..else
> conditionals for every request?

Sorry, meant pre-initialized ivsize not digsize, which could be
in alg wrapper structure (aspeed_hace_alg).

Thanks,
Dhananjay

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ