der_rsa.h 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. /*
  2. * WARNING: do not edit!
  3. * Generated by makefile from providers\common\include\prov\der_rsa.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/rsa.h"
  13. #include "internal/der.h"
  14. /* Well known OIDs precompiled */
  15. /*
  16. * hashAlgs OBJECT IDENTIFIER ::= { nistAlgorithms 2 }
  17. */
  18. #define DER_OID_V_hashAlgs DER_P_OBJECT, 8, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02
  19. #define DER_OID_SZ_hashAlgs 10
  20. extern const unsigned char ossl_der_oid_hashAlgs[DER_OID_SZ_hashAlgs];
  21. /*
  22. * rsaEncryption OBJECT IDENTIFIER ::= { pkcs-1 1 }
  23. */
  24. #define DER_OID_V_rsaEncryption DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01
  25. #define DER_OID_SZ_rsaEncryption 11
  26. extern const unsigned char ossl_der_oid_rsaEncryption[DER_OID_SZ_rsaEncryption];
  27. /*
  28. * id-RSAES-OAEP OBJECT IDENTIFIER ::= { pkcs-1 7 }
  29. */
  30. #define DER_OID_V_id_RSAES_OAEP DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x07
  31. #define DER_OID_SZ_id_RSAES_OAEP 11
  32. extern const unsigned char ossl_der_oid_id_RSAES_OAEP[DER_OID_SZ_id_RSAES_OAEP];
  33. /*
  34. * id-pSpecified OBJECT IDENTIFIER ::= { pkcs-1 9 }
  35. */
  36. #define DER_OID_V_id_pSpecified DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x09
  37. #define DER_OID_SZ_id_pSpecified 11
  38. extern const unsigned char ossl_der_oid_id_pSpecified[DER_OID_SZ_id_pSpecified];
  39. /*
  40. * id-RSASSA-PSS OBJECT IDENTIFIER ::= { pkcs-1 10 }
  41. */
  42. #define DER_OID_V_id_RSASSA_PSS DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0A
  43. #define DER_OID_SZ_id_RSASSA_PSS 11
  44. extern const unsigned char ossl_der_oid_id_RSASSA_PSS[DER_OID_SZ_id_RSASSA_PSS];
  45. /*
  46. * md2WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 2 }
  47. */
  48. #define DER_OID_V_md2WithRSAEncryption DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x02
  49. #define DER_OID_SZ_md2WithRSAEncryption 11
  50. extern const unsigned char ossl_der_oid_md2WithRSAEncryption[DER_OID_SZ_md2WithRSAEncryption];
  51. /*
  52. * md5WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 4 }
  53. */
  54. #define DER_OID_V_md5WithRSAEncryption DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x04
  55. #define DER_OID_SZ_md5WithRSAEncryption 11
  56. extern const unsigned char ossl_der_oid_md5WithRSAEncryption[DER_OID_SZ_md5WithRSAEncryption];
  57. /*
  58. * sha1WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 5 }
  59. */
  60. #define DER_OID_V_sha1WithRSAEncryption DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x05
  61. #define DER_OID_SZ_sha1WithRSAEncryption 11
  62. extern const unsigned char ossl_der_oid_sha1WithRSAEncryption[DER_OID_SZ_sha1WithRSAEncryption];
  63. /*
  64. * sha224WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 14 }
  65. */
  66. #define DER_OID_V_sha224WithRSAEncryption DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0E
  67. #define DER_OID_SZ_sha224WithRSAEncryption 11
  68. extern const unsigned char ossl_der_oid_sha224WithRSAEncryption[DER_OID_SZ_sha224WithRSAEncryption];
  69. /*
  70. * sha256WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 11 }
  71. */
  72. #define DER_OID_V_sha256WithRSAEncryption DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B
  73. #define DER_OID_SZ_sha256WithRSAEncryption 11
  74. extern const unsigned char ossl_der_oid_sha256WithRSAEncryption[DER_OID_SZ_sha256WithRSAEncryption];
  75. /*
  76. * sha384WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 12 }
  77. */
  78. #define DER_OID_V_sha384WithRSAEncryption DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0C
  79. #define DER_OID_SZ_sha384WithRSAEncryption 11
  80. extern const unsigned char ossl_der_oid_sha384WithRSAEncryption[DER_OID_SZ_sha384WithRSAEncryption];
  81. /*
  82. * sha512WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 13 }
  83. */
  84. #define DER_OID_V_sha512WithRSAEncryption DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0D
  85. #define DER_OID_SZ_sha512WithRSAEncryption 11
  86. extern const unsigned char ossl_der_oid_sha512WithRSAEncryption[DER_OID_SZ_sha512WithRSAEncryption];
  87. /*
  88. * sha512-224WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 15 }
  89. */
  90. #define DER_OID_V_sha512_224WithRSAEncryption DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0F
  91. #define DER_OID_SZ_sha512_224WithRSAEncryption 11
  92. extern const unsigned char ossl_der_oid_sha512_224WithRSAEncryption[DER_OID_SZ_sha512_224WithRSAEncryption];
  93. /*
  94. * sha512-256WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 16 }
  95. */
  96. #define DER_OID_V_sha512_256WithRSAEncryption DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x10
  97. #define DER_OID_SZ_sha512_256WithRSAEncryption 11
  98. extern const unsigned char ossl_der_oid_sha512_256WithRSAEncryption[DER_OID_SZ_sha512_256WithRSAEncryption];
  99. /*
  100. * id-mgf1 OBJECT IDENTIFIER ::= { pkcs-1 8 }
  101. */
  102. #define DER_OID_V_id_mgf1 DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x08
  103. #define DER_OID_SZ_id_mgf1 11
  104. extern const unsigned char ossl_der_oid_id_mgf1[DER_OID_SZ_id_mgf1];
  105. /*
  106. * id-rsassa-pkcs1-v1_5-with-sha3-224 OBJECT IDENTIFIER ::= { sigAlgs 13 }
  107. */
  108. #define DER_OID_V_id_rsassa_pkcs1_v1_5_with_sha3_224 DER_P_OBJECT, 9, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x03, 0x0D
  109. #define DER_OID_SZ_id_rsassa_pkcs1_v1_5_with_sha3_224 11
  110. extern const unsigned char ossl_der_oid_id_rsassa_pkcs1_v1_5_with_sha3_224[DER_OID_SZ_id_rsassa_pkcs1_v1_5_with_sha3_224];
  111. /*
  112. * id-rsassa-pkcs1-v1_5-with-sha3-256 OBJECT IDENTIFIER ::= { sigAlgs 14 }
  113. */
  114. #define DER_OID_V_id_rsassa_pkcs1_v1_5_with_sha3_256 DER_P_OBJECT, 9, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x03, 0x0E
  115. #define DER_OID_SZ_id_rsassa_pkcs1_v1_5_with_sha3_256 11
  116. extern const unsigned char ossl_der_oid_id_rsassa_pkcs1_v1_5_with_sha3_256[DER_OID_SZ_id_rsassa_pkcs1_v1_5_with_sha3_256];
  117. /*
  118. * id-rsassa-pkcs1-v1_5-with-sha3-384 OBJECT IDENTIFIER ::= { sigAlgs 15 }
  119. */
  120. #define DER_OID_V_id_rsassa_pkcs1_v1_5_with_sha3_384 DER_P_OBJECT, 9, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x03, 0x0F
  121. #define DER_OID_SZ_id_rsassa_pkcs1_v1_5_with_sha3_384 11
  122. extern const unsigned char ossl_der_oid_id_rsassa_pkcs1_v1_5_with_sha3_384[DER_OID_SZ_id_rsassa_pkcs1_v1_5_with_sha3_384];
  123. /*
  124. * id-rsassa-pkcs1-v1_5-with-sha3-512 OBJECT IDENTIFIER ::= { sigAlgs 16 }
  125. */
  126. #define DER_OID_V_id_rsassa_pkcs1_v1_5_with_sha3_512 DER_P_OBJECT, 9, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x03, 0x10
  127. #define DER_OID_SZ_id_rsassa_pkcs1_v1_5_with_sha3_512 11
  128. extern const unsigned char ossl_der_oid_id_rsassa_pkcs1_v1_5_with_sha3_512[DER_OID_SZ_id_rsassa_pkcs1_v1_5_with_sha3_512];
  129. /*
  130. * md4WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 3 }
  131. */
  132. #define DER_OID_V_md4WithRSAEncryption DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x03
  133. #define DER_OID_SZ_md4WithRSAEncryption 11
  134. extern const unsigned char ossl_der_oid_md4WithRSAEncryption[DER_OID_SZ_md4WithRSAEncryption];
  135. /*
  136. * ripemd160WithRSAEncryption OBJECT IDENTIFIER ::= {
  137. * iso(1) identified-organization(3) teletrust(36) algorithm(3) signatureAlgorithm(3) rsaSignature(1) 2
  138. * }
  139. */
  140. #define DER_OID_V_ripemd160WithRSAEncryption DER_P_OBJECT, 6, 0x2B, 0x24, 0x03, 0x03, 0x01, 0x02
  141. #define DER_OID_SZ_ripemd160WithRSAEncryption 8
  142. extern const unsigned char ossl_der_oid_ripemd160WithRSAEncryption[DER_OID_SZ_ripemd160WithRSAEncryption];
  143. /*
  144. * mdc2WithRSASignature OBJECT IDENTIFIER ::= {
  145. * iso(1) identified-organization(3) oiw(14) secsig(3) algorithms(2) mdc2WithRSASignature(14)
  146. * }
  147. */
  148. #define DER_OID_V_mdc2WithRSASignature DER_P_OBJECT, 5, 0x2B, 0x0E, 0x03, 0x02, 0x0E
  149. #define DER_OID_SZ_mdc2WithRSASignature 7
  150. extern const unsigned char ossl_der_oid_mdc2WithRSASignature[DER_OID_SZ_mdc2WithRSASignature];
  151. /* PSS parameters */
  152. int ossl_DER_w_RSASSA_PSS_params(WPACKET *pkt, int tag,
  153. const RSA_PSS_PARAMS_30 *pss);
  154. /* Subject Public Key Info */
  155. int ossl_DER_w_algorithmIdentifier_RSA(WPACKET *pkt, int tag, RSA *rsa);
  156. int ossl_DER_w_algorithmIdentifier_RSA_PSS(WPACKET *pkt, int tag,
  157. int rsa_type,
  158. const RSA_PSS_PARAMS_30 *pss);
  159. /* Signature */
  160. int ossl_DER_w_algorithmIdentifier_MDWithRSAEncryption(WPACKET *pkt, int tag,
  161. int mdnid);