#include
int RSA_padding_add_PKCS1_type_1(unsigned char *to, int tlen, unsigned char *f, int fl);
int RSA_padding_check_PKCS1_type_1(unsigned char *to, int tlen, unsigned char *f, int fl, int rsa_len);
int RSA_padding_add_PKCS1_type_2(unsigned char *to, int tlen, unsigned char *f, int fl);
int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen, unsigned char *f, int fl, int rsa_len);
int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen, unsigned char *f, int fl, unsigned char *p, int pl);
int RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen, unsigned char *f, int fl, int rsa_len, unsigned char *p, int pl);
int RSA_padding_add_SSLv23(unsigned char *to, int tlen, unsigned char *f, int fl);
int RSA_padding_check_SSLv23(unsigned char *to, int tlen, unsigned char *f, int fl, int rsa_len);
int RSA_padding_add_none(unsigned char *to, int tlen, unsigned char *f, int fl);
int RSA_padding_check_none(unsigned char *to, int tlen, unsigned char *f, int fl, int rsa_len);
However, they can also be called directly to implement padding for other asymmetric ciphers. _R_S_A___p_a_d_d_i_n_g___a_d_d___P_K_C_S_1___O_A_E_P_(_) and _R_S_A___p_a_d_d_i_n_g___c_h_e_c_k___P_K_C_S_1___O_A_E_P_(_) may be used in an application combined with RRSSAA__NNOO__PPAADDDDIINNGG in order to implement OAEP with an encoding parameter.
_R_S_A___p_a_d_d_i_n_g___a_d_d___x_x_x_(_) encodes ffll bytes from ff so as to fit into ttlleenn bytes and stores the result at ttoo. An error occurs if ffll does not meet the size requirements of the encoding method.
The following encoding methods are implemented:
The random number generator must be seeded prior to calling _R_S_A___p_a_d_d_i_n_g___a_d_d___x_x_x_(_).
_R_S_A___p_a_d_d_i_n_g___c_h_e_c_k___x_x_x_(_) verifies that the ffll bytes at ff contain a valid encoding for a rrssaa__lleenn byte RSA key in the respective encoding method and stores the recovered data of at most ttlleenn bytes (for RRSSAA__NNOO__PPAADDDDIINNGG: of size ttlleenn) at ttoo.
For _R_S_A___p_a_d_d_i_n_g___x_x_x___O_A_E_P_(_), pp points to the encoding parameter of length ppll. pp may be NNUULLLL if ppll is 0.
_R_S_A___p_a_d_d_i_n_g___a_d_d___P_K_C_S_1___O_A_E_P_(_) and _R_S_A___p_a_d_d_i_n_g___c_h_e_c_k___P_K_C_S_1___O_A_E_P_(_) were added in OpenSSL 0.9.2b.