/* * ISC License * * Copyright (c) 2013-2019 * Frank Denis * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef x25519_ref10_H #define x25519_ref10_H #include #ifdef __cplusplus extern "C" { #endif #define crypto_scalarmult_curve25519_BYTES 32U size_t crypto_scalarmult_curve25519_bytes(void); #define crypto_scalarmult_curve25519_SCALARBYTES 32U size_t crypto_scalarmult_curve25519_scalarbytes(void); /* * NOTE: Do not use the result of this function directly for key exchange. * * Hash the result with the public keys in order to compute a shared * secret key: H(q || client_pk || server_pk) * * Or unless this is not an option, use the crypto_kx() API instead. */ #define crypto_scalarmult_curve25519 hc_hcrypto_scalarmult_curve25519 int crypto_scalarmult_curve25519(unsigned char *q, const unsigned char *n, const unsigned char *p); #define crypto_scalarmult_curve25519_base hc_hcrypto_scalarmult_curve25519_base int crypto_scalarmult_curve25519_base(unsigned char *q, const unsigned char *n); #ifdef __cplusplus } #endif #endif