Defines | |
#define | MD4_DIGEST_SIZE 16 |
#define | MD5_DIGEST_SIZE 16 |
#define | SHA1_DIGEST_SIZE 20 |
#define | SHA256_DIGEST_SIZE 32 |
#define | SHA384_DIGEST_SIZE 48 |
#define | SHA512_DIGEST_SIZE 64 |
#define | TDES_BLOCK_SIZE 8 |
#define | AES_BLOCK_SIZE 16 |
Enumerations | |
enum | RSA_KEY_TAG { RsaKeyN, RsaKeyE, RsaKeyD, RsaKeyP, RsaKeyQ, RsaKeyDp, RsaKeyDq, RsaKeyQInv } |
Functions | |
UINTN EFIAPI | Md4GetContextSize (VOID) |
BOOLEAN EFIAPI | Md4Init (OUT VOID *Md4Context) |
BOOLEAN EFIAPI | Md4Duplicate (IN CONST VOID *Md4Context, OUT VOID *NewMd4Context) |
BOOLEAN EFIAPI | Md4Update (IN OUT VOID *Md4Context, IN CONST VOID *Data, IN UINTN DataSize) |
BOOLEAN EFIAPI | Md4Final (IN OUT VOID *Md4Context, OUT UINT8 *HashValue) |
UINTN EFIAPI | Md5GetContextSize (VOID) |
BOOLEAN EFIAPI | Md5Init (OUT VOID *Md5Context) |
BOOLEAN EFIAPI | Md5Duplicate (IN CONST VOID *Md5Context, OUT VOID *NewMd5Context) |
BOOLEAN EFIAPI | Md5Update (IN OUT VOID *Md5Context, IN CONST VOID *Data, IN UINTN DataSize) |
BOOLEAN EFIAPI | Md5Final (IN OUT VOID *Md5Context, OUT UINT8 *HashValue) |
UINTN EFIAPI | Sha1GetContextSize (VOID) |
BOOLEAN EFIAPI | Sha1Init (OUT VOID *Sha1Context) |
BOOLEAN EFIAPI | Sha1Duplicate (IN CONST VOID *Sha1Context, OUT VOID *NewSha1Context) |
BOOLEAN EFIAPI | Sha1Update (IN OUT VOID *Sha1Context, IN CONST VOID *Data, IN UINTN DataSize) |
BOOLEAN EFIAPI | Sha1Final (IN OUT VOID *Sha1Context, OUT UINT8 *HashValue) |
UINTN EFIAPI | Sha256GetContextSize (VOID) |
BOOLEAN EFIAPI | Sha256Init (OUT VOID *Sha256Context) |
BOOLEAN EFIAPI | Sha256Duplicate (IN CONST VOID *Sha256Context, OUT VOID *NewSha256Context) |
BOOLEAN EFIAPI | Sha256Update (IN OUT VOID *Sha256Context, IN CONST VOID *Data, IN UINTN DataSize) |
BOOLEAN EFIAPI | Sha256Final (IN OUT VOID *Sha256Context, OUT UINT8 *HashValue) |
UINTN EFIAPI | Sha384GetContextSize (VOID) |
BOOLEAN EFIAPI | Sha384Init (OUT VOID *Sha384Context) |
BOOLEAN EFIAPI | Sha384Duplicate (IN CONST VOID *Sha384Context, OUT VOID *NewSha384Context) |
BOOLEAN EFIAPI | Sha384Update (IN OUT VOID *Sha384Context, IN CONST VOID *Data, IN UINTN DataSize) |
BOOLEAN EFIAPI | Sha384Final (IN OUT VOID *Sha384Context, OUT UINT8 *HashValue) |
UINTN EFIAPI | Sha512GetContextSize (VOID) |
BOOLEAN EFIAPI | Sha512Init (OUT VOID *Sha512Context) |
BOOLEAN EFIAPI | Sha512Duplicate (IN CONST VOID *Sha512Context, OUT VOID *NewSha512Context) |
BOOLEAN EFIAPI | Sha512Update (IN OUT VOID *Sha512Context, IN CONST VOID *Data, IN UINTN DataSize) |
BOOLEAN EFIAPI | Sha512Final (IN OUT VOID *Sha512Context, OUT UINT8 *HashValue) |
UINTN EFIAPI | HmacMd5GetContextSize (VOID) |
BOOLEAN EFIAPI | HmacMd5Init (OUT VOID *HmacMd5Context, IN CONST UINT8 *Key, IN UINTN KeySize) |
BOOLEAN EFIAPI | HmacMd5Duplicate (IN CONST VOID *HmacMd5Context, OUT VOID *NewHmacMd5Context) |
BOOLEAN EFIAPI | HmacMd5Update (IN OUT VOID *HmacMd5Context, IN CONST VOID *Data, IN UINTN DataSize) |
BOOLEAN EFIAPI | HmacMd5Final (IN OUT VOID *HmacMd5Context, OUT UINT8 *HmacValue) |
UINTN EFIAPI | HmacSha1GetContextSize (VOID) |
BOOLEAN EFIAPI | HmacSha1Init (OUT VOID *HmacSha1Context, IN CONST UINT8 *Key, IN UINTN KeySize) |
BOOLEAN EFIAPI | HmacSha1Duplicate (IN CONST VOID *HmacSha1Context, OUT VOID *NewHmacSha1Context) |
BOOLEAN EFIAPI | HmacSha1Update (IN OUT VOID *HmacSha1Context, IN CONST VOID *Data, IN UINTN DataSize) |
BOOLEAN EFIAPI | HmacSha1Final (IN OUT VOID *HmacSha1Context, OUT UINT8 *HmacValue) |
UINTN EFIAPI | TdesGetContextSize (VOID) |
BOOLEAN EFIAPI | TdesInit (OUT VOID *TdesContext, IN CONST UINT8 *Key, IN UINTN KeyLength) |
BOOLEAN EFIAPI | TdesEcbEncrypt (IN VOID *TdesContext, IN CONST UINT8 *Input, IN UINTN InputSize, OUT UINT8 *Output) |
BOOLEAN EFIAPI | TdesEcbDecrypt (IN VOID *TdesContext, IN CONST UINT8 *Input, IN UINTN InputSize, OUT UINT8 *Output) |
BOOLEAN EFIAPI | TdesCbcEncrypt (IN VOID *TdesContext, IN CONST UINT8 *Input, IN UINTN InputSize, IN CONST UINT8 *Ivec, OUT UINT8 *Output) |
BOOLEAN EFIAPI | TdesCbcDecrypt (IN VOID *TdesContext, IN CONST UINT8 *Input, IN UINTN InputSize, IN CONST UINT8 *Ivec, OUT UINT8 *Output) |
UINTN EFIAPI | AesGetContextSize (VOID) |
BOOLEAN EFIAPI | AesInit (OUT VOID *AesContext, IN CONST UINT8 *Key, IN UINTN KeyLength) |
BOOLEAN EFIAPI | AesEcbEncrypt (IN VOID *AesContext, IN CONST UINT8 *Input, IN UINTN InputSize, OUT UINT8 *Output) |
BOOLEAN EFIAPI | AesEcbDecrypt (IN VOID *AesContext, IN CONST UINT8 *Input, IN UINTN InputSize, OUT UINT8 *Output) |
BOOLEAN EFIAPI | AesCbcEncrypt (IN VOID *AesContext, IN CONST UINT8 *Input, IN UINTN InputSize, IN CONST UINT8 *Ivec, OUT UINT8 *Output) |
BOOLEAN EFIAPI | AesCbcDecrypt (IN VOID *AesContext, IN CONST UINT8 *Input, IN UINTN InputSize, IN CONST UINT8 *Ivec, OUT UINT8 *Output) |
UINTN EFIAPI | Arc4GetContextSize (VOID) |
BOOLEAN EFIAPI | Arc4Init (OUT VOID *Arc4Context, IN CONST UINT8 *Key, IN UINTN KeySize) |
BOOLEAN EFIAPI | Arc4Encrypt (IN OUT VOID *Arc4Context, IN CONST UINT8 *Input, IN UINTN InputSize, OUT UINT8 *Output) |
BOOLEAN EFIAPI | Arc4Decrypt (IN OUT VOID *Arc4Context, IN UINT8 *Input, IN UINTN InputSize, OUT UINT8 *Output) |
BOOLEAN EFIAPI | Arc4Reset (IN OUT VOID *Arc4Context) |
VOID *EFIAPI | RsaNew (VOID) |
VOID EFIAPI | RsaFree (IN VOID *RsaContext) |
BOOLEAN EFIAPI | RsaSetKey (IN OUT VOID *RsaContext, IN RSA_KEY_TAG KeyTag, IN CONST UINT8 *BigNumber, IN UINTN BnSize) |
BOOLEAN EFIAPI | RsaGetKey (IN OUT VOID *RsaContext, IN RSA_KEY_TAG KeyTag, OUT UINT8 *BigNumber, IN OUT UINTN *BnSize) |
BOOLEAN EFIAPI | RsaGenerateKey (IN OUT VOID *RsaContext, IN UINTN ModulusLength, IN CONST UINT8 *PublicExponent, IN UINTN PublicExponentSize) |
BOOLEAN EFIAPI | RsaCheckKey (IN VOID *RsaContext) |
BOOLEAN EFIAPI | RsaPkcs1Sign (IN VOID *RsaContext, IN CONST UINT8 *MessageHash, IN UINTN HashSize, OUT UINT8 *Signature, IN OUT UINTN *SigSize) |
BOOLEAN EFIAPI | RsaPkcs1Verify (IN VOID *RsaContext, IN CONST UINT8 *MessageHash, IN UINTN HashSize, IN CONST UINT8 *Signature, IN UINTN SigSize) |
BOOLEAN EFIAPI | RsaGetPrivateKeyFromPem (IN CONST UINT8 *PemData, IN UINTN PemSize, IN CONST CHAR8 *Password, OUT VOID **RsaContext) |
BOOLEAN EFIAPI | RsaGetPublicKeyFromX509 (IN CONST UINT8 *Cert, IN UINTN CertSize, OUT VOID **RsaContext) |
BOOLEAN EFIAPI | X509GetSubjectName (IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINT8 *CertSubject, IN OUT UINTN *SubjectSize) |
BOOLEAN EFIAPI | X509VerifyCert (IN CONST UINT8 *Cert, IN UINTN CertSize, IN CONST UINT8 *CACert, IN UINTN CACertSize) |
BOOLEAN EFIAPI | X509ConstructCertificate (IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINT8 **SingleX509Cert) |
BOOLEAN EFIAPI | X509ConstructCertificateStack (IN OUT UINT8 **X509Stack,...) |
VOID EFIAPI | X509Free (IN VOID *X509Cert) |
VOID EFIAPI | X509StackFree (IN VOID *X509Stack) |
BOOLEAN EFIAPI | X509GetTBSCert (IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINT8 **TBSCert, OUT UINTN *TBSCertSize) |
BOOLEAN EFIAPI | Pkcs7GetSigners (IN CONST UINT8 *P7Data, IN UINTN P7Length, OUT UINT8 **CertStack, OUT UINTN *StackLength, OUT UINT8 **TrustedCert, OUT UINTN *CertLength) |
VOID EFIAPI | Pkcs7FreeSigners (IN UINT8 *Certs) |
BOOLEAN EFIAPI | Pkcs7Sign (IN CONST UINT8 *PrivateKey, IN UINTN PrivateKeySize, IN CONST UINT8 *KeyPassword, IN UINT8 *InData, IN UINTN InDataSize, IN UINT8 *SignCert, IN UINT8 *OtherCerts, OUT UINT8 **SignedData, OUT UINTN *SignedDataSize) |
BOOLEAN EFIAPI | Pkcs7Verify (IN CONST UINT8 *P7Data, IN UINTN P7Length, IN CONST UINT8 *TrustedCert, IN UINTN CertLength, IN CONST UINT8 *InData, IN UINTN DataLength) |
BOOLEAN EFIAPI | Pkcs7GetAttachedContent (IN CONST UINT8 *P7Data, IN UINTN P7Length, OUT VOID **Content, OUT UINTN *ContentSize) |
BOOLEAN EFIAPI | AuthenticodeVerify (IN CONST UINT8 *AuthData, IN UINTN DataSize, IN CONST UINT8 *TrustedCert, IN UINTN CertSize, IN CONST UINT8 *ImageHash, IN UINTN HashSize) |
BOOLEAN EFIAPI | ImageTimestampVerify (IN CONST UINT8 *AuthData, IN UINTN DataSize, IN CONST UINT8 *TsaCert, IN UINTN CertSize, OUT EFI_TIME *SigningTime) |
VOID *EFIAPI | DhNew (VOID) |
VOID EFIAPI | DhFree (IN VOID *DhContext) |
BOOLEAN EFIAPI | DhGenerateParameter (IN OUT VOID *DhContext, IN UINTN Generator, IN UINTN PrimeLength, OUT UINT8 *Prime) |
BOOLEAN EFIAPI | DhSetParameter (IN OUT VOID *DhContext, IN UINTN Generator, IN UINTN PrimeLength, IN CONST UINT8 *Prime) |
BOOLEAN EFIAPI | DhGenerateKey (IN OUT VOID *DhContext, OUT UINT8 *PublicKey, IN OUT UINTN *PublicKeySize) |
BOOLEAN EFIAPI | DhComputeKey (IN OUT VOID *DhContext, IN CONST UINT8 *PeerPublicKey, IN UINTN PeerPublicKeySize, OUT UINT8 *Key, IN OUT UINTN *KeySize) |
BOOLEAN EFIAPI | RandomSeed (IN CONST UINT8 *Seed, IN UINTN SeedSize) |
BOOLEAN EFIAPI | RandomBytes (OUT UINT8 *Output, IN UINTN Size) |
Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define AES_BLOCK_SIZE 16 |
AES block size in bytes
#define MD4_DIGEST_SIZE 16 |
MD4 digest size in bytes
#define MD5_DIGEST_SIZE 16 |
MD5 digest size in bytes
#define SHA1_DIGEST_SIZE 20 |
SHA-1 digest size in bytes.
#define SHA256_DIGEST_SIZE 32 |
SHA-256 digest size in bytes
#define SHA384_DIGEST_SIZE 48 |
SHA-384 digest size in bytes
#define SHA512_DIGEST_SIZE 64 |
SHA-512 digest size in bytes
#define TDES_BLOCK_SIZE 8 |
TDES block size in bytes
enum RSA_KEY_TAG |
RSA Key Tags Definition used in RsaSetKey() function for key component identification.
BOOLEAN EFIAPI AesCbcDecrypt | ( | IN VOID * | AesContext, | |
IN CONST UINT8 * | Input, | |||
IN UINTN | InputSize, | |||
IN CONST UINT8 * | Ivec, | |||
OUT UINT8 * | Output | |||
) |
Performs AES decryption on a data buffer of the specified size in CBC mode.
This function performs AES decryption on data buffer pointed by Input, of specified size of InputSize, in CBC mode. InputSize must be multiple of block size (16 bytes). This function does not perform padding. Caller must perform padding, if necessary, to ensure valid input data size. Initialization vector should be one block size (16 bytes). AesContext should be already correctly initialized by AesInit(). Behavior with invalid AES context is undefined.
If AesContext is NULL, then return FALSE. If Input is NULL, then return FALSE. If InputSize is not multiple of block size (16 bytes), then return FALSE. If Ivec is NULL, then return FALSE. If Output is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in] | AesContext | Pointer to the AES context. |
[in] | Input | Pointer to the buffer containing the data to be encrypted. |
[in] | InputSize | Size of the Input buffer in bytes. |
[in] | Ivec | Pointer to initialization vector. |
[out] | Output | Pointer to a buffer that receives the AES encryption output. |
TRUE | AES decryption succeeded. | |
FALSE | AES decryption failed. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI AesCbcEncrypt | ( | IN VOID * | AesContext, | |
IN CONST UINT8 * | Input, | |||
IN UINTN | InputSize, | |||
IN CONST UINT8 * | Ivec, | |||
OUT UINT8 * | Output | |||
) |
Performs AES encryption on a data buffer of the specified size in CBC mode.
This function performs AES encryption on data buffer pointed by Input, of specified size of InputSize, in CBC mode. InputSize must be multiple of block size (16 bytes). This function does not perform padding. Caller must perform padding, if necessary, to ensure valid input data size. Initialization vector should be one block size (16 bytes). AesContext should be already correctly initialized by AesInit(). Behavior with invalid AES context is undefined.
If AesContext is NULL, then return FALSE. If Input is NULL, then return FALSE. If InputSize is not multiple of block size (16 bytes), then return FALSE. If Ivec is NULL, then return FALSE. If Output is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in] | AesContext | Pointer to the AES context. |
[in] | Input | Pointer to the buffer containing the data to be encrypted. |
[in] | InputSize | Size of the Input buffer in bytes. |
[in] | Ivec | Pointer to initialization vector. |
[out] | Output | Pointer to a buffer that receives the AES encryption output. |
TRUE | AES encryption succeeded. | |
FALSE | AES encryption failed. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI AesEcbDecrypt | ( | IN VOID * | AesContext, | |
IN CONST UINT8 * | Input, | |||
IN UINTN | InputSize, | |||
OUT UINT8 * | Output | |||
) |
Performs AES decryption on a data buffer of the specified size in ECB mode.
This function performs AES decryption on data buffer pointed by Input, of specified size of InputSize, in ECB mode. InputSize must be multiple of block size (16 bytes). This function does not perform padding. Caller must perform padding, if necessary, to ensure valid input data size. AesContext should be already correctly initialized by AesInit(). Behavior with invalid AES context is undefined.
If AesContext is NULL, then return FALSE. If Input is NULL, then return FALSE. If InputSize is not multiple of block size (16 bytes), then return FALSE. If Output is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in] | AesContext | Pointer to the AES context. |
[in] | Input | Pointer to the buffer containing the data to be decrypted. |
[in] | InputSize | Size of the Input buffer in bytes. |
[out] | Output | Pointer to a buffer that receives the AES decryption output. |
TRUE | AES decryption succeeded. | |
FALSE | AES decryption failed. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI AesEcbEncrypt | ( | IN VOID * | AesContext, | |
IN CONST UINT8 * | Input, | |||
IN UINTN | InputSize, | |||
OUT UINT8 * | Output | |||
) |
Performs AES encryption on a data buffer of the specified size in ECB mode.
This function performs AES encryption on data buffer pointed by Input, of specified size of InputSize, in ECB mode. InputSize must be multiple of block size (16 bytes). This function does not perform padding. Caller must perform padding, if necessary, to ensure valid input data size. AesContext should be already correctly initialized by AesInit(). Behavior with invalid AES context is undefined.
If AesContext is NULL, then return FALSE. If Input is NULL, then return FALSE. If InputSize is not multiple of block size (16 bytes), then return FALSE. If Output is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in] | AesContext | Pointer to the AES context. |
[in] | Input | Pointer to the buffer containing the data to be encrypted. |
[in] | InputSize | Size of the Input buffer in bytes. |
[out] | Output | Pointer to a buffer that receives the AES encryption output. |
TRUE | AES encryption succeeded. | |
FALSE | AES encryption failed. | |
FALSE | This interface is not supported. |
UINTN EFIAPI AesGetContextSize | ( | VOID | ) |
Retrieves the size, in bytes, of the context buffer required for AES operations.
If this interface is not supported, then return zero.
0 | This interface is not supported. |
BOOLEAN EFIAPI AesInit | ( | OUT VOID * | AesContext, | |
IN CONST UINT8 * | Key, | |||
IN UINTN | KeyLength | |||
) |
Initializes user-supplied memory as AES context for subsequent use.
This function initializes user-supplied memory pointed by AesContext as AES context. In addition, it sets up all AES key materials for subsequent encryption and decryption operations. There are 3 options for key length, 128 bits, 192 bits, and 256 bits.
If AesContext is NULL, then return FALSE. If Key is NULL, then return FALSE. If KeyLength is not valid, then return FALSE. If this interface is not supported, then return FALSE.
[out] | AesContext | Pointer to AES context being initialized. |
[in] | Key | Pointer to the user-supplied AES key. |
[in] | KeyLength | Length of AES key in bits. |
TRUE | AES context initialization succeeded. | |
FALSE | AES context initialization failed. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI Arc4Decrypt | ( | IN OUT VOID * | Arc4Context, | |
IN UINT8 * | Input, | |||
IN UINTN | InputSize, | |||
OUT UINT8 * | Output | |||
) |
Performs ARC4 decryption on a data buffer of the specified size.
This function performs ARC4 decryption on data buffer pointed by Input, of specified size of InputSize. Arc4Context should be already correctly initialized by Arc4Init(). Behavior with invalid ARC4 context is undefined.
If Arc4Context is NULL, then return FALSE. If Input is NULL, then return FALSE. If Output is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in] | Arc4Context | Pointer to the ARC4 context. |
[in] | Input | Pointer to the buffer containing the data to be decrypted. |
[in] | InputSize | Size of the Input buffer in bytes. |
[out] | Output | Pointer to a buffer that receives the ARC4 decryption output. |
TRUE | ARC4 decryption succeeded. | |
FALSE | ARC4 decryption failed. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI Arc4Encrypt | ( | IN OUT VOID * | Arc4Context, | |
IN CONST UINT8 * | Input, | |||
IN UINTN | InputSize, | |||
OUT UINT8 * | Output | |||
) |
Performs ARC4 encryption on a data buffer of the specified size.
This function performs ARC4 encryption on data buffer pointed by Input, of specified size of InputSize. Arc4Context should be already correctly initialized by Arc4Init(). Behavior with invalid ARC4 context is undefined.
If Arc4Context is NULL, then return FALSE. If Input is NULL, then return FALSE. If Output is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in] | Arc4Context | Pointer to the ARC4 context. |
[in] | Input | Pointer to the buffer containing the data to be encrypted. |
[in] | InputSize | Size of the Input buffer in bytes. |
[out] | Output | Pointer to a buffer that receives the ARC4 encryption output. |
TRUE | ARC4 encryption succeeded. | |
FALSE | ARC4 encryption failed. | |
FALSE | This interface is not supported. |
UINTN EFIAPI Arc4GetContextSize | ( | VOID | ) |
Retrieves the size, in bytes, of the context buffer required for ARC4 operations.
If this interface is not supported, then return zero.
0 | This interface is not supported. |
BOOLEAN EFIAPI Arc4Init | ( | OUT VOID * | Arc4Context, | |
IN CONST UINT8 * | Key, | |||
IN UINTN | KeySize | |||
) |
Initializes user-supplied memory as ARC4 context for subsequent use.
This function initializes user-supplied memory pointed by Arc4Context as ARC4 context. In addition, it sets up all ARC4 key materials for subsequent encryption and decryption operations.
If Arc4Context is NULL, then return FALSE. If Key is NULL, then return FALSE. If KeySize does not in the range of [5, 256] bytes, then return FALSE. If this interface is not supported, then return FALSE.
[out] | Arc4Context | Pointer to ARC4 context being initialized. |
[in] | Key | Pointer to the user-supplied ARC4 key. |
[in] | KeySize | Size of ARC4 key in bytes. |
TRUE | ARC4 context initialization succeeded. | |
FALSE | ARC4 context initialization failed. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI Arc4Reset | ( | IN OUT VOID * | Arc4Context | ) |
Resets the ARC4 context to the initial state.
The function resets the ARC4 context to the state it had immediately after the ARC4Init() function call. Contrary to ARC4Init(), Arc4Reset() requires no secret key as input, but ARC4 context should be already correctly initialized by ARC4Init().
If Arc4Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in,out] | Arc4Context | Pointer to the ARC4 context. |
TRUE | ARC4 reset succeeded. | |
FALSE | ARC4 reset failed. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI AuthenticodeVerify | ( | IN CONST UINT8 * | AuthData, | |
IN UINTN | DataSize, | |||
IN CONST UINT8 * | TrustedCert, | |||
IN UINTN | CertSize, | |||
IN CONST UINT8 * | ImageHash, | |||
IN UINTN | HashSize | |||
) |
Verifies the validility of a PE/COFF Authenticode Signature as described in "Windows Authenticode Portable Executable Signature Format".
If AuthData is NULL, then return FALSE. If ImageHash is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in] | AuthData | Pointer to the Authenticode Signature retrieved from signed PE/COFF image to be verified. |
[in] | DataSize | Size of the Authenticode Signature in bytes. |
[in] | TrustedCert | Pointer to a trusted/root certificate encoded in DER, which is used for certificate chain verification. |
[in] | CertSize | Size of the trusted certificate in bytes. |
[in] | ImageHash | Pointer to the original image file hash value. The procudure for calculating the image hash value is described in Authenticode specification. |
[in] | HashSize | Size of Image hash value in bytes. |
TRUE | The specified Authenticode Signature is valid. | |
FALSE | Invalid Authenticode Signature. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI DhComputeKey | ( | IN OUT VOID * | DhContext, | |
IN CONST UINT8 * | PeerPublicKey, | |||
IN UINTN | PeerPublicKeySize, | |||
OUT UINT8 * | Key, | |||
IN OUT UINTN * | KeySize | |||
) |
Computes exchanged common key.
Given peer's public key, this function computes the exchanged common key, based on its own context including value of prime modulus and random secret exponent.
If DhContext is NULL, then return FALSE. If PeerPublicKey is NULL, then return FALSE. If KeySize is NULL, then return FALSE. If Key is NULL, then return FALSE. If KeySize is not large enough, then return FALSE. If this interface is not supported, then return FALSE.
[in,out] | DhContext | Pointer to the DH context. |
[in] | PeerPublicKey | Pointer to the peer's public key. |
[in] | PeerPublicKeySize | Size of peer's public key in bytes. |
[out] | Key | Pointer to the buffer to receive generated key. |
[in,out] | KeySize | On input, the size of Key buffer in bytes. On output, the size of data returned in Key buffer in bytes. |
TRUE | DH exchanged key generation succeeded. | |
FALSE | DH exchanged key generation failed. | |
FALSE | KeySize is not large enough. | |
FALSE | This interface is not supported. |
VOID EFIAPI DhFree | ( | IN VOID * | DhContext | ) |
Release the specified DH context.
If the interface is not supported, then ASSERT().
[in] | DhContext | Pointer to the DH context to be released. |
BOOLEAN EFIAPI DhGenerateKey | ( | IN OUT VOID * | DhContext, | |
OUT UINT8 * | PublicKey, | |||
IN OUT UINTN * | PublicKeySize | |||
) |
Generates DH public key.
This function generates random secret exponent, and computes the public key, which is returned via parameter PublicKey and PublicKeySize. DH context is updated accordingly. If the PublicKey buffer is too small to hold the public key, FALSE is returned and PublicKeySize is set to the required buffer size to obtain the public key.
If DhContext is NULL, then return FALSE. If PublicKeySize is NULL, then return FALSE. If PublicKeySize is large enough but PublicKey is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in,out] | DhContext | Pointer to the DH context. |
[out] | PublicKey | Pointer to the buffer to receive generated public key. |
[in,out] | PublicKeySize | On input, the size of PublicKey buffer in bytes. On output, the size of data returned in PublicKey buffer in bytes. |
TRUE | DH public key generation succeeded. | |
FALSE | DH public key generation failed. | |
FALSE | PublicKeySize is not large enough. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI DhGenerateParameter | ( | IN OUT VOID * | DhContext, | |
IN UINTN | Generator, | |||
IN UINTN | PrimeLength, | |||
OUT UINT8 * | Prime | |||
) |
Generates DH parameter.
Given generator g, and length of prime number p in bits, this function generates p, and sets DH context according to value of g and p.
Before this function can be invoked, pseudorandom number generator must be correctly initialized by RandomSeed().
If DhContext is NULL, then return FALSE. If Prime is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in,out] | DhContext | Pointer to the DH context. |
[in] | Generator | Value of generator. |
[in] | PrimeLength | Length in bits of prime to be generated. |
[out] | Prime | Pointer to the buffer to receive the generated prime number. |
TRUE | DH pamameter generation succeeded. | |
FALSE | Value of Generator is not supported. | |
FALSE | PRNG fails to generate random prime number with PrimeLength. | |
FALSE | This interface is not supported. |
VOID* EFIAPI DhNew | ( | VOID | ) |
BOOLEAN EFIAPI DhSetParameter | ( | IN OUT VOID * | DhContext, | |
IN UINTN | Generator, | |||
IN UINTN | PrimeLength, | |||
IN CONST UINT8 * | Prime | |||
) |
Sets generator and prime parameters for DH.
Given generator g, and prime number p, this function and sets DH context accordingly.
If DhContext is NULL, then return FALSE. If Prime is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in,out] | DhContext | Pointer to the DH context. |
[in] | Generator | Value of generator. |
[in] | PrimeLength | Length in bits of prime to be generated. |
[in] | Prime | Pointer to the prime number. |
TRUE | DH pamameter setting succeeded. | |
FALSE | Value of Generator is not supported. | |
FALSE | Value of Generator is not suitable for the Prime. | |
FALSE | Value of Prime is not a prime number. | |
FALSE | Value of Prime is not a safe prime number. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI HmacMd5Duplicate | ( | IN CONST VOID * | HmacMd5Context, | |
OUT VOID * | NewHmacMd5Context | |||
) |
Makes a copy of an existing HMAC-MD5 context.
If HmacMd5Context is NULL, then return FALSE. If NewHmacMd5Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in] | HmacMd5Context | Pointer to HMAC-MD5 context being copied. |
[out] | NewHmacMd5Context | Pointer to new HMAC-MD5 context. |
TRUE | HMAC-MD5 context copy succeeded. | |
FALSE | HMAC-MD5 context copy failed. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI HmacMd5Final | ( | IN OUT VOID * | HmacMd5Context, | |
OUT UINT8 * | HmacValue | |||
) |
Completes computation of the HMAC-MD5 digest value.
This function completes HMAC-MD5 hash computation and retrieves the digest value into the specified memory. After this function has been called, the HMAC-MD5 context cannot be used again. HMAC-MD5 context should be already correctly intialized by HmacMd5Init(), and should not be finalized by HmacMd5Final(). Behavior with invalid HMAC-MD5 context is undefined.
If HmacMd5Context is NULL, then return FALSE. If HashValue is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in,out] | HmacMd5Context | Pointer to the HMAC-MD5 context. |
[out] | HashValue | Pointer to a buffer that receives the HMAC-MD5 digest value (16 bytes). |
TRUE | HMAC-MD5 digest computation succeeded. | |
FALSE | HMAC-MD5 digest computation failed. | |
FALSE | This interface is not supported. |
UINTN EFIAPI HmacMd5GetContextSize | ( | VOID | ) |
Retrieves the size, in bytes, of the context buffer required for HMAC-MD5 operations.
If this interface is not supported, then return zero.
0 | This interface is not supported. |
BOOLEAN EFIAPI HmacMd5Init | ( | OUT VOID * | HmacMd5Context, | |
IN CONST UINT8 * | Key, | |||
IN UINTN | KeySize | |||
) |
Initializes user-supplied memory pointed by HmacMd5Context as HMAC-MD5 context for subsequent use.
If HmacMd5Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[out] | HmacMd5Context | Pointer to HMAC-MD5 context being initialized. |
[in] | Key | Pointer to the user-supplied key. |
[in] | KeySize | Key size in bytes. |
TRUE | HMAC-MD5 context initialization succeeded. | |
FALSE | HMAC-MD5 context initialization failed. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI HmacMd5Update | ( | IN OUT VOID * | HmacMd5Context, | |
IN CONST VOID * | Data, | |||
IN UINTN | DataSize | |||
) |
Digests the input data and updates HMAC-MD5 context.
This function performs HMAC-MD5 digest on a data buffer of the specified size. It can be called multiple times to compute the digest of long or discontinuous data streams. HMAC-MD5 context should be already correctly intialized by HmacMd5Init(), and should not be finalized by HmacMd5Final(). Behavior with invalid context is undefined.
If HmacMd5Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in,out] | HmacMd5Context | Pointer to the HMAC-MD5 context. |
[in] | Data | Pointer to the buffer containing the data to be digested. |
[in] | DataSize | Size of Data buffer in bytes. |
TRUE | HMAC-MD5 data digest succeeded. | |
FALSE | HMAC-MD5 data digest failed. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI HmacSha1Duplicate | ( | IN CONST VOID * | HmacSha1Context, | |
OUT VOID * | NewHmacSha1Context | |||
) |
Makes a copy of an existing HMAC-SHA1 context.
If HmacSha1Context is NULL, then return FALSE. If NewHmacSha1Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in] | HmacSha1Context | Pointer to HMAC-SHA1 context being copied. |
[out] | NewHmacSha1Context | Pointer to new HMAC-SHA1 context. |
TRUE | HMAC-SHA1 context copy succeeded. | |
FALSE | HMAC-SHA1 context copy failed. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI HmacSha1Final | ( | IN OUT VOID * | HmacSha1Context, | |
OUT UINT8 * | HmacValue | |||
) |
Completes computation of the HMAC-SHA1 digest value.
This function completes HMAC-SHA1 hash computation and retrieves the digest value into the specified memory. After this function has been called, the HMAC-SHA1 context cannot be used again. HMAC-SHA1 context should be already correctly intialized by HmacSha1Init(), and should not be finalized by HmacSha1Final(). Behavior with invalid HMAC-SHA1 context is undefined.
If HmacSha1Context is NULL, then return FALSE. If HashValue is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in,out] | HmacSha1Context | Pointer to the HMAC-SHA1 context. |
[out] | HashValue | Pointer to a buffer that receives the HMAC-SHA1 digest value (20 bytes). |
TRUE | HMAC-SHA1 digest computation succeeded. | |
FALSE | HMAC-SHA1 digest computation failed. | |
FALSE | This interface is not supported. |
UINTN EFIAPI HmacSha1GetContextSize | ( | VOID | ) |
Retrieves the size, in bytes, of the context buffer required for HMAC-SHA1 operations.
If this interface is not supported, then return zero.
0 | This interface is not supported. |
BOOLEAN EFIAPI HmacSha1Init | ( | OUT VOID * | HmacSha1Context, | |
IN CONST UINT8 * | Key, | |||
IN UINTN | KeySize | |||
) |
Initializes user-supplied memory pointed by HmacSha1Context as HMAC-SHA1 context for subsequent use.
If HmacSha1Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[out] | HmacSha1Context | Pointer to HMAC-SHA1 context being initialized. |
[in] | Key | Pointer to the user-supplied key. |
[in] | KeySize | Key size in bytes. |
TRUE | HMAC-SHA1 context initialization succeeded. | |
FALSE | HMAC-SHA1 context initialization failed. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI HmacSha1Update | ( | IN OUT VOID * | HmacSha1Context, | |
IN CONST VOID * | Data, | |||
IN UINTN | DataSize | |||
) |
Digests the input data and updates HMAC-SHA1 context.
This function performs HMAC-SHA1 digest on a data buffer of the specified size. It can be called multiple times to compute the digest of long or discontinuous data streams. HMAC-SHA1 context should be already correctly intialized by HmacSha1Init(), and should not be finalized by HmacSha1Final(). Behavior with invalid context is undefined.
If HmacSha1Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in,out] | HmacSha1Context | Pointer to the HMAC-SHA1 context. |
[in] | Data | Pointer to the buffer containing the data to be digested. |
[in] | DataSize | Size of Data buffer in bytes. |
TRUE | HMAC-SHA1 data digest succeeded. | |
FALSE | HMAC-SHA1 data digest failed. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI ImageTimestampVerify | ( | IN CONST UINT8 * | AuthData, | |
IN UINTN | DataSize, | |||
IN CONST UINT8 * | TsaCert, | |||
IN UINTN | CertSize, | |||
OUT EFI_TIME * | SigningTime | |||
) |
Verifies the validility of a RFC3161 Timestamp CounterSignature embedded in PE/COFF Authenticode signature.
If AuthData is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in] | AuthData | Pointer to the Authenticode Signature retrieved from signed PE/COFF image to be verified. |
[in] | DataSize | Size of the Authenticode Signature in bytes. |
[in] | TsaCert | Pointer to a trusted/root TSA certificate encoded in DER, which is used for TSA certificate chain verification. |
[in] | CertSize | Size of the trusted certificate in bytes. |
[out] | SigningTime | Return the time of timestamp generation time if the timestamp signature is valid. |
TRUE | The specified Authenticode includes a valid RFC3161 Timestamp CounterSignature. | |
FALSE | No valid RFC3161 Timestamp CounterSignature in the specified Authenticode data. |
BOOLEAN EFIAPI Md4Duplicate | ( | IN CONST VOID * | Md4Context, | |
OUT VOID * | NewMd4Context | |||
) |
Makes a copy of an existing MD4 context.
If Md4Context is NULL, then return FALSE. If NewMd4Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in] | Md4Context | Pointer to MD4 context being copied. |
[out] | NewMd4Context | Pointer to new MD4 context. |
TRUE | MD4 context copy succeeded. | |
FALSE | MD4 context copy failed. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI Md4Final | ( | IN OUT VOID * | Md4Context, | |
OUT UINT8 * | HashValue | |||
) |
Completes computation of the MD4 digest value.
This function completes MD4 hash computation and retrieves the digest value into the specified memory. After this function has been called, the MD4 context cannot be used again. MD4 context should be already correctly intialized by Md4Init(), and should not be finalized by Md4Final(). Behavior with invalid MD4 context is undefined.
If Md4Context is NULL, then return FALSE. If HashValue is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in,out] | Md4Context | Pointer to the MD4 context. |
[out] | HashValue | Pointer to a buffer that receives the MD4 digest value (16 bytes). |
TRUE | MD4 digest computation succeeded. | |
FALSE | MD4 digest computation failed. | |
FALSE | This interface is not supported. |
UINTN EFIAPI Md4GetContextSize | ( | VOID | ) |
Retrieves the size, in bytes, of the context buffer required for MD4 hash operations.
If this interface is not supported, then return zero.
0 | This interface is not supported. |
BOOLEAN EFIAPI Md4Init | ( | OUT VOID * | Md4Context | ) |
Initializes user-supplied memory pointed by Md4Context as MD4 hash context for subsequent use.
If Md4Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[out] | Md4Context | Pointer to MD4 context being initialized. |
TRUE | MD4 context initialization succeeded. | |
FALSE | MD4 context initialization failed. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI Md4Update | ( | IN OUT VOID * | Md4Context, | |
IN CONST VOID * | Data, | |||
IN UINTN | DataSize | |||
) |
Digests the input data and updates MD4 context.
This function performs MD4 digest on a data buffer of the specified size. It can be called multiple times to compute the digest of long or discontinuous data streams. MD4 context should be already correctly intialized by Md4Init(), and should not be finalized by Md4Final(). Behavior with invalid context is undefined.
If Md4Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in,out] | Md4Context | Pointer to the MD4 context. |
[in] | Data | Pointer to the buffer containing the data to be hashed. |
[in] | DataSize | Size of Data buffer in bytes. |
TRUE | MD4 data digest succeeded. | |
FALSE | MD4 data digest failed. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI Md5Duplicate | ( | IN CONST VOID * | Md5Context, | |
OUT VOID * | NewMd5Context | |||
) |
Makes a copy of an existing MD5 context.
If Md5Context is NULL, then return FALSE. If NewMd5Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in] | Md5Context | Pointer to MD5 context being copied. |
[out] | NewMd5Context | Pointer to new MD5 context. |
TRUE | MD5 context copy succeeded. | |
FALSE | MD5 context copy failed. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI Md5Final | ( | IN OUT VOID * | Md5Context, | |
OUT UINT8 * | HashValue | |||
) |
Completes computation of the MD5 digest value.
This function completes MD5 hash computation and retrieves the digest value into the specified memory. After this function has been called, the MD5 context cannot be used again. MD5 context should be already correctly intialized by Md5Init(), and should not be finalized by Md5Final(). Behavior with invalid MD5 context is undefined.
If Md5Context is NULL, then return FALSE. If HashValue is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in,out] | Md5Context | Pointer to the MD5 context. |
[out] | HashValue | Pointer to a buffer that receives the MD5 digest value (16 bytes). |
TRUE | MD5 digest computation succeeded. | |
FALSE | MD5 digest computation failed. | |
FALSE | This interface is not supported. |
UINTN EFIAPI Md5GetContextSize | ( | VOID | ) |
Retrieves the size, in bytes, of the context buffer required for MD5 hash operations.
If this interface is not supported, then return zero.
0 | This interface is not supported. |
BOOLEAN EFIAPI Md5Init | ( | OUT VOID * | Md5Context | ) |
Initializes user-supplied memory pointed by Md5Context as MD5 hash context for subsequent use.
If Md5Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[out] | Md5Context | Pointer to MD5 context being initialized. |
TRUE | MD5 context initialization succeeded. | |
FALSE | MD5 context initialization failed. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI Md5Update | ( | IN OUT VOID * | Md5Context, | |
IN CONST VOID * | Data, | |||
IN UINTN | DataSize | |||
) |
Digests the input data and updates MD5 context.
This function performs MD5 digest on a data buffer of the specified size. It can be called multiple times to compute the digest of long or discontinuous data streams. MD5 context should be already correctly intialized by Md5Init(), and should not be finalized by Md5Final(). Behavior with invalid context is undefined.
If Md5Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in,out] | Md5Context | Pointer to the MD5 context. |
[in] | Data | Pointer to the buffer containing the data to be hashed. |
[in] | DataSize | Size of Data buffer in bytes. |
TRUE | MD5 data digest succeeded. | |
FALSE | MD5 data digest failed. | |
FALSE | This interface is not supported. |
VOID EFIAPI Pkcs7FreeSigners | ( | IN UINT8 * | Certs | ) |
Wrap function to use free() to free allocated memory for certificates.
If this interface is not supported, then ASSERT().
[in] | Certs | Pointer to the certificates to be freed. |
BOOLEAN EFIAPI Pkcs7GetAttachedContent | ( | IN CONST UINT8 * | P7Data, | |
IN UINTN | P7Length, | |||
OUT VOID ** | Content, | |||
OUT UINTN * | ContentSize | |||
) |
Extracts the attached content from a PKCS#7 signed data if existed. The input signed data could be wrapped in a ContentInfo structure.
If P7Data, Content, or ContentSize is NULL, then return FALSE. If P7Length overflow, then return FAlSE. If the P7Data is not correctly formatted, then return FALSE.
Caution: This function may receive untrusted input. So this function will do basic check for PKCS#7 data structure.
[in] | P7Data | Pointer to the PKCS#7 signed data to process. |
[in] | P7Length | Length of the PKCS#7 signed data in bytes. |
[out] | Content | Pointer to the extracted content from the PKCS#7 signedData. It's caller's responsiblity to free the buffer. |
[out] | ContentSize | The size of the extracted content in bytes. |
TRUE | The P7Data was correctly formatted for processing. | |
FALSE | The P7Data was not correctly formatted for processing. |
BOOLEAN EFIAPI Pkcs7GetSigners | ( | IN CONST UINT8 * | P7Data, | |
IN UINTN | P7Length, | |||
OUT UINT8 ** | CertStack, | |||
OUT UINTN * | StackLength, | |||
OUT UINT8 ** | TrustedCert, | |||
OUT UINTN * | CertLength | |||
) |
Get the signer's certificates from PKCS#7 signed data as described in "PKCS #7: Cryptographic Message Syntax Standard". The input signed data could be wrapped in a ContentInfo structure.
If P7Data, CertStack, StackLength, TrustedCert or CertLength is NULL, then return FALSE. If P7Length overflow, then return FAlSE. If this interface is not supported, then return FALSE.
[in] | P7Data | Pointer to the PKCS#7 message to verify. |
[in] | P7Length | Length of the PKCS#7 message in bytes. |
[out] | CertStack | Pointer to Signer's certificates retrieved from P7Data. It's caller's responsiblity to free the buffer. |
[out] | StackLength | Length of signer's certificates in bytes. |
[out] | TrustedCert | Pointer to a trusted certificate from Signer's certificates. It's caller's responsiblity to free the buffer. |
[out] | CertLength | Length of the trusted certificate in bytes. |
TRUE | The operation is finished successfully. | |
FALSE | Error occurs during the operation. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI Pkcs7Sign | ( | IN CONST UINT8 * | PrivateKey, | |
IN UINTN | PrivateKeySize, | |||
IN CONST UINT8 * | KeyPassword, | |||
IN UINT8 * | InData, | |||
IN UINTN | InDataSize, | |||
IN UINT8 * | SignCert, | |||
IN UINT8 * | OtherCerts, | |||
OUT UINT8 ** | SignedData, | |||
OUT UINTN * | SignedDataSize | |||
) |
Creates a PKCS#7 signedData as described in "PKCS #7: Cryptographic Message Syntax Standard, version 1.5". This interface is only intended to be used for application to perform PKCS#7 functionality validation.
If this interface is not supported, then return FALSE.
[in] | PrivateKey | Pointer to the PEM-formatted private key data for data signing. |
[in] | PrivateKeySize | Size of the PEM private key data in bytes. |
[in] | KeyPassword | NULL-terminated passphrase used for encrypted PEM key data. |
[in] | InData | Pointer to the content to be signed. |
[in] | InDataSize | Size of InData in bytes. |
[in] | SignCert | Pointer to signer's DER-encoded certificate to sign with. |
[in] | OtherCerts | Pointer to an optional additional set of certificates to include in the PKCS#7 signedData (e.g. any intermediate CAs in the chain). |
[out] | SignedData | Pointer to output PKCS#7 signedData. |
[out] | SignedDataSize | Size of SignedData in bytes. |
TRUE | PKCS#7 data signing succeeded. | |
FALSE | PKCS#7 data signing failed. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI Pkcs7Verify | ( | IN CONST UINT8 * | P7Data, | |
IN UINTN | P7Length, | |||
IN CONST UINT8 * | TrustedCert, | |||
IN UINTN | CertLength, | |||
IN CONST UINT8 * | InData, | |||
IN UINTN | DataLength | |||
) |
Verifies the validility of a PKCS#7 signed data as described in "PKCS #7: Cryptographic Message Syntax Standard". The input signed data could be wrapped in a ContentInfo structure.
If P7Data, TrustedCert or InData is NULL, then return FALSE. If P7Length, CertLength or DataLength overflow, then return FAlSE. If this interface is not supported, then return FALSE.
[in] | P7Data | Pointer to the PKCS#7 message to verify. |
[in] | P7Length | Length of the PKCS#7 message in bytes. |
[in] | TrustedCert | Pointer to a trusted/root certificate encoded in DER, which is used for certificate chain verification. |
[in] | CertLength | Length of the trusted certificate in bytes. |
[in] | InData | Pointer to the content to be verified. |
[in] | DataLength | Length of InData in bytes. |
TRUE | The specified PKCS#7 signed data is valid. | |
FALSE | Invalid PKCS#7 signed data. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI RandomBytes | ( | OUT UINT8 * | Output, | |
IN UINTN | Size | |||
) |
Generates a pseudorandom byte stream of the specified size.
If Output is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[out] | Output | Pointer to buffer to receive random value. |
[in] | Size | Size of randome bytes to generate. |
TRUE | Pseudorandom byte stream generated successfully. | |
FALSE | Pseudorandom number generator fails to generate due to lack of entropy. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI RandomSeed | ( | IN CONST UINT8 * | Seed, | |
IN UINTN | SeedSize | |||
) |
Sets up the seed value for the pseudorandom number generator.
This function sets up the seed value for the pseudorandom number generator. If Seed is not NULL, then the seed passed in is used. If Seed is NULL, then default seed is used. If this interface is not supported, then return FALSE.
[in] | Seed | Pointer to seed value. If NULL, default seed is used. |
[in] | SeedSize | Size of seed value. If Seed is NULL, this parameter is ignored. |
TRUE | Pseudorandom number generator has enough entropy for random generation. | |
FALSE | Pseudorandom number generator does not have enough entropy for random generation. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI RsaCheckKey | ( | IN VOID * | RsaContext | ) |
Validates key components of RSA context. NOTE: This function performs integrity checks on all the RSA key material, so the RSA key structure must contain all the private key data.
This function validates key compoents of RSA context in following aspects:
If RsaContext is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in] | RsaContext | Pointer to RSA context to check. |
TRUE | RSA key components are valid. | |
FALSE | RSA key components are not valid. | |
FALSE | This interface is not supported. |
VOID EFIAPI RsaFree | ( | IN VOID * | RsaContext | ) |
Release the specified RSA context.
If RsaContext is NULL, then return FALSE.
[in] | RsaContext | Pointer to the RSA context to be released. |
BOOLEAN EFIAPI RsaGenerateKey | ( | IN OUT VOID * | RsaContext, | |
IN UINTN | ModulusLength, | |||
IN CONST UINT8 * | PublicExponent, | |||
IN UINTN | PublicExponentSize | |||
) |
Generates RSA key components.
This function generates RSA key components. It takes RSA public exponent E and length in bits of RSA modulus N as input, and generates all key components. If PublicExponent is NULL, the default RSA public exponent (0x10001) will be used.
Before this function can be invoked, pseudorandom number generator must be correctly initialized by RandomSeed().
If RsaContext is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in,out] | RsaContext | Pointer to RSA context being set. |
[in] | ModulusLength | Length of RSA modulus N in bits. |
[in] | PublicExponent | Pointer to RSA public exponent. |
[in] | PublicExponentSize | Size of RSA public exponent buffer in bytes. |
TRUE | RSA key component was generated successfully. | |
FALSE | Invalid RSA key component tag. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI RsaGetKey | ( | IN OUT VOID * | RsaContext, | |
IN RSA_KEY_TAG | KeyTag, | |||
OUT UINT8 * | BigNumber, | |||
IN OUT UINTN * | BnSize | |||
) |
Gets the tag-designated RSA key component from the established RSA context.
This function retrieves the tag-designated RSA key component from the established RSA context as a non-negative integer (octet string format represented in RSA PKCS#1). If specified key component has not been set or has been cleared, then returned BnSize is set to 0. If the BigNumber buffer is too small to hold the contents of the key, FALSE is returned and BnSize is set to the required buffer size to obtain the key.
If RsaContext is NULL, then return FALSE. If BnSize is NULL, then return FALSE. If BnSize is large enough but BigNumber is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in,out] | RsaContext | Pointer to RSA context being set. |
[in] | KeyTag | Tag of RSA key component being set. |
[out] | BigNumber | Pointer to octet integer buffer. |
[in,out] | BnSize | On input, the size of big number buffer in bytes. On output, the size of data returned in big number buffer in bytes. |
TRUE | RSA key component was retrieved successfully. | |
FALSE | Invalid RSA key component tag. | |
FALSE | BnSize is too small. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI RsaGetPrivateKeyFromPem | ( | IN CONST UINT8 * | PemData, | |
IN UINTN | PemSize, | |||
IN CONST CHAR8 * | Password, | |||
OUT VOID ** | RsaContext | |||
) |
Retrieve the RSA Private Key from the password-protected PEM key data.
If PemData is NULL, then return FALSE. If RsaContext is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in] | PemData | Pointer to the PEM-encoded key data to be retrieved. |
[in] | PemSize | Size of the PEM key data in bytes. |
[in] | Password | NULL-terminated passphrase used for encrypted PEM key data. |
[out] | RsaContext | Pointer to new-generated RSA context which contain the retrieved RSA private key component. Use RsaFree() function to free the resource. |
TRUE | RSA Private Key was retrieved successfully. | |
FALSE | Invalid PEM key data or incorrect password. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI RsaGetPublicKeyFromX509 | ( | IN CONST UINT8 * | Cert, | |
IN UINTN | CertSize, | |||
OUT VOID ** | RsaContext | |||
) |
Retrieve the RSA Public Key from one DER-encoded X509 certificate.
If Cert is NULL, then return FALSE. If RsaContext is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in] | Cert | Pointer to the DER-encoded X509 certificate. |
[in] | CertSize | Size of the X509 certificate in bytes. |
[out] | RsaContext | Pointer to new-generated RSA context which contain the retrieved RSA public key component. Use RsaFree() function to free the resource. |
TRUE | RSA Public Key was retrieved successfully. | |
FALSE | Fail to retrieve RSA public key from X509 certificate. | |
FALSE | This interface is not supported. |
VOID* EFIAPI RsaNew | ( | VOID | ) |
Allocates and initializes one RSA context for subsequent use.
BOOLEAN EFIAPI RsaPkcs1Sign | ( | IN VOID * | RsaContext, | |
IN CONST UINT8 * | MessageHash, | |||
IN UINTN | HashSize, | |||
OUT UINT8 * | Signature, | |||
IN OUT UINTN * | SigSize | |||
) |
Carries out the RSA-SSA signature generation with EMSA-PKCS1-v1_5 encoding scheme.
This function carries out the RSA-SSA signature generation with EMSA-PKCS1-v1_5 encoding scheme defined in RSA PKCS#1. If the Signature buffer is too small to hold the contents of signature, FALSE is returned and SigSize is set to the required buffer size to obtain the signature.
If RsaContext is NULL, then return FALSE. If MessageHash is NULL, then return FALSE. If HashSize is not equal to the size of MD5, SHA-1 or SHA-256 digest, then return FALSE. If SigSize is large enough but Signature is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in] | RsaContext | Pointer to RSA context for signature generation. |
[in] | MessageHash | Pointer to octet message hash to be signed. |
[in] | HashSize | Size of the message hash in bytes. |
[out] | Signature | Pointer to buffer to receive RSA PKCS1-v1_5 signature. |
[in,out] | SigSize | On input, the size of Signature buffer in bytes. On output, the size of data returned in Signature buffer in bytes. |
TRUE | Signature successfully generated in PKCS1-v1_5. | |
FALSE | Signature generation failed. | |
FALSE | SigSize is too small. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI RsaPkcs1Verify | ( | IN VOID * | RsaContext, | |
IN CONST UINT8 * | MessageHash, | |||
IN UINTN | HashSize, | |||
IN CONST UINT8 * | Signature, | |||
IN UINTN | SigSize | |||
) |
Verifies the RSA-SSA signature with EMSA-PKCS1-v1_5 encoding scheme defined in RSA PKCS#1.
If RsaContext is NULL, then return FALSE. If MessageHash is NULL, then return FALSE. If Signature is NULL, then return FALSE. If HashSize is not equal to the size of MD5, SHA-1, SHA-256 digest, then return FALSE.
[in] | RsaContext | Pointer to RSA context for signature verification. |
[in] | MessageHash | Pointer to octet message hash to be checked. |
[in] | HashSize | Size of the message hash in bytes. |
[in] | Signature | Pointer to RSA PKCS1-v1_5 signature to be verified. |
[in] | SigSize | Size of signature in bytes. |
TRUE | Valid signature encoded in PKCS1-v1_5. | |
FALSE | Invalid signature or invalid RSA context. |
BOOLEAN EFIAPI RsaSetKey | ( | IN OUT VOID * | RsaContext, | |
IN RSA_KEY_TAG | KeyTag, | |||
IN CONST UINT8 * | BigNumber, | |||
IN UINTN | BnSize | |||
) |
Sets the tag-designated key component into the established RSA context.
This function sets the tag-designated RSA key component into the established RSA context from the user-specified non-negative integer (octet string format represented in RSA PKCS#1). If BigNumber is NULL, then the specified key componenet in RSA context is cleared.
If RsaContext is NULL, then return FALSE.
[in,out] | RsaContext | Pointer to RSA context being set. |
[in] | KeyTag | Tag of RSA key component being set. |
[in] | BigNumber | Pointer to octet integer buffer. If NULL, then the specified key componenet in RSA context is cleared. |
[in] | BnSize | Size of big number buffer in bytes. If BigNumber is NULL, then it is ignored. |
TRUE | RSA key component was set successfully. | |
FALSE | Invalid RSA key component tag. |
BOOLEAN EFIAPI Sha1Duplicate | ( | IN CONST VOID * | Sha1Context, | |
OUT VOID * | NewSha1Context | |||
) |
Makes a copy of an existing SHA-1 context.
If Sha1Context is NULL, then return FALSE. If NewSha1Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in] | Sha1Context | Pointer to SHA-1 context being copied. |
[out] | NewSha1Context | Pointer to new SHA-1 context. |
TRUE | SHA-1 context copy succeeded. | |
FALSE | SHA-1 context copy failed. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI Sha1Final | ( | IN OUT VOID * | Sha1Context, | |
OUT UINT8 * | HashValue | |||
) |
Completes computation of the SHA-1 digest value.
This function completes SHA-1 hash computation and retrieves the digest value into the specified memory. After this function has been called, the SHA-1 context cannot be used again. SHA-1 context should be already correctly intialized by Sha1Init(), and should not be finalized by Sha1Final(). Behavior with invalid SHA-1 context is undefined.
If Sha1Context is NULL, then return FALSE. If HashValue is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in,out] | Sha1Context | Pointer to the SHA-1 context. |
[out] | HashValue | Pointer to a buffer that receives the SHA-1 digest value (20 bytes). |
TRUE | SHA-1 digest computation succeeded. | |
FALSE | SHA-1 digest computation failed. | |
FALSE | This interface is not supported. |
UINTN EFIAPI Sha1GetContextSize | ( | VOID | ) |
Retrieves the size, in bytes, of the context buffer required for SHA-1 hash operations.
If this interface is not supported, then return zero.
0 | This interface is not supported. |
BOOLEAN EFIAPI Sha1Init | ( | OUT VOID * | Sha1Context | ) |
Initializes user-supplied memory pointed by Sha1Context as SHA-1 hash context for subsequent use.
If Sha1Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[out] | Sha1Context | Pointer to SHA-1 context being initialized. |
TRUE | SHA-1 context initialization succeeded. | |
FALSE | SHA-1 context initialization failed. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI Sha1Update | ( | IN OUT VOID * | Sha1Context, | |
IN CONST VOID * | Data, | |||
IN UINTN | DataSize | |||
) |
Digests the input data and updates SHA-1 context.
This function performs SHA-1 digest on a data buffer of the specified size. It can be called multiple times to compute the digest of long or discontinuous data streams. SHA-1 context should be already correctly intialized by Sha1Init(), and should not be finalized by Sha1Final(). Behavior with invalid context is undefined.
If Sha1Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in,out] | Sha1Context | Pointer to the SHA-1 context. |
[in] | Data | Pointer to the buffer containing the data to be hashed. |
[in] | DataSize | Size of Data buffer in bytes. |
TRUE | SHA-1 data digest succeeded. | |
FALSE | SHA-1 data digest failed. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI Sha256Duplicate | ( | IN CONST VOID * | Sha256Context, | |
OUT VOID * | NewSha256Context | |||
) |
Makes a copy of an existing SHA-256 context.
If Sha256Context is NULL, then return FALSE. If NewSha256Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in] | Sha256Context | Pointer to SHA-256 context being copied. |
[out] | NewSha256Context | Pointer to new SHA-256 context. |
TRUE | SHA-256 context copy succeeded. | |
FALSE | SHA-256 context copy failed. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI Sha256Final | ( | IN OUT VOID * | Sha256Context, | |
OUT UINT8 * | HashValue | |||
) |
Completes computation of the SHA-256 digest value.
This function completes SHA-256 hash computation and retrieves the digest value into the specified memory. After this function has been called, the SHA-256 context cannot be used again. SHA-256 context should be already correctly intialized by Sha256Init(), and should not be finalized by Sha256Final(). Behavior with invalid SHA-256 context is undefined.
If Sha256Context is NULL, then return FALSE. If HashValue is NULL, then return FALSE.
[in,out] | Sha256Context | Pointer to the SHA-256 context. |
[out] | HashValue | Pointer to a buffer that receives the SHA-256 digest value (32 bytes). |
TRUE | SHA-256 digest computation succeeded. | |
FALSE | SHA-256 digest computation failed. |
UINTN EFIAPI Sha256GetContextSize | ( | VOID | ) |
Retrieves the size, in bytes, of the context buffer required for SHA-256 hash operations.
BOOLEAN EFIAPI Sha256Init | ( | OUT VOID * | Sha256Context | ) |
Initializes user-supplied memory pointed by Sha256Context as SHA-256 hash context for subsequent use.
If Sha256Context is NULL, then return FALSE.
[out] | Sha256Context | Pointer to SHA-256 context being initialized. |
TRUE | SHA-256 context initialization succeeded. | |
FALSE | SHA-256 context initialization failed. |
BOOLEAN EFIAPI Sha256Update | ( | IN OUT VOID * | Sha256Context, | |
IN CONST VOID * | Data, | |||
IN UINTN | DataSize | |||
) |
Digests the input data and updates SHA-256 context.
This function performs SHA-256 digest on a data buffer of the specified size. It can be called multiple times to compute the digest of long or discontinuous data streams. SHA-256 context should be already correctly intialized by Sha256Init(), and should not be finalized by Sha256Final(). Behavior with invalid context is undefined.
If Sha256Context is NULL, then return FALSE.
[in,out] | Sha256Context | Pointer to the SHA-256 context. |
[in] | Data | Pointer to the buffer containing the data to be hashed. |
[in] | DataSize | Size of Data buffer in bytes. |
TRUE | SHA-256 data digest succeeded. | |
FALSE | SHA-256 data digest failed. |
BOOLEAN EFIAPI Sha384Duplicate | ( | IN CONST VOID * | Sha384Context, | |
OUT VOID * | NewSha384Context | |||
) |
Makes a copy of an existing SHA-384 context.
If Sha384Context is NULL, then return FALSE. If NewSha384Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in] | Sha384Context | Pointer to SHA-384 context being copied. |
[out] | NewSha384Context | Pointer to new SHA-384 context. |
TRUE | SHA-384 context copy succeeded. | |
FALSE | SHA-384 context copy failed. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI Sha384Final | ( | IN OUT VOID * | Sha384Context, | |
OUT UINT8 * | HashValue | |||
) |
Completes computation of the SHA-384 digest value.
This function completes SHA-384 hash computation and retrieves the digest value into the specified memory. After this function has been called, the SHA-384 context cannot be used again. SHA-384 context should be already correctly intialized by Sha384Init(), and should not be finalized by Sha384Final(). Behavior with invalid SHA-384 context is undefined.
If Sha384Context is NULL, then return FALSE. If HashValue is NULL, then return FALSE.
[in,out] | Sha384Context | Pointer to the SHA-384 context. |
[out] | HashValue | Pointer to a buffer that receives the SHA-384 digest value (48 bytes). |
TRUE | SHA-384 digest computation succeeded. | |
FALSE | SHA-384 digest computation failed. |
UINTN EFIAPI Sha384GetContextSize | ( | VOID | ) |
Retrieves the size, in bytes, of the context buffer required for SHA-384 hash operations.
BOOLEAN EFIAPI Sha384Init | ( | OUT VOID * | Sha384Context | ) |
Initializes user-supplied memory pointed by Sha384Context as SHA-384 hash context for subsequent use.
If Sha384Context is NULL, then return FALSE.
[out] | Sha384Context | Pointer to SHA-384 context being initialized. |
TRUE | SHA-384 context initialization succeeded. | |
FALSE | SHA-384 context initialization failed. |
BOOLEAN EFIAPI Sha384Update | ( | IN OUT VOID * | Sha384Context, | |
IN CONST VOID * | Data, | |||
IN UINTN | DataSize | |||
) |
Digests the input data and updates SHA-384 context.
This function performs SHA-384 digest on a data buffer of the specified size. It can be called multiple times to compute the digest of long or discontinuous data streams. SHA-384 context should be already correctly intialized by Sha384Init(), and should not be finalized by Sha384Final(). Behavior with invalid context is undefined.
If Sha384Context is NULL, then return FALSE.
[in,out] | Sha384Context | Pointer to the SHA-384 context. |
[in] | Data | Pointer to the buffer containing the data to be hashed. |
[in] | DataSize | Size of Data buffer in bytes. |
TRUE | SHA-384 data digest succeeded. | |
FALSE | SHA-384 data digest failed. |
BOOLEAN EFIAPI Sha512Duplicate | ( | IN CONST VOID * | Sha512Context, | |
OUT VOID * | NewSha512Context | |||
) |
Makes a copy of an existing SHA-512 context.
If Sha512Context is NULL, then return FALSE. If NewSha512Context is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in] | Sha512Context | Pointer to SHA-512 context being copied. |
[out] | NewSha512Context | Pointer to new SHA-512 context. |
TRUE | SHA-512 context copy succeeded. | |
FALSE | SHA-512 context copy failed. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI Sha512Final | ( | IN OUT VOID * | Sha512Context, | |
OUT UINT8 * | HashValue | |||
) |
Completes computation of the SHA-512 digest value.
This function completes SHA-512 hash computation and retrieves the digest value into the specified memory. After this function has been called, the SHA-512 context cannot be used again. SHA-512 context should be already correctly intialized by Sha512Init(), and should not be finalized by Sha512Final(). Behavior with invalid SHA-512 context is undefined.
If Sha512Context is NULL, then return FALSE. If HashValue is NULL, then return FALSE.
[in,out] | Sha512Context | Pointer to the SHA-512 context. |
[out] | HashValue | Pointer to a buffer that receives the SHA-512 digest value (64 bytes). |
TRUE | SHA-512 digest computation succeeded. | |
FALSE | SHA-512 digest computation failed. |
UINTN EFIAPI Sha512GetContextSize | ( | VOID | ) |
Retrieves the size, in bytes, of the context buffer required for SHA-512 hash operations.
BOOLEAN EFIAPI Sha512Init | ( | OUT VOID * | Sha512Context | ) |
Initializes user-supplied memory pointed by Sha512Context as SHA-512 hash context for subsequent use.
If Sha512Context is NULL, then return FALSE.
[out] | Sha512Context | Pointer to SHA-512 context being initialized. |
TRUE | SHA-512 context initialization succeeded. | |
FALSE | SHA-512 context initialization failed. |
BOOLEAN EFIAPI Sha512Update | ( | IN OUT VOID * | Sha512Context, | |
IN CONST VOID * | Data, | |||
IN UINTN | DataSize | |||
) |
Digests the input data and updates SHA-512 context.
This function performs SHA-512 digest on a data buffer of the specified size. It can be called multiple times to compute the digest of long or discontinuous data streams. SHA-512 context should be already correctly intialized by Sha512Init(), and should not be finalized by Sha512Final(). Behavior with invalid context is undefined.
If Sha512Context is NULL, then return FALSE.
[in,out] | Sha512Context | Pointer to the SHA-512 context. |
[in] | Data | Pointer to the buffer containing the data to be hashed. |
[in] | DataSize | Size of Data buffer in bytes. |
TRUE | SHA-512 data digest succeeded. | |
FALSE | SHA-512 data digest failed. |
BOOLEAN EFIAPI TdesCbcDecrypt | ( | IN VOID * | TdesContext, | |
IN CONST UINT8 * | Input, | |||
IN UINTN | InputSize, | |||
IN CONST UINT8 * | Ivec, | |||
OUT UINT8 * | Output | |||
) |
Performs TDES decryption on a data buffer of the specified size in CBC mode.
This function performs TDES decryption on data buffer pointed by Input, of specified size of InputSize, in CBC mode. InputSize must be multiple of block size (8 bytes). This function does not perform padding. Caller must perform padding, if necessary, to ensure valid input data size. Initialization vector should be one block size (8 bytes). TdesContext should be already correctly initialized by TdesInit(). Behavior with invalid TDES context is undefined.
If TdesContext is NULL, then return FALSE. If Input is NULL, then return FALSE. If InputSize is not multiple of block size (8 bytes), then return FALSE. If Ivec is NULL, then return FALSE. If Output is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in] | TdesContext | Pointer to the TDES context. |
[in] | Input | Pointer to the buffer containing the data to be encrypted. |
[in] | InputSize | Size of the Input buffer in bytes. |
[in] | Ivec | Pointer to initialization vector. |
[out] | Output | Pointer to a buffer that receives the TDES encryption output. |
TRUE | TDES decryption succeeded. | |
FALSE | TDES decryption failed. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI TdesCbcEncrypt | ( | IN VOID * | TdesContext, | |
IN CONST UINT8 * | Input, | |||
IN UINTN | InputSize, | |||
IN CONST UINT8 * | Ivec, | |||
OUT UINT8 * | Output | |||
) |
Performs TDES encryption on a data buffer of the specified size in CBC mode.
This function performs TDES encryption on data buffer pointed by Input, of specified size of InputSize, in CBC mode. InputSize must be multiple of block size (8 bytes). This function does not perform padding. Caller must perform padding, if necessary, to ensure valid input data size. Initialization vector should be one block size (8 bytes). TdesContext should be already correctly initialized by TdesInit(). Behavior with invalid TDES context is undefined.
If TdesContext is NULL, then return FALSE. If Input is NULL, then return FALSE. If InputSize is not multiple of block size (8 bytes), then return FALSE. If Ivec is NULL, then return FALSE. If Output is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in] | TdesContext | Pointer to the TDES context. |
[in] | Input | Pointer to the buffer containing the data to be encrypted. |
[in] | InputSize | Size of the Input buffer in bytes. |
[in] | Ivec | Pointer to initialization vector. |
[out] | Output | Pointer to a buffer that receives the TDES encryption output. |
TRUE | TDES encryption succeeded. | |
FALSE | TDES encryption failed. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI TdesEcbDecrypt | ( | IN VOID * | TdesContext, | |
IN CONST UINT8 * | Input, | |||
IN UINTN | InputSize, | |||
OUT UINT8 * | Output | |||
) |
Performs TDES decryption on a data buffer of the specified size in ECB mode.
This function performs TDES decryption on data buffer pointed by Input, of specified size of InputSize, in ECB mode. InputSize must be multiple of block size (8 bytes). This function does not perform padding. Caller must perform padding, if necessary, to ensure valid input data size. TdesContext should be already correctly initialized by TdesInit(). Behavior with invalid TDES context is undefined.
If TdesContext is NULL, then return FALSE. If Input is NULL, then return FALSE. If InputSize is not multiple of block size (8 bytes), then return FALSE. If Output is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in] | TdesContext | Pointer to the TDES context. |
[in] | Input | Pointer to the buffer containing the data to be decrypted. |
[in] | InputSize | Size of the Input buffer in bytes. |
[out] | Output | Pointer to a buffer that receives the TDES decryption output. |
TRUE | TDES decryption succeeded. | |
FALSE | TDES decryption failed. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI TdesEcbEncrypt | ( | IN VOID * | TdesContext, | |
IN CONST UINT8 * | Input, | |||
IN UINTN | InputSize, | |||
OUT UINT8 * | Output | |||
) |
Performs TDES encryption on a data buffer of the specified size in ECB mode.
This function performs TDES encryption on data buffer pointed by Input, of specified size of InputSize, in ECB mode. InputSize must be multiple of block size (8 bytes). This function does not perform padding. Caller must perform padding, if necessary, to ensure valid input data size. TdesContext should be already correctly initialized by TdesInit(). Behavior with invalid TDES context is undefined.
If TdesContext is NULL, then return FALSE. If Input is NULL, then return FALSE. If InputSize is not multiple of block size (8 bytes), then return FALSE. If Output is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in] | TdesContext | Pointer to the TDES context. |
[in] | Input | Pointer to the buffer containing the data to be encrypted. |
[in] | InputSize | Size of the Input buffer in bytes. |
[out] | Output | Pointer to a buffer that receives the TDES encryption output. |
TRUE | TDES encryption succeeded. | |
FALSE | TDES encryption failed. | |
FALSE | This interface is not supported. |
UINTN EFIAPI TdesGetContextSize | ( | VOID | ) |
Retrieves the size, in bytes, of the context buffer required for TDES operations.
If this interface is not supported, then return zero.
0 | This interface is not supported. |
BOOLEAN EFIAPI TdesInit | ( | OUT VOID * | TdesContext, | |
IN CONST UINT8 * | Key, | |||
IN UINTN | KeyLength | |||
) |
Initializes user-supplied memory as TDES context for subsequent use.
This function initializes user-supplied memory pointed by TdesContext as TDES context. In addition, it sets up all TDES key materials for subsequent encryption and decryption operations. There are 3 key options as follows: KeyLength = 64, Keying option 1: K1 == K2 == K3 (Backward compatibility with DES) KeyLength = 128, Keying option 2: K1 != K2 and K3 = K1 (Less Security) KeyLength = 192 Keying option 3: K1 != K2 != K3 (Strongest)
If TdesContext is NULL, then return FALSE. If Key is NULL, then return FALSE. If KeyLength is not valid, then return FALSE. If this interface is not supported, then return FALSE.
[out] | TdesContext | Pointer to TDES context being initialized. |
[in] | Key | Pointer to the user-supplied TDES key. |
[in] | KeyLength | Length of TDES key in bits. |
TRUE | TDES context initialization succeeded. | |
FALSE | TDES context initialization failed. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI X509ConstructCertificate | ( | IN CONST UINT8 * | Cert, | |
IN UINTN | CertSize, | |||
OUT UINT8 ** | SingleX509Cert | |||
) |
Construct a X509 object from DER-encoded certificate data.
If Cert is NULL, then return FALSE. If SingleX509Cert is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in] | Cert | Pointer to the DER-encoded certificate data. |
[in] | CertSize | The size of certificate data in bytes. |
[out] | SingleX509Cert | The generated X509 object. |
TRUE | The X509 object generation succeeded. | |
FALSE | The operation failed. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI X509ConstructCertificateStack | ( | IN OUT UINT8 ** | X509Stack, | |
... | ||||
) |
Construct a X509 stack object from a list of DER-encoded certificate data.
If X509Stack is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in,out] | X509Stack | On input, pointer to an existing or NULL X509 stack object. On output, pointer to the X509 stack object with new inserted X509 certificate. |
... | A list of DER-encoded single certificate data followed by certificate size. A NULL terminates the list. The pairs are the arguments to X509ConstructCertificate(). |
TRUE | The X509 stack construction succeeded. | |
FALSE | The construction operation failed. | |
FALSE | This interface is not supported. |
VOID EFIAPI X509Free | ( | IN VOID * | X509Cert | ) |
Release the specified X509 object.
If the interface is not supported, then ASSERT().
[in] | X509Cert | Pointer to the X509 object to be released. |
BOOLEAN EFIAPI X509GetSubjectName | ( | IN CONST UINT8 * | Cert, | |
IN UINTN | CertSize, | |||
OUT UINT8 * | CertSubject, | |||
IN OUT UINTN * | SubjectSize | |||
) |
Retrieve the subject bytes from one X.509 certificate.
If Cert is NULL, then return FALSE. If SubjectSize is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in] | Cert | Pointer to the DER-encoded X509 certificate. |
[in] | CertSize | Size of the X509 certificate in bytes. |
[out] | CertSubject | Pointer to the retrieved certificate subject bytes. |
[in,out] | SubjectSize | The size in bytes of the CertSubject buffer on input, and the size of buffer returned CertSubject on output. |
TRUE | The certificate subject retrieved successfully. | |
FALSE | Invalid certificate, or the SubjectSize is too small for the result. The SubjectSize will be updated with the required size. | |
FALSE | This interface is not supported. |
BOOLEAN EFIAPI X509GetTBSCert | ( | IN CONST UINT8 * | Cert, | |
IN UINTN | CertSize, | |||
OUT UINT8 ** | TBSCert, | |||
OUT UINTN * | TBSCertSize | |||
) |
Retrieve the TBSCertificate from one given X.509 certificate.
[in] | Cert | Pointer to the given DER-encoded X509 certificate. |
[in] | CertSize | Size of the X509 certificate in bytes. |
[out] | TBSCert | DER-Encoded To-Be-Signed certificate. |
[out] | TBSCertSize | Size of the TBS certificate in bytes. |
TRUE | The TBSCertificate was retrieved successfully. | |
FALSE | Invalid X.509 certificate. |
VOID EFIAPI X509StackFree | ( | IN VOID * | X509Stack | ) |
Release the specified X509 stack object.
If the interface is not supported, then ASSERT().
[in] | X509Stack | Pointer to the X509 stack object to be released. |
BOOLEAN EFIAPI X509VerifyCert | ( | IN CONST UINT8 * | Cert, | |
IN UINTN | CertSize, | |||
IN CONST UINT8 * | CACert, | |||
IN UINTN | CACertSize | |||
) |
Verify one X509 certificate was issued by the trusted CA.
If Cert is NULL, then return FALSE. If CACert is NULL, then return FALSE. If this interface is not supported, then return FALSE.
[in] | Cert | Pointer to the DER-encoded X509 certificate to be verified. |
[in] | CertSize | Size of the X509 certificate in bytes. |
[in] | CACert | Pointer to the DER-encoded trusted CA certificate. |
[in] | CACertSize | Size of the CA Certificate in bytes. |
TRUE | The certificate was issued by the trusted CA. | |
FALSE | Invalid certificate or the certificate was not issued by the given trusted CA. | |
FALSE | This interface is not supported. |