Macros | Functions | Variables
cast.c File Reference
#include <openssl/cast.h>
#include <openssl/cipher.h>
#include <openssl/obj.h>
#include "../../crypto/internal.h"
#include "internal.h"
#include "../macros.h"
Include dependency graph for cast.c:

Go to the source code of this file.

Macros

#define CAST_exp(l, A, a, n)
 
#define E_CAST(n, key, L, R, OP1, OP2, OP3)
 
#define S4   CAST_S_table4
 
#define S5   CAST_S_table5
 
#define S6   CAST_S_table6
 
#define S7   CAST_S_table7
 

Functions

static int cast_cbc_cipher (EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, size_t len)
 
void CAST_cbc_encrypt (const uint8_t *in, uint8_t *out, size_t length, const CAST_KEY *ks, uint8_t *iv, int enc)
 
void CAST_cfb64_encrypt (const uint8_t *in, uint8_t *out, size_t length, const CAST_KEY *schedule, uint8_t *ivec, int *num, int enc)
 
void CAST_decrypt (uint32_t *data, const CAST_KEY *key)
 
static int cast_ecb_cipher (EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, size_t len)
 
void CAST_ecb_encrypt (const uint8_t *in, uint8_t *out, const CAST_KEY *ks, int enc)
 
void CAST_encrypt (uint32_t *data, const CAST_KEY *key)
 
static int cast_init_key (EVP_CIPHER_CTX *ctx, const uint8_t *key, const uint8_t *iv, int enc)
 
void CAST_set_key (CAST_KEY *key, size_t len, const uint8_t *data)
 
const EVP_CIPHEREVP_cast5_cbc (void)
 
const EVP_CIPHEREVP_cast5_ecb (void)
 

Variables

static const EVP_CIPHER cast5_cbc
 
static const EVP_CIPHER cast5_ecb
 

Macro Definition Documentation

◆ CAST_exp

#define CAST_exp (   l,
  A,
  a,
  n 
)
Value:
A[n / 4] = l; \
a[n + 3] = (l)&0xff; \
a[n + 2] = (l >> 8) & 0xff; \
a[n + 1] = (l >> 16) & 0xff; \
a[n + 0] = (l >> 24) & 0xff;

Definition at line 239 of file cast.c.

◆ E_CAST

#define E_CAST (   n,
  key,
  L,
  R,
  OP1,
  OP2,
  OP3 
)
Value:
{ \
uint32_t a, b, c, d; \
t = (key[n * 2] OP1 R) & 0xffffffff; \
t = CRYPTO_rotl_u32(t, (key[n * 2 + 1])); \
a = CAST_S_table0[(t >> 8) & 0xff]; \
b = CAST_S_table1[(t)&0xff]; \
c = CAST_S_table2[(t >> 24) & 0xff]; \
d = CAST_S_table3[(t >> 16) & 0xff]; \
L ^= (((((a OP2 b)&0xffffffffL)OP3 c) & 0xffffffffL) OP1 d) & 0xffffffffL; \
}

Definition at line 87 of file cast.c.

◆ S4

#define S4   CAST_S_table4

Definition at line 245 of file cast.c.

◆ S5

#define S5   CAST_S_table5

Definition at line 246 of file cast.c.

◆ S6

#define S6   CAST_S_table6

Definition at line 247 of file cast.c.

◆ S7

#define S7   CAST_S_table7

Definition at line 248 of file cast.c.

Function Documentation

◆ cast_cbc_cipher()

static int cast_cbc_cipher ( EVP_CIPHER_CTX ctx,
uint8_t out,
const uint8_t in,
size_t  len 
)
static

Definition at line 431 of file cast.c.

◆ CAST_cbc_encrypt()

void CAST_cbc_encrypt ( const uint8_t in,
uint8_t out,
size_t  length,
const CAST_KEY ks,
uint8_t iv,
int  enc 
)

Definition at line 163 of file cast.c.

◆ CAST_cfb64_encrypt()

void CAST_cfb64_encrypt ( const uint8_t in,
uint8_t out,
size_t  length,
const CAST_KEY schedule,
uint8_t ivec,
int num,
int  enc 
)

Definition at line 353 of file cast.c.

◆ CAST_decrypt()

