2 Diffie-Hellman Wrapper Implementation which does not provide
5 Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #include "InternalCryptLib.h"
13 Allocates and Initializes one Diffie-Hellman Context for subsequent use.
15 @return Pointer to the Diffie-Hellman Context that has been initialized.
16 If the interface is not supported, DhNew() returns NULL.
30 Release the specified DH context.
32 If the interface is not supported, then ASSERT().
34 @param[in] DhContext Pointer to the DH context to be released.
47 Generates DH parameter.
49 Return FALSE to indicate this interface is not supported.
51 @param[in, out] DhContext Pointer to the DH context.
52 @param[in] Generator Value of generator.
53 @param[in] PrimeLength Length in bits of prime to be generated.
54 @param[out] Prime Pointer to the buffer to receive the generated prime number.
56 @retval FALSE This interface is not supported.
62 IN OUT VOID
*DhContext
,
73 Sets generator and prime parameters for DH.
75 Return FALSE to indicate this interface is not supported.
77 @param[in, out] DhContext Pointer to the DH context.
78 @param[in] Generator Value of generator.
79 @param[in] PrimeLength Length in bits of prime to be generated.
80 @param[in] Prime Pointer to the prime number.
82 @retval FALSE This interface is not supported.
88 IN OUT VOID
*DhContext
,
99 Generates DH public key.
101 Return FALSE to indicate this interface is not supported.
103 @param[in, out] DhContext Pointer to the DH context.
104 @param[out] PublicKey Pointer to the buffer to receive generated public key.
105 @param[in, out] PublicKeySize On input, the size of PublicKey buffer in bytes.
106 On output, the size of data returned in PublicKey buffer in bytes.
108 @retval FALSE This interface is not supported.
114 IN OUT VOID
*DhContext
,
115 OUT UINT8
*PublicKey
,
116 IN OUT UINTN
*PublicKeySize
124 Computes exchanged common key.
126 Return FALSE to indicate this interface is not supported.
128 @param[in, out] DhContext Pointer to the DH context.
129 @param[in] PeerPublicKey Pointer to the peer's public key.
130 @param[in] PeerPublicKeySize Size of peer's public key in bytes.
131 @param[out] Key Pointer to the buffer to receive generated key.
132 @param[in, out] KeySize On input, the size of Key buffer in bytes.
133 On output, the size of data returned in Key buffer in bytes.
135 @retval FALSE This interface is not supported.
141 IN OUT VOID
*DhContext
,
142 IN CONST UINT8
*PeerPublicKey
,
143 IN UINTN PeerPublicKeySize
,
145 IN OUT UINTN
*KeySize