hane 1.1.1 → 1.2.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 (379) hide show
  1. package/README.md +32 -32
  2. package/binding.gyp +50 -50
  3. package/deps/win-nodeapi/node_api.def +158 -158
  4. package/package.json +34 -34
  5. package/src/native/addon.cc +183 -183
  6. package/src/native/zsign_driver.cc +86 -86
  7. package/src/native/zsign_driver.h +38 -38
  8. package/vendor/zlib/.cmake-format.yaml +245 -245
  9. package/vendor/zlib/.github/workflows/c-std.yml +230 -230
  10. package/vendor/zlib/.github/workflows/cmake.yml +112 -112
  11. package/vendor/zlib/.github/workflows/configure.yml +136 -136
  12. package/vendor/zlib/.github/workflows/fuzz.yml +25 -25
  13. package/vendor/zlib/.github/workflows/msys-cygwin.yml +77 -77
  14. package/vendor/zlib/BUILD.bazel +134 -134
  15. package/vendor/zlib/CMakeLists.txt +330 -330
  16. package/vendor/zlib/ChangeLog +1621 -1621
  17. package/vendor/zlib/FAQ +367 -367
  18. package/vendor/zlib/INDEX +68 -68
  19. package/vendor/zlib/LICENSE +22 -22
  20. package/vendor/zlib/MODULE.bazel +9 -9
  21. package/vendor/zlib/Makefile.in +419 -419
  22. package/vendor/zlib/README +115 -115
  23. package/vendor/zlib/README-cmake.md +83 -83
  24. package/vendor/zlib/adler32.c +164 -164
  25. package/vendor/zlib/amiga/Makefile.pup +69 -69
  26. package/vendor/zlib/amiga/Makefile.sas +68 -68
  27. package/vendor/zlib/compress.c +75 -75
  28. package/vendor/zlib/configure +966 -966
  29. package/vendor/zlib/contrib/README.contrib +57 -57
  30. package/vendor/zlib/contrib/ada/buffer_demo.adb +106 -106
  31. package/vendor/zlib/contrib/ada/mtest.adb +156 -156
  32. package/vendor/zlib/contrib/ada/read.adb +156 -156
  33. package/vendor/zlib/contrib/ada/readme.txt +65 -65
  34. package/vendor/zlib/contrib/ada/test.adb +463 -463
  35. package/vendor/zlib/contrib/ada/zlib-streams.adb +225 -225
  36. package/vendor/zlib/contrib/ada/zlib-streams.ads +114 -114
  37. package/vendor/zlib/contrib/ada/zlib-thin.adb +142 -142
  38. package/vendor/zlib/contrib/ada/zlib-thin.ads +450 -450
  39. package/vendor/zlib/contrib/ada/zlib.adb +701 -701
  40. package/vendor/zlib/contrib/ada/zlib.ads +328 -328
  41. package/vendor/zlib/contrib/ada/zlib.gpr +20 -20
  42. package/vendor/zlib/contrib/blast/Makefile +8 -8
  43. package/vendor/zlib/contrib/blast/README +4 -4
  44. package/vendor/zlib/contrib/blast/blast.c +466 -466
  45. package/vendor/zlib/contrib/blast/blast.h +83 -83
  46. package/vendor/zlib/contrib/delphi/ZLib.pas +557 -557
  47. package/vendor/zlib/contrib/delphi/ZLibConst.pas +11 -11
  48. package/vendor/zlib/contrib/delphi/readme.txt +76 -76
  49. package/vendor/zlib/contrib/delphi/zlibd32.mak +99 -99
  50. package/vendor/zlib/contrib/gcc_gvmat64/gvmat64.S +574 -574
  51. package/vendor/zlib/contrib/infback9/README +1 -1
  52. package/vendor/zlib/contrib/infback9/infback9.c +603 -603
  53. package/vendor/zlib/contrib/infback9/infback9.h +37 -37
  54. package/vendor/zlib/contrib/infback9/inffix9.h +107 -107
  55. package/vendor/zlib/contrib/infback9/inflate9.h +47 -47
  56. package/vendor/zlib/contrib/infback9/inftree9.c +319 -319
  57. package/vendor/zlib/contrib/infback9/inftree9.h +61 -61
  58. package/vendor/zlib/contrib/iostream/test.cpp +24 -24
  59. package/vendor/zlib/contrib/iostream/zfstream.cpp +329 -329
  60. package/vendor/zlib/contrib/iostream/zfstream.h +128 -128
  61. package/vendor/zlib/contrib/iostream2/zstream.h +307 -307
  62. package/vendor/zlib/contrib/iostream2/zstream_test.cpp +25 -25
  63. package/vendor/zlib/contrib/iostream3/README +35 -35
  64. package/vendor/zlib/contrib/iostream3/TODO +17 -17
  65. package/vendor/zlib/contrib/iostream3/test.cc +50 -50
  66. package/vendor/zlib/contrib/iostream3/zfstream.cc +479 -479
  67. package/vendor/zlib/contrib/iostream3/zfstream.h +466 -466
  68. package/vendor/zlib/contrib/minizip/CMakeLists.txt +380 -380
  69. package/vendor/zlib/contrib/minizip/Makefile +37 -37
  70. package/vendor/zlib/contrib/minizip/Makefile.am +45 -45
  71. package/vendor/zlib/contrib/minizip/MiniZip64_Changes.txt +6 -6
  72. package/vendor/zlib/contrib/minizip/MiniZip64_info.txt +74 -74
  73. package/vendor/zlib/contrib/minizip/configure.ac +32 -32
  74. package/vendor/zlib/contrib/minizip/crypt.h +128 -128
  75. package/vendor/zlib/contrib/minizip/ints.h +57 -57
  76. package/vendor/zlib/contrib/minizip/ioapi.c +231 -231
  77. package/vendor/zlib/contrib/minizip/ioapi.h +183 -183
  78. package/vendor/zlib/contrib/minizip/iowin32.c +448 -448
  79. package/vendor/zlib/contrib/minizip/iowin32.h +28 -28
  80. package/vendor/zlib/contrib/minizip/make_vms.com +25 -25
  81. package/vendor/zlib/contrib/minizip/miniunz.c +647 -647
  82. package/vendor/zlib/contrib/minizip/miniunzip.1 +63 -63
  83. package/vendor/zlib/contrib/minizip/minizip.1 +46 -46
  84. package/vendor/zlib/contrib/minizip/minizip.c +512 -512
  85. package/vendor/zlib/contrib/minizip/minizip.pc.in +12 -12
  86. package/vendor/zlib/contrib/minizip/minizip.pc.txt +13 -13
  87. package/vendor/zlib/contrib/minizip/minizipConfig.cmake.in +35 -35
  88. package/vendor/zlib/contrib/minizip/mztools.c +288 -288
  89. package/vendor/zlib/contrib/minizip/mztools.h +37 -37
  90. package/vendor/zlib/contrib/minizip/skipset.h +361 -361
  91. package/vendor/zlib/contrib/minizip/test/CMakeLists.txt +121 -121
  92. package/vendor/zlib/contrib/minizip/test/add_subdirectory_exclude_test.cmake.in +29 -29
  93. package/vendor/zlib/contrib/minizip/test/add_subdirectory_test.cmake.in +28 -28
  94. package/vendor/zlib/contrib/minizip/test/find_package_test.cmake.in +25 -25
  95. package/vendor/zlib/contrib/minizip/test/test_helper.cm +32 -32
  96. package/vendor/zlib/contrib/minizip/unzip.c +1981 -1981
  97. package/vendor/zlib/contrib/minizip/unzip.h +441 -441
  98. package/vendor/zlib/contrib/minizip/zip.c +2199 -2199
  99. package/vendor/zlib/contrib/minizip/zip.h +370 -370
  100. package/vendor/zlib/contrib/nuget/nuget.csproj +43 -43
  101. package/vendor/zlib/contrib/nuget/nuget.sln +22 -22
  102. package/vendor/zlib/contrib/pascal/example.pas +599 -599
  103. package/vendor/zlib/contrib/pascal/readme.txt +76 -76
  104. package/vendor/zlib/contrib/pascal/zlibd32.mak +99 -99
  105. package/vendor/zlib/contrib/pascal/zlibpas.pas +276 -276
  106. package/vendor/zlib/contrib/puff/Makefile +42 -42
  107. package/vendor/zlib/contrib/puff/README +63 -63
  108. package/vendor/zlib/contrib/puff/puff.c +840 -840
  109. package/vendor/zlib/contrib/puff/puff.h +35 -35
  110. package/vendor/zlib/contrib/puff/pufftest.c +169 -169
  111. package/vendor/zlib/contrib/untgz/Makefile +14 -14
  112. package/vendor/zlib/contrib/untgz/Makefile.msc +17 -17
  113. package/vendor/zlib/contrib/untgz/untgz.c +667 -667
  114. package/vendor/zlib/contrib/vstudio/readme.txt +81 -81
  115. package/vendor/zlib/contrib/vstudio/vc12/miniunz.vcxproj +315 -315
  116. package/vendor/zlib/contrib/vstudio/vc12/minizip.vcxproj +312 -312
  117. package/vendor/zlib/contrib/vstudio/vc12/testzlib.vcxproj +421 -421
  118. package/vendor/zlib/contrib/vstudio/vc12/testzlibdll.vcxproj +315 -315
  119. package/vendor/zlib/contrib/vstudio/vc12/zlib.rc +32 -32
  120. package/vendor/zlib/contrib/vstudio/vc12/zlibstat.vcxproj +458 -458
  121. package/vendor/zlib/contrib/vstudio/vc12/zlibvc.sln +119 -119
  122. package/vendor/zlib/contrib/vstudio/vc12/zlibvc.vcxproj +667 -667
  123. package/vendor/zlib/contrib/vstudio/vc14/miniunz.vcxproj +315 -315
  124. package/vendor/zlib/contrib/vstudio/vc14/minizip.vcxproj +312 -312
  125. package/vendor/zlib/contrib/vstudio/vc14/testzlib.vcxproj +421 -421
  126. package/vendor/zlib/contrib/vstudio/vc14/testzlibdll.vcxproj +315 -315
  127. package/vendor/zlib/contrib/vstudio/vc14/zlib.rc +32 -32
  128. package/vendor/zlib/contrib/vstudio/vc14/zlibstat.vcxproj +458 -458
  129. package/vendor/zlib/contrib/vstudio/vc14/zlibvc.sln +119 -119
  130. package/vendor/zlib/contrib/vstudio/vc14/zlibvc.vcxproj +667 -667
  131. package/vendor/zlib/contrib/vstudio/vc17/miniunz.vcxproj +408 -408
  132. package/vendor/zlib/contrib/vstudio/vc17/minizip.vcxproj +404 -404
  133. package/vendor/zlib/contrib/vstudio/vc17/testzlib.vcxproj +472 -472
  134. package/vendor/zlib/contrib/vstudio/vc17/testzlibdll.vcxproj +408 -408
  135. package/vendor/zlib/contrib/vstudio/vc17/zlib.rc +32 -32
  136. package/vendor/zlib/contrib/vstudio/vc17/zlibstat.vcxproj +601 -601
  137. package/vendor/zlib/contrib/vstudio/vc17/zlibvc.sln +179 -179
  138. package/vendor/zlib/contrib/vstudio/vc17/zlibvc.vcxproj +874 -874
  139. package/vendor/zlib/crc32.c +1049 -1049
  140. package/vendor/zlib/crc32.h +9446 -9446
  141. package/vendor/zlib/deflate.c +2152 -2152
  142. package/vendor/zlib/deflate.h +380 -380
  143. package/vendor/zlib/doc/algorithm.txt +209 -209
  144. package/vendor/zlib/doc/rfc1950.txt +619 -619
  145. package/vendor/zlib/doc/rfc1951.txt +955 -955
  146. package/vendor/zlib/doc/rfc1952.txt +675 -675
  147. package/vendor/zlib/doc/txtvsbin.txt +107 -107
  148. package/vendor/zlib/examples/README.examples +54 -54
  149. package/vendor/zlib/examples/enough.c +597 -597
  150. package/vendor/zlib/examples/fitblk.c +233 -233
  151. package/vendor/zlib/examples/gun.c +702 -702
  152. package/vendor/zlib/examples/gzappend.c +504 -504
  153. package/vendor/zlib/examples/gzjoin.c +449 -449
  154. package/vendor/zlib/examples/gzlog.c +1061 -1061
  155. package/vendor/zlib/examples/gzlog.h +91 -91
  156. package/vendor/zlib/examples/gznorm.c +474 -474
  157. package/vendor/zlib/examples/zlib_how.html +549 -549
  158. package/vendor/zlib/examples/zpipe.c +209 -209
  159. package/vendor/zlib/examples/zran.c +550 -550
  160. package/vendor/zlib/examples/zran.h +53 -53
  161. package/vendor/zlib/gzclose.c +23 -23
  162. package/vendor/zlib/gzguts.h +215 -215
  163. package/vendor/zlib/gzlib.c +585 -585
  164. package/vendor/zlib/gzread.c +603 -603
  165. package/vendor/zlib/gzwrite.c +631 -631
  166. package/vendor/zlib/infback.c +628 -628
  167. package/vendor/zlib/inffast.c +320 -320
  168. package/vendor/zlib/inffast.h +11 -11
  169. package/vendor/zlib/inffixed.h +94 -94
  170. package/vendor/zlib/inflate.c +1526 -1526
  171. package/vendor/zlib/inflate.h +126 -126
  172. package/vendor/zlib/inftrees.c +299 -299
  173. package/vendor/zlib/inftrees.h +62 -62
  174. package/vendor/zlib/make_vms.com +867 -867
  175. package/vendor/zlib/msdos/Makefile.bor +115 -115
  176. package/vendor/zlib/msdos/Makefile.dj2 +104 -104
  177. package/vendor/zlib/msdos/Makefile.emx +69 -69
  178. package/vendor/zlib/msdos/Makefile.msc +112 -112
  179. package/vendor/zlib/msdos/Makefile.tc +100 -100
  180. package/vendor/zlib/nintendods/Makefile +126 -126
  181. package/vendor/zlib/nintendods/README +5 -5
  182. package/vendor/zlib/old/Makefile.emx +69 -69
  183. package/vendor/zlib/old/Makefile.riscos +151 -151
  184. package/vendor/zlib/old/README +3 -3
  185. package/vendor/zlib/old/descrip.mms +48 -48
  186. package/vendor/zlib/old/os2/Makefile.os2 +136 -136
  187. package/vendor/zlib/old/os2/zlib.def +51 -51
  188. package/vendor/zlib/old/visual-basic.txt +160 -160
  189. package/vendor/zlib/os400/README400 +48 -48
  190. package/vendor/zlib/os400/bndsrc +133 -133
  191. package/vendor/zlib/os400/make.sh +366 -366
  192. package/vendor/zlib/os400/zlib.inc +531 -531
  193. package/vendor/zlib/qnx/package.qpg +141 -141
  194. package/vendor/zlib/test/CMakeLists.txt +265 -265
  195. package/vendor/zlib/test/add_subdirectory_exclude_test.cmake.in +29 -29
  196. package/vendor/zlib/test/add_subdirectory_test.cmake.in +28 -28
  197. package/vendor/zlib/test/example.c +552 -552
  198. package/vendor/zlib/test/find_package_test.cmake.in +26 -26
  199. package/vendor/zlib/test/infcover.c +672 -672
  200. package/vendor/zlib/test/minigzip.c +590 -590
  201. package/vendor/zlib/treebuild.xml +116 -116
  202. package/vendor/zlib/trees.c +1119 -1119
  203. package/vendor/zlib/trees.h +128 -128
  204. package/vendor/zlib/uncompr.c +85 -85
  205. package/vendor/zlib/watcom/watcom_f.mak +43 -43
  206. package/vendor/zlib/watcom/watcom_l.mak +43 -43
  207. package/vendor/zlib/win32/DLL_FAQ.txt +381 -381
  208. package/vendor/zlib/win32/Makefile.bor +109 -109
  209. package/vendor/zlib/win32/Makefile.gcc +177 -177
  210. package/vendor/zlib/win32/Makefile.msc +159 -159
  211. package/vendor/zlib/win32/README-WIN32.txt +103 -103
  212. package/vendor/zlib/win32/VisualC.txt +3 -3
  213. package/vendor/zlib/win32/zlib1.rc +37 -37
  214. package/vendor/zlib/zconf.h.in +544 -544
  215. package/vendor/zlib/zlib.3 +149 -149
  216. package/vendor/zlib/zlib.h +1957 -1957
  217. package/vendor/zlib/zlib.map +103 -103
  218. package/vendor/zlib/zlib.pc.cmakein +13 -13
  219. package/vendor/zlib/zlib.pc.in +13 -13
  220. package/vendor/zlib/zlibConfig.cmake.in +26 -26
  221. package/vendor/zlib/zutil.c +299 -299
  222. package/vendor/zlib/zutil.h +257 -257
  223. package/vendor/zsign/.gitattributes +3 -3
  224. package/vendor/zsign/LICENSE +20 -20
  225. package/vendor/zsign/README.md +142 -142
  226. package/vendor/zsign/build/linux/Makefile +43 -43
  227. package/vendor/zsign/build/macos/Makefile +43 -43
  228. package/vendor/zsign/build/windows/vs2022/include/minizip/crypt.h +128 -128
  229. package/vendor/zsign/build/windows/vs2022/include/minizip/ioapi.h +216 -216
  230. package/vendor/zsign/build/windows/vs2022/include/minizip/iowin32.h +28 -28
  231. package/vendor/zsign/build/windows/vs2022/include/minizip/mztools.h +37 -37
  232. package/vendor/zsign/build/windows/vs2022/include/minizip/unzip.h +437 -437
  233. package/vendor/zsign/build/windows/vs2022/include/minizip/zip.h +364 -364
  234. package/vendor/zsign/build/windows/vs2022/include/openssl/__DECC_INCLUDE_EPILOGUE.H +22 -22
  235. package/vendor/zsign/build/windows/vs2022/include/openssl/__DECC_INCLUDE_PROLOGUE.H +26 -26
  236. package/vendor/zsign/build/windows/vs2022/include/openssl/aes.h +111 -111
  237. package/vendor/zsign/build/windows/vs2022/include/openssl/applink.c +153 -153
  238. package/vendor/zsign/build/windows/vs2022/include/openssl/asn1_mac.h +10 -10
  239. package/vendor/zsign/build/windows/vs2022/include/openssl/asn1err.h +142 -142
  240. package/vendor/zsign/build/windows/vs2022/include/openssl/async.h +104 -104
  241. package/vendor/zsign/build/windows/vs2022/include/openssl/asyncerr.h +29 -29
  242. package/vendor/zsign/build/windows/vs2022/include/openssl/bioerr.h +72 -72
  243. package/vendor/zsign/build/windows/vs2022/include/openssl/blowfish.h +78 -78
  244. package/vendor/zsign/build/windows/vs2022/include/openssl/bn.h +590 -590
  245. package/vendor/zsign/build/windows/vs2022/include/openssl/bnerr.h +47 -47
  246. package/vendor/zsign/build/windows/vs2022/include/openssl/buffer.h +62 -62
  247. package/vendor/zsign/build/windows/vs2022/include/openssl/buffererr.h +25 -25
  248. package/vendor/zsign/build/windows/vs2022/include/openssl/camellia.h +117 -117
  249. package/vendor/zsign/build/windows/vs2022/include/openssl/cast.h +71 -71
  250. package/vendor/zsign/build/windows/vs2022/include/openssl/cmac.h +52 -52
  251. package/vendor/zsign/build/windows/vs2022/include/openssl/cmp_util.h +56 -56
  252. package/vendor/zsign/build/windows/vs2022/include/openssl/cmperr.h +131 -131
  253. package/vendor/zsign/build/windows/vs2022/include/openssl/cmserr.h +125 -125
  254. package/vendor/zsign/build/windows/vs2022/include/openssl/comperr.h +38 -38
  255. package/vendor/zsign/build/windows/vs2022/include/openssl/conf_api.h +46 -46
  256. package/vendor/zsign/build/windows/vs2022/include/openssl/conferr.h +52 -52
  257. package/vendor/zsign/build/windows/vs2022/include/openssl/conftypes.h +44 -44
  258. package/vendor/zsign/build/windows/vs2022/include/openssl/core.h +236 -236
  259. package/vendor/zsign/build/windows/vs2022/include/openssl/core_dispatch.h +1022 -1022
  260. package/vendor/zsign/build/windows/vs2022/include/openssl/core_object.h +41 -41
  261. package/vendor/zsign/build/windows/vs2022/include/openssl/crmferr.h +50 -50
  262. package/vendor/zsign/build/windows/vs2022/include/openssl/cryptoerr.h +56 -56
  263. package/vendor/zsign/build/windows/vs2022/include/openssl/cryptoerr_legacy.h +1466 -1466
  264. package/vendor/zsign/build/windows/vs2022/include/openssl/cterr.h +45 -45
  265. package/vendor/zsign/build/windows/vs2022/include/openssl/decoder.h +133 -133
  266. package/vendor/zsign/build/windows/vs2022/include/openssl/decodererr.h +28 -28
  267. package/vendor/zsign/build/windows/vs2022/include/openssl/des.h +211 -211
  268. package/vendor/zsign/build/windows/vs2022/include/openssl/dh.h +339 -339
  269. package/vendor/zsign/build/windows/vs2022/include/openssl/dherr.h +59 -59
  270. package/vendor/zsign/build/windows/vs2022/include/openssl/dsa.h +280 -280
  271. package/vendor/zsign/build/windows/vs2022/include/openssl/dsaerr.h +44 -44
  272. package/vendor/zsign/build/windows/vs2022/include/openssl/dtls1.h +57 -57
  273. package/vendor/zsign/build/windows/vs2022/include/openssl/e_os2.h +310 -310
  274. package/vendor/zsign/build/windows/vs2022/include/openssl/e_ostime.h +38 -38
  275. package/vendor/zsign/build/windows/vs2022/include/openssl/ebcdic.h +39 -39
  276. package/vendor/zsign/build/windows/vs2022/include/openssl/ec.h +1588 -1588
  277. package/vendor/zsign/build/windows/vs2022/include/openssl/ecdh.h +10 -10
  278. package/vendor/zsign/build/windows/vs2022/include/openssl/ecdsa.h +10 -10
  279. package/vendor/zsign/build/windows/vs2022/include/openssl/ecerr.h +104 -104
  280. package/vendor/zsign/build/windows/vs2022/include/openssl/encoder.h +124 -124
  281. package/vendor/zsign/build/windows/vs2022/include/openssl/encodererr.h +28 -28
  282. package/vendor/zsign/build/windows/vs2022/include/openssl/engine.h +833 -833
  283. package/vendor/zsign/build/windows/vs2022/include/openssl/engineerr.h +63 -63
  284. package/vendor/zsign/build/windows/vs2022/include/openssl/esserr.h +32 -32
  285. package/vendor/zsign/build/windows/vs2022/include/openssl/evp.h +2231 -2231
  286. package/vendor/zsign/build/windows/vs2022/include/openssl/evperr.h +140 -140
  287. package/vendor/zsign/build/windows/vs2022/include/openssl/fips_names.h +50 -50
  288. package/vendor/zsign/build/windows/vs2022/include/openssl/hmac.h +62 -62
  289. package/vendor/zsign/build/windows/vs2022/include/openssl/hpke.h +169 -169
  290. package/vendor/zsign/build/windows/vs2022/include/openssl/http.h +118 -118
  291. package/vendor/zsign/build/windows/vs2022/include/openssl/httperr.h +56 -56
  292. package/vendor/zsign/build/windows/vs2022/include/openssl/idea.h +82 -82
  293. package/vendor/zsign/build/windows/vs2022/include/openssl/indicator.h +31 -31
  294. package/vendor/zsign/build/windows/vs2022/include/openssl/kdf.h +138 -138
  295. package/vendor/zsign/build/windows/vs2022/include/openssl/kdferr.h +16 -16
  296. package/vendor/zsign/build/windows/vs2022/include/openssl/macros.h +338 -338
  297. package/vendor/zsign/build/windows/vs2022/include/openssl/md2.h +56 -56
  298. package/vendor/zsign/build/windows/vs2022/include/openssl/md4.h +63 -63
  299. package/vendor/zsign/build/windows/vs2022/include/openssl/md5.h +62 -62
  300. package/vendor/zsign/build/windows/vs2022/include/openssl/mdc2.h +55 -55
  301. package/vendor/zsign/build/windows/vs2022/include/openssl/modes.h +219 -219
  302. package/vendor/zsign/build/windows/vs2022/include/openssl/obj_mac.h +5820 -5820
  303. package/vendor/zsign/build/windows/vs2022/include/openssl/objects.h +184 -184
  304. package/vendor/zsign/build/windows/vs2022/include/openssl/objectserr.h +28 -28
  305. package/vendor/zsign/build/windows/vs2022/include/openssl/ocsperr.h +53 -53
  306. package/vendor/zsign/build/windows/vs2022/include/openssl/opensslconf.h +17 -17
  307. package/vendor/zsign/build/windows/vs2022/include/openssl/ossl_typ.h +16 -16
  308. package/vendor/zsign/build/windows/vs2022/include/openssl/param_build.h +63 -63
  309. package/vendor/zsign/build/windows/vs2022/include/openssl/params.h +160 -160
  310. package/vendor/zsign/build/windows/vs2022/include/openssl/pem.h +543 -543
  311. package/vendor/zsign/build/windows/vs2022/include/openssl/pem2.h +19 -19
  312. package/vendor/zsign/build/windows/vs2022/include/openssl/pemerr.h +58 -58
  313. package/vendor/zsign/build/windows/vs2022/include/openssl/pkcs12err.h +46 -46
  314. package/vendor/zsign/build/windows/vs2022/include/openssl/pkcs7err.h +63 -63
  315. package/vendor/zsign/build/windows/vs2022/include/openssl/prov_ssl.h +38 -38
  316. package/vendor/zsign/build/windows/vs2022/include/openssl/proverr.h +162 -162
  317. package/vendor/zsign/build/windows/vs2022/include/openssl/provider.h +66 -66
  318. package/vendor/zsign/build/windows/vs2022/include/openssl/quic.h +70 -70
  319. package/vendor/zsign/build/windows/vs2022/include/openssl/rand.h +125 -125
  320. package/vendor/zsign/build/windows/vs2022/include/openssl/randerr.h +69 -69
  321. package/vendor/zsign/build/windows/vs2022/include/openssl/rc2.h +68 -68
  322. package/vendor/zsign/build/windows/vs2022/include/openssl/rc4.h +47 -47
  323. package/vendor/zsign/build/windows/vs2022/include/openssl/rc5.h +79 -79
  324. package/vendor/zsign/build/windows/vs2022/include/openssl/ripemd.h +59 -59
  325. package/vendor/zsign/build/windows/vs2022/include/openssl/rsa.h +615 -615
  326. package/vendor/zsign/build/windows/vs2022/include/openssl/rsaerr.h +107 -107
  327. package/vendor/zsign/build/windows/vs2022/include/openssl/seed.h +113 -113
  328. package/vendor/zsign/build/windows/vs2022/include/openssl/self_test.h +98 -98
  329. package/vendor/zsign/build/windows/vs2022/include/openssl/sha.h +139 -139
  330. package/vendor/zsign/build/windows/vs2022/include/openssl/srtp.h +68 -68
  331. package/vendor/zsign/build/windows/vs2022/include/openssl/ssl2.h +30 -30
  332. package/vendor/zsign/build/windows/vs2022/include/openssl/ssl3.h +357 -357
  333. package/vendor/zsign/build/windows/vs2022/include/openssl/sslerr.h +379 -379
  334. package/vendor/zsign/build/windows/vs2022/include/openssl/sslerr_legacy.h +467 -467
  335. package/vendor/zsign/build/windows/vs2022/include/openssl/stack.h +90 -90
  336. package/vendor/zsign/build/windows/vs2022/include/openssl/store.h +377 -377
  337. package/vendor/zsign/build/windows/vs2022/include/openssl/storeerr.h +49 -49
  338. package/vendor/zsign/build/windows/vs2022/include/openssl/symhacks.h +39 -39
  339. package/vendor/zsign/build/windows/vs2022/include/openssl/thread.h +31 -31
  340. package/vendor/zsign/build/windows/vs2022/include/openssl/tls1.h +1220 -1220
  341. package/vendor/zsign/build/windows/vs2022/include/openssl/trace.h +320 -320
  342. package/vendor/zsign/build/windows/vs2022/include/openssl/ts.h +522 -522
  343. package/vendor/zsign/build/windows/vs2022/include/openssl/tserr.h +67 -67
  344. package/vendor/zsign/build/windows/vs2022/include/openssl/txt_db.h +63 -63
  345. package/vendor/zsign/build/windows/vs2022/include/openssl/types.h +245 -245
  346. package/vendor/zsign/build/windows/vs2022/include/openssl/uierr.h +38 -38
  347. package/vendor/zsign/build/windows/vs2022/include/openssl/whrlpool.h +62 -62
  348. package/vendor/zsign/build/windows/vs2022/include/openssl/x509err.h +70 -70
  349. package/vendor/zsign/build/windows/vs2022/include/openssl/x509v3err.h +96 -96
  350. package/vendor/zsign/src/archo.cpp +742 -742
  351. package/vendor/zsign/src/archo.h +61 -61
  352. package/vendor/zsign/src/bundle.cpp +589 -589
  353. package/vendor/zsign/src/bundle.h +46 -46
  354. package/vendor/zsign/src/common/archive.cpp +246 -246
  355. package/vendor/zsign/src/common/archive.h +22 -22
  356. package/vendor/zsign/src/common/common.h +56 -56
  357. package/vendor/zsign/src/common/fs.cpp +573 -573
  358. package/vendor/zsign/src/common/fs.h +50 -50
  359. package/vendor/zsign/src/common/log.cpp +145 -145
  360. package/vendor/zsign/src/common/log.h +37 -37
  361. package/vendor/zsign/src/common/mach-o.h +585 -585
  362. package/vendor/zsign/src/common/sha.cpp +133 -133
  363. package/vendor/zsign/src/common/sha.h +24 -24
  364. package/vendor/zsign/src/common/timer.cpp +28 -28
  365. package/vendor/zsign/src/common/timer.h +17 -17
  366. package/vendor/zsign/src/common/util.cpp +185 -185
  367. package/vendor/zsign/src/common/util.h +25 -25
  368. package/vendor/zsign/src/macho.cpp +273 -273
  369. package/vendor/zsign/src/macho.h +38 -38
  370. package/vendor/zsign/src/openssl.cpp +698 -698
  371. package/vendor/zsign/src/openssl.h +71 -71
  372. package/vendor/zsign/src/signing.cpp +745 -745
  373. package/vendor/zsign/src/signing.h +59 -59
  374. package/vendor/zsign/src/zsign.cpp +317 -317
  375. package/vendor/zsign/test/dylib/demo/Makefile +12 -12
  376. package/vendor/zsign/test/dylib/demo/control +9 -9
  377. package/vendor/zsign/test/dylib/demo/demo.m +21 -21
  378. package/vendor/zsign/test/linux/test.sh +19 -19
  379. package/vendor/zsign/test/macos/test.sh +19 -19
