OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
PasswordHash.c File Reference
#include "CryptoInternal.h"

Go to the source code of this file.

Functions

VOID OcHashPasswordSha512 (IN CONST UINT8 *Password, IN UINT32 PasswordSize, IN CONST UINT8 *Salt, IN UINT32 SaltSize, OUT UINT8 *Hash)
 
BOOLEAN OcVerifyPasswordSha512 (IN CONST UINT8 *Password, IN UINT32 PasswordSize, IN CONST UINT8 *Salt, IN UINT32 SaltSize, IN CONST UINT8 *RefHash)
 

Detailed Description

Copyright (C) 2019, Download-Fritz. All rights reserved.

This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

Definition in file PasswordHash.c.

Function Documentation

◆ OcHashPasswordSha512()

VOID OcHashPasswordSha512 ( IN CONST UINT8 * Password,
IN UINT32 PasswordSize,
IN CONST UINT8 * Salt,
IN UINT32 SaltSize,
OUT UINT8 * Hash )

Hash Password and Salt into a PasswordHash. The used hash function is SHA-512, thus the caller must ensure RefHash is at least 64 bytes in size.

Parameters
[in]PasswordThe entered password to hash.
[in]PasswordSizeThe size, in bytes, of Password.
[in]SaltThe cryptographic salt appended to Password on hash.
[in]SaltSizeThe size, in bytes, of Salt.
[in]HashThe SHA-512 hash of Password and Salt.

Definition at line 17 of file PasswordHash.c.

◆ OcVerifyPasswordSha512()

BOOLEAN OcVerifyPasswordSha512 ( IN CONST UINT8 * Password,
IN UINT32 PasswordSize,
IN CONST UINT8 * Salt,
IN UINT32 SaltSize,
IN CONST UINT8 * RefHash )

Verify Password and Salt against RefHash. The used hash function is SHA-512, thus the caller must ensure RefHash is at least 64 bytes in size.

Parameters
[in]PasswordThe entered password to verify.
[in]PasswordSizeThe size, in bytes, of Password.
[in]SaltThe cryptographic salt appended to Password on hash.
[in]SaltSizeThe size, in bytes, of Salt.
[in]RefHashThe SHA-512 hash of the reference password and Salt.
Returns
Whether Password and Salt cryptographically match RefHash.

Definition at line 69 of file PasswordHash.c.