Files
openssl/crypto/evp/e_des3.c
Matt Caswell 32eaa748a3 Cleanup block cipher macros in include/crypto/evp.h
Remove some unneeded deadcode and fix the formatting

Also fix all users of those macros to avoid compilation warnings

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29446)
2026-01-12 08:31:38 +00:00

63 lines
1.6 KiB
C

/*
* Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#include <stdio.h>
#include "internal/cryptlib.h"
#ifndef OPENSSL_NO_DES
#include <openssl/objects.h>
#include "crypto/evp.h"
#include <openssl/des.h>
#include <openssl/rand.h>
#include "evp_local.h"
BLOCK_CIPHER_defs(des_ede, DES_EDE_KEY, NID_des_ede, 8, 16, 8, 64,
EVP_CIPH_RAND_KEY | EVP_CIPH_FLAG_DEFAULT_ASN1,
NULL, NULL, NULL, NULL, NULL)
BLOCK_CIPHER_defs(des_ede3, DES_EDE_KEY, NID_des_ede3, 8, 24, 8, 64,
EVP_CIPH_RAND_KEY | EVP_CIPH_FLAG_DEFAULT_ASN1,
NULL, NULL, NULL, NULL, NULL)
BLOCK_CIPHER_def_cfb(des_ede3, DES_EDE_KEY, NID_des_ede3, 24, 8, 1,
EVP_CIPH_RAND_KEY | EVP_CIPH_FLAG_DEFAULT_ASN1,
NULL, NULL, NULL, NULL, des3_NULLctrl)
BLOCK_CIPHER_def_cfb(des_ede3, DES_EDE_KEY, NID_des_ede3, 24, 8, 8,
EVP_CIPH_RAND_KEY | EVP_CIPH_FLAG_DEFAULT_ASN1,
NULL, NULL, NULL, NULL, NULL)
const EVP_CIPHER *EVP_des_ede(void)
{
return &des_ede_ecb;
}
const EVP_CIPHER *EVP_des_ede3(void)
{
return &des_ede3_ecb;
}
static const EVP_CIPHER des3_wrap = {
NID_id_smime_alg_CMS3DESwrap,
8, 24, 0,
EVP_CIPH_WRAP_MODE | EVP_CIPH_CUSTOM_IV | EVP_CIPH_FLAG_CUSTOM_CIPHER
| EVP_CIPH_FLAG_DEFAULT_ASN1,
EVP_ORIG_GLOBAL,
NULL, NULL,
NULL,
0,
NULL, NULL, NULL, NULL
};
const EVP_CIPHER *EVP_des_ede3_wrap(void)
{
return &des3_wrap;
}
#endif