Go to the documentation of this file.
61 #if defined(OPENSSL_WINDOWS)
67 #include "../../crypto/internal.h"
69 #include "../macros.h"
87 #define E_CAST(n, key, L, R, OP1, OP2, OP3) \
89 uint32_t a, b, c, d; \
90 t = (key[n * 2] OP1 R) & 0xffffffff; \
91 t = CRYPTO_rotl_u32(t, (key[n * 2 + 1])); \
92 a = CAST_S_table0[(t >> 8) & 0xff]; \
93 b = CAST_S_table1[(t)&0xff]; \
94 c = CAST_S_table2[(t >> 24) & 0xff]; \
95 d = CAST_S_table3[(t >> 16) & 0xff]; \
96 L ^= (((((a OP2 b)&0xffffffffL)OP3 c) & 0xffffffffL) OP1 d) & 0xffffffffL; \
120 if (!
key->short_key) {
127 data[1] =
l & 0xffffffff
L;
128 data[0] =
r & 0xffffffff
L;
139 if (!
key->short_key) {
159 data[1] =
l & 0xffffffff
L;
160 data[0] =
r & 0xffffffff
L;
212 tout0 = tin[0] ^ xor0;
213 tout1 = tin[1] ^ xor1;
226 tout0 = tin[0] ^ xor0;
227 tout1 = tin[1] ^ xor1;
235 tin0 = tin1 = tout0 = tout1 = xor0 = xor1 = 0;
239 #define CAST_exp(l, A, a, n) \
241 a[n + 3] = (l)&0xff; \
242 a[n + 2] = (l >> 8) & 0xff; \
243 a[n + 1] = (l >> 16) & 0xff; \
244 a[n + 0] = (l >> 24) & 0xff;
245 #define S4 CAST_S_table4
246 #define S5 CAST_S_table5
247 #define S6 CAST_S_table6
248 #define S7 CAST_S_table7
258 for (
i = 0;
i < 16;
i++) {
266 for (
i = 0;
i <
len;
i++) {
277 X[0] = ((
x[0] << 24) | (
x[1] << 16) | (
x[2] << 8) |
x[3]) & 0xffffffff
L;
278 X[1] = ((
x[4] << 24) | (
x[5] << 16) | (
x[6] << 8) |
x[7]) & 0xffffffff
L;
279 X[2] = ((
x[8] << 24) | (
x[9] << 16) | (
x[10] << 8) |
x[11]) & 0xffffffff
L;
280 X[3] = ((
x[12] << 24) | (
x[13] << 16) | (
x[14] << 8) |
x[15]) & 0xffffffff
L;
344 for (
i = 0;
i < 16;
i++) {
346 key->data[
i * 2 + 1] = ((
k[
i + 16]) + 16) & 0x1f;
405 v0 = v1 =
ti[0] =
ti[1] = t =
c = cc = 0;
#define EVP_CIPH_VARIABLE_LENGTH
#define E_CAST(n, key, L, R, OP1, OP2, OP3)
#define n2ln(c, l1, l2, n)
void CAST_set_key(CAST_KEY *key, size_t len, const uint8_t *data)
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)
struct cast_key_st CAST_KEY
static const EVP_CIPHER cast5_cbc
void CAST_decrypt(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)
#define CAST_exp(l, A, a, n)
const EVP_CIPHER * EVP_cast5_ecb(void)
static int cast_cbc_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, size_t len)
OPENSSL_MSVC_PRAGMA(warning(disable:4702))
static const EVP_CIPHER cast5_ecb
void CAST_encrypt(uint32_t *data, const CAST_KEY *key)
#define EVP_CIPH_CBC_MODE
int push(void *desc, unsigned char *buf, unsigned len)
void CAST_ecb_encrypt(const uint8_t *in, uint8_t *out, const CAST_KEY *ks, int enc)
const EVP_CIPHER * EVP_cast5_cbc(void)
void CAST_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length, const CAST_KEY *ks, uint8_t *iv, int enc)
#define l2nn(l1, l2, c, n)
static int cast_ecb_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, size_t len)
#define EVP_CIPH_ECB_MODE
grpc
Author(s):
autogenerated on Fri May 16 2025 02:57:52