1 #ifndef crypto_scalarmult_H 2 #define crypto_scalarmult_H 3 4 #include <stddef.h> 5 6 #include "crypto_scalarmult_curve25519.h" 7 #include "export.h" 8 9 #ifdef __cplusplus 10 extern "C" { 11 #endif 12 13 #define crypto_scalarmult_BYTES crypto_scalarmult_curve25519_BYTES 14 SODIUM_EXPORT 15 size_t crypto_scalarmult_bytes(void); 16 17 #define crypto_scalarmult_SCALARBYTES crypto_scalarmult_curve25519_SCALARBYTES 18 SODIUM_EXPORT 19 size_t crypto_scalarmult_scalarbytes(void); 20 21 #define crypto_scalarmult_PRIMITIVE "curve25519" 22 SODIUM_EXPORT 23 const char *crypto_scalarmult_primitive(void); 24 25 SODIUM_EXPORT 26 int crypto_scalarmult_base(unsigned char *q, const unsigned char *n); 27 28 /* 29 * NOTE: Do not use the result of this function directly. 30 * 31 * Hash the result with the public keys in order to compute a shared 32 * secret key: H(q || client_pk || server_pk) 33 * 34 * Or unless this is not an option, use the crypto_kx() API instead. 35 */ 36 SODIUM_EXPORT 37 int crypto_scalarmult(unsigned char *q, const unsigned char *n, 38 const unsigned char *p) 39 __attribute__ ((warn_unused_result)); 40 41 #ifdef __cplusplus 42 } 43 #endif 44 45 #endif 46