qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH for-2.10 11/19] crypto: hmac: add hmac driver fr


From: Daniel P. Berrange
Subject: Re: [Qemu-devel] [PATCH for-2.10 11/19] crypto: hmac: add hmac driver framework
Date: Mon, 10 Apr 2017 11:06:09 +0100
User-agent: Mutt/1.7.1 (2016-10-04)

On Mon, Apr 10, 2017 at 05:00:33PM +0800, Longpeng(Mike) wrote:
> 1) makes the public APIs in hmac-nettle/gcrypt/glib static,
>    and rename them with "nettle/gcrypt/glib" prefix.
> 
> 2) introduces hmac framework, including QCryptoHmacDriver
>    and new public APIs.
> 
> Signed-off-by: Longpeng(Mike) <address@hidden>
> ---
>  crypto/hmac-gcrypt.c  | 48 +++++++++++------------------------
>  crypto/hmac-glib.c    | 70 
> ++++++++++++++++++---------------------------------
>  crypto/hmac-nettle.c  | 49 +++++++++++-------------------------
>  crypto/hmac.c         | 39 ++++++++++++++++++++++++++++
>  include/crypto/hmac.h | 20 +++++++++++++++
>  5 files changed, 112 insertions(+), 114 deletions(-)
> 

> diff --git a/include/crypto/hmac.h b/include/crypto/hmac.h
> index 0d3acd7..6f63eb8 100644
> --- a/include/crypto/hmac.h
> +++ b/include/crypto/hmac.h
> @@ -14,12 +14,32 @@
>  
>  #include "qapi-types.h"
>  
> +typedef struct QCryptoHmacDriver QCryptoHmacDriver;
>  typedef struct QCryptoHmac QCryptoHmac;
> +
>  struct QCryptoHmac {
> +    QCryptoHmacDriver *driver;
>      QCryptoHashAlgorithm alg;
>      void *opaque;
>  };
>  
> +struct QCryptoHmacDriver {
> +    int (*hmac_bytesv)(QCryptoHmac *hmac,
> +                       const struct iovec *iov,
> +                       size_t niov,
> +                       uint8_t **result,
> +                       size_t *resultlen,
> +                       Error **errp);
> +
> +    void (*hmac_free)(QCryptoHmac *hmac);
> +};
> +
> +extern void *qcrypto_hmac_ctx_new(QCryptoHashAlgorithm alg,
> +                                  const uint8_t *key, size_t nkey,
> +                                  Error **errp);
> +extern QCryptoHmacDriver qcrypto_hmac_lib_driver;

Again, we want to have  a crypto/hmacpriv.h header file for this stuff.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|



reply via email to

[Prev in Thread] Current Thread [Next in Thread]