rbnacl-libsodium 0.4.5a

Sign up to get free protection for your applications and to get access to all the features.
Files changed (409) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +35 -0
  3. data/.gitmodules +3 -0
  4. data/CHANGES.md +3 -0
  5. data/Gemfile +6 -0
  6. data/LICENSE +21 -0
  7. data/README.md +23 -0
  8. data/Rakefile +1 -0
  9. data/ext/rbnacl/extconf.rb +30 -0
  10. data/lib/rbnacl/libsodium.rb +11 -0
  11. data/lib/rbnacl/libsodium/version.rb +5 -0
  12. data/rbnacl-libsodium.gemspec +25 -0
  13. data/vendor/libsodium/AUTHORS +101 -0
  14. data/vendor/libsodium/ChangeLog +68 -0
  15. data/vendor/libsodium/LICENSE +16 -0
  16. data/vendor/libsodium/Makefile.am +20 -0
  17. data/vendor/libsodium/README +1 -0
  18. data/vendor/libsodium/README.markdown +246 -0
  19. data/vendor/libsodium/THANKS +17 -0
  20. data/vendor/libsodium/autogen.sh +16 -0
  21. data/vendor/libsodium/configure.ac +405 -0
  22. data/vendor/libsodium/dist-build/android.sh +48 -0
  23. data/vendor/libsodium/dist-build/iphone.sh +16 -0
  24. data/vendor/libsodium/dist-build/msys.sh +9 -0
  25. data/vendor/libsodium/libsodium.pc.in +11 -0
  26. data/vendor/libsodium/libsodium.sln +38 -0
  27. data/vendor/libsodium/libsodium.vcxproj +508 -0
  28. data/vendor/libsodium/libsodium.vcxproj.filters +569 -0
  29. data/vendor/libsodium/logo.png +0 -0
  30. data/vendor/libsodium/m4/ax_check_compile_flag.m4 +73 -0
  31. data/vendor/libsodium/m4/ax_check_gnu_make.m4 +78 -0
  32. data/vendor/libsodium/m4/ax_check_link_flag.m4 +72 -0
  33. data/vendor/libsodium/m4/ld-output-def.m4 +29 -0
  34. data/vendor/libsodium/m4/pkg.m4 +214 -0
  35. data/vendor/libsodium/msvc-scripts/Makefile.am +4 -0
  36. data/vendor/libsodium/msvc-scripts/process.bat +8 -0
  37. data/vendor/libsodium/msvc-scripts/rep.vbs +12 -0
  38. data/vendor/libsodium/msvc-scripts/sodium.props +25 -0
  39. data/vendor/libsodium/src/Makefile.am +3 -0
  40. data/vendor/libsodium/src/libsodium/Makefile.am +232 -0
  41. data/vendor/libsodium/src/libsodium/crypto_auth/crypto_auth.c +34 -0
  42. data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha256/auth_hmacsha256_api.c +16 -0
  43. data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha256/checksum +1 -0
  44. data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha256/ref/api.h +10 -0
  45. data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha256/ref/hmac_hmacsha256.c +83 -0
  46. data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha256/ref/verify_hmacsha256.c +9 -0
  47. data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512256/auth_hmacsha512256_api.c +16 -0
  48. data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512256/checksum +1 -0
  49. data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512256/ref/api.h +10 -0
  50. data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512256/ref/hmac_hmacsha512256.c +86 -0
  51. data/vendor/libsodium/src/libsodium/crypto_auth/hmacsha512256/ref/verify_hmacsha512256.c +9 -0
  52. data/vendor/libsodium/src/libsodium/crypto_auth/try.c +119 -0
  53. data/vendor/libsodium/src/libsodium/crypto_box/crypto_box.c +95 -0
  54. data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/box_curve25519xsalsa20poly1305_api.c +41 -0
  55. data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/checksum +1 -0
  56. data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/after_curve25519xsalsa20poly1305.c +22 -0
  57. data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/api.h +19 -0
  58. data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/before_curve25519xsalsa20poly1305.c +19 -0
  59. data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/box_curve25519xsalsa20poly1305.c +27 -0
  60. data/vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/keypair_curve25519xsalsa20poly1305.c +12 -0
  61. data/vendor/libsodium/src/libsodium/crypto_box/try.c +195 -0
  62. data/vendor/libsodium/src/libsodium/crypto_core/hsalsa20/checksum +1 -0
  63. data/vendor/libsodium/src/libsodium/crypto_core/hsalsa20/core_hsalsa20_api.c +26 -0
  64. data/vendor/libsodium/src/libsodium/crypto_core/hsalsa20/ref2/api.h +11 -0
  65. data/vendor/libsodium/src/libsodium/crypto_core/hsalsa20/ref2/core_hsalsa20.c +108 -0
  66. data/vendor/libsodium/src/libsodium/crypto_core/salsa20/checksum +1 -0
  67. data/vendor/libsodium/src/libsodium/crypto_core/salsa20/core_salsa20_api.c +26 -0
  68. data/vendor/libsodium/src/libsodium/crypto_core/salsa20/ref/api.h +11 -0
  69. data/vendor/libsodium/src/libsodium/crypto_core/salsa20/ref/core_salsa20.c +134 -0
  70. data/vendor/libsodium/src/libsodium/crypto_core/salsa2012/checksum +1 -0
  71. data/vendor/libsodium/src/libsodium/crypto_core/salsa2012/core_salsa2012_api.c +26 -0
  72. data/vendor/libsodium/src/libsodium/crypto_core/salsa2012/ref/api.h +11 -0
  73. data/vendor/libsodium/src/libsodium/crypto_core/salsa2012/ref/core_salsa2012.c +134 -0
  74. data/vendor/libsodium/src/libsodium/crypto_core/salsa208/checksum +1 -0
  75. data/vendor/libsodium/src/libsodium/crypto_core/salsa208/core_salsa208_api.c +26 -0
  76. data/vendor/libsodium/src/libsodium/crypto_core/salsa208/ref/api.h +11 -0
  77. data/vendor/libsodium/src/libsodium/crypto_core/salsa208/ref/core_salsa208.c +134 -0
  78. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/generichash_blake2_api.c +31 -0
  79. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/api.h +4 -0
  80. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2-impl.h +132 -0
  81. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2.h +169 -0
  82. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2b-ref.c +364 -0
  83. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/blake2s-ref.c +355 -0
  84. data/vendor/libsodium/src/libsodium/crypto_generichash/blake2/ref/generichash_blake2b.c +61 -0
  85. data/vendor/libsodium/src/libsodium/crypto_generichash/crypto_generichash.c +84 -0
  86. data/vendor/libsodium/src/libsodium/crypto_hash/crypto_hash.c +9 -0
  87. data/vendor/libsodium/src/libsodium/crypto_hash/sha256/checksum +1 -0
  88. data/vendor/libsodium/src/libsodium/crypto_hash/sha256/hash_sha256_api.c +11 -0
  89. data/vendor/libsodium/src/libsodium/crypto_hash/sha256/ref/api.h +8 -0
  90. data/vendor/libsodium/src/libsodium/crypto_hash/sha256/ref/hash_sha256.c +69 -0
  91. data/vendor/libsodium/src/libsodium/crypto_hash/sha512/checksum +1 -0
  92. data/vendor/libsodium/src/libsodium/crypto_hash/sha512/hash_sha512_api.c +11 -0
  93. data/vendor/libsodium/src/libsodium/crypto_hash/sha512/ref/api.h +8 -0
  94. data/vendor/libsodium/src/libsodium/crypto_hash/sha512/ref/hash_sha512.c +71 -0
  95. data/vendor/libsodium/src/libsodium/crypto_hash/try.c +76 -0
  96. data/vendor/libsodium/src/libsodium/crypto_hashblocks/sha256/checksum +1 -0
  97. data/vendor/libsodium/src/libsodium/crypto_hashblocks/sha256/hashblocks_sha256_api.c +16 -0
  98. data/vendor/libsodium/src/libsodium/crypto_hashblocks/sha256/ref/api.h +9 -0
  99. data/vendor/libsodium/src/libsodium/crypto_hashblocks/sha256/ref/blocks_sha256.c +212 -0
  100. data/vendor/libsodium/src/libsodium/crypto_hashblocks/sha512/checksum +1 -0
  101. data/vendor/libsodium/src/libsodium/crypto_hashblocks/sha512/hashblocks_sha512_api.c +16 -0
  102. data/vendor/libsodium/src/libsodium/crypto_hashblocks/sha512/ref/api.h +9 -0
  103. data/vendor/libsodium/src/libsodium/crypto_hashblocks/sha512/ref/blocks_sha512.c +239 -0
  104. data/vendor/libsodium/src/libsodium/crypto_hashblocks/try.c +78 -0
  105. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/crypto_onetimeauth.c +34 -0
  106. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/53/api.h +8 -0
  107. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/53/auth_poly1305_53.c +1661 -0
  108. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/53/verify_poly1305_53.c +10 -0
  109. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/api.h +8 -0
  110. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/auth_poly1305_donna.c +151 -0
  111. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/portable-jane.h +772 -0
  112. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/verify_poly1305_donna.c +10 -0
  113. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305.c +36 -0
  114. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305_api.c +16 -0
  115. data/vendor/libsodium/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305_try.c +152 -0
  116. data/vendor/libsodium/src/libsodium/crypto_scalarmult/crypto_scalarmult.c +34 -0
  117. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/checksum +1 -0
  118. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/donna_c64/api.h +9 -0
  119. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/donna_c64/base_curve25519_donna_c64.c +13 -0
  120. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/donna_c64/smult_curve25519_donna_c64.c +426 -0
  121. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref/api.h +8 -0
  122. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref/base_curve25519_ref.c +20 -0
  123. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref/smult_curve25519_ref.c +268 -0
  124. data/vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519_api.c +14 -0
  125. data/vendor/libsodium/src/libsodium/crypto_scalarmult/try.c +125 -0
  126. data/vendor/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox.c +48 -0
  127. data/vendor/libsodium/src/libsodium/crypto_secretbox/try.c +129 -0
  128. data/vendor/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/checksum +1 -0
  129. data/vendor/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/ref/api.h +12 -0
  130. data/vendor/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/ref/box_xsalsa20poly1305.c +35 -0
  131. data/vendor/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/secretbox_xsalsa20poly1305_api.c +26 -0
  132. data/vendor/libsodium/src/libsodium/crypto_shorthash/crypto_shorthash.c +27 -0
  133. data/vendor/libsodium/src/libsodium/crypto_shorthash/siphash24/ref/api.h +8 -0
  134. data/vendor/libsodium/src/libsodium/crypto_shorthash/siphash24/ref/shorthash_siphash24.c +91 -0
  135. data/vendor/libsodium/src/libsodium/crypto_shorthash/siphash24/shorthash_siphash24_api.c +11 -0
  136. data/vendor/libsodium/src/libsodium/crypto_sign/crypto_sign.c +61 -0
  137. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/description +1 -0
  138. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/api.h +14 -0
  139. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/base.h +1344 -0
  140. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/base2.h +40 -0
  141. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/d.h +1 -0
  142. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/d2.h +1 -0
  143. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe.h +56 -0
  144. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_0.c +19 -0
  145. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_1.c +19 -0
  146. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_add.c +57 -0
  147. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_cmov.c +63 -0
  148. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_copy.c +29 -0
  149. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_frombytes.c +73 -0
  150. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_invert.c +14 -0
  151. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_isnegative.c +16 -0
  152. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_isnonzero.c +19 -0
  153. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_mul.c +253 -0
  154. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_neg.c +45 -0
  155. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_pow22523.c +13 -0
  156. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_sq.c +149 -0
  157. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_sq2.c +160 -0
  158. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_sub.c +57 -0
  159. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/fe_tobytes.c +119 -0
  160. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge.h +95 -0
  161. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_add.c +11 -0
  162. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_add.h +97 -0
  163. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_double_scalarmult.c +96 -0
  164. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_frombytes.c +50 -0
  165. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_madd.c +11 -0
  166. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_madd.h +88 -0
  167. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_msub.c +11 -0
  168. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_msub.h +88 -0
  169. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p1p1_to_p2.c +12 -0
  170. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p1p1_to_p3.c +13 -0
  171. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p2_0.c +8 -0
  172. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p2_dbl.c +11 -0
  173. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p2_dbl.h +73 -0
  174. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p3_0.c +9 -0
  175. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p3_dbl.c +12 -0
  176. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p3_to_cached.c +17 -0
  177. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p3_to_p2.c +12 -0
  178. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_p3_tobytes.c +14 -0
  179. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_precomp_0.c +8 -0
  180. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_scalarmult_base.c +105 -0
  181. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_sub.c +11 -0
  182. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_sub.h +97 -0
  183. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/ge_tobytes.c +14 -0
  184. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/keypair.c +31 -0
  185. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/open.c +40 -0
  186. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/pow22523.h +160 -0
  187. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/pow225521.h +160 -0
  188. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sc.h +15 -0
  189. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sc_muladd.c +368 -0
  190. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sc_reduce.c +275 -0
  191. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sign.c +38 -0
  192. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sqrtm1.h +1 -0
  193. data/vendor/libsodium/src/libsodium/crypto_sign/ed25519/sign_ed25519_api.c +26 -0
  194. data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/api.h +13 -0
  195. data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/fe25519.h +54 -0
  196. data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/fe25519_edwards25519sha512batch.c +348 -0
  197. data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/ge25519.h +34 -0
  198. data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/ge25519_edwards25519sha512batch.c +230 -0
  199. data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/sc25519.h +51 -0
  200. data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/sc25519_edwards25519sha512batch.c +146 -0
  201. data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/ref/sign_edwards25519sha512batch.c +102 -0
  202. data/vendor/libsodium/src/libsodium/crypto_sign/edwards25519sha512batch/sign_edwards25519sha512batch_api.c +21 -0
  203. data/vendor/libsodium/src/libsodium/crypto_sign/try.c +87 -0
  204. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/checksum +1 -0
  205. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/afternm_aes128ctr.c +159 -0
  206. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/api.h +14 -0
  207. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/beforenm_aes128ctr.c +59 -0
  208. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/common.h +788 -0
  209. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/common_aes128ctr.c +64 -0
  210. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/consts.h +28 -0
  211. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/consts_aes128ctr.c +14 -0
  212. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/int128.h +47 -0
  213. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/int128_aes128ctr.c +131 -0
  214. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/stream_aes128ctr.c +28 -0
  215. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/types.h +10 -0
  216. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/portable/xor_afternm_aes128ctr.c +181 -0
  217. data/vendor/libsodium/src/libsodium/crypto_stream/aes128ctr/stream_aes128ctr_api.c +21 -0
  218. data/vendor/libsodium/src/libsodium/crypto_stream/aes256estream/hongjun/aes-table-be.h +274 -0
  219. data/vendor/libsodium/src/libsodium/crypto_stream/aes256estream/hongjun/aes-table-le.h +274 -0
  220. data/vendor/libsodium/src/libsodium/crypto_stream/aes256estream/hongjun/aes-table.h +56 -0
  221. data/vendor/libsodium/src/libsodium/crypto_stream/aes256estream/hongjun/aes256-ctr.c +238 -0
  222. data/vendor/libsodium/src/libsodium/crypto_stream/aes256estream/hongjun/aes256.h +171 -0
  223. data/vendor/libsodium/src/libsodium/crypto_stream/aes256estream/hongjun/api.h +14 -0
  224. data/vendor/libsodium/src/libsodium/crypto_stream/aes256estream/hongjun/ecrypt-sync.h +27 -0
  225. data/vendor/libsodium/src/libsodium/crypto_stream/aes256estream/stream_aes256estream_api.c +21 -0
  226. data/vendor/libsodium/src/libsodium/crypto_stream/crypto_stream.c +36 -0
  227. data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/amd64_xmm6/api.h +1 -0
  228. data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/amd64_xmm6/stream_salsa20_amd64_xmm6.S +950 -0
  229. data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/checksum +1 -0
  230. data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/ref/api.h +8 -0
  231. data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/ref/stream_salsa20_ref.c +55 -0
  232. data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/ref/xor_salsa20_ref.c +58 -0
  233. data/vendor/libsodium/src/libsodium/crypto_stream/salsa20/stream_salsa20_api.c +16 -0
  234. data/vendor/libsodium/src/libsodium/crypto_stream/salsa2012/checksum +1 -0
  235. data/vendor/libsodium/src/libsodium/crypto_stream/salsa2012/ref/api.h +11 -0
  236. data/vendor/libsodium/src/libsodium/crypto_stream/salsa2012/ref/stream_salsa2012.c +51 -0
  237. data/vendor/libsodium/src/libsodium/crypto_stream/salsa2012/ref/xor_salsa2012.c +54 -0
  238. data/vendor/libsodium/src/libsodium/crypto_stream/salsa2012/stream_salsa2012_api.c +16 -0
  239. data/vendor/libsodium/src/libsodium/crypto_stream/salsa208/checksum +1 -0
  240. data/vendor/libsodium/src/libsodium/crypto_stream/salsa208/ref/api.h +10 -0
  241. data/vendor/libsodium/src/libsodium/crypto_stream/salsa208/ref/stream_salsa208.c +51 -0
  242. data/vendor/libsodium/src/libsodium/crypto_stream/salsa208/ref/xor_salsa208.c +54 -0
  243. data/vendor/libsodium/src/libsodium/crypto_stream/salsa208/stream_salsa208_api.c +16 -0
  244. data/vendor/libsodium/src/libsodium/crypto_stream/try.c +122 -0
  245. data/vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/checksum +1 -0
  246. data/vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/ref/api.h +11 -0
  247. data/vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/ref/stream_xsalsa20.c +24 -0
  248. data/vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/ref/xor_xsalsa20.c +25 -0
  249. data/vendor/libsodium/src/libsodium/crypto_stream/xsalsa20/stream_xsalsa20_api.c +16 -0
  250. data/vendor/libsodium/src/libsodium/crypto_verify/16/checksum +1 -0
  251. data/vendor/libsodium/src/libsodium/crypto_verify/16/ref/api.h +2 -0
  252. data/vendor/libsodium/src/libsodium/crypto_verify/16/ref/verify_16.c +24 -0
  253. data/vendor/libsodium/src/libsodium/crypto_verify/16/verify_16_api.c +6 -0
  254. data/vendor/libsodium/src/libsodium/crypto_verify/32/checksum +1 -0
  255. data/vendor/libsodium/src/libsodium/crypto_verify/32/ref/api.h +2 -0
  256. data/vendor/libsodium/src/libsodium/crypto_verify/32/ref/verify_32.c +40 -0
  257. data/vendor/libsodium/src/libsodium/crypto_verify/32/verify_32_api.c +6 -0
  258. data/vendor/libsodium/src/libsodium/crypto_verify/try.c +76 -0
  259. data/vendor/libsodium/src/libsodium/include/Makefile.am +63 -0
  260. data/vendor/libsodium/src/libsodium/include/sodium.h +48 -0
  261. data/vendor/libsodium/src/libsodium/include/sodium/core.h +18 -0
  262. data/vendor/libsodium/src/libsodium/include/sodium/crypto_auth.h +36 -0
  263. data/vendor/libsodium/src/libsodium/include/sodium/crypto_auth_hmacsha256.h +36 -0
  264. data/vendor/libsodium/src/libsodium/include/sodium/crypto_auth_hmacsha512256.h +36 -0
  265. data/vendor/libsodium/src/libsodium/include/sodium/crypto_box.h +83 -0
  266. data/vendor/libsodium/src/libsodium/include/sodium/crypto_box_curve25519xsalsa20poly1305.h +72 -0
  267. data/vendor/libsodium/src/libsodium/include/sodium/crypto_core_hsalsa20.h +40 -0
  268. data/vendor/libsodium/src/libsodium/include/sodium/crypto_core_salsa20.h +40 -0
  269. data/vendor/libsodium/src/libsodium/include/sodium/crypto_core_salsa2012.h +40 -0
  270. data/vendor/libsodium/src/libsodium/include/sodium/crypto_core_salsa208.h +40 -0
  271. data/vendor/libsodium/src/libsodium/include/sodium/crypto_generichash.h +70 -0
  272. data/vendor/libsodium/src/libsodium/include/sodium/crypto_generichash_blake2b.h +87 -0
  273. data/vendor/libsodium/src/libsodium/include/sodium/crypto_hash.h +23 -0
  274. data/vendor/libsodium/src/libsodium/include/sodium/crypto_hash_sha256.h +29 -0
  275. data/vendor/libsodium/src/libsodium/include/sodium/crypto_hash_sha512.h +29 -0
  276. data/vendor/libsodium/src/libsodium/include/sodium/crypto_hashblocks_sha256.h +32 -0
  277. data/vendor/libsodium/src/libsodium/include/sodium/crypto_hashblocks_sha512.h +32 -0
  278. data/vendor/libsodium/src/libsodium/include/sodium/crypto_int32.h +8 -0
  279. data/vendor/libsodium/src/libsodium/include/sodium/crypto_int64.h +8 -0
  280. data/vendor/libsodium/src/libsodium/include/sodium/crypto_onetimeauth.h +37 -0
  281. data/vendor/libsodium/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h +65 -0
  282. data/vendor/libsodium/src/libsodium/include/sodium/crypto_onetimeauth_poly1305_53.h +34 -0
  283. data/vendor/libsodium/src/libsodium/include/sodium/crypto_onetimeauth_poly1305_donna.h +34 -0
  284. data/vendor/libsodium/src/libsodium/include/sodium/crypto_scalarmult.h +36 -0
  285. data/vendor/libsodium/src/libsodium/include/sodium/crypto_scalarmult_curve25519.h.in +44 -0
  286. data/vendor/libsodium/src/libsodium/include/sodium/crypto_secretbox.h +47 -0
  287. data/vendor/libsodium/src/libsodium/include/sodium/crypto_secretbox_xsalsa20poly1305.h +44 -0
  288. data/vendor/libsodium/src/libsodium/include/sodium/crypto_shorthash.h +33 -0
  289. data/vendor/libsodium/src/libsodium/include/sodium/crypto_shorthash_siphash24.h +29 -0
  290. data/vendor/libsodium/src/libsodium/include/sodium/crypto_sign.h +61 -0
  291. data/vendor/libsodium/src/libsodium/include/sodium/crypto_sign_ed25519.h +52 -0
  292. data/vendor/libsodium/src/libsodium/include/sodium/crypto_sign_edwards25519sha512batch.h +44 -0
  293. data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream.h +46 -0
  294. data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_aes128ctr.h +60 -0
  295. data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_aes256estream.h +61 -0
  296. data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_salsa20.h.in +54 -0
  297. data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_salsa2012.h +43 -0
  298. data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_salsa208.h +43 -0
  299. data/vendor/libsodium/src/libsodium/include/sodium/crypto_stream_xsalsa20.h +44 -0
  300. data/vendor/libsodium/src/libsodium/include/sodium/crypto_uint16.h +8 -0
  301. data/vendor/libsodium/src/libsodium/include/sodium/crypto_uint32.h +8 -0
  302. data/vendor/libsodium/src/libsodium/include/sodium/crypto_uint64.h +8 -0
  303. data/vendor/libsodium/src/libsodium/include/sodium/crypto_uint8.h +8 -0
  304. data/vendor/libsodium/src/libsodium/include/sodium/crypto_verify_16.h +25 -0
  305. data/vendor/libsodium/src/libsodium/include/sodium/crypto_verify_32.h +25 -0
  306. data/vendor/libsodium/src/libsodium/include/sodium/export.h +32 -0
  307. data/vendor/libsodium/src/libsodium/include/sodium/randombytes.h +53 -0
  308. data/vendor/libsodium/src/libsodium/include/sodium/randombytes_salsa20_random.h +45 -0
  309. data/vendor/libsodium/src/libsodium/include/sodium/randombytes_sysrandom.h +45 -0
  310. data/vendor/libsodium/src/libsodium/include/sodium/utils.h +36 -0
  311. data/vendor/libsodium/src/libsodium/include/sodium/version.h.in +29 -0
  312. data/vendor/libsodium/src/libsodium/randombytes/randombytes.c +63 -0
  313. data/vendor/libsodium/src/libsodium/randombytes/salsa20/randombytes_salsa20_random.c +317 -0
  314. data/vendor/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c +212 -0
  315. data/vendor/libsodium/src/libsodium/sodium/compat.c +248 -0
  316. data/vendor/libsodium/src/libsodium/sodium/core.c +21 -0
  317. data/vendor/libsodium/src/libsodium/sodium/utils.c +94 -0
  318. data/vendor/libsodium/src/libsodium/sodium/version.c +20 -0
  319. data/vendor/libsodium/test/Makefile.am +5 -0
  320. data/vendor/libsodium/test/default/Makefile.am +277 -0
  321. data/vendor/libsodium/test/default/auth.c +21 -0
  322. data/vendor/libsodium/test/default/auth.exp +4 -0
  323. data/vendor/libsodium/test/default/auth2.c +36 -0
  324. data/vendor/libsodium/test/default/auth2.exp +4 -0
  325. data/vendor/libsodium/test/default/auth3.c +36 -0
  326. data/vendor/libsodium/test/default/auth3.exp +1 -0
  327. data/vendor/libsodium/test/default/auth5.c +37 -0
  328. data/vendor/libsodium/test/default/auth5.exp +0 -0
  329. data/vendor/libsodium/test/default/box.c +65 -0
  330. data/vendor/libsodium/test/default/box.exp +19 -0
  331. data/vendor/libsodium/test/default/box2.c +66 -0
  332. data/vendor/libsodium/test/default/box2.exp +17 -0
  333. data/vendor/libsodium/test/default/box7.c +37 -0
  334. data/vendor/libsodium/test/default/box7.exp +0 -0
  335. data/vendor/libsodium/test/default/box8.c +44 -0
  336. data/vendor/libsodium/test/default/box8.exp +0 -0
  337. data/vendor/libsodium/test/default/cmptest.h +51 -0
  338. data/vendor/libsodium/test/default/core1.c +32 -0
  339. data/vendor/libsodium/test/default/core1.exp +4 -0
  340. data/vendor/libsodium/test/default/core2.c +35 -0
  341. data/vendor/libsodium/test/default/core2.exp +4 -0
  342. data/vendor/libsodium/test/default/core3.c +42 -0
  343. data/vendor/libsodium/test/default/core3.exp +1 -0
  344. data/vendor/libsodium/test/default/core4.c +35 -0
  345. data/vendor/libsodium/test/default/core4.exp +8 -0
  346. data/vendor/libsodium/test/default/core5.c +34 -0
  347. data/vendor/libsodium/test/default/core5.exp +4 -0
  348. data/vendor/libsodium/test/default/core6.c +49 -0
  349. data/vendor/libsodium/test/default/core6.exp +4 -0
  350. data/vendor/libsodium/test/default/generichash.c +27 -0
  351. data/vendor/libsodium/test/default/generichash.exp +64 -0
  352. data/vendor/libsodium/test/default/generichash2.c +31 -0
  353. data/vendor/libsodium/test/default/generichash2.exp +64 -0
  354. data/vendor/libsodium/test/default/hash.c +16 -0
  355. data/vendor/libsodium/test/default/hash.exp +1 -0
  356. data/vendor/libsodium/test/default/hash2.exp +1 -0
  357. data/vendor/libsodium/test/default/hash3.c +16 -0
  358. data/vendor/libsodium/test/default/hash3.exp +1 -0
  359. data/vendor/libsodium/test/default/onetimeauth.c +44 -0
  360. data/vendor/libsodium/test/default/onetimeauth.exp +2 -0
  361. data/vendor/libsodium/test/default/onetimeauth2.c +42 -0
  362. data/vendor/libsodium/test/default/onetimeauth2.exp +1 -0
  363. data/vendor/libsodium/test/default/onetimeauth7.c +37 -0
  364. data/vendor/libsodium/test/default/onetimeauth7.exp +0 -0
  365. data/vendor/libsodium/test/default/pre.js +33 -0
  366. data/vendor/libsodium/test/default/randombytes.c +16 -0
  367. data/vendor/libsodium/test/default/scalarmult.c +25 -0
  368. data/vendor/libsodium/test/default/scalarmult.exp +4 -0
  369. data/vendor/libsodium/test/default/scalarmult2.c +25 -0
  370. data/vendor/libsodium/test/default/scalarmult2.exp +4 -0
  371. data/vendor/libsodium/test/default/scalarmult5.c +32 -0
  372. data/vendor/libsodium/test/default/scalarmult5.exp +4 -0
  373. data/vendor/libsodium/test/default/scalarmult6.c +32 -0
  374. data/vendor/libsodium/test/default/scalarmult6.exp +4 -0
  375. data/vendor/libsodium/test/default/scalarmult7.c +34 -0
  376. data/vendor/libsodium/test/default/scalarmult7.exp +1 -0
  377. data/vendor/libsodium/test/default/scalarmult8.c +34 -0
  378. data/vendor/libsodium/test/default/scalarmult8.exp +1 -0
  379. data/vendor/libsodium/test/default/secretbox.c +58 -0
  380. data/vendor/libsodium/test/default/secretbox.exp +19 -0
  381. data/vendor/libsodium/test/default/secretbox2.c +59 -0
  382. data/vendor/libsodium/test/default/secretbox2.exp +17 -0
  383. data/vendor/libsodium/test/default/secretbox7.c +33 -0
  384. data/vendor/libsodium/test/default/secretbox7.exp +0 -0
  385. data/vendor/libsodium/test/default/secretbox8.c +40 -0
  386. data/vendor/libsodium/test/default/secretbox8.exp +0 -0
  387. data/vendor/libsodium/test/default/shorthash.c +23 -0
  388. data/vendor/libsodium/test/default/shorthash.exp +64 -0
  389. data/vendor/libsodium/test/default/sodium_core.c +11 -0
  390. data/vendor/libsodium/test/default/sodium_core.exp +1 -0
  391. data/vendor/libsodium/test/default/sodium_utils.c +27 -0
  392. data/vendor/libsodium/test/default/sodium_utils.exp +6 -0
  393. data/vendor/libsodium/test/default/sodium_version.c +13 -0
  394. data/vendor/libsodium/test/default/sodium_version.exp +3 -0
  395. data/vendor/libsodium/test/default/stream.c +30 -0
  396. data/vendor/libsodium/test/default/stream.exp +1 -0
  397. data/vendor/libsodium/test/default/stream2.c +28 -0
  398. data/vendor/libsodium/test/default/stream2.exp +1 -0
  399. data/vendor/libsodium/test/default/stream3.c +30 -0
  400. data/vendor/libsodium/test/default/stream3.exp +4 -0
  401. data/vendor/libsodium/test/default/stream4.c +55 -0
  402. data/vendor/libsodium/test/default/stream4.exp +17 -0
  403. data/vendor/libsodium/test/default/stream5.c +29 -0
  404. data/vendor/libsodium/test/default/stream5.exp +1 -0
  405. data/vendor/libsodium/test/default/stream6.c +54 -0
  406. data/vendor/libsodium/test/default/stream6.exp +17 -0
  407. data/vendor/libsodium/test/default/wintest.bat +56 -0
  408. data/vendor/libsodium/test/quirks/windows/windows-quirks.h +18 -0
  409. metadata +500 -0
