Warning, file /include/sodium/crypto_kx.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 #ifndef crypto_kx_H
0002 #define crypto_kx_H
0003
0004 #include <stddef.h>
0005
0006 #include "export.h"
0007
0008 #ifdef __cplusplus
0009 # ifdef __GNUC__
0010 # pragma GCC diagnostic ignored "-Wlong-long"
0011 # endif
0012 extern "C" {
0013 #endif
0014
0015 #define crypto_kx_PUBLICKEYBYTES 32
0016 SODIUM_EXPORT
0017 size_t crypto_kx_publickeybytes(void);
0018
0019 #define crypto_kx_SECRETKEYBYTES 32
0020 SODIUM_EXPORT
0021 size_t crypto_kx_secretkeybytes(void);
0022
0023 #define crypto_kx_SEEDBYTES 32
0024 SODIUM_EXPORT
0025 size_t crypto_kx_seedbytes(void);
0026
0027 #define crypto_kx_SESSIONKEYBYTES 32
0028 SODIUM_EXPORT
0029 size_t crypto_kx_sessionkeybytes(void);
0030
0031 #define crypto_kx_PRIMITIVE "x25519blake2b"
0032 SODIUM_EXPORT
0033 const char *crypto_kx_primitive(void);
0034
0035 SODIUM_EXPORT
0036 int crypto_kx_seed_keypair(unsigned char pk[crypto_kx_PUBLICKEYBYTES],
0037 unsigned char sk[crypto_kx_SECRETKEYBYTES],
0038 const unsigned char seed[crypto_kx_SEEDBYTES])
0039 __attribute__ ((nonnull));
0040
0041 SODIUM_EXPORT
0042 int crypto_kx_keypair(unsigned char pk[crypto_kx_PUBLICKEYBYTES],
0043 unsigned char sk[crypto_kx_SECRETKEYBYTES])
0044 __attribute__ ((nonnull));
0045
0046 SODIUM_EXPORT
0047 int crypto_kx_client_session_keys(unsigned char rx[crypto_kx_SESSIONKEYBYTES],
0048 unsigned char tx[crypto_kx_SESSIONKEYBYTES],
0049 const unsigned char client_pk[crypto_kx_PUBLICKEYBYTES],
0050 const unsigned char client_sk[crypto_kx_SECRETKEYBYTES],
0051 const unsigned char server_pk[crypto_kx_PUBLICKEYBYTES])
0052 __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(3, 4, 5)));
0053
0054 SODIUM_EXPORT
0055 int crypto_kx_server_session_keys(unsigned char rx[crypto_kx_SESSIONKEYBYTES],
0056 unsigned char tx[crypto_kx_SESSIONKEYBYTES],
0057 const unsigned char server_pk[crypto_kx_PUBLICKEYBYTES],
0058 const unsigned char server_sk[crypto_kx_SECRETKEYBYTES],
0059 const unsigned char client_pk[crypto_kx_PUBLICKEYBYTES])
0060 __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(3, 4, 5)));
0061
0062 #ifdef __cplusplus
0063 }
0064 #endif
0065
0066 #endif