67 return ( ( ( v->
b & v->
c ) | ( ~v->
b & v->
d ) ) + v->
w[i] );
78 return ( ( ( v->
b & v->
c ) | ( v->
b & v->
d ) | ( v->
c & v->
d ) ) +
79 v->
w[ ( ( i << 2 ) | ( i >> 2 ) ) % 16 ] );
90 static const uint8_t reverse[16] = {
91 0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15
93 return ( ( v->
b ^ v->
c ^ v->
d ) + v->
w[reverse[i]] );
164 DBGC ( context,
"MD4 digesting:\n" );
173 for ( i = 0 ; i < (
sizeof (
u.ddd.dword ) /
174 sizeof (
u.ddd.dword[0] ) ) ; i++ ) {
180 for ( i = 0 ; i < 48 ; i++ ) {
183 f =
step->f ( &
u.v, ( i % 16 ) );
187 *b =
rol32 ( ( *a +
f +
step->constant ),
r[round][ i % 4 ] );
189 DBGC2 ( context,
"%2d : %08x %08x %08x %08x\n",
194 for ( i = 0 ; i < 4 ; i++ ) {
197 u.ddd.dd.digest.h[i] );
200 DBGC ( context,
"MD4 digested:\n" );
224 if ( ( context->
len % sizeof ( context->
ddd.
dd.
data ) ) == 0 )
248 }
while ( ( context->
len % sizeof ( context->
ddd.
dd.
data ) ) !=
static void md4_init(void *ctx)
Initialise MD4 algorithm.
static __always_inline void off_t int c
uint32_t constant
Constant.
static struct md4_step md4_steps[4]
MD4 steps.
static u32 rol32(u32 v, int bits)
Rotate 32-bit value left.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
struct md4_digest_data dd
Digest and data block.
unsigned long long uint64_t
#define cpu_to_le64(value)
#define offsetof(type, field)
Get offset of a field within a structure.
struct golan_eq_context ctx
static uint32_t md4_f_0_15(struct md4_variables *v, unsigned int i)
f(b,c,d,w) for steps 0 to 15
void * memcpy(void *dest, const void *src, size_t len) __nonnull
uint32_t h[4]
Hash output.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
static void md4_update(void *ctx, const void *data, size_t len)
Accumulate data with MD4 algorithm.
union md4_block data
Accumulated data.
#define build_assert(condition)
Assert a condition at build time (after dead code elimination)
static void md4_final(void *ctx, void *out)
Generate MD4 digest.
size_t len
Amount of accumulated data.
#define cpu_to_le32(value)
uint8_t byte[64]
Raw bytes.
union md4_digest_data_dwords ddd
Digest and accumulated data.
static uint32_t md4_f_32_47(struct md4_variables *v, unsigned int i)
f(b,c,d,w) for steps 32 to 47
MD4 digest and data block.
uint32_t(* f)(struct md4_variables *v, unsigned int i)
Calculate f(b,c,d,w)
static uint32_t md4_f_16_31(struct md4_variables *v, unsigned int i)
f(b,c,d,w) for steps 16 to 31
const char * name
Algorithm name.
void step(void)
Single-step a single process.
A message digest algorithm.
uint8_t data[48]
Additional event data.
uint32_t dword[sizeof(struct md4_digest_data)/sizeof(uint32_t)]
Raw dwords.
uint16_t offset
Offset to command line.
struct digest_algorithm md4_algorithm
MD4 algorithm.
typeof(acpi_finder=acpi_find)
ACPI table finder.
uint32_t digestsize
Digest size (i.e.
static void md4_digest(struct md4_context *context)
Calculate MD4 digest of accumulated data.
struct md4_digest digest
Digest of data already processed.
#define le32_to_cpus(ptr)
static const uint8_t r[3][4]
MD4 shift amounts.