jpayne@69
|
1 /*
|
jpayne@69
|
2 * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
|
jpayne@69
|
3 *
|
jpayne@69
|
4 * Licensed under the OpenSSL license (the "License"). You may not use
|
jpayne@69
|
5 * this file except in compliance with the License. You can obtain a copy
|
jpayne@69
|
6 * in the file LICENSE in the source distribution or at
|
jpayne@69
|
7 * https://www.openssl.org/source/license.html
|
jpayne@69
|
8 */
|
jpayne@69
|
9
|
jpayne@69
|
10 #ifndef HEADER_CAST_H
|
jpayne@69
|
11 # define HEADER_CAST_H
|
jpayne@69
|
12
|
jpayne@69
|
13 # include <openssl/opensslconf.h>
|
jpayne@69
|
14
|
jpayne@69
|
15 # ifndef OPENSSL_NO_CAST
|
jpayne@69
|
16 # ifdef __cplusplus
|
jpayne@69
|
17 extern "C" {
|
jpayne@69
|
18 # endif
|
jpayne@69
|
19
|
jpayne@69
|
20 # define CAST_ENCRYPT 1
|
jpayne@69
|
21 # define CAST_DECRYPT 0
|
jpayne@69
|
22
|
jpayne@69
|
23 # define CAST_LONG unsigned int
|
jpayne@69
|
24
|
jpayne@69
|
25 # define CAST_BLOCK 8
|
jpayne@69
|
26 # define CAST_KEY_LENGTH 16
|
jpayne@69
|
27
|
jpayne@69
|
28 typedef struct cast_key_st {
|
jpayne@69
|
29 CAST_LONG data[32];
|
jpayne@69
|
30 int short_key; /* Use reduced rounds for short key */
|
jpayne@69
|
31 } CAST_KEY;
|
jpayne@69
|
32
|
jpayne@69
|
33 void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data);
|
jpayne@69
|
34 void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out,
|
jpayne@69
|
35 const CAST_KEY *key, int enc);
|
jpayne@69
|
36 void CAST_encrypt(CAST_LONG *data, const CAST_KEY *key);
|
jpayne@69
|
37 void CAST_decrypt(CAST_LONG *data, const CAST_KEY *key);
|
jpayne@69
|
38 void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
jpayne@69
|
39 long length, const CAST_KEY *ks, unsigned char *iv,
|
jpayne@69
|
40 int enc);
|
jpayne@69
|
41 void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out,
|
jpayne@69
|
42 long length, const CAST_KEY *schedule,
|
jpayne@69
|
43 unsigned char *ivec, int *num, int enc);
|
jpayne@69
|
44 void CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out,
|
jpayne@69
|
45 long length, const CAST_KEY *schedule,
|
jpayne@69
|
46 unsigned char *ivec, int *num);
|
jpayne@69
|
47
|
jpayne@69
|
48 # ifdef __cplusplus
|
jpayne@69
|
49 }
|
jpayne@69
|
50 # endif
|
jpayne@69
|
51 # endif
|
jpayne@69
|
52
|
jpayne@69
|
53 #endif
|