| 1 |
/** @file |
| 2 |
HMAC-SHA256 Wrapper Implementation which does not provide real capabilities. |
| 3 |
|
| 4 |
Copyright (c) 2016, Intel Corporation. All rights reserved.<BR> |
| 5 |
This program and the accompanying materials |
| 6 |
are licensed and made available under the terms and conditions of the BSD License |
| 7 |
which accompanies this distribution. The full text of the license may be found at |
| 8 |
http://opensource.org/licenses/bsd-license.php |
| 9 |
|
| 10 |
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, |
| 11 |
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. |
| 12 |
|
| 13 |
**/ |
| 14 |
|
| 15 |
#include "InternalCryptLib.h" |
| 16 |
|
| 17 |
/** |
| 18 |
Retrieves the size, in bytes, of the context buffer required for HMAC-SHA256 operations. |
| 19 |
|
| 20 |
Return zero to indicate this interface is not supported. |
| 21 |
|
| 22 |
@retval 0 This interface is not supported. |
| 23 |
|
| 24 |
**/ |
| 25 |
UINTN |
| 26 |
EFIAPI |
| 27 |
HmacSha256GetContextSize ( |
| 28 |
VOID |
| 29 |
) |
| 30 |
{ |
| 31 |
ASSERT (FALSE); |
| 32 |
return 0; |
| 33 |
} |
| 34 |
|
| 35 |
/** |
| 36 |
Initializes user-supplied memory pointed by HmacSha256Context as HMAC-SHA256 context for |
| 37 |
subsequent use. |
| 38 |
|
| 39 |
Return FALSE to indicate this interface is not supported. |
| 40 |
|
| 41 |
@param[out] HmacSha256Context Pointer to HMAC-SHA256 context being initialized. |
| 42 |
@param[in] Key Pointer to the user-supplied key. |
| 43 |
@param[in] KeySize Key size in bytes. |
| 44 |
|
| 45 |
@retval FALSE This interface is not supported. |
| 46 |
|
| 47 |
**/ |
| 48 |
BOOLEAN |
| 49 |
EFIAPI |
| 50 |
HmacSha256Init ( |
| 51 |
OUT VOID *HmacSha256Context, |
| 52 |
IN CONST UINT8 *Key, |
| 53 |
IN UINTN KeySize |
| 54 |
) |
| 55 |
{ |
| 56 |
ASSERT (FALSE); |
| 57 |
return FALSE; |
| 58 |
} |
| 59 |
|
| 60 |
/** |
| 61 |
Makes a copy of an existing HMAC-SHA256 context. |
| 62 |
|
| 63 |
Return FALSE to indicate this interface is not supported. |
| 64 |
|
| 65 |
@param[in] HmacSha256Context Pointer to HMAC-SHA256 context being copied. |
| 66 |
@param[out] NewHmacSha256Context Pointer to new HMAC-SHA256 context. |
| 67 |
|
| 68 |
@retval FALSE This interface is not supported. |
| 69 |
|
| 70 |
**/ |
| 71 |
BOOLEAN |
| 72 |
EFIAPI |
| 73 |
HmacSha256Duplicate ( |
| 74 |
IN CONST VOID *HmacSha256Context, |
| 75 |
OUT VOID *NewHmacSha256Context |
| 76 |
) |
| 77 |
{ |
| 78 |
ASSERT (FALSE); |
| 79 |
return FALSE; |
| 80 |
} |
| 81 |
|
| 82 |
/** |
| 83 |
Digests the input data and updates HMAC-SHA256 context. |
| 84 |
|
| 85 |
Return FALSE to indicate this interface is not supported. |
| 86 |
|
| 87 |
@param[in, out] HmacSha256Context Pointer to the HMAC-SHA256 context. |
| 88 |
@param[in] Data Pointer to the buffer containing the data to be digested. |
| 89 |
@param[in] DataSize Size of Data buffer in bytes. |
| 90 |
|
| 91 |
@retval FALSE This interface is not supported. |
| 92 |
|
| 93 |
**/ |
| 94 |
BOOLEAN |
| 95 |
EFIAPI |
| 96 |
HmacSha256Update ( |
| 97 |
IN OUT VOID *HmacSha256Context, |
| 98 |
IN CONST VOID *Data, |
| 99 |
IN UINTN DataSize |
| 100 |
) |
| 101 |
{ |
| 102 |
ASSERT (FALSE); |
| 103 |
return FALSE; |
| 104 |
} |
| 105 |
|
| 106 |
/** |
| 107 |
Completes computation of the HMAC-SHA256 digest value. |
| 108 |
|
| 109 |
Return FALSE to indicate this interface is not supported. |
| 110 |
|
| 111 |
@param[in, out] HmacSha256Context Pointer to the HMAC-SHA256 context. |
| 112 |
@param[out] HmacValue Pointer to a buffer that receives the HMAC-SHA256 digest |
| 113 |
value (32 bytes). |
| 114 |
|
| 115 |
@retval FALSE This interface is not supported. |
| 116 |
|
| 117 |
**/ |
| 118 |
BOOLEAN |
| 119 |
EFIAPI |
| 120 |
HmacSha256Final ( |
| 121 |
IN OUT VOID *HmacSha256Context, |
| 122 |
OUT UINT8 *HmacValue |
| 123 |
) |
| 124 |
{ |
| 125 |
ASSERT (FALSE); |
| 126 |
return FALSE; |
| 127 |
} |