On Mon, Apr 10, 2017 at 04:59:53PM +0800, Longpeng(Mike) wrote: > 1) makes the public APIs in hash-nettle/gcrypt/glib static, > and rename them with "nettle/gcrypt/glib" prefix. > > 2) introduces hash framework, including QCryptoHashDriver > and new public APIs. > > Signed-off-by: Longpeng(Mike) <longpe...@huawei.com> > --- > crypto/hash-gcrypt.c | 17 +++++++++++------ > crypto/hash-glib.c | 17 +++++++++++------ > crypto/hash-nettle.c | 17 +++++++++++------ > crypto/hash.c | 12 ++++++++++++ > include/crypto/hash.h | 12 ++++++++++++ > 5 files changed, 57 insertions(+), 18 deletions(-) >
> diff --git a/include/crypto/hash.h b/include/crypto/hash.h > index ca3267f..00b764e 100644 > --- a/include/crypto/hash.h > +++ b/include/crypto/hash.h > @@ -25,6 +25,18 @@ > > /* See also "QCryptoHashAlgorithm" defined in qapi/crypto.json */ > > +typedef struct QCryptoHashDriver QCryptoHashDriver; > +struct QCryptoHashDriver { > + int (*hash_bytesv)(QCryptoHashAlgorithm alg, > + const struct iovec *iov, > + size_t niov, > + uint8_t **result, > + size_t *resultlen, > + Error **errp); > +}; > + > +extern QCryptoHashDriver qcrypto_hash_lib_driver; This should be in a crypto/hashpriv.h header file, since again it is not something we want exposed. 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/ :|