Debian Codegraph @

debian/rust-vendor/aws-lc-sys/aws-lc/include/openssl/blowfish.h

raw
1 // Copyright (C) 1995-1998 Eric Young ([email protected]) All rights reserved.
2 // SPDX-License-Identifier: Apache-2.0
3
4 #ifndef OPENSSL_HEADER_BLOWFISH_H
5 #define OPENSSL_HEADER_BLOWFISH_H
6
7 #include <openssl/base.h>
8
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12
13
14 #define BF_ENCRYPT 1
15 #define BF_DECRYPT 0
16
17 #define BF_ROUNDS 16
18 #define BF_BLOCK 8
19
20 typedef struct bf_key_st {
21 uint32_t P[BF_ROUNDS + 2];
22 uint32_t S[4 * 256];
23 } BF_KEY;
24
25 OPENSSL_DEPRECATED OPENSSL_EXPORT void BF_set_key(BF_KEY *key, size_t len,
26 const uint8_t *data);
27 OPENSSL_DEPRECATED OPENSSL_EXPORT void BF_encrypt(uint32_t *data,
28 const BF_KEY *key);
29 OPENSSL_DEPRECATED OPENSSL_EXPORT void BF_decrypt(uint32_t *data,
30 const BF_KEY *key);
31
32 OPENSSL_DEPRECATED OPENSSL_EXPORT void BF_ecb_encrypt(const uint8_t *in,
33 uint8_t *out,
34 const BF_KEY *key,
35 int enc);
36 OPENSSL_DEPRECATED OPENSSL_EXPORT void BF_cbc_encrypt(const uint8_t *in,
37 uint8_t *out,
38 size_t length,
39 const BF_KEY *schedule,
40 uint8_t *ivec, int enc);
41
42 OPENSSL_DEPRECATED OPENSSL_EXPORT void BF_cfb64_encrypt(
43 const uint8_t *in, uint8_t *out, size_t length, const BF_KEY *schedule,
44 uint8_t *ivec, int *num, int encrypt);
45
46 OPENSSL_DEPRECATED OPENSSL_EXPORT void BF_ofb64_encrypt(
47 const uint8_t *in, uint8_t *out, size_t length, const BF_KEY *schedule,
48 uint8_t *ivec, int *num);
49
50 #ifdef __cplusplus
51 }
52 #endif
53
54 #endif // OPENSSL_HEADER_BLOWFISH_H