1 1.1 riastrad #ifndef crypto_scalarmult_H 2 1.1 riastrad #define crypto_scalarmult_H 3 1.1 riastrad 4 1.1 riastrad #if 0 5 1.1 riastrad #include <stddef.h> 6 1.1 riastrad #endif 7 1.1 riastrad #include "crypto_scalarmult_curve25519.h" 8 1.1 riastrad #include "export.h" 9 1.1 riastrad 10 1.1 riastrad #ifdef __cplusplus 11 1.1 riastrad extern "C" { 12 1.1 riastrad #endif 13 1.1 riastrad 14 1.1 riastrad #define crypto_scalarmult_BYTES crypto_scalarmult_curve25519_BYTES 15 1.1 riastrad SODIUM_EXPORT 16 1.1 riastrad size_t crypto_scalarmult_bytes(void); 17 1.1 riastrad 18 1.1 riastrad #define crypto_scalarmult_SCALARBYTES crypto_scalarmult_curve25519_SCALARBYTES 19 1.1 riastrad SODIUM_EXPORT 20 1.1 riastrad size_t crypto_scalarmult_scalarbytes(void); 21 1.1 riastrad 22 1.1 riastrad #define crypto_scalarmult_PRIMITIVE "curve25519" 23 1.1 riastrad SODIUM_EXPORT 24 1.1 riastrad const char *crypto_scalarmult_primitive(void); 25 1.1 riastrad 26 1.1 riastrad SODIUM_EXPORT 27 1.1 riastrad int crypto_scalarmult_base(unsigned char *q, const unsigned char *n); 28 1.1 riastrad 29 1.1 riastrad /* 30 1.1 riastrad * NOTE: Do not use the result of this function directly. 31 1.1 riastrad * 32 1.1 riastrad * Hash the result with the public keys in order to compute a shared 33 1.1 riastrad * secret key: H(q || client_pk || server_pk) 34 1.1 riastrad * 35 1.1 riastrad * Or unless this is not an option, use the crypto_kx() API instead. 36 1.1 riastrad */ 37 1.1 riastrad SODIUM_EXPORT 38 1.1 riastrad int crypto_scalarmult(unsigned char *q, const unsigned char *n, 39 1.1 riastrad const unsigned char *p) 40 1.1 riastrad __attribute__ ((warn_unused_result)); 41 1.1 riastrad 42 1.1 riastrad #ifdef __cplusplus 43 1.1 riastrad } 44 1.1 riastrad #endif 45 1.1 riastrad 46 1.1 riastrad #endif 47 1.1 riastrad #ifndef crypto_scalarmult_H 48 1.1 riastrad #define crypto_scalarmult_H 49 1.1 riastrad 50 1.1 riastrad #if 0 51 1.1 riastrad #include <stddef.h> 52 1.1 riastrad #endif 53 1.1 riastrad #include "crypto_scalarmult_curve25519.h" 54 1.1 riastrad #include "export.h" 55 1.1 riastrad 56 1.1 riastrad #ifdef __cplusplus 57 1.1 riastrad extern "C" { 58 1.1 riastrad #endif 59 1.1 riastrad 60 1.1 riastrad #define crypto_scalarmult_BYTES crypto_scalarmult_curve25519_BYTES 61 1.1 riastrad SODIUM_EXPORT 62 1.1 riastrad size_t crypto_scalarmult_bytes(void); 63 1.1 riastrad 64 1.1 riastrad #define crypto_scalarmult_SCALARBYTES crypto_scalarmult_curve25519_SCALARBYTES 65 1.1 riastrad SODIUM_EXPORT 66 1.1 riastrad size_t crypto_scalarmult_scalarbytes(void); 67 1.1 riastrad 68 1.1 riastrad #define crypto_scalarmult_PRIMITIVE "curve25519" 69 1.1 riastrad SODIUM_EXPORT 70 1.1 riastrad const char *crypto_scalarmult_primitive(void); 71 1.1 riastrad 72 1.1 riastrad SODIUM_EXPORT 73 1.1 riastrad int crypto_scalarmult_base(unsigned char *q, const unsigned char *n); 74 1.1 riastrad 75 1.1 riastrad /* 76 1.1 riastrad * NOTE: Do not use the result of this function directly. 77 1.1 riastrad * 78 1.1 riastrad * Hash the result with the public keys in order to compute a shared 79 1.1 riastrad * secret key: H(q || client_pk || server_pk) 80 1.1 riastrad * 81 1.1 riastrad * Or unless this is not an option, use the crypto_kx() API instead. 82 1.1 riastrad */ 83 1.1 riastrad SODIUM_EXPORT 84 1.1 riastrad int crypto_scalarmult(unsigned char *q, const unsigned char *n, 85 1.1 riastrad const unsigned char *p) 86 1.1 riastrad __attribute__ ((warn_unused_result)); 87 1.1 riastrad 88 1.1 riastrad #ifdef __cplusplus 89 1.1 riastrad } 90 1.1 riastrad #endif 91 1.1 riastrad 92 1.1 riastrad #endif 93 1.1 riastrad #ifndef crypto_scalarmult_H 94 1.1 riastrad #define crypto_scalarmult_H 95 1.1 riastrad 96 1.1 riastrad #if 0 97 1.1 riastrad #include <stddef.h> 98 1.1 riastrad #endif 99 1.1 riastrad #include "crypto_scalarmult_curve25519.h" 100 1.1 riastrad #include "export.h" 101 1.1 riastrad 102 1.1 riastrad #ifdef __cplusplus 103 1.1 riastrad extern "C" { 104 1.1 riastrad #endif 105 1.1 riastrad 106 1.1 riastrad #define crypto_scalarmult_BYTES crypto_scalarmult_curve25519_BYTES 107 1.1 riastrad SODIUM_EXPORT 108 1.1 riastrad size_t crypto_scalarmult_bytes(void); 109 1.1 riastrad 110 1.1 riastrad #define crypto_scalarmult_SCALARBYTES crypto_scalarmult_curve25519_SCALARBYTES 111 1.1 riastrad SODIUM_EXPORT 112 1.1 riastrad size_t crypto_scalarmult_scalarbytes(void); 113 1.1 riastrad 114 1.1 riastrad #define crypto_scalarmult_PRIMITIVE "curve25519" 115 1.1 riastrad SODIUM_EXPORT 116 1.1 riastrad const char *crypto_scalarmult_primitive(void); 117 1.1 riastrad 118 1.1 riastrad SODIUM_EXPORT 119 1.1 riastrad int crypto_scalarmult_base(unsigned char *q, const unsigned char *n); 120 1.1 riastrad 121 1.1 riastrad /* 122 1.1 riastrad * NOTE: Do not use the result of this function directly. 123 1.1 riastrad * 124 1.1 riastrad * Hash the result with the public keys in order to compute a shared 125 1.1 riastrad * secret key: H(q || client_pk || server_pk) 126 1.1 riastrad * 127 1.1 riastrad * Or unless this is not an option, use the crypto_kx() API instead. 128 1.1 riastrad */ 129 1.1 riastrad SODIUM_EXPORT 130 1.1 riastrad int crypto_scalarmult(unsigned char *q, const unsigned char *n, 131 1.1 riastrad const unsigned char *p) 132 1.1 riastrad __attribute__ ((warn_unused_result)); 133 1.1 riastrad 134 1.1 riastrad #ifdef __cplusplus 135 1.1 riastrad } 136 1.1 riastrad #endif 137 1.1 riastrad 138 1.1 riastrad #endif 139 1.1 riastrad #ifndef crypto_scalarmult_H 140 1.1 riastrad #define crypto_scalarmult_H 141 1.1 riastrad 142 1.1 riastrad #if 0 143 1.1 riastrad #include <stddef.h> 144 1.1 riastrad #endif 145 1.1 riastrad #include "crypto_scalarmult_curve25519.h" 146 1.1 riastrad #include "export.h" 147 1.1 riastrad 148 1.1 riastrad #ifdef __cplusplus 149 1.1 riastrad extern "C" { 150 1.1 riastrad #endif 151 1.1 riastrad 152 1.1 riastrad #define crypto_scalarmult_BYTES crypto_scalarmult_curve25519_BYTES 153 1.1 riastrad SODIUM_EXPORT 154 1.1 riastrad size_t crypto_scalarmult_bytes(void); 155 1.1 riastrad 156 1.1 riastrad #define crypto_scalarmult_SCALARBYTES crypto_scalarmult_curve25519_SCALARBYTES 157 1.1 riastrad SODIUM_EXPORT 158 1.1 riastrad size_t crypto_scalarmult_scalarbytes(void); 159 1.1 riastrad 160 1.1 riastrad #define crypto_scalarmult_PRIMITIVE "curve25519" 161 1.1 riastrad SODIUM_EXPORT 162 1.1 riastrad const char *crypto_scalarmult_primitive(void); 163 1.1 riastrad 164 1.1 riastrad SODIUM_EXPORT 165 1.1 riastrad int crypto_scalarmult_base(unsigned char *q, const unsigned char *n); 166 1.1 riastrad 167 1.1 riastrad /* 168 1.1 riastrad * NOTE: Do not use the result of this function directly. 169 1.1 riastrad * 170 1.1 riastrad * Hash the result with the public keys in order to compute a shared 171 1.1 riastrad * secret key: H(q || client_pk || server_pk) 172 1.1 riastrad * 173 1.1 riastrad * Or unless this is not an option, use the crypto_kx() API instead. 174 1.1 riastrad */ 175 1.1 riastrad SODIUM_EXPORT 176 1.1 riastrad int crypto_scalarmult(unsigned char *q, const unsigned char *n, 177 1.1 riastrad const unsigned char *p) 178 1.1 riastrad __attribute__ ((warn_unused_result)); 179 1.1 riastrad 180 1.1 riastrad #ifdef __cplusplus 181 1.1 riastrad } 182 1.1 riastrad #endif 183 1.1 riastrad 184 1.1 riastrad #endif 185