Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
FSHA1 Class Reference

#include <SecureHash.h>

+ Collaboration diagram for FSHA1:

Public Types

enum  { DigestSize =20 }
 

Public Member Functions

 FSHA1 ()
 
 ~FSHA1 ()
 
void Reset ()
 
void Update (const uint8 *data, uint64 len)
 
void UpdateWithString (const TCHAR *data, uint32 len)
 
void Final ()
 
FSHAHash Finalize ()
 
void GetHash (uint8 *puDest)
 

Static Public Member Functions

static void HashBuffer (const void *Data, uint64 DataSize, uint8 *OutHash)
 
static FSHAHash HashBuffer (const void *Data, uint64 DataSize)
 
static void HMACBuffer (const void *Key, uint32 KeySize, const void *Data, uint64 DataSize, uint8 *OutHash)
 
static void InitializeFileHashesFromBuffer (uint8 *Buffer, uint64 BufferSize, bool bDuplicateKeyMemory=false)
 
static bool GetFileSHAHash (const TCHAR *Pathname, uint8 Hash[20], bool bIsFullPackageHash=true)
 

Public Attributes

uint32 m_state [5]
 
uint64 m_count
 
uint32 __reserved1 [1]
 
uint8 m_buffer [64]
 
uint8 m_digest [20]
 
uint32 __reserved2 [3]
 

Private Member Functions

void Transform (const uint8 *buffer, uint64 len)
 

Static Private Attributes

static TMap< FString, uint8 * > FullFileSHAHashMap
 
static TMap< FString, uint8 * > ScriptSHAHashMap
 

Detailed Description

Definition at line 308 of file SecureHash.h.

Member Enumeration Documentation

◆ anonymous enum

Enumerator
DigestSize 

Definition at line 312 of file SecureHash.h.

Constructor & Destructor Documentation

◆ FSHA1()

FSHA1::FSHA1 ( )

◆ ~FSHA1()

FSHA1::~FSHA1 ( )

Member Function Documentation

◆ Final()

void FSHA1::Final ( )
+ Here is the caller graph for this function:

◆ Finalize()

FSHAHash FSHA1::Finalize ( )
inline

Definition at line 336 of file SecureHash.h.

+ Here is the call graph for this function:

◆ GetFileSHAHash()

static bool FSHA1::GetFileSHAHash ( const TCHAR * Pathname,
uint8 Hash[20],
bool bIsFullPackageHash = true )
static

Gets the stored SHA hash from the platform, if it exists. This function must be able to be called from any thread.

Parameters
PathnamePathname to the file to get the SHA for
Hash20 byte array that receives the hash
bIsFullPackageHashtrue if we are looking for a full package hash, instead of a script code only hash
Returns
true if the hash was found, false otherwise

◆ GetHash()

void FSHA1::GetHash ( uint8 * puDest)
+ Here is the caller graph for this function:

◆ HashBuffer() [1/2]

static FSHAHash FSHA1::HashBuffer ( const void * Data,
uint64 DataSize )
inlinestatic

Calculate the hash on a single block and return it

Parameters
DataInput data to hash
DataSizeSize of the Data block
Returns
Resulting digest

Definition at line 363 of file SecureHash.h.

+ Here is the call graph for this function:

◆ HashBuffer() [2/2]

static void FSHA1::HashBuffer ( const void * Data,
uint64 DataSize,
uint8 * OutHash )
static

Calculate the hash on a single block and return it

Parameters
DataInput data to hash
DataSizeSize of the Data block
OutHashResulting hash value (20 byte buffer)
+ Here is the caller graph for this function:

◆ HMACBuffer()

static void FSHA1::HMACBuffer ( const void * Key,
uint32 KeySize,
const void * Data,
uint64 DataSize,
uint8 * OutHash )
static

Generate the HMAC (Hash-based Message Authentication Code) for a block of data. https://en.wikipedia.org/wiki/Hash-based_message_authentication_code

Parameters
KeyThe secret key to be used when generating the HMAC
KeySizeThe size of the key
DataInput data to hash
DataSizeSize of the Data block
OutHashResulting hash value (20 byte buffer)

◆ InitializeFileHashesFromBuffer()

static void FSHA1::InitializeFileHashesFromBuffer ( uint8 * Buffer,
uint64 BufferSize,
bool bDuplicateKeyMemory = false )
static

Shared hashes.sha reading code (each platform gets a buffer to the data, then passes it to this function for processing)

Parameters
BufferContents of hashes.sha (probably loaded from an a section in the executable)
BufferSizeSize of Buffer
bDuplicateKeyMemoryIf Buffer is not always loaded, pass true so that the 20 byte hashes are duplicated

◆ Reset()

void FSHA1::Reset ( )

◆ Transform()

void FSHA1::Transform ( const uint8 * buffer,
uint64 len )
private

◆ Update()

void FSHA1::Update ( const uint8 * data,
uint64 len )

◆ UpdateWithString()

void FSHA1::UpdateWithString ( const TCHAR * data,
uint32 len )

Member Data Documentation

◆ __reserved1

uint32 FSHA1::__reserved1[1]

Definition at line 319 of file SecureHash.h.

◆ __reserved2

uint32 FSHA1::__reserved2[3]

Definition at line 322 of file SecureHash.h.

◆ FullFileSHAHashMap

TMap<FString, uint8*> FSHA1::FullFileSHAHashMap
staticprivate

Global map of filename to hash value, filled out in InitializeFileHashesFromBuffer

Definition at line 409 of file SecureHash.h.

◆ m_buffer

uint8 FSHA1::m_buffer[64]

Definition at line 320 of file SecureHash.h.

◆ m_count

uint64 FSHA1::m_count

Definition at line 318 of file SecureHash.h.

◆ m_digest

uint8 FSHA1::m_digest[20]

Definition at line 321 of file SecureHash.h.

◆ m_state

uint32 FSHA1::m_state[5]

Definition at line 317 of file SecureHash.h.

◆ ScriptSHAHashMap

TMap<FString, uint8*> FSHA1::ScriptSHAHashMap
staticprivate

Global map of filename to hash value, but for script-only SHA hashes

Definition at line 412 of file SecureHash.h.


The documentation for this class was generated from the following file: