@crossbind/port-openssl-linuxmusl 0.0.0-stage → 2.0.0-beta.63

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 (328) hide show
  1. package/LICENSE +177 -0
  2. package/README.md +13 -2
  3. package/assets/90-wasi.conf +18 -0
  4. package/assets/cacert.pem +3480 -0
  5. package/crossbind.build.js +1 -0
  6. package/crossbind.config.js +5 -0
  7. package/dist/prebuilt/CMakeLists.txt +58 -0
  8. package/dist/prebuilt/linuxmusl-arm64-mt-release/crossbind-emccflags.fingerprint +1 -0
  9. package/dist/prebuilt/linuxmusl-arm64-mt-release/crossbind-source.fingerprint +1 -0
  10. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/aes.h +109 -0
  11. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/asn1.h +1096 -0
  12. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/asn1err.h +140 -0
  13. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/asn1t.h +935 -0
  14. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/async.h +102 -0
  15. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/asyncerr.h +27 -0
  16. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/bio.h +1039 -0
  17. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/bioerr.h +70 -0
  18. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/blowfish.h +78 -0
  19. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/bn.h +588 -0
  20. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/bnerr.h +45 -0
  21. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/buffer.h +60 -0
  22. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/buffererr.h +23 -0
  23. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/byteorder.h +339 -0
  24. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/camellia.h +117 -0
  25. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/cast.h +71 -0
  26. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/cmac.h +53 -0
  27. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/cmp.h +742 -0
  28. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/cmp_util.h +56 -0
  29. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/cmperr.h +132 -0
  30. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/cms.h +522 -0
  31. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/cmserr.h +128 -0
  32. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/comp.h +101 -0
  33. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/comperr.h +36 -0
  34. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/conf.h +219 -0
  35. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/conf_api.h +46 -0
  36. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/conferr.h +50 -0
  37. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/configuration.h +223 -0
  38. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/conftypes.h +44 -0
  39. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/core.h +235 -0
  40. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/core_dispatch.h +1069 -0
  41. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/core_names.h +601 -0
  42. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/core_object.h +42 -0
  43. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/crmf.h +279 -0
  44. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/crmferr.h +56 -0
  45. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/crypto.h +620 -0
  46. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/cryptoerr.h +54 -0
  47. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/cryptoerr_legacy.h +1502 -0
  48. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/ct.h +574 -0
  49. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/cterr.h +43 -0
  50. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/decoder.h +133 -0
  51. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/decodererr.h +26 -0
  52. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/des.h +211 -0
  53. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/dh.h +332 -0
  54. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/dherr.h +57 -0
  55. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/dsa.h +272 -0
  56. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/dsaerr.h +42 -0
  57. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/dtls1.h +57 -0
  58. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/e_os2.h +293 -0
  59. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/e_ostime.h +38 -0
  60. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/ebcdic.h +39 -0
  61. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/ec.h +1571 -0
  62. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/ecdh.h +10 -0
  63. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/ecdsa.h +10 -0
  64. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/ecerr.h +102 -0
  65. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/ech.h +134 -0
  66. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/encoder.h +126 -0
  67. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/encodererr.h +28 -0
  68. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/engine.h +1211 -0
  69. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/engineerr.h +19 -0
  70. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/err.h +461 -0
  71. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/ess.h +136 -0
  72. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/esserr.h +32 -0
  73. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/evp.h +1948 -0
  74. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/evperr.h +148 -0
  75. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/fips_names.h +56 -0
  76. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/fipskey.h +47 -0
  77. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/hmac.h +63 -0
  78. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/hpke.h +169 -0
  79. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/http.h +117 -0
  80. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/httperr.h +55 -0
  81. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/idea.h +82 -0
  82. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/indicator.h +31 -0
  83. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/kdf.h +141 -0
  84. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/kdferr.h +16 -0
  85. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/lhash.h +417 -0
  86. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/macros.h +392 -0
  87. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/md2.h +56 -0
  88. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/md4.h +63 -0
  89. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/md5.h +62 -0
  90. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/mdc2.h +55 -0
  91. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/ml_kem.h +31 -0
  92. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/modes.h +219 -0
  93. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/obj_mac.h +6699 -0
  94. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/objects.h +186 -0
  95. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/objectserr.h +26 -0
  96. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/ocsp.h +487 -0
  97. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/ocsperr.h +51 -0
  98. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/opensslconf.h +17 -0
  99. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/opensslv.h +131 -0
  100. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/ossl_typ.h +16 -0
  101. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/param_build.h +63 -0
  102. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/params.h +167 -0
  103. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/pem.h +549 -0
  104. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/pem2.h +19 -0
  105. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/pemerr.h +57 -0
  106. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/pkcs12.h +376 -0
  107. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/pkcs12err.h +45 -0
  108. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/pkcs7.h +432 -0
  109. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/pkcs7err.h +61 -0
  110. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/posix_time.h +46 -0
  111. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/prov_ssl.h +38 -0
  112. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/proverr.h +176 -0
  113. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/provider.h +94 -0
  114. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/quic.h +80 -0
  115. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/rand.h +130 -0
  116. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/randerr.h +68 -0
  117. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/rc2.h +68 -0
  118. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/rc4.h +47 -0
  119. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/rc5.h +79 -0
  120. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/ripemd.h +59 -0
  121. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/rsa.h +613 -0
  122. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/rsaerr.h +104 -0
  123. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/safestack.h +350 -0
  124. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/seed.h +112 -0
  125. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/self_test.h +119 -0
  126. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/sha.h +140 -0
  127. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/srp.h +291 -0
  128. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/srtp.h +68 -0
  129. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/ssl.h +2943 -0
  130. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/ssl2.h +30 -0
  131. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/ssl3.h +357 -0
  132. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/sslerr.h +381 -0
  133. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/sslerr_legacy.h +487 -0
  134. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/stack.h +93 -0
  135. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/store.h +373 -0
  136. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/storeerr.h +48 -0
  137. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/symhacks.h +39 -0
  138. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/thread.h +31 -0
  139. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/tls1.h +1241 -0
  140. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/trace.h +323 -0
  141. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/ts.h +516 -0
  142. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/tserr.h +65 -0
  143. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/txt_db.h +63 -0
  144. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/types.h +249 -0
  145. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/ui.h +409 -0
  146. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/uierr.h +36 -0
  147. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/whrlpool.h +62 -0
  148. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/x509.h +1305 -0
  149. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/x509_acert.h +312 -0
  150. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/x509_vfy.h +949 -0
  151. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/x509err.h +70 -0
  152. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/x509v3.h +2019 -0
  153. package/dist/prebuilt/linuxmusl-arm64-mt-release/include/openssl/x509v3err.h +95 -0
  154. package/dist/prebuilt/linuxmusl-arm64-mt-release/lib/cmake/OpenSSL/OpenSSLConfig.cmake +128 -0
  155. package/dist/prebuilt/linuxmusl-arm64-mt-release/lib/cmake/OpenSSL/OpenSSLConfigVersion.cmake +18 -0
  156. package/dist/prebuilt/linuxmusl-arm64-mt-release/lib/libcrypto.a +0 -0
  157. package/dist/prebuilt/linuxmusl-arm64-mt-release/lib/libssl.a +0 -0
  158. package/dist/prebuilt/linuxmusl-arm64-mt-release/lib/ossl-modules/legacy.so +0 -0
  159. package/dist/prebuilt/linuxmusl-arm64-mt-release/lib/pkgconfig/libcrypto.pc +13 -0
  160. package/dist/prebuilt/linuxmusl-arm64-mt-release/lib/pkgconfig/libssl.pc +12 -0
  161. package/dist/prebuilt/linuxmusl-arm64-mt-release/lib/pkgconfig/openssl.pc +10 -0
  162. package/dist/prebuilt/linuxmusl-arm64-mt-release/lib.sources +1 -0
  163. package/dist/prebuilt/linuxmusl-arm64-mt-release/ssl/certs/cacert.pem +3480 -0
  164. package/dist/prebuilt/linuxmusl-arm64-mt-release/ssl/ct_log_list.cnf +9 -0
  165. package/dist/prebuilt/linuxmusl-arm64-mt-release/ssl/ct_log_list.cnf.dist +9 -0
  166. package/dist/prebuilt/linuxmusl-arm64-mt-release/ssl/openssl.cnf +395 -0
  167. package/dist/prebuilt/linuxmusl-arm64-mt-release/ssl/openssl.cnf.dist +395 -0
  168. package/dist/prebuilt/linuxmusl-x64-mt-release/crossbind-emccflags.fingerprint +1 -0
  169. package/dist/prebuilt/linuxmusl-x64-mt-release/crossbind-source.fingerprint +1 -0
  170. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/aes.h +109 -0
  171. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/asn1.h +1096 -0
  172. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/asn1err.h +140 -0
  173. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/asn1t.h +935 -0
  174. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/async.h +102 -0
  175. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/asyncerr.h +27 -0
  176. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/bio.h +1039 -0
  177. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/bioerr.h +70 -0
  178. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/blowfish.h +78 -0
  179. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/bn.h +588 -0
  180. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/bnerr.h +45 -0
  181. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/buffer.h +60 -0
  182. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/buffererr.h +23 -0
  183. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/byteorder.h +339 -0
  184. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/camellia.h +117 -0
  185. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/cast.h +71 -0
  186. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/cmac.h +53 -0
  187. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/cmp.h +742 -0
  188. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/cmp_util.h +56 -0
  189. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/cmperr.h +132 -0
  190. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/cms.h +522 -0
  191. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/cmserr.h +128 -0
  192. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/comp.h +101 -0
  193. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/comperr.h +36 -0
  194. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/conf.h +219 -0
  195. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/conf_api.h +46 -0
  196. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/conferr.h +50 -0
  197. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/configuration.h +223 -0
  198. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/conftypes.h +44 -0
  199. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/core.h +235 -0
  200. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/core_dispatch.h +1069 -0
  201. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/core_names.h +601 -0
  202. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/core_object.h +42 -0
  203. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/crmf.h +279 -0
  204. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/crmferr.h +56 -0
  205. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/crypto.h +620 -0
  206. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/cryptoerr.h +54 -0
  207. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/cryptoerr_legacy.h +1502 -0
  208. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/ct.h +574 -0
  209. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/cterr.h +43 -0
  210. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/decoder.h +133 -0
  211. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/decodererr.h +26 -0
  212. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/des.h +211 -0
  213. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/dh.h +332 -0
  214. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/dherr.h +57 -0
  215. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/dsa.h +272 -0
  216. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/dsaerr.h +42 -0
  217. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/dtls1.h +57 -0
  218. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/e_os2.h +293 -0
  219. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/e_ostime.h +38 -0
  220. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/ebcdic.h +39 -0
  221. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/ec.h +1571 -0
  222. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/ecdh.h +10 -0
  223. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/ecdsa.h +10 -0
  224. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/ecerr.h +102 -0
  225. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/ech.h +134 -0
  226. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/encoder.h +126 -0
  227. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/encodererr.h +28 -0
  228. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/engine.h +1211 -0
  229. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/engineerr.h +19 -0
  230. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/err.h +461 -0
  231. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/ess.h +136 -0
  232. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/esserr.h +32 -0
  233. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/evp.h +1948 -0
  234. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/evperr.h +148 -0
  235. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/fips_names.h +56 -0
  236. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/fipskey.h +47 -0
  237. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/hmac.h +63 -0
  238. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/hpke.h +169 -0
  239. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/http.h +117 -0
  240. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/httperr.h +55 -0
  241. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/idea.h +82 -0
  242. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/indicator.h +31 -0
  243. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/kdf.h +141 -0
  244. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/kdferr.h +16 -0
  245. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/lhash.h +417 -0
  246. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/macros.h +392 -0
  247. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/md2.h +56 -0
  248. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/md4.h +63 -0
  249. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/md5.h +62 -0
  250. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/mdc2.h +55 -0
  251. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/ml_kem.h +31 -0
  252. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/modes.h +219 -0
  253. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/obj_mac.h +6699 -0
  254. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/objects.h +186 -0
  255. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/objectserr.h +26 -0
  256. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/ocsp.h +487 -0
  257. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/ocsperr.h +51 -0
  258. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/opensslconf.h +17 -0
  259. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/opensslv.h +131 -0
  260. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/ossl_typ.h +16 -0
  261. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/param_build.h +63 -0
  262. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/params.h +167 -0
  263. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/pem.h +549 -0
  264. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/pem2.h +19 -0
  265. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/pemerr.h +57 -0
  266. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/pkcs12.h +376 -0
  267. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/pkcs12err.h +45 -0
  268. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/pkcs7.h +432 -0
  269. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/pkcs7err.h +61 -0
  270. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/posix_time.h +46 -0
  271. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/prov_ssl.h +38 -0
  272. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/proverr.h +176 -0
  273. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/provider.h +94 -0
  274. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/quic.h +80 -0
  275. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/rand.h +130 -0
  276. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/randerr.h +68 -0
  277. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/rc2.h +68 -0
  278. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/rc4.h +47 -0
  279. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/rc5.h +79 -0
  280. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/ripemd.h +59 -0
  281. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/rsa.h +613 -0
  282. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/rsaerr.h +104 -0
  283. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/safestack.h +350 -0
  284. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/seed.h +112 -0
  285. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/self_test.h +119 -0
  286. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/sha.h +140 -0
  287. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/srp.h +291 -0
  288. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/srtp.h +68 -0
  289. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/ssl.h +2943 -0
  290. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/ssl2.h +30 -0
  291. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/ssl3.h +357 -0
  292. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/sslerr.h +381 -0
  293. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/sslerr_legacy.h +487 -0
  294. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/stack.h +93 -0
  295. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/store.h +373 -0
  296. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/storeerr.h +48 -0
  297. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/symhacks.h +39 -0
  298. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/thread.h +31 -0
  299. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/tls1.h +1241 -0
  300. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/trace.h +323 -0
  301. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/ts.h +516 -0
  302. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/tserr.h +65 -0
  303. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/txt_db.h +63 -0
  304. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/types.h +249 -0
  305. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/ui.h +409 -0
  306. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/uierr.h +36 -0
  307. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/whrlpool.h +62 -0
  308. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/x509.h +1305 -0
  309. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/x509_acert.h +312 -0
  310. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/x509_vfy.h +949 -0
  311. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/x509err.h +70 -0
  312. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/x509v3.h +2019 -0
  313. package/dist/prebuilt/linuxmusl-x64-mt-release/include/openssl/x509v3err.h +95 -0
  314. package/dist/prebuilt/linuxmusl-x64-mt-release/lib/cmake/OpenSSL/OpenSSLConfig.cmake +128 -0
  315. package/dist/prebuilt/linuxmusl-x64-mt-release/lib/cmake/OpenSSL/OpenSSLConfigVersion.cmake +18 -0
  316. package/dist/prebuilt/linuxmusl-x64-mt-release/lib/libcrypto.a +0 -0
  317. package/dist/prebuilt/linuxmusl-x64-mt-release/lib/libssl.a +0 -0
  318. package/dist/prebuilt/linuxmusl-x64-mt-release/lib/ossl-modules/legacy.so +0 -0
  319. package/dist/prebuilt/linuxmusl-x64-mt-release/lib/pkgconfig/libcrypto.pc +13 -0
  320. package/dist/prebuilt/linuxmusl-x64-mt-release/lib/pkgconfig/libssl.pc +12 -0
  321. package/dist/prebuilt/linuxmusl-x64-mt-release/lib/pkgconfig/openssl.pc +10 -0
  322. package/dist/prebuilt/linuxmusl-x64-mt-release/lib.sources +1 -0
  323. package/dist/prebuilt/linuxmusl-x64-mt-release/ssl/certs/cacert.pem +3480 -0
  324. package/dist/prebuilt/linuxmusl-x64-mt-release/ssl/ct_log_list.cnf +9 -0
  325. package/dist/prebuilt/linuxmusl-x64-mt-release/ssl/ct_log_list.cnf.dist +9 -0
  326. package/dist/prebuilt/linuxmusl-x64-mt-release/ssl/openssl.cnf +395 -0
  327. package/dist/prebuilt/linuxmusl-x64-mt-release/ssl/openssl.cnf.dist +395 -0
  328. package/package.json +34 -3
