UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
SecureHash.cpp File Reference

Macros

#define UE_PLATFORM_SHA_FALLBACK   1
 
#define UE_PLATFORM_SHA_X86   0
 
#define UE_PLATFORM_SHA_ARMV8   0
 
#define MD5_F(x, y, z)   (((x) & (y)) | ((~x) & (z)))
 
#define MD5_G(x, y, z)   (((x) & (z)) | ((y) & (~z)))
 
#define MD5_H(x, y, z)   ((x) ^ (y) ^ (z))
 
#define MD5_I(x, y, z)   ((y) ^ ((x) | (~z)))
 
#define ROTLEFT(x, n)   (((x) << (n)) | ((x) >> (32-(n))))
 
#define MD5_FF(a, b, c, d, x, s, ac)
 
#define MD5_GG(a, b, c, d, x, s, ac)
 
#define MD5_HH(a, b, c, d, x, s, ac)
 
#define MD5_II(a, b, c, d, x, s, ac)
 
#define ROL32(_val32, _nBits)   (((_val32)<<(_nBits))|((_val32)>>(32-(_nBits))))
 
#define SHABLK0(i)   (block[i])
 
#define SHABLK(i)   (block[i&15] = ROL32(block[(i+13)&15] ^ block[(i+8)&15] ^ block[(i+2)&15] ^ block[i&15],1))
 
#define _R0(v, w, x, y, z, i)   { z+=((w&(x^y))^y)+SHABLK0(i)+0x5A827999+ROL32(v,5); w=ROL32(w,30); }
 
#define _R1(v, w, x, y, z, i)   { z+=((w&(x^y))^y)+SHABLK(i)+0x5A827999+ROL32(v,5); w=ROL32(w,30); }
 
#define _R2(v, w, x, y, z, i)   { z+=(w^x^y)+SHABLK(i)+0x6ED9EBA1+ROL32(v,5); w=ROL32(w,30); }
 
#define _R3(v, w, x, y, z, i)   { z+=(((w|x)&y)|(w&x))+SHABLK(i)+0x8F1BBCDC+ROL32(v,5); w=ROL32(w,30); }
 
#define _R4(v, w, x, y, z, i)   { z+=(w^x^y)+SHABLK(i)+0xCA62C1D6+ROL32(v,5); w=ROL32(w,30); }
 
#define SHA1_BLOCK_SIZE   64
 
#define DISABLE_AUTHENTICATION_FOR_DEV   1
 

Enumerations

enum  { _S11 =7 }
 
enum  { _S12 =12 }
 
enum  { _S13 =17 }
 
enum  { _S14 =22 }
 
enum  { _S21 =5 }
 
enum  { _S22 =9 }
 
enum  { _S23 =14 }
 
enum  { _S24 =20 }
 
enum  { _S31 =4 }
 
enum  { _S32 =11 }
 
enum  { _S33 =16 }
 
enum  { _S34 =23 }
 
enum  { _S41 =6 }
 
enum  { _S42 =10 }
 
enum  { _S43 =15 }
 
enum  { _S44 =21 }
 

Functions

 DEFINE_LOG_CATEGORY_STATIC (LogSecureHash, Log, All)
 
void appOnFailSHAVerification (const TCHAR *FailedPathname, bool bFailedDueToMissingHash)
 

Macro Definition Documentation

◆ _R0

#define _R0 (   v,
  w,
  x,
  y,
  z,
 
)    { z+=((w&(x^y))^y)+SHABLK0(i)+0x5A827999+ROL32(v,5); w=ROL32(w,30); }

◆ _R1

#define _R1 (   v,
  w,
  x,
  y,
  z,
 
)    { z+=((w&(x^y))^y)+SHABLK(i)+0x5A827999+ROL32(v,5); w=ROL32(w,30); }

◆ _R2

#define _R2 (   v,
  w,
  x,
  y,
  z,
 
)    { z+=(w^x^y)+SHABLK(i)+0x6ED9EBA1+ROL32(v,5); w=ROL32(w,30); }

◆ _R3

#define _R3 (   v,
  w,
  x,
  y,
  z,
 
)    { z+=(((w|x)&y)|(w&x))+SHABLK(i)+0x8F1BBCDC+ROL32(v,5); w=ROL32(w,30); }

◆ _R4

#define _R4 (   v,
  w,
  x,
  y,
  z,
 
)    { z+=(w^x^y)+SHABLK(i)+0xCA62C1D6+ROL32(v,5); w=ROL32(w,30); }

◆ DISABLE_AUTHENTICATION_FOR_DEV

#define DISABLE_AUTHENTICATION_FOR_DEV   1

Callback that is called if the asynchronous SHA verification fails This will be called from a pooled thread.

Parameters
FailedPathnamePathname of file that failed to verify
bFailedDueToMissingHashtrue if the reason for the failure was that the hash was missing, and that was set as being an error condition

