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 @@
1
+ f005c91634ae549f0dd4529ddbaf07038cb75a59b818cd1d4eb4e2b4019ab6733556131f320c4a145c735a22594581d454cccb15c18bf198ffcb2da29fe39456
@@ -0,0 +1,16 @@
1
+ #include "crypto_hashblocks_sha512.h"
2
+
3
+ size_t
4
+ crypto_hashblocks_sha512_statebytes(void) {
5
+ return crypto_hashblocks_sha512_STATEBYTES;
6
+ }
7
+
8
+ size_t
9
+ crypto_hashblocks_sha512_blockbytes(void) {
10
+ return crypto_hashblocks_sha512_BLOCKBYTES;
11
+ }
12
+
13
+ const char *
14
+ crypto_hashblocks_sha512_primitive(void) {
15
+ return "sha512";
16
+ }
@@ -0,0 +1,9 @@
1
+
2
+ #include "crypto_hashblocks_sha512.h"
3
+
4
+ #define crypto_hashblocks crypto_hashblocks_sha512
5
+ #define crypto_hashblocks_STATEBYTES crypto_hashblocks_sha512_STATEBYTES
6
+ #define crypto_hashblocks_BLOCKBYTES crypto_hashblocks_sha512_BLOCKBYTES
7
+ #define crypto_hashblocks_PRIMITIVE "sha512"
8
+ #define crypto_hashblocks_IMPLEMENTATION crypto_hashblocks_sha512_IMPLEMENTATION
9
+ #define crypto_hashblocks_VERSION crypto_hashblocks_sha512_VERSION
@@ -0,0 +1,239 @@
1
+ #include "api.h"
2
+
3
+ typedef unsigned long long uint64;
4
+
5
+ static uint64 load_bigendian(const unsigned char *x)
6
+ {
7
+ return
8
+ (uint64) (x[7]) \
9
+ | (((uint64) (x[6])) << 8) \
10
+ | (((uint64) (x[5])) << 16) \
11
+ | (((uint64) (x[4])) << 24) \
12
+ | (((uint64) (x[3])) << 32) \
13
+ | (((uint64) (x[2])) << 40) \
14
+ | (((uint64) (x[1])) << 48) \
15
+ | (((uint64) (x[0])) << 56)
16
+ ;
17
+ }
18
+
19
+ static void store_bigendian(unsigned char *x,uint64 u)
20
+ {
21
+ x[7] = u; u >>= 8;
22
+ x[6] = u; u >>= 8;
23
+ x[5] = u; u >>= 8;
24
+ x[4] = u; u >>= 8;
25
+ x[3] = u; u >>= 8;
26
+ x[2] = u; u >>= 8;
27
+ x[1] = u; u >>= 8;
28
+ x[0] = u;
29
+ }
30
+
31
+ #define SHR(x,c) ((x) >> (c))
32
+ #define ROTR(x,c) (((x) >> (c)) | ((x) << (64 - (c))))
33
+
34
+ #define Ch(x,y,z) ((x & y) ^ (~x & z))
35
+ #define Maj(x,y,z) ((x & y) ^ (x & z) ^ (y & z))
36
+ #define Sigma0(x) (ROTR(x,28) ^ ROTR(x,34) ^ ROTR(x,39))
37
+ #define Sigma1(x) (ROTR(x,14) ^ ROTR(x,18) ^ ROTR(x,41))
38
+ #define sigma0(x) (ROTR(x, 1) ^ ROTR(x, 8) ^ SHR(x,7))
39
+ #define sigma1(x) (ROTR(x,19) ^ ROTR(x,61) ^ SHR(x,6))
40
+
41
+ #define M(w0,w14,w9,w1) w0 = sigma1(w14) + w9 + sigma0(w1) + w0;
42
+
43
+ #define EXPAND \
44
+ M(w0 ,w14,w9 ,w1 ) \
45
+ M(w1 ,w15,w10,w2 ) \
46
+ M(w2 ,w0 ,w11,w3 ) \
47
+ M(w3 ,w1 ,w12,w4 ) \
48
+ M(w4 ,w2 ,w13,w5 ) \
49
+ M(w5 ,w3 ,w14,w6 ) \
50
+ M(w6 ,w4 ,w15,w7 ) \
51
+ M(w7 ,w5 ,w0 ,w8 ) \
52
+ M(w8 ,w6 ,w1 ,w9 ) \
53
+ M(w9 ,w7 ,w2 ,w10) \
54
+ M(w10,w8 ,w3 ,w11) \
55
+ M(w11,w9 ,w4 ,w12) \
56
+ M(w12,w10,w5 ,w13) \
57
+ M(w13,w11,w6 ,w14) \
58
+ M(w14,w12,w7 ,w15) \
59
+ M(w15,w13,w8 ,w0 )
60
+
61
+ #define F(w,k) \
62
+ T1 = h + Sigma1(e) + Ch(e,f,g) + k + w; \
63
+ T2 = Sigma0(a) + Maj(a,b,c); \
64
+ h = g; \
65
+ g = f; \
66
+ f = e; \
67
+ e = d + T1; \
68
+ d = c; \
69
+ c = b; \
70
+ b = a; \
71
+ a = T1 + T2;
72
+
73
+ int crypto_hashblocks(unsigned char *statebytes,const unsigned char *in,unsigned long long inlen)
74
+ {
75
+ uint64 state[8];
76
+ uint64 a;
77
+ uint64 b;
78
+ uint64 c;
79
+ uint64 d;
80
+ uint64 e;
81
+ uint64 f;
82
+ uint64 g;
83
+ uint64 h;
84
+ uint64 T1;
85
+ uint64 T2;
86
+
87
+ a = load_bigendian(statebytes + 0); state[0] = a;
88
+ b = load_bigendian(statebytes + 8); state[1] = b;
89
+ c = load_bigendian(statebytes + 16); state[2] = c;
90
+ d = load_bigendian(statebytes + 24); state[3] = d;
91
+ e = load_bigendian(statebytes + 32); state[4] = e;
92
+ f = load_bigendian(statebytes + 40); state[5] = f;
93
+ g = load_bigendian(statebytes + 48); state[6] = g;
94
+ h = load_bigendian(statebytes + 56); state[7] = h;
95
+
96
+ while (inlen >= 128) {
97
+ uint64 w0 = load_bigendian(in + 0);
98
+ uint64 w1 = load_bigendian(in + 8);
99
+ uint64 w2 = load_bigendian(in + 16);
100
+ uint64 w3 = load_bigendian(in + 24);
101
+ uint64 w4 = load_bigendian(in + 32);
102
+ uint64 w5 = load_bigendian(in + 40);
103
+ uint64 w6 = load_bigendian(in + 48);
104
+ uint64 w7 = load_bigendian(in + 56);
105
+ uint64 w8 = load_bigendian(in + 64);
106
+ uint64 w9 = load_bigendian(in + 72);
107
+ uint64 w10 = load_bigendian(in + 80);
108
+ uint64 w11 = load_bigendian(in + 88);
109
+ uint64 w12 = load_bigendian(in + 96);
110
+ uint64 w13 = load_bigendian(in + 104);
111
+ uint64 w14 = load_bigendian(in + 112);
112
+ uint64 w15 = load_bigendian(in + 120);
113
+
114
+ F(w0 ,0x428a2f98d728ae22ULL)
115
+ F(w1 ,0x7137449123ef65cdULL)
116
+ F(w2 ,0xb5c0fbcfec4d3b2fULL)
117
+ F(w3 ,0xe9b5dba58189dbbcULL)
118
+ F(w4 ,0x3956c25bf348b538ULL)
119
+ F(w5 ,0x59f111f1b605d019ULL)
120
+ F(w6 ,0x923f82a4af194f9bULL)
121
+ F(w7 ,0xab1c5ed5da6d8118ULL)
122
+ F(w8 ,0xd807aa98a3030242ULL)
123
+ F(w9 ,0x12835b0145706fbeULL)
124
+ F(w10,0x243185be4ee4b28cULL)
125
+ F(w11,0x550c7dc3d5ffb4e2ULL)
126
+ F(w12,0x72be5d74f27b896fULL)
127
+ F(w13,0x80deb1fe3b1696b1ULL)
128
+ F(w14,0x9bdc06a725c71235ULL)
129
+ F(w15,0xc19bf174cf692694ULL)
130
+
131
+ EXPAND
132
+
133
+ F(w0 ,0xe49b69c19ef14ad2ULL)
134
+ F(w1 ,0xefbe4786384f25e3ULL)
135
+ F(w2 ,0x0fc19dc68b8cd5b5ULL)
136
+ F(w3 ,0x240ca1cc77ac9c65ULL)
137
+ F(w4 ,0x2de92c6f592b0275ULL)
138
+ F(w5 ,0x4a7484aa6ea6e483ULL)
139
+ F(w6 ,0x5cb0a9dcbd41fbd4ULL)
140
+ F(w7 ,0x76f988da831153b5ULL)
141
+ F(w8 ,0x983e5152ee66dfabULL)
142
+ F(w9 ,0xa831c66d2db43210ULL)
143
+ F(w10,0xb00327c898fb213fULL)
144
+ F(w11,0xbf597fc7beef0ee4ULL)
145
+ F(w12,0xc6e00bf33da88fc2ULL)
146
+ F(w13,0xd5a79147930aa725ULL)
147
+ F(w14,0x06ca6351e003826fULL)
148
+ F(w15,0x142929670a0e6e70ULL)
149
+
150
+ EXPAND
151
+
152
+ F(w0 ,0x27b70a8546d22ffcULL)
153
+ F(w1 ,0x2e1b21385c26c926ULL)
154
+ F(w2 ,0x4d2c6dfc5ac42aedULL)
155
+ F(w3 ,0x53380d139d95b3dfULL)
156
+ F(w4 ,0x650a73548baf63deULL)
157
+ F(w5 ,0x766a0abb3c77b2a8ULL)
158
+ F(w6 ,0x81c2c92e47edaee6ULL)
159
+ F(w7 ,0x92722c851482353bULL)
160
+ F(w8 ,0xa2bfe8a14cf10364ULL)
161
+ F(w9 ,0xa81a664bbc423001ULL)
162
+ F(w10,0xc24b8b70d0f89791ULL)
163
+ F(w11,0xc76c51a30654be30ULL)
164
+ F(w12,0xd192e819d6ef5218ULL)
165
+ F(w13,0xd69906245565a910ULL)
166
+ F(w14,0xf40e35855771202aULL)
167
+ F(w15,0x106aa07032bbd1b8ULL)
168
+
169
+ EXPAND
170
+
171
+ F(w0 ,0x19a4c116b8d2d0c8ULL)
172
+ F(w1 ,0x1e376c085141ab53ULL)
173
+ F(w2 ,0x2748774cdf8eeb99ULL)
174
+ F(w3 ,0x34b0bcb5e19b48a8ULL)
175
+ F(w4 ,0x391c0cb3c5c95a63ULL)
176
+ F(w5 ,0x4ed8aa4ae3418acbULL)
177
+ F(w6 ,0x5b9cca4f7763e373ULL)
178
+ F(w7 ,0x682e6ff3d6b2b8a3ULL)
179
+ F(w8 ,0x748f82ee5defb2fcULL)
180
+ F(w9 ,0x78a5636f43172f60ULL)
181
+ F(w10,0x84c87814a1f0ab72ULL)
182
+ F(w11,0x8cc702081a6439ecULL)
183
+ F(w12,0x90befffa23631e28ULL)
184
+ F(w13,0xa4506cebde82bde9ULL)
185
+ F(w14,0xbef9a3f7b2c67915ULL)
186
+ F(w15,0xc67178f2e372532bULL)
187
+
188
+ EXPAND
189
+
190
+ F(w0 ,0xca273eceea26619cULL)
191
+ F(w1 ,0xd186b8c721c0c207ULL)
192
+ F(w2 ,0xeada7dd6cde0eb1eULL)
193
+ F(w3 ,0xf57d4f7fee6ed178ULL)
194
+ F(w4 ,0x06f067aa72176fbaULL)
195
+ F(w5 ,0x0a637dc5a2c898a6ULL)
196
+ F(w6 ,0x113f9804bef90daeULL)
197
+ F(w7 ,0x1b710b35131c471bULL)
198
+ F(w8 ,0x28db77f523047d84ULL)
199
+ F(w9 ,0x32caab7b40c72493ULL)
200
+ F(w10,0x3c9ebe0a15c9bebcULL)
201
+ F(w11,0x431d67c49c100d4cULL)
202
+ F(w12,0x4cc5d4becb3e42b6ULL)
203
+ F(w13,0x597f299cfc657e2aULL)
204
+ F(w14,0x5fcb6fab3ad6faecULL)
205
+ F(w15,0x6c44198c4a475817ULL)
206
+
207
+ a += state[0];
208
+ b += state[1];
209
+ c += state[2];
210
+ d += state[3];
211
+ e += state[4];
212
+ f += state[5];
213
+ g += state[6];
214
+ h += state[7];
215
+
216
+ state[0] = a;
217
+ state[1] = b;
218
+ state[2] = c;
219
+ state[3] = d;
220
+ state[4] = e;
221
+ state[5] = f;
222
+ state[6] = g;
223
+ state[7] = h;
224
+
225
+ in += 128;
226
+ inlen -= 128;
227
+ }
228
+
229
+ store_bigendian(statebytes + 0,state[0]);
230
+ store_bigendian(statebytes + 8,state[1]);
231
+ store_bigendian(statebytes + 16,state[2]);
232
+ store_bigendian(statebytes + 24,state[3]);
233
+ store_bigendian(statebytes + 32,state[4]);
234
+ store_bigendian(statebytes + 40,state[5]);
235
+ store_bigendian(statebytes + 48,state[6]);
236
+ store_bigendian(statebytes + 56,state[7]);
237
+
238
+ return 0;
239
+ }
@@ -0,0 +1,78 @@
1
+ /*
2
+ * crypto_hashblocks/try.c version 20090118
3
+ * D. J. Bernstein
4
+ * Public domain.
5
+ */
6
+
7
+ #include <stdlib.h>
8
+ #include "crypto_hashblocks.h"
9
+ #include "utils.h"
10
+ #include "windows/windows-quirks.h"
11
+
12
+ extern unsigned char *alignedcalloc(unsigned long long);
13
+
14
+ const char *primitiveimplementation = crypto_hashblocks_IMPLEMENTATION;
15
+
16
+ #define MAXTEST_BYTES (10000 + crypto_hashblocks_STATEBYTES)
17
+ #define CHECKSUM_BYTES 4096
18
+ #define TUNE_BYTES 1536
19
+
20
+ static unsigned char *h;
21
+ static unsigned char *h2;
22
+ static unsigned char *m;
23
+ static unsigned char *m2;
24
+
25
+ void preallocate(void)
26
+ {
27
+ }
28
+
29
+ void allocate(void)
30
+ {
31
+ h = alignedcalloc(crypto_hashblocks_STATEBYTES);
32
+ h2 = alignedcalloc(crypto_hashblocks_STATEBYTES);
33
+ m = alignedcalloc(MAXTEST_BYTES);
34
+ m2 = alignedcalloc(MAXTEST_BYTES);
35
+ }
36
+
37
+ void predoit(void)
38
+ {
39
+ }
40
+
41
+ void doit(void)
42
+ {
43
+ crypto_hashblocks(h,m,TUNE_BYTES);
44
+ }
45
+
46
+ char checksum[crypto_hashblocks_STATEBYTES * 2 + 1];
47
+
48
+ const char *checksum_compute(void)
49
+ {
50
+ long long i;
51
+ long long j;
52
+
53
+ for (i = 0;i < CHECKSUM_BYTES;++i) {
54
+ long long hlen = crypto_hashblocks_STATEBYTES;
55
+ long long mlen = i;
56
+ for (j = -16;j < 0;++j) h[j] = rand();
57
+ for (j = hlen;j < hlen + 16;++j) h[j] = rand();
58
+ for (j = -16;j < hlen + 16;++j) h2[j] = h[j];
59
+ for (j = -16;j < 0;++j) m[j] = rand();
60
+ for (j = mlen;j < mlen + 16;++j) m[j] = rand();
61
+ for (j = -16;j < mlen + 16;++j) m2[j] = m[j];
62
+ if (crypto_hashblocks(h,m,mlen) != 0) return "crypto_hashblocks returns nonzero";
63
+ for (j = -16;j < mlen + 16;++j) if (m2[j] != m[j]) return "crypto_hashblocks writes to input";
64
+ for (j = -16;j < 0;++j) if (h2[j] != h[j]) return "crypto_hashblocks writes before output";
65
+ for (j = hlen;j < hlen + 16;++j) if (h2[j] != h[j]) return "crypto_hashblocks writes after output";
66
+ for (j = 0;j < hlen;++j) m2[j] = h2[j];
67
+ if (crypto_hashblocks(h2,m2,mlen) != 0) return "crypto_hashblocks returns nonzero";
68
+ if (crypto_hashblocks(m2,m2,mlen) != 0) return "crypto_hashblocks returns nonzero";
69
+ for (j = 0;j < hlen;++j) if (m2[j] != h2[j]) return "crypto_hashblocks does not handle overlap";
70
+ for (j = 0;j < mlen;++j) m[j] ^= h[j % hlen];
71
+ m[mlen] = h[0];
72
+ }
73
+ if (crypto_hashblocks(h,m,CHECKSUM_BYTES) != 0) return "crypto_hashblocks returns nonzero";
74
+
75
+ sodium_bin2hex(checksum, sizeof checksum, h, crypto_hashblocks_STATEBYTES);
76
+
77
+ return 0;
78
+ }
@@ -0,0 +1,34 @@
1
+
2
+ #include "crypto_onetimeauth.h"
3
+
4
+ size_t
5
+ crypto_onetimeauth_bytes(void)
6
+ {
7
+ return crypto_onetimeauth_BYTES;
8
+ }
9
+
10
+ size_t
11
+ crypto_onetimeauth_keybytes(void)
12
+ {
13
+ return crypto_onetimeauth_KEYBYTES;
14
+ }
15
+
16
+ const char *
17
+ crypto_onetimeauth_primitive(void)
18
+ {
19
+ return crypto_onetimeauth_PRIMITIVE;
20
+ }
21
+
22
+ int
23
+ crypto_onetimeauth(unsigned char *out, const unsigned char *in,
24
+ unsigned long long inlen, const unsigned char *k)
25
+ {
26
+ return crypto_onetimeauth_poly1305(out, in, inlen, k);
27
+ }
28
+
29
+ int
30
+ crypto_onetimeauth_verify(const unsigned char *h, const unsigned char *in,
31
+ unsigned long long inlen, const unsigned char *k)
32
+ {
33
+ return crypto_onetimeauth_poly1305_verify(h, in, inlen, k);
34
+ }
@@ -0,0 +1,8 @@
1
+
2
+ #include "crypto_onetimeauth_poly1305.h"
3
+
4
+ #define crypto_onetimeauth_poly1305_implementation_name \
5
+ crypto_onetimeauth_poly1305_53_implementation_name
6
+
7
+ #define crypto_onetimeauth crypto_onetimeauth_poly1305_53
8
+ #define crypto_onetimeauth_verify crypto_onetimeauth_poly1305_53_verify
@@ -0,0 +1,1661 @@
1
+ /*
2
+ 20080910
3
+ D. J. Bernstein
4
+ Public domain.
5
+ */
6
+
7
+ #ifdef HAVE_FENV_H
8
+ # include <fenv.h>
9
+ #endif
10
+ #include <stdint.h>
11
+ #include <stdlib.h>
12
+
13
+ #include "api.h"
14
+ #include "crypto_onetimeauth_poly1305_53.h"
15
+ #include "utils.h"
16
+
17
+ #ifdef HAVE_FENV_H
18
+ # pragma STDC FENV_ACCESS ON
19
+ #endif
20
+
21
+ typedef uint8_t uchar;
22
+ typedef int32_t int32;
23
+ typedef uint32_t uint32;
24
+ typedef int64_t int64;
25
+ typedef uint64_t uint64;
26
+
27
+ static const double poly1305_53_constants[] = {
28
+ 0.00000000558793544769287109375 /* alpham80 = 3 2^(-29) */
29
+ , 24.0 /* alpham48 = 3 2^3 */
30
+ , 103079215104.0 /* alpham16 = 3 2^35 */
31
+ , 6755399441055744.0 /* alpha0 = 3 2^51 */
32
+ , 1770887431076116955136.0 /* alpha18 = 3 2^69 */
33
+ , 29014219670751100192948224.0 /* alpha32 = 3 2^83 */
34
+ , 7605903601369376408980219232256.0 /* alpha50 = 3 2^101 */
35
+ , 124615124604835863084731911901282304.0 /* alpha64 = 3 2^115 */
36
+ , 32667107224410092492483962313449748299776.0 /* alpha82 = 3 2^133 */
37
+ , 535217884764734955396857238543560676143529984.0 /* alpha96 = 3 2^147 */
38
+ , 35076039295941670036888435985190792471742381031424.0 /* alpha112 = 3 2^163 */
39
+ , 9194973245195333150150082162901855101712434733101613056.0 /* alpha130 = 3 2^181 */
40
+ #ifdef _MSC_VER
41
+ , 3.67341984631964846240230167881951774318332986491277350471484908212005393579602241516113281250E-39 /* scale = 5 2^(-130) */
42
+ #else
43
+ , 0.0000000000000000000000000000000000000036734198463196484624023016788195177431833298649127735047148490821200539357960224151611328125 /* scale = 5 2^(-130) */
44
+ #endif
45
+ , 6755408030990331.0 /* offset0 = alpha0 + 2^33 - 5 */
46
+ , 29014256564239239022116864.0 /* offset1 = alpha32 + 2^65 - 2^33 */
47
+ , 124615283061160854719918951570079744.0 /* offset2 = alpha64 + 2^97 - 2^65 */
48
+ , 535219245894202480694386063513315216128475136.0 /* offset3 = alpha96 + 2^130 - 2^97 */
49
+ } ;
50
+
51
+ int crypto_onetimeauth(unsigned char *out,const unsigned char *m,unsigned long long l,const unsigned char *k)
52
+ {
53
+ register const unsigned char *r = k;
54
+ register const unsigned char *s = k + 16;
55
+ double r0high_stack;
56
+ double r1high_stack;
57
+ double r1low_stack;
58
+ double sr1high_stack;
59
+ double r2low_stack;
60
+ double sr2high_stack;
61
+ double r0low_stack;
62
+ double sr1low_stack;
63
+ double r2high_stack;
64
+ double sr2low_stack;
65
+ double r3high_stack;
66
+ double sr3high_stack;
67
+ double r3low_stack;
68
+ double sr3low_stack;
69
+ int64 d0;
70
+ int64 d1;
71
+ int64 d2;
72
+ int64 d3;
73
+ register double scale;
74
+ register double alpha0;
75
+ register double alpha32;
76
+ register double alpha64;
77
+ register double alpha96;
78
+ register double alpha130;
79
+ register double h0;
80
+ register double h1;
81
+ register double h2;
82
+ register double h3;
83
+ register double h4;
84
+ register double h5;
85
+ register double h6;
86
+ register double h7;
87
+ register double y7;
88
+ register double y6;
89
+ register double y1;
90
+ register double y0;
91
+ register double y5;
92
+ register double y4;
93
+ register double x7;
94
+ register double x6;
95
+ register double x1;
96
+ register double x0;
97
+ register double y3;
98
+ register double y2;
99
+ register double r3low;
100
+ register double r0low;
101
+ register double r3high;
102
+ register double r0high;
103
+ register double sr1low;
104
+ register double x5;
105
+ register double r3lowx0;
106
+ register double sr1high;
107
+ register double x4;
108
+ register double r0lowx6;
109
+ register double r1low;
110
+ register double x3;
111
+ register double r3highx0;
112
+ register double r1high;
113
+ register double x2;
114
+ register double r0highx6;
115
+ register double sr2low;
116
+ register double r0lowx0;
117
+ register double sr2high;
118
+ register double sr1lowx6;
119
+ register double r2low;
120
+ register double r0highx0;
121
+ register double r2high;
122
+ register double sr1highx6;
123
+ register double sr3low;
124
+ register double r1lowx0;
125
+ register double sr3high;
126
+ register double sr2lowx6;
127
+ register double r1highx0;
128
+ register double sr2highx6;
129
+ register double r2lowx0;
130
+ register double sr3lowx6;
131
+ register double r2highx0;
132
+ register double sr3highx6;
133
+ register double r1highx4;
134
+ register double r1lowx4;
135
+ register double r0highx4;
136
+ register double r0lowx4;
137
+ register double sr3highx4;
138
+ register double sr3lowx4;
139
+ register double sr2highx4;
140
+ register double sr2lowx4;
141
+ register double r0lowx2;
142
+ register double r0highx2;
143
+ register double r1lowx2;
144
+ register double r1highx2;
145
+ register double r2lowx2;
146
+ register double r2highx2;
147
+ register double sr3lowx2;
148
+ register double sr3highx2;
149
+ register double z0;
150
+ register double z1;
151
+ register double z2;
152
+ register double z3;
153
+ register int64 r0;
154
+ register int64 r1;
155
+ register int64 r2;
156
+ register int64 r3;
157
+ register uint32 r00;
158
+ register uint32 r01;
159
+ register uint32 r02;
160
+ register uint32 r03;
161
+ register uint32 r10;
162
+ register uint32 r11;
163
+ register uint32 r12;
164
+ register uint32 r13;
165
+ register uint32 r20;
166
+ register uint32 r21;
167
+ register uint32 r22;
168
+ register uint32 r23;
169
+ register uint32 r30;
170
+ register uint32 r31;
171
+ register uint32 r32;
172
+ register uint32 r33;
173
+ register int64 m0;
174
+ register int64 m1;
175
+ register int64 m2;
176
+ register int64 m3;
177
+ register uint32 m00;
178
+ register uint32 m01;
179
+ register uint32 m02;
180
+ register uint32 m03;
181
+ register uint32 m10;
182
+ register uint32 m11;
183
+ register uint32 m12;
184
+ register uint32 m13;
185
+ register uint32 m20;
186
+ register uint32 m21;
187
+ register uint32 m22;
188
+ register uint32 m23;
189
+ register uint32 m30;
190
+ register uint32 m31;
191
+ register uint32 m32;
192
+ register uint64 m33;
193
+ register char *constants;
194
+ register int32 lbelow2;
195
+ register int32 lbelow3;
196
+ register int32 lbelow4;
197
+ register int32 lbelow5;
198
+ register int32 lbelow6;
199
+ register int32 lbelow7;
200
+ register int32 lbelow8;
201
+ register int32 lbelow9;
202
+ register int32 lbelow10;
203
+ register int32 lbelow11;
204
+ register int32 lbelow12;
205
+ register int32 lbelow13;
206
+ register int32 lbelow14;
207
+ register int32 lbelow15;
208
+ register double alpham80;
209
+ register double alpham48;
210
+ register double alpham16;
211
+ register double alpha18;
212
+ register double alpha50;
213
+ register double alpha82;
214
+ register double alpha112;
215
+ register double offset0;
216
+ register double offset1;
217
+ register double offset2;
218
+ register double offset3;
219
+ register uint32 s00;
220
+ register uint32 s01;
221
+ register uint32 s02;
222
+ register uint32 s03;
223
+ register uint32 s10;
224
+ register uint32 s11;
225
+ register uint32 s12;
226
+ register uint32 s13;
227
+ register uint32 s20;
228
+ register uint32 s21;
229
+ register uint32 s22;
230
+ register uint32 s23;
231
+ register uint32 s30;
232
+ register uint32 s31;
233
+ register uint32 s32;
234
+ register uint32 s33;
235
+ register uint64 bits32;
236
+ register uint64 f;
237
+ register uint64 f0;
238
+ register uint64 f1;
239
+ register uint64 f2;
240
+ register uint64 f3;
241
+ register uint64 f4;
242
+ register uint64 g;
243
+ register uint64 g0;
244
+ register uint64 g1;
245
+ register uint64 g2;
246
+ register uint64 g3;
247
+ register uint64 g4;
248
+
249
+ #ifdef HAVE_FENV_H
250
+ const int previous_rounding_mode = fegetround();
251
+ if (previous_rounding_mode != FE_TONEAREST) {
252
+ if (fesetround(FE_TONEAREST) != 0) {
253
+ return -1;
254
+ }
255
+ }
256
+ #endif
257
+
258
+ r00 = *(const uchar *) (r + 0);
259
+ constants = (char *) &poly1305_53_constants;
260
+
261
+ r01 = *(const uchar *) (r + 1);
262
+
263
+ r02 = *(const uchar *) (r + 2);
264
+ r0 = 2151;
265
+
266
+ r03 = *(const uchar *) (r + 3); r03 &= 15;
267
+ r0 <<= 51;
268
+
269
+ r10 = *(const uchar *) (r + 4); r10 &= 252;
270
+ r01 <<= 8;
271
+ r0 += r00;
272
+
273
+ r11 = *(const uchar *) (r + 5);
274
+ r02 <<= 16;
275
+ r0 += r01;
276
+
277
+ r12 = *(const uchar *) (r + 6);
278
+ r03 <<= 24;
279
+ r0 += r02;
280
+
281
+ r13 = *(const uchar *) (r + 7); r13 &= 15;
282
+ r1 = 2215;
283
+ r0 += r03;
284
+
285
+ d0 = r0;
286
+ r1 <<= 51;
287
+ r2 = 2279;
288
+
289
+ r20 = *(const uchar *) (r + 8); r20 &= 252;
290
+ r11 <<= 8;
291
+ r1 += r10;
292
+
293
+ r21 = *(const uchar *) (r + 9);
294
+ r12 <<= 16;
295
+ r1 += r11;
296
+
297
+ r22 = *(const uchar *) (r + 10);
298
+ r13 <<= 24;
299
+ r1 += r12;
300
+
301
+ r23 = *(const uchar *) (r + 11); r23 &= 15;
302
+ r2 <<= 51;
303
+ r1 += r13;
304
+
305
+ d1 = r1;
306
+ r21 <<= 8;
307
+ r2 += r20;
308
+
309
+ r30 = *(const uchar *) (r + 12); r30 &= 252;
310
+ r22 <<= 16;
311
+ r2 += r21;
312
+
313
+ r31 = *(const uchar *) (r + 13);
314
+ r23 <<= 24;
315
+ r2 += r22;
316
+
317
+ r32 = *(const uchar *) (r + 14);
318
+ r2 += r23;
319
+ r3 = 2343;
320
+
321
+ d2 = r2;
322
+ r3 <<= 51;
323
+ alpha32 = *(double *) (constants + 40);
324
+
325
+ r33 = *(const uchar *) (r + 15); r33 &= 15;
326
+ r31 <<= 8;
327
+ r3 += r30;
328
+
329
+ r32 <<= 16;
330
+ r3 += r31;
331
+
332
+ r33 <<= 24;
333
+ r3 += r32;
334
+
335
+ r3 += r33;
336
+ h0 = alpha32 - alpha32;
337
+
338
+ d3 = r3;
339
+ h1 = alpha32 - alpha32;
340
+
341
+ alpha0 = *(double *) (constants + 24);
342
+ h2 = alpha32 - alpha32;
343
+
344
+ alpha64 = *(double *) (constants + 56);
345
+ h3 = alpha32 - alpha32;
346
+
347
+ alpha18 = *(double *) (constants + 32);
348
+ h4 = alpha32 - alpha32;
349
+
350
+ r0low = *(double *) &d0;
351
+ h5 = alpha32 - alpha32;
352
+
353
+ r1low = *(double *) &d1;
354
+ h6 = alpha32 - alpha32;
355
+
356
+ r2low = *(double *) &d2;
357
+ h7 = alpha32 - alpha32;
358
+
359
+ alpha50 = *(double *) (constants + 48);
360
+ r0low -= alpha0;
361
+
362
+ alpha82 = *(double *) (constants + 64);
363
+ r1low -= alpha32;
364
+
365
+ scale = *(double *) (constants + 96);
366
+ r2low -= alpha64;
367
+
368
+ alpha96 = *(double *) (constants + 72);
369
+ r0high = r0low + alpha18;
370
+
371
+ r3low = *(double *) &d3;
372
+
373
+ alpham80 = *(double *) (constants + 0);
374
+ r1high = r1low + alpha50;
375
+ sr1low = scale * r1low;
376
+
377
+ alpham48 = *(double *) (constants + 8);
378
+ r2high = r2low + alpha82;
379
+ sr2low = scale * r2low;
380
+
381
+ r0high -= alpha18;
382
+ r0high_stack = r0high;
383
+
384
+ r3low -= alpha96;
385
+
386
+ r1high -= alpha50;
387
+ r1high_stack = r1high;
388
+
389
+ sr1high = sr1low + alpham80;
390
+
391
+ alpha112 = *(double *) (constants + 80);
392
+ r0low -= r0high;
393
+
394
+ alpham16 = *(double *) (constants + 16);
395
+ r2high -= alpha82;
396
+ sr3low = scale * r3low;
397
+
398
+ alpha130 = *(double *) (constants + 88);
399
+ sr2high = sr2low + alpham48;
400
+
401
+ r1low -= r1high;
402
+ r1low_stack = r1low;
403
+
404
+ sr1high -= alpham80;
405
+ sr1high_stack = sr1high;
406
+
407
+ r2low -= r2high;
408
+ r2low_stack = r2low;
409
+
410
+ sr2high -= alpham48;
411
+ sr2high_stack = sr2high;
412
+
413
+ r3high = r3low + alpha112;
414
+ r0low_stack = r0low;
415
+
416
+ sr1low -= sr1high;
417
+ sr1low_stack = sr1low;
418
+
419
+ sr3high = sr3low + alpham16;
420
+ r2high_stack = r2high;
421
+
422
+ sr2low -= sr2high;
423
+ sr2low_stack = sr2low;
424
+
425
+ r3high -= alpha112;
426
+ r3high_stack = r3high;
427
+
428
+
429
+ sr3high -= alpham16;
430
+ sr3high_stack = sr3high;
431
+
432
+
433
+ r3low -= r3high;
434
+ r3low_stack = r3low;
435
+
436
+
437
+ sr3low -= sr3high;
438
+ sr3low_stack = sr3low;
439
+
440
+ if (l < 16) goto addatmost15bytes;
441
+
442
+ m00 = *(const uchar *) (m + 0);
443
+ m0 = 2151;
444
+
445
+ m0 <<= 51;
446
+ m1 = 2215;
447
+ m01 = *(const uchar *) (m + 1);
448
+
449
+ m1 <<= 51;
450
+ m2 = 2279;
451
+ m02 = *(const uchar *) (m + 2);
452
+
453
+ m2 <<= 51;
454
+ m3 = 2343;
455
+ m03 = *(const uchar *) (m + 3);
456
+
457
+ m10 = *(const uchar *) (m + 4);
458
+ m01 <<= 8;
459
+ m0 += m00;
460
+
461
+ m11 = *(const uchar *) (m + 5);
462
+ m02 <<= 16;
463
+ m0 += m01;
464
+
465
+ m12 = *(const uchar *) (m + 6);
466
+ m03 <<= 24;
467
+ m0 += m02;
468
+
469
+ m13 = *(const uchar *) (m + 7);
470
+ m3 <<= 51;
471
+ m0 += m03;
472
+
473
+ m20 = *(const uchar *) (m + 8);
474
+ m11 <<= 8;
475
+ m1 += m10;
476
+
477
+ m21 = *(const uchar *) (m + 9);
478
+ m12 <<= 16;
479
+ m1 += m11;
480
+
481
+ m22 = *(const uchar *) (m + 10);
482
+ m13 <<= 24;
483
+ m1 += m12;
484
+
485
+ m23 = *(const uchar *) (m + 11);
486
+ m1 += m13;
487
+
488
+ m30 = *(const uchar *) (m + 12);
489
+ m21 <<= 8;
490
+ m2 += m20;
491
+
492
+ m31 = *(const uchar *) (m + 13);
493
+ m22 <<= 16;
494
+ m2 += m21;
495
+
496
+ m32 = *(const uchar *) (m + 14);
497
+ m23 <<= 24;
498
+ m2 += m22;
499
+
500
+ m33 = *(const uchar *) (m + 15);
501
+ m2 += m23;
502
+
503
+ d0 = m0;
504
+ m31 <<= 8;
505
+ m3 += m30;
506
+
507
+ d1 = m1;
508
+ m32 <<= 16;
509
+ m3 += m31;
510
+
511
+ d2 = m2;
512
+ m33 += 256;
513
+
514
+ m33 <<= 24;
515
+ m3 += m32;
516
+
517
+ m3 += m33;
518
+ d3 = m3;
519
+
520
+ m += 16;
521
+ l -= 16;
522
+
523
+ z0 = *(double *) &d0;
524
+
525
+ z1 = *(double *) &d1;
526
+
527
+ z2 = *(double *) &d2;
528
+
529
+ z3 = *(double *) &d3;
530
+
531
+ z0 -= alpha0;
532
+
533
+ z1 -= alpha32;
534
+
535
+ z2 -= alpha64;
536
+
537
+ z3 -= alpha96;
538
+
539
+ h0 += z0;
540
+
541
+ h1 += z1;
542
+
543
+ h3 += z2;
544
+
545
+ h5 += z3;
546
+
547
+ if (l < 16) goto multiplyaddatmost15bytes;
548
+
549
+ multiplyaddatleast16bytes:;
550
+
551
+ m2 = 2279;
552
+ m20 = *(const uchar *) (m + 8);
553
+ y7 = h7 + alpha130;
554
+
555
+ m2 <<= 51;
556
+ m3 = 2343;
557
+ m21 = *(const uchar *) (m + 9);
558
+ y6 = h6 + alpha130;
559
+
560
+ m3 <<= 51;
561
+ m0 = 2151;
562
+ m22 = *(const uchar *) (m + 10);
563
+ y1 = h1 + alpha32;
564
+
565
+ m0 <<= 51;
566
+ m1 = 2215;
567
+ m23 = *(const uchar *) (m + 11);
568
+ y0 = h0 + alpha32;
569
+
570
+ m1 <<= 51;
571
+ m30 = *(const uchar *) (m + 12);
572
+ y7 -= alpha130;
573
+
574
+ m21 <<= 8;
575
+ m2 += m20;
576
+ m31 = *(const uchar *) (m + 13);
577
+ y6 -= alpha130;
578
+
579
+ m22 <<= 16;
580
+ m2 += m21;
581
+ m32 = *(const uchar *) (m + 14);
582
+ y1 -= alpha32;
583
+
584
+ m23 <<= 24;
585
+ m2 += m22;
586
+ m33 = *(const uchar *) (m + 15);
587
+ y0 -= alpha32;
588
+
589
+ m2 += m23;
590
+ m00 = *(const uchar *) (m + 0);
591
+ y5 = h5 + alpha96;
592
+
593
+ m31 <<= 8;
594
+ m3 += m30;
595
+ m01 = *(const uchar *) (m + 1);
596
+ y4 = h4 + alpha96;
597
+
598
+ m32 <<= 16;
599
+ m02 = *(const uchar *) (m + 2);
600
+ x7 = h7 - y7;
601
+ y7 *= scale;
602
+
603
+ m33 += 256;
604
+ m03 = *(const uchar *) (m + 3);
605
+ x6 = h6 - y6;
606
+ y6 *= scale;
607
+
608
+ m33 <<= 24;
609
+ m3 += m31;
610
+ m10 = *(const uchar *) (m + 4);
611
+ x1 = h1 - y1;
612
+
613
+ m01 <<= 8;
614
+ m3 += m32;
615
+ m11 = *(const uchar *) (m + 5);
616
+ x0 = h0 - y0;
617
+
618
+ m3 += m33;
619
+ m0 += m00;
620
+ m12 = *(const uchar *) (m + 6);
621
+ y5 -= alpha96;
622
+
623
+ m02 <<= 16;
624
+ m0 += m01;
625
+ m13 = *(const uchar *) (m + 7);
626
+ y4 -= alpha96;
627
+
628
+ m03 <<= 24;
629
+ m0 += m02;
630
+ d2 = m2;
631
+ x1 += y7;
632
+
633
+ m0 += m03;
634
+ d3 = m3;
635
+ x0 += y6;
636
+
637
+ m11 <<= 8;
638
+ m1 += m10;
639
+ d0 = m0;
640
+ x7 += y5;
641
+
642
+ m12 <<= 16;
643
+ m1 += m11;
644
+ x6 += y4;
645
+
646
+ m13 <<= 24;
647
+ m1 += m12;
648
+ y3 = h3 + alpha64;
649
+
650
+ m1 += m13;
651
+ d1 = m1;
652
+ y2 = h2 + alpha64;
653
+
654
+ x0 += x1;
655
+
656
+ x6 += x7;
657
+
658
+ y3 -= alpha64;
659
+ r3low = r3low_stack;
660
+
661
+ y2 -= alpha64;
662
+ r0low = r0low_stack;
663
+
664
+ x5 = h5 - y5;
665
+ r3lowx0 = r3low * x0;
666
+ r3high = r3high_stack;
667
+
668
+ x4 = h4 - y4;
669
+ r0lowx6 = r0low * x6;
670
+ r0high = r0high_stack;
671
+
672
+ x3 = h3 - y3;
673
+ r3highx0 = r3high * x0;
674
+ sr1low = sr1low_stack;
675
+
676
+ x2 = h2 - y2;
677
+ r0highx6 = r0high * x6;
678
+ sr1high = sr1high_stack;
679
+
680
+ x5 += y3;
681
+ r0lowx0 = r0low * x0;
682
+ r1low = r1low_stack;
683
+
684
+ h6 = r3lowx0 + r0lowx6;
685
+ sr1lowx6 = sr1low * x6;
686
+ r1high = r1high_stack;
687
+
688
+ x4 += y2;
689
+ r0highx0 = r0high * x0;
690
+ sr2low = sr2low_stack;
691
+
692
+ h7 = r3highx0 + r0highx6;
693
+ sr1highx6 = sr1high * x6;
694
+ sr2high = sr2high_stack;
695
+
696
+ x3 += y1;
697
+ r1lowx0 = r1low * x0;
698
+ r2low = r2low_stack;
699
+
700
+ h0 = r0lowx0 + sr1lowx6;
701
+ sr2lowx6 = sr2low * x6;
702
+ r2high = r2high_stack;
703
+
704
+ x2 += y0;
705
+ r1highx0 = r1high * x0;
706
+ sr3low = sr3low_stack;
707
+
708
+ h1 = r0highx0 + sr1highx6;
709
+ sr2highx6 = sr2high * x6;
710
+ sr3high = sr3high_stack;
711
+
712
+ x4 += x5;
713
+ r2lowx0 = r2low * x0;
714
+ z2 = *(double *) &d2;
715
+
716
+ h2 = r1lowx0 + sr2lowx6;
717
+ sr3lowx6 = sr3low * x6;
718
+
719
+ x2 += x3;
720
+ r2highx0 = r2high * x0;
721
+ z3 = *(double *) &d3;
722
+
723
+ h3 = r1highx0 + sr2highx6;
724
+ sr3highx6 = sr3high * x6;
725
+
726
+ r1highx4 = r1high * x4;
727
+ z2 -= alpha64;
728
+
729
+ h4 = r2lowx0 + sr3lowx6;
730
+ r1lowx4 = r1low * x4;
731
+
732
+ r0highx4 = r0high * x4;
733
+ z3 -= alpha96;
734
+
735
+ h5 = r2highx0 + sr3highx6;
736
+ r0lowx4 = r0low * x4;
737
+
738
+ h7 += r1highx4;
739
+ sr3highx4 = sr3high * x4;
740
+
741
+ h6 += r1lowx4;
742
+ sr3lowx4 = sr3low * x4;
743
+
744
+ h5 += r0highx4;
745
+ sr2highx4 = sr2high * x4;
746
+
747
+ h4 += r0lowx4;
748
+ sr2lowx4 = sr2low * x4;
749
+
750
+ h3 += sr3highx4;
751
+ r0lowx2 = r0low * x2;
752
+
753
+ h2 += sr3lowx4;
754
+ r0highx2 = r0high * x2;
755
+
756
+ h1 += sr2highx4;
757
+ r1lowx2 = r1low * x2;
758
+
759
+ h0 += sr2lowx4;
760
+ r1highx2 = r1high * x2;
761
+
762
+ h2 += r0lowx2;
763
+ r2lowx2 = r2low * x2;
764
+
765
+ h3 += r0highx2;
766
+ r2highx2 = r2high * x2;
767
+
768
+ h4 += r1lowx2;
769
+ sr3lowx2 = sr3low * x2;
770
+
771
+ h5 += r1highx2;
772
+ sr3highx2 = sr3high * x2;
773
+ alpha0 = *(double *) (constants + 24);
774
+
775
+ m += 16;
776
+ h6 += r2lowx2;
777
+
778
+ l -= 16;
779
+ h7 += r2highx2;
780
+
781
+ z1 = *(double *) &d1;
782
+ h0 += sr3lowx2;
783
+
784
+ z0 = *(double *) &d0;
785
+ h1 += sr3highx2;
786
+
787
+ z1 -= alpha32;
788
+
789
+ z0 -= alpha0;
790
+
791
+ h5 += z3;
792
+
793
+ h3 += z2;
794
+
795
+ h1 += z1;
796
+
797
+ h0 += z0;
798
+
799
+ if (l >= 16) goto multiplyaddatleast16bytes;
800
+
801
+ multiplyaddatmost15bytes:;
802
+
803
+ y7 = h7 + alpha130;
804
+
805
+ y6 = h6 + alpha130;
806
+
807
+ y1 = h1 + alpha32;
808
+
809
+ y0 = h0 + alpha32;
810
+
811
+ y7 -= alpha130;
812
+
813
+ y6 -= alpha130;
814
+
815
+ y1 -= alpha32;
816
+
817
+ y0 -= alpha32;
818
+
819
+ y5 = h5 + alpha96;
820
+
821
+ y4 = h4 + alpha96;
822
+
823
+ x7 = h7 - y7;
824
+ y7 *= scale;
825
+
826
+ x6 = h6 - y6;
827
+ y6 *= scale;
828
+
829
+ x1 = h1 - y1;
830
+
831
+ x0 = h0 - y0;
832
+
833
+ y5 -= alpha96;
834
+
835
+ y4 -= alpha96;
836
+
837
+ x1 += y7;
838
+
839
+ x0 += y6;
840
+
841
+ x7 += y5;
842
+
843
+ x6 += y4;
844
+
845
+ y3 = h3 + alpha64;
846
+
847
+ y2 = h2 + alpha64;
848
+
849
+ x0 += x1;
850
+
851
+ x6 += x7;
852
+
853
+ y3 -= alpha64;
854
+ r3low = r3low_stack;
855
+
856
+ y2 -= alpha64;
857
+ r0low = r0low_stack;
858
+
859
+ x5 = h5 - y5;
860
+ r3lowx0 = r3low * x0;
861
+ r3high = r3high_stack;
862
+
863
+ x4 = h4 - y4;
864
+ r0lowx6 = r0low * x6;
865
+ r0high = r0high_stack;
866
+
867
+ x3 = h3 - y3;
868
+ r3highx0 = r3high * x0;
869
+ sr1low = sr1low_stack;
870
+
871
+ x2 = h2 - y2;
872
+ r0highx6 = r0high * x6;
873
+ sr1high = sr1high_stack;
874
+
875
+ x5 += y3;
876
+ r0lowx0 = r0low * x0;
877
+ r1low = r1low_stack;
878
+
879
+ h6 = r3lowx0 + r0lowx6;
880
+ sr1lowx6 = sr1low * x6;
881
+ r1high = r1high_stack;
882
+
883
+ x4 += y2;
884
+ r0highx0 = r0high * x0;
885
+ sr2low = sr2low_stack;
886
+
887
+ h7 = r3highx0 + r0highx6;
888
+ sr1highx6 = sr1high * x6;
889
+ sr2high = sr2high_stack;
890
+
891
+ x3 += y1;
892
+ r1lowx0 = r1low * x0;
893
+ r2low = r2low_stack;
894
+
895
+ h0 = r0lowx0 + sr1lowx6;
896
+ sr2lowx6 = sr2low * x6;
897
+ r2high = r2high_stack;
898
+
899
+ x2 += y0;
900
+ r1highx0 = r1high * x0;
901
+ sr3low = sr3low_stack;
902
+
903
+ h1 = r0highx0 + sr1highx6;
904
+ sr2highx6 = sr2high * x6;
905
+ sr3high = sr3high_stack;
906
+
907
+ x4 += x5;
908
+ r2lowx0 = r2low * x0;
909
+
910
+ h2 = r1lowx0 + sr2lowx6;
911
+ sr3lowx6 = sr3low * x6;
912
+
913
+ x2 += x3;
914
+ r2highx0 = r2high * x0;
915
+
916
+ h3 = r1highx0 + sr2highx6;
917
+ sr3highx6 = sr3high * x6;
918
+
919
+ r1highx4 = r1high * x4;
920
+
921
+ h4 = r2lowx0 + sr3lowx6;
922
+ r1lowx4 = r1low * x4;
923
+
924
+ r0highx4 = r0high * x4;
925
+
926
+ h5 = r2highx0 + sr3highx6;
927
+ r0lowx4 = r0low * x4;
928
+
929
+ h7 += r1highx4;
930
+ sr3highx4 = sr3high * x4;
931
+
932
+ h6 += r1lowx4;
933
+ sr3lowx4 = sr3low * x4;
934
+
935
+ h5 += r0highx4;
936
+ sr2highx4 = sr2high * x4;
937
+
938
+ h4 += r0lowx4;
939
+ sr2lowx4 = sr2low * x4;
940
+
941
+ h3 += sr3highx4;
942
+ r0lowx2 = r0low * x2;
943
+
944
+ h2 += sr3lowx4;
945
+ r0highx2 = r0high * x2;
946
+
947
+ h1 += sr2highx4;
948
+ r1lowx2 = r1low * x2;
949
+
950
+ h0 += sr2lowx4;
951
+ r1highx2 = r1high * x2;
952
+
953
+ h2 += r0lowx2;
954
+ r2lowx2 = r2low * x2;
955
+
956
+ h3 += r0highx2;
957
+ r2highx2 = r2high * x2;
958
+
959
+ h4 += r1lowx2;
960
+ sr3lowx2 = sr3low * x2;
961
+
962
+ h5 += r1highx2;
963
+ sr3highx2 = sr3high * x2;
964
+
965
+ h6 += r2lowx2;
966
+
967
+ h7 += r2highx2;
968
+
969
+ h0 += sr3lowx2;
970
+
971
+ h1 += sr3highx2;
972
+
973
+ addatmost15bytes:;
974
+
975
+ if (l == 0) goto nomorebytes;
976
+
977
+ lbelow2 = l - 2;
978
+
979
+ lbelow3 = l - 3;
980
+
981
+ lbelow2 >>= 31;
982
+ lbelow4 = l - 4;
983
+
984
+ m00 = *(const uchar *) (m + 0);
985
+ lbelow3 >>= 31;
986
+ m += lbelow2;
987
+
988
+ m01 = *(const uchar *) (m + 1);
989
+ lbelow4 >>= 31;
990
+ m += lbelow3;
991
+
992
+ m02 = *(const uchar *) (m + 2);
993
+ m += lbelow4;
994
+ m0 = 2151;
995
+
996
+ m03 = *(const uchar *) (m + 3);
997
+ m0 <<= 51;
998
+ m1 = 2215;
999
+
1000
+ m0 += m00;
1001
+ m01 &= ~lbelow2;
1002
+
1003
+ m02 &= ~lbelow3;
1004
+ m01 -= lbelow2;
1005
+
1006
+ m01 <<= 8;
1007
+ m03 &= ~lbelow4;
1008
+
1009
+ m0 += m01;
1010
+ lbelow2 -= lbelow3;
1011
+
1012
+ m02 += lbelow2;
1013
+ lbelow3 -= lbelow4;
1014
+
1015
+ m02 <<= 16;
1016
+ m03 += lbelow3;
1017
+
1018
+ m03 <<= 24;
1019
+ m0 += m02;
1020
+
1021
+ m0 += m03;
1022
+ lbelow5 = l - 5;
1023
+
1024
+ lbelow6 = l - 6;
1025
+ lbelow7 = l - 7;
1026
+
1027
+ lbelow5 >>= 31;
1028
+ lbelow8 = l - 8;
1029
+
1030
+ lbelow6 >>= 31;
1031
+ m += lbelow5;
1032
+
1033
+ m10 = *(const uchar *) (m + 4);
1034
+ lbelow7 >>= 31;
1035
+ m += lbelow6;
1036
+
1037
+ m11 = *(const uchar *) (m + 5);
1038
+ lbelow8 >>= 31;
1039
+ m += lbelow7;
1040
+
1041
+ m12 = *(const uchar *) (m + 6);
1042
+ m1 <<= 51;
1043
+ m += lbelow8;
1044
+
1045
+ m13 = *(const uchar *) (m + 7);
1046
+ m10 &= ~lbelow5;
1047
+ lbelow4 -= lbelow5;
1048
+
1049
+ m10 += lbelow4;
1050
+ lbelow5 -= lbelow6;
1051
+
1052
+ m11 &= ~lbelow6;
1053
+ m11 += lbelow5;
1054
+
1055
+ m11 <<= 8;
1056
+ m1 += m10;
1057
+
1058
+ m1 += m11;
1059
+ m12 &= ~lbelow7;
1060
+
1061
+ lbelow6 -= lbelow7;
1062
+ m13 &= ~lbelow8;
1063
+
1064
+ m12 += lbelow6;
1065
+ lbelow7 -= lbelow8;
1066
+
1067
+ m12 <<= 16;
1068
+ m13 += lbelow7;
1069
+
1070
+ m13 <<= 24;
1071
+ m1 += m12;
1072
+
1073
+ m1 += m13;
1074
+ m2 = 2279;
1075
+
1076
+ lbelow9 = l - 9;
1077
+ m3 = 2343;
1078
+
1079
+ lbelow10 = l - 10;
1080
+ lbelow11 = l - 11;
1081
+
1082
+ lbelow9 >>= 31;
1083
+ lbelow12 = l - 12;
1084
+
1085
+ lbelow10 >>= 31;
1086
+ m += lbelow9;
1087
+
1088
+ m20 = *(const uchar *) (m + 8);
1089
+ lbelow11 >>= 31;
1090
+ m += lbelow10;
1091
+
1092
+ m21 = *(const uchar *) (m + 9);
1093
+ lbelow12 >>= 31;
1094
+ m += lbelow11;
1095
+
1096
+ m22 = *(const uchar *) (m + 10);
1097
+ m2 <<= 51;
1098
+ m += lbelow12;
1099
+
1100
+ m23 = *(const uchar *) (m + 11);
1101
+ m20 &= ~lbelow9;
1102
+ lbelow8 -= lbelow9;
1103
+
1104
+ m20 += lbelow8;
1105
+ lbelow9 -= lbelow10;
1106
+
1107
+ m21 &= ~lbelow10;
1108
+ m21 += lbelow9;
1109
+
1110
+ m21 <<= 8;
1111
+ m2 += m20;
1112
+
1113
+ m2 += m21;
1114
+ m22 &= ~lbelow11;
1115
+
1116
+ lbelow10 -= lbelow11;
1117
+ m23 &= ~lbelow12;
1118
+
1119
+ m22 += lbelow10;
1120
+ lbelow11 -= lbelow12;
1121
+
1122
+ m22 <<= 16;
1123
+ m23 += lbelow11;
1124
+
1125
+ m23 <<= 24;
1126
+ m2 += m22;
1127
+
1128
+ m3 <<= 51;
1129
+ lbelow13 = l - 13;
1130
+
1131
+ lbelow13 >>= 31;
1132
+ lbelow14 = l - 14;
1133
+
1134
+ lbelow14 >>= 31;
1135
+ m += lbelow13;
1136
+ lbelow15 = l - 15;
1137
+
1138
+ m30 = *(const uchar *) (m + 12);
1139
+ lbelow15 >>= 31;
1140
+ m += lbelow14;
1141
+
1142
+ m31 = *(const uchar *) (m + 13);
1143
+ m += lbelow15;
1144
+ m2 += m23;
1145
+
1146
+ m32 = *(const uchar *) (m + 14);
1147
+ m30 &= ~lbelow13;
1148
+ lbelow12 -= lbelow13;
1149
+
1150
+ m30 += lbelow12;
1151
+ lbelow13 -= lbelow14;
1152
+
1153
+ m3 += m30;
1154
+ m31 &= ~lbelow14;
1155
+
1156
+ m31 += lbelow13;
1157
+ m32 &= ~lbelow15;
1158
+
1159
+ m31 <<= 8;
1160
+ lbelow14 -= lbelow15;
1161
+
1162
+ m3 += m31;
1163
+ m32 += lbelow14;
1164
+ d0 = m0;
1165
+
1166
+ m32 <<= 16;
1167
+ m33 = lbelow15 + 1;
1168
+ d1 = m1;
1169
+
1170
+ m33 <<= 24;
1171
+ m3 += m32;
1172
+ d2 = m2;
1173
+
1174
+ m3 += m33;
1175
+ d3 = m3;
1176
+
1177
+ alpha0 = *(double *) (constants + 24);
1178
+
1179
+ z3 = *(double *) &d3;
1180
+
1181
+ z2 = *(double *) &d2;
1182
+
1183
+ z1 = *(double *) &d1;
1184
+
1185
+ z0 = *(double *) &d0;
1186
+
1187
+ z3 -= alpha96;
1188
+
1189
+ z2 -= alpha64;
1190
+
1191
+ z1 -= alpha32;
1192
+
1193
+ z0 -= alpha0;
1194
+
1195
+ h5 += z3;
1196
+
1197
+ h3 += z2;
1198
+
1199
+ h1 += z1;
1200
+
1201
+ h0 += z0;
1202
+
1203
+ y7 = h7 + alpha130;
1204
+
1205
+ y6 = h6 + alpha130;
1206
+
1207
+ y1 = h1 + alpha32;
1208
+
1209
+ y0 = h0 + alpha32;
1210
+
1211
+ y7 -= alpha130;
1212
+
1213
+ y6 -= alpha130;
1214
+
1215
+ y1 -= alpha32;
1216
+
1217
+ y0 -= alpha32;
1218
+
1219
+ y5 = h5 + alpha96;
1220
+
1221
+ y4 = h4 + alpha96;
1222
+
1223
+ x7 = h7 - y7;
1224
+ y7 *= scale;
1225
+
1226
+ x6 = h6 - y6;
1227
+ y6 *= scale;
1228
+
1229
+ x1 = h1 - y1;
1230
+
1231
+ x0 = h0 - y0;
1232
+
1233
+ y5 -= alpha96;
1234
+
1235
+ y4 -= alpha96;
1236
+
1237
+ x1 += y7;
1238
+
1239
+ x0 += y6;
1240
+
1241
+ x7 += y5;
1242
+
1243
+ x6 += y4;
1244
+
1245
+ y3 = h3 + alpha64;
1246
+
1247
+ y2 = h2 + alpha64;
1248
+
1249
+ x0 += x1;
1250
+
1251
+ x6 += x7;
1252
+
1253
+ y3 -= alpha64;
1254
+ r3low = r3low_stack;
1255
+
1256
+ y2 -= alpha64;
1257
+ r0low = r0low_stack;
1258
+
1259
+ x5 = h5 - y5;
1260
+ r3lowx0 = r3low * x0;
1261
+ r3high = r3high_stack;
1262
+
1263
+ x4 = h4 - y4;
1264
+ r0lowx6 = r0low * x6;
1265
+ r0high = r0high_stack;
1266
+
1267
+ x3 = h3 - y3;
1268
+ r3highx0 = r3high * x0;
1269
+ sr1low = sr1low_stack;
1270
+
1271
+ x2 = h2 - y2;
1272
+ r0highx6 = r0high * x6;
1273
+ sr1high = sr1high_stack;
1274
+
1275
+ x5 += y3;
1276
+ r0lowx0 = r0low * x0;
1277
+ r1low = r1low_stack;
1278
+
1279
+ h6 = r3lowx0 + r0lowx6;
1280
+ sr1lowx6 = sr1low * x6;
1281
+ r1high = r1high_stack;
1282
+
1283
+ x4 += y2;
1284
+ r0highx0 = r0high * x0;
1285
+ sr2low = sr2low_stack;
1286
+
1287
+ h7 = r3highx0 + r0highx6;
1288
+ sr1highx6 = sr1high * x6;
1289
+ sr2high = sr2high_stack;
1290
+
1291
+ x3 += y1;
1292
+ r1lowx0 = r1low * x0;
1293
+ r2low = r2low_stack;
1294
+
1295
+ h0 = r0lowx0 + sr1lowx6;
1296
+ sr2lowx6 = sr2low * x6;
1297
+ r2high = r2high_stack;
1298
+
1299
+ x2 += y0;
1300
+ r1highx0 = r1high * x0;
1301
+ sr3low = sr3low_stack;
1302
+
1303
+ h1 = r0highx0 + sr1highx6;
1304
+ sr2highx6 = sr2high * x6;
1305
+ sr3high = sr3high_stack;
1306
+
1307
+ x4 += x5;
1308
+ r2lowx0 = r2low * x0;
1309
+
1310
+ h2 = r1lowx0 + sr2lowx6;
1311
+ sr3lowx6 = sr3low * x6;
1312
+
1313
+ x2 += x3;
1314
+ r2highx0 = r2high * x0;
1315
+
1316
+ h3 = r1highx0 + sr2highx6;
1317
+ sr3highx6 = sr3high * x6;
1318
+
1319
+ r1highx4 = r1high * x4;
1320
+
1321
+ h4 = r2lowx0 + sr3lowx6;
1322
+ r1lowx4 = r1low * x4;
1323
+
1324
+ r0highx4 = r0high * x4;
1325
+
1326
+ h5 = r2highx0 + sr3highx6;
1327
+ r0lowx4 = r0low * x4;
1328
+
1329
+ h7 += r1highx4;
1330
+ sr3highx4 = sr3high * x4;
1331
+
1332
+ h6 += r1lowx4;
1333
+ sr3lowx4 = sr3low * x4;
1334
+
1335
+ h5 += r0highx4;
1336
+ sr2highx4 = sr2high * x4;
1337
+
1338
+ h4 += r0lowx4;
1339
+ sr2lowx4 = sr2low * x4;
1340
+
1341
+ h3 += sr3highx4;
1342
+ r0lowx2 = r0low * x2;
1343
+
1344
+ h2 += sr3lowx4;
1345
+ r0highx2 = r0high * x2;
1346
+
1347
+ h1 += sr2highx4;
1348
+ r1lowx2 = r1low * x2;
1349
+
1350
+ h0 += sr2lowx4;
1351
+ r1highx2 = r1high * x2;
1352
+
1353
+ h2 += r0lowx2;
1354
+ r2lowx2 = r2low * x2;
1355
+
1356
+ h3 += r0highx2;
1357
+ r2highx2 = r2high * x2;
1358
+
1359
+ h4 += r1lowx2;
1360
+ sr3lowx2 = sr3low * x2;
1361
+
1362
+ h5 += r1highx2;
1363
+ sr3highx2 = sr3high * x2;
1364
+
1365
+ h6 += r2lowx2;
1366
+
1367
+ h7 += r2highx2;
1368
+
1369
+ h0 += sr3lowx2;
1370
+
1371
+ h1 += sr3highx2;
1372
+
1373
+
1374
+ nomorebytes:;
1375
+
1376
+ offset0 = *(double *) (constants + 104);
1377
+ y7 = h7 + alpha130;
1378
+
1379
+ offset1 = *(double *) (constants + 112);
1380
+ y0 = h0 + alpha32;
1381
+
1382
+ offset2 = *(double *) (constants + 120);
1383
+ y1 = h1 + alpha32;
1384
+
1385
+ offset3 = *(double *) (constants + 128);
1386
+ y2 = h2 + alpha64;
1387
+
1388
+ y7 -= alpha130;
1389
+
1390
+ y3 = h3 + alpha64;
1391
+
1392
+ y4 = h4 + alpha96;
1393
+
1394
+ y5 = h5 + alpha96;
1395
+
1396
+ x7 = h7 - y7;
1397
+ y7 *= scale;
1398
+
1399
+ y0 -= alpha32;
1400
+
1401
+ y1 -= alpha32;
1402
+
1403
+ y2 -= alpha64;
1404
+
1405
+ h6 += x7;
1406
+
1407
+ y3 -= alpha64;
1408
+
1409
+ y4 -= alpha96;
1410
+
1411
+ y5 -= alpha96;
1412
+
1413
+ y6 = h6 + alpha130;
1414
+
1415
+ x0 = h0 - y0;
1416
+
1417
+ x1 = h1 - y1;
1418
+
1419
+ x2 = h2 - y2;
1420
+
1421
+ y6 -= alpha130;
1422
+
1423
+ x0 += y7;
1424
+
1425
+ x3 = h3 - y3;
1426
+
1427
+ x4 = h4 - y4;
1428
+
1429
+ x5 = h5 - y5;
1430
+
1431
+ x6 = h6 - y6;
1432
+
1433
+ y6 *= scale;
1434
+
1435
+ x2 += y0;
1436
+
1437
+ x3 += y1;
1438
+
1439
+ x4 += y2;
1440
+
1441
+ x0 += y6;
1442
+
1443
+ x5 += y3;
1444
+
1445
+ x6 += y4;
1446
+
1447
+ x2 += x3;
1448
+
1449
+ x0 += x1;
1450
+
1451
+ x4 += x5;
1452
+
1453
+ x6 += y5;
1454
+
1455
+ x2 += offset1;
1456
+ *(double *) &d1 = x2;
1457
+
1458
+ x0 += offset0;
1459
+ *(double *) &d0 = x0;
1460
+
1461
+ x4 += offset2;
1462
+ *(double *) &d2 = x4;
1463
+
1464
+ x6 += offset3;
1465
+ *(double *) &d3 = x6;
1466
+
1467
+
1468
+
1469
+
1470
+ f0 = d0;
1471
+
1472
+ f1 = d1;
1473
+ bits32 = -1;
1474
+
1475
+ f2 = d2;
1476
+ bits32 >>= 32;
1477
+
1478
+ f3 = d3;
1479
+ f = f0 >> 32;
1480
+
1481
+ f0 &= bits32;
1482
+ f &= 255;
1483
+
1484
+ f1 += f;
1485
+ g0 = f0 + 5;
1486
+
1487
+ g = g0 >> 32;
1488
+ g0 &= bits32;
1489
+
1490
+ f = f1 >> 32;
1491
+ f1 &= bits32;
1492
+
1493
+ f &= 255;
1494
+ g1 = f1 + g;
1495
+
1496
+ g = g1 >> 32;
1497
+ f2 += f;
1498
+
1499
+ f = f2 >> 32;
1500
+ g1 &= bits32;
1501
+
1502
+ f2 &= bits32;
1503
+ f &= 255;
1504
+
1505
+ f3 += f;
1506
+ g2 = f2 + g;
1507
+
1508
+ g = g2 >> 32;
1509
+ g2 &= bits32;
1510
+
1511
+ f4 = f3 >> 32;
1512
+ f3 &= bits32;
1513
+
1514
+ f4 &= 255;
1515
+ g3 = f3 + g;
1516
+
1517
+ g = g3 >> 32;
1518
+ g3 &= bits32;
1519
+
1520
+ g4 = f4 + g;
1521
+
1522
+ g4 = g4 - 4;
1523
+ s00 = *(const uchar *) (s + 0);
1524
+
1525
+ f = (int64) g4 >> 63;
1526
+ s01 = *(const uchar *) (s + 1);
1527
+
1528
+ f0 &= f;
1529
+ g0 &= ~f;
1530
+ s02 = *(const uchar *) (s + 2);
1531
+
1532
+ f1 &= f;
1533
+ f0 |= g0;
1534
+ s03 = *(const uchar *) (s + 3);
1535
+
1536
+ g1 &= ~f;
1537
+ f2 &= f;
1538
+ s10 = *(const uchar *) (s + 4);
1539
+
1540
+ f3 &= f;
1541
+ g2 &= ~f;
1542
+ s11 = *(const uchar *) (s + 5);
1543
+
1544
+ g3 &= ~f;
1545
+ f1 |= g1;
1546
+ s12 = *(const uchar *) (s + 6);
1547
+
1548
+ f2 |= g2;
1549
+ f3 |= g3;
1550
+ s13 = *(const uchar *) (s + 7);
1551
+
1552
+ s01 <<= 8;
1553
+ f0 += s00;
1554
+ s20 = *(const uchar *) (s + 8);
1555
+
1556
+ s02 <<= 16;
1557
+ f0 += s01;
1558
+ s21 = *(const uchar *) (s + 9);
1559
+
1560
+ s03 <<= 24;
1561
+ f0 += s02;
1562
+ s22 = *(const uchar *) (s + 10);
1563
+
1564
+ s11 <<= 8;
1565
+ f1 += s10;
1566
+ s23 = *(const uchar *) (s + 11);
1567
+
1568
+ s12 <<= 16;
1569
+ f1 += s11;
1570
+ s30 = *(const uchar *) (s + 12);
1571
+
1572
+ s13 <<= 24;
1573
+ f1 += s12;
1574
+ s31 = *(const uchar *) (s + 13);
1575
+
1576
+ f0 += s03;
1577
+ f1 += s13;
1578
+ s32 = *(const uchar *) (s + 14);
1579
+
1580
+ s21 <<= 8;
1581
+ f2 += s20;
1582
+ s33 = *(const uchar *) (s + 15);
1583
+
1584
+ s22 <<= 16;
1585
+ f2 += s21;
1586
+
1587
+ s23 <<= 24;
1588
+ f2 += s22;
1589
+
1590
+ s31 <<= 8;
1591
+ f3 += s30;
1592
+
1593
+ s32 <<= 16;
1594
+ f3 += s31;
1595
+
1596
+ s33 <<= 24;
1597
+ f3 += s32;
1598
+
1599
+ f2 += s23;
1600
+ f3 += s33;
1601
+
1602
+ *(uchar *) (out + 0) = f0;
1603
+ f0 >>= 8;
1604
+ *(uchar *) (out + 1) = f0;
1605
+ f0 >>= 8;
1606
+ *(uchar *) (out + 2) = f0;
1607
+ f0 >>= 8;
1608
+ *(uchar *) (out + 3) = f0;
1609
+ f0 >>= 8;
1610
+ f1 += f0;
1611
+
1612
+ *(uchar *) (out + 4) = f1;
1613
+ f1 >>= 8;
1614
+ *(uchar *) (out + 5) = f1;
1615
+ f1 >>= 8;
1616
+ *(uchar *) (out + 6) = f1;
1617
+ f1 >>= 8;
1618
+ *(uchar *) (out + 7) = f1;
1619
+ f1 >>= 8;
1620
+ f2 += f1;
1621
+
1622
+ *(uchar *) (out + 8) = f2;
1623
+ f2 >>= 8;
1624
+ *(uchar *) (out + 9) = f2;
1625
+ f2 >>= 8;
1626
+ *(uchar *) (out + 10) = f2;
1627
+ f2 >>= 8;
1628
+ *(uchar *) (out + 11) = f2;
1629
+ f2 >>= 8;
1630
+ f3 += f2;
1631
+
1632
+ *(uchar *) (out + 12) = f3;
1633
+ f3 >>= 8;
1634
+ *(uchar *) (out + 13) = f3;
1635
+ f3 >>= 8;
1636
+ *(uchar *) (out + 14) = f3;
1637
+ f3 >>= 8;
1638
+ *(uchar *) (out + 15) = f3;
1639
+
1640
+ #ifdef HAVE_FENV_H
1641
+ if (previous_rounding_mode != FE_TONEAREST &&
1642
+ fesetround(previous_rounding_mode) != 0) {
1643
+ abort();
1644
+ }
1645
+ #endif
1646
+
1647
+ return 0;
1648
+ }
1649
+
1650
+ const char *
1651
+ crypto_onetimeauth_poly1305_implementation_name(void)
1652
+ {
1653
+ return "53";
1654
+ }
1655
+
1656
+ struct crypto_onetimeauth_poly1305_implementation
1657
+ crypto_onetimeauth_poly1305_53_implementation = {
1658
+ _SODIUM_C99(.implementation_name =) crypto_onetimeauth_poly1305_implementation_name,
1659
+ _SODIUM_C99(.onetimeauth =) crypto_onetimeauth,
1660
+ _SODIUM_C99(.onetimeauth_verify =) crypto_onetimeauth_verify
1661
+ };