SHA-512 algorithm.
Definition in file sha512.h.
Calculate SHA-512 digest of accumulated data.
- Parameters
-
| dd | Digest and data block |
| digest | Copy of current digest value |
Definition at line 101 of file sha512.c.
102 {
103 union {
123 unsigned int i;
124
125
136
137
139 s0 = ( ror64 ( *
a, 28 ) ^ ror64 ( *
a, 34 ) ^ ror64 ( *
a, 39 ) );
140 maj = ( ( *
a & *
b ) ^ ( *
a & *
c ) ^ ( *
b & *
c ) );
141 t2 = ( s0 + maj );
142 s1 = ( ror64 ( *
e, 14 ) ^ ror64 ( *
e, 18 ) ^ ror64 ( *
e, 41 ) );
143 ch = ( ( *
e & *
f ) ^ ( (~*
e) & *
g ) );
144 t1 = ( *
h + s1 +
ch +
k[i] +
w[ i % 16 ] );
153 s0 = ( ror64 (
w[ ( i - 15 ) % 16 ], 1 ) ^
154 ror64 (
w[ ( i - 15 ) % 16 ], 8 ) ^
155 (
w[ ( i - 15 ) % 16 ] >> 7 ) );
156 s1 = ( ror64 (
w[ ( i - 2 ) % 16 ], 19 ) ^
157 ror64 (
w[ ( i - 2 ) % 16 ], 61 ) ^
158 (
w[ ( i - 2 ) % 16 ] >> 6 ) );
159 w[ i % 16 ] = (
w[ ( i - 16 ) % 16 ] + s0 +
160 w[ ( i - 7 ) % 16 ] + s1 );
162 "%016llx %016llx %016llx %016llx %016llx\n",
163 i, *
a, *
b, *
c, *
d, *
e, *
f, *
g, *
h );
164 }
165
166
167 for ( i = 0 ; i < 8 ; i++ )
169}
typeof(acpi_finder=acpi_find)
ACPI table finder.
unsigned long long uint64_t
#define build_assert(condition)
Assert a condition at build time (after dead code elimination).
union @104331263140136355135267063077374276003064103115 u
static const uint32_t k[64]
MD5 constants.
struct digest_algorithm sha512_algorithm
#define SHA512_ROUNDS
SHA-512 number of rounds.
#define container_of(ptr, type, field)
Get containing structure.
struct sha512_digest digest
Digest of data already processed.
uint64_t h[8]
Hash output.
References sha512_variables::a, sha512_variables::b, build_assert, sha512_variables::c, ch, container_of, sha512_variables::d, DBGC2, sha512_digest_data::digest, sha512_variables::e, sha512_variables::f, sha512_variables::g, h, sha512_digest::h, sha512_variables::h, k, sha512_algorithm, SHA512_ROUNDS, typeof(), u, and sha512_variables::w.