Audacity 3.2.0
Namespaces | Macros | Functions | Variables
SHA256.cpp File Reference
#include "SHA256.h"
#include <cassert>
#include <cstring>
Include dependency graph for SHA256.cpp:

Go to the source code of this file.

Namespaces

namespace  crypto
 
namespace  crypto::anonymous_namespace{SHA256.cpp}
 

Macros

#define ROTLEFT(a, b)   (((a) << (b)) | ((a) >> (32 - (b))))
 
#define ROTRIGHT(a, b)   (((a) >> (b)) | ((a) << (32 - (b))))
 
#define CH(x, y, z)   (((x) & (y)) ^ (~(x) & (z)))
 
#define MAJ(x, y, z)   (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z)))
 
#define EP0(x)   (ROTRIGHT(x, 2) ^ ROTRIGHT(x, 13) ^ ROTRIGHT(x, 22))
 
#define EP1(x)   (ROTRIGHT(x, 6) ^ ROTRIGHT(x, 11) ^ ROTRIGHT(x, 25))
 
#define SIG0(x)   (ROTRIGHT(x, 7) ^ ROTRIGHT(x, 18) ^ ((x) >> 3))
 
#define SIG1(x)   (ROTRIGHT(x, 17) ^ ROTRIGHT(x, 19) ^ ((x) >> 10))
 

Functions

void crypto::anonymous_namespace{SHA256.cpp}::sha256_transform (uint32_t state[8], const uint8_t data[64])
 

Variables

constexpr uint32_t crypto::anonymous_namespace{SHA256.cpp}::K [64]
 

Macro Definition Documentation

◆ CH

#define CH (   x,
  y,
 
)    (((x) & (y)) ^ (~(x) & (z)))

Definition at line 36 of file SHA256.cpp.

◆ EP0

#define EP0 (   x)    (ROTRIGHT(x, 2) ^ ROTRIGHT(x, 13) ^ ROTRIGHT(x, 22))

Definition at line 38 of file SHA256.cpp.

◆ EP1

#define EP1 (   x)    (ROTRIGHT(x, 6) ^ ROTRIGHT(x, 11) ^ ROTRIGHT(x, 25))

Definition at line 39 of file SHA256.cpp.

◆ MAJ

#define MAJ (   x,
  y,
 
)    (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z)))

Definition at line 37 of file SHA256.cpp.

◆ ROTLEFT

#define ROTLEFT (   a,
 
)    (((a) << (b)) | ((a) >> (32 - (b))))

Definition at line 33 of file SHA256.cpp.

◆ ROTRIGHT

#define ROTRIGHT (   a,
 
)    (((a) >> (b)) | ((a) << (32 - (b))))

Definition at line 34 of file SHA256.cpp.

◆ SIG0

#define SIG0 (   x)    (ROTRIGHT(x, 7) ^ ROTRIGHT(x, 18) ^ ((x) >> 3))

Definition at line 40 of file SHA256.cpp.

◆ SIG1

#define SIG1 (   x)    (ROTRIGHT(x, 17) ^ ROTRIGHT(x, 19) ^ ((x) >> 10))

Definition at line 41 of file SHA256.cpp.