NAME
RSApaddingaddPKCS1type1, RSApaddingcheckPKCS1type1, RSApaddingaddPKCS1type2, RSApaddingcheckPKCS1type2, RSApaddingaddPKCS1OAEP, RSApaddingcheckPKCS1OAEP, RSApaddingaddSSLv23, RSApaddingcheckSSLv23, RSApaddingaddnone,RSApaddingchecknone - asymmetric encryption padding
SYNOPSIS
#include
int RSApaddingaddPKCS1type1(unsigned char *to, int tlen, unsigned char *f, int fl); int RSApaddingcheckPKCS1type1(unsigned char *to, int tlen, unsigned char *f, int fl, int rsalen); int RSApaddingaddPKCS1type2(unsigned char *to, int tlen, unsigned char *f, int fl); int RSApaddingcheckPKCS1type2(unsigned char *to, int tlen, unsigned char *f, int fl, int rsalen); int RSApaddingaddPKCS1OAEP(unsigned char *to, int tlen, unsigned char *f, int fl, unsigned char *p, int pl); int RSApaddingcheckPKCS1OAEP(unsigned char *to, int tlen, unsigned char *f, int fl, int rsalen, unsigned char *p, int pl); int RSApaddingaddSSLv23(unsigned char *to, int tlen, unsigned char *f, int fl); int RSApaddingcheckSSLv23(unsigned char *to, int tlen, unsigned char *f, int fl, int rsalen); int RSApaddingaddnone(unsigned char *to, int tlen, unsigned char *f, int fl); int RSApaddingchecknone(unsigned char *to, int tlen, unsigned char *f, int fl, int rsalen);DESCRIPTION
The RSApaddingxxxxxx() functions are called from the RSA encrypt, decrypt, sign and verify functions. Normally they should not be called from application programs. However, they can also be called directly to implement padding for other asymmetric ciphers. RSApaddingaddPKCS1OAEP() and RSApaddingcheckPKCS1OAEP() may be used in an application combined with RRSSAANNOOPPAADDDDIINNGG in order to implement OAEP with an encoding parameter. RSApaddingaddxxx() 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: PKCS1type1PKCS #1 v2.0 EMSA-PKCS1-v15 (PKCS #1 v1.5 block type 1); used for
signatures PKCS1type2PKCS #1 v2.0 EME-PKCS1-v15 (PKCS #1 v1.5 block type 2)
PKCS1OAEPPKCS #1 v2.0 EME-OAEP
SSLv23PKCS #1 EME-PKCS1-v15 with SSL-specific modification
none simply copy the data The random number generator must be seeded prior to calling RSApaddingaddxxx(). RSApaddingcheckxxx() verifies that the ffll bytes at ff contain a valid encoding for a rrssaalleenn byte RSA key in the respective encoding method and stores the recovered data of at most ttlleenn bytes (for RRSSAANNOOPPAADDDDIINNGG: of size ttlleenn) at ttoo. For RSApaddingxxxOAEP(), pp points to the encoding parameter of length ppll. pp may be NNUULLLL if ppll is 0.RETURN VALUES
The RSApaddingaddxxx() functions return 1 on success, 0 on error. The RSApaddingcheckxxx() functions return the length of therecovered data, -1 on error. Error codes can be obtained by calling
ERRgeterror(3).SEE ALSO
RSApublicencrypt(3), RSAprivatedecrypt(3), RSAsign(3), RSAverify(3) HISTORY RSApaddingaddPKCS1type1(), RSApaddingcheckPKCS1type1(), RSApaddingaddPKCS1type2(), RSApaddingcheckPKCS1type2(), RSApaddingaddSSLv23(), RSApaddingcheckSSLv23(), RSApaddingaddnone() and RSApaddingchecknone() appeared in SSLeay 0.9.0. RSApaddingaddPKCS1OAEP() and RSApaddingcheckPKCS1OAEP() were added in OpenSSL 0.9.2b.0.9.7l 2000-02-24 RSApaddingaddPKCS1type1(3)