qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: "Longpeng(Mike)" <longpeng2@huawei.com>
Cc: xuquan8@huawei.com, arei.gonglei@huawei.com, qemu-devel@nongnu.org
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	[thread overview]
Message-ID: <20170410100609.GF3655@redhat.com> (raw)
In-Reply-To: <1491814833-62792-1-git-send-email-longpeng2@huawei.com>

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) <longpeng2@huawei.com>
> ---
>  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	other threads:[~2017-04-10 10:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-10  9:00 [Qemu-devel] [PATCH for-2.10 11/19] crypto: hmac: add hmac driver framework Longpeng(Mike)
2017-04-10 10:06 ` Daniel P. Berrange [this message]

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=20170410100609.GF3655@redhat.com \
    --to=berrange@redhat.com \
    --cc=arei.gonglei@huawei.com \
    --cc=longpeng2@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=xuquan8@huawei.com \
    /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).