Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
fx_crypt_sha.cpp File Reference

(813d9ae984a99e739b99cf694a9d5b24d0a6b7a7)

#include "core/fdrm/fx_crypt.h"
#include <string.h>
+ Include dependency graph for fx_crypt_sha.cpp:

Go to the source code of this file.

Macros

#define SHA_GET_UINT32(n, b, i)
 
#define SHA_PUT_UINT32(n, b, i)
 
#define SHA_GET_UINT64(n, b, i)
 
#define SHA_PUT_UINT64(n, b, i)
 
#define SHA384_F0(x, y, z)
 
#define SHA384_F1(x, y, z)
 
#define SHA384_SHR(x, n)
 
#define SHA384_ROTR(x, n)
 
#define SHA384_S0(x)
 
#define SHA384_S1(x)
 
#define SHA384_S2(x)
 
#define SHA384_S3(x)
 
#define SHA384_P(a, b, c, d, e, f, g, h, x, K)
 
#define SHA384_R(t)
 
#define rol(x, y)
 
#define SHR(x, n)
 
#define ROTR(x, n)
 
#define S0(x)
 
#define S1(x)
 
#define S2(x)
 
#define S3(x)
 
#define F0(x, y, z)
 
#define F1(x, y, z)
 
#define R(t)
 
#define PS(a, b, c, d, e, f, g, h, x, K)
 

Functions

void CRYPT_SHA1Start (CRYPT_sha1_context *context)
 
void CRYPT_SHA1Update (CRYPT_sha1_context *context, const uint8_t *data, uint32_t size)
 
void CRYPT_SHA1Finish (CRYPT_sha1_context *context, uint8_t digest[20])
 
void CRYPT_SHA1Generate (const uint8_t *data, uint32_t size, uint8_t digest[20])
 
void CRYPT_SHA256Start (CRYPT_sha2_context *context)
 
void CRYPT_SHA256Update (CRYPT_sha2_context *context, const uint8_t *data, uint32_t size)
 
void CRYPT_SHA256Finish (CRYPT_sha2_context *context, uint8_t digest[32])
 
void CRYPT_SHA256Generate (const uint8_t *data, uint32_t size, uint8_t digest[32])
 
void CRYPT_SHA384Start (CRYPT_sha2_context *context)
 
void CRYPT_SHA384Update (CRYPT_sha2_context *context, const uint8_t *data, uint32_t size)
 
void CRYPT_SHA384Finish (CRYPT_sha2_context *context, uint8_t digest[48])
 
void CRYPT_SHA384Generate (const uint8_t *data, uint32_t size, uint8_t digest[48])
 
void CRYPT_SHA512Start (CRYPT_sha2_context *context)
 
void CRYPT_SHA512Update (CRYPT_sha2_context *context, const uint8_t *data, uint32_t size)
 
void CRYPT_SHA512Finish (CRYPT_sha2_context *context, uint8_t digest[64])
 
void CRYPT_SHA512Generate (const uint8_t *data, uint32_t size, uint8_t digest[64])
 

Macro Definition Documentation

◆ F0

#define F0 ( x,
y,
z )
Value:
((x & y) | (z & (x | y)))
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat z
GLint GLint GLint GLint GLint x
[0]
GLint y

Definition at line 70 of file fx_crypt_sha.cpp.

◆ F1

#define F1 ( x,
y,
z )
Value:
(z ^ (x & (y ^ z)))

Definition at line 71 of file fx_crypt_sha.cpp.

◆ PS

#define PS ( a,
b,
c,
d,
e,
f,
g,
h,
x,
K )
Value:
{ \
uint32_t temp1 = h + S3(e) + F1(e, f, g) + K + x; \
uint32_t temp2 = S2(a) + F0(a, b, c); \
d += temp1; \
h = temp1 + temp2; \
}
#define F1(x, y, z)
#define S2(x)
#define F0(x, y, z)
#define S3(x)
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
[7]
GLfloat GLfloat f
[0]
GLboolean GLboolean g
GLfloat GLfloat GLfloat GLfloat h
const GLubyte * c
double d
[1]

Definition at line 73 of file fx_crypt_sha.cpp.

◆ R

#define R ( t)
Value:
(W[t] = S1(W[t - 2]) + W[t - 7] + S0(W[t - 15]) + W[t - 16])
#define S0(x)
#define S1(x)
GLdouble GLdouble t
Definition qopenglext.h:243

