libsodium_arginfo.h 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880
  1. /* This is a generated file, edit the .stub.php file instead.
  2. * Stub hash: e172b900040a9d9ac98207c638fdeb3a0c6a13e6 */
  3. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_aead_aes256gcm_is_available, 0, 0, _IS_BOOL, 0)
  4. ZEND_END_ARG_INFO()
  5. #if defined(HAVE_AESGCM)
  6. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_sodium_crypto_aead_aes256gcm_decrypt, 0, 4, MAY_BE_STRING|MAY_BE_FALSE)
  7. ZEND_ARG_TYPE_INFO(0, ciphertext, IS_STRING, 0)
  8. ZEND_ARG_TYPE_INFO(0, additional_data, IS_STRING, 0)
  9. ZEND_ARG_TYPE_INFO(0, nonce, IS_STRING, 0)
  10. ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
  11. ZEND_END_ARG_INFO()
  12. #endif
  13. #if defined(HAVE_AESGCM)
  14. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_aead_aes256gcm_encrypt, 0, 4, IS_STRING, 0)
  15. ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
  16. ZEND_ARG_TYPE_INFO(0, additional_data, IS_STRING, 0)
  17. ZEND_ARG_TYPE_INFO(0, nonce, IS_STRING, 0)
  18. ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
  19. ZEND_END_ARG_INFO()
  20. #endif
  21. #if defined(HAVE_AESGCM)
  22. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_aead_aes256gcm_keygen, 0, 0, IS_STRING, 0)
  23. ZEND_END_ARG_INFO()
  24. #endif
  25. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_sodium_crypto_aead_chacha20poly1305_decrypt, 0, 4, MAY_BE_STRING|MAY_BE_FALSE)
  26. ZEND_ARG_TYPE_INFO(0, ciphertext, IS_STRING, 0)
  27. ZEND_ARG_TYPE_INFO(0, additional_data, IS_STRING, 0)
  28. ZEND_ARG_TYPE_INFO(0, nonce, IS_STRING, 0)
  29. ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
  30. ZEND_END_ARG_INFO()
  31. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_aead_chacha20poly1305_encrypt, 0, 4, IS_STRING, 0)
  32. ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
  33. ZEND_ARG_TYPE_INFO(0, additional_data, IS_STRING, 0)
  34. ZEND_ARG_TYPE_INFO(0, nonce, IS_STRING, 0)
  35. ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
  36. ZEND_END_ARG_INFO()
  37. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_aead_chacha20poly1305_keygen, 0, 0, IS_STRING, 0)
  38. ZEND_END_ARG_INFO()
  39. #define arginfo_sodium_crypto_aead_chacha20poly1305_ietf_decrypt arginfo_sodium_crypto_aead_chacha20poly1305_decrypt
  40. #define arginfo_sodium_crypto_aead_chacha20poly1305_ietf_encrypt arginfo_sodium_crypto_aead_chacha20poly1305_encrypt
  41. #define arginfo_sodium_crypto_aead_chacha20poly1305_ietf_keygen arginfo_sodium_crypto_aead_chacha20poly1305_keygen
  42. #if defined(crypto_aead_xchacha20poly1305_IETF_NPUBBYTES)
  43. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_sodium_crypto_aead_xchacha20poly1305_ietf_decrypt, 0, 4, MAY_BE_STRING|MAY_BE_FALSE)
  44. ZEND_ARG_TYPE_INFO(0, ciphertext, IS_STRING, 0)
  45. ZEND_ARG_TYPE_INFO(0, additional_data, IS_STRING, 0)
  46. ZEND_ARG_TYPE_INFO(0, nonce, IS_STRING, 0)
  47. ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
  48. ZEND_END_ARG_INFO()
  49. #endif
  50. #if defined(crypto_aead_xchacha20poly1305_IETF_NPUBBYTES)
  51. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_aead_xchacha20poly1305_ietf_keygen, 0, 0, IS_STRING, 0)
  52. ZEND_END_ARG_INFO()
  53. #endif
  54. #if defined(crypto_aead_xchacha20poly1305_IETF_NPUBBYTES)
  55. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_aead_xchacha20poly1305_ietf_encrypt, 0, 4, IS_STRING, 0)
  56. ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
  57. ZEND_ARG_TYPE_INFO(0, additional_data, IS_STRING, 0)
  58. ZEND_ARG_TYPE_INFO(0, nonce, IS_STRING, 0)
  59. ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
  60. ZEND_END_ARG_INFO()
  61. #endif
  62. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_auth, 0, 2, IS_STRING, 0)
  63. ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
  64. ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
  65. ZEND_END_ARG_INFO()
  66. #define arginfo_sodium_crypto_auth_keygen arginfo_sodium_crypto_aead_chacha20poly1305_keygen
  67. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_auth_verify, 0, 3, _IS_BOOL, 0)
  68. ZEND_ARG_TYPE_INFO(0, mac, IS_STRING, 0)
  69. ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
  70. ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
  71. ZEND_END_ARG_INFO()
  72. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_box, 0, 3, IS_STRING, 0)
  73. ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
  74. ZEND_ARG_TYPE_INFO(0, nonce, IS_STRING, 0)
  75. ZEND_ARG_TYPE_INFO(0, key_pair, IS_STRING, 0)
  76. ZEND_END_ARG_INFO()
  77. #define arginfo_sodium_crypto_box_keypair arginfo_sodium_crypto_aead_chacha20poly1305_keygen
  78. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_box_seed_keypair, 0, 1, IS_STRING, 0)
  79. ZEND_ARG_TYPE_INFO(0, seed, IS_STRING, 0)
  80. ZEND_END_ARG_INFO()
  81. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_box_keypair_from_secretkey_and_publickey, 0, 2, IS_STRING, 0)
  82. ZEND_ARG_TYPE_INFO(0, secret_key, IS_STRING, 0)
  83. ZEND_ARG_TYPE_INFO(0, public_key, IS_STRING, 0)
  84. ZEND_END_ARG_INFO()
  85. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_sodium_crypto_box_open, 0, 3, MAY_BE_STRING|MAY_BE_FALSE)
  86. ZEND_ARG_TYPE_INFO(0, ciphertext, IS_STRING, 0)
  87. ZEND_ARG_TYPE_INFO(0, nonce, IS_STRING, 0)
  88. ZEND_ARG_TYPE_INFO(0, key_pair, IS_STRING, 0)
  89. ZEND_END_ARG_INFO()
  90. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_box_publickey, 0, 1, IS_STRING, 0)
  91. ZEND_ARG_TYPE_INFO(0, key_pair, IS_STRING, 0)
  92. ZEND_END_ARG_INFO()
  93. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_box_publickey_from_secretkey, 0, 1, IS_STRING, 0)
  94. ZEND_ARG_TYPE_INFO(0, secret_key, IS_STRING, 0)
  95. ZEND_END_ARG_INFO()
  96. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_box_seal, 0, 2, IS_STRING, 0)
  97. ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
  98. ZEND_ARG_TYPE_INFO(0, public_key, IS_STRING, 0)
  99. ZEND_END_ARG_INFO()
  100. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_sodium_crypto_box_seal_open, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
  101. ZEND_ARG_TYPE_INFO(0, ciphertext, IS_STRING, 0)
  102. ZEND_ARG_TYPE_INFO(0, key_pair, IS_STRING, 0)
  103. ZEND_END_ARG_INFO()
  104. #define arginfo_sodium_crypto_box_secretkey arginfo_sodium_crypto_box_publickey
  105. #if defined(crypto_core_ristretto255_HASHBYTES)
  106. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_core_ristretto255_add, 0, 2, IS_STRING, 0)
  107. ZEND_ARG_TYPE_INFO(0, p, IS_STRING, 0)
  108. ZEND_ARG_TYPE_INFO(0, q, IS_STRING, 0)
  109. ZEND_END_ARG_INFO()
  110. #endif
  111. #if defined(crypto_core_ristretto255_HASHBYTES)
  112. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_core_ristretto255_from_hash, 0, 1, IS_STRING, 0)
  113. ZEND_ARG_TYPE_INFO(0, s, IS_STRING, 0)
  114. ZEND_END_ARG_INFO()
  115. #endif
  116. #if defined(crypto_core_ristretto255_HASHBYTES)
  117. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_core_ristretto255_is_valid_point, 0, 1, _IS_BOOL, 0)
  118. ZEND_ARG_TYPE_INFO(0, s, IS_STRING, 0)
  119. ZEND_END_ARG_INFO()
  120. #endif
  121. #if defined(crypto_core_ristretto255_HASHBYTES)
  122. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_core_ristretto255_random, 0, 0, IS_STRING, 0)
  123. ZEND_END_ARG_INFO()
  124. #endif
  125. #if defined(crypto_core_ristretto255_HASHBYTES)
  126. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_core_ristretto255_scalar_add, 0, 2, IS_STRING, 0)
  127. ZEND_ARG_TYPE_INFO(0, x, IS_STRING, 0)
  128. ZEND_ARG_TYPE_INFO(0, y, IS_STRING, 0)
  129. ZEND_END_ARG_INFO()
  130. #endif
  131. #if defined(crypto_core_ristretto255_HASHBYTES)
  132. #define arginfo_sodium_crypto_core_ristretto255_scalar_complement arginfo_sodium_crypto_core_ristretto255_from_hash
  133. #endif
  134. #if defined(crypto_core_ristretto255_HASHBYTES)
  135. #define arginfo_sodium_crypto_core_ristretto255_scalar_invert arginfo_sodium_crypto_core_ristretto255_from_hash
  136. #endif
  137. #if defined(crypto_core_ristretto255_HASHBYTES)
  138. #define arginfo_sodium_crypto_core_ristretto255_scalar_mul arginfo_sodium_crypto_core_ristretto255_scalar_add
  139. #endif
  140. #if defined(crypto_core_ristretto255_HASHBYTES)
  141. #define arginfo_sodium_crypto_core_ristretto255_scalar_negate arginfo_sodium_crypto_core_ristretto255_from_hash
  142. #endif
  143. #if defined(crypto_core_ristretto255_HASHBYTES)
  144. #define arginfo_sodium_crypto_core_ristretto255_scalar_random arginfo_sodium_crypto_core_ristretto255_random
  145. #endif
  146. #if defined(crypto_core_ristretto255_HASHBYTES)
  147. #define arginfo_sodium_crypto_core_ristretto255_scalar_reduce arginfo_sodium_crypto_core_ristretto255_from_hash
  148. #endif
  149. #if defined(crypto_core_ristretto255_HASHBYTES)
  150. #define arginfo_sodium_crypto_core_ristretto255_scalar_sub arginfo_sodium_crypto_core_ristretto255_scalar_add
  151. #endif
  152. #if defined(crypto_core_ristretto255_HASHBYTES)
  153. #define arginfo_sodium_crypto_core_ristretto255_sub arginfo_sodium_crypto_core_ristretto255_add
  154. #endif
  155. #define arginfo_sodium_crypto_kx_keypair arginfo_sodium_crypto_aead_chacha20poly1305_keygen
  156. #define arginfo_sodium_crypto_kx_publickey arginfo_sodium_crypto_box_publickey
  157. #define arginfo_sodium_crypto_kx_secretkey arginfo_sodium_crypto_box_publickey
  158. #define arginfo_sodium_crypto_kx_seed_keypair arginfo_sodium_crypto_box_seed_keypair
  159. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_kx_client_session_keys, 0, 2, IS_ARRAY, 0)
  160. ZEND_ARG_TYPE_INFO(0, client_key_pair, IS_STRING, 0)
  161. ZEND_ARG_TYPE_INFO(0, server_key, IS_STRING, 0)
  162. ZEND_END_ARG_INFO()
  163. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_kx_server_session_keys, 0, 2, IS_ARRAY, 0)
  164. ZEND_ARG_TYPE_INFO(0, server_key_pair, IS_STRING, 0)
  165. ZEND_ARG_TYPE_INFO(0, client_key, IS_STRING, 0)
  166. ZEND_END_ARG_INFO()
  167. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_generichash, 0, 1, IS_STRING, 0)
  168. ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
  169. ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, key, IS_STRING, 0, "\"\"")
  170. ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "SODIUM_CRYPTO_GENERICHASH_BYTES")
  171. ZEND_END_ARG_INFO()
  172. #define arginfo_sodium_crypto_generichash_keygen arginfo_sodium_crypto_aead_chacha20poly1305_keygen
  173. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_generichash_init, 0, 0, IS_STRING, 0)
  174. ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, key, IS_STRING, 0, "\"\"")
  175. ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "SODIUM_CRYPTO_GENERICHASH_BYTES")
  176. ZEND_END_ARG_INFO()
  177. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_generichash_update, 0, 2, _IS_BOOL, 0)
  178. ZEND_ARG_TYPE_INFO(1, state, IS_STRING, 0)
  179. ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
  180. ZEND_END_ARG_INFO()
  181. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_generichash_final, 0, 1, IS_STRING, 0)
  182. ZEND_ARG_TYPE_INFO(1, state, IS_STRING, 0)
  183. ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "SODIUM_CRYPTO_GENERICHASH_BYTES")
  184. ZEND_END_ARG_INFO()
  185. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_kdf_derive_from_key, 0, 4, IS_STRING, 0)
  186. ZEND_ARG_TYPE_INFO(0, subkey_length, IS_LONG, 0)
  187. ZEND_ARG_TYPE_INFO(0, subkey_id, IS_LONG, 0)
  188. ZEND_ARG_TYPE_INFO(0, context, IS_STRING, 0)
  189. ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
  190. ZEND_END_ARG_INFO()
  191. #define arginfo_sodium_crypto_kdf_keygen arginfo_sodium_crypto_aead_chacha20poly1305_keygen
  192. #if defined(crypto_pwhash_SALTBYTES)
  193. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_pwhash, 0, 5, IS_STRING, 0)
  194. ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0)
  195. ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0)
  196. ZEND_ARG_TYPE_INFO(0, salt, IS_STRING, 0)
  197. ZEND_ARG_TYPE_INFO(0, opslimit, IS_LONG, 0)
  198. ZEND_ARG_TYPE_INFO(0, memlimit, IS_LONG, 0)
  199. ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, algo, IS_LONG, 0, "SODIUM_CRYPTO_PWHASH_ALG_DEFAULT")
  200. ZEND_END_ARG_INFO()
  201. #endif
  202. #if defined(crypto_pwhash_SALTBYTES)
  203. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_pwhash_str, 0, 3, IS_STRING, 0)
  204. ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0)
  205. ZEND_ARG_TYPE_INFO(0, opslimit, IS_LONG, 0)
  206. ZEND_ARG_TYPE_INFO(0, memlimit, IS_LONG, 0)
  207. ZEND_END_ARG_INFO()
  208. #endif
  209. #if defined(crypto_pwhash_SALTBYTES)
  210. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_pwhash_str_verify, 0, 2, _IS_BOOL, 0)
  211. ZEND_ARG_TYPE_INFO(0, hash, IS_STRING, 0)
  212. ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0)
  213. ZEND_END_ARG_INFO()
  214. #endif
  215. #if SODIUM_LIBRARY_VERSION_MAJOR > 9 || (SODIUM_LIBRARY_VERSION_MAJOR == 9 && SODIUM_LIBRARY_VERSION_MINOR >= 6)
  216. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_pwhash_str_needs_rehash, 0, 3, _IS_BOOL, 0)
  217. ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0)
  218. ZEND_ARG_TYPE_INFO(0, opslimit, IS_LONG, 0)
  219. ZEND_ARG_TYPE_INFO(0, memlimit, IS_LONG, 0)
  220. ZEND_END_ARG_INFO()
  221. #endif
  222. #if defined(crypto_pwhash_scryptsalsa208sha256_SALTBYTES)
  223. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_pwhash_scryptsalsa208sha256, 0, 5, IS_STRING, 0)
  224. ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0)
  225. ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0)
  226. ZEND_ARG_TYPE_INFO(0, salt, IS_STRING, 0)
  227. ZEND_ARG_TYPE_INFO(0, opslimit, IS_LONG, 0)
  228. ZEND_ARG_TYPE_INFO(0, memlimit, IS_LONG, 0)
  229. ZEND_END_ARG_INFO()
  230. #endif
  231. #if defined(crypto_pwhash_scryptsalsa208sha256_SALTBYTES)
  232. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_pwhash_scryptsalsa208sha256_str, 0, 3, IS_STRING, 0)
  233. ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0)
  234. ZEND_ARG_TYPE_INFO(0, opslimit, IS_LONG, 0)
  235. ZEND_ARG_TYPE_INFO(0, memlimit, IS_LONG, 0)
  236. ZEND_END_ARG_INFO()
  237. #endif
  238. #if defined(crypto_pwhash_scryptsalsa208sha256_SALTBYTES)
  239. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_pwhash_scryptsalsa208sha256_str_verify, 0, 2, _IS_BOOL, 0)
  240. ZEND_ARG_TYPE_INFO(0, hash, IS_STRING, 0)
  241. ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0)
  242. ZEND_END_ARG_INFO()
  243. #endif
  244. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_scalarmult, 0, 2, IS_STRING, 0)
  245. ZEND_ARG_TYPE_INFO(0, n, IS_STRING, 0)
  246. ZEND_ARG_TYPE_INFO(0, p, IS_STRING, 0)
  247. ZEND_END_ARG_INFO()
  248. #if defined(crypto_core_ristretto255_HASHBYTES)
  249. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_scalarmult_ristretto255, 0, 2, IS_STRING, 0)
  250. ZEND_ARG_TYPE_INFO(0, n, IS_STRING, 0)
  251. ZEND_ARG_TYPE_INFO(0, p, IS_STRING, 0)
  252. ZEND_END_ARG_INFO()
  253. #endif
  254. #if defined(crypto_core_ristretto255_HASHBYTES)
  255. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_scalarmult_ristretto255_base, 0, 1, IS_STRING, 0)
  256. ZEND_ARG_TYPE_INFO(0, n, IS_STRING, 0)
  257. ZEND_END_ARG_INFO()
  258. #endif
  259. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_secretbox, 0, 3, IS_STRING, 0)
  260. ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
  261. ZEND_ARG_TYPE_INFO(0, nonce, IS_STRING, 0)
  262. ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
  263. ZEND_END_ARG_INFO()
  264. #define arginfo_sodium_crypto_secretbox_keygen arginfo_sodium_crypto_aead_chacha20poly1305_keygen
  265. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_sodium_crypto_secretbox_open, 0, 3, MAY_BE_STRING|MAY_BE_FALSE)
  266. ZEND_ARG_TYPE_INFO(0, ciphertext, IS_STRING, 0)
  267. ZEND_ARG_TYPE_INFO(0, nonce, IS_STRING, 0)
  268. ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
  269. ZEND_END_ARG_INFO()
  270. #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
  271. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_secretstream_xchacha20poly1305_keygen, 0, 0, IS_STRING, 0)
  272. ZEND_END_ARG_INFO()
  273. #endif
  274. #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
  275. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_secretstream_xchacha20poly1305_init_push, 0, 1, IS_ARRAY, 0)
  276. ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
  277. ZEND_END_ARG_INFO()
  278. #endif
  279. #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
  280. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_secretstream_xchacha20poly1305_push, 0, 2, IS_STRING, 0)
  281. ZEND_ARG_TYPE_INFO(1, state, IS_STRING, 0)
  282. ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
  283. ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, additional_data, IS_STRING, 0, "\"\"")
  284. ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, tag, IS_LONG, 0, "SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_MESSAGE")
  285. ZEND_END_ARG_INFO()
  286. #endif
  287. #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
  288. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_secretstream_xchacha20poly1305_init_pull, 0, 2, IS_STRING, 0)
  289. ZEND_ARG_TYPE_INFO(0, header, IS_STRING, 0)
  290. ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
  291. ZEND_END_ARG_INFO()
  292. #endif
  293. #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
  294. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_sodium_crypto_secretstream_xchacha20poly1305_pull, 0, 2, MAY_BE_ARRAY|MAY_BE_FALSE)
  295. ZEND_ARG_TYPE_INFO(1, state, IS_STRING, 0)
  296. ZEND_ARG_TYPE_INFO(0, ciphertext, IS_STRING, 0)
  297. ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, additional_data, IS_STRING, 0, "\"\"")
  298. ZEND_END_ARG_INFO()
  299. #endif
  300. #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
  301. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_secretstream_xchacha20poly1305_rekey, 0, 1, IS_VOID, 0)
  302. ZEND_ARG_TYPE_INFO(1, state, IS_STRING, 0)
  303. ZEND_END_ARG_INFO()
  304. #endif
  305. #define arginfo_sodium_crypto_shorthash arginfo_sodium_crypto_auth
  306. #define arginfo_sodium_crypto_shorthash_keygen arginfo_sodium_crypto_aead_chacha20poly1305_keygen
  307. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_sign, 0, 2, IS_STRING, 0)
  308. ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
  309. ZEND_ARG_TYPE_INFO(0, secret_key, IS_STRING, 0)
  310. ZEND_END_ARG_INFO()
  311. #define arginfo_sodium_crypto_sign_detached arginfo_sodium_crypto_sign
  312. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_sign_ed25519_pk_to_curve25519, 0, 1, IS_STRING, 0)
  313. ZEND_ARG_TYPE_INFO(0, public_key, IS_STRING, 0)
  314. ZEND_END_ARG_INFO()
  315. #define arginfo_sodium_crypto_sign_ed25519_sk_to_curve25519 arginfo_sodium_crypto_box_publickey_from_secretkey
  316. #define arginfo_sodium_crypto_sign_keypair arginfo_sodium_crypto_aead_chacha20poly1305_keygen
  317. #define arginfo_sodium_crypto_sign_keypair_from_secretkey_and_publickey arginfo_sodium_crypto_box_keypair_from_secretkey_and_publickey
  318. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_sodium_crypto_sign_open, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
  319. ZEND_ARG_TYPE_INFO(0, signed_message, IS_STRING, 0)
  320. ZEND_ARG_TYPE_INFO(0, public_key, IS_STRING, 0)
  321. ZEND_END_ARG_INFO()
  322. #define arginfo_sodium_crypto_sign_publickey arginfo_sodium_crypto_box_publickey
  323. #define arginfo_sodium_crypto_sign_secretkey arginfo_sodium_crypto_box_publickey
  324. #define arginfo_sodium_crypto_sign_publickey_from_secretkey arginfo_sodium_crypto_box_publickey_from_secretkey
  325. #define arginfo_sodium_crypto_sign_seed_keypair arginfo_sodium_crypto_box_seed_keypair
  326. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_sign_verify_detached, 0, 3, _IS_BOOL, 0)
  327. ZEND_ARG_TYPE_INFO(0, signature, IS_STRING, 0)
  328. ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
  329. ZEND_ARG_TYPE_INFO(0, public_key, IS_STRING, 0)
  330. ZEND_END_ARG_INFO()
  331. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_stream, 0, 3, IS_STRING, 0)
  332. ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0)
  333. ZEND_ARG_TYPE_INFO(0, nonce, IS_STRING, 0)
  334. ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
  335. ZEND_END_ARG_INFO()
  336. #define arginfo_sodium_crypto_stream_keygen arginfo_sodium_crypto_aead_chacha20poly1305_keygen
  337. #define arginfo_sodium_crypto_stream_xor arginfo_sodium_crypto_secretbox
  338. #if defined(crypto_stream_xchacha20_KEYBYTES)
  339. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_stream_xchacha20, 0, 3, IS_STRING, 0)
  340. ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0)
  341. ZEND_ARG_TYPE_INFO(0, nonce, IS_STRING, 0)
  342. ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
  343. ZEND_END_ARG_INFO()
  344. #endif
  345. #if defined(crypto_stream_xchacha20_KEYBYTES)
  346. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_stream_xchacha20_keygen, 0, 0, IS_STRING, 0)
  347. ZEND_END_ARG_INFO()
  348. #endif
  349. #if defined(crypto_stream_xchacha20_KEYBYTES)
  350. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_crypto_stream_xchacha20_xor, 0, 3, IS_STRING, 0)
  351. ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
  352. ZEND_ARG_TYPE_INFO(0, nonce, IS_STRING, 0)
  353. ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
  354. ZEND_END_ARG_INFO()
  355. #endif
  356. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_add, 0, 2, IS_VOID, 0)
  357. ZEND_ARG_TYPE_INFO(1, string1, IS_STRING, 0)
  358. ZEND_ARG_TYPE_INFO(0, string2, IS_STRING, 0)
  359. ZEND_END_ARG_INFO()
  360. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_compare, 0, 2, IS_LONG, 0)
  361. ZEND_ARG_TYPE_INFO(0, string1, IS_STRING, 0)
  362. ZEND_ARG_TYPE_INFO(0, string2, IS_STRING, 0)
  363. ZEND_END_ARG_INFO()
  364. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_increment, 0, 1, IS_VOID, 0)
  365. ZEND_ARG_TYPE_INFO(1, string, IS_STRING, 0)
  366. ZEND_END_ARG_INFO()
  367. #define arginfo_sodium_memcmp arginfo_sodium_compare
  368. #define arginfo_sodium_memzero arginfo_sodium_increment
  369. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_pad, 0, 2, IS_STRING, 0)
  370. ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
  371. ZEND_ARG_TYPE_INFO(0, block_size, IS_LONG, 0)
  372. ZEND_END_ARG_INFO()
  373. #define arginfo_sodium_unpad arginfo_sodium_pad
  374. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_bin2hex, 0, 1, IS_STRING, 0)
  375. ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
  376. ZEND_END_ARG_INFO()
  377. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_hex2bin, 0, 1, IS_STRING, 0)
  378. ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
  379. ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, ignore, IS_STRING, 0, "\"\"")
  380. ZEND_END_ARG_INFO()
  381. #if defined(sodium_base64_VARIANT_ORIGINAL)
  382. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_bin2base64, 0, 2, IS_STRING, 0)
  383. ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
  384. ZEND_ARG_TYPE_INFO(0, id, IS_LONG, 0)
  385. ZEND_END_ARG_INFO()
  386. #endif
  387. #if defined(sodium_base64_VARIANT_ORIGINAL)
  388. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sodium_base642bin, 0, 2, IS_STRING, 0)
  389. ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
  390. ZEND_ARG_TYPE_INFO(0, id, IS_LONG, 0)
  391. ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, ignore, IS_STRING, 0, "\"\"")
  392. ZEND_END_ARG_INFO()
  393. #endif
  394. #define arginfo_sodium_crypto_scalarmult_base arginfo_sodium_crypto_box_publickey_from_secretkey
  395. ZEND_FUNCTION(sodium_crypto_aead_aes256gcm_is_available);
  396. #if defined(HAVE_AESGCM)
  397. ZEND_FUNCTION(sodium_crypto_aead_aes256gcm_decrypt);
  398. #endif
  399. #if defined(HAVE_AESGCM)
  400. ZEND_FUNCTION(sodium_crypto_aead_aes256gcm_encrypt);
  401. #endif
  402. #if defined(HAVE_AESGCM)
  403. ZEND_FUNCTION(sodium_crypto_aead_aes256gcm_keygen);
  404. #endif
  405. ZEND_FUNCTION(sodium_crypto_aead_chacha20poly1305_decrypt);
  406. ZEND_FUNCTION(sodium_crypto_aead_chacha20poly1305_encrypt);
  407. ZEND_FUNCTION(sodium_crypto_aead_chacha20poly1305_keygen);
  408. ZEND_FUNCTION(sodium_crypto_aead_chacha20poly1305_ietf_decrypt);
  409. ZEND_FUNCTION(sodium_crypto_aead_chacha20poly1305_ietf_encrypt);
  410. ZEND_FUNCTION(sodium_crypto_aead_chacha20poly1305_ietf_keygen);
  411. #if defined(crypto_aead_xchacha20poly1305_IETF_NPUBBYTES)
  412. ZEND_FUNCTION(sodium_crypto_aead_xchacha20poly1305_ietf_decrypt);
  413. #endif
  414. #if defined(crypto_aead_xchacha20poly1305_IETF_NPUBBYTES)
  415. ZEND_FUNCTION(sodium_crypto_aead_xchacha20poly1305_ietf_keygen);
  416. #endif
  417. #if defined(crypto_aead_xchacha20poly1305_IETF_NPUBBYTES)
  418. ZEND_FUNCTION(sodium_crypto_aead_xchacha20poly1305_ietf_encrypt);
  419. #endif
  420. ZEND_FUNCTION(sodium_crypto_auth);
  421. ZEND_FUNCTION(sodium_crypto_auth_keygen);
  422. ZEND_FUNCTION(sodium_crypto_auth_verify);
  423. ZEND_FUNCTION(sodium_crypto_box);
  424. ZEND_FUNCTION(sodium_crypto_box_keypair);
  425. ZEND_FUNCTION(sodium_crypto_box_seed_keypair);
  426. ZEND_FUNCTION(sodium_crypto_box_keypair_from_secretkey_and_publickey);
  427. ZEND_FUNCTION(sodium_crypto_box_open);
  428. ZEND_FUNCTION(sodium_crypto_box_publickey);
  429. ZEND_FUNCTION(sodium_crypto_box_publickey_from_secretkey);
  430. ZEND_FUNCTION(sodium_crypto_box_seal);
  431. ZEND_FUNCTION(sodium_crypto_box_seal_open);
  432. ZEND_FUNCTION(sodium_crypto_box_secretkey);
  433. #if defined(crypto_core_ristretto255_HASHBYTES)
  434. ZEND_FUNCTION(sodium_crypto_core_ristretto255_add);
  435. #endif
  436. #if defined(crypto_core_ristretto255_HASHBYTES)
  437. ZEND_FUNCTION(sodium_crypto_core_ristretto255_from_hash);
  438. #endif
  439. #if defined(crypto_core_ristretto255_HASHBYTES)
  440. ZEND_FUNCTION(sodium_crypto_core_ristretto255_is_valid_point);
  441. #endif
  442. #if defined(crypto_core_ristretto255_HASHBYTES)
  443. ZEND_FUNCTION(sodium_crypto_core_ristretto255_random);
  444. #endif
  445. #if defined(crypto_core_ristretto255_HASHBYTES)
  446. ZEND_FUNCTION(sodium_crypto_core_ristretto255_scalar_add);
  447. #endif
  448. #if defined(crypto_core_ristretto255_HASHBYTES)
  449. ZEND_FUNCTION(sodium_crypto_core_ristretto255_scalar_complement);
  450. #endif
  451. #if defined(crypto_core_ristretto255_HASHBYTES)
  452. ZEND_FUNCTION(sodium_crypto_core_ristretto255_scalar_invert);
  453. #endif
  454. #if defined(crypto_core_ristretto255_HASHBYTES)
  455. ZEND_FUNCTION(sodium_crypto_core_ristretto255_scalar_mul);
  456. #endif
  457. #if defined(crypto_core_ristretto255_HASHBYTES)
  458. ZEND_FUNCTION(sodium_crypto_core_ristretto255_scalar_negate);
  459. #endif
  460. #if defined(crypto_core_ristretto255_HASHBYTES)
  461. ZEND_FUNCTION(sodium_crypto_core_ristretto255_scalar_random);
  462. #endif
  463. #if defined(crypto_core_ristretto255_HASHBYTES)
  464. ZEND_FUNCTION(sodium_crypto_core_ristretto255_scalar_reduce);
  465. #endif
  466. #if defined(crypto_core_ristretto255_HASHBYTES)
  467. ZEND_FUNCTION(sodium_crypto_core_ristretto255_scalar_sub);
  468. #endif
  469. #if defined(crypto_core_ristretto255_HASHBYTES)
  470. ZEND_FUNCTION(sodium_crypto_core_ristretto255_sub);
  471. #endif
  472. ZEND_FUNCTION(sodium_crypto_kx_keypair);
  473. ZEND_FUNCTION(sodium_crypto_kx_publickey);
  474. ZEND_FUNCTION(sodium_crypto_kx_secretkey);
  475. ZEND_FUNCTION(sodium_crypto_kx_seed_keypair);
  476. ZEND_FUNCTION(sodium_crypto_kx_client_session_keys);
  477. ZEND_FUNCTION(sodium_crypto_kx_server_session_keys);
  478. ZEND_FUNCTION(sodium_crypto_generichash);
  479. ZEND_FUNCTION(sodium_crypto_generichash_keygen);
  480. ZEND_FUNCTION(sodium_crypto_generichash_init);
  481. ZEND_FUNCTION(sodium_crypto_generichash_update);
  482. ZEND_FUNCTION(sodium_crypto_generichash_final);
  483. ZEND_FUNCTION(sodium_crypto_kdf_derive_from_key);
  484. ZEND_FUNCTION(sodium_crypto_kdf_keygen);
  485. #if defined(crypto_pwhash_SALTBYTES)
  486. ZEND_FUNCTION(sodium_crypto_pwhash);
  487. #endif
  488. #if defined(crypto_pwhash_SALTBYTES)
  489. ZEND_FUNCTION(sodium_crypto_pwhash_str);
  490. #endif
  491. #if defined(crypto_pwhash_SALTBYTES)
  492. ZEND_FUNCTION(sodium_crypto_pwhash_str_verify);
  493. #endif
  494. #if SODIUM_LIBRARY_VERSION_MAJOR > 9 || (SODIUM_LIBRARY_VERSION_MAJOR == 9 && SODIUM_LIBRARY_VERSION_MINOR >= 6)
  495. ZEND_FUNCTION(sodium_crypto_pwhash_str_needs_rehash);
  496. #endif
  497. #if defined(crypto_pwhash_scryptsalsa208sha256_SALTBYTES)
  498. ZEND_FUNCTION(sodium_crypto_pwhash_scryptsalsa208sha256);
  499. #endif
  500. #if defined(crypto_pwhash_scryptsalsa208sha256_SALTBYTES)
  501. ZEND_FUNCTION(sodium_crypto_pwhash_scryptsalsa208sha256_str);
  502. #endif
  503. #if defined(crypto_pwhash_scryptsalsa208sha256_SALTBYTES)
  504. ZEND_FUNCTION(sodium_crypto_pwhash_scryptsalsa208sha256_str_verify);
  505. #endif
  506. ZEND_FUNCTION(sodium_crypto_scalarmult);
  507. #if defined(crypto_core_ristretto255_HASHBYTES)
  508. ZEND_FUNCTION(sodium_crypto_scalarmult_ristretto255);
  509. #endif
  510. #if defined(crypto_core_ristretto255_HASHBYTES)
  511. ZEND_FUNCTION(sodium_crypto_scalarmult_ristretto255_base);
  512. #endif
  513. ZEND_FUNCTION(sodium_crypto_secretbox);
  514. ZEND_FUNCTION(sodium_crypto_secretbox_keygen);
  515. ZEND_FUNCTION(sodium_crypto_secretbox_open);
  516. #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
  517. ZEND_FUNCTION(sodium_crypto_secretstream_xchacha20poly1305_keygen);
  518. #endif
  519. #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
  520. ZEND_FUNCTION(sodium_crypto_secretstream_xchacha20poly1305_init_push);
  521. #endif
  522. #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
  523. ZEND_FUNCTION(sodium_crypto_secretstream_xchacha20poly1305_push);
  524. #endif
  525. #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
  526. ZEND_FUNCTION(sodium_crypto_secretstream_xchacha20poly1305_init_pull);
  527. #endif
  528. #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
  529. ZEND_FUNCTION(sodium_crypto_secretstream_xchacha20poly1305_pull);
  530. #endif
  531. #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
  532. ZEND_FUNCTION(sodium_crypto_secretstream_xchacha20poly1305_rekey);
  533. #endif
  534. ZEND_FUNCTION(sodium_crypto_shorthash);
  535. ZEND_FUNCTION(sodium_crypto_shorthash_keygen);
  536. ZEND_FUNCTION(sodium_crypto_sign);
  537. ZEND_FUNCTION(sodium_crypto_sign_detached);
  538. ZEND_FUNCTION(sodium_crypto_sign_ed25519_pk_to_curve25519);
  539. ZEND_FUNCTION(sodium_crypto_sign_ed25519_sk_to_curve25519);
  540. ZEND_FUNCTION(sodium_crypto_sign_keypair);
  541. ZEND_FUNCTION(sodium_crypto_sign_keypair_from_secretkey_and_publickey);
  542. ZEND_FUNCTION(sodium_crypto_sign_open);
  543. ZEND_FUNCTION(sodium_crypto_sign_publickey);
  544. ZEND_FUNCTION(sodium_crypto_sign_secretkey);
  545. ZEND_FUNCTION(sodium_crypto_sign_publickey_from_secretkey);
  546. ZEND_FUNCTION(sodium_crypto_sign_seed_keypair);
  547. ZEND_FUNCTION(sodium_crypto_sign_verify_detached);
  548. ZEND_FUNCTION(sodium_crypto_stream);
  549. ZEND_FUNCTION(sodium_crypto_stream_keygen);
  550. ZEND_FUNCTION(sodium_crypto_stream_xor);
  551. #if defined(crypto_stream_xchacha20_KEYBYTES)
  552. ZEND_FUNCTION(sodium_crypto_stream_xchacha20);
  553. #endif
  554. #if defined(crypto_stream_xchacha20_KEYBYTES)
  555. ZEND_FUNCTION(sodium_crypto_stream_xchacha20_keygen);
  556. #endif
  557. #if defined(crypto_stream_xchacha20_KEYBYTES)
  558. ZEND_FUNCTION(sodium_crypto_stream_xchacha20_xor);
  559. #endif
  560. ZEND_FUNCTION(sodium_add);
  561. ZEND_FUNCTION(sodium_compare);
  562. ZEND_FUNCTION(sodium_increment);
  563. ZEND_FUNCTION(sodium_memcmp);
  564. ZEND_FUNCTION(sodium_memzero);
  565. ZEND_FUNCTION(sodium_pad);
  566. ZEND_FUNCTION(sodium_unpad);
  567. ZEND_FUNCTION(sodium_bin2hex);
  568. ZEND_FUNCTION(sodium_hex2bin);
  569. #if defined(sodium_base64_VARIANT_ORIGINAL)
  570. ZEND_FUNCTION(sodium_bin2base64);
  571. #endif
  572. #if defined(sodium_base64_VARIANT_ORIGINAL)
  573. ZEND_FUNCTION(sodium_base642bin);
  574. #endif
  575. static const zend_function_entry ext_functions[] = {
  576. ZEND_FE(sodium_crypto_aead_aes256gcm_is_available, arginfo_sodium_crypto_aead_aes256gcm_is_available)
  577. #if defined(HAVE_AESGCM)
  578. ZEND_FE(sodium_crypto_aead_aes256gcm_decrypt, arginfo_sodium_crypto_aead_aes256gcm_decrypt)
  579. #endif
  580. #if defined(HAVE_AESGCM)
  581. ZEND_FE(sodium_crypto_aead_aes256gcm_encrypt, arginfo_sodium_crypto_aead_aes256gcm_encrypt)
  582. #endif
  583. #if defined(HAVE_AESGCM)
  584. ZEND_FE(sodium_crypto_aead_aes256gcm_keygen, arginfo_sodium_crypto_aead_aes256gcm_keygen)
  585. #endif
  586. ZEND_FE(sodium_crypto_aead_chacha20poly1305_decrypt, arginfo_sodium_crypto_aead_chacha20poly1305_decrypt)
  587. ZEND_FE(sodium_crypto_aead_chacha20poly1305_encrypt, arginfo_sodium_crypto_aead_chacha20poly1305_encrypt)
  588. ZEND_FE(sodium_crypto_aead_chacha20poly1305_keygen, arginfo_sodium_crypto_aead_chacha20poly1305_keygen)
  589. ZEND_FE(sodium_crypto_aead_chacha20poly1305_ietf_decrypt, arginfo_sodium_crypto_aead_chacha20poly1305_ietf_decrypt)
  590. ZEND_FE(sodium_crypto_aead_chacha20poly1305_ietf_encrypt, arginfo_sodium_crypto_aead_chacha20poly1305_ietf_encrypt)
  591. ZEND_FE(sodium_crypto_aead_chacha20poly1305_ietf_keygen, arginfo_sodium_crypto_aead_chacha20poly1305_ietf_keygen)
  592. #if defined(crypto_aead_xchacha20poly1305_IETF_NPUBBYTES)
  593. ZEND_FE(sodium_crypto_aead_xchacha20poly1305_ietf_decrypt, arginfo_sodium_crypto_aead_xchacha20poly1305_ietf_decrypt)
  594. #endif
  595. #if defined(crypto_aead_xchacha20poly1305_IETF_NPUBBYTES)
  596. ZEND_FE(sodium_crypto_aead_xchacha20poly1305_ietf_keygen, arginfo_sodium_crypto_aead_xchacha20poly1305_ietf_keygen)
  597. #endif
  598. #if defined(crypto_aead_xchacha20poly1305_IETF_NPUBBYTES)
  599. ZEND_FE(sodium_crypto_aead_xchacha20poly1305_ietf_encrypt, arginfo_sodium_crypto_aead_xchacha20poly1305_ietf_encrypt)
  600. #endif
  601. ZEND_FE(sodium_crypto_auth, arginfo_sodium_crypto_auth)
  602. ZEND_FE(sodium_crypto_auth_keygen, arginfo_sodium_crypto_auth_keygen)
  603. ZEND_FE(sodium_crypto_auth_verify, arginfo_sodium_crypto_auth_verify)
  604. ZEND_FE(sodium_crypto_box, arginfo_sodium_crypto_box)
  605. ZEND_FE(sodium_crypto_box_keypair, arginfo_sodium_crypto_box_keypair)
  606. ZEND_FE(sodium_crypto_box_seed_keypair, arginfo_sodium_crypto_box_seed_keypair)
  607. ZEND_FE(sodium_crypto_box_keypair_from_secretkey_and_publickey, arginfo_sodium_crypto_box_keypair_from_secretkey_and_publickey)
  608. ZEND_FE(sodium_crypto_box_open, arginfo_sodium_crypto_box_open)
  609. ZEND_FE(sodium_crypto_box_publickey, arginfo_sodium_crypto_box_publickey)
  610. ZEND_FE(sodium_crypto_box_publickey_from_secretkey, arginfo_sodium_crypto_box_publickey_from_secretkey)
  611. ZEND_FE(sodium_crypto_box_seal, arginfo_sodium_crypto_box_seal)
  612. ZEND_FE(sodium_crypto_box_seal_open, arginfo_sodium_crypto_box_seal_open)
  613. ZEND_FE(sodium_crypto_box_secretkey, arginfo_sodium_crypto_box_secretkey)
  614. #if defined(crypto_core_ristretto255_HASHBYTES)
  615. ZEND_FE(sodium_crypto_core_ristretto255_add, arginfo_sodium_crypto_core_ristretto255_add)
  616. #endif
  617. #if defined(crypto_core_ristretto255_HASHBYTES)
  618. ZEND_FE(sodium_crypto_core_ristretto255_from_hash, arginfo_sodium_crypto_core_ristretto255_from_hash)
  619. #endif
  620. #if defined(crypto_core_ristretto255_HASHBYTES)
  621. ZEND_FE(sodium_crypto_core_ristretto255_is_valid_point, arginfo_sodium_crypto_core_ristretto255_is_valid_point)
  622. #endif
  623. #if defined(crypto_core_ristretto255_HASHBYTES)
  624. ZEND_FE(sodium_crypto_core_ristretto255_random, arginfo_sodium_crypto_core_ristretto255_random)
  625. #endif
  626. #if defined(crypto_core_ristretto255_HASHBYTES)
  627. ZEND_FE(sodium_crypto_core_ristretto255_scalar_add, arginfo_sodium_crypto_core_ristretto255_scalar_add)
  628. #endif
  629. #if defined(crypto_core_ristretto255_HASHBYTES)
  630. ZEND_FE(sodium_crypto_core_ristretto255_scalar_complement, arginfo_sodium_crypto_core_ristretto255_scalar_complement)
  631. #endif
  632. #if defined(crypto_core_ristretto255_HASHBYTES)
  633. ZEND_FE(sodium_crypto_core_ristretto255_scalar_invert, arginfo_sodium_crypto_core_ristretto255_scalar_invert)
  634. #endif
  635. #if defined(crypto_core_ristretto255_HASHBYTES)
  636. ZEND_FE(sodium_crypto_core_ristretto255_scalar_mul, arginfo_sodium_crypto_core_ristretto255_scalar_mul)
  637. #endif
  638. #if defined(crypto_core_ristretto255_HASHBYTES)
  639. ZEND_FE(sodium_crypto_core_ristretto255_scalar_negate, arginfo_sodium_crypto_core_ristretto255_scalar_negate)
  640. #endif
  641. #if defined(crypto_core_ristretto255_HASHBYTES)
  642. ZEND_FE(sodium_crypto_core_ristretto255_scalar_random, arginfo_sodium_crypto_core_ristretto255_scalar_random)
  643. #endif
  644. #if defined(crypto_core_ristretto255_HASHBYTES)
  645. ZEND_FE(sodium_crypto_core_ristretto255_scalar_reduce, arginfo_sodium_crypto_core_ristretto255_scalar_reduce)
  646. #endif
  647. #if defined(crypto_core_ristretto255_HASHBYTES)
  648. ZEND_FE(sodium_crypto_core_ristretto255_scalar_sub, arginfo_sodium_crypto_core_ristretto255_scalar_sub)
  649. #endif
  650. #if defined(crypto_core_ristretto255_HASHBYTES)
  651. ZEND_FE(sodium_crypto_core_ristretto255_sub, arginfo_sodium_crypto_core_ristretto255_sub)
  652. #endif
  653. ZEND_FE(sodium_crypto_kx_keypair, arginfo_sodium_crypto_kx_keypair)
  654. ZEND_FE(sodium_crypto_kx_publickey, arginfo_sodium_crypto_kx_publickey)
  655. ZEND_FE(sodium_crypto_kx_secretkey, arginfo_sodium_crypto_kx_secretkey)
  656. ZEND_FE(sodium_crypto_kx_seed_keypair, arginfo_sodium_crypto_kx_seed_keypair)
  657. ZEND_FE(sodium_crypto_kx_client_session_keys, arginfo_sodium_crypto_kx_client_session_keys)
  658. ZEND_FE(sodium_crypto_kx_server_session_keys, arginfo_sodium_crypto_kx_server_session_keys)
  659. ZEND_FE(sodium_crypto_generichash, arginfo_sodium_crypto_generichash)
  660. ZEND_FE(sodium_crypto_generichash_keygen, arginfo_sodium_crypto_generichash_keygen)
  661. ZEND_FE(sodium_crypto_generichash_init, arginfo_sodium_crypto_generichash_init)
  662. ZEND_FE(sodium_crypto_generichash_update, arginfo_sodium_crypto_generichash_update)
  663. ZEND_FE(sodium_crypto_generichash_final, arginfo_sodium_crypto_generichash_final)
  664. ZEND_FE(sodium_crypto_kdf_derive_from_key, arginfo_sodium_crypto_kdf_derive_from_key)
  665. ZEND_FE(sodium_crypto_kdf_keygen, arginfo_sodium_crypto_kdf_keygen)
  666. #if defined(crypto_pwhash_SALTBYTES)
  667. ZEND_FE(sodium_crypto_pwhash, arginfo_sodium_crypto_pwhash)
  668. #endif
  669. #if defined(crypto_pwhash_SALTBYTES)
  670. ZEND_FE(sodium_crypto_pwhash_str, arginfo_sodium_crypto_pwhash_str)
  671. #endif
  672. #if defined(crypto_pwhash_SALTBYTES)
  673. ZEND_FE(sodium_crypto_pwhash_str_verify, arginfo_sodium_crypto_pwhash_str_verify)
  674. #endif
  675. #if SODIUM_LIBRARY_VERSION_MAJOR > 9 || (SODIUM_LIBRARY_VERSION_MAJOR == 9 && SODIUM_LIBRARY_VERSION_MINOR >= 6)
  676. ZEND_FE(sodium_crypto_pwhash_str_needs_rehash, arginfo_sodium_crypto_pwhash_str_needs_rehash)
  677. #endif
  678. #if defined(crypto_pwhash_scryptsalsa208sha256_SALTBYTES)
  679. ZEND_FE(sodium_crypto_pwhash_scryptsalsa208sha256, arginfo_sodium_crypto_pwhash_scryptsalsa208sha256)
  680. #endif
  681. #if defined(crypto_pwhash_scryptsalsa208sha256_SALTBYTES)
  682. ZEND_FE(sodium_crypto_pwhash_scryptsalsa208sha256_str, arginfo_sodium_crypto_pwhash_scryptsalsa208sha256_str)
  683. #endif
  684. #if defined(crypto_pwhash_scryptsalsa208sha256_SALTBYTES)
  685. ZEND_FE(sodium_crypto_pwhash_scryptsalsa208sha256_str_verify, arginfo_sodium_crypto_pwhash_scryptsalsa208sha256_str_verify)
  686. #endif
  687. ZEND_FE(sodium_crypto_scalarmult, arginfo_sodium_crypto_scalarmult)
  688. #if defined(crypto_core_ristretto255_HASHBYTES)
  689. ZEND_FE(sodium_crypto_scalarmult_ristretto255, arginfo_sodium_crypto_scalarmult_ristretto255)
  690. #endif
  691. #if defined(crypto_core_ristretto255_HASHBYTES)
  692. ZEND_FE(sodium_crypto_scalarmult_ristretto255_base, arginfo_sodium_crypto_scalarmult_ristretto255_base)
  693. #endif
  694. ZEND_FE(sodium_crypto_secretbox, arginfo_sodium_crypto_secretbox)
  695. ZEND_FE(sodium_crypto_secretbox_keygen, arginfo_sodium_crypto_secretbox_keygen)
  696. ZEND_FE(sodium_crypto_secretbox_open, arginfo_sodium_crypto_secretbox_open)
  697. #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
  698. ZEND_FE(sodium_crypto_secretstream_xchacha20poly1305_keygen, arginfo_sodium_crypto_secretstream_xchacha20poly1305_keygen)
  699. #endif
  700. #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
  701. ZEND_FE(sodium_crypto_secretstream_xchacha20poly1305_init_push, arginfo_sodium_crypto_secretstream_xchacha20poly1305_init_push)
  702. #endif
  703. #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
  704. ZEND_FE(sodium_crypto_secretstream_xchacha20poly1305_push, arginfo_sodium_crypto_secretstream_xchacha20poly1305_push)
  705. #endif
  706. #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
  707. ZEND_FE(sodium_crypto_secretstream_xchacha20poly1305_init_pull, arginfo_sodium_crypto_secretstream_xchacha20poly1305_init_pull)
  708. #endif
  709. #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
  710. ZEND_FE(sodium_crypto_secretstream_xchacha20poly1305_pull, arginfo_sodium_crypto_secretstream_xchacha20poly1305_pull)
  711. #endif
  712. #if defined(crypto_secretstream_xchacha20poly1305_ABYTES)
  713. ZEND_FE(sodium_crypto_secretstream_xchacha20poly1305_rekey, arginfo_sodium_crypto_secretstream_xchacha20poly1305_rekey)
  714. #endif
  715. ZEND_FE(sodium_crypto_shorthash, arginfo_sodium_crypto_shorthash)
  716. ZEND_FE(sodium_crypto_shorthash_keygen, arginfo_sodium_crypto_shorthash_keygen)
  717. ZEND_FE(sodium_crypto_sign, arginfo_sodium_crypto_sign)
  718. ZEND_FE(sodium_crypto_sign_detached, arginfo_sodium_crypto_sign_detached)
  719. ZEND_FE(sodium_crypto_sign_ed25519_pk_to_curve25519, arginfo_sodium_crypto_sign_ed25519_pk_to_curve25519)
  720. ZEND_FE(sodium_crypto_sign_ed25519_sk_to_curve25519, arginfo_sodium_crypto_sign_ed25519_sk_to_curve25519)
  721. ZEND_FE(sodium_crypto_sign_keypair, arginfo_sodium_crypto_sign_keypair)
  722. ZEND_FE(sodium_crypto_sign_keypair_from_secretkey_and_publickey, arginfo_sodium_crypto_sign_keypair_from_secretkey_and_publickey)
  723. ZEND_FE(sodium_crypto_sign_open, arginfo_sodium_crypto_sign_open)
  724. ZEND_FE(sodium_crypto_sign_publickey, arginfo_sodium_crypto_sign_publickey)
  725. ZEND_FE(sodium_crypto_sign_secretkey, arginfo_sodium_crypto_sign_secretkey)
  726. ZEND_FE(sodium_crypto_sign_publickey_from_secretkey, arginfo_sodium_crypto_sign_publickey_from_secretkey)
  727. ZEND_FE(sodium_crypto_sign_seed_keypair, arginfo_sodium_crypto_sign_seed_keypair)
  728. ZEND_FE(sodium_crypto_sign_verify_detached, arginfo_sodium_crypto_sign_verify_detached)
  729. ZEND_FE(sodium_crypto_stream, arginfo_sodium_crypto_stream)
  730. ZEND_FE(sodium_crypto_stream_keygen, arginfo_sodium_crypto_stream_keygen)
  731. ZEND_FE(sodium_crypto_stream_xor, arginfo_sodium_crypto_stream_xor)
  732. #if defined(crypto_stream_xchacha20_KEYBYTES)
  733. ZEND_FE(sodium_crypto_stream_xchacha20, arginfo_sodium_crypto_stream_xchacha20)
  734. #endif
  735. #if defined(crypto_stream_xchacha20_KEYBYTES)
  736. ZEND_FE(sodium_crypto_stream_xchacha20_keygen, arginfo_sodium_crypto_stream_xchacha20_keygen)
  737. #endif
  738. #if defined(crypto_stream_xchacha20_KEYBYTES)
  739. ZEND_FE(sodium_crypto_stream_xchacha20_xor, arginfo_sodium_crypto_stream_xchacha20_xor)
  740. #endif
  741. ZEND_FE(sodium_add, arginfo_sodium_add)
  742. ZEND_FE(sodium_compare, arginfo_sodium_compare)
  743. ZEND_FE(sodium_increment, arginfo_sodium_increment)
  744. ZEND_FE(sodium_memcmp, arginfo_sodium_memcmp)
  745. ZEND_FE(sodium_memzero, arginfo_sodium_memzero)
  746. ZEND_FE(sodium_pad, arginfo_sodium_pad)
  747. ZEND_FE(sodium_unpad, arginfo_sodium_unpad)
  748. ZEND_FE(sodium_bin2hex, arginfo_sodium_bin2hex)
  749. ZEND_FE(sodium_hex2bin, arginfo_sodium_hex2bin)
  750. #if defined(sodium_base64_VARIANT_ORIGINAL)
  751. ZEND_FE(sodium_bin2base64, arginfo_sodium_bin2base64)
  752. #endif
  753. #if defined(sodium_base64_VARIANT_ORIGINAL)
  754. ZEND_FE(sodium_base642bin, arginfo_sodium_base642bin)
  755. #endif
  756. ZEND_FALIAS(sodium_crypto_scalarmult_base, sodium_crypto_box_publickey_from_secretkey, arginfo_sodium_crypto_scalarmult_base)
  757. ZEND_FE_END
  758. };
  759. static const zend_function_entry class_SodiumException_methods[] = {
  760. ZEND_FE_END
  761. };
  762. static zend_class_entry *register_class_SodiumException(zend_class_entry *class_entry_Exception)
  763. {
  764. zend_class_entry ce, *class_entry;
  765. INIT_CLASS_ENTRY(ce, "SodiumException", class_SodiumException_methods);
  766. class_entry = zend_register_internal_class_ex(&ce, class_entry_Exception);
  767. return class_entry;
  768. }