xref: /freebsd/crypto/openssl/include/openssl/idea.h (revision 8aac90f18aef7c9eea906c3ff9a001ca7b94f375)
1 /*
2  * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
3  *
4  * Licensed under the Apache License 2.0 (the "License").  You may not use
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
8  */
9 
10 #ifndef OPENSSL_IDEA_H
11 # define OPENSSL_IDEA_H
12 # pragma once
13 
14 # include <openssl/macros.h>
15 # ifndef OPENSSL_NO_DEPRECATED_3_0
16 #  define HEADER_IDEA_H
17 # endif
18 
19 # include <openssl/opensslconf.h>
20 
21 # ifndef OPENSSL_NO_IDEA
22 #  ifdef  __cplusplus
23 extern "C" {
24 #  endif
25 
26 #  define IDEA_BLOCK      8
27 #  define IDEA_KEY_LENGTH 16
28 
29 #  ifndef OPENSSL_NO_DEPRECATED_3_0
30 
31 typedef unsigned int IDEA_INT;
32 
33 #   define IDEA_ENCRYPT    1
34 #   define IDEA_DECRYPT    0
35 
36 typedef struct idea_key_st {
37     IDEA_INT data[9][6];
38 } IDEA_KEY_SCHEDULE;
39 #endif
40 #ifndef OPENSSL_NO_DEPRECATED_3_0
41 OSSL_DEPRECATEDIN_3_0 const char *IDEA_options(void);
42 OSSL_DEPRECATEDIN_3_0 void IDEA_ecb_encrypt(const unsigned char *in,
43                                             unsigned char *out,
44                                             IDEA_KEY_SCHEDULE *ks);
45 OSSL_DEPRECATEDIN_3_0 void IDEA_set_encrypt_key(const unsigned char *key,
46                                                 IDEA_KEY_SCHEDULE *ks);
47 OSSL_DEPRECATEDIN_3_0 void IDEA_set_decrypt_key(IDEA_KEY_SCHEDULE *ek,
48                                                 IDEA_KEY_SCHEDULE *dk);
49 OSSL_DEPRECATEDIN_3_0 void IDEA_cbc_encrypt(const unsigned char *in,
50                                             unsigned char *out, long length,
51                                             IDEA_KEY_SCHEDULE *ks,
52                                             unsigned char *iv, int enc);
53 OSSL_DEPRECATEDIN_3_0 void IDEA_cfb64_encrypt(const unsigned char *in,
54                                               unsigned char *out, long length,
55                                               IDEA_KEY_SCHEDULE *ks,
56                                               unsigned char *iv, int *num,
57                                               int enc);
58 OSSL_DEPRECATEDIN_3_0 void IDEA_ofb64_encrypt(const unsigned char *in,
59                                               unsigned char *out, long length,
60                                               IDEA_KEY_SCHEDULE *ks,
61                                               unsigned char *iv, int *num);
62 OSSL_DEPRECATEDIN_3_0 void IDEA_encrypt(unsigned long *in,
63                                         IDEA_KEY_SCHEDULE *ks);
64 #endif
65 
66 #  ifndef OPENSSL_NO_DEPRECATED_1_1_0
67 #   define idea_options          IDEA_options
68 #   define idea_ecb_encrypt      IDEA_ecb_encrypt
69 #   define idea_set_encrypt_key  IDEA_set_encrypt_key
70 #   define idea_set_decrypt_key  IDEA_set_decrypt_key
71 #   define idea_cbc_encrypt      IDEA_cbc_encrypt
72 #   define idea_cfb64_encrypt    IDEA_cfb64_encrypt
73 #   define idea_ofb64_encrypt    IDEA_ofb64_encrypt
74 #   define idea_encrypt          IDEA_encrypt
75 #  endif
76 
77 #  ifdef  __cplusplus
78 }
79 #  endif
80 # endif
81 
82 #endif
83