Definition at line 72 of file fx_crypt_sha.cpp.

◆ rol

#define rol ( x,
y )
Value:
(((x) << (y)) | (((unsigned int)x) >> (32 - y)))

Definition at line 63 of file fx_crypt_sha.cpp.

◆ ROTR

#define ROTR ( x,
n )
Value:
(SHR(x, n) | (x << (32 - n)))
#define SHR(x, n)
GLfloat n
[4]

Definition at line 65 of file fx_crypt_sha.cpp.

◆ S0

#define S0 ( x)
Value:
(ROTR(x, 7) ^ ROTR(x, 18) ^ SHR(x, 3))
#define ROTR(x, n)

Definition at line 66 of file fx_crypt_sha.cpp.

◆ S1

#define S1 ( x)
Value:
(ROTR(x, 17) ^ ROTR(x, 19) ^ SHR(x, 10))

Definition at line 67 of file fx_crypt_sha.cpp.

◆ S2

#define S2 ( x)
Value:
(ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))

Definition at line 68 of file fx_crypt_sha.cpp.

◆ S3

#define S3 ( x)
Value:
(ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))

Definition at line 69 of file fx_crypt_sha.cpp.

◆ SHA384_F0

#define SHA384_F0 ( x,
y,
z )
Value:
((x & y) | (z & (x | y)))

Definition at line 42 of file fx_crypt_sha.cpp.

◆ SHA384_F1

#define SHA384_F1 ( x,
y,
z )
Value:
(z ^ (x & (y ^ z)))

Definition at line 43 of file fx_crypt_sha.cpp.

◆ SHA384_P

#define SHA384_P ( a,
b,
c,
d,
e,
f,
g,
h,
x,
K )
Value:
{ \
uint64_t temp1 = h + SHA384_S3(e) + SHA384_F1(e, f, g) + K + x; \
uint64_t temp2 = SHA384_S2(a) + SHA384_F0(a, b, c); \
d += temp1; \
h = temp1 + temp2; \
}
#define SHA384_F0(x, y, z)
#define SHA384_S3(x)
#define SHA384_S2(x)
#define SHA384_F1(x, y, z)

Definition at line 53 of file fx_crypt_sha.cpp.

◆ SHA384_R

#define SHA384_R ( t)
Value:
(W[t] = SHA384_S1(W[t - 2]) + W[t - 7] + SHA384_S0(W[t - 15]) + W[t - 16])
#define SHA384_S0(x)
#define SHA384_S1(x)

Definition at line 60 of file fx_crypt_sha.cpp.

◆ SHA384_ROTR

#define SHA384_ROTR ( x,
n )
Value:
(SHA384_SHR(x, n) | x << (64 - n))
#define SHA384_SHR(x, n)

Definition at line 45 of file fx_crypt_sha.cpp.

◆ SHA384_S0

#define SHA384_S0 ( x)
Value:
#define SHA384_ROTR(x, n)

Definition at line 46 of file fx_crypt_sha.cpp.

◆ SHA384_S1

#define SHA384_S1 ( x)
Value:
(SHA384_ROTR(x, 19) ^ SHA384_ROTR(x, 61) ^ SHA384_SHR(x, 6))

Definition at line 47 of file fx_crypt_sha.cpp.

◆ SHA384_S2

#define SHA384_S2 ( x)
Value:
(SHA384_ROTR(x, 28) ^ SHA384_ROTR(x, 34) ^ SHA384_ROTR(x, 39))

Definition at line 49 of file fx_crypt_sha.cpp.

◆ SHA384_S3

#define SHA384_S3 ( x)
Value:
(SHA384_ROTR(x, 14) ^ SHA384_ROTR(x, 18) ^ SHA384_ROTR(x, 41))

Definition at line 51 of file fx_crypt_sha.cpp.

◆ SHA384_SHR

#define SHA384_SHR ( x,
n )
Value:
(x >> n)

Definition at line 44 of file fx_crypt_sha.cpp.

◆ SHA_GET_UINT32

#define SHA_GET_UINT32 ( n,
b,
i )
Value:
{ \
(n) = ((uint32_t)(b)[(i)] << 24) | ((uint32_t)(b)[(i) + 1] << 16) | \
((uint32_t)(b)[(i) + 2] << 8) | ((uint32_t)(b)[(i) + 3]); \
}

