From b3d43b123cca4f1412e8dea8afb759404d187ffa Mon Sep 17 00:00:00 2001 From: jsing Date: Sat, 3 Sep 2022 20:12:24 +0000 Subject: [PATCH] Remove now unused IMPLEMENT_BLOCK_CIPHER macro. Also remove various comments noting that it cannot be used for certain block ciphers (which kinda defeats the purpose of having a generic implementation in the first place). --- lib/libcrypto/evp/e_des.c | 4 +--- lib/libcrypto/evp/e_des3.c | 4 +--- lib/libcrypto/evp/e_idea.c | 4 +--- lib/libcrypto/evp/evp_locl.h | 11 +---------- 4 files changed, 4 insertions(+), 19 deletions(-) diff --git a/lib/libcrypto/evp/e_des.c b/lib/libcrypto/evp/e_des.c index ad91720ff1c..118e59695f2 100644 --- a/lib/libcrypto/evp/e_des.c +++ b/lib/libcrypto/evp/e_des.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_des.c,v 1.14 2015/10/12 06:05:52 guenther Exp $ */ +/* $OpenBSD: e_des.c,v 1.15 2022/09/03 20:12:24 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -72,8 +72,6 @@ static int des_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, const unsigned char *iv, int enc); static int des_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr); -/* Because of various casts and different names can't use IMPLEMENT_BLOCK_CIPHER */ - static int des_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) diff --git a/lib/libcrypto/evp/e_des3.c b/lib/libcrypto/evp/e_des3.c index 01388397633..cc01c69b5e0 100644 --- a/lib/libcrypto/evp/e_des3.c +++ b/lib/libcrypto/evp/e_des3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_des3.c,v 1.20 2019/05/14 15:40:44 beck Exp $ */ +/* $OpenBSD: e_des3.c,v 1.21 2022/09/03 20:12:24 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -85,8 +85,6 @@ typedef struct { #define data(ctx) ((DES_EDE_KEY *)(ctx)->cipher_data) -/* Because of various casts and different args can't use IMPLEMENT_BLOCK_CIPHER */ - static int des_ede_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) diff --git a/lib/libcrypto/evp/e_idea.c b/lib/libcrypto/evp/e_idea.c index 454ad4e6722..b2240b3043b 100644 --- a/lib/libcrypto/evp/e_idea.c +++ b/lib/libcrypto/evp/e_idea.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_idea.c,v 1.10 2015/09/10 15:56:25 jsing Exp $ */ +/* $OpenBSD: e_idea.c,v 1.11 2022/09/03 20:12:24 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -85,8 +85,6 @@ idea_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, return 1; } -/* Can't use IMPLEMENT_BLOCK_CIPHER because idea_ecb_encrypt is different */ - typedef struct { IDEA_KEY_SCHEDULE ks; } EVP_IDEA_KEY; diff --git a/lib/libcrypto/evp/evp_locl.h b/lib/libcrypto/evp/evp_locl.h index 43e0ac333d8..c5ff49d2b27 100644 --- a/lib/libcrypto/evp/evp_locl.h +++ b/lib/libcrypto/evp/evp_locl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: evp_locl.h,v 1.23 2022/05/05 08:42:27 tb Exp $ */ +/* $OpenBSD: evp_locl.h,v 1.24 2022/09/03 20:12:24 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -371,15 +371,6 @@ static const EVP_CIPHER cname##_ecb = {\ const EVP_CIPHER *EVP_##cname##_ecb(void) { return &cname##_ecb; } */ -#define IMPLEMENT_BLOCK_CIPHER(cname, ksched, cprefix, kstruct, nid, \ - block_size, key_len, iv_len, cbits, \ - flags, init_key, \ - cleanup, set_asn1, get_asn1, ctrl) \ - BLOCK_CIPHER_all_funcs(cname, cprefix, cbits, kstruct, ksched) \ - BLOCK_CIPHER_defs(cname, kstruct, nid, block_size, key_len, iv_len, \ - cbits, flags, init_key, cleanup, set_asn1, \ - get_asn1, ctrl) - #define EVP_C_DATA(kstruct, ctx) ((kstruct *)(ctx)->cipher_data) #define IMPLEMENT_CFBR(cipher,cprefix,kstruct,ksched,keysize,cbits,iv_len) \ -- 2.20.1