diff options
Diffstat (limited to 'crypto/evp/e_cast.c')
-rw-r--r-- | crypto/evp/e_cast.c | 14 |
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; } |