der_ec.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. /*
  2. * WARNING: do not edit!
  3. * Generated by makefile from providers\common\include\prov\der_ec.h.in
  4. *
  5. * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
  6. *
  7. * Licensed under the Apache License 2.0 (the "License"). You may not use
  8. * this file except in compliance with the License. You can obtain a copy
  9. * in the file LICENSE in the source distribution or at
  10. * https://www.openssl.org/source/license.html
  11. */
  12. #include "crypto/ec.h"
  13. #include "internal/der.h"
  14. /* Well known OIDs precompiled */
  15. /*
  16. * ecdsa-with-SHA1 OBJECT IDENTIFIER ::= { id-ecSigType 1 }
  17. */
  18. #define DER_OID_V_ecdsa_with_SHA1 DER_P_OBJECT, 7, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x01
  19. #define DER_OID_SZ_ecdsa_with_SHA1 9
  20. extern const unsigned char ossl_der_oid_ecdsa_with_SHA1[DER_OID_SZ_ecdsa_with_SHA1];
  21. /*
  22. * id-ecPublicKey OBJECT IDENTIFIER ::= { id-publicKeyType 1 }
  23. */
  24. #define DER_OID_V_id_ecPublicKey DER_P_OBJECT, 7, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x02, 0x01
  25. #define DER_OID_SZ_id_ecPublicKey 9
  26. extern const unsigned char ossl_der_oid_id_ecPublicKey[DER_OID_SZ_id_ecPublicKey];
  27. /*
  28. * c2pnb163v1 OBJECT IDENTIFIER ::= { c-TwoCurve 1 }
  29. */
  30. #define DER_OID_V_c2pnb163v1 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x01
  31. #define DER_OID_SZ_c2pnb163v1 10
  32. extern const unsigned char ossl_der_oid_c2pnb163v1[DER_OID_SZ_c2pnb163v1];
  33. /*
  34. * c2pnb163v2 OBJECT IDENTIFIER ::= { c-TwoCurve 2 }
  35. */
  36. #define DER_OID_V_c2pnb163v2 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x02
  37. #define DER_OID_SZ_c2pnb163v2 10
  38. extern const unsigned char ossl_der_oid_c2pnb163v2[DER_OID_SZ_c2pnb163v2];
  39. /*
  40. * c2pnb163v3 OBJECT IDENTIFIER ::= { c-TwoCurve 3 }
  41. */
  42. #define DER_OID_V_c2pnb163v3 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x03
  43. #define DER_OID_SZ_c2pnb163v3 10
  44. extern const unsigned char ossl_der_oid_c2pnb163v3[DER_OID_SZ_c2pnb163v3];
  45. /*
  46. * c2pnb176w1 OBJECT IDENTIFIER ::= { c-TwoCurve 4 }
  47. */
  48. #define DER_OID_V_c2pnb176w1 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x04
  49. #define DER_OID_SZ_c2pnb176w1 10
  50. extern const unsigned char ossl_der_oid_c2pnb176w1[DER_OID_SZ_c2pnb176w1];
  51. /*
  52. * c2tnb191v1 OBJECT IDENTIFIER ::= { c-TwoCurve 5 }
  53. */
  54. #define DER_OID_V_c2tnb191v1 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x05
  55. #define DER_OID_SZ_c2tnb191v1 10
  56. extern const unsigned char ossl_der_oid_c2tnb191v1[DER_OID_SZ_c2tnb191v1];
  57. /*
  58. * c2tnb191v2 OBJECT IDENTIFIER ::= { c-TwoCurve 6 }
  59. */
  60. #define DER_OID_V_c2tnb191v2 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x06
  61. #define DER_OID_SZ_c2tnb191v2 10
  62. extern const unsigned char ossl_der_oid_c2tnb191v2[DER_OID_SZ_c2tnb191v2];
  63. /*
  64. * c2tnb191v3 OBJECT IDENTIFIER ::= { c-TwoCurve 7 }
  65. */
  66. #define DER_OID_V_c2tnb191v3 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x07
  67. #define DER_OID_SZ_c2tnb191v3 10
  68. extern const unsigned char ossl_der_oid_c2tnb191v3[DER_OID_SZ_c2tnb191v3];
  69. /*
  70. * c2onb191v4 OBJECT IDENTIFIER ::= { c-TwoCurve 8 }
  71. */
  72. #define DER_OID_V_c2onb191v4 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x08
  73. #define DER_OID_SZ_c2onb191v4 10
  74. extern const unsigned char ossl_der_oid_c2onb191v4[DER_OID_SZ_c2onb191v4];
  75. /*
  76. * c2onb191v5 OBJECT IDENTIFIER ::= { c-TwoCurve 9 }
  77. */
  78. #define DER_OID_V_c2onb191v5 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x09
  79. #define DER_OID_SZ_c2onb191v5 10
  80. extern const unsigned char ossl_der_oid_c2onb191v5[DER_OID_SZ_c2onb191v5];
  81. /*
  82. * c2pnb208w1 OBJECT IDENTIFIER ::= { c-TwoCurve 10 }
  83. */
  84. #define DER_OID_V_c2pnb208w1 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x0A
  85. #define DER_OID_SZ_c2pnb208w1 10
  86. extern const unsigned char ossl_der_oid_c2pnb208w1[DER_OID_SZ_c2pnb208w1];
  87. /*
  88. * c2tnb239v1 OBJECT IDENTIFIER ::= { c-TwoCurve 11 }
  89. */
  90. #define DER_OID_V_c2tnb239v1 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x0B
  91. #define DER_OID_SZ_c2tnb239v1 10
  92. extern const unsigned char ossl_der_oid_c2tnb239v1[DER_OID_SZ_c2tnb239v1];
  93. /*
  94. * c2tnb239v2 OBJECT IDENTIFIER ::= { c-TwoCurve 12 }
  95. */
  96. #define DER_OID_V_c2tnb239v2 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x0C
  97. #define DER_OID_SZ_c2tnb239v2 10
  98. extern const unsigned char ossl_der_oid_c2tnb239v2[DER_OID_SZ_c2tnb239v2];
  99. /*
  100. * c2tnb239v3 OBJECT IDENTIFIER ::= { c-TwoCurve 13 }
  101. */
  102. #define DER_OID_V_c2tnb239v3 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x0D
  103. #define DER_OID_SZ_c2tnb239v3 10
  104. extern const unsigned char ossl_der_oid_c2tnb239v3[DER_OID_SZ_c2tnb239v3];
  105. /*
  106. * c2onb239v4 OBJECT IDENTIFIER ::= { c-TwoCurve 14 }
  107. */
  108. #define DER_OID_V_c2onb239v4 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x0E
  109. #define DER_OID_SZ_c2onb239v4 10
  110. extern const unsigned char ossl_der_oid_c2onb239v4[DER_OID_SZ_c2onb239v4];
  111. /*
  112. * c2onb239v5 OBJECT IDENTIFIER ::= { c-TwoCurve 15 }
  113. */
  114. #define DER_OID_V_c2onb239v5 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x0F
  115. #define DER_OID_SZ_c2onb239v5 10
  116. extern const unsigned char ossl_der_oid_c2onb239v5[DER_OID_SZ_c2onb239v5];
  117. /*
  118. * c2pnb272w1 OBJECT IDENTIFIER ::= { c-TwoCurve 16 }
  119. */
  120. #define DER_OID_V_c2pnb272w1 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x10
  121. #define DER_OID_SZ_c2pnb272w1 10
  122. extern const unsigned char ossl_der_oid_c2pnb272w1[DER_OID_SZ_c2pnb272w1];
  123. /*
  124. * c2pnb304w1 OBJECT IDENTIFIER ::= { c-TwoCurve 17 }
  125. */
  126. #define DER_OID_V_c2pnb304w1 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x11
  127. #define DER_OID_SZ_c2pnb304w1 10
  128. extern const unsigned char ossl_der_oid_c2pnb304w1[DER_OID_SZ_c2pnb304w1];
  129. /*
  130. * c2tnb359v1 OBJECT IDENTIFIER ::= { c-TwoCurve 18 }
  131. */
  132. #define DER_OID_V_c2tnb359v1 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x12
  133. #define DER_OID_SZ_c2tnb359v1 10
  134. extern const unsigned char ossl_der_oid_c2tnb359v1[DER_OID_SZ_c2tnb359v1];
  135. /*
  136. * c2pnb368w1 OBJECT IDENTIFIER ::= { c-TwoCurve 19 }
  137. */
  138. #define DER_OID_V_c2pnb368w1 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x13
  139. #define DER_OID_SZ_c2pnb368w1 10
  140. extern const unsigned char ossl_der_oid_c2pnb368w1[DER_OID_SZ_c2pnb368w1];
  141. /*
  142. * c2tnb431r1 OBJECT IDENTIFIER ::= { c-TwoCurve 20 }
  143. */
  144. #define DER_OID_V_c2tnb431r1 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x00, 0x14
  145. #define DER_OID_SZ_c2tnb431r1 10
  146. extern const unsigned char ossl_der_oid_c2tnb431r1[DER_OID_SZ_c2tnb431r1];
  147. /*
  148. * prime192v1 OBJECT IDENTIFIER ::= { primeCurve 1 }
  149. */
  150. #define DER_OID_V_prime192v1 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x01
  151. #define DER_OID_SZ_prime192v1 10
  152. extern const unsigned char ossl_der_oid_prime192v1[DER_OID_SZ_prime192v1];
  153. /*
  154. * prime192v2 OBJECT IDENTIFIER ::= { primeCurve 2 }
  155. */
  156. #define DER_OID_V_prime192v2 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x02
  157. #define DER_OID_SZ_prime192v2 10
  158. extern const unsigned char ossl_der_oid_prime192v2[DER_OID_SZ_prime192v2];
  159. /*
  160. * prime192v3 OBJECT IDENTIFIER ::= { primeCurve 3 }
  161. */
  162. #define DER_OID_V_prime192v3 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x03
  163. #define DER_OID_SZ_prime192v3 10
  164. extern const unsigned char ossl_der_oid_prime192v3[DER_OID_SZ_prime192v3];
  165. /*
  166. * prime239v1 OBJECT IDENTIFIER ::= { primeCurve 4 }
  167. */
  168. #define DER_OID_V_prime239v1 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x04
  169. #define DER_OID_SZ_prime239v1 10
  170. extern const unsigned char ossl_der_oid_prime239v1[DER_OID_SZ_prime239v1];
  171. /*
  172. * prime239v2 OBJECT IDENTIFIER ::= { primeCurve 5 }
  173. */
  174. #define DER_OID_V_prime239v2 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x05
  175. #define DER_OID_SZ_prime239v2 10
  176. extern const unsigned char ossl_der_oid_prime239v2[DER_OID_SZ_prime239v2];
  177. /*
  178. * prime239v3 OBJECT IDENTIFIER ::= { primeCurve 6 }
  179. */
  180. #define DER_OID_V_prime239v3 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x06
  181. #define DER_OID_SZ_prime239v3 10
  182. extern const unsigned char ossl_der_oid_prime239v3[DER_OID_SZ_prime239v3];
  183. /*
  184. * prime256v1 OBJECT IDENTIFIER ::= { primeCurve 7 }
  185. */
  186. #define DER_OID_V_prime256v1 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x07
  187. #define DER_OID_SZ_prime256v1 10
  188. extern const unsigned char ossl_der_oid_prime256v1[DER_OID_SZ_prime256v1];
  189. /*
  190. * ecdsa-with-SHA224 OBJECT IDENTIFIER ::= { iso(1) member-body(2)
  191. * us(840) ansi-X9-62(10045) signatures(4) ecdsa-with-SHA2(3) 1 }
  192. */
  193. #define DER_OID_V_ecdsa_with_SHA224 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x01
  194. #define DER_OID_SZ_ecdsa_with_SHA224 10
  195. extern const unsigned char ossl_der_oid_ecdsa_with_SHA224[DER_OID_SZ_ecdsa_with_SHA224];
  196. /*
  197. * ecdsa-with-SHA256 OBJECT IDENTIFIER ::= { iso(1) member-body(2)
  198. * us(840) ansi-X9-62(10045) signatures(4) ecdsa-with-SHA2(3) 2 }
  199. */
  200. #define DER_OID_V_ecdsa_with_SHA256 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x02
  201. #define DER_OID_SZ_ecdsa_with_SHA256 10
  202. extern const unsigned char ossl_der_oid_ecdsa_with_SHA256[DER_OID_SZ_ecdsa_with_SHA256];
  203. /*
  204. * ecdsa-with-SHA384 OBJECT IDENTIFIER ::= { iso(1) member-body(2)
  205. * us(840) ansi-X9-62(10045) signatures(4) ecdsa-with-SHA2(3) 3 }
  206. */
  207. #define DER_OID_V_ecdsa_with_SHA384 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x03
  208. #define DER_OID_SZ_ecdsa_with_SHA384 10
  209. extern const unsigned char ossl_der_oid_ecdsa_with_SHA384[DER_OID_SZ_ecdsa_with_SHA384];
  210. /*
  211. * ecdsa-with-SHA512 OBJECT IDENTIFIER ::= { iso(1) member-body(2)
  212. * us(840) ansi-X9-62(10045) signatures(4) ecdsa-with-SHA2(3) 4 }
  213. */
  214. #define DER_OID_V_ecdsa_with_SHA512 DER_P_OBJECT, 8, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x04
  215. #define DER_OID_SZ_ecdsa_with_SHA512 10
  216. extern const unsigned char ossl_der_oid_ecdsa_with_SHA512[DER_OID_SZ_ecdsa_with_SHA512];
  217. /*
  218. * id-ecdsa-with-sha3-224 OBJECT IDENTIFIER ::= { sigAlgs 9 }
  219. */
  220. #define DER_OID_V_id_ecdsa_with_sha3_224 DER_P_OBJECT, 9, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x03, 0x09
  221. #define DER_OID_SZ_id_ecdsa_with_sha3_224 11
  222. extern const unsigned char ossl_der_oid_id_ecdsa_with_sha3_224[DER_OID_SZ_id_ecdsa_with_sha3_224];
  223. /*
  224. * id-ecdsa-with-sha3-256 OBJECT IDENTIFIER ::= { sigAlgs 10 }
  225. */
  226. #define DER_OID_V_id_ecdsa_with_sha3_256 DER_P_OBJECT, 9, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x03, 0x0A
  227. #define DER_OID_SZ_id_ecdsa_with_sha3_256 11
  228. extern const unsigned char ossl_der_oid_id_ecdsa_with_sha3_256[DER_OID_SZ_id_ecdsa_with_sha3_256];
  229. /*
  230. * id-ecdsa-with-sha3-384 OBJECT IDENTIFIER ::= { sigAlgs 11 }
  231. */
  232. #define DER_OID_V_id_ecdsa_with_sha3_384 DER_P_OBJECT, 9, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x03, 0x0B
  233. #define DER_OID_SZ_id_ecdsa_with_sha3_384 11
  234. extern const unsigned char ossl_der_oid_id_ecdsa_with_sha3_384[DER_OID_SZ_id_ecdsa_with_sha3_384];
  235. /*
  236. * id-ecdsa-with-sha3-512 OBJECT IDENTIFIER ::= { sigAlgs 12 }
  237. */
  238. #define DER_OID_V_id_ecdsa_with_sha3_512 DER_P_OBJECT, 9, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x03, 0x0C
  239. #define DER_OID_SZ_id_ecdsa_with_sha3_512 11
  240. extern const unsigned char ossl_der_oid_id_ecdsa_with_sha3_512[DER_OID_SZ_id_ecdsa_with_sha3_512];
  241. /* Subject Public Key Info */
  242. int ossl_DER_w_algorithmIdentifier_EC(WPACKET *pkt, int cont, EC_KEY *ec);
  243. /* Signature */
  244. int ossl_DER_w_algorithmIdentifier_ECDSA_with_MD(WPACKET *pkt, int cont,
  245. EC_KEY *ec, int mdnid);