dh.h 823 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Diffie-Hellman secret to be used with kpp API along with helper functions
  3. *
  4. * Copyright (c) 2016, Intel Corporation
  5. * Authors: Salvatore Benedetto <salvatore.benedetto@intel.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License as published by the Free
  9. * Software Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. */
  13. #ifndef _CRYPTO_DH_
  14. #define _CRYPTO_DH_
  15. struct dh {
  16. void *key;
  17. void *p;
  18. void *g;
  19. unsigned int key_size;
  20. unsigned int p_size;
  21. unsigned int g_size;
  22. };
  23. int crypto_dh_key_len(const struct dh *params);
  24. int crypto_dh_encode_key(char *buf, unsigned int len, const struct dh *params);
  25. int crypto_dh_decode_key(const char *buf, unsigned int len, struct dh *params);
  26. #endif