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 ( GPL2_OR_LATER_OR_UBDL  )
static void digest_null_init ( void *ctx  __unused) [static]

Definition at line 35 of file crypto_null.c.

                                                    {
        /* Do nothing */
}
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.

                                                       {
        /* Do nothing */
}
static void digest_null_final ( void *ctx  __unused,
void *out  __unused 
) [static]

Definition at line 44 of file crypto_null.c.

                                                                         {
        /* Do nothing */
}
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.

                                                         {
        /* Do nothing */
        return 0;
}
static void cipher_null_setiv ( void *ctx  __unused,
const void *iv  __unused 
) [static]

Definition at line 64 of file crypto_null.c.

                                                          {
        /* Do nothing */
}
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.

References memcpy().

                                                          {
        memcpy ( dst, src, len );
}
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.

References memcpy().

                                                          {
        memcpy ( dst, src, len );
}
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.

                                                        {
        return 0;
}
static size_t pubkey_null_max_len ( void *ctx  __unused) [static]

Definition at line 94 of file crypto_null.c.

                                                         {
        return 0;
}
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.

                                                             {
        return 0;
}
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.

                                                            {
        return 0;
}
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.

                                                         {
        return 0;
}
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.

                                                                {
        return 0;
}
static void pubkey_null_final ( void *ctx  __unused) [static]

Definition at line 127 of file crypto_null.c.

                                                     {
        /* Do nothing */
}

Variable Documentation

Initial value:
 {
        .name = "null",
        .ctxsize = 0,
        .blocksize = 1,
        .digestsize = 0,
        .init = digest_null_init,
        .update = digest_null_update,
        .final = digest_null_final,
}

Definition at line 48 of file crypto_null.c.

Initial value:
 {
        .name = "null",
        .ctxsize = 0,
        .blocksize = 1,
        .setkey = cipher_null_setkey,
        .setiv = cipher_null_setiv,
        .encrypt = cipher_null_encrypt,
        .decrypt = cipher_null_decrypt,
}

Definition at line 79 of file crypto_null.c.

Initial value:
 {
        .name = "null",
        .ctxsize = 0,
        .init = pubkey_null_init,
        .max_len = pubkey_null_max_len,
        .encrypt = pubkey_null_encrypt,
        .decrypt = pubkey_null_decrypt,
        .sign = pubkey_null_sign,
        .verify = pubkey_null_verify,
        .final = pubkey_null_final,
}

Definition at line 131 of file crypto_null.c.