1
0
mirror of https://github.com/danog/phpseclib.git synced 2024-12-14 18:15:39 +01:00

Merge branch '3.0'

This commit is contained in:
terrafrost 2020-05-13 06:07:49 -05:00
commit 6c855e709d
3 changed files with 22 additions and 45 deletions

View File

@ -24,6 +24,28 @@ namespace phpseclib3\Crypt\Common;
*/
abstract class StreamCipher extends SymmetricKey
{
/**
* Block Length of the cipher
*
* Stream ciphers do not have a block size
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::block_size
* @var int
* @access private
*/
protected $block_size = 0;
/**
* Default Constructor.
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::__construct()
* @return \phpseclib3\Crypt\Common\StreamCipher
*/
public function __construct()
{
parent::__construct('stream');
}
/**
* Stream ciphers not use an IV
*

View File

@ -63,18 +63,6 @@ class RC4 extends StreamCipher
const DECRYPT = 1;
/**#@-*/
/**
* Block Length of the cipher
*
* RC4 is a stream cipher
* so we the block_size to 0
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::block_size
* @var int
* @access private
*/
protected $block_size = 0;
/**
* Key Length (in bytes)
*
@ -111,18 +99,6 @@ class RC4 extends StreamCipher
*/
private $stream;
/**
* Default Constructor.
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::__construct()
* @return \phpseclib3\Crypt\RC4
* @access public
*/
public function __construct()
{
parent::__construct('stream');
}
/**
* Test for engine validity
*

View File

@ -50,16 +50,6 @@ class Salsa20 extends StreamCipher
*/
protected $key_length = 32; // = 256 bits
/**
* Block Length of the cipher
*
* Salsa20 is a stream cipher
* so we the block_size to 0
*
* @var int
*/
protected $block_size = 0;
/**#@+
* @access private
* @see \phpseclib3\Crypt\Salsa20::crypt()
@ -96,17 +86,6 @@ class Salsa20 extends StreamCipher
*/
protected $usingGeneratedPoly1305Key = false;
/**
* Default Constructor.
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::__construct()
* @return \phpseclib3\Crypt\Salsa20
*/
public function __construct()
{
parent::__construct('stream');
}
/**
* Salsa20 uses a nonce
*