[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] hw/crypto: add Allwinner sun4i-ss crypto device
From: |
Daniel P . Berrangé |
Subject: |
Re: [PATCH] hw/crypto: add Allwinner sun4i-ss crypto device |
Date: |
Wed, 27 Apr 2022 09:42:49 +0100 |
User-agent: |
Mutt/2.1.5 (2021-12-30) |
On Wed, Apr 27, 2022 at 10:34:24AM +0200, LABBE Corentin wrote:
> Le Mon, Apr 25, 2022 at 03:29:32PM +0100, Daniel P. Berrangé a écrit :
> > 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.
>
> sha256 is only necessary for the upcomming sun8i-ce, so it do not block
> sun4i-ss.
> I try to contact nettle to add necessary headers.
>
> So for sun4i-ss, what do you think about my qcrypto_nettle_compress
> implementation ?
It is reasonable in general.
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 :|