CryptoPkg/Include/Protocol/RuntimeCrypt.h File Reference


Data Structures

struct  EFI_RUNTIME_CRYPT_PROTOCOL

Defines

#define EFI_RUNTIME_CRYPT_PROTOCOL_GUID

Typedefs

typedef IN CONST VOID * Data
typedef IN CONST VOID IN UINTN DataLength
typedef OUT UINT8 * HashValue
typedef VOID *EFIAPI * EFI_RUNTIME_CRYPT_RSA_NEW (VOID)
typedef IN RSA_KEY_TAG KeyTag
typedef IN RSA_KEY_TAG IN
CONST UINT8 * 
BigNumber
typedef IN RSA_KEY_TAG IN
CONST UINT8 IN UINTN 
BnLength
typedef IN CONST UINT8 * MessageHash
typedef IN CONST UINT8 IN UINTN HashLength
typedef IN CONST UINT8 IN
UINTN IN CONST UINT8 * 
Signature
typedef IN CONST UINT8 IN
UINTN IN CONST UINT8 IN UINTN 
SigLength

Functions

typedef UINTN (EFIAPI *EFI_RUNTIME_CRYPT_SHA256_GET_CONTEXT_SIZE)(VOID)
typedef BOOLEAN (EFIAPI *EFI_RUNTIME_CRYPT_SHA256_INIT)(IN OUT VOID *Sha256Context)
typedef VOID (EFIAPI *EFI_RUNTIME_CRYPT_RSA_FREE)(IN VOID *RsaContext)

Variables

EFI_GUID gEfiRuntimeCryptProtocolGuid

Detailed Description

The runtime cryptographic protocol. Only limited crypto primitives (SHA-256 and RSA) are provided for runtime authenticated variable service.

Copyright (c) 2010 - 2012, 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 Documentation

#define EFI_RUNTIME_CRYPT_PROTOCOL_GUID

Value:

{ \
    0xe1475e0c, 0x1746, 0x4802, { 0x86, 0x2e, 0x1, 0x1c, 0x2c, 0x2d, 0x9d, 0x86 } \
  }
Runtime Cryptographic Protocol GUID.


Typedef Documentation

typedef IN RSA_KEY_TAG IN CONST UINT8* BigNumber

typedef IN RSA_KEY_TAG IN CONST UINT8 IN UINTN BnLength

typedef IN CONST VOID* Data

typedef IN CONST VOID IN UINTN DataLength

typedef VOID* EFIAPI* EFI_RUNTIME_CRYPT_RSA_NEW(VOID)

Allocates and Initializes one RSA Context for subsequent use.

Returns:
Pointer to the RSA Context that has been initialized. If the allocations fails, RsaNew() returns NULL.

typedef IN CONST UINT8 IN UINTN HashLength

typedef OUT UINT8* HashValue

typedef IN RSA_KEY_TAG KeyTag

typedef IN CONST UINT8* MessageHash

typedef IN CONST UINT8 IN UINTN IN CONST UINT8 IN UINTN SigLength

typedef IN CONST UINT8 IN UINTN IN CONST UINT8* Signature


Function Documentation

typedef BOOLEAN ( EFIAPI *  EFI_RUNTIME_CRYPT_RSA_PKCS1_VERIFY  ) 

Initializes user-supplied memory pointed by Sha256Context as SHA-256 hash context for subsequent use.

If Sha256Context is NULL, then return FALSE.

Parameters:
[in,out] Sha256Context Pointer to SHA-256 Context being initialized.
Return values:
TRUE SHA-256 context initialization succeeded.
FALSE SHA-256 context initialization failed.
Performs SHA-256 digest on a data buffer of the specified length. This function can be called multiple times to compute the digest of long or discontinuous data streams.

If Sha256Context is NULL, then return FALSE.

Parameters:
[in,out] Sha256Context Pointer to the SHA-256 context.
[in] Data Pointer to the buffer containing the data to be hashed.
[in] DataLength Length of Data buffer in bytes.
Return values:
TRUE SHA-256 data digest succeeded.
FALSE Invalid SHA-256 context. After Sha256Final function has been called, the SHA-256 context cannot be reused.
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.

If Sha256Context is NULL, then return FALSE. If HashValue is NULL, then return FALSE.

Parameters:
[in,out] Sha256Context Pointer to SHA-256 context
[out] HashValue Pointer to a buffer that receives the SHA-256 digest value (32 bytes).
Return values:
TRUE SHA-256 digest computation succeeded.
FALSE SHA-256 digest computation failed.
Sets the tag-designated RSA key component into the established RSA context from the user-specified nonnegative integer (octet string format represented in RSA PKCS#1).

If RsaContext is NULL, then return FALSE.

Parameters:
[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.
[in] BnLength Length of big number buffer in bytes.
Returns:
TRUE RSA key component was set successfully.

FALSE Invalid RSA key component tag.

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 HashLength is not equal to the size of MD5, SHA-1 or SHA-256 digest, then return FALSE.

Parameters:
[in] RsaContext Pointer to RSA context for signature verification.
[in] MessageHash Pointer to octet message hash to be checked.
[in] HashLength Length of the message hash in bytes.
[in] Signature Pointer to RSA PKCS1-v1_5 signature to be verified.
[in] SigLength Length of signature in bytes.
Returns:
TRUE Valid signature encoded in PKCS1-v1_5.

FALSE Invalid signature or invalid RSA context.

typedef UINTN ( EFIAPI *  EFI_RUNTIME_CRYPT_SHA256_GET_CONTEXT_SIZE  ) 

Retrieves the size, in bytes, of the context buffer required for SHA-256 operations.

Returns:
The size, in bytes, of the context buffer required for SHA-256 operations.

typedef VOID ( EFIAPI *  EFI_RUNTIME_CRYPT_RSA_FREE  ) 

Release the specified RSA Context.

Parameters:
[in] RsaContext Pointer to the RSA context to be released.


Variable Documentation


Generated on Wed Sep 2 14:03:42 2015 for CryptoPkg[ALL] by  doxygen 1.5.7.1