__init__.py 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  1. # Copyright 2013-2019 Donald Stufft and individual contributors
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. from nacl.bindings.crypto_aead import (
  15. crypto_aead_chacha20poly1305_ABYTES,
  16. crypto_aead_chacha20poly1305_KEYBYTES,
  17. crypto_aead_chacha20poly1305_MESSAGEBYTES_MAX,
  18. crypto_aead_chacha20poly1305_NPUBBYTES,
  19. crypto_aead_chacha20poly1305_NSECBYTES,
  20. crypto_aead_chacha20poly1305_decrypt,
  21. crypto_aead_chacha20poly1305_encrypt,
  22. crypto_aead_chacha20poly1305_ietf_ABYTES,
  23. crypto_aead_chacha20poly1305_ietf_KEYBYTES,
  24. crypto_aead_chacha20poly1305_ietf_MESSAGEBYTES_MAX,
  25. crypto_aead_chacha20poly1305_ietf_NPUBBYTES,
  26. crypto_aead_chacha20poly1305_ietf_NSECBYTES,
  27. crypto_aead_chacha20poly1305_ietf_decrypt,
  28. crypto_aead_chacha20poly1305_ietf_encrypt,
  29. crypto_aead_xchacha20poly1305_ietf_ABYTES,
  30. crypto_aead_xchacha20poly1305_ietf_KEYBYTES,
  31. crypto_aead_xchacha20poly1305_ietf_MESSAGEBYTES_MAX,
  32. crypto_aead_xchacha20poly1305_ietf_NPUBBYTES,
  33. crypto_aead_xchacha20poly1305_ietf_NSECBYTES,
  34. crypto_aead_xchacha20poly1305_ietf_decrypt,
  35. crypto_aead_xchacha20poly1305_ietf_encrypt,
  36. )
  37. from nacl.bindings.crypto_box import (
  38. crypto_box,
  39. crypto_box_BEFORENMBYTES,
  40. crypto_box_BOXZEROBYTES,
  41. crypto_box_NONCEBYTES,
  42. crypto_box_PUBLICKEYBYTES,
  43. crypto_box_SEALBYTES,
  44. crypto_box_SECRETKEYBYTES,
  45. crypto_box_SEEDBYTES,
  46. crypto_box_ZEROBYTES,
  47. crypto_box_afternm,
  48. crypto_box_beforenm,
  49. crypto_box_keypair,
  50. crypto_box_open,
  51. crypto_box_open_afternm,
  52. crypto_box_seal,
  53. crypto_box_seal_open,
  54. crypto_box_seed_keypair,
  55. )
  56. from nacl.bindings.crypto_core import (
  57. crypto_core_ed25519_BYTES,
  58. crypto_core_ed25519_NONREDUCEDSCALARBYTES,
  59. crypto_core_ed25519_SCALARBYTES,
  60. crypto_core_ed25519_add,
  61. crypto_core_ed25519_is_valid_point,
  62. crypto_core_ed25519_scalar_add,
  63. crypto_core_ed25519_scalar_complement,
  64. crypto_core_ed25519_scalar_invert,
  65. crypto_core_ed25519_scalar_mul,
  66. crypto_core_ed25519_scalar_negate,
  67. crypto_core_ed25519_scalar_reduce,
  68. crypto_core_ed25519_scalar_sub,
  69. crypto_core_ed25519_sub,
  70. has_crypto_core_ed25519,
  71. )
  72. from nacl.bindings.crypto_generichash import (
  73. crypto_generichash_BYTES,
  74. crypto_generichash_BYTES_MAX,
  75. crypto_generichash_BYTES_MIN,
  76. crypto_generichash_KEYBYTES,
  77. crypto_generichash_KEYBYTES_MAX,
  78. crypto_generichash_KEYBYTES_MIN,
  79. crypto_generichash_PERSONALBYTES,
  80. crypto_generichash_SALTBYTES,
  81. crypto_generichash_STATEBYTES,
  82. generichash_blake2b_final as crypto_generichash_blake2b_final,
  83. generichash_blake2b_init as crypto_generichash_blake2b_init,
  84. generichash_blake2b_salt_personal as crypto_generichash_blake2b_salt_personal,
  85. generichash_blake2b_update as crypto_generichash_blake2b_update,
  86. )
  87. from nacl.bindings.crypto_hash import (
  88. crypto_hash,
  89. crypto_hash_BYTES,
  90. crypto_hash_sha256,
  91. crypto_hash_sha256_BYTES,
  92. crypto_hash_sha512,
  93. crypto_hash_sha512_BYTES,
  94. )
  95. from nacl.bindings.crypto_kx import (
  96. crypto_kx_PUBLIC_KEY_BYTES,
  97. crypto_kx_SECRET_KEY_BYTES,
  98. crypto_kx_SEED_BYTES,
  99. crypto_kx_SESSION_KEY_BYTES,
  100. crypto_kx_client_session_keys,
  101. crypto_kx_keypair,
  102. crypto_kx_seed_keypair,
  103. crypto_kx_server_session_keys,
  104. )
  105. from nacl.bindings.crypto_pwhash import (
  106. crypto_pwhash_ALG_ARGON2I13,
  107. crypto_pwhash_ALG_ARGON2ID13,
  108. crypto_pwhash_ALG_DEFAULT,
  109. crypto_pwhash_BYTES_MAX,
  110. crypto_pwhash_BYTES_MIN,
  111. crypto_pwhash_PASSWD_MAX,
  112. crypto_pwhash_PASSWD_MIN,
  113. crypto_pwhash_SALTBYTES,
  114. crypto_pwhash_STRBYTES,
  115. crypto_pwhash_alg,
  116. crypto_pwhash_argon2i_MEMLIMIT_INTERACTIVE,
  117. crypto_pwhash_argon2i_MEMLIMIT_MAX,
  118. crypto_pwhash_argon2i_MEMLIMIT_MIN,
  119. crypto_pwhash_argon2i_MEMLIMIT_MODERATE,
  120. crypto_pwhash_argon2i_MEMLIMIT_SENSITIVE,
  121. crypto_pwhash_argon2i_OPSLIMIT_INTERACTIVE,
  122. crypto_pwhash_argon2i_OPSLIMIT_MAX,
  123. crypto_pwhash_argon2i_OPSLIMIT_MIN,
  124. crypto_pwhash_argon2i_OPSLIMIT_MODERATE,
  125. crypto_pwhash_argon2i_OPSLIMIT_SENSITIVE,
  126. crypto_pwhash_argon2i_STRPREFIX,
  127. crypto_pwhash_argon2id_MEMLIMIT_INTERACTIVE,
  128. crypto_pwhash_argon2id_MEMLIMIT_MAX,
  129. crypto_pwhash_argon2id_MEMLIMIT_MIN,
  130. crypto_pwhash_argon2id_MEMLIMIT_MODERATE,
  131. crypto_pwhash_argon2id_MEMLIMIT_SENSITIVE,
  132. crypto_pwhash_argon2id_OPSLIMIT_INTERACTIVE,
  133. crypto_pwhash_argon2id_OPSLIMIT_MAX,
  134. crypto_pwhash_argon2id_OPSLIMIT_MIN,
  135. crypto_pwhash_argon2id_OPSLIMIT_MODERATE,
  136. crypto_pwhash_argon2id_OPSLIMIT_SENSITIVE,
  137. crypto_pwhash_argon2id_STRPREFIX,
  138. crypto_pwhash_scryptsalsa208sha256_BYTES_MAX,
  139. crypto_pwhash_scryptsalsa208sha256_BYTES_MIN,
  140. crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE,
  141. crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MAX,
  142. crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MIN,
  143. crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_SENSITIVE,
  144. crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE,
  145. crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MAX,
  146. crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MIN,
  147. crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_SENSITIVE,
  148. crypto_pwhash_scryptsalsa208sha256_PASSWD_MAX,
  149. crypto_pwhash_scryptsalsa208sha256_PASSWD_MIN,
  150. crypto_pwhash_scryptsalsa208sha256_SALTBYTES,
  151. crypto_pwhash_scryptsalsa208sha256_STRBYTES,
  152. crypto_pwhash_scryptsalsa208sha256_STRPREFIX,
  153. crypto_pwhash_scryptsalsa208sha256_ll,
  154. crypto_pwhash_scryptsalsa208sha256_str,
  155. crypto_pwhash_scryptsalsa208sha256_str_verify,
  156. crypto_pwhash_str_alg,
  157. crypto_pwhash_str_verify,
  158. has_crypto_pwhash_scryptsalsa208sha256,
  159. nacl_bindings_pick_scrypt_params,
  160. )
  161. from nacl.bindings.crypto_scalarmult import (
  162. crypto_scalarmult,
  163. crypto_scalarmult_BYTES,
  164. crypto_scalarmult_SCALARBYTES,
  165. crypto_scalarmult_base,
  166. crypto_scalarmult_ed25519,
  167. crypto_scalarmult_ed25519_BYTES,
  168. crypto_scalarmult_ed25519_SCALARBYTES,
  169. crypto_scalarmult_ed25519_base,
  170. crypto_scalarmult_ed25519_base_noclamp,
  171. crypto_scalarmult_ed25519_noclamp,
  172. has_crypto_scalarmult_ed25519,
  173. )
  174. from nacl.bindings.crypto_secretbox import (
  175. crypto_secretbox,
  176. crypto_secretbox_BOXZEROBYTES,
  177. crypto_secretbox_KEYBYTES,
  178. crypto_secretbox_MACBYTES,
  179. crypto_secretbox_MESSAGEBYTES_MAX,
  180. crypto_secretbox_NONCEBYTES,
  181. crypto_secretbox_ZEROBYTES,
  182. crypto_secretbox_open,
  183. )
  184. from nacl.bindings.crypto_secretstream import (
  185. crypto_secretstream_xchacha20poly1305_ABYTES,
  186. crypto_secretstream_xchacha20poly1305_HEADERBYTES,
  187. crypto_secretstream_xchacha20poly1305_KEYBYTES,
  188. crypto_secretstream_xchacha20poly1305_STATEBYTES,
  189. crypto_secretstream_xchacha20poly1305_TAG_FINAL,
  190. crypto_secretstream_xchacha20poly1305_TAG_MESSAGE,
  191. crypto_secretstream_xchacha20poly1305_TAG_PUSH,
  192. crypto_secretstream_xchacha20poly1305_TAG_REKEY,
  193. crypto_secretstream_xchacha20poly1305_init_pull,
  194. crypto_secretstream_xchacha20poly1305_init_push,
  195. crypto_secretstream_xchacha20poly1305_keygen,
  196. crypto_secretstream_xchacha20poly1305_pull,
  197. crypto_secretstream_xchacha20poly1305_push,
  198. crypto_secretstream_xchacha20poly1305_rekey,
  199. crypto_secretstream_xchacha20poly1305_state,
  200. )
  201. from nacl.bindings.crypto_shorthash import (
  202. BYTES as crypto_shorthash_siphash24_BYTES,
  203. KEYBYTES as crypto_shorthash_siphash24_KEYBYTES,
  204. XBYTES as crypto_shorthash_siphashx24_BYTES,
  205. XKEYBYTES as crypto_shorthash_siphashx24_KEYBYTES,
  206. crypto_shorthash_siphash24,
  207. crypto_shorthash_siphashx24,
  208. has_crypto_shorthash_siphashx24,
  209. )
  210. from nacl.bindings.crypto_sign import (
  211. crypto_sign,
  212. crypto_sign_BYTES,
  213. crypto_sign_PUBLICKEYBYTES,
  214. crypto_sign_SECRETKEYBYTES,
  215. crypto_sign_SEEDBYTES,
  216. crypto_sign_ed25519_pk_to_curve25519,
  217. crypto_sign_ed25519_sk_to_curve25519,
  218. crypto_sign_ed25519_sk_to_pk,
  219. crypto_sign_ed25519_sk_to_seed,
  220. crypto_sign_ed25519ph_STATEBYTES,
  221. crypto_sign_ed25519ph_final_create,
  222. crypto_sign_ed25519ph_final_verify,
  223. crypto_sign_ed25519ph_state,
  224. crypto_sign_ed25519ph_update,
  225. crypto_sign_keypair,
  226. crypto_sign_open,
  227. crypto_sign_seed_keypair,
  228. )
  229. from nacl.bindings.randombytes import (
  230. randombytes,
  231. randombytes_buf_deterministic,
  232. )
  233. from nacl.bindings.sodium_core import sodium_init
  234. from nacl.bindings.utils import (
  235. sodium_add,
  236. sodium_increment,
  237. sodium_memcmp,
  238. sodium_pad,
  239. sodium_unpad,
  240. )
  241. __all__ = [
  242. "crypto_aead_chacha20poly1305_ABYTES",
  243. "crypto_aead_chacha20poly1305_KEYBYTES",
  244. "crypto_aead_chacha20poly1305_MESSAGEBYTES_MAX",
  245. "crypto_aead_chacha20poly1305_NPUBBYTES",
  246. "crypto_aead_chacha20poly1305_NSECBYTES",
  247. "crypto_aead_chacha20poly1305_decrypt",
  248. "crypto_aead_chacha20poly1305_encrypt",
  249. "crypto_aead_chacha20poly1305_ietf_ABYTES",
  250. "crypto_aead_chacha20poly1305_ietf_KEYBYTES",
  251. "crypto_aead_chacha20poly1305_ietf_MESSAGEBYTES_MAX",
  252. "crypto_aead_chacha20poly1305_ietf_NPUBBYTES",
  253. "crypto_aead_chacha20poly1305_ietf_NSECBYTES",
  254. "crypto_aead_chacha20poly1305_ietf_decrypt",
  255. "crypto_aead_chacha20poly1305_ietf_encrypt",
  256. "crypto_aead_xchacha20poly1305_ietf_ABYTES",
  257. "crypto_aead_xchacha20poly1305_ietf_KEYBYTES",
  258. "crypto_aead_xchacha20poly1305_ietf_MESSAGEBYTES_MAX",
  259. "crypto_aead_xchacha20poly1305_ietf_NPUBBYTES",
  260. "crypto_aead_xchacha20poly1305_ietf_NSECBYTES",
  261. "crypto_aead_xchacha20poly1305_ietf_decrypt",
  262. "crypto_aead_xchacha20poly1305_ietf_encrypt",
  263. "crypto_box_SECRETKEYBYTES",
  264. "crypto_box_PUBLICKEYBYTES",
  265. "crypto_box_SEEDBYTES",
  266. "crypto_box_NONCEBYTES",
  267. "crypto_box_ZEROBYTES",
  268. "crypto_box_BOXZEROBYTES",
  269. "crypto_box_BEFORENMBYTES",
  270. "crypto_box_SEALBYTES",
  271. "crypto_box_keypair",
  272. "crypto_box",
  273. "crypto_box_open",
  274. "crypto_box_beforenm",
  275. "crypto_box_afternm",
  276. "crypto_box_open_afternm",
  277. "crypto_box_seal",
  278. "crypto_box_seal_open",
  279. "crypto_box_seed_keypair",
  280. "has_crypto_core_ed25519",
  281. "crypto_core_ed25519_BYTES",
  282. "crypto_core_ed25519_UNIFORMBYTES",
  283. "crypto_core_ed25519_SCALARBYTES",
  284. "crypto_core_ed25519_NONREDUCEDSCALARBYTES",
  285. "crypto_core_ed25519_add",
  286. "crypto_core_ed25519_from_uniform",
  287. "crypto_core_ed25519_is_valid_point",
  288. "crypto_core_ed25519_sub",
  289. "crypto_core_ed25519_scalar_invert",
  290. "crypto_core_ed25519_scalar_negate",
  291. "crypto_core_ed25519_scalar_complement",
  292. "crypto_core_ed25519_scalar_add",
  293. "crypto_core_ed25519_scalar_sub",
  294. "crypto_core_ed25519_scalar_mul",
  295. "crypto_core_ed25519_scalar_reduce",
  296. "crypto_hash_BYTES",
  297. "crypto_hash_sha256_BYTES",
  298. "crypto_hash_sha512_BYTES",
  299. "crypto_hash",
  300. "crypto_hash_sha256",
  301. "crypto_hash_sha512",
  302. "crypto_generichash_BYTES",
  303. "crypto_generichash_BYTES_MIN",
  304. "crypto_generichash_BYTES_MAX",
  305. "crypto_generichash_KEYBYTES",
  306. "crypto_generichash_KEYBYTES_MIN",
  307. "crypto_generichash_KEYBYTES_MAX",
  308. "crypto_generichash_SALTBYTES",
  309. "crypto_generichash_PERSONALBYTES",
  310. "crypto_generichash_STATEBYTES",
  311. "crypto_generichash_blake2b_salt_personal",
  312. "crypto_generichash_blake2b_init",
  313. "crypto_generichash_blake2b_update",
  314. "crypto_generichash_blake2b_final",
  315. "crypto_kx_keypair",
  316. "crypto_kx_seed_keypair",
  317. "crypto_kx_client_session_keys",
  318. "crypto_kx_server_session_keys",
  319. "crypto_kx_PUBLIC_KEY_BYTES",
  320. "crypto_kx_SECRET_KEY_BYTES",
  321. "crypto_kx_SEED_BYTES",
  322. "crypto_kx_SESSION_KEY_BYTES",
  323. "has_crypto_scalarmult_ed25519",
  324. "crypto_scalarmult_BYTES",
  325. "crypto_scalarmult_SCALARBYTES",
  326. "crypto_scalarmult",
  327. "crypto_scalarmult_base",
  328. "crypto_scalarmult_ed25519_BYTES",
  329. "crypto_scalarmult_ed25519_SCALARBYTES",
  330. "crypto_scalarmult_ed25519",
  331. "crypto_scalarmult_ed25519_base",
  332. "crypto_scalarmult_ed25519_noclamp",
  333. "crypto_scalarmult_ed25519_base_noclamp",
  334. "crypto_secretbox_KEYBYTES",
  335. "crypto_secretbox_NONCEBYTES",
  336. "crypto_secretbox_ZEROBYTES",
  337. "crypto_secretbox_BOXZEROBYTES",
  338. "crypto_secretbox_MACBYTES",
  339. "crypto_secretbox_MESSAGEBYTES_MAX",
  340. "crypto_secretbox",
  341. "crypto_secretbox_open",
  342. "crypto_secretstream_xchacha20poly1305_ABYTES",
  343. "crypto_secretstream_xchacha20poly1305_HEADERBYTES",
  344. "crypto_secretstream_xchacha20poly1305_KEYBYTES",
  345. "crypto_secretstream_xchacha20poly1305_STATEBYTES",
  346. "crypto_secretstream_xchacha20poly1305_TAG_FINAL",
  347. "crypto_secretstream_xchacha20poly1305_TAG_MESSAGE",
  348. "crypto_secretstream_xchacha20poly1305_TAG_PUSH",
  349. "crypto_secretstream_xchacha20poly1305_TAG_REKEY",
  350. "crypto_secretstream_xchacha20poly1305_init_pull",
  351. "crypto_secretstream_xchacha20poly1305_init_push",
  352. "crypto_secretstream_xchacha20poly1305_keygen",
  353. "crypto_secretstream_xchacha20poly1305_pull",
  354. "crypto_secretstream_xchacha20poly1305_push",
  355. "crypto_secretstream_xchacha20poly1305_rekey",
  356. "crypto_secretstream_xchacha20poly1305_state",
  357. "has_crypto_shorthash_siphashx24",
  358. "crypto_shorthash_siphash24_BYTES",
  359. "crypto_shorthash_siphash24_KEYBYTES",
  360. "crypto_shorthash_siphash24",
  361. "crypto_shorthash_siphashx24_BYTES",
  362. "crypto_shorthash_siphashx24_KEYBYTES",
  363. "crypto_shorthash_siphashx24",
  364. "crypto_sign_BYTES",
  365. "crypto_sign_SEEDBYTES",
  366. "crypto_sign_PUBLICKEYBYTES",
  367. "crypto_sign_SECRETKEYBYTES",
  368. "crypto_sign_keypair",
  369. "crypto_sign_seed_keypair",
  370. "crypto_sign",
  371. "crypto_sign_open",
  372. "crypto_sign_ed25519_pk_to_curve25519",
  373. "crypto_sign_ed25519_sk_to_curve25519",
  374. "crypto_sign_ed25519_sk_to_pk",
  375. "crypto_sign_ed25519_sk_to_seed",
  376. "crypto_sign_ed25519ph_STATEBYTES",
  377. "crypto_sign_ed25519ph_final_create",
  378. "crypto_sign_ed25519ph_final_verify",
  379. "crypto_sign_ed25519ph_state",
  380. "crypto_sign_ed25519ph_update",
  381. "crypto_pwhash_ALG_ARGON2I13",
  382. "crypto_pwhash_ALG_ARGON2ID13",
  383. "crypto_pwhash_ALG_DEFAULT",
  384. "crypto_pwhash_BYTES_MAX",
  385. "crypto_pwhash_BYTES_MIN",
  386. "crypto_pwhash_PASSWD_MAX",
  387. "crypto_pwhash_PASSWD_MIN",
  388. "crypto_pwhash_SALTBYTES",
  389. "crypto_pwhash_STRBYTES",
  390. "crypto_pwhash_alg",
  391. "crypto_pwhash_argon2i_MEMLIMIT_MIN",
  392. "crypto_pwhash_argon2i_MEMLIMIT_MAX",
  393. "crypto_pwhash_argon2i_MEMLIMIT_INTERACTIVE",
  394. "crypto_pwhash_argon2i_MEMLIMIT_MODERATE",
  395. "crypto_pwhash_argon2i_MEMLIMIT_SENSITIVE",
  396. "crypto_pwhash_argon2i_OPSLIMIT_MIN",
  397. "crypto_pwhash_argon2i_OPSLIMIT_MAX",
  398. "crypto_pwhash_argon2i_OPSLIMIT_INTERACTIVE",
  399. "crypto_pwhash_argon2i_OPSLIMIT_MODERATE",
  400. "crypto_pwhash_argon2i_OPSLIMIT_SENSITIVE",
  401. "crypto_pwhash_argon2i_STRPREFIX",
  402. "crypto_pwhash_argon2id_MEMLIMIT_MIN",
  403. "crypto_pwhash_argon2id_MEMLIMIT_MAX",
  404. "crypto_pwhash_argon2id_MEMLIMIT_INTERACTIVE",
  405. "crypto_pwhash_argon2id_MEMLIMIT_MODERATE",
  406. "crypto_pwhash_argon2id_OPSLIMIT_MIN",
  407. "crypto_pwhash_argon2id_OPSLIMIT_MAX",
  408. "crypto_pwhash_argon2id_MEMLIMIT_SENSITIVE",
  409. "crypto_pwhash_argon2id_OPSLIMIT_INTERACTIVE",
  410. "crypto_pwhash_argon2id_OPSLIMIT_MODERATE",
  411. "crypto_pwhash_argon2id_OPSLIMIT_SENSITIVE",
  412. "crypto_pwhash_argon2id_STRPREFIX",
  413. "crypto_pwhash_str_alg",
  414. "crypto_pwhash_str_verify",
  415. "has_crypto_pwhash_scryptsalsa208sha256",
  416. "crypto_pwhash_scryptsalsa208sha256_BYTES_MAX",
  417. "crypto_pwhash_scryptsalsa208sha256_BYTES_MIN",
  418. "crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE",
  419. "crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MAX",
  420. "crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MIN",
  421. "crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_SENSITIVE",
  422. "crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE",
  423. "crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MAX",
  424. "crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MIN",
  425. "crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_SENSITIVE",
  426. "crypto_pwhash_scryptsalsa208sha256_PASSWD_MAX",
  427. "crypto_pwhash_scryptsalsa208sha256_PASSWD_MIN",
  428. "crypto_pwhash_scryptsalsa208sha256_SALTBYTES",
  429. "crypto_pwhash_scryptsalsa208sha256_STRBYTES",
  430. "crypto_pwhash_scryptsalsa208sha256_STRPREFIX",
  431. "crypto_pwhash_scryptsalsa208sha256_ll",
  432. "crypto_pwhash_scryptsalsa208sha256_str",
  433. "crypto_pwhash_scryptsalsa208sha256_str_verify",
  434. "nacl_bindings_pick_scrypt_params",
  435. "randombytes",
  436. "randombytes_buf_deterministic",
  437. "sodium_init",
  438. "sodium_add",
  439. "sodium_increment",
  440. "sodium_memcmp",
  441. "sodium_pad",
  442. "sodium_unpad",
  443. ]
  444. # Initialize Sodium
  445. sodium_init()