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

(0ccf980226462398d5097987466bcffd8236e1e9)

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, pdfium::span< const uint8_t > data)
void CRYPT_SHA1Finish (CRYPT_sha1_context *context, pdfium::span< uint8_t, 20 > digest)
DataVector< uint8_t > CRYPT_SHA1Generate (pdfium::span< const uint8_t > data)
void CRYPT_SHA256Start (CRYPT_sha2_context *context)
void CRYPT_SHA256Update (CRYPT_sha2_context *context, pdfium::span< const uint8_t > data)
void CRYPT_SHA256Finish (CRYPT_sha2_context *context, pdfium::span< uint8_t, 32 > digest)
DataVector< uint8_t > CRYPT_SHA256Generate (pdfium::span< const uint8_t > data)
void CRYPT_SHA384Start (CRYPT_sha2_context *context)
void CRYPT_SHA384Update (CRYPT_sha2_context *context, pdfium::span< const uint8_t > data)
void CRYPT_SHA384Finish (CRYPT_sha2_context *context, pdfium::span< uint8_t, 48 > digest)
DataVector< uint8_t > CRYPT_SHA384Generate (pdfium::span< const uint8_t > data)
void CRYPT_SHA512Start (CRYPT_sha2_context *context)
void CRYPT_SHA512Update (CRYPT_sha2_context *context, pdfium::span< const uint8_t > data)
void CRYPT_SHA512Finish (CRYPT_sha2_context *context, pdfium::span< uint8_t, 64 > digest)
DataVector< uint8_t > CRYPT_SHA512Generate (pdfium::span< const uint8_t > data)

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
GLint y

Definition at line 75 of file fx_crypt_sha.cpp.

◆ F1

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

Definition at line 76 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
GLfloat GLfloat f
[26]
GLboolean GLboolean g
GLfloat GLfloat GLfloat GLfloat h
const GLubyte * c

Definition at line 79 of file fx_crypt_sha.cpp.

◆ R

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

Definition at line 77 of file fx_crypt_sha.cpp.

◆ rol

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

Definition at line 68 of file fx_crypt_sha.cpp.

◆ ROTR

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

Definition at line 70 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 71 of file fx_crypt_sha.cpp.

◆ S1

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

Definition at line 72 of file fx_crypt_sha.cpp.

◆ S2

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

Definition at line 73 of file fx_crypt_sha.cpp.

◆ S3

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

Definition at line 74 of file fx_crypt_sha.cpp.

◆ SHA384_F0

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

Definition at line 47 of file fx_crypt_sha.cpp.

◆ SHA384_F1

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

Definition at line 48 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 58 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 65 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 50 of file fx_crypt_sha.cpp.

◆ SHA384_S0

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

Definition at line 51 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 52 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 54 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 56 of file fx_crypt_sha.cpp.

◆ SHA384_SHR

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

Definition at line 49 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 13 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 27 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 19 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 35 of file fx_crypt_sha.cpp.

◆ SHR

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

Definition at line 69 of file fx_crypt_sha.cpp.

Function Documentation

◆ CRYPT_SHA1Finish()

void CRYPT_SHA1Finish ( CRYPT_sha1_context * context,
pdfium::span< uint8_t, 20 > digest )

◆ CRYPT_SHA1Generate()

DataVector< uint8_t > CRYPT_SHA1Generate ( pdfium::span< const uint8_t > data)

Definition at line 430 of file fx_crypt_sha.cpp.

References CRYPT_SHA1Start().

Here is the call graph for this function:

◆ CRYPT_SHA1Start()

void CRYPT_SHA1Start ( CRYPT_sha1_context * context)

Definition at line 367 of file fx_crypt_sha.cpp.

References CRYPT_sha1_context::blkused, 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,
pdfium::span< const uint8_t > data )

◆ CRYPT_SHA256Finish()

void CRYPT_SHA256Finish ( CRYPT_sha2_context * context,
pdfium::span< uint8_t, 32 > digest )

Definition at line 477 of file fx_crypt_sha.cpp.

References CRYPT_sha2_context::total_bytes.

◆ CRYPT_SHA256Generate()

DataVector< uint8_t > CRYPT_SHA256Generate ( pdfium::span< const uint8_t > data)

Definition at line 496 of file fx_crypt_sha.cpp.

References CRYPT_SHA256Start().

Here is the call graph for this function:

◆ CRYPT_SHA256Start()

void CRYPT_SHA256Start ( CRYPT_sha2_context * context)

Definition at line 440 of file fx_crypt_sha.cpp.

References CRYPT_sha2_context::buffer, 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,
pdfium::span< const uint8_t > data )

◆ CRYPT_SHA384Finish()

void CRYPT_SHA384Finish ( CRYPT_sha2_context * context,
pdfium::span< uint8_t, 48 > digest )

Definition at line 543 of file fx_crypt_sha.cpp.

References CRYPT_sha2_context::total_bytes.

◆ CRYPT_SHA384Generate()

DataVector< uint8_t > CRYPT_SHA384Generate ( pdfium::span< const uint8_t > data)

Definition at line 561 of file fx_crypt_sha.cpp.

References CRYPT_SHA384Start().

Here is the call graph for this function:

◆ CRYPT_SHA384Start()

void CRYPT_SHA384Start ( CRYPT_sha2_context * context)

Definition at line 506 of file fx_crypt_sha.cpp.

References CRYPT_sha2_context::buffer, 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,
pdfium::span< const uint8_t > data )

◆ CRYPT_SHA512Finish()

void CRYPT_SHA512Finish ( CRYPT_sha2_context * context,
pdfium::span< uint8_t, 64 > digest )

Definition at line 589 of file fx_crypt_sha.cpp.

References CRYPT_sha2_context::total_bytes.

◆ CRYPT_SHA512Generate()

DataVector< uint8_t > CRYPT_SHA512Generate ( pdfium::span< const uint8_t > data)

Definition at line 609 of file fx_crypt_sha.cpp.

References CRYPT_SHA512Start().

Here is the call graph for this function:

◆ CRYPT_SHA512Start()

void CRYPT_SHA512Start ( CRYPT_sha2_context * context)

Definition at line 571 of file fx_crypt_sha.cpp.

References CRYPT_sha2_context::buffer, 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,
pdfium::span< const uint8_t > data )

Definition at line 584 of file fx_crypt_sha.cpp.