iPXE
md5_sha1.h
Go to the documentation of this file.
1#ifndef _IPXE_MD5_SHA1_H
2#define _IPXE_MD5_SHA1_H
3
4/** @file
5 *
6 * Hybrid MD5+SHA1 hash as used by TLSv1.1 and earlier
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/md5.h>
16#include <ipxe/sha1.h>
17
18/** An MD5+SHA1 context */
20 /** MD5 context */
22 /** SHA-1 context */
24} __attribute__ (( packed ));
25
26/** MD5+SHA1 context size */
27#define MD5_SHA1_CTX_SIZE sizeof ( struct md5_sha1_context )
28
29/** An MD5+SHA1 digest */
31 /** MD5 digest */
33 /** SHA-1 digest */
35} __attribute__ (( packed ));
36
37/** MD5+SHA1 digest size */
38#define MD5_SHA1_DIGEST_SIZE sizeof ( struct md5_sha1_digest )
39
40/** An MD5+SHA1 data block */
42 /** MD5 data block */
44 /** SHA-1 data block */
46};
47
48/** MD5+SHA1 block size */
49#define MD5_SHA1_BLOCK_SIZE sizeof ( union md5_sha1_block )
50
51/** An MD5+SHA1 HMAC key block
52 *
53 * The hybrid PRF used in TLS version 1.1 and earlier does not use
54 * HMAC with the hybrid MD5+SHA1 algorithm: it uses separate
55 * invocations of HMAC-MD5 and HMAC-SHA1.
56 */
58 /** MD5 HMAC key */
60 /** SHA-1 HMAC key */
62};
63
65
66#endif /* _IPXE_MD5_SHA1_H */
#define SHA1_DIGEST_SIZE
Definition Tpm20.h:25
#define SHA1_BLOCK_SIZE
Definition Tpm20.h:26
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.
MD5 algorithm.
#define MD5_CTX_SIZE
MD5 context size.
Definition md5.h:51
#define MD5_BLOCK_SIZE
MD5 block size.
Definition md5.h:54
#define MD5_DIGEST_SIZE
MD5 digest size.
Definition md5.h:57
struct digest_algorithm md5_sha1_algorithm
Hybrid MD5+SHA1 digest algorithm.
Definition md5_sha1.c:84
SHA-1 algorithm.
#define SHA1_CTX_SIZE
SHA-1 context size.
Definition sha1.h:51
A message digest algorithm.
Definition crypto.h:19
An MD5+SHA1 context.
Definition md5_sha1.h:19
uint8_t sha1[SHA1_CTX_SIZE]
SHA-1 context.
Definition md5_sha1.h:23
uint8_t md5[MD5_CTX_SIZE]
MD5 context.
Definition md5_sha1.h:21
An MD5+SHA1 digest.
Definition md5_sha1.h:30
uint8_t md5[MD5_DIGEST_SIZE]
MD5 digest.
Definition md5_sha1.h:32
uint8_t sha1[SHA1_DIGEST_SIZE]
SHA-1 digest.
Definition md5_sha1.h:34
An MD5+SHA1 HMAC key block.
Definition md5_sha1.h:57
uint8_t md5[MD5_BLOCK_SIZE]
MD5 HMAC key.
Definition md5_sha1.h:59
uint8_t sha1[SHA1_BLOCK_SIZE]
SHA-1 HMAC key.
Definition md5_sha1.h:61
An MD5+SHA1 data block.
Definition md5_sha1.h:41
uint8_t sha1[SHA1_BLOCK_SIZE]
SHA-1 data block.
Definition md5_sha1.h:45
uint8_t md5[MD5_BLOCK_SIZE]
MD5 data block.
Definition md5_sha1.h:43