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
16/** An MD4 digest */
17struct md4_digest {
18 /** Hash output */
20};
21
22/** An MD4 data block */
23union md4_block {
24 /** Raw bytes */
25 uint8_t byte[64];
26 /** Raw dwords */
28 /** Final block structure */
29 struct {
30 /** Padding */
32 /** Length in bits */
34 } final;
35};
36
37/** MD4 digest and data block
38 *
39 * The order of fields within this structure is designed to minimise
40 * code size.
41 */
43 /** Digest of data already processed */
45 /** Accumulated data */
47} __attribute__ (( packed ));
48
49/** MD4 digest and data block */
51 /** Digest and data block */
53 /** Raw dwords */
54 uint32_t dword[ sizeof ( struct md4_digest_data ) /
55 sizeof ( uint32_t ) ];
56};
57
58/** An MD4 context */
60 /** Amount of accumulated data */
61 size_t len;
62 /** Digest and accumulated data */
64} __attribute__ (( packed ));
65
66/** MD4 context size */
67#define MD4_CTX_SIZE sizeof ( struct md4_context )
68
69/** MD4 block size */
70#define MD4_BLOCK_SIZE sizeof ( union md4_block )
71
72/** MD4 digest size */
73#define MD4_DIGEST_SIZE sizeof ( struct md4_digest )
74
76
77#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:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
#define __attribute__(x)
Definition compiler.h:10
Cryptographic API.
struct digest_algorithm md4_algorithm
MD4 algorithm.
Definition md4.c:262
A message digest algorithm.
Definition crypto.h:19
An MD4 context.
Definition md4.h:59
size_t len
Amount of accumulated data.
Definition md4.h:61
union md4_digest_data_dwords ddd
Digest and accumulated data.
Definition md4.h:63
MD4 digest and data block.
Definition md4.h:42
union md4_block data
Accumulated data.
Definition md4.h:46
struct md4_digest digest
Digest of data already processed.
Definition md4.h:44
An MD4 digest.
Definition md4.h:17
uint32_t h[4]
Hash output.
Definition md4.h:19
An MD4 data block.
Definition md4.h:23
uint8_t pad[56]
Padding.
Definition md4.h:31
uint32_t dword[16]
Raw dwords.
Definition md4.h:27
uint64_t len
Length in bits.
Definition md4.h:33
MD4 digest and data block.
Definition md4.h:50
uint32_t dword[sizeof(struct md4_digest_data)/sizeof(uint32_t)]
Raw dwords.
Definition md4.h:55
struct md4_digest_data dd
Digest and data block.
Definition md4.h:52