Subversion Repositories oidplus

Rev

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