hane 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (488) hide show
  1. package/README.md +32 -0
  2. package/binding.gyp +87 -0
  3. package/dist/index.d.ts +34 -0
  4. package/dist/index.js +1 -0
  5. package/package.json +33 -0
  6. package/src/native/addon.cc +231 -0
  7. package/src/native/zsign_driver.cc +87 -0
  8. package/src/native/zsign_driver.h +38 -0
  9. package/vendor/zlib/.cmake-format.yaml +245 -0
  10. package/vendor/zlib/.github/workflows/c-std.yml +230 -0
  11. package/vendor/zlib/.github/workflows/cmake.yml +112 -0
  12. package/vendor/zlib/.github/workflows/configure.yml +136 -0
  13. package/vendor/zlib/.github/workflows/fuzz.yml +25 -0
  14. package/vendor/zlib/.github/workflows/msys-cygwin.yml +77 -0
  15. package/vendor/zlib/BUILD.bazel +134 -0
  16. package/vendor/zlib/CMakeLists.txt +330 -0
  17. package/vendor/zlib/ChangeLog +1621 -0
  18. package/vendor/zlib/FAQ +367 -0
  19. package/vendor/zlib/INDEX +68 -0
  20. package/vendor/zlib/LICENSE +22 -0
  21. package/vendor/zlib/MODULE.bazel +9 -0
  22. package/vendor/zlib/Makefile.in +419 -0
  23. package/vendor/zlib/README +115 -0
  24. package/vendor/zlib/README-cmake.md +83 -0
  25. package/vendor/zlib/adler32.c +164 -0
  26. package/vendor/zlib/amiga/Makefile.pup +69 -0
  27. package/vendor/zlib/amiga/Makefile.sas +68 -0
  28. package/vendor/zlib/compress.c +75 -0
  29. package/vendor/zlib/configure +966 -0
  30. package/vendor/zlib/contrib/README.contrib +57 -0
  31. package/vendor/zlib/contrib/ada/buffer_demo.adb +106 -0
  32. package/vendor/zlib/contrib/ada/mtest.adb +156 -0
  33. package/vendor/zlib/contrib/ada/read.adb +156 -0
  34. package/vendor/zlib/contrib/ada/readme.txt +65 -0
  35. package/vendor/zlib/contrib/ada/test.adb +463 -0
  36. package/vendor/zlib/contrib/ada/zlib-streams.adb +225 -0
  37. package/vendor/zlib/contrib/ada/zlib-streams.ads +114 -0
  38. package/vendor/zlib/contrib/ada/zlib-thin.adb +142 -0
  39. package/vendor/zlib/contrib/ada/zlib-thin.ads +450 -0
  40. package/vendor/zlib/contrib/ada/zlib.adb +701 -0
  41. package/vendor/zlib/contrib/ada/zlib.ads +328 -0
  42. package/vendor/zlib/contrib/ada/zlib.gpr +20 -0
  43. package/vendor/zlib/contrib/blast/Makefile +8 -0
  44. package/vendor/zlib/contrib/blast/README +4 -0
  45. package/vendor/zlib/contrib/blast/blast.c +466 -0
  46. package/vendor/zlib/contrib/blast/blast.h +83 -0
  47. package/vendor/zlib/contrib/blast/test.pk +0 -0
  48. package/vendor/zlib/contrib/blast/test.txt +1 -0
  49. package/vendor/zlib/contrib/delphi/ZLib.pas +557 -0
  50. package/vendor/zlib/contrib/delphi/ZLibConst.pas +11 -0
  51. package/vendor/zlib/contrib/delphi/readme.txt +76 -0
  52. package/vendor/zlib/contrib/delphi/zlibd32.mak +99 -0
  53. package/vendor/zlib/contrib/dotzlib/DotZLib/AssemblyInfo.cs +58 -0
  54. package/vendor/zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs +202 -0
  55. package/vendor/zlib/contrib/dotzlib/DotZLib/CircularBuffer.cs +83 -0
  56. package/vendor/zlib/contrib/dotzlib/DotZLib/CodecBase.cs +198 -0
  57. package/vendor/zlib/contrib/dotzlib/DotZLib/Deflater.cs +106 -0
  58. package/vendor/zlib/contrib/dotzlib/DotZLib/DotZLib.cs +288 -0
  59. package/vendor/zlib/contrib/dotzlib/DotZLib/DotZLib.csproj +141 -0
  60. package/vendor/zlib/contrib/dotzlib/DotZLib/GZipStream.cs +301 -0
  61. package/vendor/zlib/contrib/dotzlib/DotZLib/Inflater.cs +105 -0
  62. package/vendor/zlib/contrib/dotzlib/DotZLib/UnitTests.cs +274 -0
  63. package/vendor/zlib/contrib/dotzlib/DotZLib.build +33 -0
  64. package/vendor/zlib/contrib/dotzlib/DotZLib.chm +0 -0
  65. package/vendor/zlib/contrib/dotzlib/DotZLib.sln +21 -0
  66. package/vendor/zlib/contrib/dotzlib/LICENSE_1_0.txt +23 -0
  67. package/vendor/zlib/contrib/dotzlib/readme.txt +58 -0
  68. package/vendor/zlib/contrib/gcc_gvmat64/gvmat64.S +574 -0
  69. package/vendor/zlib/contrib/infback9/README +1 -0
  70. package/vendor/zlib/contrib/infback9/infback9.c +603 -0
  71. package/vendor/zlib/contrib/infback9/infback9.h +37 -0
  72. package/vendor/zlib/contrib/infback9/inffix9.h +107 -0
  73. package/vendor/zlib/contrib/infback9/inflate9.h +47 -0
  74. package/vendor/zlib/contrib/infback9/inftree9.c +319 -0
  75. package/vendor/zlib/contrib/infback9/inftree9.h +61 -0
  76. package/vendor/zlib/contrib/iostream/test.cpp +24 -0
  77. package/vendor/zlib/contrib/iostream/zfstream.cpp +329 -0
  78. package/vendor/zlib/contrib/iostream/zfstream.h +128 -0
  79. package/vendor/zlib/contrib/iostream2/zstream.h +307 -0
  80. package/vendor/zlib/contrib/iostream2/zstream_test.cpp +25 -0
  81. package/vendor/zlib/contrib/iostream3/README +35 -0
  82. package/vendor/zlib/contrib/iostream3/TODO +17 -0
  83. package/vendor/zlib/contrib/iostream3/test.cc +50 -0
  84. package/vendor/zlib/contrib/iostream3/zfstream.cc +479 -0
  85. package/vendor/zlib/contrib/iostream3/zfstream.h +466 -0
  86. package/vendor/zlib/contrib/minizip/CMakeLists.txt +380 -0
  87. package/vendor/zlib/contrib/minizip/Makefile +37 -0
  88. package/vendor/zlib/contrib/minizip/Makefile.am +45 -0
  89. package/vendor/zlib/contrib/minizip/MiniZip64_Changes.txt +6 -0
  90. package/vendor/zlib/contrib/minizip/MiniZip64_info.txt +74 -0
  91. package/vendor/zlib/contrib/minizip/configure.ac +32 -0
  92. package/vendor/zlib/contrib/minizip/crypt.h +128 -0
  93. package/vendor/zlib/contrib/minizip/ints.h +57 -0
  94. package/vendor/zlib/contrib/minizip/ioapi.c +231 -0
  95. package/vendor/zlib/contrib/minizip/ioapi.h +183 -0
  96. package/vendor/zlib/contrib/minizip/iowin32.c +448 -0
  97. package/vendor/zlib/contrib/minizip/iowin32.h +28 -0
  98. package/vendor/zlib/contrib/minizip/make_vms.com +25 -0
  99. package/vendor/zlib/contrib/minizip/miniunz.c +647 -0
  100. package/vendor/zlib/contrib/minizip/miniunzip.1 +63 -0
  101. package/vendor/zlib/contrib/minizip/minizip.1 +46 -0
  102. package/vendor/zlib/contrib/minizip/minizip.c +512 -0
  103. package/vendor/zlib/contrib/minizip/minizip.pc.in +12 -0
  104. package/vendor/zlib/contrib/minizip/minizip.pc.txt +13 -0
  105. package/vendor/zlib/contrib/minizip/minizipConfig.cmake.in +35 -0
  106. package/vendor/zlib/contrib/minizip/mztools.c +288 -0
  107. package/vendor/zlib/contrib/minizip/mztools.h +37 -0
  108. package/vendor/zlib/contrib/minizip/skipset.h +361 -0
  109. package/vendor/zlib/contrib/minizip/test/CMakeLists.txt +121 -0
  110. package/vendor/zlib/contrib/minizip/test/add_subdirectory_exclude_test.cmake.in +29 -0
  111. package/vendor/zlib/contrib/minizip/test/add_subdirectory_test.cmake.in +28 -0
  112. package/vendor/zlib/contrib/minizip/test/find_package_test.cmake.in +25 -0
  113. package/vendor/zlib/contrib/minizip/test/test_helper.cm +32 -0
  114. package/vendor/zlib/contrib/minizip/unzip.c +1981 -0
  115. package/vendor/zlib/contrib/minizip/unzip.h +441 -0
  116. package/vendor/zlib/contrib/minizip/zip.c +2199 -0
  117. package/vendor/zlib/contrib/minizip/zip.h +370 -0
  118. package/vendor/zlib/contrib/nuget/nuget.csproj +43 -0
  119. package/vendor/zlib/contrib/nuget/nuget.sln +22 -0
  120. package/vendor/zlib/contrib/pascal/example.pas +599 -0
  121. package/vendor/zlib/contrib/pascal/readme.txt +76 -0
  122. package/vendor/zlib/contrib/pascal/zlibd32.mak +99 -0
  123. package/vendor/zlib/contrib/pascal/zlibpas.pas +276 -0
  124. package/vendor/zlib/contrib/puff/Makefile +42 -0
  125. package/vendor/zlib/contrib/puff/README +63 -0
  126. package/vendor/zlib/contrib/puff/puff.c +840 -0
  127. package/vendor/zlib/contrib/puff/puff.h +35 -0
  128. package/vendor/zlib/contrib/puff/pufftest.c +169 -0
  129. package/vendor/zlib/contrib/puff/zeros.raw +0 -0
  130. package/vendor/zlib/contrib/testzlib/testzlib.c +275 -0
  131. package/vendor/zlib/contrib/testzlib/testzlib.txt +10 -0
  132. package/vendor/zlib/contrib/untgz/Makefile +14 -0
  133. package/vendor/zlib/contrib/untgz/Makefile.msc +17 -0
  134. package/vendor/zlib/contrib/untgz/untgz.c +667 -0
  135. package/vendor/zlib/contrib/vstudio/readme.txt +81 -0
  136. package/vendor/zlib/contrib/vstudio/vc10/miniunz.vcxproj +310 -0
  137. package/vendor/zlib/contrib/vstudio/vc10/miniunz.vcxproj.filters +22 -0
  138. package/vendor/zlib/contrib/vstudio/vc10/minizip.vcxproj +307 -0
  139. package/vendor/zlib/contrib/vstudio/vc10/minizip.vcxproj.filters +22 -0
  140. package/vendor/zlib/contrib/vstudio/vc10/testzlib.vcxproj +412 -0
  141. package/vendor/zlib/contrib/vstudio/vc10/testzlib.vcxproj.filters +55 -0
  142. package/vendor/zlib/contrib/vstudio/vc10/testzlibdll.vcxproj +310 -0
  143. package/vendor/zlib/contrib/vstudio/vc10/testzlibdll.vcxproj.filters +22 -0
  144. package/vendor/zlib/contrib/vstudio/vc10/zlib.rc +32 -0
  145. package/vendor/zlib/contrib/vstudio/vc10/zlibstat.vcxproj +449 -0
  146. package/vendor/zlib/contrib/vstudio/vc10/zlibstat.vcxproj.filters +74 -0
  147. package/vendor/zlib/contrib/vstudio/vc10/zlibvc.def +161 -0
  148. package/vendor/zlib/contrib/vstudio/vc10/zlibvc.sln +135 -0
  149. package/vendor/zlib/contrib/vstudio/vc10/zlibvc.vcxproj +633 -0
  150. package/vendor/zlib/contrib/vstudio/vc10/zlibvc.vcxproj.filters +115 -0
  151. package/vendor/zlib/contrib/vstudio/vc11/miniunz.vcxproj +314 -0
  152. package/vendor/zlib/contrib/vstudio/vc11/minizip.vcxproj +311 -0
  153. package/vendor/zlib/contrib/vstudio/vc11/testzlib.vcxproj +418 -0
  154. package/vendor/zlib/contrib/vstudio/vc11/testzlibdll.vcxproj +314 -0
  155. package/vendor/zlib/contrib/vstudio/vc11/zlib.rc +32 -0
  156. package/vendor/zlib/contrib/vstudio/vc11/zlibstat.vcxproj +456 -0
  157. package/vendor/zlib/contrib/vstudio/vc11/zlibvc.def +161 -0
  158. package/vendor/zlib/contrib/vstudio/vc11/zlibvc.sln +117 -0
  159. package/vendor/zlib/contrib/vstudio/vc11/zlibvc.vcxproj +664 -0
  160. package/vendor/zlib/contrib/vstudio/vc12/miniunz.vcxproj +316 -0
  161. package/vendor/zlib/contrib/vstudio/vc12/minizip.vcxproj +313 -0
  162. package/vendor/zlib/contrib/vstudio/vc12/testzlib.vcxproj +422 -0
  163. package/vendor/zlib/contrib/vstudio/vc12/testzlibdll.vcxproj +316 -0
  164. package/vendor/zlib/contrib/vstudio/vc12/zlib.rc +32 -0
  165. package/vendor/zlib/contrib/vstudio/vc12/zlibstat.vcxproj +459 -0
  166. package/vendor/zlib/contrib/vstudio/vc12/zlibvc.def +161 -0
  167. package/vendor/zlib/contrib/vstudio/vc12/zlibvc.sln +119 -0
  168. package/vendor/zlib/contrib/vstudio/vc12/zlibvc.vcxproj +668 -0
  169. package/vendor/zlib/contrib/vstudio/vc14/miniunz.vcxproj +316 -0
  170. package/vendor/zlib/contrib/vstudio/vc14/minizip.vcxproj +313 -0
  171. package/vendor/zlib/contrib/vstudio/vc14/testzlib.vcxproj +422 -0
  172. package/vendor/zlib/contrib/vstudio/vc14/testzlibdll.vcxproj +316 -0
  173. package/vendor/zlib/contrib/vstudio/vc14/zlib.rc +32 -0
  174. package/vendor/zlib/contrib/vstudio/vc14/zlibstat.vcxproj +459 -0
  175. package/vendor/zlib/contrib/vstudio/vc14/zlibvc.def +161 -0
  176. package/vendor/zlib/contrib/vstudio/vc14/zlibvc.sln +119 -0
  177. package/vendor/zlib/contrib/vstudio/vc14/zlibvc.vcxproj +668 -0
  178. package/vendor/zlib/contrib/vstudio/vc17/miniunz.vcxproj +409 -0
  179. package/vendor/zlib/contrib/vstudio/vc17/minizip.vcxproj +405 -0
  180. package/vendor/zlib/contrib/vstudio/vc17/testzlib.vcxproj +473 -0
  181. package/vendor/zlib/contrib/vstudio/vc17/testzlibdll.vcxproj +409 -0
  182. package/vendor/zlib/contrib/vstudio/vc17/zlib.rc +32 -0
  183. package/vendor/zlib/contrib/vstudio/vc17/zlibstat.vcxproj +602 -0
  184. package/vendor/zlib/contrib/vstudio/vc17/zlibvc.def +161 -0
  185. package/vendor/zlib/contrib/vstudio/vc17/zlibvc.sln +179 -0
  186. package/vendor/zlib/contrib/vstudio/vc17/zlibvc.vcxproj +875 -0
  187. package/vendor/zlib/contrib/vstudio/vc9/miniunz.vcproj +565 -0
  188. package/vendor/zlib/contrib/vstudio/vc9/minizip.vcproj +562 -0
  189. package/vendor/zlib/contrib/vstudio/vc9/testzlib.vcproj +796 -0
  190. package/vendor/zlib/contrib/vstudio/vc9/testzlibdll.vcproj +565 -0
  191. package/vendor/zlib/contrib/vstudio/vc9/zlib.rc +32 -0
  192. package/vendor/zlib/contrib/vstudio/vc9/zlibstat.vcproj +781 -0
  193. package/vendor/zlib/contrib/vstudio/vc9/zlibvc.def +161 -0
  194. package/vendor/zlib/contrib/vstudio/vc9/zlibvc.sln +144 -0
  195. package/vendor/zlib/contrib/vstudio/vc9/zlibvc.vcproj +1100 -0
  196. package/vendor/zlib/crc32.c +1049 -0
  197. package/vendor/zlib/crc32.h +9446 -0
  198. package/vendor/zlib/deflate.c +2152 -0
  199. package/vendor/zlib/deflate.h +380 -0
  200. package/vendor/zlib/doc/algorithm.txt +209 -0
  201. package/vendor/zlib/doc/crc-doc.1.0.pdf +0 -0
  202. package/vendor/zlib/doc/rfc1950.txt +619 -0
  203. package/vendor/zlib/doc/rfc1951.txt +955 -0
  204. package/vendor/zlib/doc/rfc1952.txt +675 -0
  205. package/vendor/zlib/doc/txtvsbin.txt +107 -0
  206. package/vendor/zlib/examples/README.examples +54 -0
  207. package/vendor/zlib/examples/enough.c +597 -0
  208. package/vendor/zlib/examples/fitblk.c +233 -0
  209. package/vendor/zlib/examples/gun.c +702 -0
  210. package/vendor/zlib/examples/gzappend.c +504 -0
  211. package/vendor/zlib/examples/gzjoin.c +449 -0
  212. package/vendor/zlib/examples/gzlog.c +1061 -0
  213. package/vendor/zlib/examples/gzlog.h +91 -0
  214. package/vendor/zlib/examples/gznorm.c +474 -0
  215. package/vendor/zlib/examples/zlib_how.html +549 -0
  216. package/vendor/zlib/examples/zpipe.c +209 -0
  217. package/vendor/zlib/examples/zran.c +550 -0
  218. package/vendor/zlib/examples/zran.h +53 -0
  219. package/vendor/zlib/gzclose.c +23 -0
  220. package/vendor/zlib/gzguts.h +215 -0
  221. package/vendor/zlib/gzlib.c +585 -0
  222. package/vendor/zlib/gzread.c +603 -0
  223. package/vendor/zlib/gzwrite.c +631 -0
  224. package/vendor/zlib/infback.c +628 -0
  225. package/vendor/zlib/inffast.c +320 -0
  226. package/vendor/zlib/inffast.h +11 -0
  227. package/vendor/zlib/inffixed.h +94 -0
  228. package/vendor/zlib/inflate.c +1526 -0
  229. package/vendor/zlib/inflate.h +126 -0
  230. package/vendor/zlib/inftrees.c +299 -0
  231. package/vendor/zlib/inftrees.h +62 -0
  232. package/vendor/zlib/make_vms.com +867 -0
  233. package/vendor/zlib/msdos/Makefile.bor +115 -0
  234. package/vendor/zlib/msdos/Makefile.dj2 +104 -0
  235. package/vendor/zlib/msdos/Makefile.emx +69 -0
  236. package/vendor/zlib/msdos/Makefile.msc +112 -0
  237. package/vendor/zlib/msdos/Makefile.tc +100 -0
  238. package/vendor/zlib/nintendods/Makefile +126 -0
  239. package/vendor/zlib/nintendods/README +5 -0
  240. package/vendor/zlib/old/Makefile.emx +69 -0
  241. package/vendor/zlib/old/Makefile.riscos +151 -0
  242. package/vendor/zlib/old/README +3 -0
  243. package/vendor/zlib/old/descrip.mms +48 -0
  244. package/vendor/zlib/old/os2/Makefile.os2 +136 -0
  245. package/vendor/zlib/old/os2/zlib.def +51 -0
  246. package/vendor/zlib/old/visual-basic.txt +160 -0
  247. package/vendor/zlib/os400/README400 +48 -0
  248. package/vendor/zlib/os400/bndsrc +133 -0
  249. package/vendor/zlib/os400/make.sh +366 -0
  250. package/vendor/zlib/os400/zlib.inc +531 -0
  251. package/vendor/zlib/qnx/package.qpg +141 -0
  252. package/vendor/zlib/test/CMakeLists.txt +265 -0
  253. package/vendor/zlib/test/add_subdirectory_exclude_test.cmake.in +29 -0
  254. package/vendor/zlib/test/add_subdirectory_test.cmake.in +28 -0
  255. package/vendor/zlib/test/example.c +552 -0
  256. package/vendor/zlib/test/find_package_test.cmake.in +26 -0
  257. package/vendor/zlib/test/infcover.c +672 -0
  258. package/vendor/zlib/test/minigzip.c +590 -0
  259. package/vendor/zlib/treebuild.xml +116 -0
  260. package/vendor/zlib/trees.c +1119 -0
  261. package/vendor/zlib/trees.h +128 -0
  262. package/vendor/zlib/uncompr.c +85 -0
  263. package/vendor/zlib/watcom/watcom_f.mak +43 -0
  264. package/vendor/zlib/watcom/watcom_l.mak +43 -0
  265. package/vendor/zlib/win32/DLL_FAQ.txt +381 -0
  266. package/vendor/zlib/win32/Makefile.bor +109 -0
  267. package/vendor/zlib/win32/Makefile.gcc +177 -0
  268. package/vendor/zlib/win32/Makefile.msc +159 -0
  269. package/vendor/zlib/win32/README-WIN32.txt +103 -0
  270. package/vendor/zlib/win32/VisualC.txt +3 -0
  271. package/vendor/zlib/win32/zlib.def +98 -0
  272. package/vendor/zlib/win32/zlib1.rc +37 -0
  273. package/vendor/zlib/zconf.h.in +544 -0
  274. package/vendor/zlib/zlib.3 +149 -0
  275. package/vendor/zlib/zlib.3.pdf +0 -0
  276. package/vendor/zlib/zlib.h +1957 -0
  277. package/vendor/zlib/zlib.map +104 -0
  278. package/vendor/zlib/zlib.pc.cmakein +13 -0
  279. package/vendor/zlib/zlib.pc.in +13 -0
  280. package/vendor/zlib/zlibConfig.cmake.in +26 -0
  281. package/vendor/zlib/zutil.c +299 -0
  282. package/vendor/zlib/zutil.h +257 -0
  283. package/vendor/zsign/.gitattributes +4 -0
  284. package/vendor/zsign/LICENSE +21 -0
  285. package/vendor/zsign/README.md +142 -0
  286. package/vendor/zsign/build/linux/Makefile +43 -0
  287. package/vendor/zsign/build/macos/Makefile +43 -0
  288. package/vendor/zsign/build/windows/vs2022/include/minizip/crypt.h +128 -0
  289. package/vendor/zsign/build/windows/vs2022/include/minizip/ioapi.h +216 -0
  290. package/vendor/zsign/build/windows/vs2022/include/minizip/iowin32.h +28 -0
  291. package/vendor/zsign/build/windows/vs2022/include/minizip/mztools.h +37 -0
  292. package/vendor/zsign/build/windows/vs2022/include/minizip/unzip.h +437 -0
  293. package/vendor/zsign/build/windows/vs2022/include/minizip/zip.h +364 -0
  294. package/vendor/zsign/build/windows/vs2022/include/openssl/__DECC_INCLUDE_EPILOGUE.H +22 -0
  295. package/vendor/zsign/build/windows/vs2022/include/openssl/__DECC_INCLUDE_PROLOGUE.H +26 -0
  296. package/vendor/zsign/build/windows/vs2022/include/openssl/aes.h +111 -0
  297. package/vendor/zsign/build/windows/vs2022/include/openssl/applink.c +153 -0
  298. package/vendor/zsign/build/windows/vs2022/include/openssl/asn1.h +1133 -0
  299. package/vendor/zsign/build/windows/vs2022/include/openssl/asn1_mac.h +10 -0
  300. package/vendor/zsign/build/windows/vs2022/include/openssl/asn1err.h +142 -0
  301. package/vendor/zsign/build/windows/vs2022/include/openssl/asn1t.h +946 -0
  302. package/vendor/zsign/build/windows/vs2022/include/openssl/async.h +104 -0
  303. package/vendor/zsign/build/windows/vs2022/include/openssl/asyncerr.h +29 -0
  304. package/vendor/zsign/build/windows/vs2022/include/openssl/bio.h +1015 -0
  305. package/vendor/zsign/build/windows/vs2022/include/openssl/bioerr.h +72 -0
  306. package/vendor/zsign/build/windows/vs2022/include/openssl/blowfish.h +78 -0
  307. package/vendor/zsign/build/windows/vs2022/include/openssl/bn.h +590 -0
  308. package/vendor/zsign/build/windows/vs2022/include/openssl/bnerr.h +47 -0
  309. package/vendor/zsign/build/windows/vs2022/include/openssl/buffer.h +62 -0
  310. package/vendor/zsign/build/windows/vs2022/include/openssl/buffererr.h +25 -0
  311. package/vendor/zsign/build/windows/vs2022/include/openssl/camellia.h +117 -0
  312. package/vendor/zsign/build/windows/vs2022/include/openssl/cast.h +71 -0
  313. package/vendor/zsign/build/windows/vs2022/include/openssl/cmac.h +52 -0
  314. package/vendor/zsign/build/windows/vs2022/include/openssl/cmp.h +727 -0
  315. package/vendor/zsign/build/windows/vs2022/include/openssl/cmp_util.h +56 -0
  316. package/vendor/zsign/build/windows/vs2022/include/openssl/cmperr.h +131 -0
  317. package/vendor/zsign/build/windows/vs2022/include/openssl/cms.h +508 -0
  318. package/vendor/zsign/build/windows/vs2022/include/openssl/cmserr.h +125 -0
  319. package/vendor/zsign/build/windows/vs2022/include/openssl/comp.h +98 -0
  320. package/vendor/zsign/build/windows/vs2022/include/openssl/comperr.h +38 -0
  321. package/vendor/zsign/build/windows/vs2022/include/openssl/conf.h +214 -0
  322. package/vendor/zsign/build/windows/vs2022/include/openssl/conf_api.h +46 -0
  323. package/vendor/zsign/build/windows/vs2022/include/openssl/conferr.h +52 -0
  324. package/vendor/zsign/build/windows/vs2022/include/openssl/configuration.h +188 -0
  325. package/vendor/zsign/build/windows/vs2022/include/openssl/conftypes.h +44 -0
  326. package/vendor/zsign/build/windows/vs2022/include/openssl/core.h +236 -0
  327. package/vendor/zsign/build/windows/vs2022/include/openssl/core_dispatch.h +1022 -0
  328. package/vendor/zsign/build/windows/vs2022/include/openssl/core_names.h +545 -0
  329. package/vendor/zsign/build/windows/vs2022/include/openssl/core_object.h +41 -0
  330. package/vendor/zsign/build/windows/vs2022/include/openssl/crmf.h +260 -0
  331. package/vendor/zsign/build/windows/vs2022/include/openssl/crmferr.h +50 -0
  332. package/vendor/zsign/build/windows/vs2022/include/openssl/crypto.h +580 -0
  333. package/vendor/zsign/build/windows/vs2022/include/openssl/cryptoerr.h +56 -0
  334. package/vendor/zsign/build/windows/vs2022/include/openssl/cryptoerr_legacy.h +1466 -0
  335. package/vendor/zsign/build/windows/vs2022/include/openssl/ct.h +573 -0
  336. package/vendor/zsign/build/windows/vs2022/include/openssl/cterr.h +45 -0
  337. package/vendor/zsign/build/windows/vs2022/include/openssl/decoder.h +133 -0
  338. package/vendor/zsign/build/windows/vs2022/include/openssl/decodererr.h +28 -0
  339. package/vendor/zsign/build/windows/vs2022/include/openssl/des.h +211 -0
  340. package/vendor/zsign/build/windows/vs2022/include/openssl/dh.h +339 -0
  341. package/vendor/zsign/build/windows/vs2022/include/openssl/dherr.h +59 -0
  342. package/vendor/zsign/build/windows/vs2022/include/openssl/dsa.h +280 -0
  343. package/vendor/zsign/build/windows/vs2022/include/openssl/dsaerr.h +44 -0
  344. package/vendor/zsign/build/windows/vs2022/include/openssl/dtls1.h +57 -0
  345. package/vendor/zsign/build/windows/vs2022/include/openssl/e_os2.h +310 -0
  346. package/vendor/zsign/build/windows/vs2022/include/openssl/e_ostime.h +38 -0
  347. package/vendor/zsign/build/windows/vs2022/include/openssl/ebcdic.h +39 -0
  348. package/vendor/zsign/build/windows/vs2022/include/openssl/ec.h +1588 -0
  349. package/vendor/zsign/build/windows/vs2022/include/openssl/ecdh.h +10 -0
  350. package/vendor/zsign/build/windows/vs2022/include/openssl/ecdsa.h +10 -0
  351. package/vendor/zsign/build/windows/vs2022/include/openssl/ecerr.h +104 -0
  352. package/vendor/zsign/build/windows/vs2022/include/openssl/encoder.h +124 -0
  353. package/vendor/zsign/build/windows/vs2022/include/openssl/encodererr.h +28 -0
  354. package/vendor/zsign/build/windows/vs2022/include/openssl/engine.h +833 -0
  355. package/vendor/zsign/build/windows/vs2022/include/openssl/engineerr.h +63 -0
  356. package/vendor/zsign/build/windows/vs2022/include/openssl/err.h +512 -0
  357. package/vendor/zsign/build/windows/vs2022/include/openssl/ess.h +128 -0
  358. package/vendor/zsign/build/windows/vs2022/include/openssl/esserr.h +32 -0
  359. package/vendor/zsign/build/windows/vs2022/include/openssl/evp.h +2231 -0
  360. package/vendor/zsign/build/windows/vs2022/include/openssl/evperr.h +140 -0
  361. package/vendor/zsign/build/windows/vs2022/include/openssl/fips_names.h +50 -0
  362. package/vendor/zsign/build/windows/vs2022/include/openssl/fipskey.h +41 -0
  363. package/vendor/zsign/build/windows/vs2022/include/openssl/hmac.h +62 -0
  364. package/vendor/zsign/build/windows/vs2022/include/openssl/hpke.h +169 -0
  365. package/vendor/zsign/build/windows/vs2022/include/openssl/http.h +118 -0
  366. package/vendor/zsign/build/windows/vs2022/include/openssl/httperr.h +56 -0
  367. package/vendor/zsign/build/windows/vs2022/include/openssl/idea.h +82 -0
  368. package/vendor/zsign/build/windows/vs2022/include/openssl/indicator.h +31 -0
  369. package/vendor/zsign/build/windows/vs2022/include/openssl/kdf.h +138 -0
  370. package/vendor/zsign/build/windows/vs2022/include/openssl/kdferr.h +16 -0
  371. package/vendor/zsign/build/windows/vs2022/include/openssl/lhash.h +398 -0
  372. package/vendor/zsign/build/windows/vs2022/include/openssl/macros.h +338 -0
  373. package/vendor/zsign/build/windows/vs2022/include/openssl/md2.h +56 -0
  374. package/vendor/zsign/build/windows/vs2022/include/openssl/md4.h +63 -0
  375. package/vendor/zsign/build/windows/vs2022/include/openssl/md5.h +62 -0
  376. package/vendor/zsign/build/windows/vs2022/include/openssl/mdc2.h +55 -0
  377. package/vendor/zsign/build/windows/vs2022/include/openssl/modes.h +219 -0
  378. package/vendor/zsign/build/windows/vs2022/include/openssl/obj_mac.h +5820 -0
  379. package/vendor/zsign/build/windows/vs2022/include/openssl/objects.h +184 -0
  380. package/vendor/zsign/build/windows/vs2022/include/openssl/objectserr.h +28 -0
  381. package/vendor/zsign/build/windows/vs2022/include/openssl/ocsp.h +483 -0
  382. package/vendor/zsign/build/windows/vs2022/include/openssl/ocsperr.h +53 -0
  383. package/vendor/zsign/build/windows/vs2022/include/openssl/opensslconf.h +17 -0
  384. package/vendor/zsign/build/windows/vs2022/include/openssl/opensslv.h +114 -0
  385. package/vendor/zsign/build/windows/vs2022/include/openssl/ossl_typ.h +16 -0
  386. package/vendor/zsign/build/windows/vs2022/include/openssl/param_build.h +63 -0
  387. package/vendor/zsign/build/windows/vs2022/include/openssl/params.h +160 -0
  388. package/vendor/zsign/build/windows/vs2022/include/openssl/pem.h +543 -0
  389. package/vendor/zsign/build/windows/vs2022/include/openssl/pem2.h +19 -0
  390. package/vendor/zsign/build/windows/vs2022/include/openssl/pemerr.h +58 -0
  391. package/vendor/zsign/build/windows/vs2022/include/openssl/pkcs12.h +366 -0
  392. package/vendor/zsign/build/windows/vs2022/include/openssl/pkcs12err.h +46 -0
  393. package/vendor/zsign/build/windows/vs2022/include/openssl/pkcs7.h +430 -0
  394. package/vendor/zsign/build/windows/vs2022/include/openssl/pkcs7err.h +63 -0
  395. package/vendor/zsign/build/windows/vs2022/include/openssl/prov_ssl.h +38 -0
  396. package/vendor/zsign/build/windows/vs2022/include/openssl/proverr.h +162 -0
  397. package/vendor/zsign/build/windows/vs2022/include/openssl/provider.h +66 -0
  398. package/vendor/zsign/build/windows/vs2022/include/openssl/quic.h +70 -0
  399. package/vendor/zsign/build/windows/vs2022/include/openssl/rand.h +125 -0
  400. package/vendor/zsign/build/windows/vs2022/include/openssl/randerr.h +69 -0
  401. package/vendor/zsign/build/windows/vs2022/include/openssl/rc2.h +68 -0
  402. package/vendor/zsign/build/windows/vs2022/include/openssl/rc4.h +47 -0
  403. package/vendor/zsign/build/windows/vs2022/include/openssl/rc5.h +79 -0
  404. package/vendor/zsign/build/windows/vs2022/include/openssl/ripemd.h +59 -0
  405. package/vendor/zsign/build/windows/vs2022/include/openssl/rsa.h +615 -0
  406. package/vendor/zsign/build/windows/vs2022/include/openssl/rsaerr.h +107 -0
  407. package/vendor/zsign/build/windows/vs2022/include/openssl/safestack.h +297 -0
  408. package/vendor/zsign/build/windows/vs2022/include/openssl/seed.h +113 -0
  409. package/vendor/zsign/build/windows/vs2022/include/openssl/self_test.h +98 -0
  410. package/vendor/zsign/build/windows/vs2022/include/openssl/sha.h +139 -0
  411. package/vendor/zsign/build/windows/vs2022/include/openssl/srp.h +285 -0
  412. package/vendor/zsign/build/windows/vs2022/include/openssl/srtp.h +68 -0
  413. package/vendor/zsign/build/windows/vs2022/include/openssl/ssl.h +2878 -0
  414. package/vendor/zsign/build/windows/vs2022/include/openssl/ssl2.h +30 -0
  415. package/vendor/zsign/build/windows/vs2022/include/openssl/ssl3.h +357 -0
  416. package/vendor/zsign/build/windows/vs2022/include/openssl/sslerr.h +379 -0
  417. package/vendor/zsign/build/windows/vs2022/include/openssl/sslerr_legacy.h +467 -0
  418. package/vendor/zsign/build/windows/vs2022/include/openssl/stack.h +90 -0
  419. package/vendor/zsign/build/windows/vs2022/include/openssl/store.h +377 -0
  420. package/vendor/zsign/build/windows/vs2022/include/openssl/storeerr.h +49 -0
  421. package/vendor/zsign/build/windows/vs2022/include/openssl/symhacks.h +39 -0
  422. package/vendor/zsign/build/windows/vs2022/include/openssl/thread.h +31 -0
  423. package/vendor/zsign/build/windows/vs2022/include/openssl/tls1.h +1220 -0
  424. package/vendor/zsign/build/windows/vs2022/include/openssl/trace.h +320 -0
  425. package/vendor/zsign/build/windows/vs2022/include/openssl/ts.h +522 -0
  426. package/vendor/zsign/build/windows/vs2022/include/openssl/tserr.h +67 -0
  427. package/vendor/zsign/build/windows/vs2022/include/openssl/txt_db.h +63 -0
  428. package/vendor/zsign/build/windows/vs2022/include/openssl/types.h +245 -0
  429. package/vendor/zsign/build/windows/vs2022/include/openssl/ui.h +407 -0
  430. package/vendor/zsign/build/windows/vs2022/include/openssl/uierr.h +38 -0
  431. package/vendor/zsign/build/windows/vs2022/include/openssl/whrlpool.h +62 -0
  432. package/vendor/zsign/build/windows/vs2022/include/openssl/x509.h +1304 -0
  433. package/vendor/zsign/build/windows/vs2022/include/openssl/x509_acert.h +263 -0
  434. package/vendor/zsign/build/windows/vs2022/include/openssl/x509_vfy.h +902 -0
  435. package/vendor/zsign/build/windows/vs2022/include/openssl/x509err.h +70 -0
  436. package/vendor/zsign/build/windows/vs2022/include/openssl/x509v3.h +1500 -0
  437. package/vendor/zsign/build/windows/vs2022/include/openssl/x509v3err.h +96 -0
  438. package/vendor/zsign/build/windows/vs2022/include/zlib/zconf.h +553 -0
  439. package/vendor/zsign/build/windows/vs2022/include/zlib/zlib.h +1938 -0
  440. package/vendor/zsign/build/windows/vs2022/lib/minizip/x64/mt/minizip.lib +0 -0
  441. package/vendor/zsign/build/windows/vs2022/lib/openssl/x64/mt/libcrypto.lib +0 -0
  442. package/vendor/zsign/build/windows/vs2022/lib/openssl/x64/mt/libssl.lib +0 -0
  443. package/vendor/zsign/build/windows/vs2022/lib/zlib/x64/mt/zlib.lib +0 -0
  444. package/vendor/zsign/build/windows/vs2022/zsign/src/common_win32.h +44 -0
  445. package/vendor/zsign/build/windows/vs2022/zsign/src/getopt.cpp +69 -0
  446. package/vendor/zsign/build/windows/vs2022/zsign/src/getopt.h +20 -0
  447. package/vendor/zsign/build/windows/vs2022/zsign/src/iconv.cpp +138 -0
  448. package/vendor/zsign/build/windows/vs2022/zsign/src/iconv.h +38 -0
  449. package/vendor/zsign/build/windows/vs2022/zsign/zsign.vcxproj +177 -0
  450. package/vendor/zsign/build/windows/vs2022/zsign/zsign.vcxproj.filters +120 -0
  451. package/vendor/zsign/build/windows/vs2022/zsign.sln +28 -0
  452. package/vendor/zsign/src/archo.cpp +742 -0
  453. package/vendor/zsign/src/archo.h +61 -0
  454. package/vendor/zsign/src/bundle.cpp +589 -0
  455. package/vendor/zsign/src/bundle.h +46 -0
  456. package/vendor/zsign/src/common/archive.cpp +246 -0
  457. package/vendor/zsign/src/common/archive.h +22 -0
  458. package/vendor/zsign/src/common/base64.cpp +166 -0
  459. package/vendor/zsign/src/common/base64.h +30 -0
  460. package/vendor/zsign/src/common/common.h +56 -0
  461. package/vendor/zsign/src/common/fs.cpp +573 -0
  462. package/vendor/zsign/src/common/fs.h +50 -0
  463. package/vendor/zsign/src/common/json.cpp +3380 -0
  464. package/vendor/zsign/src/common/json.h +530 -0
  465. package/vendor/zsign/src/common/log.cpp +145 -0
  466. package/vendor/zsign/src/common/log.h +37 -0
  467. package/vendor/zsign/src/common/mach-o.h +585 -0
  468. package/vendor/zsign/src/common/sha.cpp +133 -0
  469. package/vendor/zsign/src/common/sha.h +24 -0
  470. package/vendor/zsign/src/common/timer.cpp +28 -0
  471. package/vendor/zsign/src/common/timer.h +17 -0
  472. package/vendor/zsign/src/common/util.cpp +185 -0
  473. package/vendor/zsign/src/common/util.h +25 -0
  474. package/vendor/zsign/src/macho.cpp +273 -0
  475. package/vendor/zsign/src/macho.h +38 -0
  476. package/vendor/zsign/src/openssl.cpp +698 -0
  477. package/vendor/zsign/src/openssl.h +71 -0
  478. package/vendor/zsign/src/signing.cpp +745 -0
  479. package/vendor/zsign/src/signing.h +59 -0
  480. package/vendor/zsign/src/zsign.cpp +317 -0
  481. package/vendor/zsign/test/dylib/bin/demo1.dylib +0 -0
  482. package/vendor/zsign/test/dylib/bin/demo2.dylib +0 -0
  483. package/vendor/zsign/test/dylib/demo/Makefile +12 -0
  484. package/vendor/zsign/test/dylib/demo/control +9 -0
  485. package/vendor/zsign/test/dylib/demo/demo.m +21 -0
  486. package/vendor/zsign/test/linux/test.sh +19 -0
  487. package/vendor/zsign/test/macos/test.sh +19 -0
  488. package/vendor/zsign/test/windows/test.ps1 +17 -0
