crypto_scalarmult_ed25519.h (1406B)
1 2 #ifndef crypto_scalarmult_ed25519_H 3 #define crypto_scalarmult_ed25519_H 4 5 #include <stddef.h> 6 7 #include "export.h" 8 9 #ifdef __cplusplus 10 extern "C" { 11 #endif 12 13 #define crypto_scalarmult_ed25519_BYTES 32U 14 SODIUM_EXPORT 15 size_t crypto_scalarmult_ed25519_bytes(void); 16 17 #define crypto_scalarmult_ed25519_SCALARBYTES 32U 18 SODIUM_EXPORT 19 size_t crypto_scalarmult_ed25519_scalarbytes(void); 20 21 /* 22 * NOTE: Do not use the result of this function directly for key exchange. 23 * 24 * Hash the result with the public keys in order to compute a shared 25 * secret key: H(q || client_pk || server_pk) 26 * 27 * Or unless this is not an option, use the crypto_kx() API instead. 28 */ 29 SODIUM_EXPORT 30 int crypto_scalarmult_ed25519(unsigned char *q, const unsigned char *n, 31 const unsigned char *p) 32 __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); 33 34 SODIUM_EXPORT 35 int crypto_scalarmult_ed25519_noclamp(unsigned char *q, const unsigned char *n, 36 const unsigned char *p) 37 __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); 38 39 SODIUM_EXPORT 40 int crypto_scalarmult_ed25519_base(unsigned char *q, const unsigned char *n) 41 __attribute__ ((nonnull)); 42 43 SODIUM_EXPORT 44 int crypto_scalarmult_ed25519_base_noclamp(unsigned char *q, const unsigned char *n) 45 __attribute__ ((nonnull)); 46 47 #ifdef __cplusplus 48 } 49 #endif 50 51 #endif