58 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1,
59 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
60 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786,
61 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
62 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147,
63 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
64 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b,
65 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
66 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a,
67 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
68 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
153 DBGC ( context,
"SHA256 digesting:\n" );
162 for ( i = 0 ; i < (
sizeof (
u.ddd.dword ) /
163 sizeof (
u.ddd.dword[0] ) ) ; i++ ) {
174 w[i] = (
w[i-16] + s0 +
w[i-7] + s1 );
180 maj = ( ( *
a & *
b ) ^ ( *
a & *
c ) ^ ( *
b & *
c ) );
183 ch = ( ( *
e & *
f ) ^ ( (~*
e) & *
g ) );
184 t1 = ( *
h + s1 +
ch +
k[i] +
w[i] );
193 DBGC2 ( context,
"%2d : %08x %08x %08x %08x %08x %08x %08x " 194 "%08x\n", i, *
a, *
b, *
c, *
d, *
e, *
f, *
g, *
h );
198 for ( i = 0 ; i < 8 ; i++ ) {
201 u.ddd.dd.digest.h[i] );
204 DBGC ( context,
"SHA256 digested:\n" );
228 if ( ( context->
len % sizeof ( context->
ddd.
dd.
data ) ) == 0 )
252 }
while ( ( context->
len % sizeof ( context->
ddd.
dd.
data ) ) !=
static void sha256_init(void *ctx)
Initialise SHA-256 algorithm.
static __always_inline void off_t int c
static const struct sha256_digest sha256_init_digest
SHA-256 initial digest values.
static const uint32_t k[SHA256_ROUNDS]
SHA-256 constants.
struct sha256_digest digest
Digest of data already processed.
unsigned long long uint64_t
size_t digestsize
Digest size.
#define offsetof(type, field)
Get offset of a field within a structure.
struct golan_eq_context ctx
static u32 ror32(u32 v, int bits)
Rotate 32-bit value right.
SHA-256 digest and data block.
uint32_t h[8]
Hash output.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
void sha256_update(void *ctx, const void *data, size_t len)
Accumulate data with SHA-256 algorithm.
#define build_assert(condition)
Assert a condition at build time (after dead code elimination)
struct sha256_digest_data dd
Digest and data block.
uint32_t w[SHA256_ROUNDS]
size_t len
Amount of accumulated data.
union sha256_block data
Accumulated data.
uint32_t dword[sizeof(struct sha256_digest_data)/sizeof(uint32_t)]
Raw dwords.
#define cpu_to_be32(value)
struct digest_algorithm sha256_algorithm
SHA-256 algorithm.
#define be32_to_cpus(ptr)
const char * name
Algorithm name.
A message digest algorithm.
#define cpu_to_be64(value)
uint8_t data[48]
Additional event data.
void sha256_family_init(struct sha256_context *context, const struct sha256_digest *init, size_t digestsize)
Initialise SHA-256 family algorithm.
union sha256_digest_data_dwords ddd
Digest and accumulated data.
#define SHA256_ROUNDS
SHA-256 number of rounds.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
uint16_t offset
Offset to command line.
typeof(acpi_finder=acpi_find)
ACPI table finder.
uint32_t digestsize
Digest size (i.e.
uint8_t byte[64]
Raw bytes.
static void sha256_digest(struct sha256_context *context)
Calculate SHA-256 digest of accumulated data.
void sha256_final(void *ctx, void *out)
Generate SHA-256 digest.