void CAST_decrypt ( uint32_t data,
const CAST_KEY key 
)

Definition at line 131 of file cast.c.

◆ cast_ecb_cipher()

static int cast_ecb_cipher ( EVP_CIPHER_CTX ctx,
uint8_t out,
const uint8_t in,
size_t  len 
)
static

Definition at line 416 of file cast.c.

◆ CAST_ecb_encrypt()

void CAST_ecb_encrypt ( const uint8_t in,
uint8_t out,
const CAST_KEY ks,
int  enc 
)

Definition at line 72 of file cast.c.

◆ CAST_encrypt()

void CAST_encrypt ( uint32_t data,
const CAST_KEY key 
)

Definition at line 99 of file cast.c.

◆ cast_init_key()

static int cast_init_key ( EVP_CIPHER_CTX ctx,
const uint8_t key,
const uint8_t iv,
int  enc 
)
static

Definition at line 409 of file cast.c.

◆ CAST_set_key()

void CAST_set_key ( CAST_KEY key,
size_t  len,
const uint8_t data 
)

Definition at line 250 of file cast.c.

◆ EVP_cast5_cbc()

const EVP_CIPHER* EVP_cast5_cbc ( void  )

Definition at line 458 of file cast.c.

◆ EVP_cast5_ecb()

const EVP_CIPHER* EVP_cast5_ecb ( void  )

Definition at line 456 of file cast.c.

Variable Documentation

◆ cast5_cbc

const EVP_CIPHER cast5_cbc
static
Initial value:

Definition at line 447 of file cast.c.

◆ cast5_ecb

const EVP_CIPHER cast5_ecb
static
Initial value:

Definition at line 438 of file cast.c.

NID_cast5_cbc
#define NID_cast5_cbc
Definition: nid.h:577
EVP_CIPH_VARIABLE_LENGTH
#define EVP_CIPH_VARIABLE_LENGTH
Definition: cipher.h:357
CAST_S_table2
const uint32_t CAST_S_table2[256]
Definition: cast_tables.c:154
CAST_KEY
struct cast_key_st CAST_KEY
CAST_KEY_LENGTH
#define CAST_KEY_LENGTH
Definition: cast.h:71
CRYPTO_rotl_u32
static uint32_t CRYPTO_rotl_u32(uint32_t value, int shift)
Definition: third_party/boringssl-with-bazel/src/crypto/internal.h:899
a
int a
Definition: abseil-cpp/absl/container/internal/hash_policy_traits_test.cc:88
CAST_BLOCK
#define CAST_BLOCK
Definition: cast.h:70
cast_init_key
static int cast_init_key(EVP_CIPHER_CTX *ctx, const uint8_t *key, const uint8_t *iv, int enc)
Definition: cast.c:409
c
void c(T a)
Definition: miscompile_with_no_unique_address_test.cc:40
cast_cbc_cipher
static int cast_cbc_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, size_t len)
Definition: cast.c:431
CAST_S_table1
const uint32_t CAST_S_table1[256]
Definition: cast_tables.c:108
b
uint64_t b
Definition: abseil-cpp/absl/container/internal/layout_test.cc:53
d
static const fe d
Definition: curve25519_tables.h:19
n
int n
Definition: abseil-cpp/absl/container/btree_test.cc:1080
EVP_CIPH_CBC_MODE
#define EVP_CIPH_CBC_MODE
Definition: cipher.h:345
CAST_S_table0
const uint32_t CAST_S_table0[256]
Definition: cast_tables.c:62
key
const char * key
Definition: hpack_parser_table.cc:164
absl::str_format_internal::LengthMod::t
@ t
A
Definition: miscompile_with_no_unique_address_test.cc:23
NID_cast5_ecb
#define NID_cast5_ecb
Definition: nid.h:582
CAST_S_table3
const uint32_t CAST_S_table3[256]
Definition: cast_tables.c:200
run_grpclb_interop_tests.l
dictionary l
Definition: run_grpclb_interop_tests.py:410
cast_ecb_cipher
static int cast_ecb_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, size_t len)
Definition: cast.c:416
EVP_CIPH_ECB_MODE
#define EVP_CIPH_ECB_MODE
Definition: cipher.h:344


grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:05