qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: LABBE Corentin <clabbe@baylibre.com>
Cc: b.galvani@gmail.com, Peter Maydell <peter.maydell@linaro.org>,
	qemu-arm@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH] hw/crypto: add Allwinner sun4i-ss crypto device
Date: Mon, 25 Apr 2022 15:29:32 +0100	[thread overview]
Message-ID: <YmawTE9AfYxyaZoo@redhat.com> (raw)
In-Reply-To: <YmacD3eroYTnjUdx@Red>

On Mon, Apr 25, 2022 at 03:03:11PM +0200, LABBE Corentin wrote:
> diff --git a/crypto/hash-nettle.c b/crypto/hash-nettle.c
> index 1ca1a41062..b9342b4fe1 100644
> --- a/crypto/hash-nettle.c
> +++ b/crypto/hash-nettle.c
> @@ -26,10 +26,22 @@
>  #include <nettle/sha.h>
>  #include <nettle/ripemd160.h>
>  
> +#ifndef nettle_sha256_compress
> +#define nettle_sha256_compress _nettle_sha256_compress
> +void _nettle_sha256_compress(uint32_t *state, const uint8_t *input, const uint32_t *k);
> +#endif
> +
> +#ifndef nettle_sha512_compress
> +#define nettle_sha512_compress _nettle_sha512_compress
> +void _nettle_sha512_compress(uint32_t *state, const uint8_t *input, const uint32_t *k);
> +#endif

The 'nettle_sha256_compress' function doesn't exist in any header file
from nettle that I've looked at.

The '_nettle_sha256_compress' function exists as a symbol in the .so
library, but it is clearly not intended for public usage:

$ nm -a -D /usr/lib64/libnettle.so | grep sha256_compress
0000000000027730 T _nettle_sha256_compress@@NETTLE_INTERNAL_8_4

So this #define magic is definitely not something we can do.

IOW, unless I'm missing something, I don't think we can even
use nettle for your desired goal, which leaves us no impl at
all.


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



  reply	other threads:[~2022-04-25 14:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-10 19:12 [PATCH] hw/crypto: add Allwinner sun4i-ss crypto device Corentin Labbe
2022-04-21 12:38 ` Peter Maydell
2022-04-21 13:18   ` Daniel P. Berrangé
2022-04-24 19:10   ` LABBE Corentin
2022-04-25 10:19     ` Daniel P. Berrangé
2022-04-25 13:03       ` LABBE Corentin
2022-04-25 14:29         ` Daniel P. Berrangé [this message]
2022-04-27  8:34           ` LABBE Corentin
2022-04-27  8:42             ` Daniel P. Berrangé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YmawTE9AfYxyaZoo@redhat.com \
    --to=berrange@redhat.com \
    --cc=b.galvani@gmail.com \
    --cc=clabbe@baylibre.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).