libsodium (1.0.19)
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 __attribute__ ((nonnull));
28
29 /*
30 * NOTE: Do not use the result of this function directly for key exchange.
31 *
32 * Hash the result with the public keys in order to compute a shared
33 * secret key: H(q || client_pk || server_pk)
34 *
35 * Or unless this is not an option, use the crypto_kx() API instead.
36 */
37 SODIUM_EXPORT
38 int crypto_scalarmult(unsigned char *q, const unsigned char *n,
39 const unsigned char *p)
40 __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
41
42 #ifdef __cplusplus
43 }
44 #endif
45
46 #endif