.. _rsaverify_pkcs1v15:


RSAVerify_PKCS1v15
==================


Carries out the RSA-SSAsignature verification scheme of PKCS#1 v1.5.


Syntax
------


IppStatus ippsRSAVerify_PKCS1v15(const Ipp8u\* pMsg, int msgLen, const
Ipp8u\* pSign, int\* pIsSignValid, const IppsRSAPublicKeyState\* pKey,
IppHashAlgId hashAlg, Ipp8u\* pBuffer);


IppStatus ippsRSAVerify_PKCS1v15_rmf(const Ipp8u\* pMsg, int msgLen,
const Ipp8u\* pSign, int\* pIsSignValid, const IppsRSAPublicKeyState\*
pKey, const IppsHashMethod\* pMethod, Ipp8u\* pBuffer);


Include Files
-------------


``ippcp.h``


Parameters
----------


.. list-table::
   :header-rows: 0

   * -     pMsg
     -  Pointer to the message that has been signed, or pointer to the pre-hashed message digest.
   * -     msgLen
     -  Length of the message \*pMsg in octets, or IPPCP_RSA_PKCS1V15_PREHASHED if \*pMsg contains a pre-hashed message digest (ippsRSAVerify_PKCS1v15_rmf only).
   * -     pSign
     -  Pointer to the signature string to be verified.
   * -     pIsSignValid
     -  Pointer to the verification result.
   * -     pKey
     -  Pointer to the properly initialized IppsRSAPublicKeyState context.
   * -     hashAlg
     -  Identifier of the hash algorithm. For details, see table :ref:`Supported Hash Algorithms <one-way-hash-primitives>`.
   * -     pMethod
     -  Pointer to the hash method. For details, see :ref:`HashMethod <hashmethod>` functions.
   * -     pBuffer
     -  Pointer to a temporary buffer of size not less than returned by the :ref:`RSA_GetBufferSizePublicKey <rsa_getbuffersizepublickey-privatekey>` function.




Description
-----------

.. note::


   ippsRSAVerify_PKCS1v15 API is deprecated. Please refer to :ref:`Deprecated Functions <appendix-b-deprecated-functions>`
   section for the recommendations for transition.

The function verifies the signature generated by the
:ref:`RSASign_PKCS1v15 <rsasign_pkcs1v15>`
function that uses the same hashAlg or pMethod parameter against the
input message, as defined :term:`PKCS 1.2.1 <[PKCS 1.2.1]>`.


.. note::


   This function has a *reduced memory footprint* version. To learn
   more, see :ref:`Reduced Memory Footprint Functions <one-way-hash-primitives>`.


The ippsRSAVerify_PKCS1v15_rmf function supports two modes of operation:

- Standard mode: When msgLen >= 0, the function hashes the input message internally using the specified hash method before verification.

- Pre-hashed mode: When msgLen == IPPCP_RSA_PKCS1V15_PREHASHED, the function treats pMsg as a pre-computed hash digest and bypasses internal hashing. In this mode, pMsg must point to a hash digest of exactly pMethod->hashLen bytes.


Return Values
-------------


.. list-table::
   :header-rows: 0

   * -     ippStsNoErr
     -  Indicates no error. Any other value indicates an error or warning.
   * -     ippStsNullPtrErr
     -     Indicates an error condition if any of the specified pointers is NULL.
   * -     ippStsContextMatchErr
     -     Indicates an error condition if the context parameter does not match the operation.
   * -     ippStsIncompleteContextErr
     -     Indicates an error condition if the public key is not set up.
   * -     ippStsLengthErr
     -  Indicates an error condition if any input/output length parameters are inconsistent with one another.
   * -     ippStsNotSupportedModeErr
     -     Indicates an error condition if the hashAlg parameter does not match any value of IppHashAlgId listed in table :ref:`Supported Hash Algorithms <one-way-hash-primitives>`.


.. note:: You can set up the public key in a call to ``RSA_SetPublicKey``.


.. rubric:: Related Information

:ref:`rsa_setpublickey-privatekeytype1-type2`

