Mcrypt and IV w/ CBC in PHP4.0.1p2
| From: | William Ahern | Date: | Sun, 23 Jul 2000 03:33:20 +0000 |
| Subject: | Mcrypt and IV w/ CBC in PHP4.0.1p2 | ||
| Groups: | php.dev php.general | ||
| Request: | Send a blank email to php-general+get-7750@lists.php.net to get a copy of this message | ||
my mcrypt.h (v 1.8) shows a different API then what was in my
ext/mcrypt/mcrypt.c. here's a diff of mcrypt.c that works for me.
previously, supplying an iv to mcrypt_cbc output the same as w/o an iv.
345a346,348
> td = init_mcrypt_cbc((*cipher)->value.lval, (*key)->value.str.val,
> (*key)->value.str.len);
> MCRYPT_CHECK_TD_CPY;
>
347,349c350
< td = init_mcrypt_cbc_iv((*cipher)->value.lval, (*key)->value.str.val,
(*key)->value.str.len, (*iv)->value.str.val);
< } else {
< td = init_mcrypt_cbc((*cipher)->value.lval, (*key)->value.str.val,
(*key)->value.str.len);
---
> mcrypt(td, (*iv)->value.str.val);
351,352d351
<
< MCRYPT_CHECK_TD_CPY;