@@ -0,0 +1,248 @@
1
+
2
+ #include "crypto_auth_hmacsha256.h"
3
+ #include "crypto_auth_hmacsha512256.h"
4
+ #include "crypto_box_curve25519xsalsa20poly1305.h"
5
+ #include "crypto_hash_sha256.h"
6
+ #include "crypto_hash_sha512.h"
7
+ #include "crypto_onetimeauth_poly1305.h"
8
+ #include "crypto_scalarmult_curve25519.h"
9
+ #include "crypto_secretbox_xsalsa20poly1305.h"
10
+ #include "crypto_sign_ed25519.h"
11
+ #include "crypto_stream_xsalsa20.h"
12
+ #include "crypto_verify_16.h"
13
+ #include "crypto_verify_32.h"
14
+ #include "export.h"
15
+
16
+ #ifdef __cplusplus
17
+ extern "C" {
18
+ #endif
19
+
20
+ #undef crypto_hash_sha256_ref
21
+ SODIUM_EXPORT int
22
+ crypto_hash_sha256_ref(unsigned char *out, const unsigned char *in,
23
+ unsigned long long inlen)
24
+ {
25
+ return crypto_hash_sha256(out, in, inlen);
26
+ }
27
+
28
+ #undef crypto_hash_sha512_ref
29
+ SODIUM_EXPORT int
30
+ crypto_hash_sha512_ref(unsigned char *out, const unsigned char *in,
31
+ unsigned long long inlen)
32
+ {
33
+ return crypto_hash_sha512(out, in, inlen);
34
+ }
35
+
36
+ #undef crypto_auth_hmacsha256_ref
37
+ SODIUM_EXPORT int
38
+ crypto_auth_hmacsha256_ref(unsigned char *out, const unsigned char *in,
39
+ unsigned long long inlen, const unsigned char *k)
40
+ {
41
+ return crypto_auth_hmacsha256(out, in, inlen, k);
42
+ }
43
+
44
+ #undef crypto_auth_hmacsha256_ref_verify
45
+ SODIUM_EXPORT int
46
+ crypto_auth_hmacsha256_ref_verify(const unsigned char *h,
47
+ const unsigned char *in,
48
+ unsigned long long inlen,
49
+ const unsigned char *k)
50
+ {
51
+ return crypto_auth_hmacsha256_verify(h, in, inlen, k);
52
+ }
53
+
54
+ #undef crypto_auth_hmacsha512256_ref
55
+ SODIUM_EXPORT int
56
+ crypto_auth_hmacsha512256_ref(unsigned char *out, const unsigned char *in,
57
+ unsigned long long inlen, const unsigned char *k)
58
+ {
59
+ return crypto_auth_hmacsha512256(out, in, inlen, k);
60
+ }
61
+
62
+ #undef crypto_auth_hmacsha512256_ref_verify
63
+ SODIUM_EXPORT int
64
+ crypto_auth_hmacsha512256_ref_verify(const unsigned char *h,
65
+ const unsigned char *in,
66
+ unsigned long long inlen,
67
+ const unsigned char *k)
68
+ {
69
+ return crypto_auth_hmacsha512256_verify(h, in, inlen, k);
70
+ }
71
+
72
+ #undef crypto_box_curve25519xsalsa20poly1305_ref_keypair
73
+ SODIUM_EXPORT int
74
+ crypto_box_curve25519xsalsa20poly1305_ref_keypair(unsigned char *pk,
75
+ unsigned char *sk)
76
+ {
77
+ return crypto_box_curve25519xsalsa20poly1305_keypair(pk, sk);
78
+ }
79
+
80
+ #undef crypto_box_curve25519xsalsa20poly1305_ref_beforenm
81
+ SODIUM_EXPORT int
82
+ crypto_box_curve25519xsalsa20poly1305_ref_beforenm(unsigned char *k,
83
+ const unsigned char *pk,
84
+ const unsigned char *sk)
85
+ {
86
+ return crypto_box_curve25519xsalsa20poly1305_beforenm(k, pk, sk);
87
+ }
88
+
89
+ #undef crypto_box_curve25519xsalsa20poly1305_ref_afternm
90
+ SODIUM_EXPORT int
91
+ crypto_box_curve25519xsalsa20poly1305_ref_afternm(unsigned char *c,
92
+ const unsigned char *m,
93
+ unsigned long long mlen,
94
+ const unsigned char *n,
95
+ const unsigned char *k)
96
+ {
97
+ return crypto_box_curve25519xsalsa20poly1305_afternm(c, m, mlen, n, k);
98
+ }
99
+
100
+ #undef crypto_box_curve25519xsalsa20poly1305_ref_open_afternm
101
+ SODIUM_EXPORT int
102
+ crypto_box_curve25519xsalsa20poly1305_ref_open_afternm(unsigned char *m,
103
+ const unsigned char *c,
104
+ unsigned long long clen,
105
+ const unsigned char *n,
106
+ const unsigned char *k)
107
+ {
108
+ return crypto_box_curve25519xsalsa20poly1305_open_afternm(m, c, clen, n, k);
109
+ }
110
+
111
+ #undef crypto_box_curve25519xsalsa20poly1305_ref
112
+ SODIUM_EXPORT int
113
+ crypto_box_curve25519xsalsa20poly1305_ref(unsigned char *c,
114
+ const unsigned char *m,
115
+ unsigned long long mlen,
116
+ const unsigned char *n,
117
+ const unsigned char *pk,
118
+ const unsigned char *sk)
119
+ {
120
+ return crypto_box_curve25519xsalsa20poly1305(c, m, mlen, n, pk, sk);
121
+ }
122
+
123
+ #undef crypto_box_curve25519xsalsa20poly1305_ref_open
124
+ SODIUM_EXPORT int
125
+ crypto_box_curve25519xsalsa20poly1305_ref_open(unsigned char *m,
126
+ const unsigned char *c,
127
+ unsigned long long clen,
128
+ const unsigned char *n,
129
+ const unsigned char *pk,
130
+ const unsigned char *sk)
131
+ {
132
+ return crypto_box_curve25519xsalsa20poly1305_open(m, c, clen, n, pk, sk);
133
+ }
134
+
135
+ #undef crypto_scalarmult_curve25519_ref_base
136
+ SODIUM_EXPORT int
137
+ crypto_scalarmult_curve25519_ref_base(unsigned char *q, const unsigned char *n)
138
+ {
139
+ return crypto_scalarmult_curve25519_base(q, n);
140
+ }
141
+
142
+ #undef crypto_scalarmult_curve25519_ref
143
+ SODIUM_EXPORT int
144
+ crypto_scalarmult_curve25519_ref(unsigned char *q, const unsigned char *n,
145
+ const unsigned char *p)
146
+ {
147
+ return crypto_scalarmult_curve25519(q, n, p);
148
+ }
149
+
150
+ #undef crypto_secretbox_xsalsa20poly1305_ref
151
+ SODIUM_EXPORT int
152
+ crypto_secretbox_xsalsa20poly1305_ref(unsigned char *c,
153
+ const unsigned char *m,
154
+ unsigned long long mlen,
155
+ const unsigned char *n,
156
+ const unsigned char *k)
157
+ {
158
+ return crypto_secretbox_xsalsa20poly1305(c, m, mlen, n, k);
159
+ }
160
+
161
+ #undef crypto_secretbox_xsalsa20poly1305_ref_open
162
+ SODIUM_EXPORT int
163
+ crypto_secretbox_xsalsa20poly1305_ref_open(unsigned char *m,
164
+ const unsigned char *c,
165
+ unsigned long long clen,
166
+ const unsigned char *n,
167
+ const unsigned char *k)
168
+ {
169
+ return crypto_secretbox_xsalsa20poly1305_open(m, c, clen, n, k);
170
+ }
171
+
172
+ #undef crypto_sign_ed25519_ref_seed_keypair
173
+ SODIUM_EXPORT int
174
+ crypto_sign_ed25519_ref_seed_keypair(unsigned char *pk, unsigned char *sk,
175
+ const unsigned char *seed)
176
+ {
177
+ return crypto_sign_ed25519_seed_keypair(pk, sk, seed);
178
+ }
179
+
180
+ #undef crypto_sign_ed25519_ref_keypair
181
+ SODIUM_EXPORT int
182
+ crypto_sign_ed25519_ref_keypair(unsigned char *pk, unsigned char *sk)
183
+ {
184
+ return crypto_sign_ed25519_keypair(pk, sk);
185
+ }
186
+
187
+ #undef crypto_sign_ed25519_ref
188
+ SODIUM_EXPORT int
189
+ crypto_sign_ed25519_ref(unsigned char *sm, unsigned long long *smlen,
190
+ const unsigned char *m, unsigned long long mlen,
191
+ const unsigned char *sk)
192
+ {
193
+ return crypto_sign_ed25519(sm, smlen, m, mlen, sk);
194
+ }
195
+
196
+ #undef crypto_sign_ed25519_ref_open
197
+ SODIUM_EXPORT int
198
+ crypto_sign_ed25519_ref_open(unsigned char *m, unsigned long long *mlen,
199
+ const unsigned char *sm, unsigned long long smlen,
200
+ const unsigned char *pk)
201
+ {
202
+ return crypto_sign_ed25519_open(m, mlen, sm, smlen, pk);
203
+ }
204
+
205
+ #undef crypto_stream_xsalsa20_ref
206
+ SODIUM_EXPORT int
207
+ crypto_stream_xsalsa20_ref(unsigned char *c, unsigned long long clen,
208
+ const unsigned char *n, const unsigned char *k)
209
+ {
210
+ return crypto_stream_xsalsa20(c, clen, n, k);
211
+ }
212
+
213
+ #undef crypto_stream_xsalsa20_ref_xor
214
+ SODIUM_EXPORT int
215
+ crypto_stream_xsalsa20_ref_xor(unsigned char *c, const unsigned char *m,
216
+ unsigned long long mlen, const unsigned char *n,
217
+ const unsigned char *k)
218
+ {
219
+ return crypto_stream_xsalsa20_xor(c, m, mlen, n, k);
220
+ }
221
+
222
+ #undef crypto_verify_16_ref
223
+ SODIUM_EXPORT int
224
+ crypto_verify_16_ref(const unsigned char *x, const unsigned char *y)
225
+ {
226
+ return crypto_verify_16(x, y);
227
+ }
228
+
229
+ #undef crypto_verify_32_ref
230
+ SODIUM_EXPORT int
231
+ crypto_verify_32_ref(const unsigned char *x, const unsigned char *y)
232
+ {
233
+ return crypto_verify_32(x, y);
234
+ }
235
+
236
+ #undef crypto_onetimeauth_poly1305_ref
237
+ SODIUM_EXPORT int
238
+ crypto_onetimeauth_poly1305_ref(unsigned char *out,
239
+ const unsigned char *in,
240
+ unsigned long long inlen,
241
+ const unsigned char *k)
242
+ {
243
+ return crypto_onetimeauth_poly1305(out, in, inlen, k);
244
+ }
245
+
246
+ #ifdef __cplusplus
247
+ }
248
+ #endif
@@ -0,0 +1,21 @@
1
+
2
+ #include "core.h"
3
+ #include "crypto_onetimeauth.h"
4
+ #include "randombytes.h"
5
+
6
+ static int initialized;
7
+
8
+ int
9
+ sodium_init(void)
10
+ {
11
+ if (initialized != 0) {
12
+ return 1;
13
+ }
14
+ if (crypto_onetimeauth_pick_best_implementation() == NULL) {
15
+ return -1;
16
+ }
17
+ randombytes_stir();
18
+ initialized = 1;
19
+
20
+ return 0;
21
+ }
@@ -0,0 +1,94 @@
1
+
2
+ #include <limits.h>
3
+ #include <stddef.h>
4
+ #include <stdint.h>
5
+ #include <stdlib.h>
6
+ #include <string.h>
7
+
8
+ #include "utils.h"
9
+ #include "randombytes.h"
10
+ #ifdef _WIN32
11
+ # include <windows.h>
12
+ # include <wincrypt.h>
13
+ #endif
14
+
15
+ void
16
+ sodium_memzero(void * const pnt, const size_t len)
17
+ {
18
+ #ifdef HAVE_SECUREZEROMEMORY
19
+ SecureZeroMemory(pnt, len);
20
+ #else
21
+ volatile unsigned char *pnt_ = (volatile unsigned char *) pnt;
22
+ size_t i = (size_t) 0U;
23
+
24
+ while (i < len) {
25
+ pnt_[i++] = 0U;
26
+ }
27
+ #endif
28
+ }
29
+
30
+ int
31
+ sodium_memcmp(const void * const b1_, const void * const b2_, size_t size)
32
+ {
33
+ const unsigned char *b1 = (const unsigned char *) b1_;
34
+ const unsigned char *b2 = (const unsigned char *) b2_;
35
+ size_t i;
36
+ unsigned char d = (unsigned char) 0U;
37
+
38
+ for (i = 0U; i < size; i++) {
39
+ d |= b1[i] ^ b2[i];
40
+ }
41
+ return (int) d;
42
+ }
43
+
44
+ unsigned char *
45
+ _sodium_alignedcalloc(unsigned char ** const unaligned_p, const size_t len)
46
+ {
47
+ unsigned char *aligned;
48
+ unsigned char *unaligned;
49
+ size_t i;
50
+
51
+ if (SIZE_MAX - (size_t) 256U < len ||
52
+ (unaligned = (unsigned char *) malloc(len + (size_t) 256U)) == NULL) {
53
+ *unaligned_p = NULL;
54
+ return NULL;
55
+ }
56
+ *unaligned_p = unaligned;
57
+ #ifdef HAVE_ARC4RANDOM_BUF
58
+ (void) i;
59
+ arc4random_buf(unaligned, len + (size_t) 256U);
60
+ #else
61
+ for (i = (size_t) 0U; i < len + (size_t) 256U; ++i) {
62
+ unaligned[i] = (unsigned char) rand();
63
+ }
64
+ #endif
65
+ aligned = unaligned + 64;
66
+ aligned += (ptrdiff_t) 63 & (-(ptrdiff_t) aligned);
67
+ memset(aligned, 0, len);
68
+
69
+ return aligned;
70
+ }
71
+
72
+ char *
73
+ sodium_bin2hex(char * const hex, const size_t hexlen,
74
+ const unsigned char *bin, const size_t binlen)
75
+ {
76
+ static const char hexdigits[16] = {
77
+ '0', '1', '2', '3', '4', '5', '6', '7',
78
+ '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
79
+ };
80
+ size_t i = (size_t) 0U;
81
+ size_t j = (size_t) 0U;
82
+
83
+ if (binlen >= SIZE_MAX / 2 || hexlen < binlen * 2U) {
84
+ abort();
85
+ }
86
+ while (i < binlen) {
87
+ hex[j++] = hexdigits[bin[i] >> 4];
88
+ hex[j++] = hexdigits[bin[i] & 0xf];
89
+ i++;
90
+ }
91
+ hex[j] = 0;
92
+
93
+ return hex;
94
+ }
@@ -0,0 +1,20 @@
1
+
2
+ #include "version.h"
3
+
4
+ const char *
5
+ sodium_version_string(void)
6
+ {
7
+ return SODIUM_VERSION_STRING;
8
+ }
9
+
10
+ int
11
+ sodium_library_version_major(void)
12
+ {
13
+ return SODIUM_LIBRARY_VERSION_MAJOR;
14
+ }
15
+
16
+ int
17
+ sodium_library_version_minor(void)
18
+ {
19
+ return SODIUM_LIBRARY_VERSION_MINOR;
20
+ }
@@ -0,0 +1,5 @@
1
+ SUBDIRS = \
2
+ default
3
+
4
+ EXTRA_DIST = \
5
+ quirks/windows/windows-quirks.h
@@ -0,0 +1,277 @@
1
+
2
+ EXTRA_DIST = \
3
+ cmptest.h \
4
+ wintest.bat \
5
+ auth.exp \
6
+ auth2.exp \
7
+ auth3.exp \
8
+ auth5.exp \
9
+ box.exp \
10
+ box2.exp \
11
+ box7.exp \
12
+ box8.exp \
13
+ core1.exp \
14
+ core2.exp \
15
+ core3.exp \
16
+ core4.exp \
17
+ core5.exp \
18
+ core6.exp \
19
+ generichash.exp \
20
+ generichash2.exp \
21
+ hash.exp \
22
+ hash2.exp \
23
+ hash3.exp \
24
+ onetimeauth.exp \
25
+ onetimeauth2.exp \
26
+ onetimeauth7.exp \
27
+ scalarmult.exp \
28
+ scalarmult2.exp \
29
+ scalarmult5.exp \
30
+ scalarmult6.exp \
31
+ scalarmult7.exp \
32
+ scalarmult8.exp \
33
+ secretbox.exp \
34
+ secretbox2.exp \
35
+ secretbox7.exp \
36
+ secretbox8.exp \
37
+ shorthash.exp \
38
+ sodium_core.exp \
39
+ sodium_utils.exp \
40
+ sodium_version.exp \
41
+ stream.exp \
42
+ stream2.exp \
43
+ stream3.exp \
44
+ stream4.exp \
45
+ stream5.exp \
46
+ stream6.exp
47
+
48
+ DISTCLEANFILES = \
49
+ auth.res \
50
+ auth2.res \
51
+ auth3.res \
52
+ auth5.res \
53
+ box.res \
54
+ box2.res \
55
+ box7.res \
56
+ box8.res \
57
+ core1.res \
58
+ core2.res \
59
+ core3.res \
60
+ core4.res \
61
+ core5.res \
62
+ core6.res \
63
+ generichash.res \
64
+ generichash2.res \
65
+ hash.res \
66
+ hash2.res \
67
+ hash3.res \
68
+ onetimeauth.res \
69
+ onetimeauth2.res \
70
+ onetimeauth7.res \
71
+ scalarmult.res \
72
+ scalarmult2.res \
73
+ scalarmult5.res \
74
+ scalarmult6.res \
75
+ scalarmult7.res \
76
+ scalarmult8.res \
77
+ secretbox.res \
78
+ secretbox2.res \
79
+ secretbox7.res \
80
+ secretbox8.res \
81
+ shorthash.res \
82
+ sodium_core.res \
83
+ sodium_utils.res \
84
+ sodium_version.res \
85
+ stream.res \
86
+ stream2.res \
87
+ stream3.res \
88
+ stream4.res \
89
+ stream5.res \
90
+ stream6.res
91
+
92
+ AM_CPPFLAGS = \
93
+ -DTEST_SRCDIR=\"@srcdir@\" \
94
+ -I$(top_srcdir)/src/libsodium/include \
95
+ -I$(top_srcdir)/src/libsodium/include/sodium \
96
+ -I$(top_builddir)/src/libsodium/include \
97
+ -I$(top_builddir)/src/libsodium/include/sodium \
98
+ -I$(top_srcdir)/test/quirks
99
+
100
+ TESTS_TARGETS = \
101
+ auth \
102
+ auth2 \
103
+ auth3 \
104
+ auth5 \
105
+ box \
106
+ box2 \
107
+ box7 \
108
+ box8 \
109
+ core1 \
110
+ core2 \
111
+ core3 \
112
+ core4 \
113
+ core5 \
114
+ core6 \
115
+ generichash \
116
+ generichash2 \
117
+ hash \
118
+ hash3 \
119
+ onetimeauth \
120
+ onetimeauth2 \
121
+ onetimeauth7 \
122
+ randombytes \
123
+ scalarmult \
124
+ scalarmult2 \
125
+ scalarmult5 \
126
+ scalarmult6 \
127
+ scalarmult7 \
128
+ scalarmult8 \
129
+ secretbox \
130
+ secretbox2 \
131
+ secretbox7 \
132
+ secretbox8 \
133
+ shorthash \
134
+ sodium_core \
135
+ sodium_utils \
136
+ sodium_version \
137
+ stream \
138
+ stream2 \
139
+ stream3 \
140
+ stream4 \
141
+ stream5 \
142
+ stream6
143
+
144
+ check_PROGRAMS = $(TESTS_TARGETS)
145
+
146
+ TESTS = $(TESTS_TARGETS)
147
+
148
+ TESTS_LDADD = \
149
+ ${top_builddir}/src/libsodium/libsodium.la
150
+
151
+ auth_SOURCE = cmptest.h auth.c
152
+ auth_LDADD = $(TESTS_LDADD)
153
+
154
+ auth2_SOURCE = cmptest.h auth2.c
155
+ auth2_LDADD = $(TESTS_LDADD)
156
+
157
+ auth3_SOURCE = cmptest.h auth3.c
158
+ auth3_LDADD = $(TESTS_LDADD)
159
+
160
+ auth5_SOURCE = cmptest.h auth5.c windows/windows-quirks.h
161
+ auth5_LDADD = $(TESTS_LDADD)
162
+
163
+ box_SOURCE = cmptest.h box.c
164
+ box_LDADD = $(TESTS_LDADD)
165
+
166
+ box2_SOURCE = cmptest.h box2.c
167
+ box2_LDADD = $(TESTS_LDADD)
168
+
169
+ box7_SOURCE = cmptest.h box7.c
170
+ box7_LDADD = $(TESTS_LDADD)
171
+
172
+ box8_SOURCE = cmptest.h box8.c
173
+ box8_LDADD = $(TESTS_LDADD)
174
+
175
+ core1_SOURCE = cmptest.h core1.c
176
+ core1_LDADD = $(TESTS_LDADD)
177
+
178
+ core2_SOURCE = cmptest.h core2.c
179
+ core2_LDADD = $(TESTS_LDADD)
180
+
181
+ core3_SOURCE = cmptest.h core3.c
182
+ core3_LDADD = $(TESTS_LDADD)
183
+
184
+ core4_SOURCE = cmptest.h core4.c
185
+ core4_LDADD = $(TESTS_LDADD)
186
+
187
+ core5_SOURCE = cmptest.h core5.c
188
+ core5_LDADD = $(TESTS_LDADD)
189
+
190
+ core6_SOURCE = cmptest.h core6.c
191
+ core6_LDADD = $(TESTS_LDADD)
192
+
193
+ generichash_SOURCE = cmptest.h generichash.c
194
+ generichash_LDADD = $(TESTS_LDADD)
195
+
196
+ generichash2_SOURCE = cmptest.h generichash2.c
197
+ generichash2_LDADD = $(TESTS_LDADD)
198
+
199
+ hash_SOURCE = cmptest.h hash.c
200
+ hash_LDADD = $(TESTS_LDADD)
201
+
202
+ hash3_SOURCE = cmptest.h hash3.c
203
+ hash3_LDADD = $(TESTS_LDADD)
204
+
205
+ onetimeauth_SOURCE = cmptest.h onetimeauth.c
206
+ onetimeauth_LDADD = $(TESTS_LDADD)
207
+
208
+ onetimeauth2_SOURCE = cmptest.h onetimeauth2.c
209
+ onetimeauth2_LDADD = $(TESTS_LDADD)
210
+
211
+ onetimeauth7_SOURCE = cmptest.h onetimeauth7.c
212
+ onetimeauth7_LDADD = $(TESTS_LDADD)
213
+
214
+ randombytes_SOURCE = randombytes.c
215
+ randombytes_LDADD = $(TESTS_LDADD)
216
+
217
+ scalarmult_SOURCE = cmptest.h scalarmult.c
218
+ scalarmult_LDADD = $(TESTS_LDADD)
219
+
220
+ scalarmult2_SOURCE = cmptest.h scalarmult2.c
221
+ scalarmult2_LDADD = $(TESTS_LDADD)
222
+
223
+ scalarmult5_SOURCE = cmptest.h scalarmult5.c
224
+ scalarmult5_LDADD = $(TESTS_LDADD)
225
+
226
+ scalarmult6_SOURCE = cmptest.h scalarmult6.c
227
+ scalarmult6_LDADD = $(TESTS_LDADD)
228
+
229
+ scalarmult7_SOURCE = cmptest.h scalarmult7.c
230
+ scalarmult7_LDADD = $(TESTS_LDADD)
231
+
232
+ scalarmult8_SOURCE = cmptest.h scalarmult8.c
233
+ scalarmult8_LDADD = $(TESTS_LDADD)
234
+
235
+ secretbox_SOURCE = cmptest.h secretbox.c
236
+ secretbox_LDADD = $(TESTS_LDADD)
237
+
238
+ secretbox2_SOURCE = cmptest.h secretbox2.c
239
+ secretbox2_LDADD = $(TESTS_LDADD)
240
+
241
+ secretbox7_SOURCE = cmptest.h secretbox7.c
242
+ secretbox7_LDADD = $(TESTS_LDADD)
243
+
244
+ secretbox8_SOURCE = cmptest.h secretbox8.c
245
+ secretbox8_LDADD = $(TESTS_LDADD)
246
+
247
+ shorthash_SOURCE = cmptest.h shorthash.c
248
+ shorthash_LDADD = $(TESTS_LDADD)
249
+
250
+ sodium_core_SOURCE = cmptest.h sodium_core.c
251
+ sodium_core_LDADD = $(TESTS_LDADD)
252
+
253
+ sodium_utils_SOURCE = cmptest.h sodium_utils.c
254
+ sodium_utils_LDADD = $(TESTS_LDADD)
255
+
256
+ sodium_version_SOURCE = cmptest.h sodium_version.c
257
+ sodium_version_LDADD = $(TESTS_LDADD)
258
+
259
+ stream_SOURCE = cmptest.h stream.c
260
+ stream_LDADD = $(TESTS_LDADD)
261
+
262
+ stream2_SOURCE = cmptest.h stream2.c
263
+ stream2_LDADD = $(TESTS_LDADD)
264
+
265
+ stream3_SOURCE = cmptest.h stream3.c
266
+ stream3_LDADD = $(TESTS_LDADD)
267
+
268
+ stream4_SOURCE = cmptest.h stream4.c
269
+ stream4_LDADD = $(TESTS_LDADD)
270
+
271
+ stream5_SOURCE = cmptest.h stream5.c
272
+ stream5_LDADD = $(TESTS_LDADD)
273
+
274
+ stream6_SOURCE = cmptest.h stream6.c
275
+ stream6_LDADD = $(TESTS_LDADD)
276
+
277
+ verify: check