◆ MD5_F

#define MD5_F (   x,
  y,
 
)    (((x) & (y)) | ((~x) & (z)))

◆ MD5_FF

#define MD5_FF (   a,
  b,
  c,
  d,
  x,
  s,
  ac 
)
Value:
{ \
(a) += MD5_F ((b), (c), (d)) + (x) + (uint32)(ac); \
(a) = ROTLEFT ((a), (s)); \
(a) += (b); \
}
#define ROTLEFT(x, n)
Definition SecureHash.cpp:90
#define MD5_F(x, y, z)
Definition SecureHash.cpp:82
uint32_t uint32
Definition binka_ue_file_header.h:6

◆ MD5_G

#define MD5_G (   x,
  y,
 
)    (((x) & (z)) | ((y) & (~z)))

◆ MD5_GG

#define MD5_GG (   a,
  b,
  c,
  d,
  x,
  s,
  ac 
)
Value:
{ \
(a) += MD5_G ((b), (c), (d)) + (x) + (uint32)(ac); \
(a) = ROTLEFT ((a), (s)); \
(a) += (b); \
}
#define MD5_G(x, y, z)
Definition SecureHash.cpp:83

◆ MD5_H

#define MD5_H (   x,
  y,
 
)    ((x) ^ (y) ^ (z))

◆ MD5_HH

#define MD5_HH (   a,
  b,
  c,
  d,
  x,
  s,
  ac 
)
Value:
{ \
(a) += MD5_H ((b), (c), (d)) + (x) + (uint32)(ac); \
(a) = ROTLEFT ((a), (s)); \
(a) += (b); \
}
#define MD5_H(x, y, z)
Definition SecureHash.cpp:84

◆ MD5_I

#define MD5_I (   x,
  y,
 
)    ((y) ^ ((x) | (~z)))

◆ MD5_II

#define MD5_II (   a,
  b,
  c,
  d,
  x,
  s,
  ac 
)
Value:
{ \
(a) += MD5_I ((b), (c), (d)) + (x) + (uint32)(ac); \
(a) = ROTLEFT ((a), (s)); \
(a) += (b); \
}
#define MD5_I(x, y, z)
Definition SecureHash.cpp:85

◆ ROL32

#define ROL32 (   _val32,
  _nBits 
)    (((_val32)<<(_nBits))|((_val32)>>(32-(_nBits))))

◆ ROTLEFT

#define ROTLEFT (   x,
 
)    (((x) << (n)) | ((x) >> (32-(n))))

◆ SHA1_BLOCK_SIZE

#define SHA1_BLOCK_SIZE   64

◆ SHABLK

#define SHABLK (   i)    (block[i&15] = ROL32(block[(i+13)&15] ^ block[(i+8)&15] ^ block[(i+2)&15] ^ block[i&15],1))

◆ SHABLK0

#define SHABLK0 (   i)    (block[i])

◆ UE_PLATFORM_SHA_ARMV8

#define UE_PLATFORM_SHA_ARMV8   0

◆ UE_PLATFORM_SHA_FALLBACK

#define UE_PLATFORM_SHA_FALLBACK   1

◆ UE_PLATFORM_SHA_X86

#define UE_PLATFORM_SHA_X86   0

Enumeration Type Documentation

◆ anonymous enum

Enumerator
_S11 

◆ anonymous enum

Enumerator
_S12 

◆ anonymous enum

Enumerator
_S13 

◆ anonymous enum

Enumerator
_S14 

◆ anonymous enum

Enumerator
_S21 

◆ anonymous enum

Enumerator
_S22 

◆ anonymous enum

Enumerator
_S23 

◆ anonymous enum

Enumerator
_S24 

◆ anonymous enum

Enumerator
_S31 

◆ anonymous enum

Enumerator
_S32 

◆ anonymous enum

Enumerator
_S33 

◆ anonymous enum

Enumerator
_S34 

◆ anonymous enum

Enumerator
_S41 

◆ anonymous enum

Enumerator
_S42 

◆ anonymous enum

Enumerator
_S43 

◆ anonymous enum

Enumerator
_S44 

Function Documentation

◆ appOnFailSHAVerification()

void appOnFailSHAVerification ( const TCHAR FailedPathname,
bool  bFailedDueToMissingHash 
)

Callback that is called if the asynchronous SHA verification fails This will be called from a pooled thread.

NOTE: Each platform is expected to implement this!

Parameters
FailedPathnamePathname of file that failed to verify
bFailedDueToMissingHashtrue if the reason for the failure was that the hash was missing, and that was set as being an error condition

◆ DEFINE_LOG_CATEGORY_STATIC()

DEFINE_LOG_CATEGORY_STATIC ( LogSecureHash  ,
Log  ,
All   
)