diff options
author | beck <> | 1999-09-29 04:37:45 +0000 |
---|---|---|
committer | beck <> | 1999-09-29 04:37:45 +0000 |
commit | de8f24ea083384bb66b32ec105dc4743c5663cdf (patch) | |
tree | 1412176ae62a3cab2cf2b0b92150fcbceaac6092 /src/lib/libcrypto/evp/e_cfb_d.c | |
parent | cb929d29896bcb87c2a97417fbd03e50078fc178 (diff) | |
download | openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.gz openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.bz2 openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.zip |
OpenSSL 0.9.4 merge
Diffstat (limited to 'src/lib/libcrypto/evp/e_cfb_d.c')
-rw-r--r-- | src/lib/libcrypto/evp/e_cfb_d.c | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/src/lib/libcrypto/evp/e_cfb_d.c b/src/lib/libcrypto/evp/e_cfb_d.c index 9ae4558f51..6bdf20b646 100644 --- a/src/lib/libcrypto/evp/e_cfb_d.c +++ b/src/lib/libcrypto/evp/e_cfb_d.c | |||
@@ -58,19 +58,14 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include "evp.h" | 61 | #include <openssl/evp.h> |
62 | #include "objects.h" | 62 | #include <openssl/objects.h> |
63 | 63 | ||
64 | #ifndef NOPROTO | 64 | #ifndef NO_DES |
65 | static void des_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 65 | static void des_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
66 | unsigned char *iv,int enc); | 66 | unsigned char *iv,int enc); |
67 | static void des_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 67 | static void des_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
68 | unsigned char *in, unsigned int inl); | 68 | unsigned char *in, unsigned int inl); |
69 | #else | ||
70 | static void des_cfb_init_key(); | ||
71 | static void des_cfb_cipher(); | ||
72 | #endif | ||
73 | |||
74 | static EVP_CIPHER d_cfb_cipher= | 69 | static EVP_CIPHER d_cfb_cipher= |
75 | { | 70 | { |
76 | NID_des_cfb64, | 71 | NID_des_cfb64, |
@@ -84,31 +79,27 @@ static EVP_CIPHER d_cfb_cipher= | |||
84 | EVP_CIPHER_get_asn1_iv, | 79 | EVP_CIPHER_get_asn1_iv, |
85 | }; | 80 | }; |
86 | 81 | ||
87 | EVP_CIPHER *EVP_des_cfb() | 82 | EVP_CIPHER *EVP_des_cfb(void) |
88 | { | 83 | { |
89 | return(&d_cfb_cipher); | 84 | return(&d_cfb_cipher); |
90 | } | 85 | } |
91 | 86 | ||
92 | static void des_cfb_init_key(ctx,key,iv,enc) | 87 | static void des_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
93 | EVP_CIPHER_CTX *ctx; | 88 | unsigned char *iv, int enc) |
94 | unsigned char *key; | ||
95 | unsigned char *iv; | ||
96 | int enc; | ||
97 | { | 89 | { |
90 | des_cblock *deskey = (des_cblock *)key; | ||
91 | |||
98 | ctx->num=0; | 92 | ctx->num=0; |
99 | 93 | ||
100 | if (iv != NULL) | 94 | if (iv != NULL) |
101 | memcpy(&(ctx->oiv[0]),iv,8); | 95 | memcpy(&(ctx->oiv[0]),iv,8); |
102 | memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); | 96 | memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); |
103 | if (key != NULL) | 97 | if (deskey != NULL) |
104 | des_set_key((des_cblock *)key,ctx->c.des_ks); | 98 | des_set_key(deskey,ctx->c.des_ks); |
105 | } | 99 | } |
106 | 100 | ||
107 | static void des_cfb_cipher(ctx,out,in,inl) | 101 | static void des_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
108 | EVP_CIPHER_CTX *ctx; | 102 | unsigned char *in, unsigned int inl) |
109 | unsigned char *out; | ||
110 | unsigned char *in; | ||
111 | unsigned int inl; | ||
112 | { | 103 | { |
113 | des_cfb64_encrypt( | 104 | des_cfb64_encrypt( |
114 | in,out, | 105 | in,out, |
@@ -116,3 +107,4 @@ unsigned int inl; | |||
116 | (des_cblock *)&(ctx->iv[0]), | 107 | (des_cblock *)&(ctx->iv[0]), |
117 | &ctx->num,ctx->encrypt); | 108 | &ctx->num,ctx->encrypt); |
118 | } | 109 | } |
110 | #endif | ||