Botan 3.9.0
Crypto and TLS for C&
Botan::SHA1_F Namespace Reference

Functions

void F1 (uint32_t A, uint32_t &B, uint32_t C, uint32_t D, uint32_t &E, uint32_t M)
void F2 (uint32_t A, uint32_t &B, uint32_t C, uint32_t D, uint32_t &E, uint32_t M)
void F3 (uint32_t A, uint32_t &B, uint32_t C, uint32_t D, uint32_t &E, uint32_t M)
void F4 (uint32_t A, uint32_t &B, uint32_t C, uint32_t D, uint32_t &E, uint32_t M)

Variables

constexpr uint32_t K1 = 0x5A827999
constexpr uint32_t K2 = 0x6ED9EBA1
constexpr uint32_t K3 = 0x8F1BBCDC
constexpr uint32_t K4 = 0xCA62C1D6

Function Documentation

◆ F1()

void Botan::SHA1_F::F1 ( uint32_t A,
uint32_t & B,
uint32_t C,
uint32_t D,
uint32_t & E,
uint32_t M )
inline

Definition at line 21 of file sha1_f.h.

21 {
22 E += choose(B, C, D) + M + rotl<5>(A);
23 B = rotl<30>(B);
24}
BOTAN_FORCE_INLINE constexpr T rotl(T input)
Definition rotate.h:23
BOTAN_FORCE_INLINE constexpr T choose(T mask, T a, T b)
Definition bit_ops.h:196

References Botan::choose(), and Botan::rotl().

◆ F2()

void Botan::SHA1_F::F2 ( uint32_t A,
uint32_t & B,
uint32_t C,
uint32_t D,
uint32_t & E,
uint32_t M )
inline

Definition at line 26 of file sha1_f.h.

26 {
27 E += (B ^ C ^ D) + M + rotl<5>(A);
28 B = rotl<30>(B);
29}

References Botan::rotl().

◆ F3()

void Botan::SHA1_F::F3 ( uint32_t A,
uint32_t & B,
uint32_t C,
uint32_t D,
uint32_t & E,
uint32_t M )
inline

Definition at line 31 of file sha1_f.h.

31 {
32 E += majority(B, C, D) + M + rotl<5>(A);
33 B = rotl<30>(B);
34}
BOTAN_FORCE_INLINE constexpr T majority(T a, T b, T c)
Definition bit_ops.h:202

References Botan::majority(), and Botan::rotl().

◆ F4()

void Botan::SHA1_F::F4 ( uint32_t A,
uint32_t & B,
uint32_t C,
uint32_t D,
uint32_t & E,
uint32_t M )
inline

Definition at line 37 of file sha1_f.h.

37 {
38 E += (B ^ C ^ D) + M + rotl<5>(A);
39 B = rotl<30>(B);
40}

References Botan::rotl().

Variable Documentation

◆ K1

uint32_t Botan::SHA1_F::K1 = 0x5A827999
constexpr

Definition at line 16 of file sha1_f.h.

◆ K2

uint32_t Botan::SHA1_F::K2 = 0x6ED9EBA1
constexpr

Definition at line 17 of file sha1_f.h.

◆ K3

uint32_t Botan::SHA1_F::K3 = 0x8F1BBCDC
constexpr

Definition at line 18 of file sha1_f.h.

◆ K4

uint32_t Botan::SHA1_F::K4 = 0xCA62C1D6
constexpr

Definition at line 19 of file sha1_f.h.