Macros | Functions
sha1.c File Reference
#include <openssl/sha.h>
#include <string.h>
#include <openssl/mem.h>
#include "../../internal.h"
#include "../digest/md32_common.h"
#include "internal.h"
Include dependency graph for sha1.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define BODY_00_15(i, a, b, c, d, e, f, xi)
 
#define BODY_16_19(i, a, b, c, d, e, f, xi, xa, xb, xc, xd)
 
#define BODY_20_31(i, a, b, c, d, e, f, xi, xa, xb, xc, xd)
 
#define BODY_32_39(i, a, b, c, d, e, f, xa, xb, xc, xd)
 
#define BODY_40_59(i, a, b, c, d, e, f, xa, xb, xc, xd)
 
#define BODY_60_79(i, a, b, c, d, e, f, xa, xb, xc, xd)
 
#define F_00_19(b, c, d)   ((((c) ^ (d)) & (b)) ^ (d))
 
#define F_20_39(b, c, d)   ((b) ^ (c) ^ (d))
 
#define F_40_59(b, c, d)   (((b) & (c)) | (((b) | (c)) & (d)))
 
#define F_60_79(b, c, d)   F_20_39(b, c, d)
 
#define K_00_19   0x5a827999UL
 
#define K_20_39   0x6ed9eba1UL
 
#define K_40_59   0x8f1bbcdcUL
 
#define K_60_79   0xca62c1d6UL
 
#define X(i)   XX##i
 
#define Xupdate(a, ix, ia, ib, ic, id)
 

Functions

uint8_tSHA1 (const uint8_t *data, size_t len, uint8_t out[SHA_DIGEST_LENGTH])
 
static void sha1_block_data_order (uint32_t *state, const uint8_t *data, size_t num)
 
int SHA1_Final (uint8_t out[SHA_DIGEST_LENGTH], SHA_CTX *c)
 
int SHA1_Init (SHA_CTX *sha)
 
void SHA1_Transform (SHA_CTX *c, const uint8_t data[SHA_CBLOCK])
 
int SHA1_Update (SHA_CTX *c, const void *data, size_t len)
 

Macro Definition Documentation

◆ BODY_00_15

#define BODY_00_15 (   i,
  a,
  b,
  c,
  d,
  e,
  f,
  xi 
)
Value:
do { \
(f) = (xi) + (e) + K_00_19 + CRYPTO_rotl_u32((a), 5) + \
F_00_19((b), (c), (d)); \
(b) = CRYPTO_rotl_u32((b), 30); \
} while (0)

Definition at line 135 of file sha1.c.

◆ BODY_16_19

#define BODY_16_19 (   i,
  a,
  b,
  c,
  d,
  e,
  f,
  xi,
  xa,
  xb,
  xc,
  xd 
)
Value:
do { \
Xupdate(f, xi, xa, xb, xc, xd); \
(f) += (e) + K_00_19 + CRYPTO_rotl_u32((a), 5) + F_00_19((b), (c), (d)); \
(b) = CRYPTO_rotl_u32((b), 30); \
} while (0)

Definition at line 142 of file sha1.c.

◆ BODY_20_31

#define BODY_20_31 (   i,
  a,
  b,
  c,
  d,
  e,
  f,
  xi,
  xa,
  xb,
  xc,
  xd 
)
Value:
do { \
Xupdate(f, xi, xa, xb, xc, xd); \
(f) += (e) + K_20_39 + CRYPTO_rotl_u32((a), 5) + F_20_39((b), (c), (d)); \
(b) = CRYPTO_rotl_u32((b), 30); \
} while (0)

Definition at line 149 of file sha1.c.

◆ BODY_32_39

#define BODY_32_39 (   i,
  a,
  b,
  c,
  d,
  e,
  f,
  xa,
  xb,
  xc,
  xd 
)
Value:
do { \
Xupdate(f, xa, xa, xb, xc, xd); \
(f) += (e) + K_20_39 + CRYPTO_rotl_u32((a), 5) + F_20_39((b), (c), (d)); \
(b) = CRYPTO_rotl_u32((b), 30); \
} while (0)

Definition at line 156 of file sha1.c.

◆ BODY_40_59

#define BODY_40_59 (   i,
  a,
  b,
  c,
  d,
  e,
  f,
  xa,
  xb,
  xc,
  xd 
)
Value:
do { \
Xupdate(f, xa, xa, xb, xc, xd); \
(f) += (e) + K_40_59 + CRYPTO_rotl_u32((a), 5) + F_40_59((b), (c), (d)); \
(b) = CRYPTO_rotl_u32((b), 30); \
} while (0)

