iPXE
sha384.c File Reference

SHA-384 algorithm. More...

#include <stdint.h>
#include <byteswap.h>
#include <ipxe/crypto.h>
#include <ipxe/sha512.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 FILE_SECBOOT (PERMITTED)
static void sha384_init (void *ctx)
 Initialise SHA-384 algorithm.

Variables

static const struct sha512_digest sha384_init_digest
 SHA-384 initial digest values.
struct digest_algorithm sha384_algorithm
 SHA-384 algorithm.

Detailed Description

SHA-384 algorithm.

Definition in file sha384.c.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )

◆ FILE_SECBOOT()

FILE_SECBOOT ( PERMITTED )

◆ sha384_init()

void sha384_init ( void * ctx)
static

Initialise SHA-384 algorithm.

Parameters
ctxSHA-384 context

Definition at line 57 of file sha384.c.

57 {
58 struct sha512_context *context = ctx;
59
61}
struct golan_eq_context ctx
Definition CIB_PRM.h:0
#define SHA384_DIGEST_SIZE
Definition Tpm20.h:34
static const struct sha512_digest sha384_init_digest
SHA-384 initial digest values.
Definition sha384.c:39
void sha512_family_init(struct sha512_context *context, const struct sha512_digest *init, size_t digestsize)
Initialise SHA-512 family algorithm.
Definition sha512.c:109
An SHA-512 context.
Definition sha512.h:64

References ctx, SHA384_DIGEST_SIZE, sha384_init_digest, and sha512_family_init().

Variable Documentation

◆ sha384_init_digest

const struct sha512_digest sha384_init_digest
static
Initial value:
= {
.h = {
cpu_to_be64 ( 0xcbbb9d5dc1059ed8ULL ),
cpu_to_be64 ( 0x629a292a367cd507ULL ),
cpu_to_be64 ( 0x9159015a3070dd17ULL ),
cpu_to_be64 ( 0x152fecd8f70e5939ULL ),
cpu_to_be64 ( 0x67332667ffc00b31ULL ),
cpu_to_be64 ( 0x8eb44a8768581511ULL ),
cpu_to_be64 ( 0xdb0c2e0d64f98fa7ULL ),
cpu_to_be64 ( 0x47b5481dbefa4fa4ULL ),
},
}
#define cpu_to_be64(value)
Definition byteswap.h:112

SHA-384 initial digest values.

Definition at line 39 of file sha384.c.

39 {
40 .h = {
41 cpu_to_be64 ( 0xcbbb9d5dc1059ed8ULL ),
42 cpu_to_be64 ( 0x629a292a367cd507ULL ),
43 cpu_to_be64 ( 0x9159015a3070dd17ULL ),
44 cpu_to_be64 ( 0x152fecd8f70e5939ULL ),
45 cpu_to_be64 ( 0x67332667ffc00b31ULL ),
46 cpu_to_be64 ( 0x8eb44a8768581511ULL ),
47 cpu_to_be64 ( 0xdb0c2e0d64f98fa7ULL ),
48 cpu_to_be64 ( 0x47b5481dbefa4fa4ULL ),
49 },
50};

Referenced by sha384_init().

◆ sha384_algorithm

struct digest_algorithm sha384_algorithm
Initial value:
= {
.name = "sha384",
.ctxsize = sizeof ( struct sha512_context ),
.blocksize = sizeof ( union sha512_block ),
.init = sha384_init,
.update = sha512_update,
.final = sha512_final,
}
uint32_t digestsize
Digest size (i.e.
Definition pccrr.h:1
static void sha384_init(void *ctx)
Initialise SHA-384 algorithm.
Definition sha384.c:57
void sha512_update(void *ctx, const void *data, size_t len)
Accumulate data with SHA-512 algorithm.
Definition sha512.c:234
void sha512_final(void *ctx, void *out)
Generate SHA-512 digest.
Definition sha512.c:257
An SHA-512 data block.
Definition sha512.h:26

SHA-384 algorithm.

Definition at line 64 of file sha384.c.

64 {
65 .name = "sha384",
66 .ctxsize = sizeof ( struct sha512_context ),
67 .blocksize = sizeof ( union sha512_block ),
69 .init = sha384_init,
70 .update = sha512_update,
71 .final = sha512_final,
72};

Referenced by __tls_cipher_suite(), __tls_cipher_suite(), __tls_cipher_suite(), __tls_cipher_suite(), DIGEST_TEST(), DIGEST_TEST(), DIGEST_TEST(), peerdist_info_v1(), sha384sum_exec(), and sha512_test_exec().