]>
Commit | Line | Data |
---|---|---|
21dcbebc | 1 | /* |
33388b44 | 2 | * Copyright 1995-2020 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_BLOWFISH_H |
11 | # define OPENSSL_BLOWFISH_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_BLOWFISH_H |
17 | # endif | |
d02b48c6 | 18 | |
3c27208f | 19 | # include <openssl/opensslconf.h> |
cf1b7d96 | 20 | |
3c27208f RS |
21 | # ifndef OPENSSL_NO_BF |
22 | # include <openssl/e_os2.h> | |
23 | # ifdef __cplusplus | |
d02b48c6 | 24 | extern "C" { |
0f113f3e | 25 | # endif |
f5d7a031 | 26 | |
03047e7b MC |
27 | # define BF_BLOCK 8 |
28 | ||
29 | # ifndef OPENSSL_NO_DEPRECATED_3_0 | |
30 | ||
31 | # define BF_ENCRYPT 1 | |
32 | # define BF_DECRYPT 0 | |
d02b48c6 | 33 | |
1d97c843 | 34 | /*- |
8cd8a7b7 | 35 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
04f8bcf1 | 36 | * ! BF_LONG has to be at least 32 bits wide. ! |
8cd8a7b7 UM |
37 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
38 | */ | |
03047e7b | 39 | # define BF_LONG unsigned int |
d02b48c6 | 40 | |
03047e7b | 41 | # define BF_ROUNDS 16 |
d02b48c6 | 42 | |
0f113f3e MC |
43 | typedef struct bf_key_st { |
44 | BF_LONG P[BF_ROUNDS + 2]; | |
45 | BF_LONG S[4 * 256]; | |
46 | } BF_KEY; | |
d02b48c6 | 47 | |
03047e7b | 48 | # endif /* OPENSSL_NO_DEPRECATED_3_0 */ |
6638749f RL |
49 | # ifndef OPENSSL_NO_DEPRECATED_3_0 |
50 | OSSL_DEPRECATEDIN_3_0 void BF_set_key(BF_KEY *key, int len, | |
51 | const unsigned char *data); | |
52 | OSSL_DEPRECATEDIN_3_0 void BF_encrypt(BF_LONG *data, const BF_KEY *key); | |
53 | OSSL_DEPRECATEDIN_3_0 void BF_decrypt(BF_LONG *data, const BF_KEY *key); | |
54 | OSSL_DEPRECATEDIN_3_0 void BF_ecb_encrypt(const unsigned char *in, | |
55 | unsigned char *out, const BF_KEY *key, | |
56 | int enc); | |
57 | OSSL_DEPRECATEDIN_3_0 void BF_cbc_encrypt(const unsigned char *in, | |
58 | unsigned char *out, long length, | |
59 | const BF_KEY *schedule, | |
60 | unsigned char *ivec, int enc); | |
61 | OSSL_DEPRECATEDIN_3_0 void BF_cfb64_encrypt(const unsigned char *in, | |
62 | unsigned char *out, | |
63 | long length, const BF_KEY *schedule, | |
64 | unsigned char *ivec, int *num, | |
65 | int enc); | |
66 | OSSL_DEPRECATEDIN_3_0 void BF_ofb64_encrypt(const unsigned char *in, | |
67 | unsigned char *out, | |
68 | long length, const BF_KEY *schedule, | |
69 | unsigned char *ivec, int *num); | |
70 | OSSL_DEPRECATEDIN_3_0 const char *BF_options(void); | |
71 | # endif | |
d02b48c6 | 72 | |
3c27208f | 73 | # ifdef __cplusplus |
d02b48c6 | 74 | } |
3c27208f RS |
75 | # endif |
76 | # endif | |
d02b48c6 RE |
77 | |
78 | #endif |