4 * Copyright (c) 2013-2019
5 * Frank Denis <j at pureftpd dot org>
7 * Permission to use, copy, modify, and/or distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 #ifndef x25519_ref10_H
21 #define x25519_ref10_H
29 #define crypto_scalarmult_curve25519_BYTES 32U
30 size_t crypto_scalarmult_curve25519_bytes(void);
32 #define crypto_scalarmult_curve25519_SCALARBYTES 32U
33 size_t crypto_scalarmult_curve25519_scalarbytes(void);
36 * NOTE: Do not use the result of this function directly for key exchange.
38 * Hash the result with the public keys in order to compute a shared
39 * secret key: H(q || client_pk || server_pk)
41 * Or unless this is not an option, use the crypto_kx() API instead.
43 #define crypto_scalarmult_curve25519 hc_hcrypto_scalarmult_curve25519
44 int crypto_scalarmult_curve25519(unsigned char *q, const unsigned char *n,
45 const unsigned char *p);
47 #define crypto_scalarmult_curve25519_base hc_hcrypto_scalarmult_curve25519_base
48 int crypto_scalarmult_curve25519_base(unsigned char *q,
49 const unsigned char *n);