iPXE
Functions | Variables
crypto_null.c File Reference

Null crypto algorithm. More...

#include <string.h>
#include <ipxe/crypto.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
static void digest_null_init (void *ctx __unused)
 
static void digest_null_update (void *ctx __unused, const void *src __unused, size_t len __unused)
 
static void digest_null_final (void *ctx __unused, void *out __unused)
 
static int cipher_null_setkey (void *ctx __unused, const void *key __unused, size_t keylen __unused)
 
static void cipher_null_setiv (void *ctx __unused, const void *iv __unused)
 
static void cipher_null_encrypt (void *ctx __unused, const void *src, void *dst, size_t len)
 
static void cipher_null_decrypt (void *ctx __unused, const void *src, void *dst, size_t len)
 
static int pubkey_null_init (void *ctx __unused, const void *key __unused, size_t key_len __unused)
 
static size_t pubkey_null_max_len (void *ctx __unused)
 
static int pubkey_null_encrypt (void *ctx __unused, const void *plaintext __unused, size_t plaintext_len __unused, void *ciphertext __unused)
 
static int pubkey_null_decrypt (void *ctx __unused, const void *ciphertext __unused, size_t ciphertext_len __unused, void *plaintext __unused)
 
static int pubkey_null_sign (void *ctx __unused, struct digest_algorithm *digest __unused, const void *value __unused, void *signature __unused)
 
static int pubkey_null_verify (void *ctx __unused, struct digest_algorithm *digest __unused, const void *value __unused, const void *signature __unused, size_t signature_len __unused)
 
static void pubkey_null_final (void *ctx __unused)
 

Variables

struct digest_algorithm digest_null
 
struct cipher_algorithm cipher_null
 
struct pubkey_algorithm pubkey_null
 

Detailed Description

Null crypto algorithm.

Definition in file crypto_null.c.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ digest_null_init()

static void digest_null_init ( void *ctx  __unused)
static

Definition at line 35 of file crypto_null.c.

35  {
36  /* Do nothing */
37 }

◆ digest_null_update()

static void digest_null_update ( void *ctx  __unused,
const void *src  __unused,
size_t len  __unused 
)
static

Definition at line 39 of file crypto_null.c.

40  {
41  /* Do nothing */
42 }

◆ digest_null_final()

static void digest_null_final ( void *ctx  __unused,
void *out  __unused 
)
static

Definition at line 44 of file crypto_null.c.

44  {
45  /* Do nothing */
46 }

◆ cipher_null_setkey()

static int cipher_null_setkey ( void *ctx  __unused,
const void *key  __unused,
size_t keylen  __unused 
)
static

Definition at line 58 of file crypto_null.c.

59  {
60  /* Do nothing */
61  return 0;
62 }

◆ cipher_null_setiv()

static void cipher_null_setiv ( void *ctx  __unused,
const void *iv  __unused 
)
static

Definition at line 64 of file crypto_null.c.

65  {
66  /* Do nothing */
67 }

◆ cipher_null_encrypt()

static void cipher_null_encrypt ( void *ctx  __unused,
const void *  src,
void *  dst,
size_t  len 
)
static

Definition at line 69 of file crypto_null.c.

70  {
71  memcpy ( dst, src, len );
72 }
void * memcpy(void *dest, const void *src, size_t len) __nonnull
static __always_inline void off_t userptr_t src
Definition: efi_uaccess.h:66
uint32_t len
Length.
Definition: ena.h:14

References len, memcpy(), and src.

◆ cipher_null_decrypt()

static void cipher_null_decrypt ( void *ctx  __unused,
const void *  src,
void *  dst,
size_t  len 
)
static

Definition at line 74 of file crypto_null.c.

75  {
76  memcpy ( dst, src, len );
77 }
void * memcpy(void *dest, const void *src, size_t len) __nonnull
static __always_inline void off_t userptr_t src
Definition: efi_uaccess.h:66
uint32_t len
Length.
Definition: ena.h:14

References len, memcpy(), and src.

◆ pubkey_null_init()

static int pubkey_null_init ( void *ctx  __unused,
const void *key  __unused,
size_t key_len  __unused 
)
static

Definition at line 89 of file crypto_null.c.

90  {
91  return 0;
92 }

◆ pubkey_null_max_len()

static size_t pubkey_null_max_len ( void *ctx  __unused)
static

