cvs: php4(PHP_4_0_7) /pear/Crypt CBC.php

From: Date: Tue, 18 Dec 2001 16:26:17 +0000
Subject: cvs: php4(PHP_4_0_7) /pear/Crypt CBC.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-1610@lists.php.net to get a copy of this message
jpm Tue Dec 18 11:26:17 2001 EDT Modified files: (Branch: PHP_4_0_7) /php4/pear/Crypt CBC.php Log: Fixing indentation and missing ?> tag Index: php4/pear/Crypt/CBC.php diff -u php4/pear/Crypt/CBC.php:1.9.2.1 php4/pear/Crypt/CBC.php:1.9.2.2 --- php4/pear/Crypt/CBC.php:1.9.2.1 Tue Dec 18 11:13:43 2001 +++ php4/pear/Crypt/CBC.php Tue Dec 18 11:26:17 2001 @@ -41,7 +41,7 @@ * the author of libcrypt decides to name things internally. * * -* @version $Id: CBC.php,v 1.9.2.1 2001/12/18 16:13:43 cmv Exp $ +* @version $Id: CBC.php,v 1.9.2.2 2001/12/18 16:26:17 jpm Exp $ * @author Colin Viebrock <colin@easydns.com> * @author Mike Glover <mpg4@duluoz.net> * @access public @@ -136,10 +136,10 @@ return $this->raiseError('mcrypt module is not compiled into PHP', null, PEAR_ERROR_DIE, null, 'compile PHP using "--with-mcrypt"' ); } - if (!function_exists('mcrypt_module_open')) { + if (!function_exists('mcrypt_module_open')) { return $this->raiseError('libmcrypt is 2.2.x', null, PEAR_ERROR_DIE, null, 'this class only works with libmcrypt 2.4.x and later' ); - } + } /* seed randomizer */ @@ -184,15 +184,15 @@ } - /** - * Destructor - * - */ + /** + * Destructor + * + */ function _Crypt_CBC () { - mcrypt_module_close($this->TD); - } + mcrypt_module_close($this->TD); + } /** @@ -230,13 +230,13 @@ $start = 0; while ( $block = substr($clear, $start, $this->blocksize) ) { $start += $this->blocksize; - if (mcrypt_generic_init($this->TD, $this->key, $iv) < 0 ) { + if (mcrypt_generic_init($this->TD, $this->key, $iv) < 0 ) { return $this->raiseError('mcrypt_generic_init failed' ); - } + } $cblock = mcrypt_generic($this->TD, $iv^$block ); - if (!mcrypt_generic_end($this->TD)) { + if (!mcrypt_generic_end($this->TD)) { return $this->raiseError('mcrypt_generic_end failed' ); - } + } $iv = $cblock; $crypt .= $cblock; } @@ -281,13 +281,13 @@ while ( $cblock = substr($crypt, $start, $this->blocksize) ) { $start += $this->blocksize; - if (mcrypt_generic_init($this->TD, $this->key, $iv) < 0 ) { + if (mcrypt_generic_init($this->TD, $this->key, $iv) < 0 ) { return $this->raiseError('mcrypt_generic_init failed' ); - } + } $block = $iv ^ mdecrypt_generic($this->TD, $cblock); - if (!mcrypt_generic_end($this->TD)) { + if (!mcrypt_generic_end($this->TD)) { return $this->raiseError('mcrypt_generic_end failed' ); - } + } $iv = $cblock; $clear .= $block; } @@ -319,7 +319,5 @@ { return pack('H*', md5($string)); } - - } - +?>

« previous php.pear.cvs (#1610) next »