62 #ifndef OPENSSL_NO_RC2
70 const unsigned char *iv,
int enc);
72 static int rc2_magic_to_meth(
int i);
83 #define data(ctx) ((EVP_RC2_KEY *)(ctx)->cipher_data)
90 rc2_set_asn1_type_and_iv, rc2_get_asn1_type_and_iv,
93 #define RC2_40_MAGIC 0xa0
94 #define RC2_64_MAGIC 0x78
95 #define RC2_128_MAGIC 0x3a
106 rc2_set_asn1_type_and_iv,
107 rc2_get_asn1_type_and_iv,
121 rc2_set_asn1_type_and_iv,
122 rc2_get_asn1_type_and_iv,
129 return(&r2_64_cbc_cipher);
134 return(&r2_40_cbc_cipher);
138 const unsigned char *iv,
int enc)
141 key,
data(ctx)->key_bits);
150 if (i == 128)
return(RC2_128_MAGIC);
151 else if (i == 64)
return(RC2_64_MAGIC);
152 else if (i == 40)
return(RC2_40_MAGIC);
156 static int rc2_magic_to_meth(
int i)
158 if (i == RC2_128_MAGIC)
return 128;
159 else if (i == RC2_64_MAGIC)
return 64;
160 else if (i == RC2_40_MAGIC)
return 40;
183 key_bits =rc2_magic_to_meth((
int)num);
201 num=rc2_meth_to_magic(c);
217 *(
int *)ptr =
data(c)->key_bits;