iPXE
md4.h
Go to the documentation of this file.
1#ifndef _IPXE_MD4_H
2#define _IPXE_MD4_H
3
4/** @file
5 *
6 * MD4 algorithm
7 *
8 */
9
10FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11FILE_SECBOOT ( PERMITTED );
12
13#include <stdint.h>
14#include <ipxe/crypto.h>
15#include <ipxe/mdhash.h>
16
17/** An MD4 digest */
18struct md4_digest {
19 /** Hash output */
21};
22
23/** An MD4 data block */
24union md4_block {
25 /** Raw bytes */
26 uint8_t byte[64];
27 /** Raw dwords */
29 /** Final block structure */
30 struct {
31 /** Padding */
33 /** Length in bits */
35 } final;
36};
37
38/** MD4 digest and data block
39 *
40 * The order of fields within this structure is designed to minimise
41 * code size.
42 */
44 /** Digest of data already processed */
46 /** Accumulated data */
48} __attribute__ (( packed ));
49
50/** MD4 context size */
51#define MD4_CTX_SIZE MDHASH_CTX_SIZE ( struct md4_digest_data )
52
53/** MD4 block size */
54#define MD4_BLOCK_SIZE sizeof ( union md4_block )
55
56/** MD4 digest size */
57#define MD4_DIGEST_SIZE sizeof ( struct md4_digest )
58
60
61#endif /* _IPXE_MD4_H */
unsigned int uint32_t
Definition stdint.h:12
unsigned long long uint64_t
Definition stdint.h:13
unsigned char uint8_t
Definition stdint.h:10
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:921
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:951
#define __attribute__(x)
Definition compiler.h:10
Cryptographic API.
struct digest_algorithm md4_algorithm
Merkle-Damgård hash algorithms.
A message digest algorithm.
Definition crypto.h:19
MD4 digest and data block.
Definition md4.h:43
union md4_block data
Accumulated data.
Definition md4.h:47
struct md4_digest digest
Digest of data already processed.
Definition md4.h:45
An MD4 digest.
Definition md4.h:18
uint32_t h[4]
Hash output.
Definition md4.h:20
An MD4 data block.
Definition md4.h:24
uint8_t pad[56]
Padding.
Definition md4.h:32
uint32_t dword[16]
Raw dwords.
Definition md4.h:28
uint64_t len
Length in bits.
Definition md4.h:34