Path: blob/main/crypto/openssl/providers/common/include/prov/der_rsa.h
48535 views
/*1* WARNING: do not edit!2* Generated by Makefile from providers/common/include/prov/der_rsa.h.in3*4* Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.5*6* Licensed under the Apache License 2.0 (the "License"). You may not use7* this file except in compliance with the License. You can obtain a copy8* in the file LICENSE in the source distribution or at9* https://www.openssl.org/source/license.html10*/1112#include "crypto/rsa.h"13#include "internal/der.h"1415/* Well known OIDs precompiled */1617/*18* hashAlgs OBJECT IDENTIFIER ::= { nistAlgorithms 2 }19*/20#define DER_OID_V_hashAlgs DER_P_OBJECT, 8, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x0221#define DER_OID_SZ_hashAlgs 1022extern const unsigned char ossl_der_oid_hashAlgs[DER_OID_SZ_hashAlgs];2324/*25* rsaEncryption OBJECT IDENTIFIER ::= { pkcs-1 1 }26*/27#define DER_OID_V_rsaEncryption DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0128#define DER_OID_SZ_rsaEncryption 1129extern const unsigned char ossl_der_oid_rsaEncryption[DER_OID_SZ_rsaEncryption];3031/*32* id-RSAES-OAEP OBJECT IDENTIFIER ::= { pkcs-1 7 }33*/34#define DER_OID_V_id_RSAES_OAEP DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0735#define DER_OID_SZ_id_RSAES_OAEP 1136extern const unsigned char ossl_der_oid_id_RSAES_OAEP[DER_OID_SZ_id_RSAES_OAEP];3738/*39* id-pSpecified OBJECT IDENTIFIER ::= { pkcs-1 9 }40*/41#define DER_OID_V_id_pSpecified DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0942#define DER_OID_SZ_id_pSpecified 1143extern const unsigned char ossl_der_oid_id_pSpecified[DER_OID_SZ_id_pSpecified];4445/*46* id-RSASSA-PSS OBJECT IDENTIFIER ::= { pkcs-1 10 }47*/48#define DER_OID_V_id_RSASSA_PSS DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0A49#define DER_OID_SZ_id_RSASSA_PSS 1150extern const unsigned char ossl_der_oid_id_RSASSA_PSS[DER_OID_SZ_id_RSASSA_PSS];5152/*53* md2WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 2 }54*/55#define DER_OID_V_md2WithRSAEncryption DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0256#define DER_OID_SZ_md2WithRSAEncryption 1157extern const unsigned char ossl_der_oid_md2WithRSAEncryption[DER_OID_SZ_md2WithRSAEncryption];5859/*60* md5WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 4 }61*/62#define DER_OID_V_md5WithRSAEncryption DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0463#define DER_OID_SZ_md5WithRSAEncryption 1164extern const unsigned char ossl_der_oid_md5WithRSAEncryption[DER_OID_SZ_md5WithRSAEncryption];6566/*67* sha1WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 5 }68*/69#define DER_OID_V_sha1WithRSAEncryption DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0570#define DER_OID_SZ_sha1WithRSAEncryption 1171extern const unsigned char ossl_der_oid_sha1WithRSAEncryption[DER_OID_SZ_sha1WithRSAEncryption];7273/*74* sha224WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 14 }75*/76#define DER_OID_V_sha224WithRSAEncryption DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0E77#define DER_OID_SZ_sha224WithRSAEncryption 1178extern const unsigned char ossl_der_oid_sha224WithRSAEncryption[DER_OID_SZ_sha224WithRSAEncryption];7980/*81* sha256WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 11 }82*/83#define DER_OID_V_sha256WithRSAEncryption DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B84#define DER_OID_SZ_sha256WithRSAEncryption 1185extern const unsigned char ossl_der_oid_sha256WithRSAEncryption[DER_OID_SZ_sha256WithRSAEncryption];8687/*88* sha384WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 12 }89*/90#define DER_OID_V_sha384WithRSAEncryption DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0C91#define DER_OID_SZ_sha384WithRSAEncryption 1192extern const unsigned char ossl_der_oid_sha384WithRSAEncryption[DER_OID_SZ_sha384WithRSAEncryption];9394/*95* sha512WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 13 }96*/97#define DER_OID_V_sha512WithRSAEncryption DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0D98#define DER_OID_SZ_sha512WithRSAEncryption 1199extern const unsigned char ossl_der_oid_sha512WithRSAEncryption[DER_OID_SZ_sha512WithRSAEncryption];100101/*102* sha512-224WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 15 }103*/104#define DER_OID_V_sha512_224WithRSAEncryption DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0F105#define DER_OID_SZ_sha512_224WithRSAEncryption 11106extern const unsigned char ossl_der_oid_sha512_224WithRSAEncryption[DER_OID_SZ_sha512_224WithRSAEncryption];107108/*109* sha512-256WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 16 }110*/111#define DER_OID_V_sha512_256WithRSAEncryption DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x10112#define DER_OID_SZ_sha512_256WithRSAEncryption 11113extern const unsigned char ossl_der_oid_sha512_256WithRSAEncryption[DER_OID_SZ_sha512_256WithRSAEncryption];114115/*116* id-mgf1 OBJECT IDENTIFIER ::= { pkcs-1 8 }117*/118#define DER_OID_V_id_mgf1 DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x08119#define DER_OID_SZ_id_mgf1 11120extern const unsigned char ossl_der_oid_id_mgf1[DER_OID_SZ_id_mgf1];121122/*123* id-rsassa-pkcs1-v1_5-with-sha3-224 OBJECT IDENTIFIER ::= { sigAlgs 13 }124*/125#define DER_OID_V_id_rsassa_pkcs1_v1_5_with_sha3_224 DER_P_OBJECT, 9, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x03, 0x0D126#define DER_OID_SZ_id_rsassa_pkcs1_v1_5_with_sha3_224 11127extern 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];128129/*130* id-rsassa-pkcs1-v1_5-with-sha3-256 OBJECT IDENTIFIER ::= { sigAlgs 14 }131*/132#define DER_OID_V_id_rsassa_pkcs1_v1_5_with_sha3_256 DER_P_OBJECT, 9, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x03, 0x0E133#define DER_OID_SZ_id_rsassa_pkcs1_v1_5_with_sha3_256 11134extern 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];135136/*137* id-rsassa-pkcs1-v1_5-with-sha3-384 OBJECT IDENTIFIER ::= { sigAlgs 15 }138*/139#define DER_OID_V_id_rsassa_pkcs1_v1_5_with_sha3_384 DER_P_OBJECT, 9, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x03, 0x0F140#define DER_OID_SZ_id_rsassa_pkcs1_v1_5_with_sha3_384 11141extern 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];142143/*144* id-rsassa-pkcs1-v1_5-with-sha3-512 OBJECT IDENTIFIER ::= { sigAlgs 16 }145*/146#define DER_OID_V_id_rsassa_pkcs1_v1_5_with_sha3_512 DER_P_OBJECT, 9, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x03, 0x10147#define DER_OID_SZ_id_rsassa_pkcs1_v1_5_with_sha3_512 11148extern 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];149150/*151* md4WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 3 }152*/153#define DER_OID_V_md4WithRSAEncryption DER_P_OBJECT, 9, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x03154#define DER_OID_SZ_md4WithRSAEncryption 11155extern const unsigned char ossl_der_oid_md4WithRSAEncryption[DER_OID_SZ_md4WithRSAEncryption];156157/*158* ripemd160WithRSAEncryption OBJECT IDENTIFIER ::= {159* iso(1) identified-organization(3) teletrust(36) algorithm(3) signatureAlgorithm(3) rsaSignature(1) 2160* }161*/162#define DER_OID_V_ripemd160WithRSAEncryption DER_P_OBJECT, 6, 0x2B, 0x24, 0x03, 0x03, 0x01, 0x02163#define DER_OID_SZ_ripemd160WithRSAEncryption 8164extern const unsigned char ossl_der_oid_ripemd160WithRSAEncryption[DER_OID_SZ_ripemd160WithRSAEncryption];165166/*167* mdc2WithRSASignature OBJECT IDENTIFIER ::= {168* iso(1) identified-organization(3) oiw(14) secsig(3) algorithms(2) mdc2WithRSASignature(14)169* }170*/171#define DER_OID_V_mdc2WithRSASignature DER_P_OBJECT, 5, 0x2B, 0x0E, 0x03, 0x02, 0x0E172#define DER_OID_SZ_mdc2WithRSASignature 7173extern const unsigned char ossl_der_oid_mdc2WithRSASignature[DER_OID_SZ_mdc2WithRSASignature];174175176/* PSS parameters */177int ossl_DER_w_RSASSA_PSS_params(WPACKET *pkt, int tag,178const RSA_PSS_PARAMS_30 *pss);179/* Subject Public Key Info */180int ossl_DER_w_algorithmIdentifier_RSA(WPACKET *pkt, int tag, RSA *rsa);181int ossl_DER_w_algorithmIdentifier_RSA_PSS(WPACKET *pkt, int tag,182int rsa_type,183const RSA_PSS_PARAMS_30 *pss);184/* Signature */185int ossl_DER_w_algorithmIdentifier_MDWithRSAEncryption(WPACKET *pkt, int tag,186int mdnid);187188189