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_IDEA_H
|
jpayne@69
|
11 # define HEADER_IDEA_H
|
jpayne@69
|
12
|
jpayne@69
|
13 # include <openssl/opensslconf.h>
|
jpayne@69
|
14
|
jpayne@69
|
15 # ifndef OPENSSL_NO_IDEA
|
jpayne@69
|
16 # ifdef __cplusplus
|
jpayne@69
|
17 extern "C" {
|
jpayne@69
|
18 # endif
|
jpayne@69
|
19
|
jpayne@69
|
20 typedef unsigned int IDEA_INT;
|
jpayne@69
|
21
|
jpayne@69
|
22 # define IDEA_ENCRYPT 1
|
jpayne@69
|
23 # define IDEA_DECRYPT 0
|
jpayne@69
|
24
|
jpayne@69
|
25 # define IDEA_BLOCK 8
|
jpayne@69
|
26 # define IDEA_KEY_LENGTH 16
|
jpayne@69
|
27
|
jpayne@69
|
28 typedef struct idea_key_st {
|
jpayne@69
|
29 IDEA_INT data[9][6];
|
jpayne@69
|
30 } IDEA_KEY_SCHEDULE;
|
jpayne@69
|
31
|
jpayne@69
|
32 const char *IDEA_options(void);
|
jpayne@69
|
33 void IDEA_ecb_encrypt(const unsigned char *in, unsigned char *out,
|
jpayne@69
|
34 IDEA_KEY_SCHEDULE *ks);
|
jpayne@69
|
35 void IDEA_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks);
|
jpayne@69
|
36 void IDEA_set_decrypt_key(IDEA_KEY_SCHEDULE *ek, IDEA_KEY_SCHEDULE *dk);
|
jpayne@69
|
37 void IDEA_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
jpayne@69
|
38 long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,
|
jpayne@69
|
39 int enc);
|
jpayne@69
|
40 void IDEA_cfb64_encrypt(const unsigned char *in, unsigned char *out,
|
jpayne@69
|
41 long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,
|
jpayne@69
|
42 int *num, int enc);
|
jpayne@69
|
43 void IDEA_ofb64_encrypt(const unsigned char *in, unsigned char *out,
|
jpayne@69
|
44 long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,
|
jpayne@69
|
45 int *num);
|
jpayne@69
|
46 void IDEA_encrypt(unsigned long *in, IDEA_KEY_SCHEDULE *ks);
|
jpayne@69
|
47
|
jpayne@69
|
48 # if OPENSSL_API_COMPAT < 0x10100000L
|
jpayne@69
|
49 # define idea_options IDEA_options
|
jpayne@69
|
50 # define idea_ecb_encrypt IDEA_ecb_encrypt
|
jpayne@69
|
51 # define idea_set_encrypt_key IDEA_set_encrypt_key
|
jpayne@69
|
52 # define idea_set_decrypt_key IDEA_set_decrypt_key
|
jpayne@69
|
53 # define idea_cbc_encrypt IDEA_cbc_encrypt
|
jpayne@69
|
54 # define idea_cfb64_encrypt IDEA_cfb64_encrypt
|
jpayne@69
|
55 # define idea_ofb64_encrypt IDEA_ofb64_encrypt
|
jpayne@69
|
56 # define idea_encrypt IDEA_encrypt
|
jpayne@69
|
57 # endif
|
jpayne@69
|
58
|
jpayne@69
|
59 # ifdef __cplusplus
|
jpayne@69
|
60 }
|
jpayne@69
|
61 # endif
|
jpayne@69
|
62 # endif
|
jpayne@69
|
63
|
jpayne@69
|
64 #endif
|