crypto_scalarmult_curve25519.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef crypto_scalarmult_curve25519_H
  2. #define crypto_scalarmult_curve25519_H
  3. #include <stddef.h>
  4. #include "export.h"
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. #define crypto_scalarmult_curve25519_BYTES 32U
  9. SODIUM_EXPORT
  10. size_t crypto_scalarmult_curve25519_bytes(void);
  11. #define crypto_scalarmult_curve25519_SCALARBYTES 32U
  12. SODIUM_EXPORT
  13. size_t crypto_scalarmult_curve25519_scalarbytes(void);
  14. /*
  15. * NOTE: Do not use the result of this function directly for key exchange.
  16. *
  17. * Hash the result with the public keys in order to compute a shared
  18. * secret key: H(q || client_pk || server_pk)
  19. *
  20. * Or unless this is not an option, use the crypto_kx() API instead.
  21. */
  22. SODIUM_EXPORT
  23. int crypto_scalarmult_curve25519(unsigned char *q, const unsigned char *n,
  24. const unsigned char *p)
  25. __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
  26. SODIUM_EXPORT
  27. int crypto_scalarmult_curve25519_base(unsigned char *q,
  28. const unsigned char *n)
  29. __attribute__ ((nonnull));
  30. #ifdef __cplusplus
  31. }
  32. #endif
  33. #endif