Home | History | Annotate | Download | only in Hash
      1 /** @file
      2   SHA-1 Digest Wrapper Implementation which does not provide real capabilities.
      3 
      4 Copyright (c) 2012, 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 /**
     19   Retrieves the size, in bytes, of the context buffer required for SHA-1 hash operations.
     20 
     21   Return zero to indicate this interface is not supported.
     22 
     23   @return  The size, in bytes, of the context buffer required for SHA-1 hash operations.
     24   @retval  0   This interface is not supported.
     25 
     26 **/
     27 UINTN
     28 EFIAPI
     29 Sha1GetContextSize (
     30   VOID
     31   )
     32 {
     33   ASSERT (FALSE);
     34   return 0;
     35 }
     36 
     37 /**
     38   Initializes user-supplied memory pointed by Sha1Context as SHA-1 hash context for
     39   subsequent use.
     40 
     41   Return FALSE to indicate this interface is not supported.
     42 
     43   @param[out]  Sha1Context  Pointer to SHA-1 context being initialized.
     44 
     45   @retval FALSE  This interface is not supported.
     46 
     47 **/
     48 BOOLEAN
     49 EFIAPI
     50 Sha1Init (
     51   OUT  VOID  *Sha1Context
     52   )
     53 {
     54   ASSERT (FALSE);
     55   return FALSE;
     56 }
     57 
     58 /**
     59   Makes a copy of an existing SHA-1 context.
     60 
     61   Return FALSE to indicate this interface is not supported.
     62 
     63   @param[in]  Sha1Context     Pointer to SHA-1 context being copied.
     64   @param[out] NewSha1Context  Pointer to new SHA-1 context.
     65 
     66   @retval FALSE  This interface is not supported.
     67 
     68 **/
     69 BOOLEAN
     70 EFIAPI
     71 Sha1Duplicate (
     72   IN   CONST VOID  *Sha1Context,
     73   OUT  VOID        *NewSha1Context
     74   )
     75 {
     76   ASSERT (FALSE);
     77   return FALSE;
     78 }
     79 
     80 /**
     81   Digests the input data and updates SHA-1 context.
     82 
     83   Return FALSE to indicate this interface is not supported.
     84 
     85   @param[in, out]  Sha1Context  Pointer to the SHA-1 context.
     86   @param[in]       Data         Pointer to the buffer containing the data to be hashed.
     87   @param[in]       DataSize     Size of Data buffer in bytes.
     88 
     89   @retval FALSE  This interface is not supported.
     90 
     91 **/
     92 BOOLEAN
     93 EFIAPI
     94 Sha1Update (
     95   IN OUT  VOID        *Sha1Context,
     96   IN      CONST VOID  *Data,
     97   IN      UINTN       DataSize
     98   )
     99 {
    100   ASSERT (FALSE);
    101   return FALSE;
    102 }
    103 
    104 /**
    105   Completes computation of the SHA-1 digest value.
    106 
    107   Return FALSE to indicate this interface is not supported.
    108 
    109   @param[in, out]  Sha1Context  Pointer to the SHA-1 context.
    110   @param[out]      HashValue    Pointer to a buffer that receives the SHA-1 digest
    111                                 value (20 bytes).
    112 
    113   @retval FALSE  This interface is not supported.
    114 
    115 **/
    116 BOOLEAN
    117 EFIAPI
    118 Sha1Final (
    119   IN OUT  VOID   *Sha1Context,
    120   OUT     UINT8  *HashValue
    121   )
    122 {
    123   ASSERT (FALSE);
    124   return FALSE;
    125 }
    126