iPXE
des.h File Reference

DES algorithm. More...

#include <ipxe/crypto.h>

Go to the source code of this file.

Data Structures

union  des_dword
 A DES 32-bit dword value. More...
union  des_block
 A DES 64-bit block. More...
union  des_round_key
 A DES round key. More...
struct  des_context
 DES context. More...

Macros

#define DES_BLOCKSIZE   sizeof ( union des_block )
 DES blocksize.
#define DES_ROUNDS   16
 Number of DES rounds.
#define DES_CTX_SIZE   sizeof ( struct des_context )
 DES context size.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 FILE_SECBOOT (PERMITTED)

Variables

struct cipher_algorithm des_algorithm
 Basic DES algorithm.
struct cipher_algorithm des_ecb_algorithm
struct cipher_algorithm des_cbc_algorithm

Detailed Description

DES algorithm.

Definition in file des.h.

Macro Definition Documentation

◆ DES_BLOCKSIZE

#define DES_BLOCKSIZE   sizeof ( union des_block )

DES blocksize.

Definition at line 50 of file des.h.

Referenced by CBC_CIPHER(), des_decrypt(), des_encrypt(), des_setkey(), and ECB_CIPHER().

◆ DES_ROUNDS

#define DES_ROUNDS   16

Number of DES rounds.

Definition at line 77 of file des.h.

Referenced by des_decrypt(), des_rounds(), and des_setkey().

◆ DES_CTX_SIZE

#define DES_CTX_SIZE   sizeof ( struct des_context )

DES context size.

Definition at line 86 of file des.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )

◆ FILE_SECBOOT()

FILE_SECBOOT ( PERMITTED )

Variable Documentation

◆ des_algorithm

struct cipher_algorithm des_algorithm
extern

Basic DES algorithm.

Definition at line 678 of file des.c.

678 {
679 .name = "des",
680 .ctxsize = sizeof ( struct des_context ),
681 .blocksize = DES_BLOCKSIZE,
682 .alignsize = 0,
683 .authsize = 0,
684 .setkey = des_setkey,
685 .setiv = cipher_null_setiv,
686 .encrypt = des_encrypt,
687 .decrypt = des_decrypt,
688 .auth = cipher_null_auth,
689};
void cipher_null_setiv(void *ctx __unused, const void *iv __unused, size_t ivlen __unused)
Definition crypto_null.c:65
void cipher_null_auth(void *ctx __unused, void *auth __unused)
Definition crypto_null.c:80
static int des_setkey(void *ctx, const void *key, size_t keylen)
Set key.
Definition des.c:588
static void des_decrypt(void *ctx, const void *src, void *dst, size_t len)
Decrypt data.
Definition des.c:666
static void des_encrypt(void *ctx, const void *src, void *dst, size_t len)
Encrypt data.
Definition des.c:648
#define DES_BLOCKSIZE
DES blocksize.
Definition des.h:50
DES context.
Definition des.h:80

Referenced by CBC_CIPHER(), ECB_CIPHER(), and mschapv2_challenge_response().

◆ des_ecb_algorithm

struct cipher_algorithm des_ecb_algorithm
extern

◆ des_cbc_algorithm

struct cipher_algorithm des_cbc_algorithm
extern