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,1588 @@
1
+ /*
2
+ * Copyright 2002-2023 The OpenSSL Project Authors. All Rights Reserved.
3
+ * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
4
+ *
5
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
6
+ * this file except in compliance with the License. You can obtain a copy
7
+ * in the file LICENSE in the source distribution or at
8
+ * https://www.openssl.org/source/license.html
9
+ */
10
+
11
+ #ifndef OPENSSL_EC_H
12
+ # define OPENSSL_EC_H
13
+ # pragma once
14
+
15
+ # include <openssl/macros.h>
16
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
17
+ # define HEADER_EC_H
18
+ # endif
19
+
20
+ # include <openssl/opensslconf.h>
21
+ # include <openssl/types.h>
22
+
23
+ # include <string.h>
24
+
25
+ # ifdef __cplusplus
26
+ extern "C" {
27
+ # endif
28
+
29
+ /* Values for EVP_PKEY_CTX_set_ec_param_enc() */
30
+ # define OPENSSL_EC_EXPLICIT_CURVE 0x000
31
+ # define OPENSSL_EC_NAMED_CURVE 0x001
32
+
33
+ int EVP_PKEY_CTX_set_ec_paramgen_curve_nid(EVP_PKEY_CTX *ctx, int nid);
34
+ int EVP_PKEY_CTX_set_ec_param_enc(EVP_PKEY_CTX *ctx, int param_enc);
35
+ int EVP_PKEY_CTX_set_ecdh_cofactor_mode(EVP_PKEY_CTX *ctx, int cofactor_mode);
36
+ int EVP_PKEY_CTX_get_ecdh_cofactor_mode(EVP_PKEY_CTX *ctx);
37
+
38
+ int EVP_PKEY_CTX_set_ecdh_kdf_type(EVP_PKEY_CTX *ctx, int kdf);
39
+ int EVP_PKEY_CTX_get_ecdh_kdf_type(EVP_PKEY_CTX *ctx);
40
+
41
+ int EVP_PKEY_CTX_set_ecdh_kdf_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
42
+ int EVP_PKEY_CTX_get_ecdh_kdf_md(EVP_PKEY_CTX *ctx, const EVP_MD **md);
43
+
44
+ int EVP_PKEY_CTX_set_ecdh_kdf_outlen(EVP_PKEY_CTX *ctx, int len);
45
+ int EVP_PKEY_CTX_get_ecdh_kdf_outlen(EVP_PKEY_CTX *ctx, int *len);
46
+
47
+ int EVP_PKEY_CTX_set0_ecdh_kdf_ukm(EVP_PKEY_CTX *ctx, unsigned char *ukm,
48
+ int len);
49
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
50
+ OSSL_DEPRECATEDIN_3_0
51
+ int EVP_PKEY_CTX_get0_ecdh_kdf_ukm(EVP_PKEY_CTX *ctx, unsigned char **ukm);
52
+ # endif
53
+
54
+ # define EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID (EVP_PKEY_ALG_CTRL + 1)
55
+ # define EVP_PKEY_CTRL_EC_PARAM_ENC (EVP_PKEY_ALG_CTRL + 2)
56
+ # define EVP_PKEY_CTRL_EC_ECDH_COFACTOR (EVP_PKEY_ALG_CTRL + 3)
57
+ # define EVP_PKEY_CTRL_EC_KDF_TYPE (EVP_PKEY_ALG_CTRL + 4)
58
+ # define EVP_PKEY_CTRL_EC_KDF_MD (EVP_PKEY_ALG_CTRL + 5)
59
+ # define EVP_PKEY_CTRL_GET_EC_KDF_MD (EVP_PKEY_ALG_CTRL + 6)
60
+ # define EVP_PKEY_CTRL_EC_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 7)
61
+ # define EVP_PKEY_CTRL_GET_EC_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 8)
62
+ # define EVP_PKEY_CTRL_EC_KDF_UKM (EVP_PKEY_ALG_CTRL + 9)
63
+ # define EVP_PKEY_CTRL_GET_EC_KDF_UKM (EVP_PKEY_ALG_CTRL + 10)
64
+
65
+ /* KDF types */
66
+ # define EVP_PKEY_ECDH_KDF_NONE 1
67
+ # define EVP_PKEY_ECDH_KDF_X9_63 2
68
+ /*
69
+ * The old name for EVP_PKEY_ECDH_KDF_X9_63
70
+ * The ECDH KDF specification has been mistakenly attributed to ANSI X9.62,
71
+ * it is actually specified in ANSI X9.63.
72
+ * This identifier is retained for backwards compatibility
73
+ */
74
+ # define EVP_PKEY_ECDH_KDF_X9_62 EVP_PKEY_ECDH_KDF_X9_63
75
+
76
+ /** Enum for the point conversion form as defined in X9.62 (ECDSA)
77
+ * for the encoding of a elliptic curve point (x,y) */
78
+ typedef enum {
79
+ /** the point is encoded as z||x, where the octet z specifies
80
+ * which solution of the quadratic equation y is */
81
+ POINT_CONVERSION_COMPRESSED = 2,
82
+ /** the point is encoded as z||x||y, where z is the octet 0x04 */
83
+ POINT_CONVERSION_UNCOMPRESSED = 4,
84
+ /** the point is encoded as z||x||y, where the octet z specifies
85
+ * which solution of the quadratic equation y is */
86
+ POINT_CONVERSION_HYBRID = 6
87
+ } point_conversion_form_t;
88
+
89
+ const char *OSSL_EC_curve_nid2name(int nid);
90
+
91
+ # ifndef OPENSSL_NO_STDIO
92
+ # include <stdio.h>
93
+ # endif
94
+ # ifndef OPENSSL_NO_EC
95
+ # include <openssl/asn1.h>
96
+ # include <openssl/symhacks.h>
97
+ # ifndef OPENSSL_NO_DEPRECATED_1_1_0
98
+ # include <openssl/bn.h>
99
+ # endif
100
+ # include <openssl/ecerr.h>
101
+
102
+ # ifndef OPENSSL_ECC_MAX_FIELD_BITS
103
+ # define OPENSSL_ECC_MAX_FIELD_BITS 661
104
+ # endif
105
+
106
+ # include <openssl/params.h>
107
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
108
+ typedef struct ec_method_st EC_METHOD;
109
+ # endif
110
+ typedef struct ec_group_st EC_GROUP;
111
+ typedef struct ec_point_st EC_POINT;
112
+ typedef struct ecpk_parameters_st ECPKPARAMETERS;
113
+ typedef struct ec_parameters_st ECPARAMETERS;
114
+
115
+ /********************************************************************/
116
+ /* EC_METHODs for curves over GF(p) */
117
+ /********************************************************************/
118
+
119
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
120
+ /** Returns the basic GFp ec methods which provides the basis for the
121
+ * optimized methods.
122
+ * \return EC_METHOD object
123
+ */
124
+ OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_GFp_simple_method(void);
125
+
126
+ /** Returns GFp methods using montgomery multiplication.
127
+ * \return EC_METHOD object
128
+ */
129
+ OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_GFp_mont_method(void);
130
+
131
+ /** Returns GFp methods using optimized methods for NIST recommended curves
132
+ * \return EC_METHOD object
133
+ */
134
+ OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_GFp_nist_method(void);
135
+
136
+ # ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
137
+ /** Returns 64-bit optimized methods for nistp224
138
+ * \return EC_METHOD object
139
+ */
140
+ OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_GFp_nistp224_method(void);
141
+
142
+ /** Returns 64-bit optimized methods for nistp256
143
+ * \return EC_METHOD object
144
+ */
145
+ OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_GFp_nistp256_method(void);
146
+
147
+ /** Returns 64-bit optimized methods for nistp521
148
+ * \return EC_METHOD object
149
+ */
150
+ OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_GFp_nistp521_method(void);
151
+ # endif /* OPENSSL_NO_EC_NISTP_64_GCC_128 */
152
+
153
+ # ifndef OPENSSL_NO_EC2M
154
+ /********************************************************************/
155
+ /* EC_METHOD for curves over GF(2^m) */
156
+ /********************************************************************/
157
+
158
+ /** Returns the basic GF2m ec method
159
+ * \return EC_METHOD object
160
+ */
161
+ OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_GF2m_simple_method(void);
162
+
163
+ # endif
164
+
165
+ /********************************************************************/
166
+ /* EC_GROUP functions */
167
+ /********************************************************************/
168
+
169
+ /**
170
+ * Creates a new EC_GROUP object
171
+ * \param meth EC_METHOD to use
172
+ * \return newly created EC_GROUP object or NULL in case of an error.
173
+ */
174
+ OSSL_DEPRECATEDIN_3_0 EC_GROUP *EC_GROUP_new(const EC_METHOD *meth);
175
+
176
+ /** Clears and frees a EC_GROUP object
177
+ * \param group EC_GROUP object to be cleared and freed.
178
+ */
179
+ OSSL_DEPRECATEDIN_3_0 void EC_GROUP_clear_free(EC_GROUP *group);
180
+
181
+ /** Returns the EC_METHOD of the EC_GROUP object.
182
+ * \param group EC_GROUP object
183
+ * \return EC_METHOD used in this EC_GROUP object.
184
+ */
185
+ OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group);
186
+
187
+ /** Returns the field type of the EC_METHOD.
188
+ * \param meth EC_METHOD object
189
+ * \return NID of the underlying field type OID.
190
+ */
191
+ OSSL_DEPRECATEDIN_3_0 int EC_METHOD_get_field_type(const EC_METHOD *meth);
192
+ # endif /* OPENSSL_NO_DEPRECATED_3_0 */
193
+
194
+ /** Frees a EC_GROUP object
195
+ * \param group EC_GROUP object to be freed.
196
+ */
197
+ void EC_GROUP_free(EC_GROUP *group);
198
+
199
+ /** Copies EC_GROUP objects. Note: both EC_GROUPs must use the same EC_METHOD.
200
+ * \param dst destination EC_GROUP object
201
+ * \param src source EC_GROUP object
202
+ * \return 1 on success and 0 if an error occurred.
203
+ */
204
+ int EC_GROUP_copy(EC_GROUP *dst, const EC_GROUP *src);
205
+
206
+ /** Creates a new EC_GROUP object and copies the content
207
+ * form src to the newly created EC_KEY object
208
+ * \param src source EC_GROUP object
209
+ * \return newly created EC_GROUP object or NULL in case of an error.
210
+ */
211
+ EC_GROUP *EC_GROUP_dup(const EC_GROUP *src);
212
+
213
+ /** Sets the generator and its order/cofactor of a EC_GROUP object.
214
+ * \param group EC_GROUP object
215
+ * \param generator EC_POINT object with the generator.
216
+ * \param order the order of the group generated by the generator.
217
+ * \param cofactor the index of the sub-group generated by the generator
218
+ * in the group of all points on the elliptic curve.
219
+ * \return 1 on success and 0 if an error occurred
220
+ */
221
+ int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator,
222
+ const BIGNUM *order, const BIGNUM *cofactor);
223
+
224
+ /** Returns the generator of a EC_GROUP object.
225
+ * \param group EC_GROUP object
226
+ * \return the currently used generator (possibly NULL).
227
+ */
228
+ const EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *group);
229
+
230
+ /** Returns the montgomery data for order(Generator)
231
+ * \param group EC_GROUP object
232
+ * \return the currently used montgomery data (possibly NULL).
233
+ */
234
+ BN_MONT_CTX *EC_GROUP_get_mont_data(const EC_GROUP *group);
235
+
236
+ /** Gets the order of a EC_GROUP
237
+ * \param group EC_GROUP object
238
+ * \param order BIGNUM to which the order is copied
239
+ * \param ctx unused
240
+ * \return 1 on success and 0 if an error occurred
241
+ */
242
+ int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx);
243
+
244
+ /** Gets the order of an EC_GROUP
245
+ * \param group EC_GROUP object
246
+ * \return the group order
247
+ */
248
+ const BIGNUM *EC_GROUP_get0_order(const EC_GROUP *group);
249
+
250
+ /** Gets the number of bits of the order of an EC_GROUP
251
+ * \param group EC_GROUP object
252
+ * \return number of bits of group order.
253
+ */
254
+ int EC_GROUP_order_bits(const EC_GROUP *group);
255
+
256
+ /** Gets the cofactor of a EC_GROUP
257
+ * \param group EC_GROUP object
258
+ * \param cofactor BIGNUM to which the cofactor is copied
259
+ * \param ctx unused
260
+ * \return 1 on success and 0 if an error occurred
261
+ */
262
+ int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor,
263
+ BN_CTX *ctx);
264
+
265
+ /** Gets the cofactor of an EC_GROUP
266
+ * \param group EC_GROUP object
267
+ * \return the group cofactor
268
+ */
269
+ const BIGNUM *EC_GROUP_get0_cofactor(const EC_GROUP *group);
270
+
271
+ /** Sets the name of a EC_GROUP object
272
+ * \param group EC_GROUP object
273
+ * \param nid NID of the curve name OID
274
+ */
275
+ void EC_GROUP_set_curve_name(EC_GROUP *group, int nid);
276
+
277
+ /** Returns the curve name of a EC_GROUP object
278
+ * \param group EC_GROUP object
279
+ * \return NID of the curve name OID or 0 if not set.
280
+ */
281
+ int EC_GROUP_get_curve_name(const EC_GROUP *group);
282
+
283
+ /** Gets the field of an EC_GROUP
284
+ * \param group EC_GROUP object
285
+ * \return the group field
286
+ */
287
+ const BIGNUM *EC_GROUP_get0_field(const EC_GROUP *group);
288
+
289
+ /** Returns the field type of the EC_GROUP.
290
+ * \param group EC_GROUP object
291
+ * \return NID of the underlying field type OID.
292
+ */
293
+ int EC_GROUP_get_field_type(const EC_GROUP *group);
294
+
295
+ void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag);
296
+ int EC_GROUP_get_asn1_flag(const EC_GROUP *group);
297
+
298
+ void EC_GROUP_set_point_conversion_form(EC_GROUP *group,
299
+ point_conversion_form_t form);
300
+ point_conversion_form_t EC_GROUP_get_point_conversion_form(const EC_GROUP *);
301
+
302
+ unsigned char *EC_GROUP_get0_seed(const EC_GROUP *x);
303
+ size_t EC_GROUP_get_seed_len(const EC_GROUP *);
304
+ size_t EC_GROUP_set_seed(EC_GROUP *, const unsigned char *, size_t len);
305
+
306
+ /** Sets the parameters of an ec curve defined by y^2 = x^3 + a*x + b (for GFp)
307
+ * or y^2 + x*y = x^3 + a*x^2 + b (for GF2m)
308
+ * \param group EC_GROUP object
309
+ * \param p BIGNUM with the prime number (GFp) or the polynomial
310
+ * defining the underlying field (GF2m)
311
+ * \param a BIGNUM with parameter a of the equation
312
+ * \param b BIGNUM with parameter b of the equation
313
+ * \param ctx BN_CTX object (optional)
314
+ * \return 1 on success and 0 if an error occurred
315
+ */
316
+ int EC_GROUP_set_curve(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a,
317
+ const BIGNUM *b, BN_CTX *ctx);
318
+
319
+ /** Gets the parameters of the ec curve defined by y^2 = x^3 + a*x + b (for GFp)
320
+ * or y^2 + x*y = x^3 + a*x^2 + b (for GF2m)
321
+ * \param group EC_GROUP object
322
+ * \param p BIGNUM with the prime number (GFp) or the polynomial
323
+ * defining the underlying field (GF2m)
324
+ * \param a BIGNUM for parameter a of the equation
325
+ * \param b BIGNUM for parameter b of the equation
326
+ * \param ctx BN_CTX object (optional)
327
+ * \return 1 on success and 0 if an error occurred
328
+ */
329
+ int EC_GROUP_get_curve(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b,
330
+ BN_CTX *ctx);
331
+
332
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
333
+ /** Sets the parameters of an ec curve. Synonym for EC_GROUP_set_curve
334
+ * \param group EC_GROUP object
335
+ * \param p BIGNUM with the prime number (GFp) or the polynomial
336
+ * defining the underlying field (GF2m)
337
+ * \param a BIGNUM with parameter a of the equation
338
+ * \param b BIGNUM with parameter b of the equation
339
+ * \param ctx BN_CTX object (optional)
340
+ * \return 1 on success and 0 if an error occurred
341
+ */
342
+ OSSL_DEPRECATEDIN_3_0 int EC_GROUP_set_curve_GFp(EC_GROUP *group,
343
+ const BIGNUM *p,
344
+ const BIGNUM *a,
345
+ const BIGNUM *b,
346
+ BN_CTX *ctx);
347
+
348
+ /** Gets the parameters of an ec curve. Synonym for EC_GROUP_get_curve
349
+ * \param group EC_GROUP object
350
+ * \param p BIGNUM with the prime number (GFp) or the polynomial
351
+ * defining the underlying field (GF2m)
352
+ * \param a BIGNUM for parameter a of the equation
353
+ * \param b BIGNUM for parameter b of the equation
354
+ * \param ctx BN_CTX object (optional)
355
+ * \return 1 on success and 0 if an error occurred
356
+ */
357
+ OSSL_DEPRECATEDIN_3_0 int EC_GROUP_get_curve_GFp(const EC_GROUP *group,
358
+ BIGNUM *p,
359
+ BIGNUM *a, BIGNUM *b,
360
+ BN_CTX *ctx);
361
+
362
+ # ifndef OPENSSL_NO_EC2M
363
+ /** Sets the parameter of an ec curve. Synonym for EC_GROUP_set_curve
364
+ * \param group EC_GROUP object
365
+ * \param p BIGNUM with the prime number (GFp) or the polynomial
366
+ * defining the underlying field (GF2m)
367
+ * \param a BIGNUM with parameter a of the equation
368
+ * \param b BIGNUM with parameter b of the equation
369
+ * \param ctx BN_CTX object (optional)
370
+ * \return 1 on success and 0 if an error occurred
371
+ */
372
+ OSSL_DEPRECATEDIN_3_0 int EC_GROUP_set_curve_GF2m(EC_GROUP *group,
373
+ const BIGNUM *p,
374
+ const BIGNUM *a,
375
+ const BIGNUM *b,
376
+ BN_CTX *ctx);
377
+
378
+ /** Gets the parameters of an ec curve. Synonym for EC_GROUP_get_curve
379
+ * \param group EC_GROUP object
380
+ * \param p BIGNUM with the prime number (GFp) or the polynomial
381
+ * defining the underlying field (GF2m)
382
+ * \param a BIGNUM for parameter a of the equation
383
+ * \param b BIGNUM for parameter b of the equation
384
+ * \param ctx BN_CTX object (optional)
385
+ * \return 1 on success and 0 if an error occurred
386
+ */
387
+ OSSL_DEPRECATEDIN_3_0 int EC_GROUP_get_curve_GF2m(const EC_GROUP *group,
388
+ BIGNUM *p,
389
+ BIGNUM *a, BIGNUM *b,
390
+ BN_CTX *ctx);
391
+ # endif /* OPENSSL_NO_EC2M */
392
+ # endif /* OPENSSL_NO_DEPRECATED_3_0 */
393
+
394
+ /** Returns the number of bits needed to represent a field element
395
+ * \param group EC_GROUP object
396
+ * \return number of bits needed to represent a field element
397
+ */
398
+ int EC_GROUP_get_degree(const EC_GROUP *group);
399
+
400
+ /** Checks whether the parameter in the EC_GROUP define a valid ec group
401
+ * \param group EC_GROUP object
402
+ * \param ctx BN_CTX object (optional)
403
+ * \return 1 if group is a valid ec group and 0 otherwise
404
+ */
405
+ int EC_GROUP_check(const EC_GROUP *group, BN_CTX *ctx);
406
+
407
+ /** Checks whether the discriminant of the elliptic curve is zero or not
408
+ * \param group EC_GROUP object
409
+ * \param ctx BN_CTX object (optional)
410
+ * \return 1 if the discriminant is not zero and 0 otherwise
411
+ */
412
+ int EC_GROUP_check_discriminant(const EC_GROUP *group, BN_CTX *ctx);
413
+
414
+ /** Compares two EC_GROUP objects
415
+ * \param a first EC_GROUP object
416
+ * \param b second EC_GROUP object
417
+ * \param ctx BN_CTX object (optional)
418
+ * \return 0 if the groups are equal, 1 if not, or -1 on error
419
+ */
420
+ int EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ctx);
421
+
422
+ /*
423
+ * EC_GROUP_new_GF*() calls EC_GROUP_new() and EC_GROUP_set_GF*() after
424
+ * choosing an appropriate EC_METHOD
425
+ */
426
+
427
+ /** Creates a new EC_GROUP object with the specified parameters defined
428
+ * over GFp (defined by the equation y^2 = x^3 + a*x + b)
429
+ * \param p BIGNUM with the prime number
430
+ * \param a BIGNUM with the parameter a of the equation
431
+ * \param b BIGNUM with the parameter b of the equation
432
+ * \param ctx BN_CTX object (optional)
433
+ * \return newly created EC_GROUP object with the specified parameters
434
+ */
435
+ EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a,
436
+ const BIGNUM *b, BN_CTX *ctx);
437
+ # ifndef OPENSSL_NO_EC2M
438
+ /** Creates a new EC_GROUP object with the specified parameters defined
439
+ * over GF2m (defined by the equation y^2 + x*y = x^3 + a*x^2 + b)
440
+ * \param p BIGNUM with the polynomial defining the underlying field
441
+ * \param a BIGNUM with the parameter a of the equation
442
+ * \param b BIGNUM with the parameter b of the equation
443
+ * \param ctx BN_CTX object (optional)
444
+ * \return newly created EC_GROUP object with the specified parameters
445
+ */
446
+ EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a,
447
+ const BIGNUM *b, BN_CTX *ctx);
448
+ # endif
449
+
450
+ /**
451
+ * Creates a EC_GROUP object with a curve specified by parameters.
452
+ * The parameters may be explicit or a named curve,
453
+ * \param params A list of parameters describing the group.
454
+ * \param libctx The associated library context or NULL for the default
455
+ * context
456
+ * \param propq A property query string
457
+ * \return newly created EC_GROUP object with specified parameters or NULL
458
+ * if an error occurred
459
+ */
460
+ EC_GROUP *EC_GROUP_new_from_params(const OSSL_PARAM params[],
461
+ OSSL_LIB_CTX *libctx, const char *propq);
462
+
463
+ /**
464
+ * Creates an OSSL_PARAM array with the parameters describing the given
465
+ * EC_GROUP.
466
+ * The resulting parameters may contain an explicit or a named curve depending
467
+ * on the EC_GROUP.
468
+ * \param group pointer to the EC_GROUP object
469
+ * \param libctx The associated library context or NULL for the default
470
+ * context
471
+ * \param propq A property query string
472
+ * \param bnctx BN_CTX object (optional)
473
+ * \return newly created OSSL_PARAM array with the parameters
474
+ * describing the given EC_GROUP or NULL if an error occurred
475
+ */
476
+ OSSL_PARAM *EC_GROUP_to_params(const EC_GROUP *group, OSSL_LIB_CTX *libctx,
477
+ const char *propq, BN_CTX *bnctx);
478
+
479
+ /**
480
+ * Creates a EC_GROUP object with a curve specified by a NID
481
+ * \param libctx The associated library context or NULL for the default
482
+ * context
483
+ * \param propq A property query string
484
+ * \param nid NID of the OID of the curve name
485
+ * \return newly created EC_GROUP object with specified curve or NULL
486
+ * if an error occurred
487
+ */
488
+ EC_GROUP *EC_GROUP_new_by_curve_name_ex(OSSL_LIB_CTX *libctx, const char *propq,
489
+ int nid);
490
+
491
+ /**
492
+ * Creates a EC_GROUP object with a curve specified by a NID. Same as
493
+ * EC_GROUP_new_by_curve_name_ex but the libctx and propq are always
494
+ * NULL.
495
+ * \param nid NID of the OID of the curve name
496
+ * \return newly created EC_GROUP object with specified curve or NULL
497
+ * if an error occurred
498
+ */
499
+ EC_GROUP *EC_GROUP_new_by_curve_name(int nid);
500
+
501
+ /** Creates a new EC_GROUP object from an ECPARAMETERS object
502
+ * \param params pointer to the ECPARAMETERS object
503
+ * \return newly created EC_GROUP object with specified curve or NULL
504
+ * if an error occurred
505
+ */
506
+ EC_GROUP *EC_GROUP_new_from_ecparameters(const ECPARAMETERS *params);
507
+
508
+ /** Creates an ECPARAMETERS object for the given EC_GROUP object.
509
+ * \param group pointer to the EC_GROUP object
510
+ * \param params pointer to an existing ECPARAMETERS object or NULL
511
+ * \return pointer to the new ECPARAMETERS object or NULL
512
+ * if an error occurred.
513
+ */
514
+ ECPARAMETERS *EC_GROUP_get_ecparameters(const EC_GROUP *group,
515
+ ECPARAMETERS *params);
516
+
517
+ /** Creates a new EC_GROUP object from an ECPKPARAMETERS object
518
+ * \param params pointer to an existing ECPKPARAMETERS object, or NULL
519
+ * \return newly created EC_GROUP object with specified curve, or NULL
520
+ * if an error occurred
521
+ */
522
+ EC_GROUP *EC_GROUP_new_from_ecpkparameters(const ECPKPARAMETERS *params);
523
+
524
+ /** Creates an ECPKPARAMETERS object for the given EC_GROUP object.
525
+ * \param group pointer to the EC_GROUP object
526
+ * \param params pointer to an existing ECPKPARAMETERS object or NULL
527
+ * \return pointer to the new ECPKPARAMETERS object or NULL
528
+ * if an error occurred.
529
+ */
530
+ ECPKPARAMETERS *EC_GROUP_get_ecpkparameters(const EC_GROUP *group,
531
+ ECPKPARAMETERS *params);
532
+
533
+ /********************************************************************/
534
+ /* handling of internal curves */
535
+ /********************************************************************/
536
+
537
+ typedef struct {
538
+ int nid;
539
+ const char *comment;
540
+ } EC_builtin_curve;
541
+
542
+ /*
543
+ * EC_builtin_curves(EC_builtin_curve *r, size_t size) returns number of all
544
+ * available curves or zero if a error occurred. In case r is not zero,
545
+ * nitems EC_builtin_curve structures are filled with the data of the first
546
+ * nitems internal groups
547
+ */
548
+ size_t EC_get_builtin_curves(EC_builtin_curve *r, size_t nitems);
549
+
550
+ const char *EC_curve_nid2nist(int nid);
551
+ int EC_curve_nist2nid(const char *name);
552
+ int EC_GROUP_check_named_curve(const EC_GROUP *group, int nist_only,
553
+ BN_CTX *ctx);
554
+
555
+ /********************************************************************/
556
+ /* EC_POINT functions */
557
+ /********************************************************************/
558
+
559
+ /** Creates a new EC_POINT object for the specified EC_GROUP
560
+ * \param group EC_GROUP the underlying EC_GROUP object
561
+ * \return newly created EC_POINT object or NULL if an error occurred
562
+ */
563
+ EC_POINT *EC_POINT_new(const EC_GROUP *group);
564
+
565
+ /** Frees a EC_POINT object
566
+ * \param point EC_POINT object to be freed
567
+ */
568
+ void EC_POINT_free(EC_POINT *point);
569
+
570
+ /** Clears and frees a EC_POINT object
571
+ * \param point EC_POINT object to be cleared and freed
572
+ */
573
+ void EC_POINT_clear_free(EC_POINT *point);
574
+
575
+ /** Copies EC_POINT object
576
+ * \param dst destination EC_POINT object
577
+ * \param src source EC_POINT object
578
+ * \return 1 on success and 0 if an error occurred
579
+ */
580
+ int EC_POINT_copy(EC_POINT *dst, const EC_POINT *src);
581
+
582
+ /** Creates a new EC_POINT object and copies the content of the supplied
583
+ * EC_POINT
584
+ * \param src source EC_POINT object
585
+ * \param group underlying the EC_GROUP object
586
+ * \return newly created EC_POINT object or NULL if an error occurred
587
+ */
588
+ EC_POINT *EC_POINT_dup(const EC_POINT *src, const EC_GROUP *group);
589
+
590
+ /** Sets a point to infinity (neutral element)
591
+ * \param group underlying EC_GROUP object
592
+ * \param point EC_POINT to set to infinity
593
+ * \return 1 on success and 0 if an error occurred
594
+ */
595
+ int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point);
596
+
597
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
598
+ /** Returns the EC_METHOD used in EC_POINT object
599
+ * \param point EC_POINT object
600
+ * \return the EC_METHOD used
601
+ */
602
+ OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_POINT_method_of(const EC_POINT *point);
603
+
604
+ /** Sets the jacobian projective coordinates of a EC_POINT over GFp
605
+ * \param group underlying EC_GROUP object
606
+ * \param p EC_POINT object
607
+ * \param x BIGNUM with the x-coordinate
608
+ * \param y BIGNUM with the y-coordinate
609
+ * \param z BIGNUM with the z-coordinate
610
+ * \param ctx BN_CTX object (optional)
611
+ * \return 1 on success and 0 if an error occurred
612
+ */
613
+ OSSL_DEPRECATEDIN_3_0 int EC_POINT_set_Jprojective_coordinates_GFp
614
+ (const EC_GROUP *group, EC_POINT *p,
615
+ const BIGNUM *x, const BIGNUM *y, const BIGNUM *z,
616
+ BN_CTX *ctx);
617
+
618
+ /** Gets the jacobian projective coordinates of a EC_POINT over GFp
619
+ * \param group underlying EC_GROUP object
620
+ * \param p EC_POINT object
621
+ * \param x BIGNUM for the x-coordinate
622
+ * \param y BIGNUM for the y-coordinate
623
+ * \param z BIGNUM for the z-coordinate
624
+ * \param ctx BN_CTX object (optional)
625
+ * \return 1 on success and 0 if an error occurred
626
+ */
627
+ OSSL_DEPRECATEDIN_3_0 int EC_POINT_get_Jprojective_coordinates_GFp
628
+ (const EC_GROUP *group, const EC_POINT *p,
629
+ BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx);
630
+ # endif /* OPENSSL_NO_DEPRECATED_3_0 */
631
+
632
+ /** Sets the affine coordinates of an EC_POINT
633
+ * \param group underlying EC_GROUP object
634
+ * \param p EC_POINT object
635
+ * \param x BIGNUM with the x-coordinate
636
+ * \param y BIGNUM with the y-coordinate
637
+ * \param ctx BN_CTX object (optional)
638
+ * \return 1 on success and 0 if an error occurred
639
+ */
640
+ int EC_POINT_set_affine_coordinates(const EC_GROUP *group, EC_POINT *p,
641
+ const BIGNUM *x, const BIGNUM *y,
642
+ BN_CTX *ctx);
643
+
644
+ /** Gets the affine coordinates of an EC_POINT.
645
+ * \param group underlying EC_GROUP object
646
+ * \param p EC_POINT object
647
+ * \param x BIGNUM for the x-coordinate
648
+ * \param y BIGNUM for the y-coordinate
649
+ * \param ctx BN_CTX object (optional)
650
+ * \return 1 on success and 0 if an error occurred
651
+ */
652
+ int EC_POINT_get_affine_coordinates(const EC_GROUP *group, const EC_POINT *p,
653
+ BIGNUM *x, BIGNUM *y, BN_CTX *ctx);
654
+
655
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
656
+ /** Sets the affine coordinates of an EC_POINT. A synonym of
657
+ * EC_POINT_set_affine_coordinates
658
+ * \param group underlying EC_GROUP object
659
+ * \param p EC_POINT object
660
+ * \param x BIGNUM with the x-coordinate
661
+ * \param y BIGNUM with the y-coordinate
662
+ * \param ctx BN_CTX object (optional)
663
+ * \return 1 on success and 0 if an error occurred
664
+ */
665
+ OSSL_DEPRECATEDIN_3_0 int EC_POINT_set_affine_coordinates_GFp
666
+ (const EC_GROUP *group, EC_POINT *p,
667
+ const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx);
668
+
669
+ /** Gets the affine coordinates of an EC_POINT. A synonym of
670
+ * EC_POINT_get_affine_coordinates
671
+ * \param group underlying EC_GROUP object
672
+ * \param p EC_POINT object
673
+ * \param x BIGNUM for the x-coordinate
674
+ * \param y BIGNUM for the y-coordinate
675
+ * \param ctx BN_CTX object (optional)
676
+ * \return 1 on success and 0 if an error occurred
677
+ */
678
+ OSSL_DEPRECATEDIN_3_0 int EC_POINT_get_affine_coordinates_GFp
679
+ (const EC_GROUP *group, const EC_POINT *p,
680
+ BIGNUM *x, BIGNUM *y, BN_CTX *ctx);
681
+ # endif /* OPENSSL_NO_DEPRECATED_3_0 */
682
+
683
+ /** Sets the x9.62 compressed coordinates of a EC_POINT
684
+ * \param group underlying EC_GROUP object
685
+ * \param p EC_POINT object
686
+ * \param x BIGNUM with x-coordinate
687
+ * \param y_bit integer with the y-Bit (either 0 or 1)
688
+ * \param ctx BN_CTX object (optional)
689
+ * \return 1 on success and 0 if an error occurred
690
+ */
691
+ int EC_POINT_set_compressed_coordinates(const EC_GROUP *group, EC_POINT *p,
692
+ const BIGNUM *x, int y_bit,
693
+ BN_CTX *ctx);
694
+
695
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
696
+ /** Sets the x9.62 compressed coordinates of a EC_POINT. A synonym of
697
+ * EC_POINT_set_compressed_coordinates
698
+ * \param group underlying EC_GROUP object
699
+ * \param p EC_POINT object
700
+ * \param x BIGNUM with x-coordinate
701
+ * \param y_bit integer with the y-Bit (either 0 or 1)
702
+ * \param ctx BN_CTX object (optional)
703
+ * \return 1 on success and 0 if an error occurred
704
+ */
705
+ OSSL_DEPRECATEDIN_3_0 int EC_POINT_set_compressed_coordinates_GFp
706
+ (const EC_GROUP *group, EC_POINT *p,
707
+ const BIGNUM *x, int y_bit, BN_CTX *ctx);
708
+ # ifndef OPENSSL_NO_EC2M
709
+ /** Sets the affine coordinates of an EC_POINT. A synonym of
710
+ * EC_POINT_set_affine_coordinates
711
+ * \param group underlying EC_GROUP object
712
+ * \param p EC_POINT object
713
+ * \param x BIGNUM with the x-coordinate
714
+ * \param y BIGNUM with the y-coordinate
715
+ * \param ctx BN_CTX object (optional)
716
+ * \return 1 on success and 0 if an error occurred
717
+ */
718
+ OSSL_DEPRECATEDIN_3_0 int EC_POINT_set_affine_coordinates_GF2m
719
+ (const EC_GROUP *group, EC_POINT *p,
720
+ const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx);
721
+
722
+ /** Gets the affine coordinates of an EC_POINT. A synonym of
723
+ * EC_POINT_get_affine_coordinates
724
+ * \param group underlying EC_GROUP object
725
+ * \param p EC_POINT object
726
+ * \param x BIGNUM for the x-coordinate
727
+ * \param y BIGNUM for the y-coordinate
728
+ * \param ctx BN_CTX object (optional)
729
+ * \return 1 on success and 0 if an error occurred
730
+ */
731
+ OSSL_DEPRECATEDIN_3_0 int EC_POINT_get_affine_coordinates_GF2m
732
+ (const EC_GROUP *group, const EC_POINT *p,
733
+ BIGNUM *x, BIGNUM *y, BN_CTX *ctx);
734
+
735
+ /** Sets the x9.62 compressed coordinates of a EC_POINT. A synonym of
736
+ * EC_POINT_set_compressed_coordinates
737
+ * \param group underlying EC_GROUP object
738
+ * \param p EC_POINT object
739
+ * \param x BIGNUM with x-coordinate
740
+ * \param y_bit integer with the y-Bit (either 0 or 1)
741
+ * \param ctx BN_CTX object (optional)
742
+ * \return 1 on success and 0 if an error occurred
743
+ */
744
+ OSSL_DEPRECATEDIN_3_0 int EC_POINT_set_compressed_coordinates_GF2m
745
+ (const EC_GROUP *group, EC_POINT *p,
746
+ const BIGNUM *x, int y_bit, BN_CTX *ctx);
747
+ # endif
748
+ # endif /* OPENSSL_NO_DEPRECATED_3_0 */
749
+
750
+ /** Encodes a EC_POINT object to a octet string
751
+ * \param group underlying EC_GROUP object
752
+ * \param p EC_POINT object
753
+ * \param form point conversion form
754
+ * \param buf memory buffer for the result. If NULL the function returns
755
+ * required buffer size.
756
+ * \param len length of the memory buffer
757
+ * \param ctx BN_CTX object (optional)
758
+ * \return the length of the encoded octet string or 0 if an error occurred
759
+ */
760
+ size_t EC_POINT_point2oct(const EC_GROUP *group, const EC_POINT *p,
761
+ point_conversion_form_t form,
762
+ unsigned char *buf, size_t len, BN_CTX *ctx);
763
+
764
+ /** Decodes a EC_POINT from a octet string
765
+ * \param group underlying EC_GROUP object
766
+ * \param p EC_POINT object
767
+ * \param buf memory buffer with the encoded ec point
768
+ * \param len length of the encoded ec point
769
+ * \param ctx BN_CTX object (optional)
770
+ * \return 1 on success and 0 if an error occurred
771
+ */
772
+ int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *p,
773
+ const unsigned char *buf, size_t len, BN_CTX *ctx);
774
+
775
+ /** Encodes an EC_POINT object to an allocated octet string
776
+ * \param group underlying EC_GROUP object
777
+ * \param point EC_POINT object
778
+ * \param form point conversion form
779
+ * \param pbuf returns pointer to allocated buffer
780
+ * \param ctx BN_CTX object (optional)
781
+ * \return the length of the encoded octet string or 0 if an error occurred
782
+ */
783
+ size_t EC_POINT_point2buf(const EC_GROUP *group, const EC_POINT *point,
784
+ point_conversion_form_t form,
785
+ unsigned char **pbuf, BN_CTX *ctx);
786
+
787
+ /* other interfaces to point2oct/oct2point: */
788
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
789
+ OSSL_DEPRECATEDIN_3_0 BIGNUM *EC_POINT_point2bn(const EC_GROUP *,
790
+ const EC_POINT *,
791
+ point_conversion_form_t form,
792
+ BIGNUM *, BN_CTX *);
793
+ OSSL_DEPRECATEDIN_3_0 EC_POINT *EC_POINT_bn2point(const EC_GROUP *,
794
+ const BIGNUM *,
795
+ EC_POINT *, BN_CTX *);
796
+ # endif /* OPENSSL_NO_DEPRECATED_3_0 */
797
+
798
+ char *EC_POINT_point2hex(const EC_GROUP *, const EC_POINT *,
799
+ point_conversion_form_t form, BN_CTX *);
800
+ EC_POINT *EC_POINT_hex2point(const EC_GROUP *, const char *,
801
+ EC_POINT *, BN_CTX *);
802
+
803
+ /********************************************************************/
804
+ /* functions for doing EC_POINT arithmetic */
805
+ /********************************************************************/
806
+
807
+ /** Computes the sum of two EC_POINT
808
+ * \param group underlying EC_GROUP object
809
+ * \param r EC_POINT object for the result (r = a + b)
810
+ * \param a EC_POINT object with the first summand
811
+ * \param b EC_POINT object with the second summand
812
+ * \param ctx BN_CTX object (optional)
813
+ * \return 1 on success and 0 if an error occurred
814
+ */
815
+ int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,
816
+ const EC_POINT *b, BN_CTX *ctx);
817
+
818
+ /** Computes the double of a EC_POINT
819
+ * \param group underlying EC_GROUP object
820
+ * \param r EC_POINT object for the result (r = 2 * a)
821
+ * \param a EC_POINT object
822
+ * \param ctx BN_CTX object (optional)
823
+ * \return 1 on success and 0 if an error occurred
824
+ */
825
+ int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,
826
+ BN_CTX *ctx);
827
+
828
+ /** Computes the inverse of a EC_POINT
829
+ * \param group underlying EC_GROUP object
830
+ * \param a EC_POINT object to be inverted (it's used for the result as well)
831
+ * \param ctx BN_CTX object (optional)
832
+ * \return 1 on success and 0 if an error occurred
833
+ */
834
+ int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx);
835
+
836
+ /** Checks whether the point is the neutral element of the group
837
+ * \param group the underlying EC_GROUP object
838
+ * \param p EC_POINT object
839
+ * \return 1 if the point is the neutral element and 0 otherwise
840
+ */
841
+ int EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *p);
842
+
843
+ /** Checks whether the point is on the curve
844
+ * \param group underlying EC_GROUP object
845
+ * \param point EC_POINT object to check
846
+ * \param ctx BN_CTX object (optional)
847
+ * \return 1 if the point is on the curve, 0 if not, or -1 on error
848
+ */
849
+ int EC_POINT_is_on_curve(const EC_GROUP *group, const EC_POINT *point,
850
+ BN_CTX *ctx);
851
+
852
+ /** Compares two EC_POINTs
853
+ * \param group underlying EC_GROUP object
854
+ * \param a first EC_POINT object
855
+ * \param b second EC_POINT object
856
+ * \param ctx BN_CTX object (optional)
857
+ * \return 1 if the points are not equal, 0 if they are, or -1 on error
858
+ */
859
+ int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b,
860
+ BN_CTX *ctx);
861
+
862
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
863
+ OSSL_DEPRECATEDIN_3_0 int EC_POINT_make_affine(const EC_GROUP *group,
864
+ EC_POINT *point, BN_CTX *ctx);
865
+ OSSL_DEPRECATEDIN_3_0 int EC_POINTs_make_affine(const EC_GROUP *group, size_t num,
866
+ EC_POINT *points[], BN_CTX *ctx);
867
+
868
+ /** Computes r = generator * n + sum_{i=0}^{num-1} p[i] * m[i]
869
+ * \param group underlying EC_GROUP object
870
+ * \param r EC_POINT object for the result
871
+ * \param n BIGNUM with the multiplier for the group generator (optional)
872
+ * \param num number further summands
873
+ * \param p array of size num of EC_POINT objects
874
+ * \param m array of size num of BIGNUM objects
875
+ * \param ctx BN_CTX object (optional)
876
+ * \return 1 on success and 0 if an error occurred
877
+ */
878
+ OSSL_DEPRECATEDIN_3_0 int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r,
879
+ const BIGNUM *n, size_t num,
880
+ const EC_POINT *p[], const BIGNUM *m[],
881
+ BN_CTX *ctx);
882
+ # endif /* OPENSSL_NO_DEPRECATED_3_0 */
883
+
884
+ /** Computes r = generator * n + q * m
885
+ * \param group underlying EC_GROUP object
886
+ * \param r EC_POINT object for the result
887
+ * \param n BIGNUM with the multiplier for the group generator (optional)
888
+ * \param q EC_POINT object with the first factor of the second summand
889
+ * \param m BIGNUM with the second factor of the second summand
890
+ * \param ctx BN_CTX object (optional)
891
+ * \return 1 on success and 0 if an error occurred
892
+ */
893
+ int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n,
894
+ const EC_POINT *q, const BIGNUM *m, BN_CTX *ctx);
895
+
896
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
897
+ /** Stores multiples of generator for faster point multiplication
898
+ * \param group EC_GROUP object
899
+ * \param ctx BN_CTX object (optional)
900
+ * \return 1 on success and 0 if an error occurred
901
+ */
902
+ OSSL_DEPRECATEDIN_3_0 int EC_GROUP_precompute_mult(EC_GROUP *group, BN_CTX *ctx);
903
+
904
+ /** Reports whether a precomputation has been done
905
+ * \param group EC_GROUP object
906
+ * \return 1 if a pre-computation has been done and 0 otherwise
907
+ */
908
+ OSSL_DEPRECATEDIN_3_0 int EC_GROUP_have_precompute_mult(const EC_GROUP *group);
909
+ # endif /* OPENSSL_NO_DEPRECATED_3_0 */
910
+
911
+ /********************************************************************/
912
+ /* ASN1 stuff */
913
+ /********************************************************************/
914
+
915
+ DECLARE_ASN1_ITEM(ECPKPARAMETERS)
916
+ DECLARE_ASN1_ALLOC_FUNCTIONS(ECPKPARAMETERS)
917
+ DECLARE_ASN1_ITEM(ECPARAMETERS)
918
+ DECLARE_ASN1_ALLOC_FUNCTIONS(ECPARAMETERS)
919
+
920
+ /*
921
+ * EC_GROUP_get_basis_type() returns the NID of the basis type used to
922
+ * represent the field elements
923
+ */
924
+ int EC_GROUP_get_basis_type(const EC_GROUP *);
925
+ # ifndef OPENSSL_NO_EC2M
926
+ int EC_GROUP_get_trinomial_basis(const EC_GROUP *, unsigned int *k);
927
+ int EC_GROUP_get_pentanomial_basis(const EC_GROUP *, unsigned int *k1,
928
+ unsigned int *k2, unsigned int *k3);
929
+ # endif
930
+
931
+ EC_GROUP *d2i_ECPKParameters(EC_GROUP **, const unsigned char **in, long len);
932
+ int i2d_ECPKParameters(const EC_GROUP *, unsigned char **out);
933
+
934
+ # define d2i_ECPKParameters_bio(bp,x) \
935
+ ASN1_d2i_bio_of(EC_GROUP, NULL, d2i_ECPKParameters, bp, x)
936
+ # define i2d_ECPKParameters_bio(bp,x) \
937
+ ASN1_i2d_bio_of(EC_GROUP, i2d_ECPKParameters, bp, x)
938
+ # define d2i_ECPKParameters_fp(fp,x) \
939
+ (EC_GROUP *)ASN1_d2i_fp(NULL, (d2i_of_void *)d2i_ECPKParameters, (fp), \
940
+ (void **)(x))
941
+ # define i2d_ECPKParameters_fp(fp,x) \
942
+ ASN1_i2d_fp((i2d_of_void *)i2d_ECPKParameters, (fp), (void *)(x))
943
+
944
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
945
+ OSSL_DEPRECATEDIN_3_0 int ECPKParameters_print(BIO *bp, const EC_GROUP *x,
946
+ int off);
947
+ # ifndef OPENSSL_NO_STDIO
948
+ OSSL_DEPRECATEDIN_3_0 int ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x,
949
+ int off);
950
+ # endif
951
+ # endif /* OPENSSL_NO_DEPRECATED_3_0 */
952
+
953
+ /********************************************************************/
954
+ /* EC_KEY functions */
955
+ /********************************************************************/
956
+
957
+ /* some values for the encoding_flag */
958
+ # define EC_PKEY_NO_PARAMETERS 0x001
959
+ # define EC_PKEY_NO_PUBKEY 0x002
960
+
961
+ /* some values for the flags field */
962
+ # define EC_FLAG_SM2_RANGE 0x0004
963
+ # define EC_FLAG_COFACTOR_ECDH 0x1000
964
+ # define EC_FLAG_CHECK_NAMED_GROUP 0x2000
965
+ # define EC_FLAG_CHECK_NAMED_GROUP_NIST 0x4000
966
+ # define EC_FLAG_CHECK_NAMED_GROUP_MASK \
967
+ (EC_FLAG_CHECK_NAMED_GROUP | EC_FLAG_CHECK_NAMED_GROUP_NIST)
968
+
969
+ /* Deprecated flags - it was using 0x01..0x02 */
970
+ # define EC_FLAG_NON_FIPS_ALLOW 0x0000
971
+ # define EC_FLAG_FIPS_CHECKED 0x0000
972
+
973
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
974
+ /**
975
+ * Creates a new EC_KEY object.
976
+ * \param ctx The library context for to use for this EC_KEY. May be NULL in
977
+ * which case the default library context is used.
978
+ * \return EC_KEY object or NULL if an error occurred.
979
+ */
980
+ OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_new_ex(OSSL_LIB_CTX *ctx, const char *propq);
981
+
982
+ /**
983
+ * Creates a new EC_KEY object. Same as calling EC_KEY_new_ex with a
984
+ * NULL library context
985
+ * \return EC_KEY object or NULL if an error occurred.
986
+ */
987
+ OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_new(void);
988
+
989
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_get_flags(const EC_KEY *key);
990
+
991
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_set_flags(EC_KEY *key, int flags);
992
+
993
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_clear_flags(EC_KEY *key, int flags);
994
+
995
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_decoded_from_explicit_params(const EC_KEY *key);
996
+
997
+ /**
998
+ * Creates a new EC_KEY object using a named curve as underlying
999
+ * EC_GROUP object.
1000
+ * \param ctx The library context for to use for this EC_KEY. May be NULL in
1001
+ * which case the default library context is used.
1002
+ * \param propq Any property query string
1003
+ * \param nid NID of the named curve.
1004
+ * \return EC_KEY object or NULL if an error occurred.
1005
+ */
1006
+ OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_new_by_curve_name_ex(OSSL_LIB_CTX *ctx,
1007
+ const char *propq,
1008
+ int nid);
1009
+
1010
+ /**
1011
+ * Creates a new EC_KEY object using a named curve as underlying
1012
+ * EC_GROUP object. Same as calling EC_KEY_new_by_curve_name_ex with a NULL
1013
+ * library context and property query string.
1014
+ * \param nid NID of the named curve.
1015
+ * \return EC_KEY object or NULL if an error occurred.
1016
+ */
1017
+ OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_new_by_curve_name(int nid);
1018
+
1019
+ /** Frees a EC_KEY object.
1020
+ * \param key EC_KEY object to be freed.
1021
+ */
1022
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_free(EC_KEY *key);
1023
+
1024
+ /** Copies a EC_KEY object.
1025
+ * \param dst destination EC_KEY object
1026
+ * \param src src EC_KEY object
1027
+ * \return dst or NULL if an error occurred.
1028
+ */
1029
+ OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_copy(EC_KEY *dst, const EC_KEY *src);
1030
+
1031
+ /** Creates a new EC_KEY object and copies the content from src to it.
1032
+ * \param src the source EC_KEY object
1033
+ * \return newly created EC_KEY object or NULL if an error occurred.
1034
+ */
1035
+ OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_dup(const EC_KEY *src);
1036
+
1037
+ /** Increases the internal reference count of a EC_KEY object.
1038
+ * \param key EC_KEY object
1039
+ * \return 1 on success and 0 if an error occurred.
1040
+ */
1041
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_up_ref(EC_KEY *key);
1042
+
1043
+ /** Returns the ENGINE object of a EC_KEY object
1044
+ * \param eckey EC_KEY object
1045
+ * \return the ENGINE object (possibly NULL).
1046
+ */
1047
+ OSSL_DEPRECATEDIN_3_0 ENGINE *EC_KEY_get0_engine(const EC_KEY *eckey);
1048
+
1049
+ /** Returns the EC_GROUP object of a EC_KEY object
1050
+ * \param key EC_KEY object
1051
+ * \return the EC_GROUP object (possibly NULL).
1052
+ */
1053
+ OSSL_DEPRECATEDIN_3_0 const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key);
1054
+
1055
+ /** Sets the EC_GROUP of a EC_KEY object.
1056
+ * \param key EC_KEY object
1057
+ * \param group EC_GROUP to use in the EC_KEY object (note: the EC_KEY
1058
+ * object will use an own copy of the EC_GROUP).
1059
+ * \return 1 on success and 0 if an error occurred.
1060
+ */
1061
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_set_group(EC_KEY *key, const EC_GROUP *group);
1062
+
1063
+ /** Returns the private key of a EC_KEY object.
1064
+ * \param key EC_KEY object
1065
+ * \return a BIGNUM with the private key (possibly NULL).
1066
+ */
1067
+ OSSL_DEPRECATEDIN_3_0 const BIGNUM *EC_KEY_get0_private_key(const EC_KEY *key);
1068
+
1069
+ /** Sets the private key of a EC_KEY object.
1070
+ * \param key EC_KEY object
1071
+ * \param prv BIGNUM with the private key (note: the EC_KEY object
1072
+ * will use an own copy of the BIGNUM).
1073
+ * \return 1 on success and 0 if an error occurred.
1074
+ */
1075
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_set_private_key(EC_KEY *key, const BIGNUM *prv);
1076
+
1077
+ /** Returns the public key of a EC_KEY object.
1078
+ * \param key the EC_KEY object
1079
+ * \return a EC_POINT object with the public key (possibly NULL)
1080
+ */
1081
+ OSSL_DEPRECATEDIN_3_0 const EC_POINT *EC_KEY_get0_public_key(const EC_KEY *key);
1082
+
1083
+ /** Sets the public key of a EC_KEY object.
1084
+ * \param key EC_KEY object
1085
+ * \param pub EC_POINT object with the public key (note: the EC_KEY object
1086
+ * will use an own copy of the EC_POINT object).
1087
+ * \return 1 on success and 0 if an error occurred.
1088
+ */
1089
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_set_public_key(EC_KEY *key, const EC_POINT *pub);
1090
+
1091
+ OSSL_DEPRECATEDIN_3_0 unsigned EC_KEY_get_enc_flags(const EC_KEY *key);
1092
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_set_enc_flags(EC_KEY *eckey, unsigned int flags);
1093
+ OSSL_DEPRECATEDIN_3_0 point_conversion_form_t EC_KEY_get_conv_form(const EC_KEY *key);
1094
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_set_conv_form(EC_KEY *eckey,
1095
+ point_conversion_form_t cform);
1096
+ # endif /*OPENSSL_NO_DEPRECATED_3_0 */
1097
+
1098
+ # define EC_KEY_get_ex_new_index(l, p, newf, dupf, freef) \
1099
+ CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_EC_KEY, l, p, newf, dupf, freef)
1100
+
1101
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
1102
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_set_ex_data(EC_KEY *key, int idx, void *arg);
1103
+ OSSL_DEPRECATEDIN_3_0 void *EC_KEY_get_ex_data(const EC_KEY *key, int idx);
1104
+
1105
+ /* wrapper functions for the underlying EC_GROUP object */
1106
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_set_asn1_flag(EC_KEY *eckey, int asn1_flag);
1107
+
1108
+ /** Creates a table of pre-computed multiples of the generator to
1109
+ * accelerate further EC_KEY operations.
1110
+ * \param key EC_KEY object
1111
+ * \param ctx BN_CTX object (optional)
1112
+ * \return 1 on success and 0 if an error occurred.
1113
+ */
1114
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_precompute_mult(EC_KEY *key, BN_CTX *ctx);
1115
+
1116
+ /** Creates a new ec private (and optional a new public) key.
1117
+ * \param key EC_KEY object
1118
+ * \return 1 on success and 0 if an error occurred.
1119
+ */
1120
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_generate_key(EC_KEY *key);
1121
+
1122
+ /** Verifies that a private and/or public key is valid.
1123
+ * \param key the EC_KEY object
1124
+ * \return 1 on success and 0 otherwise.
1125
+ */
1126
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_check_key(const EC_KEY *key);
1127
+
1128
+ /** Indicates if an EC_KEY can be used for signing.
1129
+ * \param eckey the EC_KEY object
1130
+ * \return 1 if can sign and 0 otherwise.
1131
+ */
1132
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_can_sign(const EC_KEY *eckey);
1133
+
1134
+ /** Sets a public key from affine coordinates performing
1135
+ * necessary NIST PKV tests.
1136
+ * \param key the EC_KEY object
1137
+ * \param x public key x coordinate
1138
+ * \param y public key y coordinate
1139
+ * \return 1 on success and 0 otherwise.
1140
+ */
1141
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key,
1142
+ BIGNUM *x,
1143
+ BIGNUM *y);
1144
+
1145
+ /** Encodes an EC_KEY public key to an allocated octet string
1146
+ * \param key key to encode
1147
+ * \param form point conversion form
1148
+ * \param pbuf returns pointer to allocated buffer
1149
+ * \param ctx BN_CTX object (optional)
1150
+ * \return the length of the encoded octet string or 0 if an error occurred
1151
+ */
1152
+ OSSL_DEPRECATEDIN_3_0 size_t EC_KEY_key2buf(const EC_KEY *key,
1153
+ point_conversion_form_t form,
1154
+ unsigned char **pbuf, BN_CTX *ctx);
1155
+
1156
+ /** Decodes a EC_KEY public key from a octet string
1157
+ * \param key key to decode
1158
+ * \param buf memory buffer with the encoded ec point
1159
+ * \param len length of the encoded ec point
1160
+ * \param ctx BN_CTX object (optional)
1161
+ * \return 1 on success and 0 if an error occurred
1162
+ */
1163
+
1164
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_oct2key(EC_KEY *key, const unsigned char *buf,
1165
+ size_t len, BN_CTX *ctx);
1166
+
1167
+ /** Decodes an EC_KEY private key from an octet string
1168
+ * \param key key to decode
1169
+ * \param buf memory buffer with the encoded private key
1170
+ * \param len length of the encoded key
1171
+ * \return 1 on success and 0 if an error occurred
1172
+ */
1173
+
1174
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_oct2priv(EC_KEY *key, const unsigned char *buf,
1175
+ size_t len);
1176
+
1177
+ /** Encodes a EC_KEY private key to an octet string
1178
+ * \param key key to encode
1179
+ * \param buf memory buffer for the result. If NULL the function returns
1180
+ * required buffer size.
1181
+ * \param len length of the memory buffer
1182
+ * \return the length of the encoded octet string or 0 if an error occurred
1183
+ */
1184
+
1185
+ OSSL_DEPRECATEDIN_3_0 size_t EC_KEY_priv2oct(const EC_KEY *key,
1186
+ unsigned char *buf, size_t len);
1187
+
1188
+ /** Encodes an EC_KEY private key to an allocated octet string
1189
+ * \param eckey key to encode
1190
+ * \param pbuf returns pointer to allocated buffer
1191
+ * \return the length of the encoded octet string or 0 if an error occurred
1192
+ */
1193
+ OSSL_DEPRECATEDIN_3_0 size_t EC_KEY_priv2buf(const EC_KEY *eckey,
1194
+ unsigned char **pbuf);
1195
+
1196
+ /********************************************************************/
1197
+ /* de- and encoding functions for SEC1 ECPrivateKey */
1198
+ /********************************************************************/
1199
+
1200
+ /** Decodes a private key from a memory buffer.
1201
+ * \param key a pointer to a EC_KEY object which should be used (or NULL)
1202
+ * \param in pointer to memory with the DER encoded private key
1203
+ * \param len length of the DER encoded private key
1204
+ * \return the decoded private key or NULL if an error occurred.
1205
+ */
1206
+ OSSL_DEPRECATEDIN_3_0 EC_KEY *d2i_ECPrivateKey(EC_KEY **key,
1207
+ const unsigned char **in,
1208
+ long len);
1209
+
1210
+ /** Encodes a private key object and stores the result in a buffer.
1211
+ * \param key the EC_KEY object to encode
1212
+ * \param out the buffer for the result (if NULL the function returns number
1213
+ * of bytes needed).
1214
+ * \return 1 on success and 0 if an error occurred.
1215
+ */
1216
+ OSSL_DEPRECATEDIN_3_0 int i2d_ECPrivateKey(const EC_KEY *key,
1217
+ unsigned char **out);
1218
+
1219
+ /********************************************************************/
1220
+ /* de- and encoding functions for EC parameters */
1221
+ /********************************************************************/
1222
+
1223
+ /** Decodes ec parameter from a memory buffer.
1224
+ * \param key a pointer to a EC_KEY object which should be used (or NULL)
1225
+ * \param in pointer to memory with the DER encoded ec parameters
1226
+ * \param len length of the DER encoded ec parameters
1227
+ * \return a EC_KEY object with the decoded parameters or NULL if an error
1228
+ * occurred.
1229
+ */
1230
+ OSSL_DEPRECATEDIN_3_0 EC_KEY *d2i_ECParameters(EC_KEY **key,
1231
+ const unsigned char **in,
1232
+ long len);
1233
+
1234
+ /** Encodes ec parameter and stores the result in a buffer.
1235
+ * \param key the EC_KEY object with ec parameters to encode
1236
+ * \param out the buffer for the result (if NULL the function returns number
1237
+ * of bytes needed).
1238
+ * \return 1 on success and 0 if an error occurred.
1239
+ */
1240
+ OSSL_DEPRECATEDIN_3_0 int i2d_ECParameters(const EC_KEY *key,
1241
+ unsigned char **out);
1242
+
1243
+ /********************************************************************/
1244
+ /* de- and encoding functions for EC public key */
1245
+ /* (octet string, not DER -- hence 'o2i' and 'i2o') */
1246
+ /********************************************************************/
1247
+
1248
+ /** Decodes an ec public key from a octet string.
1249
+ * \param key a pointer to a EC_KEY object which should be used
1250
+ * \param in memory buffer with the encoded public key
1251
+ * \param len length of the encoded public key
1252
+ * \return EC_KEY object with decoded public key or NULL if an error
1253
+ * occurred.
1254
+ */
1255
+ OSSL_DEPRECATEDIN_3_0 EC_KEY *o2i_ECPublicKey(EC_KEY **key,
1256
+ const unsigned char **in, long len);
1257
+
1258
+ /** Encodes an ec public key in an octet string.
1259
+ * \param key the EC_KEY object with the public key
1260
+ * \param out the buffer for the result (if NULL the function returns number
1261
+ * of bytes needed).
1262
+ * \return 1 on success and 0 if an error occurred
1263
+ */
1264
+ OSSL_DEPRECATEDIN_3_0 int i2o_ECPublicKey(const EC_KEY *key, unsigned char **out);
1265
+
1266
+ /** Prints out the ec parameters on human readable form.
1267
+ * \param bp BIO object to which the information is printed
1268
+ * \param key EC_KEY object
1269
+ * \return 1 on success and 0 if an error occurred
1270
+ */
1271
+ OSSL_DEPRECATEDIN_3_0 int ECParameters_print(BIO *bp, const EC_KEY *key);
1272
+
1273
+ /** Prints out the contents of a EC_KEY object
1274
+ * \param bp BIO object to which the information is printed
1275
+ * \param key EC_KEY object
1276
+ * \param off line offset
1277
+ * \return 1 on success and 0 if an error occurred
1278
+ */
1279
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_print(BIO *bp, const EC_KEY *key, int off);
1280
+
1281
+ # ifndef OPENSSL_NO_STDIO
1282
+ /** Prints out the ec parameters on human readable form.
1283
+ * \param fp file descriptor to which the information is printed
1284
+ * \param key EC_KEY object
1285
+ * \return 1 on success and 0 if an error occurred
1286
+ */
1287
+ OSSL_DEPRECATEDIN_3_0 int ECParameters_print_fp(FILE *fp, const EC_KEY *key);
1288
+
1289
+ /** Prints out the contents of a EC_KEY object
1290
+ * \param fp file descriptor to which the information is printed
1291
+ * \param key EC_KEY object
1292
+ * \param off line offset
1293
+ * \return 1 on success and 0 if an error occurred
1294
+ */
1295
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_print_fp(FILE *fp, const EC_KEY *key, int off);
1296
+ # endif /* OPENSSL_NO_STDIO */
1297
+
1298
+ OSSL_DEPRECATEDIN_3_0 const EC_KEY_METHOD *EC_KEY_OpenSSL(void);
1299
+ OSSL_DEPRECATEDIN_3_0 const EC_KEY_METHOD *EC_KEY_get_default_method(void);
1300
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_set_default_method(const EC_KEY_METHOD *meth);
1301
+ OSSL_DEPRECATEDIN_3_0 const EC_KEY_METHOD *EC_KEY_get_method(const EC_KEY *key);
1302
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_set_method(EC_KEY *key, const EC_KEY_METHOD *meth);
1303
+ OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_new_method(ENGINE *engine);
1304
+
1305
+ /** The old name for ecdh_KDF_X9_63
1306
+ * The ECDH KDF specification has been mistakenly attributed to ANSI X9.62,
1307
+ * it is actually specified in ANSI X9.63.
1308
+ * This identifier is retained for backwards compatibility
1309
+ */
1310
+ OSSL_DEPRECATEDIN_3_0 int ECDH_KDF_X9_62(unsigned char *out, size_t outlen,
1311
+ const unsigned char *Z, size_t Zlen,
1312
+ const unsigned char *sinfo,
1313
+ size_t sinfolen, const EVP_MD *md);
1314
+
1315
+ OSSL_DEPRECATEDIN_3_0 int ECDH_compute_key(void *out, size_t outlen,
1316
+ const EC_POINT *pub_key,
1317
+ const EC_KEY *ecdh,
1318
+ void *(*KDF)(const void *in,
1319
+ size_t inlen, void *out,
1320
+ size_t *outlen));
1321
+ # endif /* OPENSSL_NO_DEPRECATED_3_0 */
1322
+
1323
+ typedef struct ECDSA_SIG_st ECDSA_SIG;
1324
+
1325
+ /** Allocates and initialize a ECDSA_SIG structure
1326
+ * \return pointer to a ECDSA_SIG structure or NULL if an error occurred
1327
+ */
1328
+ ECDSA_SIG *ECDSA_SIG_new(void);
1329
+
1330
+ /** frees a ECDSA_SIG structure
1331
+ * \param sig pointer to the ECDSA_SIG structure
1332
+ */
1333
+ void ECDSA_SIG_free(ECDSA_SIG *sig);
1334
+
1335
+ /** i2d_ECDSA_SIG encodes content of ECDSA_SIG (note: this function modifies *pp
1336
+ * (*pp += length of the DER encoded signature)).
1337
+ * \param sig pointer to the ECDSA_SIG object
1338
+ * \param pp pointer to a unsigned char pointer for the output or NULL
1339
+ * \return the length of the DER encoded ECDSA_SIG object or a negative value
1340
+ * on error
1341
+ */
1342
+ DECLARE_ASN1_ENCODE_FUNCTIONS_only(ECDSA_SIG, ECDSA_SIG)
1343
+
1344
+ /** d2i_ECDSA_SIG decodes an ECDSA signature (note: this function modifies *pp
1345
+ * (*pp += len)).
1346
+ * \param sig pointer to ECDSA_SIG pointer (may be NULL)
1347
+ * \param pp memory buffer with the DER encoded signature
1348
+ * \param len length of the buffer
1349
+ * \return pointer to the decoded ECDSA_SIG structure (or NULL)
1350
+ */
1351
+
1352
+ /** Accessor for r and s fields of ECDSA_SIG
1353
+ * \param sig pointer to ECDSA_SIG structure
1354
+ * \param pr pointer to BIGNUM pointer for r (may be NULL)
1355
+ * \param ps pointer to BIGNUM pointer for s (may be NULL)
1356
+ */
1357
+ void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps);
1358
+
1359
+ /** Accessor for r field of ECDSA_SIG
1360
+ * \param sig pointer to ECDSA_SIG structure
1361
+ */
1362
+ const BIGNUM *ECDSA_SIG_get0_r(const ECDSA_SIG *sig);
1363
+
1364
+ /** Accessor for s field of ECDSA_SIG
1365
+ * \param sig pointer to ECDSA_SIG structure
1366
+ */
1367
+ const BIGNUM *ECDSA_SIG_get0_s(const ECDSA_SIG *sig);
1368
+
1369
+ /** Setter for r and s fields of ECDSA_SIG
1370
+ * \param sig pointer to ECDSA_SIG structure
1371
+ * \param r pointer to BIGNUM for r
1372
+ * \param s pointer to BIGNUM for s
1373
+ */
1374
+ int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s);
1375
+
1376
+ # ifndef OPENSSL_NO_DEPRECATED_3_0
1377
+ /** Computes the ECDSA signature of the given hash value using
1378
+ * the supplied private key and returns the created signature.
1379
+ * \param dgst pointer to the hash value
1380
+ * \param dgst_len length of the hash value
1381
+ * \param eckey EC_KEY object containing a private EC key
1382
+ * \return pointer to a ECDSA_SIG structure or NULL if an error occurred
1383
+ */
1384
+ OSSL_DEPRECATEDIN_3_0 ECDSA_SIG *ECDSA_do_sign(const unsigned char *dgst,
1385
+ int dgst_len, EC_KEY *eckey);
1386
+
1387
+ /** Computes ECDSA signature of a given hash value using the supplied
1388
+ * private key (note: sig must point to ECDSA_size(eckey) bytes of memory).
1389
+ * \param dgst pointer to the hash value to sign
1390
+ * \param dgstlen length of the hash value
1391
+ * \param kinv BIGNUM with a pre-computed inverse k (optional)
1392
+ * \param rp BIGNUM with a pre-computed rp value (optional),
1393
+ * see ECDSA_sign_setup
1394
+ * \param eckey EC_KEY object containing a private EC key
1395
+ * \return pointer to a ECDSA_SIG structure or NULL if an error occurred
1396
+ */
1397
+ OSSL_DEPRECATEDIN_3_0 ECDSA_SIG *ECDSA_do_sign_ex(const unsigned char *dgst,
1398
+ int dgstlen, const BIGNUM *kinv,
1399
+ const BIGNUM *rp, EC_KEY *eckey);
1400
+
1401
+ /** Verifies that the supplied signature is a valid ECDSA
1402
+ * signature of the supplied hash value using the supplied public key.
1403
+ * \param dgst pointer to the hash value
1404
+ * \param dgst_len length of the hash value
1405
+ * \param sig ECDSA_SIG structure
1406
+ * \param eckey EC_KEY object containing a public EC key
1407
+ * \return 1 if the signature is valid, 0 if the signature is invalid
1408
+ * and -1 on error
1409
+ */
1410
+ OSSL_DEPRECATEDIN_3_0 int ECDSA_do_verify(const unsigned char *dgst, int dgst_len,
1411
+ const ECDSA_SIG *sig, EC_KEY *eckey);
1412
+
1413
+ /** Precompute parts of the signing operation
1414
+ * \param eckey EC_KEY object containing a private EC key
1415
+ * \param ctx BN_CTX object (optional)
1416
+ * \param kinv BIGNUM pointer for the inverse of k
1417
+ * \param rp BIGNUM pointer for x coordinate of k * generator
1418
+ * \return 1 on success and 0 otherwise
1419
+ */
1420
+ OSSL_DEPRECATEDIN_3_0 int ECDSA_sign_setup(EC_KEY *eckey, BN_CTX *ctx,
1421
+ BIGNUM **kinv, BIGNUM **rp);
1422
+
1423
+ /** Computes ECDSA signature of a given hash value using the supplied
1424
+ * private key (note: sig must point to ECDSA_size(eckey) bytes of memory).
1425
+ * \param type this parameter is ignored
1426
+ * \param dgst pointer to the hash value to sign
1427
+ * \param dgstlen length of the hash value
1428
+ * \param sig memory for the DER encoded created signature
1429
+ * \param siglen pointer to the length of the returned signature
1430
+ * \param eckey EC_KEY object containing a private EC key
1431
+ * \return 1 on success and 0 otherwise
1432
+ */
1433
+ OSSL_DEPRECATEDIN_3_0 int ECDSA_sign(int type, const unsigned char *dgst,
1434
+ int dgstlen, unsigned char *sig,
1435
+ unsigned int *siglen, EC_KEY *eckey);
1436
+
1437
+ /** Computes ECDSA signature of a given hash value using the supplied
1438
+ * private key (note: sig must point to ECDSA_size(eckey) bytes of memory).
1439
+ * \param type this parameter is ignored
1440
+ * \param dgst pointer to the hash value to sign
1441
+ * \param dgstlen length of the hash value
1442
+ * \param sig buffer to hold the DER encoded signature
1443
+ * \param siglen pointer to the length of the returned signature
1444
+ * \param kinv BIGNUM with a pre-computed inverse k (optional)
1445
+ * \param rp BIGNUM with a pre-computed rp value (optional),
1446
+ * see ECDSA_sign_setup
1447
+ * \param eckey EC_KEY object containing a private EC key
1448
+ * \return 1 on success and 0 otherwise
1449
+ */
1450
+ OSSL_DEPRECATEDIN_3_0 int ECDSA_sign_ex(int type, const unsigned char *dgst,
1451
+ int dgstlen, unsigned char *sig,
1452
+ unsigned int *siglen, const BIGNUM *kinv,
1453
+ const BIGNUM *rp, EC_KEY *eckey);
1454
+
1455
+ /** Verifies that the given signature is valid ECDSA signature
1456
+ * of the supplied hash value using the specified public key.
1457
+ * \param type this parameter is ignored
1458
+ * \param dgst pointer to the hash value
1459
+ * \param dgstlen length of the hash value
1460
+ * \param sig pointer to the DER encoded signature
1461
+ * \param siglen length of the DER encoded signature
1462
+ * \param eckey EC_KEY object containing a public EC key
1463
+ * \return 1 if the signature is valid, 0 if the signature is invalid
1464
+ * and -1 on error
1465
+ */
1466
+ OSSL_DEPRECATEDIN_3_0 int ECDSA_verify(int type, const unsigned char *dgst,
1467
+ int dgstlen, const unsigned char *sig,
1468
+ int siglen, EC_KEY *eckey);
1469
+
1470
+ /** Returns the maximum length of the DER encoded signature
1471
+ * \param eckey EC_KEY object
1472
+ * \return numbers of bytes required for the DER encoded signature
1473
+ */
1474
+ OSSL_DEPRECATEDIN_3_0 int ECDSA_size(const EC_KEY *eckey);
1475
+
1476
+ /********************************************************************/
1477
+ /* EC_KEY_METHOD constructors, destructors, writers and accessors */
1478
+ /********************************************************************/
1479
+
1480
+ OSSL_DEPRECATEDIN_3_0 EC_KEY_METHOD *EC_KEY_METHOD_new(const EC_KEY_METHOD *meth);
1481
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_free(EC_KEY_METHOD *meth);
1482
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_set_init
1483
+ (EC_KEY_METHOD *meth,
1484
+ int (*init)(EC_KEY *key),
1485
+ void (*finish)(EC_KEY *key),
1486
+ int (*copy)(EC_KEY *dest, const EC_KEY *src),
1487
+ int (*set_group)(EC_KEY *key, const EC_GROUP *grp),
1488
+ int (*set_private)(EC_KEY *key, const BIGNUM *priv_key),
1489
+ int (*set_public)(EC_KEY *key, const EC_POINT *pub_key));
1490
+
1491
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_set_keygen(EC_KEY_METHOD *meth,
1492
+ int (*keygen)(EC_KEY *key));
1493
+
1494
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_set_compute_key
1495
+ (EC_KEY_METHOD *meth,
1496
+ int (*ckey)(unsigned char **psec, size_t *pseclen,
1497
+ const EC_POINT *pub_key, const EC_KEY *ecdh));
1498
+
1499
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_set_sign
1500
+ (EC_KEY_METHOD *meth,
1501
+ int (*sign)(int type, const unsigned char *dgst,
1502
+ int dlen, unsigned char *sig,
1503
+ unsigned int *siglen,
1504
+ const BIGNUM *kinv, const BIGNUM *r,
1505
+ EC_KEY *eckey),
1506
+ int (*sign_setup)(EC_KEY *eckey, BN_CTX *ctx_in,
1507
+ BIGNUM **kinvp, BIGNUM **rp),
1508
+ ECDSA_SIG *(*sign_sig)(const unsigned char *dgst,
1509
+ int dgst_len,
1510
+ const BIGNUM *in_kinv,
1511
+ const BIGNUM *in_r,
1512
+ EC_KEY *eckey));
1513
+
1514
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_set_verify
1515
+ (EC_KEY_METHOD *meth,
1516
+ int (*verify)(int type, const unsigned
1517
+ char *dgst, int dgst_len,
1518
+ const unsigned char *sigbuf,
1519
+ int sig_len, EC_KEY *eckey),
1520
+ int (*verify_sig)(const unsigned char *dgst,
1521
+ int dgst_len, const ECDSA_SIG *sig,
1522
+ EC_KEY *eckey));
1523
+
1524
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_get_init
1525
+ (const EC_KEY_METHOD *meth,
1526
+ int (**pinit)(EC_KEY *key),
1527
+ void (**pfinish)(EC_KEY *key),
1528
+ int (**pcopy)(EC_KEY *dest, const EC_KEY *src),
1529
+ int (**pset_group)(EC_KEY *key, const EC_GROUP *grp),
1530
+ int (**pset_private)(EC_KEY *key, const BIGNUM *priv_key),
1531
+ int (**pset_public)(EC_KEY *key, const EC_POINT *pub_key));
1532
+
1533
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_get_keygen
1534
+ (const EC_KEY_METHOD *meth, int (**pkeygen)(EC_KEY *key));
1535
+
1536
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_get_compute_key
1537
+ (const EC_KEY_METHOD *meth,
1538
+ int (**pck)(unsigned char **psec,
1539
+ size_t *pseclen,
1540
+ const EC_POINT *pub_key,
1541
+ const EC_KEY *ecdh));
1542
+
1543
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_get_sign
1544
+ (const EC_KEY_METHOD *meth,
1545
+ int (**psign)(int type, const unsigned char *dgst,
1546
+ int dlen, unsigned char *sig,
1547
+ unsigned int *siglen,
1548
+ const BIGNUM *kinv, const BIGNUM *r,
1549
+ EC_KEY *eckey),
1550
+ int (**psign_setup)(EC_KEY *eckey, BN_CTX *ctx_in,
1551
+ BIGNUM **kinvp, BIGNUM **rp),
1552
+ ECDSA_SIG *(**psign_sig)(const unsigned char *dgst,
1553
+ int dgst_len,
1554
+ const BIGNUM *in_kinv,
1555
+ const BIGNUM *in_r,
1556
+ EC_KEY *eckey));
1557
+
1558
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_get_verify
1559
+ (const EC_KEY_METHOD *meth,
1560
+ int (**pverify)(int type, const unsigned
1561
+ char *dgst, int dgst_len,
1562
+ const unsigned char *sigbuf,
1563
+ int sig_len, EC_KEY *eckey),
1564
+ int (**pverify_sig)(const unsigned char *dgst,
1565
+ int dgst_len,
1566
+ const ECDSA_SIG *sig,
1567
+ EC_KEY *eckey));
1568
+ # endif /* OPENSSL_NO_DEPRECATED_3_0 */
1569
+
1570
+ # define EVP_EC_gen(curve) \
1571
+ EVP_PKEY_Q_keygen(NULL, NULL, "EC", (char *)(strstr(curve, "")))
1572
+ /* strstr is used to enable type checking for the variadic string arg */
1573
+ # define ECParameters_dup(x) ASN1_dup_of(EC_KEY, i2d_ECParameters, \
1574
+ d2i_ECParameters, x)
1575
+
1576
+ # ifndef __cplusplus
1577
+ # if defined(__SUNPRO_C)
1578
+ # if __SUNPRO_C >= 0x520
1579
+ # pragma error_messages (default,E_ARRAY_OF_INCOMPLETE_NONAME,E_ARRAY_OF_INCOMPLETE)
1580
+ # endif
1581
+ # endif
1582
+ # endif
1583
+
1584
+ # endif
1585
+ # ifdef __cplusplus
1586
+ }
1587
+ # endif
1588
+ #endif