summaryrefslogtreecommitdiffstats
path: root/crypto/evp/e_cast.c
diff options
context:
space:
mode:
authorBen Laurie <ben@openssl.org>2001-07-31 01:57:25 +0200
committerBen Laurie <ben@openssl.org>2001-07-31 01:57:25 +0200
commitdbad169019598981174ff46c7a9bf58373b0e53a (patch)
treece8ca1188d5614648f24b03967785543f1edc8f5 /crypto/evp/e_cast.c
parentMake EVPs allocate context memory, thus making them extensible. Rationalise (diff)
downloadopenssl-dbad169019598981174ff46c7a9bf58373b0e53a.tar.xz
openssl-dbad169019598981174ff46c7a9bf58373b0e53a.zip
Really add the EVP and all of the DES changes.
Diffstat (limited to 'crypto/evp/e_cast.c')
-rw-r--r--crypto/evp/e_cast.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/crypto/evp/e_cast.c b/crypto/evp/e_cast.c
index 7116e1aed2..3d4079c4dd 100644
--- a/crypto/evp/e_cast.c
+++ b/crypto/evp/e_cast.c
@@ -63,19 +63,27 @@
#include <openssl/evp.h>
#include <openssl/objects.h>
#include "evp_locl.h"
+#include <openssl/cast.h>
static int cast_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
const unsigned char *iv,int enc);
-IMPLEMENT_BLOCK_CIPHER(cast5, cast_ks, CAST, cast_ks,
- NID_cast5, 8, EVP_CAST5_KEY_SIZE, 8,
+typedef struct
+ {
+ CAST_KEY ks;
+ } EVP_CAST_KEY;
+
+#define data(ctx) EVP_C_DATA(EVP_CAST_KEY,ctx)
+
+IMPLEMENT_BLOCK_CIPHER(cast5, ks, CAST, EVP_CAST_KEY,
+ NID_cast5, 8, CAST_KEY_LENGTH, 8,
EVP_CIPH_VARIABLE_LENGTH, cast_init_key, NULL,
EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, NULL)
static int cast_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
const unsigned char *iv, int enc)
{
- CAST_set_key(&(ctx->c.cast_ks),EVP_CIPHER_CTX_key_length(ctx),key);
+ CAST_set_key(&data(ctx)->ks,EVP_CIPHER_CTX_key_length(ctx),key);
return 1;
}