Definition at line 11 of file fx_crypt_sha.cpp.

◆ SHA_GET_UINT64

#define SHA_GET_UINT64 ( n,
b,
i )
Value:
{ \
(n) = ((uint64_t)(b)[(i)] << 56) | ((uint64_t)(b)[(i) + 1] << 48) | \
((uint64_t)(b)[(i) + 2] << 40) | ((uint64_t)(b)[(i) + 3] << 32) | \
((uint64_t)(b)[(i) + 4] << 24) | ((uint64_t)(b)[(i) + 5] << 16) | \
((uint64_t)(b)[(i) + 6] << 8) | ((uint64_t)(b)[(i) + 7]); \
}

Definition at line 23 of file fx_crypt_sha.cpp.

◆ SHA_PUT_UINT32

#define SHA_PUT_UINT32 ( n,
b,
i )
Value:
{ \
(b)[(i)] = (uint8_t)((n) >> 24); \
(b)[(i) + 1] = (uint8_t)((n) >> 16); \
(b)[(i) + 2] = (uint8_t)((n) >> 8); \
(b)[(i) + 3] = (uint8_t)((n)); \
}

Definition at line 16 of file fx_crypt_sha.cpp.

◆ SHA_PUT_UINT64

#define SHA_PUT_UINT64 ( n,
b,
i )
Value:
{ \
(b)[(i)] = (uint8_t)((n) >> 56); \
(b)[(i) + 1] = (uint8_t)((n) >> 48); \
(b)[(i) + 2] = (uint8_t)((n) >> 40); \
(b)[(i) + 3] = (uint8_t)((n) >> 32); \
(b)[(i) + 4] = (uint8_t)((n) >> 24); \
(b)[(i) + 5] = (uint8_t)((n) >> 16); \
(b)[(i) + 6] = (uint8_t)((n) >> 8); \
(b)[(i) + 7] = (uint8_t)((n)); \
}

Definition at line 30 of file fx_crypt_sha.cpp.

◆ SHR

#define SHR ( x,
n )
Value:
((x & 0xFFFFFFFF) >> n)

Definition at line 64 of file fx_crypt_sha.cpp.

Function Documentation

◆ CRYPT_SHA1Finish()

void CRYPT_SHA1Finish ( CRYPT_sha1_context * context,
uint8_t digest[20] )

Definition at line 392 of file fx_crypt_sha.cpp.

References CRYPT_sha1_context::blkused, CRYPT_SHA1Update(), CRYPT_sha1_context::h, and CRYPT_sha1_context::total_bytes.

Referenced by CRYPT_SHA1Generate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CRYPT_SHA1Generate()

void CRYPT_SHA1Generate ( const uint8_t * data,
uint32_t size,
uint8_t digest[20] )

Definition at line 421 of file fx_crypt_sha.cpp.

References CRYPT_SHA1Finish(), CRYPT_SHA1Start(), and CRYPT_SHA1Update().

+ Here is the call graph for this function:

◆ CRYPT_SHA1Start()

void CRYPT_SHA1Start ( CRYPT_sha1_context * context)

Definition at line 359 of file fx_crypt_sha.cpp.

References CRYPT_sha1_context::blkused, CRYPT_sha1_context::h, and CRYPT_sha1_context::total_bytes.

Referenced by CRYPT_SHA1Generate().

+ Here is the caller graph for this function:

◆ CRYPT_SHA1Update()

void CRYPT_SHA1Update ( CRYPT_sha1_context * context,
const uint8_t * data,
uint32_t size )

Definition at line 365 of file fx_crypt_sha.cpp.

References CRYPT_sha1_context::blkused, CRYPT_sha1_context::block, CRYPT_sha1_context::h, and CRYPT_sha1_context::total_bytes.

Referenced by CRYPT_SHA1Finish(), and CRYPT_SHA1Generate().

+ Here is the caller graph for this function:

◆ CRYPT_SHA256Finish()

void CRYPT_SHA256Finish ( CRYPT_sha2_context * context,
uint8_t digest[32] )

Definition at line 468 of file fx_crypt_sha.cpp.

References CRYPT_SHA256Update(), CRYPT_sha2_context::state, and CRYPT_sha2_context::total_bytes.

Referenced by CRYPT_SHA256Generate(), and CPDF_SecurityHandler::OnCreate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CRYPT_SHA256Generate()

