| 1 |
// Copyright (C) 1995-1998 Eric Young ([email protected]) All rights reserved. |
| 2 |
// SPDX-License-Identifier: Apache-2.0 |
| 3 |
|
| 4 |
#ifndef OPENSSL_HEADER_CAST_INTERNAL_H |
| 5 |
#define OPENSSL_HEADER_CAST_INTERNAL_H |
| 6 |
|
| 7 |
#include <openssl/base.h> |
| 8 |
|
| 9 |
#if defined(__cplusplus) |
| 10 |
extern "C" { |
| 11 |
#endif |
| 12 |
|
| 13 |
struct cast_key_st { |
| 14 |
uint32_t data[32]; |
| 15 |
int short_key; // Use reduced rounds for short key |
| 16 |
} /* CAST_KEY */; |
| 17 |
|
| 18 |
extern const uint32_t CAST_S_table0[256]; |
| 19 |
extern const uint32_t CAST_S_table1[256]; |
| 20 |
extern const uint32_t CAST_S_table2[256]; |
| 21 |
extern const uint32_t CAST_S_table3[256]; |
| 22 |
extern const uint32_t CAST_S_table4[256]; |
| 23 |
extern const uint32_t CAST_S_table5[256]; |
| 24 |
extern const uint32_t CAST_S_table6[256]; |
| 25 |
extern const uint32_t CAST_S_table7[256]; |
| 26 |
|
| 27 |
#define CAST_BLOCK 8 |
| 28 |
#define CAST_KEY_LENGTH 16 |
| 29 |
|
| 30 |
void CAST_set_key(CAST_KEY *key, size_t len, const uint8_t *data); |
| 31 |
void CAST_ecb_encrypt(const uint8_t *in, uint8_t *out, const CAST_KEY *key, |
| 32 |
int enc); |
| 33 |
void CAST_encrypt(uint32_t *data, const CAST_KEY *key); |
| 34 |
void CAST_decrypt(uint32_t *data, const CAST_KEY *key); |
| 35 |
void CAST_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length, |
| 36 |
const CAST_KEY *ks, uint8_t *iv, int enc); |
| 37 |
|
| 38 |
#if defined(__cplusplus) |
| 39 |
} // extern C |
| 40 |
#endif |
| 41 |
|
| 42 |
#endif // OPENSSL_HEADER_CAST_INTERNAL_H |