summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp/e_bf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/evp/e_bf.c')
-rw-r--r--src/lib/libcrypto/evp/e_bf.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/lib/libcrypto/evp/e_bf.c b/src/lib/libcrypto/evp/e_bf.c
index f4e0c4c093..745c4d3201 100644
--- a/src/lib/libcrypto/evp/e_bf.c
+++ b/src/lib/libcrypto/evp/e_bf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_bf.c,v 1.9 2022/09/03 19:43:16 jsing Exp $ */ 1/* $OpenBSD: e_bf.c,v 1.10 2022/09/04 13:17:18 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -68,9 +68,6 @@
68 68
69#include "evp_locl.h" 69#include "evp_locl.h"
70 70
71static int bf_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
72 const unsigned char *iv, int enc);
73
74typedef struct { 71typedef struct {
75 BF_KEY ks; 72 BF_KEY ks;
76} EVP_BF_KEY; 73} EVP_BF_KEY;
@@ -78,6 +75,14 @@ typedef struct {
78#define data(ctx) ((EVP_BF_KEY *)(ctx)->cipher_data) 75#define data(ctx) ((EVP_BF_KEY *)(ctx)->cipher_data)
79 76
80static int 77static int
78bf_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
79 const unsigned char *iv, int enc)
80{
81 BF_set_key(&data(ctx)->ks, EVP_CIPHER_CTX_key_length(ctx), key);
82 return 1;
83}
84
85static int
81bf_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) 86bf_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl)
82{ 87{
83 while (inl >= EVP_MAXCHUNK) { 88 while (inl >= EVP_MAXCHUNK) {
@@ -237,13 +242,4 @@ EVP_bf_ecb(void)
237{ 242{
238 return &bf_ecb; 243 return &bf_ecb;
239} 244}
240
241
242static int
243bf_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
244 const unsigned char *iv, int enc)
245{
246 BF_set_key(&data(ctx)->ks, EVP_CIPHER_CTX_key_length(ctx), key);
247 return 1;
248}
249#endif 245#endif