diff options
author | Richard Levitte <levitte@openssl.org> | 2001-10-24 21:21:12 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2001-10-24 21:21:12 +0000 |
commit | c2e4f17c1a0d4d5115c6ede9492de1615fe392ac (patch) | |
tree | 14dda5edeaebac01b4baa3aa026c40a784a44266 /crypto/evp/e_des3.c | |
parent | 979689aa5cfa100ccbc1f25064e9398be4b7b05c (diff) | |
download | openssl-c2e4f17c1a0d4d5115c6ede9492de1615fe392ac.tar.gz |
Due to an increasing number of clashes between modern OpenSSL and
libdes (which is still used out there) or other des implementations,
the OpenSSL DES functions are renamed to begin with DES_ instead of
des_. Compatibility routines are provided and declared by including
openssl/des_old.h. Those declarations are the same as were in des.h
when the OpenSSL project started, which is exactly how libdes looked
at that time, and hopefully still looks today.
The compatibility functions will be removed in some future release, at
the latest in version 1.0.
Diffstat (limited to 'crypto/evp/e_des3.c')
-rw-r--r-- | crypto/evp/e_des3.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/crypto/evp/e_des3.c b/crypto/evp/e_des3.c index 7a18cb618b..13b396c5d2 100644 --- a/crypto/evp/e_des3.c +++ b/crypto/evp/e_des3.c @@ -72,9 +72,9 @@ static int des_ede3_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, typedef struct { - des_key_schedule ks1;/* key schedule */ - des_key_schedule ks2;/* key schedule (for ede) */ - des_key_schedule ks3;/* key schedule (for ede3) */ + DES_key_schedule ks1;/* key schedule */ + DES_key_schedule ks2;/* key schedule (for ede) */ + DES_key_schedule ks3;/* key schedule (for ede3) */ } DES_EDE_KEY; #define data(ctx) ((DES_EDE_KEY *)(ctx)->cipher_data) @@ -85,7 +85,7 @@ static int des_ede_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, unsigned int inl) { BLOCK_CIPHER_ecb_loop() - des_ecb3_encrypt((des_cblock *)(in + i), (des_cblock *)(out + i), + DES_ecb3_encrypt((DES_cblock *)(in + i), (DES_cblock *)(out + i), &data(ctx)->ks1, &data(ctx)->ks2, &data(ctx)->ks3, ctx->encrypt); @@ -95,9 +95,9 @@ static int des_ede_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, static int des_ede_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, unsigned int inl) { - des_ede3_ofb64_encrypt(in, out, (long)inl, + DES_ede3_ofb64_encrypt(in, out, (long)inl, &data(ctx)->ks1, &data(ctx)->ks2, &data(ctx)->ks3, - (des_cblock *)ctx->iv, &ctx->num); + (DES_cblock *)ctx->iv, &ctx->num); return 1; } @@ -115,18 +115,18 @@ static int des_ede_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, printf("\n"); } #endif /* KSSL_DEBUG */ - des_ede3_cbc_encrypt(in, out, (long)inl, + DES_ede3_cbc_encrypt(in, out, (long)inl, &data(ctx)->ks1, &data(ctx)->ks2, &data(ctx)->ks3, - (des_cblock *)ctx->iv, ctx->encrypt); + (DES_cblock *)ctx->iv, ctx->encrypt); return 1; } static int des_ede_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, unsigned int inl) { - des_ede3_cfb64_encrypt(in, out, (long)inl, + DES_ede3_cfb64_encrypt(in, out, (long)inl, &data(ctx)->ks1, &data(ctx)->ks2, &data(ctx)->ks3, - (des_cblock *)ctx->iv, &ctx->num, ctx->encrypt); + (DES_cblock *)ctx->iv, &ctx->num, ctx->encrypt); return 1; } @@ -150,10 +150,10 @@ BLOCK_CIPHER_defs(des_ede3, DES_EDE_KEY, NID_des_ede3, 8, 24, 8, static int des_ede_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[0],&data(ctx)->ks1); - des_set_key_unchecked(&deskey[1],&data(ctx)->ks2); + DES_set_key_unchecked(&deskey[0],&data(ctx)->ks1); + DES_set_key_unchecked(&deskey[1],&data(ctx)->ks2); memcpy(&data(ctx)->ks3,&data(ctx)->ks1, sizeof(data(ctx)->ks1)); return 1; @@ -162,7 +162,7 @@ static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, static int des_ede3_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; #ifdef KSSL_DEBUG { int i; @@ -174,9 +174,9 @@ static int des_ede3_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, } #endif /* KSSL_DEBUG */ - des_set_key_unchecked(&deskey[0],&data(ctx)->ks1); - des_set_key_unchecked(&deskey[1],&data(ctx)->ks2); - des_set_key_unchecked(&deskey[2],&data(ctx)->ks3); + DES_set_key_unchecked(&deskey[0],&data(ctx)->ks1); + DES_set_key_unchecked(&deskey[1],&data(ctx)->ks2); + DES_set_key_unchecked(&deskey[2],&data(ctx)->ks3); return 1; } |