From 4ab2163263b4cbaa3a3992461e1449c13ed08788 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se> Date: Mon, 4 Dec 2023 21:18:07 +0100 Subject: [PATCH] Delete benchmarking of openssl blowfish, cast128 and des. --- ChangeLog | 5 +++ examples/nettle-benchmark.c | 6 ++-- examples/nettle-openssl.c | 64 ------------------------------------- non-nettle.h | 3 -- 4 files changed, 8 insertions(+), 70 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7544d36c..075ab197 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2023-12-04 Niels Möller <nisse@lysator.liu.se> + * examples/nettle-openssl.c (nettle_openssl_blowfish128) + (nettle_openssl_des, openssl_cast128_set_encrypt_key): Deleted, + since these algorithms are now available in openssl only via the + "legacy provider". Also deleted declarations and usage. + * examples/hogweed-benchmark.c (struct openssl_ctx): Unified struct, replacing openssl_rsa_ctx and openssl_ecdsa_ctx. (bench_openssl_init, bench_openssl_sign, bench_openssl_verify) diff --git a/examples/nettle-benchmark.c b/examples/nettle-benchmark.c index 1b72d838..37073a67 100644 --- a/examples/nettle-benchmark.c +++ b/examples/nettle-benchmark.c @@ -934,10 +934,10 @@ main(int argc, char **argv) OPENSSL(&nettle_openssl_aes128) OPENSSL(&nettle_openssl_aes192) OPENSSL(&nettle_openssl_aes256) - &nettle_blowfish128, OPENSSL(&nettle_openssl_blowfish128) + &nettle_blowfish128, &nettle_camellia128, &nettle_camellia192, &nettle_camellia256, - &nettle_cast128, OPENSSL(&nettle_openssl_cast128) - &nettle_des, OPENSSL(&nettle_openssl_des) + &nettle_cast128, + &nettle_des, &nettle_des3, &nettle_serpent256, &nettle_twofish128, &nettle_twofish192, &nettle_twofish256, diff --git a/examples/nettle-openssl.c b/examples/nettle-openssl.c index 31905f08..0d798617 100644 --- a/examples/nettle-openssl.c +++ b/examples/nettle-openssl.c @@ -298,70 +298,6 @@ nettle_openssl_gcm_aes256 = { openssl_evp_gcm_digest }; -/* Blowfish */ -static void -openssl_bf128_set_encrypt_key(void *ctx, const uint8_t *key) -{ - openssl_evp_set_encrypt_key(ctx, key, EVP_bf_ecb()); -} - -static void -openssl_bf128_set_decrypt_key(void *ctx, const uint8_t *key) -{ - openssl_evp_set_decrypt_key(ctx, key, EVP_bf_ecb()); -} - -const struct nettle_cipher -nettle_openssl_blowfish128 = { - "openssl bf128", sizeof(struct openssl_cipher_ctx), - 8, 16, - openssl_bf128_set_encrypt_key, openssl_bf128_set_decrypt_key, - openssl_evp_encrypt, openssl_evp_decrypt -}; - - -/* DES */ -static void -openssl_des_set_encrypt_key(void *ctx, const uint8_t *key) -{ - openssl_evp_set_encrypt_key(ctx, key, EVP_des_ecb()); -} - -static void -openssl_des_set_decrypt_key(void *ctx, const uint8_t *key) -{ - openssl_evp_set_decrypt_key(ctx, key, EVP_des_ecb()); -} - -const struct nettle_cipher -nettle_openssl_des = { - "openssl des", sizeof(struct openssl_cipher_ctx), - 8, 8, - openssl_des_set_encrypt_key, openssl_des_set_decrypt_key, - openssl_evp_encrypt, openssl_evp_decrypt -}; - - -/* Cast128 */ -static void -openssl_cast128_set_encrypt_key(void *ctx, const uint8_t *key) -{ - openssl_evp_set_encrypt_key(ctx, key, EVP_cast5_ecb()); -} - -static void -openssl_cast128_set_decrypt_key(void *ctx, const uint8_t *key) -{ - openssl_evp_set_decrypt_key(ctx, key, EVP_cast5_ecb()); -} - -const struct nettle_cipher -nettle_openssl_cast128 = { - "openssl cast128", sizeof(struct openssl_cipher_ctx), - 8, 16, - openssl_cast128_set_encrypt_key, openssl_cast128_set_decrypt_key, - openssl_evp_encrypt, openssl_evp_decrypt -}; /* Hash functions */ diff --git a/non-nettle.h b/non-nettle.h index ecf8c536..7075540a 100644 --- a/non-nettle.h +++ b/non-nettle.h @@ -75,9 +75,6 @@ extern void nettle_openssl_init(void); extern const struct nettle_cipher nettle_openssl_aes128; extern const struct nettle_cipher nettle_openssl_aes192; extern const struct nettle_cipher nettle_openssl_aes256; -extern const struct nettle_cipher nettle_openssl_blowfish128; -extern const struct nettle_cipher nettle_openssl_des; -extern const struct nettle_cipher nettle_openssl_cast128; extern const struct nettle_hash nettle_openssl_md5; extern const struct nettle_hash nettle_openssl_sha1; -- GitLab