public function testCreateFromServerConfiguration() { $instance = \CryptLib\Core\BigMath::createFromServerConfiguration(); if (extension_loaded('bcmath')) { $this->assertEquals('CryptLib\\Core\\BigMath\\BCMath', get_class($instance)); } elseif (extension_loaded('gmp')) { $this->assertEquals('CryptLib\\Core\\BigMath\\GMP', get_class($instance)); } else { $this->assertEquals('CryptLib\\Core\\BigMath\\PHPMath', get_class($instance)); } }
/** * Build the instance of the cipher mode * * @param Cipher $cipher The cipher to use for encryption/decryption * @param string $initv The initialization vector (empty if not needed) * @param array $options An array of mode-specific options */ public function __construct(\CryptLib\Cipher\Block\Cipher $cipher, $initv, array $options = array()) { parent::__construct($cipher, $initv, $options); $this->bigMath = BigMath::createFromServerConfiguration(); }