iPXE
sha512_224.c File Reference

SHA-512/224 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 sha512_224_init (void *ctx)
 Initialise SHA-512/224 algorithm.

Variables

static const struct sha512_digest sha512_224_init_digest
 SHA-512/224 initial digest values.
struct digest_algorithm sha512_224_algorithm
 SHA-512/224 algorithm.

Detailed Description

SHA-512/224 algorithm.

Definition in file sha512_224.c.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )

◆ FILE_SECBOOT()

FILE_SECBOOT ( PERMITTED )

◆ sha512_224_init()

void sha512_224_init ( void * ctx)
static

Initialise SHA-512/224 algorithm.

Parameters
ctxSHA-512/224 context

Definition at line 57 of file sha512_224.c.

57 {
58 struct sha512_context *context = ctx;
59
62}
struct golan_eq_context ctx
Definition CIB_PRM.h:0
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
#define SHA512_224_DIGEST_SIZE
SHA-512/224 digest size.
Definition sha512.h:89
static const struct sha512_digest sha512_224_init_digest
SHA-512/224 initial digest values.
Definition sha512_224.c:39
An SHA-512 context.
Definition sha512.h:64

References ctx, SHA512_224_DIGEST_SIZE, sha512_224_init_digest, and sha512_family_init().

Variable Documentation

◆ sha512_224_init_digest

const struct sha512_digest sha512_224_init_digest
static
Initial value:
= {
.h = {
cpu_to_be64 ( 0x8c3d37c819544da2ULL ),
cpu_to_be64 ( 0x73e1996689dcd4d6ULL ),
cpu_to_be64 ( 0x1dfab7ae32ff9c82ULL ),
cpu_to_be64 ( 0x679dd514582f9fcfULL ),
cpu_to_be64 ( 0x0f6d2b697bd44da8ULL ),
cpu_to_be64 ( 0x77e36f7304c48942ULL ),
cpu_to_be64 ( 0x3f9d85a86a1d36c8ULL ),
cpu_to_be64 ( 0x1112e6ad91d692a1ULL ),
},
}
#define cpu_to_be64(value)
Definition byteswap.h:112

SHA-512/224 initial digest values.

Definition at line 39 of file sha512_224.c.

39 {
40 .h = {
41 cpu_to_be64 ( 0x8c3d37c819544da2ULL ),
42 cpu_to_be64 ( 0x73e1996689dcd4d6ULL ),
43 cpu_to_be64 ( 0x1dfab7ae32ff9c82ULL ),
44 cpu_to_be64 ( 0x679dd514582f9fcfULL ),
45 cpu_to_be64 ( 0x0f6d2b697bd44da8ULL ),
46 cpu_to_be64 ( 0x77e36f7304c48942ULL ),
47 cpu_to_be64 ( 0x3f9d85a86a1d36c8ULL ),
48 cpu_to_be64 ( 0x1112e6ad91d692a1ULL ),
49 },
50};

Referenced by sha512_224_init().

◆ sha512_224_algorithm

struct digest_algorithm sha512_224_algorithm
Initial value:
= {
.name = "sha512/224",
.ctxsize = sizeof ( struct sha512_context ),
.blocksize = sizeof ( union sha512_block ),
.init = sha512_224_init,
.update = sha512_update,
.final = sha512_final,
}
uint32_t digestsize
Digest size (i.e.
Definition pccrr.h:1
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
static void sha512_224_init(void *ctx)
Initialise SHA-512/224 algorithm.
Definition sha512_224.c:57
An SHA-512 data block.
Definition sha512.h:26

SHA-512/224 algorithm.

Definition at line 65 of file sha512_224.c.

65 {
66 .name = "sha512/224",
67 .ctxsize = sizeof ( struct sha512_context ),
68 .blocksize = sizeof ( union sha512_block ),
70 .init = sha512_224_init,
71 .update = sha512_update,
72 .final = sha512_final,
73};

Referenced by DIGEST_TEST(), DIGEST_TEST(), DIGEST_TEST(), and sha512_test_exec().