projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
There may be more than one single quote to fix.
[oweals/openssl.git]
/
crypto
/
evp
/
e_des.c
diff --git
a/crypto/evp/e_des.c
b/crypto/evp/e_des.c
index 485133a2343459f4f6b73bd40e1147cef635e445..105266a4b3645e31b11b6d0b17e8b66285aa0241 100644
(file)
--- a/
crypto/evp/e_des.c
+++ b/
crypto/evp/e_des.c
@@
-56,56
+56,63
@@
* [including the GNU Public Licence.]
*/
* [including the GNU Public Licence.]
*/
-#ifndef NO_DES
+#ifndef
OPENSSL_
NO_DES
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/objects.h>
#include "evp_locl.h"
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/objects.h>
#include "evp_locl.h"
+#include <openssl/des.h>
-static int des_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
-
unsigned char *iv,
int enc);
+static int des_init_key(EVP_CIPHER_CTX *ctx,
const
unsigned char *key,
+
const unsigned char *iv,
int enc);
/* Because of various casts and different names can't use IMPLEMENT_BLOCK_CIPHER */
/* 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, unsigned char *in, unsigned int inl)
+static int des_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
+ const unsigned char *in, unsigned int inl)
{
BLOCK_CIPHER_ecb_loop()
{
BLOCK_CIPHER_ecb_loop()
-
des_ecb_encrypt((des_cblock *)(in + i), (des_cblock *)(out + i), ctx->c.des_ks
, ctx->encrypt);
+
DES_ecb_encrypt((DES_cblock *)(in + i), (DES_cblock *)(out + i), ctx->cipher_data
, ctx->encrypt);
return 1;
}
return 1;
}
-static int des_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, unsigned char *in, unsigned int inl)
+static int des_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
+ const unsigned char *in, unsigned int inl)
{
{
-
des_ofb64_encrypt(in, out, (long)inl, ctx->c.des_ks, (des
_cblock *)ctx->iv, &ctx->num);
+
DES_ofb64_encrypt(in, out, (long)inl, ctx->cipher_data, (DES
_cblock *)ctx->iv, &ctx->num);
return 1;
}
return 1;
}
-static int des_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, unsigned char *in, unsigned int inl)
+static int des_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
+ const unsigned char *in, unsigned int inl)
{
{
- des_ncbc_encrypt(in, out, (long)inl, ctx->c.des_ks, (des_cblock *)ctx->iv, ctx->encrypt);
+ DES_ncbc_encrypt(in, out, (long)inl, ctx->cipher_data,
+ (DES_cblock *)ctx->iv, ctx->encrypt);
return 1;
}
return 1;
}
-static int des_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, unsigned char *in, unsigned int inl)
+static int des_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
+ const unsigned char *in, unsigned int inl)
{
{
- des_cfb64_encrypt(in, out, (long)inl, ctx->c.des_ks, (des_cblock *)ctx->iv, &ctx->num, ctx->encrypt);
+ DES_cfb64_encrypt(in, out, (long)inl, ctx->cipher_data,
+ (DES_cblock *)ctx->iv, &ctx->num, ctx->encrypt);
return 1;
}
return 1;
}
-BLOCK_CIPHER_defs(des,
des_ks, NID_des, 8, 8, 8
,
+BLOCK_CIPHER_defs(des,
DES_key_schedule, NID_des, 8, 8, 8, 64
,
0, des_init_key, NULL,
EVP_CIPHER_set_asn1_iv,
EVP_CIPHER_get_asn1_iv,
NULL)
0, des_init_key, NULL,
EVP_CIPHER_set_asn1_iv,
EVP_CIPHER_get_asn1_iv,
NULL)
-static int des_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
- unsigned char *iv, int enc)
+static int des_init_key(EVP_CIPHER_CTX *ctx,
const
unsigned char *key,
+
const
unsigned char *iv, int enc)
{
{
-
des_cblock *deskey = (des
_cblock *)key;
+
DES_cblock *deskey = (DES
_cblock *)key;
-
des_set_key_unchecked(deskey,ctx->c.des_ks
);
+
DES_set_key_unchecked(deskey,ctx->cipher_data
);
return 1;
}
return 1;
}