@@ -0,0 +1,1571 @@
1
+ /*
2
+ * Copyright 2002-2026 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 symmetric-equivalent security bit size an EC_GROUP.
257
+ * This is rounded down to one of the standard sizes, (80, 112,
258
+ * 128, 192, 256) or reported as-is when smaller than 80.
259
+ * \param group EC_GROUP object
260
+ * \return symmetric-equivalent security bits.
261
+ */
262
+ int EC_GROUP_security_bits(const EC_GROUP *group);
263
+
264
+ /** Gets the cofactor of a EC_GROUP
265
+ * \param group EC_GROUP object
266
+ * \param cofactor BIGNUM to which the cofactor is copied
267
+ * \param ctx unused
268
+ * \return 1 on success and 0 if an error occurred
269
+ */
270
+ int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor,
271
+ BN_CTX *ctx);
272
+
273
+ /** Gets the cofactor of an EC_GROUP
274
+ * \param group EC_GROUP object
275
+ * \return the group cofactor
276
+ */
277
+ const BIGNUM *EC_GROUP_get0_cofactor(const EC_GROUP *group);
278
+
279
+ /** Sets the name of a EC_GROUP object
280
+ * \param group EC_GROUP object
281
+ * \param nid NID of the curve name OID
282
+ */
283
+ void EC_GROUP_set_curve_name(EC_GROUP *group, int nid);
284
+
285
+ /** Returns the curve name of a EC_GROUP object
286
+ * \param group EC_GROUP object
287
+ * \return NID of the curve name OID or 0 if not set.
288
+ */
289
+ int EC_GROUP_get_curve_name(const EC_GROUP *group);
290
+
291
+ /** Gets the field of an EC_GROUP
292
+ * \param group EC_GROUP object
293
+ * \return the group field
294
+ */
295
+ const BIGNUM *EC_GROUP_get0_field(const EC_GROUP *group);
296
+
297
+ /** Returns the field type of the EC_GROUP.
298
+ * \param group EC_GROUP object
299
+ * \return NID of the underlying field type OID.
300
+ */
301
+ int EC_GROUP_get_field_type(const EC_GROUP *group);
302
+
303
+ void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag);
304
+ int EC_GROUP_get_asn1_flag(const EC_GROUP *group);
305
+
306
+ void EC_GROUP_set_point_conversion_form(EC_GROUP *group,
307
+ point_conversion_form_t form);
308
+ point_conversion_form_t EC_GROUP_get_point_conversion_form(const EC_GROUP *);
309
+
310
+ unsigned char *EC_GROUP_get0_seed(const EC_GROUP *x);
311
+ size_t EC_GROUP_get_seed_len(const EC_GROUP *);
312
+ size_t EC_GROUP_set_seed(EC_GROUP *, const unsigned char *, size_t len);
313
+
314
+ /** Sets the parameters of an ec curve defined by y^2 = x^3 + a*x + b (for GFp)
315
+ * or y^2 + x*y = x^3 + a*x^2 + b (for GF2m)
316
+ * \param group EC_GROUP object
317
+ * \param p BIGNUM with the prime number (GFp) or the polynomial
318
+ * defining the underlying field (GF2m)
319
+ * \param a BIGNUM with parameter a of the equation
320
+ * \param b BIGNUM with parameter b of the equation
321
+ * \param ctx BN_CTX object (optional)
322
+ * \return 1 on success and 0 if an error occurred
323
+ */
324
+ int EC_GROUP_set_curve(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a,
325
+ const BIGNUM *b, BN_CTX *ctx);
326
+
327
+ /** Gets the parameters of the ec curve defined by y^2 = x^3 + a*x + b (for GFp)
328
+ * or y^2 + x*y = x^3 + a*x^2 + b (for GF2m)
329
+ * \param group EC_GROUP object
330
+ * \param p BIGNUM with the prime number (GFp) or the polynomial
331
+ * defining the underlying field (GF2m)
332
+ * \param a BIGNUM for parameter a of the equation
333
+ * \param b BIGNUM for parameter b of the equation
334
+ * \param ctx BN_CTX object (optional)
335
+ * \return 1 on success and 0 if an error occurred
336
+ */
337
+ int EC_GROUP_get_curve(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b,
338
+ BN_CTX *ctx);
339
+
340
+ #ifndef OPENSSL_NO_DEPRECATED_3_0
341
+ /** Sets the parameters of an ec curve. Synonym for EC_GROUP_set_curve
342
+ * \param group EC_GROUP object
343
+ * \param p BIGNUM with the prime number (GFp) or the polynomial
344
+ * defining the underlying field (GF2m)
345
+ * \param a BIGNUM with parameter a of the equation
346
+ * \param b BIGNUM with parameter b of the equation
347
+ * \param ctx BN_CTX object (optional)
348
+ * \return 1 on success and 0 if an error occurred
349
+ */
350
+ OSSL_DEPRECATEDIN_3_0 int EC_GROUP_set_curve_GFp(EC_GROUP *group,
351
+ const BIGNUM *p,
352
+ const BIGNUM *a,
353
+ const BIGNUM *b,
354
+ BN_CTX *ctx);
355
+
356
+ /** Gets the parameters of an ec curve. Synonym for EC_GROUP_get_curve
357
+ * \param group EC_GROUP object
358
+ * \param p BIGNUM with the prime number (GFp) or the polynomial
359
+ * defining the underlying field (GF2m)
360
+ * \param a BIGNUM for parameter a of the equation
361
+ * \param b BIGNUM for parameter b of the equation
362
+ * \param ctx BN_CTX object (optional)
363
+ * \return 1 on success and 0 if an error occurred
364
+ */
365
+ OSSL_DEPRECATEDIN_3_0 int EC_GROUP_get_curve_GFp(const EC_GROUP *group,
366
+ BIGNUM *p,
367
+ BIGNUM *a, BIGNUM *b,
368
+ BN_CTX *ctx);
369
+
370
+ #ifndef OPENSSL_NO_EC2M
371
+ /** Sets the parameter of an ec curve. Synonym for EC_GROUP_set_curve
372
+ * \param group EC_GROUP object
373
+ * \param p BIGNUM with the prime number (GFp) or the polynomial
374
+ * defining the underlying field (GF2m)
375
+ * \param a BIGNUM with parameter a of the equation
376
+ * \param b BIGNUM with parameter b of the equation
377
+ * \param ctx BN_CTX object (optional)
378
+ * \return 1 on success and 0 if an error occurred
379
+ */
380
+ OSSL_DEPRECATEDIN_3_0 int EC_GROUP_set_curve_GF2m(EC_GROUP *group,
381
+ const BIGNUM *p,
382
+ const BIGNUM *a,
383
+ const BIGNUM *b,
384
+ BN_CTX *ctx);
385
+
386
+ /** Gets the parameters of an ec curve. Synonym for EC_GROUP_get_curve
387
+ * \param group EC_GROUP object
388
+ * \param p BIGNUM with the prime number (GFp) or the polynomial
389
+ * defining the underlying field (GF2m)
390
+ * \param a BIGNUM for parameter a of the equation
391
+ * \param b BIGNUM for parameter b of the equation
392
+ * \param ctx BN_CTX object (optional)
393
+ * \return 1 on success and 0 if an error occurred
394
+ */
395
+ OSSL_DEPRECATEDIN_3_0 int EC_GROUP_get_curve_GF2m(const EC_GROUP *group,
396
+ BIGNUM *p,
397
+ BIGNUM *a, BIGNUM *b,
398
+ BN_CTX *ctx);
399
+ #endif /* OPENSSL_NO_EC2M */
400
+ #endif /* OPENSSL_NO_DEPRECATED_3_0 */
401
+
402
+ /** Returns the number of bits needed to represent a field element
403
+ * \param group EC_GROUP object
404
+ * \return number of bits needed to represent a field element
405
+ */
406
+ int EC_GROUP_get_degree(const EC_GROUP *group);
407
+
408
+ /** Checks whether the parameter in the EC_GROUP define a valid ec group
409
+ * \param group EC_GROUP object
410
+ * \param ctx BN_CTX object (optional)
411
+ * \return 1 if group is a valid ec group and 0 otherwise
412
+ */
413
+ int EC_GROUP_check(const EC_GROUP *group, BN_CTX *ctx);
414
+
415
+ /** Checks whether the discriminant of the elliptic curve is zero or not
416
+ * \param group EC_GROUP object
417
+ * \param ctx BN_CTX object (optional)
418
+ * \return 1 if the discriminant is not zero and 0 otherwise
419
+ */
420
+ int EC_GROUP_check_discriminant(const EC_GROUP *group, BN_CTX *ctx);
421
+
422
+ /** Compares two EC_GROUP objects
423
+ * \param a first EC_GROUP object
424
+ * \param b second EC_GROUP object
425
+ * \param ctx BN_CTX object (optional)
426
+ * \return 0 if the groups are equal, 1 if not, or -1 on error
427
+ */
428
+ int EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ctx);
429
+
430
+ /*
431
+ * EC_GROUP_new_GF*() calls EC_GROUP_new() and EC_GROUP_set_GF*() after
432
+ * choosing an appropriate EC_METHOD
433
+ */
434
+
435
+ /** Creates a new EC_GROUP object with the specified parameters defined
436
+ * over GFp (defined by the equation y^2 = x^3 + a*x + b)
437
+ * \param p BIGNUM with the prime number
438
+ * \param a BIGNUM with the parameter a of the equation
439
+ * \param b BIGNUM with the parameter b of the equation
440
+ * \param ctx BN_CTX object (optional)
441
+ * \return newly created EC_GROUP object with the specified parameters
442
+ */
443
+ EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a,
444
+ const BIGNUM *b, BN_CTX *ctx);
445
+ #ifndef OPENSSL_NO_EC2M
446
+ /** Creates a new EC_GROUP object with the specified parameters defined
447
+ * over GF2m (defined by the equation y^2 + x*y = x^3 + a*x^2 + b)
448
+ * \param p BIGNUM with the polynomial defining the underlying field
449
+ * \param a BIGNUM with the parameter a of the equation
450
+ * \param b BIGNUM with the parameter b of the equation
451
+ * \param ctx BN_CTX object (optional)
452
+ * \return newly created EC_GROUP object with the specified parameters
453
+ */
454
+ EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a,
455
+ const BIGNUM *b, BN_CTX *ctx);
456
+ #endif
457
+
458
+ /**
459
+ * Creates a EC_GROUP object with a curve specified by parameters.
460
+ * The parameters may be explicit or a named curve,
461
+ * \param params A list of parameters describing the group.
462
+ * \param libctx The associated library context or NULL for the default
463
+ * context
464
+ * \param propq A property query string
465
+ * \return newly created EC_GROUP object with specified parameters or NULL
466
+ * if an error occurred
467
+ */
468
+ EC_GROUP *EC_GROUP_new_from_params(const OSSL_PARAM params[],
469
+ OSSL_LIB_CTX *libctx, const char *propq);
470
+
471
+ /**
472
+ * Creates an OSSL_PARAM array with the parameters describing the given
473
+ * EC_GROUP.
474
+ * The resulting parameters may contain an explicit or a named curve depending
475
+ * on the EC_GROUP.
476
+ * \param group pointer to the EC_GROUP object
477
+ * \param libctx The associated library context or NULL for the default
478
+ * context
479
+ * \param propq A property query string
480
+ * \param bnctx BN_CTX object (optional)
481
+ * \return newly created OSSL_PARAM array with the parameters
482
+ * describing the given EC_GROUP or NULL if an error occurred
483
+ */
484
+ OSSL_PARAM *EC_GROUP_to_params(const EC_GROUP *group, OSSL_LIB_CTX *libctx,
485
+ const char *propq, BN_CTX *bnctx);
486
+
487
+ /**
488
+ * Creates a EC_GROUP object with a curve specified by a NID
489
+ * \param libctx The associated library context or NULL for the default
490
+ * context
491
+ * \param propq A property query string
492
+ * \param nid NID of the OID of the curve name
493
+ * \return newly created EC_GROUP object with specified curve or NULL
494
+ * if an error occurred
495
+ */
496
+ EC_GROUP *EC_GROUP_new_by_curve_name_ex(OSSL_LIB_CTX *libctx, const char *propq,
497
+ int nid);
498
+
499
+ /**
500
+ * Creates a EC_GROUP object with a curve specified by a NID. Same as
501
+ * EC_GROUP_new_by_curve_name_ex but the libctx and propq are always
502
+ * NULL.
503
+ * \param nid NID of the OID of the curve name
504
+ * \return newly created EC_GROUP object with specified curve or NULL
505
+ * if an error occurred
506
+ */
507
+ EC_GROUP *EC_GROUP_new_by_curve_name(int nid);
508
+
509
+ /** Creates a new EC_GROUP object from an ECPARAMETERS object
510
+ * \param params pointer to the ECPARAMETERS object
511
+ * \return newly created EC_GROUP object with specified curve or NULL
512
+ * if an error occurred
513
+ */
514
+ EC_GROUP *EC_GROUP_new_from_ecparameters(const ECPARAMETERS *params);
515
+
516
+ /** Creates an ECPARAMETERS object for the given EC_GROUP object.
517
+ * \param group pointer to the EC_GROUP object
518
+ * \param params pointer to an existing ECPARAMETERS object or NULL
519
+ * \return pointer to the new ECPARAMETERS object or NULL
520
+ * if an error occurred.
521
+ */
522
+ ECPARAMETERS *EC_GROUP_get_ecparameters(const EC_GROUP *group,
523
+ ECPARAMETERS *params);
524
+
525
+ /** Creates a new EC_GROUP object from an ECPKPARAMETERS object
526
+ * \param params pointer to an existing ECPKPARAMETERS object, or NULL
527
+ * \return newly created EC_GROUP object with specified curve, or NULL
528
+ * if an error occurred
529
+ */
530
+ EC_GROUP *EC_GROUP_new_from_ecpkparameters(const ECPKPARAMETERS *params);
531
+
532
+ /** Creates an ECPKPARAMETERS object for the given EC_GROUP object.
533
+ * \param group pointer to the EC_GROUP object
534
+ * \param params pointer to an existing ECPKPARAMETERS object or NULL
535
+ * \return pointer to the new ECPKPARAMETERS object or NULL
536
+ * if an error occurred.
537
+ */
538
+ ECPKPARAMETERS *EC_GROUP_get_ecpkparameters(const EC_GROUP *group,
539
+ ECPKPARAMETERS *params);
540
+
541
+ /********************************************************************/
542
+ /* handling of internal curves */
543
+ /********************************************************************/
544
+
545
+ typedef struct {
546
+ int nid;
547
+ const char *comment;
548
+ } EC_builtin_curve;
549
+
550
+ /*
551
+ * EC_builtin_curves(EC_builtin_curve *r, size_t size) returns number of all
552
+ * available curves or zero if a error occurred. In case r is not zero,
553
+ * nitems EC_builtin_curve structures are filled with the data of the first
554
+ * nitems internal groups
555
+ */
556
+ size_t EC_get_builtin_curves(EC_builtin_curve *r, size_t nitems);
557
+
558
+ const char *EC_curve_nid2nist(int nid);
559
+ int EC_curve_nist2nid(const char *name);
560
+ int EC_GROUP_check_named_curve(const EC_GROUP *group, int nist_only,
561
+ BN_CTX *ctx);
562
+
563
+ /********************************************************************/
564
+ /* EC_POINT functions */
565
+ /********************************************************************/
566
+
567
+ /** Creates a new EC_POINT object for the specified EC_GROUP
568
+ * \param group EC_GROUP the underlying EC_GROUP object
569
+ * \return newly created EC_POINT object or NULL if an error occurred
570
+ */
571
+ EC_POINT *EC_POINT_new(const EC_GROUP *group);
572
+
573
+ /** Frees a EC_POINT object
574
+ * \param point EC_POINT object to be freed
575
+ */
576
+ void EC_POINT_free(EC_POINT *point);
577
+
578
+ /** Clears and frees a EC_POINT object
579
+ * \param point EC_POINT object to be cleared and freed
580
+ */
581
+ void EC_POINT_clear_free(EC_POINT *point);
582
+
583
+ /** Copies EC_POINT object
584
+ * \param dst destination EC_POINT object
585
+ * \param src source EC_POINT object
586
+ * \return 1 on success and 0 if an error occurred
587
+ */
588
+ int EC_POINT_copy(EC_POINT *dst, const EC_POINT *src);
589
+
590
+ /** Creates a new EC_POINT object and copies the content of the supplied
591
+ * EC_POINT
592
+ * \param src source EC_POINT object
593
+ * \param group underlying the EC_GROUP object
594
+ * \return newly created EC_POINT object or NULL if an error occurred
595
+ */
596
+ EC_POINT *EC_POINT_dup(const EC_POINT *src, const EC_GROUP *group);
597
+
598
+ /** Sets a point to infinity (neutral element)
599
+ * \param group underlying EC_GROUP object
600
+ * \param point EC_POINT to set to infinity
601
+ * \return 1 on success and 0 if an error occurred
602
+ */
603
+ int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point);
604
+
605
+ #ifndef OPENSSL_NO_DEPRECATED_3_0
606
+ /** Returns the EC_METHOD used in EC_POINT object
607
+ * \param point EC_POINT object
608
+ * \return the EC_METHOD used
609
+ */
610
+ OSSL_DEPRECATEDIN_3_0 const EC_METHOD *EC_POINT_method_of(const EC_POINT *point);
611
+
612
+ /** Sets the jacobian projective coordinates of a EC_POINT over GFp
613
+ * \param group underlying EC_GROUP object
614
+ * \param p EC_POINT object
615
+ * \param x BIGNUM with the x-coordinate
616
+ * \param y BIGNUM with the y-coordinate
617
+ * \param z BIGNUM with the z-coordinate
618
+ * \param ctx BN_CTX object (optional)
619
+ * \return 1 on success and 0 if an error occurred
620
+ */
621
+ OSSL_DEPRECATEDIN_3_0 int EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group, EC_POINT *p,
622
+ const BIGNUM *x, const BIGNUM *y, const BIGNUM *z,
623
+ BN_CTX *ctx);
624
+
625
+ /** Gets the jacobian projective coordinates of a EC_POINT over GFp
626
+ * \param group underlying EC_GROUP object
627
+ * \param p EC_POINT object
628
+ * \param x BIGNUM for the x-coordinate
629
+ * \param y BIGNUM for the y-coordinate
630
+ * \param z BIGNUM for the z-coordinate
631
+ * \param ctx BN_CTX object (optional)
632
+ * \return 1 on success and 0 if an error occurred
633
+ */
634
+ OSSL_DEPRECATEDIN_3_0 int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group, const EC_POINT *p,
635
+ BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx);
636
+ #endif /* OPENSSL_NO_DEPRECATED_3_0 */
637
+
638
+ /** Sets the affine coordinates of an EC_POINT
639
+ * \param group underlying EC_GROUP object
640
+ * \param p EC_POINT object
641
+ * \param x BIGNUM with the x-coordinate
642
+ * \param y BIGNUM with the y-coordinate
643
+ * \param ctx BN_CTX object (optional)
644
+ * \return 1 on success and 0 if an error occurred
645
+ */
646
+ int EC_POINT_set_affine_coordinates(const EC_GROUP *group, EC_POINT *p,
647
+ const BIGNUM *x, const BIGNUM *y,
648
+ BN_CTX *ctx);
649
+
650
+ /** Gets the affine coordinates of an EC_POINT.
651
+ * \param group underlying EC_GROUP object
652
+ * \param p EC_POINT object
653
+ * \param x BIGNUM for the x-coordinate
654
+ * \param y BIGNUM for the y-coordinate
655
+ * \param ctx BN_CTX object (optional)
656
+ * \return 1 on success and 0 if an error occurred
657
+ */
658
+ int EC_POINT_get_affine_coordinates(const EC_GROUP *group, const EC_POINT *p,
659
+ BIGNUM *x, BIGNUM *y, BN_CTX *ctx);
660
+
661
+ #ifndef OPENSSL_NO_DEPRECATED_3_0
662
+ /** Sets the affine coordinates of an EC_POINT. A synonym of
663
+ * EC_POINT_set_affine_coordinates
664
+ * \param group underlying EC_GROUP object
665
+ * \param p EC_POINT object
666
+ * \param x BIGNUM with the x-coordinate
667
+ * \param y BIGNUM with the y-coordinate
668
+ * \param ctx BN_CTX object (optional)
669
+ * \return 1 on success and 0 if an error occurred
670
+ */
671
+ OSSL_DEPRECATEDIN_3_0 int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *p,
672
+ const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx);
673
+
674
+ /** Gets the affine coordinates of an EC_POINT. A synonym of
675
+ * EC_POINT_get_affine_coordinates
676
+ * \param group underlying EC_GROUP object
677
+ * \param p EC_POINT object
678
+ * \param x BIGNUM for the x-coordinate
679
+ * \param y BIGNUM for the y-coordinate
680
+ * \param ctx BN_CTX object (optional)
681
+ * \return 1 on success and 0 if an error occurred
682
+ */
683
+ OSSL_DEPRECATEDIN_3_0 int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group, const EC_POINT *p,
684
+ BIGNUM *x, BIGNUM *y, BN_CTX *ctx);
685
+ #endif /* OPENSSL_NO_DEPRECATED_3_0 */
686
+
687
+ /** Sets the x9.62 compressed coordinates of a EC_POINT
688
+ * \param group underlying EC_GROUP object
689
+ * \param p EC_POINT object
690
+ * \param x BIGNUM with x-coordinate
691
+ * \param y_bit integer with the y-Bit (either 0 or 1)
692
+ * \param ctx BN_CTX object (optional)
693
+ * \return 1 on success and 0 if an error occurred
694
+ */
695
+ int EC_POINT_set_compressed_coordinates(const EC_GROUP *group, EC_POINT *p,
696
+ const BIGNUM *x, int y_bit,
697
+ BN_CTX *ctx);
698
+
699
+ #ifndef OPENSSL_NO_DEPRECATED_3_0
700
+ /** Sets the x9.62 compressed coordinates of a EC_POINT. A synonym of
701
+ * EC_POINT_set_compressed_coordinates
702
+ * \param group underlying EC_GROUP object
703
+ * \param p EC_POINT object
704
+ * \param x BIGNUM with x-coordinate
705
+ * \param y_bit integer with the y-Bit (either 0 or 1)
706
+ * \param ctx BN_CTX object (optional)
707
+ * \return 1 on success and 0 if an error occurred
708
+ */
709
+ OSSL_DEPRECATEDIN_3_0 int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, EC_POINT *p,
710
+ const BIGNUM *x, int y_bit, BN_CTX *ctx);
711
+ #ifndef OPENSSL_NO_EC2M
712
+ /** Sets the affine coordinates of an EC_POINT. A synonym of
713
+ * EC_POINT_set_affine_coordinates
714
+ * \param group underlying EC_GROUP object
715
+ * \param p EC_POINT object
716
+ * \param x BIGNUM with the x-coordinate
717
+ * \param y BIGNUM with the y-coordinate
718
+ * \param ctx BN_CTX object (optional)
719
+ * \return 1 on success and 0 if an error occurred
720
+ */
721
+ OSSL_DEPRECATEDIN_3_0 int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p,
722
+ const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx);
723
+
724
+ /** Gets the affine coordinates of an EC_POINT. A synonym of
725
+ * EC_POINT_get_affine_coordinates
726
+ * \param group underlying EC_GROUP object
727
+ * \param p EC_POINT object
728
+ * \param x BIGNUM for the x-coordinate
729
+ * \param y BIGNUM for the y-coordinate
730
+ * \param ctx BN_CTX object (optional)
731
+ * \return 1 on success and 0 if an error occurred
732
+ */
733
+ OSSL_DEPRECATEDIN_3_0 int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group, const EC_POINT *p,
734
+ BIGNUM *x, BIGNUM *y, BN_CTX *ctx);
735
+
736
+ /** Sets the x9.62 compressed coordinates of a EC_POINT. A synonym of
737
+ * EC_POINT_set_compressed_coordinates
738
+ * \param group underlying EC_GROUP object
739
+ * \param p EC_POINT object
740
+ * \param x BIGNUM with x-coordinate
741
+ * \param y_bit integer with the y-Bit (either 0 or 1)
742
+ * \param ctx BN_CTX object (optional)
743
+ * \return 1 on success and 0 if an error occurred
744
+ */
745
+ OSSL_DEPRECATEDIN_3_0 int EC_POINT_set_compressed_coordinates_GF2m(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 EC_GROUP object of a EC_KEY object
1044
+ * \param key EC_KEY object
1045
+ * \return the EC_GROUP object (possibly NULL).
1046
+ */
1047
+ OSSL_DEPRECATEDIN_3_0 const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key);
1048
+
1049
+ /** Sets the EC_GROUP of a EC_KEY object.
1050
+ * \param key EC_KEY object
1051
+ * \param group EC_GROUP to use in the EC_KEY object (note: the EC_KEY
1052
+ * object will use an own copy of the EC_GROUP).
1053
+ * \return 1 on success and 0 if an error occurred.
1054
+ */
1055
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_set_group(EC_KEY *key, const EC_GROUP *group);
1056
+
1057
+ /** Returns the private key of a EC_KEY object.
1058
+ * \param key EC_KEY object
1059
+ * \return a BIGNUM with the private key (possibly NULL).
1060
+ */
1061
+ OSSL_DEPRECATEDIN_3_0 const BIGNUM *EC_KEY_get0_private_key(const EC_KEY *key);
1062
+
1063
+ /** Sets the private key of a EC_KEY object.
1064
+ * \param key EC_KEY object
1065
+ * \param prv BIGNUM with the private key (note: the EC_KEY object
1066
+ * will use an own copy of the BIGNUM).
1067
+ * \return 1 on success and 0 if an error occurred.
1068
+ */
1069
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_set_private_key(EC_KEY *key, const BIGNUM *prv);
1070
+
1071
+ /** Returns the public key of a EC_KEY object.
1072
+ * \param key the EC_KEY object
1073
+ * \return a EC_POINT object with the public key (possibly NULL)
1074
+ */
1075
+ OSSL_DEPRECATEDIN_3_0 const EC_POINT *EC_KEY_get0_public_key(const EC_KEY *key);
1076
+
1077
+ /** Sets the public key of a EC_KEY object.
1078
+ * \param key EC_KEY object
1079
+ * \param pub EC_POINT object with the public key (note: the EC_KEY object
1080
+ * will use an own copy of the EC_POINT object).
1081
+ * \return 1 on success and 0 if an error occurred.
1082
+ */
1083
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_set_public_key(EC_KEY *key, const EC_POINT *pub);
1084
+
1085
+ OSSL_DEPRECATEDIN_3_0 unsigned EC_KEY_get_enc_flags(const EC_KEY *key);
1086
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_set_enc_flags(EC_KEY *eckey, unsigned int flags);
1087
+ OSSL_DEPRECATEDIN_3_0 point_conversion_form_t EC_KEY_get_conv_form(const EC_KEY *key);
1088
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_set_conv_form(EC_KEY *eckey,
1089
+ point_conversion_form_t cform);
1090
+ #endif /*OPENSSL_NO_DEPRECATED_3_0 */
1091
+
1092
+ #define EC_KEY_get_ex_new_index(l, p, newf, dupf, freef) \
1093
+ CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_EC_KEY, l, p, newf, dupf, freef)
1094
+
1095
+ #ifndef OPENSSL_NO_DEPRECATED_3_0
1096
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_set_ex_data(EC_KEY *key, int idx, void *arg);
1097
+ OSSL_DEPRECATEDIN_3_0 void *EC_KEY_get_ex_data(const EC_KEY *key, int idx);
1098
+
1099
+ /* wrapper functions for the underlying EC_GROUP object */
1100
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_set_asn1_flag(EC_KEY *eckey, int asn1_flag);
1101
+
1102
+ /** Creates a table of pre-computed multiples of the generator to
1103
+ * accelerate further EC_KEY operations.
1104
+ * \param key EC_KEY object
1105
+ * \param ctx BN_CTX object (optional)
1106
+ * \return 1 on success and 0 if an error occurred.
1107
+ */
1108
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_precompute_mult(EC_KEY *key, BN_CTX *ctx);
1109
+
1110
+ /** Creates a new ec private (and optional a new public) key.
1111
+ * \param key EC_KEY object
1112
+ * \return 1 on success and 0 if an error occurred.
1113
+ */
1114
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_generate_key(EC_KEY *key);
1115
+
1116
+ /** Verifies that a private and/or public key is valid.
1117
+ * \param key the EC_KEY object
1118
+ * \return 1 on success and 0 otherwise.
1119
+ */
1120
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_check_key(const EC_KEY *key);
1121
+
1122
+ /** Indicates if an EC_KEY can be used for signing.
1123
+ * \param eckey the EC_KEY object
1124
+ * \return 1 if can sign and 0 otherwise.
1125
+ */
1126
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_can_sign(const EC_KEY *eckey);
1127
+
1128
+ /** Sets a public key from affine coordinates performing
1129
+ * necessary NIST PKV tests.
1130
+ * \param key the EC_KEY object
1131
+ * \param x public key x coordinate
1132
+ * \param y public key y coordinate
1133
+ * \return 1 on success and 0 otherwise.
1134
+ */
1135
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key,
1136
+ BIGNUM *x,
1137
+ BIGNUM *y);
1138
+
1139
+ /** Encodes an EC_KEY public key to an allocated octet string
1140
+ * \param key key to encode
1141
+ * \param form point conversion form
1142
+ * \param pbuf returns pointer to allocated buffer
1143
+ * \param ctx BN_CTX object (optional)
1144
+ * \return the length of the encoded octet string or 0 if an error occurred
1145
+ */
1146
+ OSSL_DEPRECATEDIN_3_0 size_t EC_KEY_key2buf(const EC_KEY *key,
1147
+ point_conversion_form_t form,
1148
+ unsigned char **pbuf, BN_CTX *ctx);
1149
+
1150
+ /** Decodes a EC_KEY public key from a octet string
1151
+ * \param key key to decode
1152
+ * \param buf memory buffer with the encoded ec point
1153
+ * \param len length of the encoded ec point
1154
+ * \param ctx BN_CTX object (optional)
1155
+ * \return 1 on success and 0 if an error occurred
1156
+ */
1157
+
1158
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_oct2key(EC_KEY *key, const unsigned char *buf,
1159
+ size_t len, BN_CTX *ctx);
1160
+
1161
+ /** Decodes an EC_KEY private key from an octet string
1162
+ * \param key key to decode
1163
+ * \param buf memory buffer with the encoded private key
1164
+ * \param len length of the encoded key
1165
+ * \return 1 on success and 0 if an error occurred
1166
+ */
1167
+
1168
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_oct2priv(EC_KEY *key, const unsigned char *buf,
1169
+ size_t len);
1170
+
1171
+ /** Encodes a EC_KEY private key to an octet string
1172
+ * \param key key to encode
1173
+ * \param buf memory buffer for the result. If NULL the function returns
1174
+ * required buffer size.
1175
+ * \param len length of the memory buffer
1176
+ * \return the length of the encoded octet string or 0 if an error occurred
1177
+ */
1178
+
1179
+ OSSL_DEPRECATEDIN_3_0 size_t EC_KEY_priv2oct(const EC_KEY *key,
1180
+ unsigned char *buf, size_t len);
1181
+
1182
+ /** Encodes an EC_KEY private key to an allocated octet string
1183
+ * \param eckey key to encode
1184
+ * \param pbuf returns pointer to allocated buffer
1185
+ * \return the length of the encoded octet string or 0 if an error occurred
1186
+ */
1187
+ OSSL_DEPRECATEDIN_3_0 size_t EC_KEY_priv2buf(const EC_KEY *eckey,
1188
+ unsigned char **pbuf);
1189
+
1190
+ /********************************************************************/
1191
+ /* de- and encoding functions for SEC1 ECPrivateKey */
1192
+ /********************************************************************/
1193
+
1194
+ /** Decodes a private key from a memory buffer.
1195
+ * \param key a pointer to a EC_KEY object which should be used (or NULL)
1196
+ * \param in pointer to memory with the DER encoded private key
1197
+ * \param len length of the DER encoded private key
1198
+ * \return the decoded private key or NULL if an error occurred.
1199
+ */
1200
+ OSSL_DEPRECATEDIN_3_0 EC_KEY *d2i_ECPrivateKey(EC_KEY **key,
1201
+ const unsigned char **in,
1202
+ long len);
1203
+
1204
+ /** Encodes a private key object and stores the result in a buffer.
1205
+ * \param key the EC_KEY object to encode
1206
+ * \param out the buffer for the result (if NULL the function returns number
1207
+ * of bytes needed).
1208
+ * \return 1 on success and 0 if an error occurred.
1209
+ */
1210
+ OSSL_DEPRECATEDIN_3_0 int i2d_ECPrivateKey(const EC_KEY *key,
1211
+ unsigned char **out);
1212
+
1213
+ /********************************************************************/
1214
+ /* de- and encoding functions for EC parameters */
1215
+ /********************************************************************/
1216
+
1217
+ /** Decodes ec parameter from a memory buffer.
1218
+ * \param key a pointer to a EC_KEY object which should be used (or NULL)
1219
+ * \param in pointer to memory with the DER encoded ec parameters
1220
+ * \param len length of the DER encoded ec parameters
1221
+ * \return a EC_KEY object with the decoded parameters or NULL if an error
1222
+ * occurred.
1223
+ */
1224
+ OSSL_DEPRECATEDIN_3_0 EC_KEY *d2i_ECParameters(EC_KEY **key,
1225
+ const unsigned char **in,
1226
+ long len);
1227
+
1228
+ /** Encodes ec parameter and stores the result in a buffer.
1229
+ * \param key the EC_KEY object with ec parameters to encode
1230
+ * \param out the buffer for the result (if NULL the function returns number
1231
+ * of bytes needed).
1232
+ * \return 1 on success and 0 if an error occurred.
1233
+ */
1234
+ OSSL_DEPRECATEDIN_3_0 int i2d_ECParameters(const EC_KEY *key,
1235
+ unsigned char **out);
1236
+
1237
+ /********************************************************************/
1238
+ /* de- and encoding functions for EC public key */
1239
+ /* (octet string, not DER -- hence 'o2i' and 'i2o') */
1240
+ /********************************************************************/
1241
+
1242
+ /** Decodes an ec public key from a octet string.
1243
+ * \param key a pointer to a EC_KEY object which should be used
1244
+ * \param in memory buffer with the encoded public key
1245
+ * \param len length of the encoded public key
1246
+ * \return EC_KEY object with decoded public key or NULL if an error
1247
+ * occurred.
1248
+ */
1249
+ OSSL_DEPRECATEDIN_3_0 EC_KEY *o2i_ECPublicKey(EC_KEY **key,
1250
+ const unsigned char **in, long len);
1251
+
1252
+ /** Encodes an ec public key in an octet string.
1253
+ * \param key the EC_KEY object with the public key
1254
+ * \param out the buffer for the result (if NULL the function returns number
1255
+ * of bytes needed).
1256
+ * \return 1 on success and 0 if an error occurred
1257
+ */
1258
+ OSSL_DEPRECATEDIN_3_0 int i2o_ECPublicKey(const EC_KEY *key, unsigned char **out);
1259
+
1260
+ /** Prints out the ec parameters on human readable form.
1261
+ * \param bp BIO object to which the information is printed
1262
+ * \param key EC_KEY object
1263
+ * \return 1 on success and 0 if an error occurred
1264
+ */
1265
+ OSSL_DEPRECATEDIN_3_0 int ECParameters_print(BIO *bp, const EC_KEY *key);
1266
+
1267
+ /** Prints out the contents of a EC_KEY object
1268
+ * \param bp BIO object to which the information is printed
1269
+ * \param key EC_KEY object
1270
+ * \param off line offset
1271
+ * \return 1 on success and 0 if an error occurred
1272
+ */
1273
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_print(BIO *bp, const EC_KEY *key, int off);
1274
+
1275
+ #ifndef OPENSSL_NO_STDIO
1276
+ /** Prints out the ec parameters on human readable form.
1277
+ * \param fp file descriptor to which the information is printed
1278
+ * \param key EC_KEY object
1279
+ * \return 1 on success and 0 if an error occurred
1280
+ */
1281
+ OSSL_DEPRECATEDIN_3_0 int ECParameters_print_fp(FILE *fp, const EC_KEY *key);
1282
+
1283
+ /** Prints out the contents of a EC_KEY object
1284
+ * \param fp file descriptor to which the information is printed
1285
+ * \param key EC_KEY object
1286
+ * \param off line offset
1287
+ * \return 1 on success and 0 if an error occurred
1288
+ */
1289
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_print_fp(FILE *fp, const EC_KEY *key, int off);
1290
+ #endif /* OPENSSL_NO_STDIO */
1291
+
1292
+ OSSL_DEPRECATEDIN_3_0 const EC_KEY_METHOD *EC_KEY_OpenSSL(void);
1293
+ OSSL_DEPRECATEDIN_3_0 const EC_KEY_METHOD *EC_KEY_get_default_method(void);
1294
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_set_default_method(const EC_KEY_METHOD *meth);
1295
+ OSSL_DEPRECATEDIN_3_0 const EC_KEY_METHOD *EC_KEY_get_method(const EC_KEY *key);
1296
+ OSSL_DEPRECATEDIN_3_0 int EC_KEY_set_method(EC_KEY *key, const EC_KEY_METHOD *meth);
1297
+ OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_new_method(ENGINE *engine);
1298
+
1299
+ /** The old name for ecdh_KDF_X9_63
1300
+ * The ECDH KDF specification has been mistakenly attributed to ANSI X9.62,
1301
+ * it is actually specified in ANSI X9.63.
1302
+ * This identifier is retained for backwards compatibility
1303
+ */
1304
+ OSSL_DEPRECATEDIN_3_0 int ECDH_KDF_X9_62(unsigned char *out, size_t outlen,
1305
+ const unsigned char *Z, size_t Zlen,
1306
+ const unsigned char *sinfo,
1307
+ size_t sinfolen, const EVP_MD *md);
1308
+
1309
+ OSSL_DEPRECATEDIN_3_0 int ECDH_compute_key(void *out, size_t outlen,
1310
+ const EC_POINT *pub_key,
1311
+ const EC_KEY *ecdh,
1312
+ void *(*KDF)(const void *in,
1313
+ size_t inlen, void *out,
1314
+ size_t *outlen));
1315
+ #endif /* OPENSSL_NO_DEPRECATED_3_0 */
1316
+
1317
+ typedef struct ECDSA_SIG_st ECDSA_SIG;
1318
+
1319
+ /** Allocates and initialize a ECDSA_SIG structure
1320
+ * \return pointer to a ECDSA_SIG structure or NULL if an error occurred
1321
+ */
1322
+ ECDSA_SIG *ECDSA_SIG_new(void);
1323
+
1324
+ /** frees a ECDSA_SIG structure
1325
+ * \param sig pointer to the ECDSA_SIG structure
1326
+ */
1327
+ void ECDSA_SIG_free(ECDSA_SIG *sig);
1328
+
1329
+ /** i2d_ECDSA_SIG encodes content of ECDSA_SIG (note: this function modifies *pp
1330
+ * (*pp += length of the DER encoded signature)).
1331
+ * \param sig pointer to the ECDSA_SIG object
1332
+ * \param pp pointer to a unsigned char pointer for the output or NULL
1333
+ * \return the length of the DER encoded ECDSA_SIG object or a negative value
1334
+ * on error
1335
+ */
1336
+ DECLARE_ASN1_ENCODE_FUNCTIONS_only(ECDSA_SIG, ECDSA_SIG)
1337
+
1338
+ /** d2i_ECDSA_SIG decodes an ECDSA signature (note: this function modifies *pp
1339
+ * (*pp += len)).
1340
+ * \param sig pointer to ECDSA_SIG pointer (may be NULL)
1341
+ * \param pp memory buffer with the DER encoded signature
1342
+ * \param len length of the buffer
1343
+ * \return pointer to the decoded ECDSA_SIG structure (or NULL)
1344
+ */
1345
+
1346
+ /** Accessor for r and s fields of ECDSA_SIG
1347
+ * \param sig pointer to ECDSA_SIG structure
1348
+ * \param pr pointer to BIGNUM pointer for r (may be NULL)
1349
+ * \param ps pointer to BIGNUM pointer for s (may be NULL)
1350
+ */
1351
+ void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps);
1352
+
1353
+ /** Accessor for r field of ECDSA_SIG
1354
+ * \param sig pointer to ECDSA_SIG structure
1355
+ */
1356
+ const BIGNUM *ECDSA_SIG_get0_r(const ECDSA_SIG *sig);
1357
+
1358
+ /** Accessor for s field of ECDSA_SIG
1359
+ * \param sig pointer to ECDSA_SIG structure
1360
+ */
1361
+ const BIGNUM *ECDSA_SIG_get0_s(const ECDSA_SIG *sig);
1362
+
1363
+ /** Setter for r and s fields of ECDSA_SIG
1364
+ * \param sig pointer to ECDSA_SIG structure
1365
+ * \param r pointer to BIGNUM for r
1366
+ * \param s pointer to BIGNUM for s
1367
+ */
1368
+ int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s);
1369
+
1370
+ #ifndef OPENSSL_NO_DEPRECATED_3_0
1371
+ /** Computes the ECDSA signature of the given hash value using
1372
+ * the supplied private key and returns the created signature.
1373
+ * \param dgst pointer to the hash value
1374
+ * \param dgst_len length of the hash value
1375
+ * \param eckey EC_KEY object containing a private EC key
1376
+ * \return pointer to a ECDSA_SIG structure or NULL if an error occurred
1377
+ */
1378
+ OSSL_DEPRECATEDIN_3_0 ECDSA_SIG *ECDSA_do_sign(const unsigned char *dgst,
1379
+ int dgst_len, EC_KEY *eckey);
1380
+
1381
+ /** Computes ECDSA signature of a given hash value using the supplied
1382
+ * private key (note: sig must point to ECDSA_size(eckey) bytes of memory).
1383
+ * \param dgst pointer to the hash value to sign
1384
+ * \param dgstlen length of the hash value
1385
+ * \param kinv BIGNUM with a pre-computed inverse k (optional)
1386
+ * \param rp BIGNUM with a pre-computed rp value (optional),
1387
+ * see ECDSA_sign_setup
1388
+ * \param eckey EC_KEY object containing a private EC key
1389
+ * \return pointer to a ECDSA_SIG structure or NULL if an error occurred
1390
+ */
1391
+ OSSL_DEPRECATEDIN_3_0 ECDSA_SIG *ECDSA_do_sign_ex(const unsigned char *dgst,
1392
+ int dgstlen, const BIGNUM *kinv,
1393
+ const BIGNUM *rp, EC_KEY *eckey);
1394
+
1395
+ /** Verifies that the supplied signature is a valid ECDSA
1396
+ * signature of the supplied hash value using the supplied public key.
1397
+ * \param dgst pointer to the hash value
1398
+ * \param dgst_len length of the hash value
1399
+ * \param sig ECDSA_SIG structure
1400
+ * \param eckey EC_KEY object containing a public EC key
1401
+ * \return 1 if the signature is valid, 0 if the signature is invalid
1402
+ * and -1 on error
1403
+ */
1404
+ OSSL_DEPRECATEDIN_3_0 int ECDSA_do_verify(const unsigned char *dgst, int dgst_len,
1405
+ const ECDSA_SIG *sig, EC_KEY *eckey);
1406
+
1407
+ /** Precompute parts of the signing operation
1408
+ * \param eckey EC_KEY object containing a private EC key
1409
+ * \param ctx BN_CTX object (optional)
1410
+ * \param kinv BIGNUM pointer for the inverse of k
1411
+ * \param rp BIGNUM pointer for x coordinate of k * generator
1412
+ * \return 1 on success and 0 otherwise
1413
+ */
1414
+ OSSL_DEPRECATEDIN_3_0 int ECDSA_sign_setup(EC_KEY *eckey, BN_CTX *ctx,
1415
+ BIGNUM **kinv, BIGNUM **rp);
1416
+
1417
+ /** Computes ECDSA signature of a given hash value using the supplied
1418
+ * private key (note: sig must point to ECDSA_size(eckey) bytes of memory).
1419
+ * \param type this parameter is ignored
1420
+ * \param dgst pointer to the hash value to sign
1421
+ * \param dgstlen length of the hash value
1422
+ * \param sig memory for the DER encoded created signature
1423
+ * \param siglen pointer to the length of the returned signature
1424
+ * \param eckey EC_KEY object containing a private EC key
1425
+ * \return 1 on success and 0 otherwise
1426
+ */
1427
+ OSSL_DEPRECATEDIN_3_0 int ECDSA_sign(int type, const unsigned char *dgst,
1428
+ int dgstlen, unsigned char *sig,
1429
+ unsigned int *siglen, EC_KEY *eckey);
1430
+
1431
+ /** Computes ECDSA signature of a given hash value using the supplied
1432
+ * private key (note: sig must point to ECDSA_size(eckey) bytes of memory).
1433
+ * \param type this parameter is ignored
1434
+ * \param dgst pointer to the hash value to sign
1435
+ * \param dgstlen length of the hash value
1436
+ * \param sig buffer to hold the DER encoded signature
1437
+ * \param siglen pointer to the length of the returned signature
1438
+ * \param kinv BIGNUM with a pre-computed inverse k (optional)
1439
+ * \param rp BIGNUM with a pre-computed rp value (optional),
1440
+ * see ECDSA_sign_setup
1441
+ * \param eckey EC_KEY object containing a private EC key
1442
+ * \return 1 on success and 0 otherwise
1443
+ */
1444
+ OSSL_DEPRECATEDIN_3_0 int ECDSA_sign_ex(int type, const unsigned char *dgst,
1445
+ int dgstlen, unsigned char *sig,
1446
+ unsigned int *siglen, const BIGNUM *kinv,
1447
+ const BIGNUM *rp, EC_KEY *eckey);
1448
+
1449
+ /** Verifies that the given signature is valid ECDSA signature
1450
+ * of the supplied hash value using the specified public key.
1451
+ * \param type this parameter is ignored
1452
+ * \param dgst pointer to the hash value
1453
+ * \param dgstlen length of the hash value
1454
+ * \param sig pointer to the DER encoded signature
1455
+ * \param siglen length of the DER encoded signature
1456
+ * \param eckey EC_KEY object containing a public EC key
1457
+ * \return 1 if the signature is valid, 0 if the signature is invalid
1458
+ * and -1 on error
1459
+ */
1460
+ OSSL_DEPRECATEDIN_3_0 int ECDSA_verify(int type, const unsigned char *dgst,
1461
+ int dgstlen, const unsigned char *sig,
1462
+ int siglen, EC_KEY *eckey);
1463
+
1464
+ /** Returns the maximum length of the DER encoded signature
1465
+ * \param eckey EC_KEY object
1466
+ * \return numbers of bytes required for the DER encoded signature
1467
+ */
1468
+ OSSL_DEPRECATEDIN_3_0 int ECDSA_size(const EC_KEY *eckey);
1469
+
1470
+ /********************************************************************/
1471
+ /* EC_KEY_METHOD constructors, destructors, writers and accessors */
1472
+ /********************************************************************/
1473
+
1474
+ OSSL_DEPRECATEDIN_3_0 EC_KEY_METHOD *EC_KEY_METHOD_new(const EC_KEY_METHOD *meth);
1475
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_free(EC_KEY_METHOD *meth);
1476
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_set_init(EC_KEY_METHOD *meth,
1477
+ int (*init)(EC_KEY *key),
1478
+ void (*finish)(EC_KEY *key),
1479
+ int (*copy)(EC_KEY *dest, const EC_KEY *src),
1480
+ int (*set_group)(EC_KEY *key, const EC_GROUP *grp),
1481
+ int (*set_private)(EC_KEY *key, const BIGNUM *priv_key),
1482
+ int (*set_public)(EC_KEY *key, const EC_POINT *pub_key));
1483
+
1484
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_set_keygen(EC_KEY_METHOD *meth,
1485
+ int (*keygen)(EC_KEY *key));
1486
+
1487
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_set_compute_key(EC_KEY_METHOD *meth,
1488
+ int (*ckey)(unsigned char **psec, size_t *pseclen,
1489
+ const EC_POINT *pub_key, const EC_KEY *ecdh));
1490
+
1491
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_set_sign(EC_KEY_METHOD *meth,
1492
+ int (*sign)(int type, const unsigned char *dgst,
1493
+ int dlen, unsigned char *sig,
1494
+ unsigned int *siglen,
1495
+ const BIGNUM *kinv, const BIGNUM *r,
1496
+ EC_KEY *eckey),
1497
+ int (*sign_setup)(EC_KEY *eckey, BN_CTX *ctx_in,
1498
+ BIGNUM **kinvp, BIGNUM **rp),
1499
+ ECDSA_SIG *(*sign_sig)(const unsigned char *dgst,
1500
+ int dgst_len,
1501
+ const BIGNUM *in_kinv,
1502
+ const BIGNUM *in_r,
1503
+ EC_KEY *eckey));
1504
+
1505
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_set_verify(EC_KEY_METHOD *meth,
1506
+ int (*verify)(int type, const unsigned char *dgst, int dgst_len,
1507
+ const unsigned char *sigbuf,
1508
+ int sig_len, EC_KEY *eckey),
1509
+ int (*verify_sig)(const unsigned char *dgst,
1510
+ int dgst_len, const ECDSA_SIG *sig,
1511
+ EC_KEY *eckey));
1512
+
1513
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_get_init(const EC_KEY_METHOD *meth,
1514
+ int (**pinit)(EC_KEY *key),
1515
+ void (**pfinish)(EC_KEY *key),
1516
+ int (**pcopy)(EC_KEY *dest, const EC_KEY *src),
1517
+ int (**pset_group)(EC_KEY *key, const EC_GROUP *grp),
1518
+ int (**pset_private)(EC_KEY *key, const BIGNUM *priv_key),
1519
+ int (**pset_public)(EC_KEY *key, const EC_POINT *pub_key));
1520
+
1521
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_get_keygen(const EC_KEY_METHOD *meth, int (**pkeygen)(EC_KEY *key));
1522
+
1523
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_get_compute_key(const EC_KEY_METHOD *meth,
1524
+ int (**pck)(unsigned char **psec,
1525
+ size_t *pseclen,
1526
+ const EC_POINT *pub_key,
1527
+ const EC_KEY *ecdh));
1528
+
1529
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_get_sign(const EC_KEY_METHOD *meth,
1530
+ int (**psign)(int type, const unsigned char *dgst,
1531
+ int dlen, unsigned char *sig,
1532
+ unsigned int *siglen,
1533
+ const BIGNUM *kinv, const BIGNUM *r,
1534
+ EC_KEY *eckey),
1535
+ int (**psign_setup)(EC_KEY *eckey, BN_CTX *ctx_in,
1536
+ BIGNUM **kinvp, BIGNUM **rp),
1537
+ ECDSA_SIG *(**psign_sig)(const unsigned char *dgst,
1538
+ int dgst_len,
1539
+ const BIGNUM *in_kinv,
1540
+ const BIGNUM *in_r,
1541
+ EC_KEY *eckey));
1542
+
1543
+ OSSL_DEPRECATEDIN_3_0 void EC_KEY_METHOD_get_verify(const EC_KEY_METHOD *meth,
1544
+ int (**pverify)(int type, const unsigned char *dgst, int dgst_len,
1545
+ const unsigned char *sigbuf,
1546
+ int sig_len, EC_KEY *eckey),
1547
+ int (**pverify_sig)(const unsigned char *dgst,
1548
+ int dgst_len,
1549
+ const ECDSA_SIG *sig,
1550
+ EC_KEY *eckey));
1551
+ #endif /* OPENSSL_NO_DEPRECATED_3_0 */
1552
+
1553
+ #define EVP_EC_gen(curve) \
1554
+ EVP_PKEY_Q_keygen(NULL, NULL, "EC", (char *)(strstr(curve, "")))
1555
+ /* strstr is used to enable type checking for the variadic string arg */
1556
+ #define ECParameters_dup(x) ASN1_dup_of(EC_KEY, i2d_ECParameters, \
1557
+ d2i_ECParameters, x)
1558
+
1559
+ #ifndef __cplusplus
1560
+ #if defined(__SUNPRO_C)
1561
+ #if __SUNPRO_C >= 0x520
1562
+ #pragma error_messages(default, E_ARRAY_OF_INCOMPLETE_NONAME, E_ARRAY_OF_INCOMPLETE)
1563
+ #endif
1564
+ #endif
1565
+ #endif
1566
+
1567
+ #endif
1568
+ #ifdef __cplusplus
1569
+ }
1570
+ #endif
1571
+ #endif