TianoCore EDK2 master
Loading...
Searching...
No Matches
CryptRsaPss.c File Reference
#include "InternalCryptLib.h"
#include <openssl/bn.h>
#include <openssl/rsa.h>
#include <openssl/objects.h>
#include <openssl/evp.h>

Go to the source code of this file.

Functions

STATIC const EVP_MD * GetEvpMD (IN UINT16 DigestLen)
 
BOOLEAN EFIAPI RsaPssVerify (IN VOID *RsaContext, IN CONST UINT8 *Message, IN UINTN MsgSize, IN CONST UINT8 *Signature, IN UINTN SigSize, IN UINT16 DigestLen, IN UINT16 SaltLen)
 

Detailed Description

RSA Asymmetric Cipher Wrapper Implementation over OpenSSL.

This file implements following APIs which provide basic capabilities for RSA: 1) RsaPssVerify

Copyright (c) 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file CryptRsaPss.c.

Function Documentation

◆ GetEvpMD()

STATIC const EVP_MD * GetEvpMD ( IN UINT16  DigestLen)

Retrieve a pointer to EVP message digest object.

Parameters
[in]DigestLenLength of the message digest.

Definition at line 28 of file CryptRsaPss.c.

◆ RsaPssVerify()

BOOLEAN EFIAPI RsaPssVerify ( IN VOID *  RsaContext,
IN CONST UINT8 *  Message,
IN UINTN  MsgSize,
IN CONST UINT8 *  Signature,
IN UINTN  SigSize,
IN UINT16  DigestLen,
IN UINT16  SaltLen 
)

Verifies the RSA signature with RSASSA-PSS signature scheme defined in RFC 8017. Implementation determines salt length automatically from the signature encoding. Mask generation function is the same as the message digest algorithm. Salt length should be equal to digest length.

Parameters
[in]RsaContextPointer to RSA context for signature verification.
[in]MessagePointer to octet message to be verified.
[in]MsgSizeSize of the message in bytes.
[in]SignaturePointer to RSASSA-PSS signature to be verified.
[in]SigSizeSize of signature in bytes.
[in]DigestLenLength of digest for RSA operation.
[in]SaltLenSalt length for PSS encoding.
Return values
TRUEValid signature encoded in RSASSA-PSS.
FALSEInvalid signature or invalid RSA context.

Definition at line 67 of file CryptRsaPss.c.