]>
Commit | Line | Data |
---|---|---|
21dcbebc RS |
1 | /* |
2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. | |
d02b48c6 | 3 | * |
48f4ad77 | 4 | * Licensed under the Apache License 2.0 (the "License"). You may not use |
21dcbebc RS |
5 | * this file except in compliance with the License. You can obtain a copy |
6 | * in the file LICENSE in the source distribution or at | |
7 | * https://www.openssl.org/source/license.html | |
d02b48c6 RE |
8 | */ |
9 | ||
ae4186b0 DMSP |
10 | #ifndef OPENSSL_IDEA_H |
11 | # define OPENSSL_IDEA_H | |
d86167ec DMSP |
12 | # pragma once |
13 | ||
14 | # include <openssl/macros.h> | |
936c2b9e | 15 | # ifndef OPENSSL_NO_DEPRECATED_3_0 |
d86167ec DMSP |
16 | # define HEADER_IDEA_H |
17 | # endif | |
d02b48c6 | 18 | |
3e9e810f | 19 | # include <openssl/opensslconf.h> |
83054771 | 20 | |
3c27208f RS |
21 | # ifndef OPENSSL_NO_IDEA |
22 | # ifdef __cplusplus | |
23 | extern "C" { | |
0f113f3e | 24 | # endif |
f5d7a031 | 25 | |
3e9e810f RS |
26 | typedef unsigned int IDEA_INT; |
27 | ||
0f113f3e MC |
28 | # define IDEA_ENCRYPT 1 |
29 | # define IDEA_DECRYPT 0 | |
d02b48c6 | 30 | |
0f113f3e MC |
31 | # define IDEA_BLOCK 8 |
32 | # define IDEA_KEY_LENGTH 16 | |
d02b48c6 | 33 | |
0f113f3e MC |
34 | typedef struct idea_key_st { |
35 | IDEA_INT data[9][6]; | |
36 | } IDEA_KEY_SCHEDULE; | |
d02b48c6 | 37 | |
9021a5df RS |
38 | const char *IDEA_options(void); |
39 | void IDEA_ecb_encrypt(const unsigned char *in, unsigned char *out, | |
0f113f3e | 40 | IDEA_KEY_SCHEDULE *ks); |
9021a5df RS |
41 | void IDEA_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks); |
42 | void IDEA_set_decrypt_key(IDEA_KEY_SCHEDULE *ek, IDEA_KEY_SCHEDULE *dk); | |
43 | void IDEA_cbc_encrypt(const unsigned char *in, unsigned char *out, | |
0f113f3e MC |
44 | long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, |
45 | int enc); | |
9021a5df | 46 | void IDEA_cfb64_encrypt(const unsigned char *in, unsigned char *out, |
0f113f3e MC |
47 | long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, |
48 | int *num, int enc); | |
9021a5df | 49 | void IDEA_ofb64_encrypt(const unsigned char *in, unsigned char *out, |
0f113f3e MC |
50 | long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, |
51 | int *num); | |
9021a5df RS |
52 | void IDEA_encrypt(unsigned long *in, IDEA_KEY_SCHEDULE *ks); |
53 | ||
fcd2d5a6 | 54 | # if !OPENSSL_API_1_1_0 |
9021a5df RS |
55 | # define idea_options IDEA_options |
56 | # define idea_ecb_encrypt IDEA_ecb_encrypt | |
57 | # define idea_set_encrypt_key IDEA_set_encrypt_key | |
58 | # define idea_set_decrypt_key IDEA_set_decrypt_key | |
59 | # define idea_cbc_encrypt IDEA_cbc_encrypt | |
60 | # define idea_cfb64_encrypt IDEA_cfb64_encrypt | |
61 | # define idea_ofb64_encrypt IDEA_ofb64_encrypt | |
62 | # define idea_encrypt IDEA_encrypt | |
63 | # endif | |
64 | ||
3c27208f | 65 | # ifdef __cplusplus |
d02b48c6 | 66 | } |
3c27208f RS |
67 | # endif |
68 | # endif | |
d02b48c6 RE |
69 | |
70 | #endif |