2
0

hmacpriv.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * QEMU Crypto hmac driver supports
  3. *
  4. * Copyright (c) 2017 HUAWEI TECHNOLOGIES CO., LTD.
  5. *
  6. * Authors:
  7. * Longpeng(Mike) <longpeng2@huawei.com>
  8. *
  9. * This work is licensed under the terms of the GNU GPL, version 2 or
  10. * (at your option) any later version. See the COPYING file in the
  11. * top-level directory.
  12. *
  13. */
  14. #ifndef QCRYPTO_HMACPRIV_H
  15. #define QCRYPTO_HMACPRIV_H
  16. typedef struct QCryptoHmacDriver QCryptoHmacDriver;
  17. struct QCryptoHmacDriver {
  18. int (*hmac_bytesv)(QCryptoHmac *hmac,
  19. const struct iovec *iov,
  20. size_t niov,
  21. uint8_t **result,
  22. size_t *resultlen,
  23. Error **errp);
  24. void (*hmac_free)(QCryptoHmac *hmac);
  25. };
  26. extern void *qcrypto_hmac_ctx_new(QCryptoHashAlgorithm alg,
  27. const uint8_t *key, size_t nkey,
  28. Error **errp);
  29. extern QCryptoHmacDriver qcrypto_hmac_lib_driver;
  30. #ifdef CONFIG_AF_ALG
  31. #include "afalgpriv.h"
  32. extern QCryptoAFAlg *
  33. qcrypto_afalg_hmac_ctx_new(QCryptoHashAlgorithm alg,
  34. const uint8_t *key, size_t nkey,
  35. Error **errp);
  36. extern QCryptoHmacDriver qcrypto_hmac_afalg_driver;
  37. #endif
  38. #endif