iPXE
md5.h
Go to the documentation of this file.
1#ifndef _IPXE_MD5_H
2#define _IPXE_MD5_H
3
4/** @file
5 *
6 * MD5 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 MD5 digest */
18struct md5_digest {
19 /** Hash output */
21};
22
23/** An MD5 data block */
24union md5_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/** MD5 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/** MD5 context size */
51#define MD5_CTX_SIZE MDHASH_CTX_SIZE ( struct md5_digest_data )
52
53/** MD5 block size */
54#define MD5_BLOCK_SIZE sizeof ( union md5_block )
55
56/** MD5 digest size */
57#define MD5_DIGEST_SIZE sizeof ( struct md5_digest )
58
60
61#endif /* _IPXE_MD5_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 md5_algorithm
Merkle-Damgård hash algorithms.
A message digest algorithm.
Definition crypto.h:19
MD5 digest and data block.
Definition md5.h:43
struct md5_digest digest
Digest of data already processed.
Definition md5.h:45
union md5_block data
Accumulated data.
Definition md5.h:47
An MD5 digest.
Definition md5.h:18
uint32_t h[4]
Hash output.
Definition md5.h:20
An MD5 data block.
Definition md5.h:24
uint32_t dword[16]
Raw dwords.
Definition md5.h:28
uint8_t pad[56]
Padding.
Definition md5.h:32
uint64_t len
Length in bits.
Definition md5.h:34