@@ -0,0 +1,301 @@
1
+ //
2
+ // � Copyright Henrik Ravn 2004
3
+ //
4
+ // Use, modification and distribution are subject to the Boost Software License, Version 1.0.
5
+ // (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6
+ //
7
+
8
+ using System;
9
+ using System.IO;
10
+ using System.Runtime.InteropServices;
11
+
12
+ namespace DotZLib
13
+ {
14
+ /// <summary>
15
+ /// Implements a compressed <see cref="Stream"/>, in GZip (.gz) format.
16
+ /// </summary>
17
+ public class GZipStream : Stream, IDisposable
18
+ {
19
+ #region Dll Imports
20
+ [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)]
21
+ private static extern IntPtr gzopen(string name, string mode);
22
+
23
+ [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)]
24
+ private static extern int gzclose(IntPtr gzFile);
25
+
26
+ [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)]
27
+ private static extern int gzwrite(IntPtr gzFile, int data, int length);
28
+
29
+ [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)]
30
+ private static extern int gzread(IntPtr gzFile, int data, int length);
31
+
32
+ [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)]
33
+ private static extern int gzgetc(IntPtr gzFile);
34
+
35
+ [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)]
36
+ private static extern int gzputc(IntPtr gzFile, int c);
37
+
38
+ #endregion
39
+
40
+ #region Private data
41
+ private IntPtr _gzFile;
42
+ private bool _isDisposed = false;
43
+ private bool _isWriting;
44
+ #endregion
45
+
46
+ #region Constructors
47
+ /// <summary>
48
+ /// Creates a new file as a writeable GZipStream
49
+ /// </summary>
50
+ /// <param name="fileName">The name of the compressed file to create</param>
51
+ /// <param name="level">The compression level to use when adding data</param>
52
+ /// <exception cref="ZLibException">If an error occurred in the internal zlib function</exception>
53
+ public GZipStream(string fileName, CompressLevel level)
54
+ {
55
+ _isWriting = true;
56
+ _gzFile = gzopen(fileName, String.Format("wb{0}", (int)level));
57
+ if (_gzFile == IntPtr.Zero)
58
+ throw new ZLibException(-1, "Could not open " + fileName);
59
+ }
60
+
61
+ /// <summary>
62
+ /// Opens an existing file as a readable GZipStream
63
+ /// </summary>
64
+ /// <param name="fileName">The name of the file to open</param>
65
+ /// <exception cref="ZLibException">If an error occurred in the internal zlib function</exception>
66
+ public GZipStream(string fileName)
67
+ {
68
+ _isWriting = false;
69
+ _gzFile = gzopen(fileName, "rb");
70
+ if (_gzFile == IntPtr.Zero)
71
+ throw new ZLibException(-1, "Could not open " + fileName);
72
+
73
+ }
74
+ #endregion
75
+
76
+ #region Access properties
77
+ /// <summary>
78
+ /// Returns true of this stream can be read from, false otherwise
79
+ /// </summary>
80
+ public override bool CanRead
81
+ {
82
+ get
83
+ {
84
+ return !_isWriting;
85
+ }
86
+ }
87
+
88
+
89
+ /// <summary>
90
+ /// Returns false.
91
+ /// </summary>
92
+ public override bool CanSeek
93
+ {
94
+ get
95
+ {
96
+ return false;
97
+ }
98
+ }
99
+
100
+ /// <summary>
101
+ /// Returns true if this tsream is writeable, false otherwise
102
+ /// </summary>
103
+ public override bool CanWrite
104
+ {
105
+ get
106
+ {
107
+ return _isWriting;
108
+ }
109
+ }
110
+ #endregion
111
+
112
+ #region Destructor & IDispose stuff
113
+
114
+ /// <summary>
115
+ /// Destroys this instance
116
+ /// </summary>
117
+ ~GZipStream()
118
+ {
119
+ cleanUp(false);
120
+ }
121
+
122
+ /// <summary>
123
+ /// Closes the external file handle
124
+ /// </summary>
125
+ public void Dispose()
126
+ {
127
+ cleanUp(true);
128
+ }
129
+
130
+ // Does the actual closing of the file handle.
131
+ private void cleanUp(bool isDisposing)
132
+ {
133
+ if (!_isDisposed)
134
+ {
135
+ gzclose(_gzFile);
136
+ _isDisposed = true;
137
+ }
138
+ }
139
+ #endregion
140
+
141
+ #region Basic reading and writing
142
+ /// <summary>
143
+ /// Attempts to read a number of bytes from the stream.
144
+ /// </summary>
145
+ /// <param name="buffer">The destination data buffer</param>
146
+ /// <param name="offset">The index of the first destination byte in <c>buffer</c></param>
147
+ /// <param name="count">The number of bytes requested</param>
148
+ /// <returns>The number of bytes read</returns>
149
+ /// <exception cref="ArgumentNullException">If <c>buffer</c> is null</exception>
150
+ /// <exception cref="ArgumentOutOfRangeException">If <c>count</c> or <c>offset</c> are negative</exception>
151
+ /// <exception cref="ArgumentException">If <c>offset</c> + <c>count</c> is &gt; buffer.Length</exception>
152
+ /// <exception cref="NotSupportedException">If this stream is not readable.</exception>
153
+ /// <exception cref="ObjectDisposedException">If this stream has been disposed.</exception>
154
+ public override int Read(byte[] buffer, int offset, int count)
155
+ {
156
+ if (!CanRead) throw new NotSupportedException();
157
+ if (buffer == null) throw new ArgumentNullException();
158
+ if (offset < 0 || count < 0) throw new ArgumentOutOfRangeException();
159
+ if ((offset+count) > buffer.Length) throw new ArgumentException();
160
+ if (_isDisposed) throw new ObjectDisposedException("GZipStream");
161
+
162
+ GCHandle h = GCHandle.Alloc(buffer, GCHandleType.Pinned);
163
+ int result;
164
+ try
165
+ {
166
+ result = gzread(_gzFile, h.AddrOfPinnedObject().ToInt32() + offset, count);
167
+ if (result < 0)
168
+ throw new IOException();
169
+ }
170
+ finally
171
+ {
172
+ h.Free();
173
+ }
174
+ return result;
175
+ }
176
+
177
+ /// <summary>
178
+ /// Attempts to read a single byte from the stream.
179
+ /// </summary>
180
+ /// <returns>The byte that was read, or -1 in case of error or End-Of-File</returns>
181
+ public override int ReadByte()
182
+ {
183
+ if (!CanRead) throw new NotSupportedException();
184
+ if (_isDisposed) throw new ObjectDisposedException("GZipStream");
185
+ return gzgetc(_gzFile);
186
+ }
187
+
188
+ /// <summary>
189
+ /// Writes a number of bytes to the stream
190
+ /// </summary>
191
+ /// <param name="buffer"></param>
192
+ /// <param name="offset"></param>
193
+ /// <param name="count"></param>
194
+ /// <exception cref="ArgumentNullException">If <c>buffer</c> is null</exception>
195
+ /// <exception cref="ArgumentOutOfRangeException">If <c>count</c> or <c>offset</c> are negative</exception>
196
+ /// <exception cref="ArgumentException">If <c>offset</c> + <c>count</c> is &gt; buffer.Length</exception>
197
+ /// <exception cref="NotSupportedException">If this stream is not writeable.</exception>
198
+ /// <exception cref="ObjectDisposedException">If this stream has been disposed.</exception>
199
+ public override void Write(byte[] buffer, int offset, int count)
200
+ {
201
+ if (!CanWrite) throw new NotSupportedException();
202
+ if (buffer == null) throw new ArgumentNullException();
203
+ if (offset < 0 || count < 0) throw new ArgumentOutOfRangeException();
204
+ if ((offset+count) > buffer.Length) throw new ArgumentException();
205
+ if (_isDisposed) throw new ObjectDisposedException("GZipStream");
206
+
207
+ GCHandle h = GCHandle.Alloc(buffer, GCHandleType.Pinned);
208
+ try
209
+ {
210
+ int result = gzwrite(_gzFile, h.AddrOfPinnedObject().ToInt32() + offset, count);
211
+ if (result < 0)
212
+ throw new IOException();
213
+ }
214
+ finally
215
+ {
216
+ h.Free();
217
+ }
218
+ }
219
+
220
+ /// <summary>
221
+ /// Writes a single byte to the stream
222
+ /// </summary>
223
+ /// <param name="value">The byte to add to the stream.</param>
224
+ /// <exception cref="NotSupportedException">If this stream is not writeable.</exception>
225
+ /// <exception cref="ObjectDisposedException">If this stream has been disposed.</exception>
226
+ public override void WriteByte(byte value)
227
+ {
228
+ if (!CanWrite) throw new NotSupportedException();
229
+ if (_isDisposed) throw new ObjectDisposedException("GZipStream");
230
+
231
+ int result = gzputc(_gzFile, (int)value);
232
+ if (result < 0)
233
+ throw new IOException();
234
+ }
235
+ #endregion
236
+
237
+ #region Position & length stuff
238
+ /// <summary>
239
+ /// Not supported.
240
+ /// </summary>
241
+ /// <param name="value"></param>
242
+ /// <exception cref="NotSupportedException">Always thrown</exception>
243
+ public override void SetLength(long value)
244
+ {
245
+ throw new NotSupportedException();
246
+ }
247
+
248
+ /// <summary>
249
+ /// Not supported.
250
+ /// </summary>
251
+ /// <param name="offset"></param>
252
+ /// <param name="origin"></param>
253
+ /// <returns></returns>
254
+ /// <exception cref="NotSupportedException">Always thrown</exception>
255
+ public override long Seek(long offset, SeekOrigin origin)
256
+ {
257
+ throw new NotSupportedException();
258
+ }
259
+
260
+ /// <summary>
261
+ /// Flushes the <c>GZipStream</c>.
262
+ /// </summary>
263
+ /// <remarks>In this implementation, this method does nothing. This is because excessive
264
+ /// flushing may degrade the achievable compression rates.</remarks>
265
+ public override void Flush()
266
+ {
267
+ // left empty on purpose
268
+ }
269
+
270
+ /// <summary>
271
+ /// Gets/sets the current position in the <c>GZipStream</c>. Not supported.
272
+ /// </summary>
273
+ /// <remarks>In this implementation this property is not supported</remarks>
274
+ /// <exception cref="NotSupportedException">Always thrown</exception>
275
+ public override long Position
276
+ {
277
+ get
278
+ {
279
+ throw new NotSupportedException();
280
+ }
281
+ set
282
+ {
283
+ throw new NotSupportedException();
284
+ }
285
+ }
286
+
287
+ /// <summary>
288
+ /// Gets the size of the stream. Not supported.
289
+ /// </summary>
290
+ /// <remarks>In this implementation this property is not supported</remarks>
291
+ /// <exception cref="NotSupportedException">Always thrown</exception>
292
+ public override long Length
293
+ {
294
+ get
295
+ {
296
+ throw new NotSupportedException();
297
+ }
298
+ }
299
+ #endregion
300
+ }
301
+ }
@@ -0,0 +1,105 @@
1
+ //
2
+ // � Copyright Henrik Ravn 2004
3
+ //
4
+ // Use, modification and distribution are subject to the Boost Software License, Version 1.0.
5
+ // (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6
+ //
7
+
8
+ using System;
9
+ using System.Diagnostics;
10
+ using System.Runtime.InteropServices;
11
+
12
+ namespace DotZLib
13
+ {
14
+
15
+ /// <summary>
16
+ /// Implements a data decompressor, using the inflate algorithm in the ZLib dll
17
+ /// </summary>
18
+ public class Inflater : CodecBase
19
+ {
20
+ #region Dll imports
21
+ [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl, CharSet=CharSet.Ansi)]
22
+ private static extern int inflateInit_(ref ZStream sz, string vs, int size);
23
+
24
+ [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)]
25
+ private static extern int inflate(ref ZStream sz, int flush);
26
+
27
+ [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)]
28
+ private static extern int inflateReset(ref ZStream sz);
29
+
30
+ [DllImport("ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)]
31
+ private static extern int inflateEnd(ref ZStream sz);
32
+ #endregion
33
+
34
+ /// <summary>
35
+ /// Constructs an new instance of the <c>Inflater</c>
36
+ /// </summary>
37
+ public Inflater() : base()
38
+ {
39
+ int retval = inflateInit_(ref _ztream, Info.Version, Marshal.SizeOf(_ztream));
40
+ if (retval != 0)
41
+ throw new ZLibException(retval, "Could not initialize inflater");
42
+
43
+ resetOutput();
44
+ }
45
+
46
+
47
+ /// <summary>
48
+ /// Adds more data to the codec to be processed.
49
+ /// </summary>
50
+ /// <param name="data">Byte array containing the data to be added to the codec</param>
51
+ /// <param name="offset">The index of the first byte to add from <c>data</c></param>
52
+ /// <param name="count">The number of bytes to add</param>
53
+ /// <remarks>Adding data may, or may not, raise the <c>DataAvailable</c> event</remarks>
54
+ public override void Add(byte[] data, int offset, int count)
55
+ {
56
+ if (data == null) throw new ArgumentNullException();
57
+ if (offset < 0 || count < 0) throw new ArgumentOutOfRangeException();
58
+ if ((offset+count) > data.Length) throw new ArgumentException();
59
+
60
+ int total = count;
61
+ int inputIndex = offset;
62
+ int err = 0;
63
+
64
+ while (err >= 0 && inputIndex < total)
65
+ {
66
+ copyInput(data, inputIndex, Math.Min(total - inputIndex, kBufferSize));
67
+ err = inflate(ref _ztream, (int)FlushTypes.None);
68
+ if (err == 0)
69
+ while (_ztream.avail_out == 0)
70
+ {
71
+ OnDataAvailable();
72
+ err = inflate(ref _ztream, (int)FlushTypes.None);
73
+ }
74
+
75
+ inputIndex += (int)_ztream.total_in;
76
+ }
77
+ setChecksum( _ztream.adler );
78
+ }
79
+
80
+
81
+ /// <summary>
82
+ /// Finishes up any pending data that needs to be processed and handled.
83
+ /// </summary>
84
+ public override void Finish()
85
+ {
86
+ int err;
87
+ do
88
+ {
89
+ err = inflate(ref _ztream, (int)FlushTypes.Finish);
90
+ OnDataAvailable();
91
+ }
92
+ while (err == 0);
93
+ setChecksum( _ztream.adler );
94
+ inflateReset(ref _ztream);
95
+ resetOutput();
96
+ }
97
+
98
+ /// <summary>
99
+ /// Closes the internal zlib inflate stream
100
+ /// </summary>
101
+ protected override void CleanUp() { inflateEnd(ref _ztream); }
102
+
103
+
104
+ }
105
+ }
@@ -0,0 +1,274 @@
1
+ //
2
+ // © Copyright Henrik Ravn 2004
3
+ //
4
+ // Use, modification and distribution are subject to the Boost Software License, Version 1.0.
5
+ // (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6
+ //
7
+
8
+ using System;
9
+ using System.Collections;
10
+ using System.IO;
11
+
12
+ // uncomment the define below to include unit tests
13
+ //#define nunit
14
+ #if nunit
15
+ using NUnit.Framework;
16
+
17
+ // Unit tests for the DotZLib class library
18
+ // ----------------------------------------
19
+ //
20
+ // Use this with NUnit 2 from http://www.nunit.org
21
+ //
22
+
23
+ namespace DotZLibTests
24
+ {
25
+ using DotZLib;
26
+
27
+ // helper methods
28
+ internal class Utils
29
+ {
30
+ public static bool byteArrEqual( byte[] lhs, byte[] rhs )
31
+ {
32
+ if (lhs.Length != rhs.Length)
33
+ return false;
34
+ for (int i = lhs.Length-1; i >= 0; --i)
35
+ if (lhs[i] != rhs[i])
36
+ return false;
37
+ return true;
38
+ }
39
+
40
+ }
41
+
42
+
43
+ [TestFixture]
44
+ public class CircBufferTests
45
+ {
46
+ #region Circular buffer tests
47
+ [Test]
48
+ public void SinglePutGet()
49
+ {
50
+ CircularBuffer buf = new CircularBuffer(10);
51
+ Assert.AreEqual( 0, buf.Size );
52
+ Assert.AreEqual( -1, buf.Get() );
53
+
54
+ Assert.IsTrue(buf.Put( 1 ));
55
+ Assert.AreEqual( 1, buf.Size );
56
+ Assert.AreEqual( 1, buf.Get() );
57
+ Assert.AreEqual( 0, buf.Size );
58
+ Assert.AreEqual( -1, buf.Get() );
59
+ }
60
+
61
+ [Test]
62
+ public void BlockPutGet()
63
+ {
64
+ CircularBuffer buf = new CircularBuffer(10);
65
+ byte[] arr = {1,2,3,4,5,6,7,8,9,10};
66
+ Assert.AreEqual( 10, buf.Put(arr,0,10) );
67
+ Assert.AreEqual( 10, buf.Size );
68
+ Assert.IsFalse( buf.Put(11) );
69
+ Assert.AreEqual( 1, buf.Get() );
70
+ Assert.IsTrue( buf.Put(11) );
71
+
72
+ byte[] arr2 = (byte[])arr.Clone();
73
+ Assert.AreEqual( 9, buf.Get(arr2,1,9) );
74
+ Assert.IsTrue( Utils.byteArrEqual(arr,arr2) );
75
+ }
76
+
77
+ #endregion
78
+ }
79
+
80
+ [TestFixture]
81
+ public class ChecksumTests
82
+ {
83
+ #region CRC32 Tests
84
+ [Test]
85
+ public void CRC32_Null()
86
+ {
87
+ CRC32Checksum crc32 = new CRC32Checksum();
88
+ Assert.AreEqual( 0, crc32.Value );
89
+
90
+ crc32 = new CRC32Checksum(1);
91
+ Assert.AreEqual( 1, crc32.Value );
92
+
93
+ crc32 = new CRC32Checksum(556);
94
+ Assert.AreEqual( 556, crc32.Value );
95
+ }
96
+
97
+ [Test]
98
+ public void CRC32_Data()
99
+ {
100
+ CRC32Checksum crc32 = new CRC32Checksum();
101
+ byte[] data = { 1,2,3,4,5,6,7 };
102
+ crc32.Update(data);
103
+ Assert.AreEqual( 0x70e46888, crc32.Value );
104
+
105
+ crc32 = new CRC32Checksum();
106
+ crc32.Update("penguin");
107
+ Assert.AreEqual( 0x0e5c1a120, crc32.Value );
108
+
109
+ crc32 = new CRC32Checksum(1);
110
+ crc32.Update("penguin");
111
+ Assert.AreEqual(0x43b6aa94, crc32.Value);
112
+
113
+ }
114
+ #endregion
115
+
116
+ #region Adler tests
117
+
118
+ [Test]
119
+ public void Adler_Null()
120
+ {
121
+ AdlerChecksum adler = new AdlerChecksum();
122
+ Assert.AreEqual(0, adler.Value);
123
+
124
+ adler = new AdlerChecksum(1);
125
+ Assert.AreEqual( 1, adler.Value );
126
+
127
+ adler = new AdlerChecksum(556);
128
+ Assert.AreEqual( 556, adler.Value );
129
+ }
130
+
131
+ [Test]
132
+ public void Adler_Data()
133
+ {
134
+ AdlerChecksum adler = new AdlerChecksum(1);
135
+ byte[] data = { 1,2,3,4,5,6,7 };
136
+ adler.Update(data);
137
+ Assert.AreEqual( 0x5b001d, adler.Value );
138
+
139
+ adler = new AdlerChecksum();
140
+ adler.Update("penguin");
141
+ Assert.AreEqual(0x0bcf02f6, adler.Value );
142
+
143
+ adler = new AdlerChecksum(1);
144
+ adler.Update("penguin");
145
+ Assert.AreEqual(0x0bd602f7, adler.Value);
146
+
147
+ }
148
+ #endregion
149
+ }
150
+
151
+ [TestFixture]
152
+ public class InfoTests
153
+ {
154
+ #region Info tests
155
+ [Test]
156
+ public void Info_Version()
157
+ {
158
+ Info info = new Info();
159
+ Assert.AreEqual("1.3.1.1", Info.Version);
160
+ Assert.AreEqual(32, info.SizeOfUInt);
161
+ Assert.AreEqual(32, info.SizeOfULong);
162
+ Assert.AreEqual(32, info.SizeOfPointer);
163
+ Assert.AreEqual(32, info.SizeOfOffset);
164
+ }
165
+ #endregion
166
+ }
167
+
168
+ [TestFixture]
169
+ public class DeflateInflateTests
170
+ {
171
+ #region Deflate tests
172
+ [Test]
173
+ public void Deflate_Init()
174
+ {
175
+ using (Deflater def = new Deflater(CompressLevel.Default))
176
+ {
177
+ }
178
+ }
179
+
180
+ private ArrayList compressedData = new ArrayList();
181
+ private uint adler1;
182
+
183
+ private ArrayList uncompressedData = new ArrayList();
184
+ private uint adler2;
185
+
186
+ public void CDataAvail(byte[] data, int startIndex, int count)
187
+ {
188
+ for (int i = 0; i < count; ++i)
189
+ compressedData.Add(data[i+startIndex]);
190
+ }
191
+
192
+ [Test]
193
+ public void Deflate_Compress()
194
+ {
195
+ compressedData.Clear();
196
+
197
+ byte[] testData = new byte[35000];
198
+ for (int i = 0; i < testData.Length; ++i)
199
+ testData[i] = 5;
200
+
201
+ using (Deflater def = new Deflater((CompressLevel)5))
202
+ {
203
+ def.DataAvailable += new DataAvailableHandler(CDataAvail);
204
+ def.Add(testData);
205
+ def.Finish();
206
+ adler1 = def.Checksum;
207
+ }
208
+ }
209
+ #endregion
210
+
211
+ #region Inflate tests
212
+ [Test]
213
+ public void Inflate_Init()
214
+ {
215
+ using (Inflater inf = new Inflater())
216
+ {
217
+ }
218
+ }
219
+
220
+ private void DDataAvail(byte[] data, int startIndex, int count)
221
+ {
222
+ for (int i = 0; i < count; ++i)
223
+ uncompressedData.Add(data[i+startIndex]);
224
+ }
225
+
226
+ [Test]
227
+ public void Inflate_Expand()
228
+ {
229
+ uncompressedData.Clear();
230
+
231
+ using (Inflater inf = new Inflater())
232
+ {
233
+ inf.DataAvailable += new DataAvailableHandler(DDataAvail);
234
+ inf.Add((byte[])compressedData.ToArray(typeof(byte)));
235
+ inf.Finish();
236
+ adler2 = inf.Checksum;
237
+ }
238
+ Assert.AreEqual( adler1, adler2 );
239
+ }
240
+ #endregion
241
+ }
242
+
243
+ [TestFixture]
244
+ public class GZipStreamTests
245
+ {
246
+ #region GZipStream test
247
+ [Test]
248
+ public void GZipStream_WriteRead()
249
+ {
250
+ using (GZipStream gzOut = new GZipStream("gzstream.gz", CompressLevel.Best))
251
+ {
252
+ BinaryWriter writer = new BinaryWriter(gzOut);
253
+ writer.Write("hi there");
254
+ writer.Write(Math.PI);
255
+ writer.Write(42);
256
+ }
257
+
258
+ using (GZipStream gzIn = new GZipStream("gzstream.gz"))
259
+ {
260
+ BinaryReader reader = new BinaryReader(gzIn);
261
+ string s = reader.ReadString();
262
+ Assert.AreEqual("hi there",s);
263
+ double d = reader.ReadDouble();
264
+ Assert.AreEqual(Math.PI, d);
265
+ int i = reader.ReadInt32();
266
+ Assert.AreEqual(42,i);
267
+ }
268
+
269
+ }
270
+ #endregion
271
+ }
272
+ }
273
+
274
+ #endif