Re: [Qemu-devel] [PATCH 06/10] crypto: add a nettle cipher implementation

2015-05-28 Thread Gonglei
On 2015/5/22 3:35, Richard Henderson wrote: > On 05/21/2015 03:56 AM, Daniel P. Berrange wrote: >> #ifdef CONFIG_GNUTLS_GCRYPT >> #include "crypto/cipher-gcrypt.c" >> #else >> +#ifdef CONFIG_GNUTLS_NETTLE >> +#include "crypto/cipher-nettle.c" >> +#else >> #include "crypto/cipher-builtin.c" >>

Re: [Qemu-devel] [PATCH 06/10] crypto: add a nettle cipher implementation

2015-05-22 Thread Daniel P. Berrange
On Thu, May 21, 2015 at 12:38:01PM -0700, Richard Henderson wrote: > On 05/21/2015 03:56 AM, Daniel P. Berrange wrote: > > +static uint8_t *qcrypto_cipher_munge_des_rfb_key(const uint8_t *key, > > + size_t nkey) > > +{ > > +uint8_t *ret = g_new0(u

Re: [Qemu-devel] [PATCH 06/10] crypto: add a nettle cipher implementation

2015-05-21 Thread Richard Henderson
On 05/21/2015 03:56 AM, Daniel P. Berrange wrote: > +static uint8_t *qcrypto_cipher_munge_des_rfb_key(const uint8_t *key, > + size_t nkey) > +{ > +uint8_t *ret = g_new0(uint8_t, nkey); > +size_t i; > +for (i = 0; i < nkey; i++) { > +

Re: [Qemu-devel] [PATCH 06/10] crypto: add a nettle cipher implementation

2015-05-21 Thread Richard Henderson
On 05/21/2015 03:56 AM, Daniel P. Berrange wrote: > #ifdef CONFIG_GNUTLS_GCRYPT > #include "crypto/cipher-gcrypt.c" > #else > +#ifdef CONFIG_GNUTLS_NETTLE > +#include "crypto/cipher-nettle.c" > +#else > #include "crypto/cipher-builtin.c" > #endif > +#endif #elif, please. r~

[Qemu-devel] [PATCH 06/10] crypto: add a nettle cipher implementation

2015-05-21 Thread Daniel P. Berrange
If we are linking to gnutls already and gnutls is built against nettle, then we should use nettle as a cipher backend in preference to our built-in backend. This will be used when linking against some GNUTLS 2.x versions and all GNUTLS 3.x versions. Signed-off-by: Daniel P. Berrange --- configu