Definition at line 94 of file crypto_null.c.

94  {
95  return 0;
96 }

◆ pubkey_null_encrypt()

static int pubkey_null_encrypt ( void *ctx  __unused,
const void *plaintext  __unused,
size_t plaintext_len  __unused,
void *ciphertext  __unused 
)
static

Definition at line 98 of file crypto_null.c.

101  {
102  return 0;
103 }

◆ pubkey_null_decrypt()

static int pubkey_null_decrypt ( void *ctx  __unused,
const void *ciphertext  __unused,
size_t ciphertext_len  __unused,
void *plaintext  __unused 
)
static

Definition at line 105 of file crypto_null.c.

108  {
109  return 0;
110 }

◆ pubkey_null_sign()

static int pubkey_null_sign ( void *ctx  __unused,
struct digest_algorithm *digest  __unused,
const void *value  __unused,
void *signature  __unused 
)
static

Definition at line 112 of file crypto_null.c.

115  {
116  return 0;
117 }

◆ pubkey_null_verify()

static int pubkey_null_verify ( void *ctx  __unused,
struct digest_algorithm *digest  __unused,
const void *value  __unused,
const void *signature  __unused,
size_t signature_len  __unused 
)
static

Definition at line 119 of file crypto_null.c.

123  {
124  return 0;
125 }

◆ pubkey_null_final()

static void pubkey_null_final ( void *ctx  __unused)
static

Definition at line 127 of file crypto_null.c.

127  {
128  /* Do nothing */
129 }

Variable Documentation

◆ digest_null

struct digest_algorithm digest_null
Initial value:
= {
.name = "null",
.ctxsize = 0,
.blocksize = 1,
.digestsize = 0,
.update = digest_null_update,
}
static void digest_null_final(void *ctx __unused, void *out __unused)
Definition: crypto_null.c:44
static void digest_null_update(void *ctx __unused, const void *src __unused, size_t len __unused)
Definition: crypto_null.c:39
static void digest_null_init(void *ctx __unused)
Definition: crypto_null.c:35

Definition at line 48 of file crypto_null.c.

◆ cipher_null

struct cipher_algorithm cipher_null
Initial value:
= {
.name = "null",
.ctxsize = 0,
.blocksize = 1,
.setkey = cipher_null_setkey,
.encrypt = cipher_null_encrypt,
.decrypt = cipher_null_decrypt,
}
static void cipher_null_encrypt(void *ctx __unused, const void *src, void *dst, size_t len)
Definition: crypto_null.c:69
static int cipher_null_setkey(void *ctx __unused, const void *key __unused, size_t keylen __unused)
Definition: crypto_null.c:58
static void cipher_null_decrypt(void *ctx __unused, const void *src, void *dst, size_t len)
Definition: crypto_null.c:74
static void cipher_null_setiv(void *ctx __unused, const void *iv __unused)
Definition: crypto_null.c:64

Definition at line 79 of file crypto_null.c.

◆ pubkey_null

struct pubkey_algorithm pubkey_null
Initial value:
= {
.name = "null",
.ctxsize = 0,
.max_len = pubkey_null_max_len,
.encrypt = pubkey_null_encrypt,
.decrypt = pubkey_null_decrypt,
.verify = pubkey_null_verify,
}
static void pubkey_null_final(void *ctx __unused)
Definition: crypto_null.c:127
static int pubkey_null_sign(void *ctx __unused, struct digest_algorithm *digest __unused, const void *value __unused, void *signature __unused)
Definition: crypto_null.c:112
static size_t pubkey_null_max_len(void *ctx __unused)
Definition: crypto_null.c:94
static int pubkey_null_verify(void *ctx __unused, struct digest_algorithm *digest __unused, const void *value __unused, const void *signature __unused, size_t signature_len __unused)
Definition: crypto_null.c:119
static int pubkey_null_decrypt(void *ctx __unused, const void *ciphertext __unused, size_t ciphertext_len __unused, void *plaintext __unused)
Definition: crypto_null.c:105
static int pubkey_null_init(void *ctx __unused, const void *key __unused, size_t key_len __unused)
Definition: crypto_null.c:89
static int pubkey_null_encrypt(void *ctx __unused, const void *plaintext __unused, size_t plaintext_len __unused, void *ciphertext __unused)
Definition: crypto_null.c:98

Definition at line 131 of file crypto_null.c.