Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1197)

Unified Diff: nss/lib/freebl/blapi.h

Issue 105893015: Update third_party/nss to NSS 3.15.4. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Remove SVN property on new file nss/lib/freebl/rsapkcs.c Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « nss/lib/ckfw/builtins/nssckbi.h ('k') | nss/lib/freebl/dh.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: nss/lib/freebl/blapi.h
===================================================================
--- nss/lib/freebl/blapi.h (revision 239365)
+++ nss/lib/freebl/blapi.h (working copy)
@@ -108,6 +108,174 @@
extern SECStatus RSA_PopulatePrivateKey(RSAPrivateKey *key);
/********************************************************************
+** RSA algorithm
+*/
+
+/********************************************************************
+** Raw signing/encryption/decryption operations.
+**
+** No padding or formatting will be applied.
+** inputLen MUST be equivalent to the modulus size (in bytes).
+*/
+extern SECStatus
+RSA_SignRaw(RSAPrivateKey * key,
+ unsigned char * output,
+ unsigned int * outputLen,
+ unsigned int maxOutputLen,
+ const unsigned char * input,
+ unsigned int inputLen);
+
+extern SECStatus
+RSA_CheckSignRaw(RSAPublicKey * key,
+ const unsigned char * sig,
+ unsigned int sigLen,
+ const unsigned char * hash,
+ unsigned int hashLen);
+
+extern SECStatus
+RSA_CheckSignRecoverRaw(RSAPublicKey * key,
+ unsigned char * data,
+ unsigned int * dataLen,
+ unsigned int maxDataLen,
+ const unsigned char * sig,
+ unsigned int sigLen);
+
+extern SECStatus
+RSA_EncryptRaw(RSAPublicKey * key,
+ unsigned char * output,
+ unsigned int * outputLen,
+ unsigned int maxOutputLen,
+ const unsigned char * input,
+ unsigned int inputLen);
+
+extern SECStatus
+RSA_DecryptRaw(RSAPrivateKey * key,
+ unsigned char * output,
+ unsigned int * outputLen,
+ unsigned int maxOutputLen,
+ const unsigned char * input,
+ unsigned int inputLen);
+
+/********************************************************************
+** RSAES-OAEP encryption/decryption, as defined in RFC 3447, Section 7.1.
+**
+** Note: Only MGF1 is supported as the mask generation function. It will be
+** used with maskHashAlg as the inner hash function.
+**
+** Unless performing Known Answer Tests, "seed" should be NULL, indicating that
+** freebl should generate a random value. Otherwise, it should be an octet
+** string of seedLen bytes, which should be the same size as the output of
+** hashAlg.
+*/
+extern SECStatus
+RSA_EncryptOAEP(RSAPublicKey * key,
+ HASH_HashType hashAlg,
+ HASH_HashType maskHashAlg,
+ const unsigned char * label,
+ unsigned int labelLen,
+ const unsigned char * seed,
+ unsigned int seedLen,
+ unsigned char * output,
+ unsigned int * outputLen,
+ unsigned int maxOutputLen,
+ const unsigned char * input,
+ unsigned int inputLen);
+
+extern SECStatus
+RSA_DecryptOAEP(RSAPrivateKey * key,
+ HASH_HashType hashAlg,
+ HASH_HashType maskHashAlg,
+ const unsigned char * label,
+ unsigned int labelLen,
+ unsigned char * output,
+ unsigned int * outputLen,
+ unsigned int maxOutputLen,
+ const unsigned char * input,
+ unsigned int inputLen);
+
+/********************************************************************
+** RSAES-PKCS1-v1_5 encryption/decryption, as defined in RFC 3447, Section 7.2.
+*/
+extern SECStatus
+RSA_EncryptBlock(RSAPublicKey * key,
+ unsigned char * output,
+ unsigned int * outputLen,
+ unsigned int maxOutputLen,
+ const unsigned char * input,
+ unsigned int inputLen);
+
+extern SECStatus
+RSA_DecryptBlock(RSAPrivateKey * key,
+ unsigned char * output,
+ unsigned int * outputLen,
+ unsigned int maxOutputLen,
+ const unsigned char * input,
+ unsigned int inputLen);
+
+/********************************************************************
+** RSASSA-PSS signing/verifying, as defined in RFC 3447, Section 8.1.
+**
+** Note: Only MGF1 is supported as the mask generation function. It will be
+** used with maskHashAlg as the inner hash function.
+**
+** Unless performing Known Answer Tests, "salt" should be NULL, indicating that
+** freebl should generate a random value.
+*/
+extern SECStatus
+RSA_SignPSS(RSAPrivateKey * key,
+ HASH_HashType hashAlg,
+ HASH_HashType maskHashAlg,
+ const unsigned char * salt,
+ unsigned int saltLen,
+ unsigned char * output,
+ unsigned int * outputLen,
+ unsigned int maxOutputLen,
+ const unsigned char * input,
+ unsigned int inputLen);
+
+extern SECStatus
+RSA_CheckSignPSS(RSAPublicKey * key,
+ HASH_HashType hashAlg,
+ HASH_HashType maskHashAlg,
+ unsigned int saltLen,
+ const unsigned char * sig,
+ unsigned int sigLen,
+ const unsigned char * hash,
+ unsigned int hashLen);
+
+/********************************************************************
+** RSASSA-PKCS1-v1_5 signing/verifying, as defined in RFC 3447, Section 8.2.
+**
+** These functions expect as input to be the raw value to be signed. For most
+** cases using PKCS1-v1_5, this should be the value of T, the DER-encoded
+** DigestInfo structure defined in Section 9.2, Step 2.
+** Note: This can also be used for signatures that use PKCS1-v1_5 padding, such
+** as the signatures used in SSL/TLS, which sign a raw hash.
+*/
+extern SECStatus
+RSA_Sign(RSAPrivateKey * key,
+ unsigned char * output,
+ unsigned int * outputLen,
+ unsigned int maxOutputLen,
+ const unsigned char * data,
+ unsigned int dataLen);
+
+extern SECStatus
+RSA_CheckSign(RSAPublicKey * key,
+ const unsigned char * sig,
+ unsigned int sigLen,
+ const unsigned char * data,
+ unsigned int dataLen);
+
+extern SECStatus
+RSA_CheckSignRecover(RSAPublicKey * key,
+ unsigned char * output,
+ unsigned int * outputLen,
+ unsigned int maxOutputLen,
+ const unsigned char * sig,
+ unsigned int sigLen);
+
+/********************************************************************
** DSA signing algorithm
*/
« no previous file with comments | « nss/lib/ckfw/builtins/nssckbi.h ('k') | nss/lib/freebl/dh.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698