void CRYPT_SHA256Generate ( const uint8_t * data,
uint32_t size,
uint8_t digest[32] )

Definition at line 486 of file fx_crypt_sha.cpp.

References CRYPT_SHA256Finish(), CRYPT_SHA256Start(), and CRYPT_SHA256Update().

+ Here is the call graph for this function:

◆ CRYPT_SHA256Start()

void CRYPT_SHA256Start ( CRYPT_sha2_context * context)

Definition at line 430 of file fx_crypt_sha.cpp.

References CRYPT_sha2_context::buffer, CRYPT_sha2_context::state, and CRYPT_sha2_context::total_bytes.

Referenced by CRYPT_SHA256Generate(), and CPDF_SecurityHandler::OnCreate().

+ Here is the caller graph for this function:

◆ CRYPT_SHA256Update()

void CRYPT_SHA256Update ( CRYPT_sha2_context * context,
const uint8_t * data,
uint32_t size )

Definition at line 443 of file fx_crypt_sha.cpp.

References CRYPT_sha2_context::buffer, and CRYPT_sha2_context::total_bytes.

Referenced by CRYPT_SHA256Finish(), CRYPT_SHA256Generate(), and CPDF_SecurityHandler::OnCreate().

+ Here is the caller graph for this function:

◆ CRYPT_SHA384Finish()

void CRYPT_SHA384Finish ( CRYPT_sha2_context * context,
uint8_t digest[48] )

Definition at line 533 of file fx_crypt_sha.cpp.

References CRYPT_SHA384Update(), CRYPT_sha2_context::state, and CRYPT_sha2_context::total_bytes.

Referenced by CRYPT_SHA384Generate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CRYPT_SHA384Generate()

void CRYPT_SHA384Generate ( const uint8_t * data,
uint32_t size,
uint8_t digest[48] )

Definition at line 550 of file fx_crypt_sha.cpp.

References CRYPT_SHA384Finish(), CRYPT_SHA384Start(), and CRYPT_SHA384Update().

+ Here is the call graph for this function:

◆ CRYPT_SHA384Start()

void CRYPT_SHA384Start ( CRYPT_sha2_context * context)

Definition at line 495 of file fx_crypt_sha.cpp.

References CRYPT_sha2_context::buffer, CRYPT_sha2_context::state, and CRYPT_sha2_context::total_bytes.

Referenced by CRYPT_SHA384Generate().

+ Here is the caller graph for this function:

◆ CRYPT_SHA384Update()

void CRYPT_SHA384Update ( CRYPT_sha2_context * context,
const uint8_t * data,
uint32_t size )

Definition at line 508 of file fx_crypt_sha.cpp.

References CRYPT_sha2_context::buffer, and CRYPT_sha2_context::total_bytes.

Referenced by CRYPT_SHA384Finish(), CRYPT_SHA384Generate(), and CRYPT_SHA512Update().

+ Here is the caller graph for this function:

◆ CRYPT_SHA512Finish()

void CRYPT_SHA512Finish ( CRYPT_sha2_context * context,
uint8_t digest[64] )

Definition at line 578 of file fx_crypt_sha.cpp.

References CRYPT_SHA512Update(), CRYPT_sha2_context::state, and CRYPT_sha2_context::total_bytes.

Referenced by CRYPT_SHA512Generate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CRYPT_SHA512Generate()

void CRYPT_SHA512Generate ( const uint8_t * data,
uint32_t size,
uint8_t digest[64] )

Definition at line 597 of file fx_crypt_sha.cpp.

References CRYPT_SHA512Finish(), CRYPT_SHA512Start(), and CRYPT_SHA512Update().

+ Here is the call graph for this function:

◆ CRYPT_SHA512Start()

void CRYPT_SHA512Start ( CRYPT_sha2_context * context)

Definition at line 559 of file fx_crypt_sha.cpp.

References CRYPT_sha2_context::buffer, CRYPT_sha2_context::state, and CRYPT_sha2_context::total_bytes.

Referenced by CRYPT_SHA512Generate().

+ Here is the caller graph for this function:

◆ CRYPT_SHA512Update()

void CRYPT_SHA512Update ( CRYPT_sha2_context * context,
const uint8_t * data,
uint32_t size )

Definition at line 572 of file fx_crypt_sha.cpp.

References CRYPT_SHA384Update().

Referenced by CRYPT_SHA512Finish(), and CRYPT_SHA512Generate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: