RSAEncrypt_PKCSv15

Carries out the encryption using the v1.5 version of the PKCS#1 standard.

Syntax

IppStatus ippsRSAEncrypt_PKCSv15(const Ipp8u* pSrc, Ipp32u srcLen, const Ipp8u* pRandPS, Ipp8u* pDst, IppsRSAState* pRSA);

Parameters

pSrc

Pointer to the message to be encrypted.

srcLen

Length (in bytes) of the message. The message can be empty, that is, srcLen==0.

pRandPS

Pointer to the non-zero octet padding string of an appropriate length. pRandPS can be NULL. In this case, the function applies the padding string of 0xFF bytes.

pDst

Pointer to the output ciphertext string.

pRSA

Pointer to the properly initialized IppsRSAState context.

Description

This function is declared in the ippcp.h file. The function carries out the RSA encryption using the public key according to the v1.5 version of the PKCS#1 standard, defined in [PKCS 1.2.1].

If RSAEncrypt_PKCSv15 receives a non-zero pRandPS pointer, the function assumes that the length of the padding string is at least k-srcLen-3 bytes, where k is the length of the RSA modulus in bytes.

Important Note iconImportant

The v1.5 version of the PKCS#1 standard requires that you provide a padding string that does not contain zero bytes. If the padding string contains a zero byte, the encryption operation completes successfully, but the inverse decryption fails.

Return Values

ippStsNoErr

Indicates no error. Any other value indicates an error or warning.

ippStsNullPtrErr

Indicates an error condition if any of the specified pointers other than pRandPS is NULL.

ippStsContextMatchErr

Indicates an error condition if the RSA context parameter does not match the operation.

ippStsInvalidCryptoKeyErr

Indicates an error condition if the RSA context has not been properly set up for the operation.

ippStsSizeErr

Indicates an error condition if the length n of the RSA modulus is too small in comparison with the length of plaintext, that is, srcLen > n - 11.

See Also


Submit feedback on this help topic

Copyright © 2000 - 2011, Intel Corporation. All rights reserved.