Subversion Repositories oidplus

Rev

Rev 846 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. <?php
  2.  
  3. /**
  4.  * Base Class for all stream ciphers
  5.  *
  6.  * PHP version 5
  7.  *
  8.  * @category  Crypt
  9.  * @package   StreamCipher
  10.  * @author    Jim Wigginton <terrafrost@php.net>
  11.  * @author    Hans-Juergen Petrich <petrich@tronic-media.com>
  12.  * @copyright 2007 Jim Wigginton
  13.  * @license   http://www.opensource.org/licenses/mit-license.html  MIT License
  14.  * @link      http://phpseclib.sourceforge.net
  15.  */
  16.  
  17. namespace phpseclib3\Crypt\Common;
  18.  
  19. /**
  20.  * Base Class for all stream cipher classes
  21.  *
  22.  * @package StreamCipher
  23.  * @author  Jim Wigginton <terrafrost@php.net>
  24.  */
  25. abstract class StreamCipher extends SymmetricKey
  26. {
  27.     /**
  28.      * Block Length of the cipher
  29.      *
  30.      * Stream ciphers do not have a block size
  31.      *
  32.      * @see \phpseclib3\Crypt\Common\SymmetricKey::block_size
  33.      * @var int
  34.      * @access private
  35.      */
  36.     protected $block_size = 0;
  37.  
  38.     /**
  39.      * Default Constructor.
  40.      *
  41.      * @see \phpseclib3\Crypt\Common\SymmetricKey::__construct()
  42.      * @return \phpseclib3\Crypt\Common\StreamCipher
  43.      */
  44.     public function __construct()
  45.     {
  46.         parent::__construct('stream');
  47.     }
  48.  
  49.     /**
  50.      * Stream ciphers not use an IV
  51.      *
  52.      * @access public
  53.      * @return bool
  54.      */
  55.     public function usesIV()
  56.     {
  57.         return false;
  58.     }
  59. }
  60.