diff options
Diffstat (limited to 'src/lib/libcrypto/evp/evp_locl.h')
-rw-r--r-- | src/lib/libcrypto/evp/evp_locl.h | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/lib/libcrypto/evp/evp_locl.h b/src/lib/libcrypto/evp/evp_locl.h index 073b0adcff..f8c5343620 100644 --- a/src/lib/libcrypto/evp/evp_locl.h +++ b/src/lib/libcrypto/evp/evp_locl.h | |||
@@ -65,7 +65,7 @@ | |||
65 | bl = ctx->cipher->block_size;\ | 65 | bl = ctx->cipher->block_size;\ |
66 | if(inl < bl) return 1;\ | 66 | if(inl < bl) return 1;\ |
67 | inl -= bl; \ | 67 | inl -= bl; \ |
68 | for(i=0; i <= inl; i+=bl) | 68 | for(i=0; i <= inl; i+=bl) \ |
69 | 69 | ||
70 | #define BLOCK_CIPHER_func_ecb(cname, cprefix, kstruct, ksched) \ | 70 | #define BLOCK_CIPHER_func_ecb(cname, cprefix, kstruct, ksched) \ |
71 | static int cname##_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, unsigned int inl) \ | 71 | static int cname##_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, unsigned int inl) \ |
@@ -92,7 +92,7 @@ static int cname##_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const uns | |||
92 | #define BLOCK_CIPHER_func_cfb(cname, cprefix, cbits, kstruct, ksched) \ | 92 | #define BLOCK_CIPHER_func_cfb(cname, cprefix, cbits, kstruct, ksched) \ |
93 | static int cname##_cfb##cbits##_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, unsigned int inl) \ | 93 | static int cname##_cfb##cbits##_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, unsigned int inl) \ |
94 | {\ | 94 | {\ |
95 | cprefix##_cfb##cbits##_encrypt(in, out, (long)(cbits==1?inl*8:inl), &((kstruct *)ctx->cipher_data)->ksched, ctx->iv, &ctx->num, ctx->encrypt);\ | 95 | cprefix##_cfb##cbits##_encrypt(in, out, (long)inl, &((kstruct *)ctx->cipher_data)->ksched, ctx->iv, &ctx->num, ctx->encrypt);\ |
96 | return 1;\ | 96 | return 1;\ |
97 | } | 97 | } |
98 | 98 | ||
@@ -226,11 +226,27 @@ const EVP_CIPHER *EVP_##cname##_ecb(void) { return &cname##_ecb; } | |||
226 | 226 | ||
227 | #define EVP_C_DATA(kstruct, ctx) ((kstruct *)(ctx)->cipher_data) | 227 | #define EVP_C_DATA(kstruct, ctx) ((kstruct *)(ctx)->cipher_data) |
228 | 228 | ||
229 | #define IMPLEMENT_CFBR(cipher,cprefix,kstruct,ksched,keysize,cbits,iv_len) \ | 229 | #define IMPLEMENT_CFBR(cipher,cprefix,kstruct,ksched,keysize,cbits,iv_len,flags) \ |
230 | BLOCK_CIPHER_func_cfb(cipher##_##keysize,cprefix,cbits,kstruct,ksched) \ | 230 | BLOCK_CIPHER_func_cfb(cipher##_##keysize,cprefix,cbits,kstruct,ksched) \ |
231 | BLOCK_CIPHER_def_cfb(cipher##_##keysize,kstruct, \ | 231 | BLOCK_CIPHER_def_cfb(cipher##_##keysize,kstruct, \ |
232 | NID_##cipher##_##keysize, keysize/8, iv_len, cbits, \ | 232 | NID_##cipher##_##keysize, keysize/8, iv_len, cbits, \ |
233 | 0, cipher##_init_key, NULL, \ | 233 | flags, cipher##_init_key, NULL, \ |
234 | EVP_CIPHER_set_asn1_iv, \ | 234 | EVP_CIPHER_set_asn1_iv, \ |
235 | EVP_CIPHER_get_asn1_iv, \ | 235 | EVP_CIPHER_get_asn1_iv, \ |
236 | NULL) | 236 | NULL) |
237 | |||
238 | #ifdef OPENSSL_FIPS | ||
239 | #define RC2_set_key private_RC2_set_key | ||
240 | #define RC4_set_key private_RC4_set_key | ||
241 | #define CAST_set_key private_CAST_set_key | ||
242 | #define RC5_32_set_key private_RC5_32_set_key | ||
243 | #define BF_set_key private_BF_set_key | ||
244 | #define idea_set_encrypt_key private_idea_set_encrypt_key | ||
245 | |||
246 | #define MD5_Init private_MD5_Init | ||
247 | #define MD4_Init private_MD4_Init | ||
248 | #define MD2_Init private_MD2_Init | ||
249 | #define MDC2_Init private_MDC2_Init | ||
250 | #define SHA_Init private_SHA_Init | ||
251 | |||
252 | #endif | ||