@@ -1,619 +1,619 @@
1
-
2
-
3
-
4
-
5
-
6
-
7
- Network Working Group P. Deutsch
8
- Request for Comments: 1950 Aladdin Enterprises
9
- Category: Informational J-L. Gailly
10
- Info-ZIP
11
- May 1996
12
-
13
-
14
- ZLIB Compressed Data Format Specification version 3.3
15
-
16
- Status of This Memo
17
-
18
- This memo provides information for the Internet community. This memo
19
- does not specify an Internet standard of any kind. Distribution of
20
- this memo is unlimited.
21
-
22
- IESG Note:
23
-
24
- The IESG takes no position on the validity of any Intellectual
25
- Property Rights statements contained in this document.
26
-
27
- Notices
28
-
29
- Copyright (c) 1996 L. Peter Deutsch and Jean-Loup Gailly
30
-
31
- Permission is granted to copy and distribute this document for any
32
- purpose and without charge, including translations into other
33
- languages and incorporation into compilations, provided that the
34
- copyright notice and this notice are preserved, and that any
35
- substantive changes or deletions from the original are clearly
36
- marked.
37
-
38
- A pointer to the latest version of this and related documentation in
39
- HTML format can be found at the URL
40
- <ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html>.
41
-
42
- Abstract
43
-
44
- This specification defines a lossless compressed data format. The
45
- data can be produced or consumed, even for an arbitrarily long
46
- sequentially presented input data stream, using only an a priori
47
- bounded amount of intermediate storage. The format presently uses
48
- the DEFLATE compression method but can be easily extended to use
49
- other compression methods. It can be implemented readily in a manner
50
- not covered by patents. This specification also defines the ADLER-32
51
- checksum (an extension and improvement of the Fletcher checksum),
52
- used for detection of data corruption, and provides an algorithm for
53
- computing it.
54
-
55
-
56
-
57
-
58
- Deutsch & Gailly Informational [Page 1]
59
-
60
- RFC 1950 ZLIB Compressed Data Format Specification May 1996
61
-
62
-
63
- Table of Contents
64
-
65
- 1. Introduction ................................................... 2
66
- 1.1. Purpose ................................................... 2
67
- 1.2. Intended audience ......................................... 3
68
- 1.3. Scope ..................................................... 3
69
- 1.4. Compliance ................................................ 3
70
- 1.5. Definitions of terms and conventions used ................ 3
71
- 1.6. Changes from previous versions ............................ 3
72
- 2. Detailed specification ......................................... 3
73
- 2.1. Overall conventions ....................................... 3
74
- 2.2. Data format ............................................... 4
75
- 2.3. Compliance ................................................ 7
76
- 3. References ..................................................... 7
77
- 4. Source code .................................................... 8
78
- 5. Security Considerations ........................................ 8
79
- 6. Acknowledgements ............................................... 8
80
- 7. Authors' Addresses ............................................. 8
81
- 8. Appendix: Rationale ............................................ 9
82
- 9. Appendix: Sample code ..........................................10
83
-
84
- 1. Introduction
85
-
86
- 1.1. Purpose
87
-
88
- The purpose of this specification is to define a lossless
89
- compressed data format that:
90
-
91
- * Is independent of CPU type, operating system, file system,
92
- and character set, and hence can be used for interchange;
93
-
94
- * Can be produced or consumed, even for an arbitrarily long
95
- sequentially presented input data stream, using only an a
96
- priori bounded amount of intermediate storage, and hence can
97
- be used in data communications or similar structures such as
98
- Unix filters;
99
-
100
- * Can use a number of different compression methods;
101
-
102
- * Can be implemented readily in a manner not covered by
103
- patents, and hence can be practiced freely.
104
-
105
- The data format defined by this specification does not attempt to
106
- allow random access to compressed data.
107
-
108
-
109
-
110
-
111
-
112
-
113
-
114
- Deutsch & Gailly Informational [Page 2]
115
-
116
- RFC 1950 ZLIB Compressed Data Format Specification May 1996
117
-
118
-
119
- 1.2. Intended audience
120
-
121
- This specification is intended for use by implementors of software
122
- to compress data into zlib format and/or decompress data from zlib
123
- format.
124
-
125
- The text of the specification assumes a basic background in
126
- programming at the level of bits and other primitive data
127
- representations.
128
-
129
- 1.3. Scope
130
-
131
- The specification specifies a compressed data format that can be
132
- used for in-memory compression of a sequence of arbitrary bytes.
133
-
134
- 1.4. Compliance
135
-
136
- Unless otherwise indicated below, a compliant decompressor must be
137
- able to accept and decompress any data set that conforms to all
138
- the specifications presented here; a compliant compressor must
139
- produce data sets that conform to all the specifications presented
140
- here.
141
-
142
- 1.5. Definitions of terms and conventions used
143
-
144
- byte: 8 bits stored or transmitted as a unit (same as an octet).
145
- (For this specification, a byte is exactly 8 bits, even on
146
- machines which store a character on a number of bits different
147
- from 8.) See below, for the numbering of bits within a byte.
148
-
149
- 1.6. Changes from previous versions
150
-
151
- Version 3.1 was the first public release of this specification.
152
- In version 3.2, some terminology was changed and the Adler-32
153
- sample code was rewritten for clarity. In version 3.3, the
154
- support for a preset dictionary was introduced, and the
155
- specification was converted to RFC style.
156
-
157
- 2. Detailed specification
158
-
159
- 2.1. Overall conventions
160
-
161
- In the diagrams below, a box like this:
162
-
163
- +---+
164
- | | <-- the vertical bars might be missing
165
- +---+
166
-
167
-
168
-
169
-
170
- Deutsch & Gailly Informational [Page 3]
171
-
172
- RFC 1950 ZLIB Compressed Data Format Specification May 1996
173
-
174
-
175
- represents one byte; a box like this:
176
-
177
- +==============+
178
- | |
179
- +==============+
180
-
181
- represents a variable number of bytes.
182
-
183
- Bytes stored within a computer do not have a "bit order", since
184
- they are always treated as a unit. However, a byte considered as
185
- an integer between 0 and 255 does have a most- and least-
186
- significant bit, and since we write numbers with the most-
187
- significant digit on the left, we also write bytes with the most-
188
- significant bit on the left. In the diagrams below, we number the
189
- bits of a byte so that bit 0 is the least-significant bit, i.e.,
190
- the bits are numbered:
191
-
192
- +--------+
193
- |76543210|
194
- +--------+
195
-
196
- Within a computer, a number may occupy multiple bytes. All
197
- multi-byte numbers in the format described here are stored with
198
- the MOST-significant byte first (at the lower memory address).
199
- For example, the decimal number 520 is stored as:
200
-
201
- 0 1
202
- +--------+--------+
203
- |00000010|00001000|
204
- +--------+--------+
205
- ^ ^
206
- | |
207
- | + less significant byte = 8
208
- + more significant byte = 2 x 256
209
-
210
- 2.2. Data format
211
-
212
- A zlib stream has the following structure:
213
-
214
- 0 1
215
- +---+---+
216
- |CMF|FLG| (more-->)
217
- +---+---+
218
-
219
-
220
-
221
-
222
-
223
-
224
-
225
-
226
- Deutsch & Gailly Informational [Page 4]
227
-
228
- RFC 1950 ZLIB Compressed Data Format Specification May 1996
229
-
230
-
231
- (if FLG.FDICT set)
232
-
233
- 0 1 2 3
234
- +---+---+---+---+
235
- | DICTID | (more-->)
236
- +---+---+---+---+
237
-
238
- +=====================+---+---+---+---+
239
- |...compressed data...| ADLER32 |
240
- +=====================+---+---+---+---+
241
-
242
- Any data which may appear after ADLER32 are not part of the zlib
243
- stream.
244
-
245
- CMF (Compression Method and flags)
246
- This byte is divided into a 4-bit compression method and a 4-
247
- bit information field depending on the compression method.
248
-
249
- bits 0 to 3 CM Compression method
250
- bits 4 to 7 CINFO Compression info
251
-
252
- CM (Compression method)
253
- This identifies the compression method used in the file. CM = 8
254
- denotes the "deflate" compression method with a window size up
255
- to 32K. This is the method used by gzip and PNG (see
256
- references [1] and [2] in Chapter 3, below, for the reference
257
- documents). CM = 15 is reserved. It might be used in a future
258
- version of this specification to indicate the presence of an
259
- extra field before the compressed data.
260
-
261
- CINFO (Compression info)
262
- For CM = 8, CINFO is the base-2 logarithm of the LZ77 window
263
- size, minus eight (CINFO=7 indicates a 32K window size). Values
264
- of CINFO above 7 are not allowed in this version of the
265
- specification. CINFO is not defined in this specification for
266
- CM not equal to 8.
267
-
268
- FLG (FLaGs)
269
- This flag byte is divided as follows:
270
-
271
- bits 0 to 4 FCHECK (check bits for CMF and FLG)
272
- bit 5 FDICT (preset dictionary)
273
- bits 6 to 7 FLEVEL (compression level)
274
-
275
- The FCHECK value must be such that CMF and FLG, when viewed as
276
- a 16-bit unsigned integer stored in MSB order (CMF*256 + FLG),
277
- is a multiple of 31.
278
-
279
-
280
-
281
-
282
- Deutsch & Gailly Informational [Page 5]
283
-
284
- RFC 1950 ZLIB Compressed Data Format Specification May 1996
285
-
286
-
287
- FDICT (Preset dictionary)
288
- If FDICT is set, a DICT dictionary identifier is present
289
- immediately after the FLG byte. The dictionary is a sequence of
290
- bytes which are initially fed to the compressor without
291
- producing any compressed output. DICT is the Adler-32 checksum
292
- of this sequence of bytes (see the definition of ADLER32
293
- below). The decompressor can use this identifier to determine
294
- which dictionary has been used by the compressor.
295
-
296
- FLEVEL (Compression level)
297
- These flags are available for use by specific compression
298
- methods. The "deflate" method (CM = 8) sets these flags as
299
- follows:
300
-
301
- 0 - compressor used fastest algorithm
302
- 1 - compressor used fast algorithm
303
- 2 - compressor used default algorithm
304
- 3 - compressor used maximum compression, slowest algorithm
305
-
306
- The information in FLEVEL is not needed for decompression; it
307
- is there to indicate if recompression might be worthwhile.
308
-
309
- compressed data
310
- For compression method 8, the compressed data is stored in the
311
- deflate compressed data format as described in the document
312
- "DEFLATE Compressed Data Format Specification" by L. Peter
313
- Deutsch. (See reference [3] in Chapter 3, below)
314
-
315
- Other compressed data formats are not specified in this version
316
- of the zlib specification.
317
-
318
- ADLER32 (Adler-32 checksum)
319
- This contains a checksum value of the uncompressed data
320
- (excluding any dictionary data) computed according to Adler-32
321
- algorithm. This algorithm is a 32-bit extension and improvement
322
- of the Fletcher algorithm, used in the ITU-T X.224 / ISO 8073
323
- standard. See references [4] and [5] in Chapter 3, below)
324
-
325
- Adler-32 is composed of two sums accumulated per byte: s1 is
326
- the sum of all bytes, s2 is the sum of all s1 values. Both sums
327
- are done modulo 65521. s1 is initialized to 1, s2 to zero. The
328
- Adler-32 checksum is stored as s2*65536 + s1 in most-
329
- significant-byte first (network) order.
330
-
331
-
332
-
333
-
334
-
335
-
336
-
337
-
338
- Deutsch & Gailly Informational [Page 6]
339
-
340
- RFC 1950 ZLIB Compressed Data Format Specification May 1996
341
-
342
-
343
- 2.3. Compliance
344
-
345
- A compliant compressor must produce streams with correct CMF, FLG
346
- and ADLER32, but need not support preset dictionaries. When the
347
- zlib data format is used as part of another standard data format,
348
- the compressor may use only preset dictionaries that are specified
349
- by this other data format. If this other format does not use the
350
- preset dictionary feature, the compressor must not set the FDICT
351
- flag.
352
-
353
- A compliant decompressor must check CMF, FLG, and ADLER32, and
354
- provide an error indication if any of these have incorrect values.
355
- A compliant decompressor must give an error indication if CM is
356
- not one of the values defined in this specification (only the
357
- value 8 is permitted in this version), since another value could
358
- indicate the presence of new features that would cause subsequent
359
- data to be interpreted incorrectly. A compliant decompressor must
360
- give an error indication if FDICT is set and DICTID is not the
361
- identifier of a known preset dictionary. A decompressor may
362
- ignore FLEVEL and still be compliant. When the zlib data format
363
- is being used as a part of another standard format, a compliant
364
- decompressor must support all the preset dictionaries specified by
365
- the other format. When the other format does not use the preset
366
- dictionary feature, a compliant decompressor must reject any
367
- stream in which the FDICT flag is set.
368
-
369
- 3. References
370
-
371
- [1] Deutsch, L.P.,"GZIP Compressed Data Format Specification",
372
- available in ftp://ftp.uu.net/pub/archiving/zip/doc/
373
-
374
- [2] Thomas Boutell, "PNG (Portable Network Graphics) specification",
375
- available in ftp://ftp.uu.net/graphics/png/documents/
376
-
377
- [3] Deutsch, L.P.,"DEFLATE Compressed Data Format Specification",
378
- available in ftp://ftp.uu.net/pub/archiving/zip/doc/
379
-
380
- [4] Fletcher, J. G., "An Arithmetic Checksum for Serial
381
- Transmissions," IEEE Transactions on Communications, Vol. COM-30,
382
- No. 1, January 1982, pp. 247-252.
383
-
384
- [5] ITU-T Recommendation X.224, Annex D, "Checksum Algorithms,"
385
- November, 1993, pp. 144, 145. (Available from
386
- gopher://info.itu.ch). ITU-T X.244 is also the same as ISO 8073.
387
-
388
-
389
-
390
-
391
-
392
-
393
-
394
- Deutsch & Gailly Informational [Page 7]
395
-
396
- RFC 1950 ZLIB Compressed Data Format Specification May 1996
397
-
398
-
399
- 4. Source code
400
-
401
- Source code for a C language implementation of a "zlib" compliant
402
- library is available at ftp://ftp.uu.net/pub/archiving/zip/zlib/.
403
-
404
- 5. Security Considerations
405
-
406
- A decoder that fails to check the ADLER32 checksum value may be
407
- subject to undetected data corruption.
408
-
409
- 6. Acknowledgements
410
-
411
- Trademarks cited in this document are the property of their
412
- respective owners.
413
-
414
- Jean-Loup Gailly and Mark Adler designed the zlib format and wrote
415
- the related software described in this specification. Glenn
416
- Randers-Pehrson converted this document to RFC and HTML format.
417
-
418
- 7. Authors' Addresses
419
-
420
- L. Peter Deutsch
421
- Aladdin Enterprises
422
- 203 Santa Margarita Ave.
423
- Menlo Park, CA 94025
424
-
425
- Phone: (415) 322-0103 (AM only)
426
- FAX: (415) 322-1734
427
- EMail: <ghost@aladdin.com>
428
-
429
-
430
- Jean-Loup Gailly
431
-
432
- EMail: <gzip@prep.ai.mit.edu>
433
-
434
- Questions about the technical content of this specification can be
435
- sent by email to
436
-
437
- Jean-Loup Gailly <gzip@prep.ai.mit.edu> and
438
- Mark Adler <madler@alumni.caltech.edu>
439
-
440
- Editorial comments on this specification can be sent by email to
441
-
442
- L. Peter Deutsch <ghost@aladdin.com> and
443
- Glenn Randers-Pehrson <randeg@alumni.rpi.edu>
444
-
445
-
446
-
447
-
448
-
449
-
450
- Deutsch & Gailly Informational [Page 8]
451
-
452
- RFC 1950 ZLIB Compressed Data Format Specification May 1996
453
-
454
-
455
- 8. Appendix: Rationale
456
-
457
- 8.1. Preset dictionaries
458
-
459
- A preset dictionary is specially useful to compress short input
460
- sequences. The compressor can take advantage of the dictionary
461
- context to encode the input in a more compact manner. The
462
- decompressor can be initialized with the appropriate context by
463
- virtually decompressing a compressed version of the dictionary
464
- without producing any output. However for certain compression
465
- algorithms such as the deflate algorithm this operation can be
466
- achieved without actually performing any decompression.
467
-
468
- The compressor and the decompressor must use exactly the same
469
- dictionary. The dictionary may be fixed or may be chosen among a
470
- certain number of predefined dictionaries, according to the kind
471
- of input data. The decompressor can determine which dictionary has
472
- been chosen by the compressor by checking the dictionary
473
- identifier. This document does not specify the contents of
474
- predefined dictionaries, since the optimal dictionaries are
475
- application specific. Standard data formats using this feature of
476
- the zlib specification must precisely define the allowed
477
- dictionaries.
478
-
479
- 8.2. The Adler-32 algorithm
480
-
481
- The Adler-32 algorithm is much faster than the CRC32 algorithm yet
482
- still provides an extremely low probability of undetected errors.
483
-
484
- The modulo on unsigned long accumulators can be delayed for 5552
485
- bytes, so the modulo operation time is negligible. If the bytes
486
- are a, b, c, the second sum is 3a + 2b + c + 3, and so is position
487
- and order sensitive, unlike the first sum, which is just a
488
- checksum. That 65521 is prime is important to avoid a possible
489
- large class of two-byte errors that leave the check unchanged.
490
- (The Fletcher checksum uses 255, which is not prime and which also
491
- makes the Fletcher check insensitive to single byte changes 0 <->
492
- 255.)
493
-
494
- The sum s1 is initialized to 1 instead of zero to make the length
495
- of the sequence part of s2, so that the length does not have to be
496
- checked separately. (Any sequence of zeroes has a Fletcher
497
- checksum of zero.)
498
-
499
-
500
-
501
-
502
-
503
-
504
-
505
-
506
- Deutsch & Gailly Informational [Page 9]
507
-
508
- RFC 1950 ZLIB Compressed Data Format Specification May 1996
509
-
510
-
511
- 9. Appendix: Sample code
512
-
513
- The following C code computes the Adler-32 checksum of a data buffer.
514
- It is written for clarity, not for speed. The sample code is in the
515
- ANSI C programming language. Non C users may find it easier to read
516
- with these hints:
517
-
518
- & Bitwise AND operator.
519
- >> Bitwise right shift operator. When applied to an
520
- unsigned quantity, as here, right shift inserts zero bit(s)
521
- at the left.
522
- << Bitwise left shift operator. Left shift inserts zero
523
- bit(s) at the right.
524
- ++ "n++" increments the variable n.
525
- % modulo operator: a % b is the remainder of a divided by b.
526
-
527
- #define BASE 65521 /* largest prime smaller than 65536 */
528
-
529
- /*
530
- Update a running Adler-32 checksum with the bytes buf[0..len-1]
531
- and return the updated checksum. The Adler-32 checksum should be
532
- initialized to 1.
533
-
534
- Usage example:
535
-
536
- unsigned long adler = 1L;
537
-
538
- while (read_buffer(buffer, length) != EOF) {
539
- adler = update_adler32(adler, buffer, length);
540
- }
541
- if (adler != original_adler) error();
542
- */
543
- unsigned long update_adler32(unsigned long adler,
544
- unsigned char *buf, int len)
545
- {
546
- unsigned long s1 = adler & 0xffff;
547
- unsigned long s2 = (adler >> 16) & 0xffff;
548
- int n;
549
-
550
- for (n = 0; n < len; n++) {
551
- s1 = (s1 + buf[n]) % BASE;
552
- s2 = (s2 + s1) % BASE;
553
- }
554
- return (s2 << 16) + s1;
555
- }
556
-
557
- /* Return the adler32 of the bytes buf[0..len-1] */
558
-
559
-
560
-
561
-
562
- Deutsch & Gailly Informational [Page 10]
563
-
564
- RFC 1950 ZLIB Compressed Data Format Specification May 1996
565
-
566
-
567
- unsigned long adler32(unsigned char *buf, int len)
568
- {
569
- return update_adler32(1L, buf, len);
570
- }
571
-
572
-
573
-
574
-
575
-
576
-
577
-
578
-
579
-
580
-
581
-
582
-
583
-
584
-
585
-
586
-
587
-
588
-
589
-
590
-
591
-
592
-
593
-
594
-
595
-
596
-
597
-
598
-
599
-
600
-
601
-
602
-
603
-
604
-
605
-
606
-
607
-
608
-
609
-
610
-
611
-
612
-
613
-
614
-
615
-
616
-
617
-
618
- Deutsch & Gailly Informational [Page 11]
619
-
1
+
2
+
3
+
4
+
5
+
6
+
7
+ Network Working Group P. Deutsch
8
+ Request for Comments: 1950 Aladdin Enterprises
9
+ Category: Informational J-L. Gailly
10
+ Info-ZIP
11
+ May 1996
12
+
13
+
14
+ ZLIB Compressed Data Format Specification version 3.3
15
+
16
+ Status of This Memo
17
+
18
+ This memo provides information for the Internet community. This memo
19
+ does not specify an Internet standard of any kind. Distribution of
20
+ this memo is unlimited.
21
+
22
+ IESG Note:
23
+
24
+ The IESG takes no position on the validity of any Intellectual
25
+ Property Rights statements contained in this document.
26
+
27
+ Notices
28
+
29
+ Copyright (c) 1996 L. Peter Deutsch and Jean-Loup Gailly
30
+
31
+ Permission is granted to copy and distribute this document for any
32
+ purpose and without charge, including translations into other
33
+ languages and incorporation into compilations, provided that the
34
+ copyright notice and this notice are preserved, and that any
35
+ substantive changes or deletions from the original are clearly
36
+ marked.
37
+
38
+ A pointer to the latest version of this and related documentation in
39
+ HTML format can be found at the URL
40
+ <ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html>.
41
+
42
+ Abstract
43
+
44
+ This specification defines a lossless compressed data format. The
45
+ data can be produced or consumed, even for an arbitrarily long
46
+ sequentially presented input data stream, using only an a priori
47
+ bounded amount of intermediate storage. The format presently uses
48
+ the DEFLATE compression method but can be easily extended to use
49
+ other compression methods. It can be implemented readily in a manner
50
+ not covered by patents. This specification also defines the ADLER-32
51
+ checksum (an extension and improvement of the Fletcher checksum),
52
+ used for detection of data corruption, and provides an algorithm for
53
+ computing it.
54
+
55
+
56
+
57
+
58
+ Deutsch & Gailly Informational [Page 1]
59
+
60
+ RFC 1950 ZLIB Compressed Data Format Specification May 1996
61
+
62
+
63
+ Table of Contents
64
+
65
+ 1. Introduction ................................................... 2
66
+ 1.1. Purpose ................................................... 2
67
+ 1.2. Intended audience ......................................... 3
68
+ 1.3. Scope ..................................................... 3
69
+ 1.4. Compliance ................................................ 3
70
+ 1.5. Definitions of terms and conventions used ................ 3
71
+ 1.6. Changes from previous versions ............................ 3
72
+ 2. Detailed specification ......................................... 3
73
+ 2.1. Overall conventions ....................................... 3
74
+ 2.2. Data format ............................................... 4
75
+ 2.3. Compliance ................................................ 7
76
+ 3. References ..................................................... 7
77
+ 4. Source code .................................................... 8
78
+ 5. Security Considerations ........................................ 8
79
+ 6. Acknowledgements ............................................... 8
80
+ 7. Authors' Addresses ............................................. 8
81
+ 8. Appendix: Rationale ............................................ 9
82
+ 9. Appendix: Sample code ..........................................10
83
+
84
+ 1. Introduction
85
+
86
+ 1.1. Purpose
87
+
88
+ The purpose of this specification is to define a lossless
89
+ compressed data format that:
90
+
91
+ * Is independent of CPU type, operating system, file system,
92
+ and character set, and hence can be used for interchange;
93
+
94
+ * Can be produced or consumed, even for an arbitrarily long
95
+ sequentially presented input data stream, using only an a
96
+ priori bounded amount of intermediate storage, and hence can
97
+ be used in data communications or similar structures such as
98
+ Unix filters;
99
+
100
+ * Can use a number of different compression methods;
101
+
102
+ * Can be implemented readily in a manner not covered by
103
+ patents, and hence can be practiced freely.
104
+
105
+ The data format defined by this specification does not attempt to
106
+ allow random access to compressed data.
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+ Deutsch & Gailly Informational [Page 2]
115
+
116
+ RFC 1950 ZLIB Compressed Data Format Specification May 1996
117
+
118
+
119
+ 1.2. Intended audience
120
+
121
+ This specification is intended for use by implementors of software
122
+ to compress data into zlib format and/or decompress data from zlib
123
+ format.
124
+
125
+ The text of the specification assumes a basic background in
126
+ programming at the level of bits and other primitive data
127
+ representations.
128
+
129
+ 1.3. Scope
130
+
131
+ The specification specifies a compressed data format that can be
132
+ used for in-memory compression of a sequence of arbitrary bytes.
133
+
134
+ 1.4. Compliance
135
+
136
+ Unless otherwise indicated below, a compliant decompressor must be
137
+ able to accept and decompress any data set that conforms to all
138
+ the specifications presented here; a compliant compressor must
139
+ produce data sets that conform to all the specifications presented
140
+ here.
141
+
142
+ 1.5. Definitions of terms and conventions used
143
+
144
+ byte: 8 bits stored or transmitted as a unit (same as an octet).
145
+ (For this specification, a byte is exactly 8 bits, even on
146
+ machines which store a character on a number of bits different
147
+ from 8.) See below, for the numbering of bits within a byte.
148
+
149
+ 1.6. Changes from previous versions
150
+
151
+ Version 3.1 was the first public release of this specification.
152
+ In version 3.2, some terminology was changed and the Adler-32
153
+ sample code was rewritten for clarity. In version 3.3, the
154
+ support for a preset dictionary was introduced, and the
155
+ specification was converted to RFC style.
156
+
157
+ 2. Detailed specification
158
+
159
+ 2.1. Overall conventions
160
+
161
+ In the diagrams below, a box like this:
162
+
163
+ +---+
164
+ | | <-- the vertical bars might be missing
165
+ +---+
166
+
167
+
168
+
169
+
170
+ Deutsch & Gailly Informational [Page 3]
171
+
172
+ RFC 1950 ZLIB Compressed Data Format Specification May 1996
173
+
174
+
175
+ represents one byte; a box like this:
176
+
177
+ +==============+
178
+ | |
179
+ +==============+
180
+
181
+ represents a variable number of bytes.
182
+
183
+ Bytes stored within a computer do not have a "bit order", since
184
+ they are always treated as a unit. However, a byte considered as
185
+ an integer between 0 and 255 does have a most- and least-
186
+ significant bit, and since we write numbers with the most-
187
+ significant digit on the left, we also write bytes with the most-
188
+ significant bit on the left. In the diagrams below, we number the
189
+ bits of a byte so that bit 0 is the least-significant bit, i.e.,
190
+ the bits are numbered:
191
+
192
+ +--------+
193
+ |76543210|
194
+ +--------+
195
+
196
+ Within a computer, a number may occupy multiple bytes. All
197
+ multi-byte numbers in the format described here are stored with
198
+ the MOST-significant byte first (at the lower memory address).
199
+ For example, the decimal number 520 is stored as:
200
+
201
+ 0 1
202
+ +--------+--------+
203
+ |00000010|00001000|
204
+ +--------+--------+
205
+ ^ ^
206
+ | |
207
+ | + less significant byte = 8
208
+ + more significant byte = 2 x 256
209
+
210
+ 2.2. Data format
211
+
212
+ A zlib stream has the following structure:
213
+
214
+ 0 1
215
+ +---+---+
216
+ |CMF|FLG| (more-->)
217
+ +---+---+
218
+
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+ Deutsch & Gailly Informational [Page 4]
227
+
228
+ RFC 1950 ZLIB Compressed Data Format Specification May 1996
229
+
230
+
231
+ (if FLG.FDICT set)
232
+
233
+ 0 1 2 3
234
+ +---+---+---+---+
235
+ | DICTID | (more-->)
236
+ +---+---+---+---+
237
+
238
+ +=====================+---+---+---+---+
239
+ |...compressed data...| ADLER32 |
240
+ +=====================+---+---+---+---+
241
+
242
+ Any data which may appear after ADLER32 are not part of the zlib
243
+ stream.
244
+
245
+ CMF (Compression Method and flags)
246
+ This byte is divided into a 4-bit compression method and a 4-
247
+ bit information field depending on the compression method.
248
+
249
+ bits 0 to 3 CM Compression method
250
+ bits 4 to 7 CINFO Compression info
251
+
252
+ CM (Compression method)
253
+ This identifies the compression method used in the file. CM = 8
254
+ denotes the "deflate" compression method with a window size up
255
+ to 32K. This is the method used by gzip and PNG (see
256
+ references [1] and [2] in Chapter 3, below, for the reference
257
+ documents). CM = 15 is reserved. It might be used in a future
258
+ version of this specification to indicate the presence of an
259
+ extra field before the compressed data.
260
+
261
+ CINFO (Compression info)
262
+ For CM = 8, CINFO is the base-2 logarithm of the LZ77 window
263
+ size, minus eight (CINFO=7 indicates a 32K window size). Values
264
+ of CINFO above 7 are not allowed in this version of the
265
+ specification. CINFO is not defined in this specification for
266
+ CM not equal to 8.
267
+
268
+ FLG (FLaGs)
269
+ This flag byte is divided as follows:
270
+
271
+ bits 0 to 4 FCHECK (check bits for CMF and FLG)
272
+ bit 5 FDICT (preset dictionary)
273
+ bits 6 to 7 FLEVEL (compression level)
274
+
275
+ The FCHECK value must be such that CMF and FLG, when viewed as
276
+ a 16-bit unsigned integer stored in MSB order (CMF*256 + FLG),
277
+ is a multiple of 31.
278
+
279
+
280
+
281
+
282
+ Deutsch & Gailly Informational [Page 5]
283
+
284
+ RFC 1950 ZLIB Compressed Data Format Specification May 1996
285
+
286
+
287
+ FDICT (Preset dictionary)
288
+ If FDICT is set, a DICT dictionary identifier is present
289
+ immediately after the FLG byte. The dictionary is a sequence of
290
+ bytes which are initially fed to the compressor without
291
+ producing any compressed output. DICT is the Adler-32 checksum
292
+ of this sequence of bytes (see the definition of ADLER32
293
+ below). The decompressor can use this identifier to determine
294
+ which dictionary has been used by the compressor.
295
+
296
+ FLEVEL (Compression level)
297
+ These flags are available for use by specific compression
298
+ methods. The "deflate" method (CM = 8) sets these flags as
299
+ follows:
300
+
301
+ 0 - compressor used fastest algorithm
302
+ 1 - compressor used fast algorithm
303
+ 2 - compressor used default algorithm
304
+ 3 - compressor used maximum compression, slowest algorithm
305
+
306
+ The information in FLEVEL is not needed for decompression; it
307
+ is there to indicate if recompression might be worthwhile.
308
+
309
+ compressed data
310
+ For compression method 8, the compressed data is stored in the
311
+ deflate compressed data format as described in the document
312
+ "DEFLATE Compressed Data Format Specification" by L. Peter
313
+ Deutsch. (See reference [3] in Chapter 3, below)
314
+
315
+ Other compressed data formats are not specified in this version
316
+ of the zlib specification.
317
+
318
+ ADLER32 (Adler-32 checksum)
319
+ This contains a checksum value of the uncompressed data
320
+ (excluding any dictionary data) computed according to Adler-32
321
+ algorithm. This algorithm is a 32-bit extension and improvement
322
+ of the Fletcher algorithm, used in the ITU-T X.224 / ISO 8073
323
+ standard. See references [4] and [5] in Chapter 3, below)
324
+
325
+ Adler-32 is composed of two sums accumulated per byte: s1 is
326
+ the sum of all bytes, s2 is the sum of all s1 values. Both sums
327
+ are done modulo 65521. s1 is initialized to 1, s2 to zero. The
328
+ Adler-32 checksum is stored as s2*65536 + s1 in most-
329
+ significant-byte first (network) order.
330
+
331
+
332
+
333
+
334
+
335
+
336
+
337
+
338
+ Deutsch & Gailly Informational [Page 6]
339
+
340
+ RFC 1950 ZLIB Compressed Data Format Specification May 1996
341
+
342
+
343
+ 2.3. Compliance
344
+
345
+ A compliant compressor must produce streams with correct CMF, FLG
346
+ and ADLER32, but need not support preset dictionaries. When the
347
+ zlib data format is used as part of another standard data format,
348
+ the compressor may use only preset dictionaries that are specified
349
+ by this other data format. If this other format does not use the
350
+ preset dictionary feature, the compressor must not set the FDICT
351
+ flag.
352
+
353
+ A compliant decompressor must check CMF, FLG, and ADLER32, and
354
+ provide an error indication if any of these have incorrect values.
355
+ A compliant decompressor must give an error indication if CM is
356
+ not one of the values defined in this specification (only the
357
+ value 8 is permitted in this version), since another value could
358
+ indicate the presence of new features that would cause subsequent
359
+ data to be interpreted incorrectly. A compliant decompressor must
360
+ give an error indication if FDICT is set and DICTID is not the
361
+ identifier of a known preset dictionary. A decompressor may
362
+ ignore FLEVEL and still be compliant. When the zlib data format
363
+ is being used as a part of another standard format, a compliant
364
+ decompressor must support all the preset dictionaries specified by
365
+ the other format. When the other format does not use the preset
366
+ dictionary feature, a compliant decompressor must reject any
367
+ stream in which the FDICT flag is set.
368
+
369
+ 3. References
370
+
371
+ [1] Deutsch, L.P.,"GZIP Compressed Data Format Specification",
372
+ available in ftp://ftp.uu.net/pub/archiving/zip/doc/
373
+
374
+ [2] Thomas Boutell, "PNG (Portable Network Graphics) specification",
375
+ available in ftp://ftp.uu.net/graphics/png/documents/
376
+
377
+ [3] Deutsch, L.P.,"DEFLATE Compressed Data Format Specification",
378
+ available in ftp://ftp.uu.net/pub/archiving/zip/doc/
379
+
380
+ [4] Fletcher, J. G., "An Arithmetic Checksum for Serial
381
+ Transmissions," IEEE Transactions on Communications, Vol. COM-30,
382
+ No. 1, January 1982, pp. 247-252.
383
+
384
+ [5] ITU-T Recommendation X.224, Annex D, "Checksum Algorithms,"
385
+ November, 1993, pp. 144, 145. (Available from
386
+ gopher://info.itu.ch). ITU-T X.244 is also the same as ISO 8073.
387
+
388
+
389
+
390
+
391
+
392
+
393
+
394
+ Deutsch & Gailly Informational [Page 7]
395
+
396
+ RFC 1950 ZLIB Compressed Data Format Specification May 1996
397
+
398
+
399
+ 4. Source code
400
+
401
+ Source code for a C language implementation of a "zlib" compliant
402
+ library is available at ftp://ftp.uu.net/pub/archiving/zip/zlib/.
403
+
404
+ 5. Security Considerations
405
+
406
+ A decoder that fails to check the ADLER32 checksum value may be
407
+ subject to undetected data corruption.
408
+
409
+ 6. Acknowledgements
410
+
411
+ Trademarks cited in this document are the property of their
412
+ respective owners.
413
+
414
+ Jean-Loup Gailly and Mark Adler designed the zlib format and wrote
415
+ the related software described in this specification. Glenn
416
+ Randers-Pehrson converted this document to RFC and HTML format.
417
+
418
+ 7. Authors' Addresses
419
+
420
+ L. Peter Deutsch
421
+ Aladdin Enterprises
422
+ 203 Santa Margarita Ave.
423
+ Menlo Park, CA 94025
424
+
425
+ Phone: (415) 322-0103 (AM only)
426
+ FAX: (415) 322-1734
427
+ EMail: <ghost@aladdin.com>
428
+
429
+
430
+ Jean-Loup Gailly
431
+
432
+ EMail: <gzip@prep.ai.mit.edu>
433
+
434
+ Questions about the technical content of this specification can be
435
+ sent by email to
436
+
437
+ Jean-Loup Gailly <gzip@prep.ai.mit.edu> and
438
+ Mark Adler <madler@alumni.caltech.edu>
439
+
440
+ Editorial comments on this specification can be sent by email to
441
+
442
+ L. Peter Deutsch <ghost@aladdin.com> and
443
+ Glenn Randers-Pehrson <randeg@alumni.rpi.edu>
444
+
445
+
446
+
447
+
448
+
449
+
450
+ Deutsch & Gailly Informational [Page 8]
451
+
452
+ RFC 1950 ZLIB Compressed Data Format Specification May 1996
453
+
454
+
455
+ 8. Appendix: Rationale
456
+
457
+ 8.1. Preset dictionaries
458
+
459
+ A preset dictionary is specially useful to compress short input
460
+ sequences. The compressor can take advantage of the dictionary
461
+ context to encode the input in a more compact manner. The
462
+ decompressor can be initialized with the appropriate context by
463
+ virtually decompressing a compressed version of the dictionary
464
+ without producing any output. However for certain compression
465
+ algorithms such as the deflate algorithm this operation can be
466
+ achieved without actually performing any decompression.
467
+
468
+ The compressor and the decompressor must use exactly the same
469
+ dictionary. The dictionary may be fixed or may be chosen among a
470
+ certain number of predefined dictionaries, according to the kind
471
+ of input data. The decompressor can determine which dictionary has
472
+ been chosen by the compressor by checking the dictionary
473
+ identifier. This document does not specify the contents of
474
+ predefined dictionaries, since the optimal dictionaries are
475
+ application specific. Standard data formats using this feature of
476
+ the zlib specification must precisely define the allowed
477
+ dictionaries.
478
+
479
+ 8.2. The Adler-32 algorithm
480
+
481
+ The Adler-32 algorithm is much faster than the CRC32 algorithm yet
482
+ still provides an extremely low probability of undetected errors.
483
+
484
+ The modulo on unsigned long accumulators can be delayed for 5552
485
+ bytes, so the modulo operation time is negligible. If the bytes
486
+ are a, b, c, the second sum is 3a + 2b + c + 3, and so is position
487
+ and order sensitive, unlike the first sum, which is just a
488
+ checksum. That 65521 is prime is important to avoid a possible
489
+ large class of two-byte errors that leave the check unchanged.
490
+ (The Fletcher checksum uses 255, which is not prime and which also
491
+ makes the Fletcher check insensitive to single byte changes 0 <->
492
+ 255.)
493
+
494
+ The sum s1 is initialized to 1 instead of zero to make the length
495
+ of the sequence part of s2, so that the length does not have to be
496
+ checked separately. (Any sequence of zeroes has a Fletcher
497
+ checksum of zero.)
498
+
499
+
500
+
501
+
502
+
503
+
504
+
505
+
506
+ Deutsch & Gailly Informational [Page 9]
507
+
508
+ RFC 1950 ZLIB Compressed Data Format Specification May 1996
509
+
510
+
511
+ 9. Appendix: Sample code
512
+
513
+ The following C code computes the Adler-32 checksum of a data buffer.
514
+ It is written for clarity, not for speed. The sample code is in the
515
+ ANSI C programming language. Non C users may find it easier to read
516
+ with these hints:
517
+
518
+ & Bitwise AND operator.
519
+ >> Bitwise right shift operator. When applied to an
520
+ unsigned quantity, as here, right shift inserts zero bit(s)
521
+ at the left.
522
+ << Bitwise left shift operator. Left shift inserts zero
523
+ bit(s) at the right.
524
+ ++ "n++" increments the variable n.
525
+ % modulo operator: a % b is the remainder of a divided by b.
526
+
527
+ #define BASE 65521 /* largest prime smaller than 65536 */
528
+
529
+ /*
530
+ Update a running Adler-32 checksum with the bytes buf[0..len-1]
531
+ and return the updated checksum. The Adler-32 checksum should be
532
+ initialized to 1.
533
+
534
+ Usage example:
535
+
536
+ unsigned long adler = 1L;
537
+
538
+ while (read_buffer(buffer, length) != EOF) {
539
+ adler = update_adler32(adler, buffer, length);
540
+ }
541
+ if (adler != original_adler) error();
542
+ */
543
+ unsigned long update_adler32(unsigned long adler,
544
+ unsigned char *buf, int len)
545
+ {
546
+ unsigned long s1 = adler & 0xffff;
547
+ unsigned long s2 = (adler >> 16) & 0xffff;
548
+ int n;
549
+
550
+ for (n = 0; n < len; n++) {
551
+ s1 = (s1 + buf[n]) % BASE;
552
+ s2 = (s2 + s1) % BASE;
553
+ }
554
+ return (s2 << 16) + s1;
555
+ }
556
+
557
+ /* Return the adler32 of the bytes buf[0..len-1] */
558
+
559
+
560
+
561
+
562
+ Deutsch & Gailly Informational [Page 10]
563
+
564
+ RFC 1950 ZLIB Compressed Data Format Specification May 1996
565
+
566
+
567
+ unsigned long adler32(unsigned char *buf, int len)
568
+ {
569
+ return update_adler32(1L, buf, len);
570
+ }
571
+
572
+
573
+
574
+
575
+
576
+
577
+
578
+
579
+
580
+
581
+
582
+
583
+
584
+
585
+
586
+
587
+
588
+
589
+
590
+
591
+
592
+
593
+
594
+
595
+
596
+
597
+
598
+
599
+
600
+
601
+
602
+
603
+
604
+
605
+
606
+
607
+
608
+
609
+
610
+
611
+
612
+
613
+
614
+
615
+
616
+
617
+
618
+ Deutsch & Gailly Informational [Page 11]
619
+