https://bugzilla.tianocore.org/show_bug.cgi?id=2257 Add a Null instance of the BaseCryptLib class. This lib instance can be used as a template for new implementations of the BaseCryptLib class and can also be used to reduce CI build times for build checks that depend on the BaseCryptLib class. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Xiaoyu Lu <xiaoyux.lu@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
		
			
				
	
	
		
			49 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			49 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
/** @file
 | 
						|
  PBKDF2 Key Derivation Function Wrapper Implementation which does not provide real
 | 
						|
  capabilities.
 | 
						|
 | 
						|
Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
 | 
						|
SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
						|
 | 
						|
**/
 | 
						|
 | 
						|
#include "InternalCryptLib.h"
 | 
						|
 | 
						|
/**
 | 
						|
  Derives a key from a password using a salt and iteration count, based on PKCS#5 v2.0
 | 
						|
  password based encryption key derivation function PBKDF2, as specified in RFC 2898.
 | 
						|
 | 
						|
  Return FALSE to indicate this interface is not supported.
 | 
						|
 | 
						|
  @param[in]  PasswordLength  Length of input password in bytes.
 | 
						|
  @param[in]  Password        Pointer to the array for the password.
 | 
						|
  @param[in]  SaltLength      Size of the Salt in bytes.
 | 
						|
  @param[in]  Salt            Pointer to the Salt.
 | 
						|
  @param[in]  IterationCount  Number of iterations to perform. Its value should be
 | 
						|
                              greater than or equal to 1.
 | 
						|
  @param[in]  DigestSize      Size of the message digest to be used (eg. SHA256_DIGEST_SIZE).
 | 
						|
                              NOTE: DigestSize will be used to determine the hash algorithm.
 | 
						|
                                    Only SHA1_DIGEST_SIZE or SHA256_DIGEST_SIZE is supported.
 | 
						|
  @param[in]  KeyLength       Size of the derived key buffer in bytes.
 | 
						|
  @param[out] OutKey          Pointer to the output derived key buffer.
 | 
						|
 | 
						|
  @retval  FALSE  This interface is not supported.
 | 
						|
 | 
						|
**/
 | 
						|
BOOLEAN
 | 
						|
EFIAPI
 | 
						|
Pkcs5HashPassword (
 | 
						|
  IN  UINTN        PasswordLength,
 | 
						|
  IN  CONST CHAR8  *Password,
 | 
						|
  IN  UINTN        SaltLength,
 | 
						|
  IN  CONST UINT8  *Salt,
 | 
						|
  IN  UINTN        IterationCount,
 | 
						|
  IN  UINTN        DigestSize,
 | 
						|
  IN  UINTN        KeyLength,
 | 
						|
  OUT UINT8        *OutKey
 | 
						|
  )
 | 
						|
{
 | 
						|
  ASSERT (FALSE);
 | 
						|
  return FALSE;
 | 
						|
}
 |