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 ?