TianoCore EDK2 master
Loading...
Searching...
No Matches
CryptDhNull.c File Reference
#include "InternalCryptLib.h"

Go to the source code of this file.

Functions

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)
 

Detailed Description

Diffie-Hellman Wrapper Implementation which does not provide real capabilities.

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

Definition in file CryptDhNull.c.

Function Documentation

◆ DhComputeKey()

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.

Return FALSE to indicate this interface is not supported.

Parameters
[in,out]DhContextPointer to the DH context.
[in]PeerPublicKeyPointer to the peer's public key.
[in]PeerPublicKeySizeSize of peer's public key in bytes.
[out]KeyPointer to the buffer to receive generated key.
[in,out]KeySizeOn input, the size of Key buffer in bytes. On output, the size of data returned in Key buffer in bytes.
Return values
FALSEThis interface is not supported.

Definition at line 140 of file CryptDhNull.c.

◆ DhFree()

VOID EFIAPI DhFree ( IN VOID *  DhContext)

Release the specified DH context.

If the interface is not supported, then ASSERT().

Parameters
[in]DhContextPointer to the DH context to be released.

Definition at line 39 of file CryptDhNull.c.

◆ DhGenerateKey()

BOOLEAN EFIAPI DhGenerateKey ( IN OUT VOID *  DhContext,
OUT UINT8 *  PublicKey,
IN OUT UINTN PublicKeySize 
)

Generates DH public key.

Return FALSE to indicate this interface is not supported.

Parameters
[in,out]DhContextPointer to the DH context.
[out]PublicKeyPointer to the buffer to receive generated public key.
[in,out]PublicKeySizeOn input, the size of PublicKey buffer in bytes. On output, the size of data returned in PublicKey buffer in bytes.
Return values
FALSEThis interface is not supported.

Definition at line 113 of file CryptDhNull.c.

◆ DhGenerateParameter()

BOOLEAN EFIAPI DhGenerateParameter ( IN OUT VOID *  DhContext,
IN UINTN  Generator,
IN UINTN  PrimeLength,
OUT UINT8 *  Prime 
)

Generates DH parameter.

Return FALSE to indicate this interface is not supported.

Parameters
[in,out]DhContextPointer to the DH context.
[in]GeneratorValue of generator.
[in]PrimeLengthLength in bits of prime to be generated.
[out]PrimePointer to the buffer to receive the generated prime number.
Return values
FALSEThis interface is not supported.

Definition at line 61 of file CryptDhNull.c.

◆ DhNew()

VOID *EFIAPI DhNew ( VOID  )

Allocates and Initializes one Diffie-Hellman Context for subsequent use.

Returns
Pointer to the Diffie-Hellman Context that has been initialized. If the interface is not supported, DhNew() returns NULL.

Definition at line 21 of file CryptDhNull.c.

◆ DhSetParameter()

BOOLEAN EFIAPI DhSetParameter ( IN OUT VOID *  DhContext,
IN UINTN  Generator,
IN UINTN  PrimeLength,
IN CONST UINT8 *  Prime 
)

Sets generator and prime parameters for DH.

Return FALSE to indicate this interface is not supported.

Parameters
[in,out]DhContextPointer to the DH context.
[in]GeneratorValue of generator.
[in]PrimeLengthLength in bits of prime to be generated.
[in]PrimePointer to the prime number.
Return values
FALSEThis interface is not supported.

Definition at line 87 of file CryptDhNull.c.