Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:38

0001 /*
0002  * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
0003  *
0004  * Licensed under the Apache License 2.0 (the "License").  You may not use
0005  * this file except in compliance with the License.  You can obtain a copy
0006  * in the file LICENSE in the source distribution or at
0007  * https://www.openssl.org/source/license.html
0008  */
0009 
0010 #ifndef OPENSSL_BLOWFISH_H
0011 # define OPENSSL_BLOWFISH_H
0012 # pragma once
0013 
0014 # include <openssl/macros.h>
0015 # ifndef OPENSSL_NO_DEPRECATED_3_0
0016 #  define HEADER_BLOWFISH_H
0017 # endif
0018 
0019 # include <openssl/opensslconf.h>
0020 
0021 # ifndef OPENSSL_NO_BF
0022 # include <openssl/e_os2.h>
0023 # ifdef  __cplusplus
0024 extern "C" {
0025 # endif
0026 
0027 # define BF_BLOCK        8
0028 
0029 # ifndef OPENSSL_NO_DEPRECATED_3_0
0030 
0031 #  define BF_ENCRYPT      1
0032 #  define BF_DECRYPT      0
0033 
0034 /*-
0035  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
0036  * ! BF_LONG has to be at least 32 bits wide.                     !
0037  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
0038  */
0039 #  define BF_LONG unsigned int
0040 
0041 #  define BF_ROUNDS       16
0042 
0043 typedef struct bf_key_st {
0044     BF_LONG P[BF_ROUNDS + 2];
0045     BF_LONG S[4 * 256];
0046 } BF_KEY;
0047 
0048 # endif /* OPENSSL_NO_DEPRECATED_3_0 */
0049 # ifndef OPENSSL_NO_DEPRECATED_3_0
0050 OSSL_DEPRECATEDIN_3_0 void BF_set_key(BF_KEY *key, int len,
0051                                       const unsigned char *data);
0052 OSSL_DEPRECATEDIN_3_0 void BF_encrypt(BF_LONG *data, const BF_KEY *key);
0053 OSSL_DEPRECATEDIN_3_0 void BF_decrypt(BF_LONG *data, const BF_KEY *key);
0054 OSSL_DEPRECATEDIN_3_0 void BF_ecb_encrypt(const unsigned char *in,
0055                                           unsigned char *out, const BF_KEY *key,
0056                                           int enc);
0057 OSSL_DEPRECATEDIN_3_0 void BF_cbc_encrypt(const unsigned char *in,
0058                                           unsigned char *out, long length,
0059                                           const BF_KEY *schedule,
0060                                           unsigned char *ivec, int enc);
0061 OSSL_DEPRECATEDIN_3_0 void BF_cfb64_encrypt(const unsigned char *in,
0062                                             unsigned char *out,
0063                                             long length, const BF_KEY *schedule,
0064                                             unsigned char *ivec, int *num,
0065                                             int enc);
0066 OSSL_DEPRECATEDIN_3_0 void BF_ofb64_encrypt(const unsigned char *in,
0067                                             unsigned char *out,
0068                                             long length, const BF_KEY *schedule,
0069                                             unsigned char *ivec, int *num);
0070 OSSL_DEPRECATEDIN_3_0 const char *BF_options(void);
0071 # endif
0072 
0073 # ifdef  __cplusplus
0074 }
0075 # endif
0076 # endif
0077 
0078 #endif