]> git.proxmox.com Git - mirror_edk2.git/blob - CryptoPkg/Library/BaseCryptLibNull/Pk/CryptPkcs1OaepNull.c
CryptoPkg: Add Null instance of the BaseCryptLib class
[mirror_edk2.git] / CryptoPkg / Library / BaseCryptLibNull / Pk / CryptPkcs1OaepNull.c
1 /** @file
2 This file contains UEFI wrapper functions for RSA PKCS1v2 OAEP encryption routines.
3
4 SPDX-License-Identifier: BSD-2-Clause-Patent
5
6 Copyright (C) 2016 Microsoft Corporation. All Rights Reserved.
7 Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
8
9 **/
10
11 #include "InternalCryptLib.h"
12
13 /**
14 Encrypts a blob using PKCS1v2 (RSAES-OAEP) schema. On success, will return the
15 encrypted message in a newly allocated buffer.
16
17 Return FALSE to indicate this interface is not supported.
18
19 @param[in] PublicKey A pointer to the DER-encoded X509 certificate that
20 will be used to encrypt the data.
21 @param[in] PublicKeySize Size of the X509 cert buffer.
22 @param[in] InData Data to be encrypted.
23 @param[in] InDataSize Size of the data buffer.
24 @param[in] PrngSeed [Optional] If provided, a pointer to a random seed buffer
25 to be used when initializing the PRNG. NULL otherwise.
26 @param[in] PrngSeedSize [Optional] If provided, size of the random seed buffer.
27 0 otherwise.
28 @param[out] EncryptedData Pointer to an allocated buffer containing the encrypted
29 message.
30 @param[out] EncryptedDataSize Size of the encrypted message buffer.
31
32 @retval FALSE This interface is not supported.
33
34 **/
35 BOOLEAN
36 EFIAPI
37 Pkcs1v2Encrypt (
38 IN CONST UINT8 *PublicKey,
39 IN UINTN PublicKeySize,
40 IN UINT8 *InData,
41 IN UINTN InDataSize,
42 IN CONST UINT8 *PrngSeed, OPTIONAL
43 IN UINTN PrngSeedSize, OPTIONAL
44 OUT UINT8 **EncryptedData,
45 OUT UINTN *EncryptedDataSize
46 )
47 {
48 ASSERT (FALSE);
49 return FALSE;
50 }
51