Definition at line 163 of file sha1.c.

◆ BODY_60_79

#define BODY_60_79 (   i,
  a,
  b,
  c,
  d,
  e,
  f,
  xa,
  xb,
  xc,
  xd 
)
Value:
do { \
Xupdate(f, xa, xa, xb, xc, xd); \
(f) = (xa) + (e) + K_60_79 + CRYPTO_rotl_u32((a), 5) + \
F_60_79((b), (c), (d)); \
(b) = CRYPTO_rotl_u32((b), 30); \
} while (0)

Definition at line 170 of file sha1.c.

◆ F_00_19

#define F_00_19 (   b,
  c,
  d 
)    ((((c) ^ (d)) & (b)) ^ (d))

Definition at line 130 of file sha1.c.

◆ F_20_39

#define F_20_39 (   b,
  c,
  d 
)    ((b) ^ (c) ^ (d))

Definition at line 131 of file sha1.c.

◆ F_40_59

#define F_40_59 (   b,
  c,
  d 
)    (((b) & (c)) | (((b) | (c)) & (d)))

Definition at line 132 of file sha1.c.

◆ F_60_79

#define F_60_79 (   b,
  c,
  d 
)    F_20_39(b, c, d)

Definition at line 133 of file sha1.c.

◆ K_00_19

#define K_00_19   0x5a827999UL

Definition at line 120 of file sha1.c.

◆ K_20_39

#define K_20_39   0x6ed9eba1UL

Definition at line 121 of file sha1.c.

◆ K_40_59

#define K_40_59   0x8f1bbcdcUL

Definition at line 122 of file sha1.c.

◆ K_60_79

#define K_60_79   0xca62c1d6UL

Definition at line 123 of file sha1.c.

◆ X

#define X (   i)    XX##i

Definition at line 189 of file sha1.c.

◆ Xupdate

#define Xupdate (   a,
  ix,
  ia,
  ib,
  ic,
  id 
)
Value:
do { \
(a) = ((ia) ^ (ib) ^ (ic) ^ (id)); \
(ix) = (a) = CRYPTO_rotl_u32((a), 1); \
} while (0)

Definition at line 114 of file sha1.c.

Function Documentation

◆ SHA1()

uint8_t* SHA1 ( const uint8_t data,
size_t  len,
uint8_t  out[SHA_DIGEST_LENGTH] 
)

Definition at line 78 of file sha1.c.

◆ sha1_block_data_order()

static void sha1_block_data_order ( uint32_t state,
const uint8_t data,
size_t  num 
)
static

Definition at line 192 of file sha1.c.

◆ SHA1_Final()

int SHA1_Final ( uint8_t  out[SHA_DIGEST_LENGTH],
SHA_CTX c 
)

Definition at line 102 of file sha1.c.

◆ SHA1_Init()

int SHA1_Init ( SHA_CTX sha)

Definition at line 68 of file sha1.c.

◆ SHA1_Transform()

void SHA1_Transform ( SHA_CTX c,
const uint8_t  data[SHA_CBLOCK] 
)

Definition at line 92 of file sha1.c.

◆ SHA1_Update()

int SHA1_Update ( SHA_CTX c,
const void *  data,
size_t  len 
)

Definition at line 96 of file sha1.c.

K_40_59
#define K_40_59
Definition: sha1.c:122
K_60_79
#define K_60_79
Definition: sha1.c:123
CRYPTO_rotl_u32
static uint32_t CRYPTO_rotl_u32(uint32_t value, int shift)
Definition: third_party/boringssl-with-bazel/src/crypto/internal.h:899
a
int a
Definition: abseil-cpp/absl/container/internal/hash_policy_traits_test.cc:88
F_00_19
#define F_00_19(b, c, d)
Definition: sha1.c:130
absl::FormatConversionChar::e
@ e
c
void c(T a)
Definition: miscompile_with_no_unique_address_test.cc:40
autogen_x86imm.f
f
Definition: autogen_x86imm.py:9
F_60_79
#define F_60_79(b, c, d)
Definition: sha1.c:133
b
uint64_t b
Definition: abseil-cpp/absl/container/internal/layout_test.cc:53
d
static const fe d
Definition: curve25519_tables.h:19
F_40_59
#define F_40_59(b, c, d)
Definition: sha1.c:132
K_20_39
#define K_20_39
Definition: sha1.c:121
F_20_39
#define F_20_39(b, c, d)
Definition: sha1.c:131
K_00_19
#define K_00_19
Definition: sha1.c:120
id
uint32_t id
Definition: flow_control_fuzzer.cc:70


grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:30