Файловый менеджер - Редактировать - /home/lmsyaran/public_html/pusher/sendMessage.tar
Назад
sendMessage.php 0000644 00000002300 15117231254 0007507 0 ustar 00 <?php defined('_JEXEC') or die; define('DS', DIRECTORY_SEPARATOR); jimport( 'joomla.plugin.plugin' ); JLoader::registerNamespace('vendor', JPATH_PLUGINS.DS.'chat'.DS.'sendMessage'.DS. 'pusher'); use vendor\pusher\pusherphpserver\src\Pusher; class PlgChatSendMessage extends JEvent { public function afterChatSave($data) { $filename = __DIR__ . '/log.txt'; file_put_contents($filename, 'data = ' . print_r($data, True) . "\n", FILE_APPEND); $app_id= '1119039'; $app_key= 'ded62ba8f60c31da4778'; $app_secret= '66ee3778f9e908cb46ae'; $app_cluster= 'ap2'; $channel_token= $data['channel_token']; unset($data['channel_token']); file_put_contents($filename, 'data2 = ' . print_r($data, True) . "\n", FILE_APPEND); file_put_contents($filename, 'channel_token = ' . print_r($channel_token, True) . "\n", FILE_APPEND); $pusher = new Pusher($app_key,$app_secret,$app_id,array('cluster'=>$app_cluster)); $ss = $pusher->trigger($channel_token,'my-event', $data); file_put_contents($filename, 'ss = ' . print_r($data, True) . "\n", FILE_APPEND); return true; } } index.html 0000644 00000000000 15117231254 0006530 0 ustar 00 pusher/composer.json 0000644 00000000225 15117231254 0010574 0 ustar 00 { "require": { "pusher/pusher-php-server": "^4.1" }, "autoload": { "psr-4": { "P\\": "src" } } } pusher/composer.lock 0000644 00000020643 15117231254 0010561 0 ustar 00 { "_readme": [ "This file locks the dependencies of your project to a known state", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], "content-hash": "348f23666086fc823d726acbdf441f8f", "packages": [ { "name": "paragonie/random_compat", "version": "v9.99.100", "source": { "type": "git", "url": "https://github.com/paragonie/random_compat.git", "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a", "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a", "shasum": "" }, "require": { "php": ">= 7" }, "require-dev": { "phpunit/phpunit": "4.*|5.*", "vimeo/psalm": "^1" }, "suggest": { "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." }, "type": "library", "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Paragon Initiative Enterprises", "email": "security@paragonie.com", "homepage": "https://paragonie.com" } ], "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", "keywords": [ "csprng", "polyfill", "pseudorandom", "random" ], "time": "2020-10-15T08:29:30+00:00" }, { "name": "paragonie/sodium_compat", "version": "v1.14.0", "source": { "type": "git", "url": "https://github.com/paragonie/sodium_compat.git", "reference": "a1cfe0b21faf9c0b61ac0c6188c4af7fd6fd0db3" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/a1cfe0b21faf9c0b61ac0c6188c4af7fd6fd0db3", "reference": "a1cfe0b21faf9c0b61ac0c6188c4af7fd6fd0db3", "shasum": "" }, "require": { "paragonie/random_compat": ">=1", "php": "^5.2.4|^5.3|^5.4|^5.5|^5.6|^7|^8" }, "require-dev": { "phpunit/phpunit": "^3|^4|^5|^6|^7|^8|^9" }, "suggest": { "ext-libsodium": "PHP < 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security.", "ext-sodium": "PHP >= 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security." }, "type": "library", "autoload": { "files": [ "autoload.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "ISC" ], "authors": [ { "name": "Paragon Initiative Enterprises", "email": "security@paragonie.com" }, { "name": "Frank Denis", "email": "jedisct1@pureftpd.org" } ], "description": "Pure PHP implementation of libsodium; uses the PHP extension if it exists", "keywords": [ "Authentication", "BLAKE2b", "ChaCha20", "ChaCha20-Poly1305", "Chapoly", "Curve25519", "Ed25519", "EdDSA", "Edwards-curve Digital Signature Algorithm", "Elliptic Curve Diffie-Hellman", "Poly1305", "Pure-PHP cryptography", "RFC 7748", "RFC 8032", "Salpoly", "Salsa20", "X25519", "XChaCha20-Poly1305", "XSalsa20-Poly1305", "Xchacha20", "Xsalsa20", "aead", "cryptography", "ecdh", "elliptic curve", "elliptic curve cryptography", "encryption", "libsodium", "php", "public-key cryptography", "secret-key cryptography", "side-channel resistant" ], "time": "2020-12-03T16:26:19+00:00" }, { "name": "psr/log", "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", "shasum": "" }, "require": { "php": ">=5.3.0" }, "type": "library", "extra": { "branch-alias": { "dev-master": "1.1.x-dev" } }, "autoload": { "psr-4": { "Psr\\Log\\": "Psr/Log/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "PHP-FIG", "homepage": "http://www.php-fig.org/" } ], "description": "Common interface for logging libraries", "homepage": "https://github.com/php-fig/log", "keywords": [ "log", "psr", "psr-3" ], "time": "2020-03-23T09:12:05+00:00" }, { "name": "pusher/pusher-php-server", "version": "v4.1.4", "source": { "type": "git", "url": "https://github.com/pusher/pusher-http-php.git", "reference": "e75e5715e3b651ec20dee5844095aadefab81acb" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/pusher/pusher-http-php/zipball/e75e5715e3b651ec20dee5844095aadefab81acb", "reference": "e75e5715e3b651ec20dee5844095aadefab81acb", "shasum": "" }, "require": { "ext-curl": "*", "paragonie/sodium_compat": "^1.6", "php": "^7.1", "psr/log": "^1.0" }, "require-dev": { "phpunit/phpunit": "^7.2" }, "type": "library", "extra": { "branch-alias": { "dev-master": "3.4-dev" } }, "autoload": { "psr-4": { "Pusher\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "description": "Library for interacting with the Pusher REST API", "keywords": [ "events", "messaging", "php-pusher-server", "publish", "push", "pusher", "real time", "real-time", "realtime", "rest", "trigger" ], "time": "2020-04-14T15:20:04+00:00" } ], "packages-dev": [], "aliases": [], "minimum-stability": "stable", "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": [], "platform-dev": [], "plugin-api-version": "1.1.0" } pusher/vendor/autoload.php 0000644 00000000262 15117231254 0011671 0 ustar 00 <?php // autoload.php @generated by Composer require_once __DIR__ . '/composer/autoload_real.php'; return ComposerAutoloaderInit75254bdcf8dcdff9c640de25cd452ac4::getLoader(); pusher/vendor/paragonie/random_compat/build-phar.sh 0000644 00000000206 15117231254 0016521 0 ustar 00 #!/usr/bin/env bash basedir=$( dirname $( readlink -f ${BASH_SOURCE[0]} ) ) php -dphar.readonly=0 "$basedir/other/build_phar.php" $* pusher/vendor/paragonie/random_compat/composer.json 0000644 00000001546 15117231254 0016670 0 ustar 00 { "name": "paragonie/random_compat", "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", "keywords": [ "csprng", "random", "polyfill", "pseudorandom" ], "license": "MIT", "type": "library", "authors": [ { "name": "Paragon Initiative Enterprises", "email": "security@paragonie.com", "homepage": "https://paragonie.com" } ], "support": { "issues": "https://github.com/paragonie/random_compat/issues", "email": "info@paragonie.com", "source": "https://github.com/paragonie/random_compat" }, "require": { "php": ">= 7" }, "require-dev": { "vimeo/psalm": "^1", "phpunit/phpunit": "4.*|5.*" }, "suggest": { "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." } } pusher/vendor/paragonie/random_compat/dist/random_compat.phar.pubkey 0000644 00000000327 15117231254 0022102 0 ustar 00 -----BEGIN PUBLIC KEY----- MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEEd+wCqJDrx5B4OldM0dQE0ZMX+lx1ZWm pui0SUqD4G29L3NGsz9UhJ/0HjBdbnkhIK5xviT0X5vtjacF6ajgcCArbTB+ds+p +h7Q084NuSuIpNb6YPfoUFgC/CL9kAoc -----END PUBLIC KEY----- pusher/vendor/paragonie/random_compat/dist/random_compat.phar.pubkey.asc 0000644 00000000750 15117231254 0022647 0 ustar 00 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQEcBAABAgAGBQJWtW1hAAoJEGuXocKCZATaJf0H+wbZGgskK1dcRTsuVJl9IWip QwGw/qIKI280SD6/ckoUMxKDCJiFuPR14zmqnS36k7N5UNPnpdTJTS8T11jttSpg 1LCmgpbEIpgaTah+cELDqFCav99fS+bEiAL5lWDAHBTE/XPjGVCqeehyPYref4IW NDBIEsvnHPHPLsn6X5jq4+Yj5oUixgxaMPiR+bcO4Sh+RzOVB6i2D0upWfRXBFXA NNnsg9/zjvoC7ZW73y9uSH+dPJTt/Vgfeiv52/v41XliyzbUyLalf02GNPY+9goV JHG1ulEEBJOCiUD9cE1PUIJwHA/HqyhHIvV350YoEFiHl8iSwm7SiZu5kPjaq74= =B6+8 -----END PGP SIGNATURE----- pusher/vendor/paragonie/random_compat/lib/random.php 0000644 00000002457 15117231254 0016707 0 ustar 00 <?php /** * Random_* Compatibility Library * for using the new PHP 7 random_* API in PHP 5 projects * * @version 2.99.99 * @released 2018-06-06 * * The MIT License (MIT) * * Copyright (c) 2015 - 2018 Paragon Initiative Enterprises * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ // NOP pusher/vendor/paragonie/random_compat/LICENSE 0000644 00000002112 15117231254 0015141 0 ustar 00 The MIT License (MIT) Copyright (c) 2015 Paragon Initiative Enterprises Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. pusher/vendor/paragonie/random_compat/other/build_phar.php 0000644 00000003141 15117231254 0020102 0 ustar 00 <?php $dist = dirname(__DIR__).'/dist'; if (!is_dir($dist)) { mkdir($dist, 0755); } if (file_exists($dist.'/random_compat.phar')) { unlink($dist.'/random_compat.phar'); } $phar = new Phar( $dist.'/random_compat.phar', FilesystemIterator::CURRENT_AS_FILEINFO | \FilesystemIterator::KEY_AS_FILENAME, 'random_compat.phar' ); rename( dirname(__DIR__).'/lib/random.php', dirname(__DIR__).'/lib/index.php' ); $phar->buildFromDirectory(dirname(__DIR__).'/lib'); rename( dirname(__DIR__).'/lib/index.php', dirname(__DIR__).'/lib/random.php' ); /** * If we pass an (optional) path to a private key as a second argument, we will * sign the Phar with OpenSSL. * * If you leave this out, it will produce an unsigned .phar! */ if ($argc > 1) { if (!@is_readable($argv[1])) { echo 'Could not read the private key file:', $argv[1], "\n"; exit(255); } $pkeyFile = file_get_contents($argv[1]); $private = openssl_get_privatekey($pkeyFile); if ($private !== false) { $pkey = ''; openssl_pkey_export($private, $pkey); $phar->setSignatureAlgorithm(Phar::OPENSSL, $pkey); /** * Save the corresponding public key to the file */ if (!@is_readable($dist.'/random_compat.phar.pubkey')) { $details = openssl_pkey_get_details($private); file_put_contents( $dist.'/random_compat.phar.pubkey', $details['key'] ); } } else { echo 'An error occurred reading the private key from OpenSSL.', "\n"; exit(255); } } pusher/vendor/paragonie/random_compat/psalm-autoload.php 0000644 00000000347 15117231254 0017577 0 ustar 00 <?php require_once 'lib/byte_safe_strings.php'; require_once 'lib/cast_to_int.php'; require_once 'lib/error_polyfill.php'; require_once 'other/ide_stubs/libsodium.php'; require_once 'lib/random.php'; $int = random_int(0, 65536); pusher/vendor/paragonie/random_compat/psalm.xml 0000644 00000001124 15117231254 0015774 0 ustar 00 <?xml version="1.0"?> <psalm autoloader="psalm-autoload.php" stopOnFirstError="false" useDocblockTypes="true" > <projectFiles> <directory name="lib" /> </projectFiles> <issueHandlers> <RedundantConditionGivenDocblockType errorLevel="info" /> <UnresolvableInclude errorLevel="info" /> <DuplicateClass errorLevel="info" /> <InvalidOperand errorLevel="info" /> <UndefinedConstant errorLevel="info" /> <MissingReturnType errorLevel="info" /> <InvalidReturnType errorLevel="info" /> </issueHandlers> </psalm> pusher/vendor/paragonie/sodium_compat/.gitignore 0000644 00000000215 15117231254 0016146 0 ustar 00 /.idea/ /.php_cs.cache /.phpunit.result.cache /box/ /dist/sodium-compat.phar /dist/sodium-compat.phar.sig /composer.lock /vendor/ /psalm.xml pusher/vendor/paragonie/sodium_compat/appveyor.yml 0000644 00000001424 15117231254 0016551 0 ustar 00 build: false shallow_clone: false platform: - x86 - x64 clone_folder: C:\projects\sodium_compat image: Visual Studio 2017 install: - cinst -y OpenSSL.Light - SET PATH=C:\Program Files\OpenSSL;%PATH% - sc config wuauserv start= auto - net start wuauserv - cinst -y php --version 5.6.30 - cd c:\tools\php56 - copy php.ini-production php.ini - echo date.timezone="UTC" >> php.ini - echo extension_dir=ext >> php.ini - echo extension=php_openssl.dll >> php.ini - cd C:\projects\sodium_compat - SET PATH=C:\tools\php56;%PATH% - php.exe -r "readfile('http://getcomposer.org/installer');" | php.exe - php.exe composer.phar install --prefer-source --no-interaction test_script: - cd C:\projects\sodium_compat - vendor\bin\phpunit.bat tests/Windows32Test.php pusher/vendor/paragonie/sodium_compat/autoload-fast.php 0000644 00000000117 15117231254 0017433 0 ustar 00 <?php require_once 'autoload.php'; ParagonIE_Sodium_Compat::$fastMult = true; pusher/vendor/paragonie/sodium_compat/autoload-pedantic.php 0000644 00000000162 15117231254 0020265 0 ustar 00 <?php require_once 'autoload.php'; define('DO_PEDANTIC_TEST', true); ParagonIE_Sodium_Compat::$fastMult = true; pusher/vendor/paragonie/sodium_compat/autoload-php7.php 0000644 00000001572 15117231254 0017362 0 ustar 00 <?php /* This file should only ever be loaded on PHP 7+ */ if (PHP_VERSION_ID < 70000) { return; } spl_autoload_register(function ($class) { $namespace = 'ParagonIE_Sodium_'; // Does the class use the namespace prefix? $len = strlen($namespace); if (strncmp($namespace, $class, $len) !== 0) { // no, move to the next registered autoloader return false; } // Get the relative class name $relative_class = substr($class, $len); // Replace the namespace prefix with the base directory, replace namespace // separators with directory separators in the relative class name, append // with .php $file = dirname(__FILE__) . '/src/' . str_replace('_', '/', $relative_class) . '.php'; // if the file exists, require it if (file_exists($file)) { require_once $file; return true; } return false; }); pusher/vendor/paragonie/sodium_compat/autoload-phpunit.php 0000644 00000000246 15117231254 0020170 0 ustar 00 <?php require_once (dirname(__FILE__) . '/vendor/autoload.php'); if (PHP_VERSION_ID >= 50300) { require_once (dirname(__FILE__) . '/tests/phpunit-shim.php'); } pusher/vendor/paragonie/sodium_compat/autoload.php 0000644 00000004511 15117231254 0016502 0 ustar 00 <?php if (PHP_VERSION_ID < 70000) { if (!is_callable('sodiumCompatAutoloader')) { /** * Sodium_Compat autoloader. * * @param string $class Class name to be autoloaded. * * @return bool Stop autoloading? */ function sodiumCompatAutoloader($class) { $namespace = 'ParagonIE_Sodium_'; // Does the class use the namespace prefix? $len = strlen($namespace); if (strncmp($namespace, $class, $len) !== 0) { // no, move to the next registered autoloader return false; } // Get the relative class name $relative_class = substr($class, $len); // Replace the namespace prefix with the base directory, replace namespace // separators with directory separators in the relative class name, append // with .php $file = dirname(__FILE__) . '/src/' . str_replace('_', '/', $relative_class) . '.php'; // if the file exists, require it if (file_exists($file)) { require_once $file; return true; } return false; } // Now that we have an autoloader, let's register it! spl_autoload_register('sodiumCompatAutoloader'); } } else { require_once dirname(__FILE__) . '/autoload-php7.php'; } if (!class_exists('SodiumException', false)) { require_once dirname(__FILE__) . '/src/SodiumException.php'; } if (PHP_VERSION_ID >= 50300) { // Namespaces didn't exist before 5.3.0, so don't even try to use this // unless PHP >= 5.3.0 require_once dirname(__FILE__) . '/lib/namespaced.php'; require_once dirname(__FILE__) . '/lib/sodium_compat.php'; } else { require_once dirname(__FILE__) . '/src/PHP52/SplFixedArray.php'; } if (PHP_VERSION_ID < 70200 || !extension_loaded('sodium')) { if (PHP_VERSION_ID >= 50300 && !defined('SODIUM_CRYPTO_SCALARMULT_BYTES')) { require_once dirname(__FILE__) . '/lib/php72compat_const.php'; } if (PHP_VERSION_ID >= 70000) { assert(class_exists('ParagonIE_Sodium_Compat'), 'Possible filesystem/autoloader bug?'); } else { assert(class_exists('ParagonIE_Sodium_Compat')); } require_once (dirname(__FILE__) . '/lib/php72compat.php'); } pusher/vendor/paragonie/sodium_compat/build-phar.sh 0000644 00000000320 15117231254 0016536 0 ustar 00 #!/usr/bin/env bash curl -LSs https://box-project.github.io/box2/installer.php | php mkdir ~/box mv box.phar ~/box/box PATH=$PATH:~/box/ make -C dist/ build-phar # PATH=$PATH:~/box/ make -C dist/ sign-phar pusher/vendor/paragonie/sodium_compat/composer-php52.json 0000644 00000004203 15117231254 0017635 0 ustar 00 { "name": "paragonie/sodium_compat", "description": "Pure PHP implementation of libsodium; uses the PHP extension if it exists", "keywords": [ "PHP", "cryptography", "elliptic curve", "elliptic curve cryptography", "Pure-PHP cryptography", "side-channel resistant", "Curve25519", "X25519", "ECDH", "Elliptic Curve Diffie-Hellman", "Ed25519", "RFC 7748", "RFC 8032", "EdDSA", "Edwards-curve Digital Signature Algorithm", "ChaCha20", "Salsa20", "Xchacha20", "Xsalsa20", "Poly1305", "BLAKE2b", "public-key cryptography", "secret-key cryptography", "AEAD", "Chapoly", "Salpoly", "ChaCha20-Poly1305", "XSalsa20-Poly1305", "XChaCha20-Poly1305", "encryption", "authentication", "libsodium" ], "license": "ISC", "authors": [ { "name": "Paragon Initiative Enterprises", "email": "security@paragonie.com" }, { "name": "Frank Denis", "email": "jedisct1@pureftpd.org" } ], "autoload": { "files": ["autoload.php"] }, "repositories": [ { "type": "git", "url": "https://github.com/garex/phpunit" }, { "type": "git", "url": "https://github.com/garex/phpunit-mock-objects" } ], "require": { "php": "^5.2.4|^5.3|^5.4|^5.5|^5.6|^7|^8", "xrstf/composer-php52": "1.*", "paragonie/random_compat": ">=1" }, "minimum-stability": "dev", "require-dev": { "phpunit/phpunit-php52": "dev-3.6.12-php52", "phpunit/phpunit-mock-objects-php52": "dev-1.1.0-php52" }, "scripts": { "post-install-cmd": [ "xrstf\\Composer52\\Generator::onPostInstallCmd" ], "post-update-cmd": [ "xrstf\\Composer52\\Generator::onPostInstallCmd" ], "post-autoload-dump": [ "xrstf\\Composer52\\Generator::onPostInstallCmd" ] }, "suggest": { "ext-libsodium": "PHP < 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security.", "ext-sodium": "PHP >= 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security." } } pusher/vendor/paragonie/sodium_compat/composer.json 0000644 00000003036 15117231254 0016704 0 ustar 00 { "name": "paragonie/sodium_compat", "description": "Pure PHP implementation of libsodium; uses the PHP extension if it exists", "keywords": [ "PHP", "cryptography", "elliptic curve", "elliptic curve cryptography", "Pure-PHP cryptography", "side-channel resistant", "Curve25519", "X25519", "ECDH", "Elliptic Curve Diffie-Hellman", "Ed25519", "RFC 7748", "RFC 8032", "EdDSA", "Edwards-curve Digital Signature Algorithm", "ChaCha20", "Salsa20", "Xchacha20", "Xsalsa20", "Poly1305", "BLAKE2b", "public-key cryptography", "secret-key cryptography", "AEAD", "Chapoly", "Salpoly", "ChaCha20-Poly1305", "XSalsa20-Poly1305", "XChaCha20-Poly1305", "encryption", "authentication", "libsodium" ], "license": "ISC", "authors": [ { "name": "Paragon Initiative Enterprises", "email": "security@paragonie.com" }, { "name": "Frank Denis", "email": "jedisct1@pureftpd.org" } ], "autoload": { "files": ["autoload.php"] }, "require": { "php": "^5.2.4|^5.3|^5.4|^5.5|^5.6|^7|^8", "paragonie/random_compat": ">=1" }, "require-dev": { "phpunit/phpunit": "^3|^4|^5|^6|^7|^8|^9" }, "suggest": { "ext-libsodium": "PHP < 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security.", "ext-sodium": "PHP >= 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security." } } pusher/vendor/paragonie/sodium_compat/dist/box.json 0000644 00000001156 15117231254 0016611 0 ustar 00 { "chmod": "0755", "finder": [ { "in": "", "name": "autoload.php" }, { "in": "src", "name": "*.php" }, { "in": "lib", "name": "*.php" }, { "in": "vendor/composer", "name": "*.php" }, { "in": "vendor/paragonie", "name": "*.php" } ], "compactors": [ "Herrera\\Box\\Compactor\\Php" ], "main": "vendor/autoload.php", "output": "sodium-compat.phar", "shebang": false, "stub": true } pusher/vendor/paragonie/sodium_compat/dist/Makefile 0000644 00000002110 15117231254 0016555 0 ustar 00 # This builds sodium-compat.phar. To run this Makefile, `box` and `composer` # must be installed and in your $PATH. Run it from inside the dist/ directory. box := $(shell which box) composer := "composer" gitcommit := $(shell git rev-parse HEAD) .PHONY: all all: build-phar .PHONY: sign-phar sign-phar: gpg -u 7F52D5C61D1255C731362E826B97A1C2826404DA --armor --output sodium-compat.phar.sig --detach-sig sodium-compat.phar # ensure we run in clean tree. export git tree and run there. .PHONY: build-phar build-phar: @echo "Creating .phar from revision $(shell git rev-parse HEAD)." rm -rf worktree install -d worktree (cd $(CURDIR)/..; git archive HEAD) | tar -x -C worktree $(MAKE) -f $(CURDIR)/Makefile -C worktree sodium-compat.phar mv worktree/*.phar . rm -rf worktree .PHONY: clean clean: rm -vf sodium-compat.phar sodium-compat.phar.sig # Inside workdir/: sodium-compat.phar: dist/box.json composer.lock cp dist/box.json . php -d phar.readonly=0 $(box) build -c box.json -v composer.lock: $(composer) config autoloader-suffix $(gitcommit) $(composer) install --no-dev pusher/vendor/paragonie/sodium_compat/lib/constants.php 0000644 00000010101 15117231254 0017444 0 ustar 00 <?php namespace Sodium; require_once dirname(dirname(__FILE__)) . '/autoload.php'; use ParagonIE_Sodium_Compat; const CRYPTO_AEAD_AES256GCM_KEYBYTES = ParagonIE_Sodium_Compat::CRYPTO_AEAD_AES256GCM_KEYBYTES; const CRYPTO_AEAD_AES256GCM_NSECBYTES = ParagonIE_Sodium_Compat::CRYPTO_AEAD_AES256GCM_NSECBYTES; const CRYPTO_AEAD_AES256GCM_NPUBBYTES = ParagonIE_Sodium_Compat::CRYPTO_AEAD_AES256GCM_NPUBBYTES; const CRYPTO_AEAD_AES256GCM_ABYTES = ParagonIE_Sodium_Compat::CRYPTO_AEAD_AES256GCM_ABYTES; const CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES = ParagonIE_Sodium_Compat::CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES; const CRYPTO_AEAD_CHACHA20POLY1305_NSECBYTES = ParagonIE_Sodium_Compat::CRYPTO_AEAD_CHACHA20POLY1305_NSECBYTES; const CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES = ParagonIE_Sodium_Compat::CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES; const CRYPTO_AEAD_CHACHA20POLY1305_ABYTES = ParagonIE_Sodium_Compat::CRYPTO_AEAD_CHACHA20POLY1305_ABYTES; const CRYPTO_AEAD_CHACHA20POLY1305_IETF_KEYBYTES = ParagonIE_Sodium_Compat::CRYPTO_AEAD_CHACHA20POLY1305_IETF_KEYBYTES; const CRYPTO_AEAD_CHACHA20POLY1305_IETF_NSECBYTES = ParagonIE_Sodium_Compat::CRYPTO_AEAD_CHACHA20POLY1305_IETF_NSECBYTES; const CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES = ParagonIE_Sodium_Compat::CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES; const CRYPTO_AEAD_CHACHA20POLY1305_IETF_ABYTES = ParagonIE_Sodium_Compat::CRYPTO_AEAD_CHACHA20POLY1305_IETF_ABYTES; const CRYPTO_AUTH_BYTES = ParagonIE_Sodium_Compat::CRYPTO_AUTH_BYTES; const CRYPTO_AUTH_KEYBYTES = ParagonIE_Sodium_Compat::CRYPTO_AUTH_KEYBYTES; const CRYPTO_BOX_SEALBYTES = ParagonIE_Sodium_Compat::CRYPTO_BOX_SEALBYTES; const CRYPTO_BOX_SECRETKEYBYTES = ParagonIE_Sodium_Compat::CRYPTO_BOX_SECRETKEYBYTES; const CRYPTO_BOX_PUBLICKEYBYTES = ParagonIE_Sodium_Compat::CRYPTO_BOX_PUBLICKEYBYTES; const CRYPTO_BOX_KEYPAIRBYTES = ParagonIE_Sodium_Compat::CRYPTO_BOX_KEYPAIRBYTES; const CRYPTO_BOX_MACBYTES = ParagonIE_Sodium_Compat::CRYPTO_BOX_MACBYTES; const CRYPTO_BOX_NONCEBYTES = ParagonIE_Sodium_Compat::CRYPTO_BOX_NONCEBYTES; const CRYPTO_BOX_SEEDBYTES = ParagonIE_Sodium_Compat::CRYPTO_BOX_SEEDBYTES; const CRYPTO_KX_BYTES = ParagonIE_Sodium_Compat::CRYPTO_KX_BYTES; const CRYPTO_KX_SEEDBYTES = ParagonIE_Sodium_Compat::CRYPTO_KX_SEEDBYTES; const CRYPTO_KX_PUBLICKEYBYTES = ParagonIE_Sodium_Compat::CRYPTO_KX_PUBLICKEYBYTES; const CRYPTO_KX_SECRETKEYBYTES = ParagonIE_Sodium_Compat::CRYPTO_KX_SECRETKEYBYTES; const CRYPTO_GENERICHASH_BYTES = ParagonIE_Sodium_Compat::CRYPTO_GENERICHASH_BYTES; const CRYPTO_GENERICHASH_BYTES_MIN = ParagonIE_Sodium_Compat::CRYPTO_GENERICHASH_BYTES_MIN; const CRYPTO_GENERICHASH_BYTES_MAX = ParagonIE_Sodium_Compat::CRYPTO_GENERICHASH_BYTES_MAX; const CRYPTO_GENERICHASH_KEYBYTES = ParagonIE_Sodium_Compat::CRYPTO_GENERICHASH_KEYBYTES; const CRYPTO_GENERICHASH_KEYBYTES_MIN = ParagonIE_Sodium_Compat::CRYPTO_GENERICHASH_KEYBYTES_MIN; const CRYPTO_GENERICHASH_KEYBYTES_MAX = ParagonIE_Sodium_Compat::CRYPTO_GENERICHASH_KEYBYTES_MAX; const CRYPTO_SCALARMULT_BYTES = ParagonIE_Sodium_Compat::CRYPTO_SCALARMULT_BYTES; const CRYPTO_SCALARMULT_SCALARBYTES = ParagonIE_Sodium_Compat::CRYPTO_SCALARMULT_SCALARBYTES; const CRYPTO_SHORTHASH_BYTES = ParagonIE_Sodium_Compat::CRYPTO_SHORTHASH_BYTES; const CRYPTO_SHORTHASH_KEYBYTES = ParagonIE_Sodium_Compat::CRYPTO_SHORTHASH_KEYBYTES; const CRYPTO_SECRETBOX_KEYBYTES = ParagonIE_Sodium_Compat::CRYPTO_SECRETBOX_KEYBYTES; const CRYPTO_SECRETBOX_MACBYTES = ParagonIE_Sodium_Compat::CRYPTO_SECRETBOX_MACBYTES; const CRYPTO_SECRETBOX_NONCEBYTES = ParagonIE_Sodium_Compat::CRYPTO_SECRETBOX_NONCEBYTES; const CRYPTO_SIGN_BYTES = ParagonIE_Sodium_Compat::CRYPTO_SIGN_BYTES; const CRYPTO_SIGN_SEEDBYTES = ParagonIE_Sodium_Compat::CRYPTO_SIGN_SEEDBYTES; const CRYPTO_SIGN_PUBLICKEYBYTES = ParagonIE_Sodium_Compat::CRYPTO_SIGN_PUBLICKEYBYTES; const CRYPTO_SIGN_SECRETKEYBYTES = ParagonIE_Sodium_Compat::CRYPTO_SIGN_SECRETKEYBYTES; const CRYPTO_SIGN_KEYPAIRBYTES = ParagonIE_Sodium_Compat::CRYPTO_SIGN_KEYPAIRBYTES; const CRYPTO_STREAM_KEYBYTES = ParagonIE_Sodium_Compat::CRYPTO_STREAM_KEYBYTES; const CRYPTO_STREAM_NONCEBYTES = ParagonIE_Sodium_Compat::CRYPTO_STREAM_NONCEBYTES; pusher/vendor/paragonie/sodium_compat/lib/namespaced.php 0000644 00000002501 15117231254 0017535 0 ustar 00 <?php require_once dirname(dirname(__FILE__)) . '/autoload.php'; if (PHP_VERSION_ID < 50300) { return; } /* * This file is just for convenience, to allow developers to reduce verbosity when * they add this project to their libraries. * * Replace this: * * $x = ParagonIE_Sodium_Compat::crypto_aead_xchacha20poly1305_encrypt(...$args); * * with this: * * use ParagonIE\Sodium\Compat; * * $x = Compat::crypto_aead_xchacha20poly1305_encrypt(...$args); */ spl_autoload_register(function ($class) { if ($class[0] === '\\') { $class = substr($class, 1); } $namespace = 'ParagonIE\\Sodium'; // Does the class use the namespace prefix? $len = strlen($namespace); if (strncmp($namespace, $class, $len) !== 0) { // no, move to the next registered autoloader return false; } // Get the relative class name $relative_class = substr($class, $len); // Replace the namespace prefix with the base directory, replace namespace // separators with directory separators in the relative class name, append // with .php $file = dirname(dirname(__FILE__)) . '/namespaced/' . str_replace('\\', '/', $relative_class) . '.php'; // if the file exists, require it if (file_exists($file)) { require_once $file; return true; } return false; }); pusher/vendor/paragonie/sodium_compat/lib/php72compat.php 0000644 00000121141 15117231254 0017603 0 ustar 00 <?php require_once dirname(dirname(__FILE__)) . '/autoload.php'; /** * This file will monkey patch the pure-PHP implementation in place of the * PECL functions and constants, but only if they do not already exist. * * Thus, the functions or constants just proxy to the appropriate * ParagonIE_Sodium_Compat method or class constant, respectively. */ foreach (array( 'BASE64_VARIANT_ORIGINAL', 'BASE64_VARIANT_ORIGINAL_NO_PADDING', 'BASE64_VARIANT_URLSAFE', 'BASE64_VARIANT_URLSAFE_NO_PADDING', 'CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES', 'CRYPTO_AEAD_CHACHA20POLY1305_NSECBYTES', 'CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES', 'CRYPTO_AEAD_CHACHA20POLY1305_ABYTES', 'CRYPTO_AEAD_AES256GCM_KEYBYTES', 'CRYPTO_AEAD_AES256GCM_NSECBYTES', 'CRYPTO_AEAD_AES256GCM_NPUBBYTES', 'CRYPTO_AEAD_AES256GCM_ABYTES', 'CRYPTO_AEAD_CHACHA20POLY1305_IETF_KEYBYTES', 'CRYPTO_AEAD_CHACHA20POLY1305_IETF_NSECBYTES', 'CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES', 'CRYPTO_AEAD_CHACHA20POLY1305_IETF_ABYTES', 'CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES', 'CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NSECBYTES', 'CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES', 'CRYPTO_AEAD_XCHACHA20POLY1305_IETF_ABYTES', 'CRYPTO_AUTH_BYTES', 'CRYPTO_AUTH_KEYBYTES', 'CRYPTO_BOX_SEALBYTES', 'CRYPTO_BOX_SECRETKEYBYTES', 'CRYPTO_BOX_PUBLICKEYBYTES', 'CRYPTO_BOX_KEYPAIRBYTES', 'CRYPTO_BOX_MACBYTES', 'CRYPTO_BOX_NONCEBYTES', 'CRYPTO_BOX_SEEDBYTES', 'CRYPTO_KDF_BYTES_MIN', 'CRYPTO_KDF_BYTES_MAX', 'CRYPTO_KDF_CONTEXTBYTES', 'CRYPTO_KDF_KEYBYTES', 'CRYPTO_KX_BYTES', 'CRYPTO_KX_KEYPAIRBYTES', 'CRYPTO_KX_PRIMITIVE', 'CRYPTO_KX_SEEDBYTES', 'CRYPTO_KX_PUBLICKEYBYTES', 'CRYPTO_KX_SECRETKEYBYTES', 'CRYPTO_KX_SESSIONKEYBYTES', 'CRYPTO_GENERICHASH_BYTES', 'CRYPTO_GENERICHASH_BYTES_MIN', 'CRYPTO_GENERICHASH_BYTES_MAX', 'CRYPTO_GENERICHASH_KEYBYTES', 'CRYPTO_GENERICHASH_KEYBYTES_MIN', 'CRYPTO_GENERICHASH_KEYBYTES_MAX', 'CRYPTO_PWHASH_SALTBYTES', 'CRYPTO_PWHASH_STRPREFIX', 'CRYPTO_PWHASH_ALG_ARGON2I13', 'CRYPTO_PWHASH_ALG_ARGON2ID13', 'CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE', 'CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE', 'CRYPTO_PWHASH_MEMLIMIT_MODERATE', 'CRYPTO_PWHASH_OPSLIMIT_MODERATE', 'CRYPTO_PWHASH_MEMLIMIT_SENSITIVE', 'CRYPTO_PWHASH_OPSLIMIT_SENSITIVE', 'CRYPTO_PWHASH_SCRYPTSALSA208SHA256_SALTBYTES', 'CRYPTO_PWHASH_SCRYPTSALSA208SHA256_STRPREFIX', 'CRYPTO_PWHASH_SCRYPTSALSA208SHA256_MEMLIMIT_INTERACTIVE', 'CRYPTO_PWHASH_SCRYPTSALSA208SHA256_OPSLIMIT_INTERACTIVE', 'CRYPTO_PWHASH_SCRYPTSALSA208SHA256_MEMLIMIT_SENSITIVE', 'CRYPTO_PWHASH_SCRYPTSALSA208SHA256_OPSLIMIT_SENSITIVE', 'CRYPTO_SCALARMULT_BYTES', 'CRYPTO_SCALARMULT_SCALARBYTES', 'CRYPTO_SHORTHASH_BYTES', 'CRYPTO_SHORTHASH_KEYBYTES', 'CRYPTO_SECRETBOX_KEYBYTES', 'CRYPTO_SECRETBOX_MACBYTES', 'CRYPTO_SECRETBOX_NONCEBYTES', 'CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_ABYTES', 'CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES', 'CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_KEYBYTES', 'CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PUSH', 'CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PULL', 'CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY', 'CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_FINAL', 'CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_MESSAGEBYTES_MAX', 'CRYPTO_SIGN_BYTES', 'CRYPTO_SIGN_SEEDBYTES', 'CRYPTO_SIGN_PUBLICKEYBYTES', 'CRYPTO_SIGN_SECRETKEYBYTES', 'CRYPTO_SIGN_KEYPAIRBYTES', 'CRYPTO_STREAM_KEYBYTES', 'CRYPTO_STREAM_NONCEBYTES', 'LIBRARY_MAJOR_VERSION', 'LIBRARY_MINOR_VERSION', 'LIBRARY_VERSION_MAJOR', 'LIBRARY_VERSION_MINOR', 'VERSION_STRING' ) as $constant ) { if (!defined("SODIUM_$constant") && defined("ParagonIE_Sodium_Compat::$constant")) { define("SODIUM_$constant", constant("ParagonIE_Sodium_Compat::$constant")); } } if (!is_callable('sodium_add')) { /** * @see ParagonIE_Sodium_Compat::add() * @param string $val * @param string $addv * @return void * @throws SodiumException */ function sodium_add(&$val, $addv) { ParagonIE_Sodium_Compat::add($val, $addv); } } if (!is_callable('sodium_base642bin')) { /** * @see ParagonIE_Sodium_Compat::bin2base64() * @param string $string * @param int $variant * @param string $ignore * @return string * @throws SodiumException * @throws TypeError */ function sodium_base642bin($string, $variant, $ignore ='') { return ParagonIE_Sodium_Compat::base642bin($string, $variant, $ignore); } } if (!is_callable('sodium_bin2base64')) { /** * @see ParagonIE_Sodium_Compat::bin2base64() * @param string $string * @param int $variant * @return string * @throws SodiumException * @throws TypeError */ function sodium_bin2base64($string, $variant) { return ParagonIE_Sodium_Compat::bin2base64($string, $variant); } } if (!is_callable('sodium_bin2hex')) { /** * @see ParagonIE_Sodium_Compat::hex2bin() * @param string $string * @return string * @throws SodiumException * @throws TypeError */ function sodium_bin2hex($string) { return ParagonIE_Sodium_Compat::bin2hex($string); } } if (!is_callable('sodium_compare')) { /** * @see ParagonIE_Sodium_Compat::compare() * @param string $a * @param string $b * @return int * @throws SodiumException * @throws TypeError */ function sodium_compare($a, $b) { return ParagonIE_Sodium_Compat::compare($a, $b); } } if (!is_callable('sodium_crypto_aead_aes256gcm_decrypt')) { /** * @see ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_decrypt() * @param string $message * @param string $assocData * @param string $nonce * @param string $key * @return string|bool */ function sodium_crypto_aead_aes256gcm_decrypt($message, $assocData, $nonce, $key) { try { return ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_decrypt($message, $assocData, $nonce, $key); } catch (Error $ex) { return false; } catch (Exception $ex) { return false; } } } if (!is_callable('sodium_crypto_aead_aes256gcm_encrypt')) { /** * @see ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_encrypt() * @param string $message * @param string $assocData * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_aead_aes256gcm_encrypt($message, $assocData, $nonce, $key) { return ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_encrypt($message, $assocData, $nonce, $key); } } if (!is_callable('sodium_crypto_aead_aes256gcm_is_available')) { /** * @see ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_is_available() * @return bool */ function sodium_crypto_aead_aes256gcm_is_available() { return ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_is_available(); } } if (!is_callable('sodium_crypto_aead_chacha20poly1305_decrypt')) { /** * @see ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_decrypt() * @param string $message * @param string $assocData * @param string $nonce * @param string $key * @return string|bool */ function sodium_crypto_aead_chacha20poly1305_decrypt($message, $assocData, $nonce, $key) { try { return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_decrypt($message, $assocData, $nonce, $key); } catch (Error $ex) { return false; } catch (Exception $ex) { return false; } } } if (!is_callable('sodium_crypto_aead_chacha20poly1305_encrypt')) { /** * @see ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_encrypt() * @param string $message * @param string $assocData * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_aead_chacha20poly1305_encrypt($message, $assocData, $nonce, $key) { return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_encrypt($message, $assocData, $nonce, $key); } } if (!is_callable('sodium_crypto_aead_chacha20poly1305_keygen')) { /** * @see ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_keygen() * @return string * @throws Exception */ function sodium_crypto_aead_chacha20poly1305_keygen() { return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_keygen(); } } if (!is_callable('sodium_crypto_aead_chacha20poly1305_ietf_decrypt')) { /** * @see ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_decrypt() * @param string $message * @param string $assocData * @param string $nonce * @param string $key * @return string|bool */ function sodium_crypto_aead_chacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key) { try { return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key); } catch (Error $ex) { return false; } catch (Exception $ex) { return false; } } } if (!is_callable('sodium_crypto_aead_chacha20poly1305_ietf_encrypt')) { /** * @see ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_encrypt() * @param string $message * @param string $assocData * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_aead_chacha20poly1305_ietf_encrypt($message, $assocData, $nonce, $key) { return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_encrypt($message, $assocData, $nonce, $key); } } if (!is_callable('sodium_crypto_aead_chacha20poly1305_ietf_keygen')) { /** * @see ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_keygen() * @return string * @throws Exception */ function sodium_crypto_aead_chacha20poly1305_ietf_keygen() { return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_keygen(); } } if (!is_callable('sodium_crypto_aead_xchacha20poly1305_ietf_decrypt')) { /** * @see ParagonIE_Sodium_Compat::crypto_aead_xchacha20poly1305_ietf_decrypt() * @param string $message * @param string $assocData * @param string $nonce * @param string $key * @return string|bool */ function sodium_crypto_aead_xchacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key) { try { return ParagonIE_Sodium_Compat::crypto_aead_xchacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key, true); } catch (Error $ex) { return false; } catch (Exception $ex) { return false; } } } if (!is_callable('sodium_crypto_aead_xchacha20poly1305_ietf_encrypt')) { /** * @see ParagonIE_Sodium_Compat::crypto_aead_xchacha20poly1305_ietf_encrypt() * @param string $message * @param string $assocData * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_aead_xchacha20poly1305_ietf_encrypt($message, $assocData, $nonce, $key) { return ParagonIE_Sodium_Compat::crypto_aead_xchacha20poly1305_ietf_encrypt($message, $assocData, $nonce, $key, true); } } if (!is_callable('sodium_crypto_aead_xchacha20poly1305_ietf_keygen')) { /** * @see ParagonIE_Sodium_Compat::crypto_aead_xchacha20poly1305_ietf_keygen() * @return string * @throws Exception */ function sodium_crypto_aead_xchacha20poly1305_ietf_keygen() { return ParagonIE_Sodium_Compat::crypto_aead_xchacha20poly1305_ietf_keygen(); } } if (!is_callable('sodium_crypto_auth')) { /** * @see ParagonIE_Sodium_Compat::crypto_auth() * @param string $message * @param string $key * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_auth($message, $key) { return ParagonIE_Sodium_Compat::crypto_auth($message, $key); } } if (!is_callable('sodium_crypto_auth_keygen')) { /** * @see ParagonIE_Sodium_Compat::crypto_auth_keygen() * @return string * @throws Exception */ function sodium_crypto_auth_keygen() { return ParagonIE_Sodium_Compat::crypto_auth_keygen(); } } if (!is_callable('sodium_crypto_auth_verify')) { /** * @see ParagonIE_Sodium_Compat::crypto_auth_verify() * @param string $mac * @param string $message * @param string $key * @return bool * @throws SodiumException * @throws TypeError */ function sodium_crypto_auth_verify($mac, $message, $key) { return ParagonIE_Sodium_Compat::crypto_auth_verify($mac, $message, $key); } } if (!is_callable('sodium_crypto_box')) { /** * @see ParagonIE_Sodium_Compat::crypto_box() * @param string $message * @param string $nonce * @param string $kp * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_box($message, $nonce, $kp) { return ParagonIE_Sodium_Compat::crypto_box($message, $nonce, $kp); } } if (!is_callable('sodium_crypto_box_keypair')) { /** * @see ParagonIE_Sodium_Compat::crypto_box_keypair() * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_box_keypair() { return ParagonIE_Sodium_Compat::crypto_box_keypair(); } } if (!is_callable('sodium_crypto_box_keypair_from_secretkey_and_publickey')) { /** * @see ParagonIE_Sodium_Compat::crypto_box_keypair_from_secretkey_and_publickey() * @param string $sk * @param string $pk * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_box_keypair_from_secretkey_and_publickey($sk, $pk) { return ParagonIE_Sodium_Compat::crypto_box_keypair_from_secretkey_and_publickey($sk, $pk); } } if (!is_callable('sodium_crypto_box_open')) { /** * @see ParagonIE_Sodium_Compat::crypto_box_open() * @param string $message * @param string $nonce * @param string $kp * @return string|bool */ function sodium_crypto_box_open($message, $nonce, $kp) { try { return ParagonIE_Sodium_Compat::crypto_box_open($message, $nonce, $kp); } catch (Error $ex) { return false; } catch (Exception $ex) { return false; } } } if (!is_callable('sodium_crypto_box_publickey')) { /** * @see ParagonIE_Sodium_Compat::crypto_box_publickey() * @param string $keypair * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_box_publickey($keypair) { return ParagonIE_Sodium_Compat::crypto_box_publickey($keypair); } } if (!is_callable('sodium_crypto_box_publickey_from_secretkey')) { /** * @see ParagonIE_Sodium_Compat::crypto_box_publickey_from_secretkey() * @param string $sk * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_box_publickey_from_secretkey($sk) { return ParagonIE_Sodium_Compat::crypto_box_publickey_from_secretkey($sk); } } if (!is_callable('sodium_crypto_box_seal')) { /** * @see ParagonIE_Sodium_Compat::crypto_box_seal() * @param string $message * @param string $publicKey * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_box_seal($message, $publicKey) { return ParagonIE_Sodium_Compat::crypto_box_seal($message, $publicKey); } } if (!is_callable('sodium_crypto_box_seal_open')) { /** * @see ParagonIE_Sodium_Compat::crypto_box_seal_open() * @param string $message * @param string $kp * @return string|bool * @throws SodiumException */ function sodium_crypto_box_seal_open($message, $kp) { try { return ParagonIE_Sodium_Compat::crypto_box_seal_open($message, $kp); } catch (SodiumException $ex) { if ($ex->getMessage() === 'Argument 2 must be CRYPTO_BOX_KEYPAIRBYTES long.') { throw $ex; } return false; } } } if (!is_callable('sodium_crypto_box_secretkey')) { /** * @see ParagonIE_Sodium_Compat::crypto_box_secretkey() * @param string $keypair * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_box_secretkey($keypair) { return ParagonIE_Sodium_Compat::crypto_box_secretkey($keypair); } } if (!is_callable('sodium_crypto_box_seed_keypair')) { /** * @see ParagonIE_Sodium_Compat::crypto_box_seed_keypair() * @param string $seed * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_box_seed_keypair($seed) { return ParagonIE_Sodium_Compat::crypto_box_seed_keypair($seed); } } if (!is_callable('sodium_crypto_generichash')) { /** * @see ParagonIE_Sodium_Compat::crypto_generichash() * @param string $message * @param string|null $key * @param int $outLen * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_generichash($message, $key = null, $outLen = 32) { return ParagonIE_Sodium_Compat::crypto_generichash($message, $key, $outLen); } } if (!is_callable('sodium_crypto_generichash_final')) { /** * @see ParagonIE_Sodium_Compat::crypto_generichash_final() * @param string|null $ctx * @param int $outputLength * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_generichash_final(&$ctx, $outputLength = 32) { return ParagonIE_Sodium_Compat::crypto_generichash_final($ctx, $outputLength); } } if (!is_callable('sodium_crypto_generichash_init')) { /** * @see ParagonIE_Sodium_Compat::crypto_generichash_init() * @param string|null $key * @param int $outLen * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_generichash_init($key = null, $outLen = 32) { return ParagonIE_Sodium_Compat::crypto_generichash_init($key, $outLen); } } if (!is_callable('sodium_crypto_generichash_keygen')) { /** * @see ParagonIE_Sodium_Compat::crypto_generichash_keygen() * @return string * @throws Exception */ function sodium_crypto_generichash_keygen() { return ParagonIE_Sodium_Compat::crypto_generichash_keygen(); } } if (!is_callable('sodium_crypto_generichash_update')) { /** * @see ParagonIE_Sodium_Compat::crypto_generichash_update() * @param string|null $ctx * @param string $message * @return void * @throws SodiumException * @throws TypeError */ function sodium_crypto_generichash_update(&$ctx, $message = '') { ParagonIE_Sodium_Compat::crypto_generichash_update($ctx, $message); } } if (!is_callable('sodium_crypto_kdf_keygen')) { /** * @see ParagonIE_Sodium_Compat::crypto_kdf_keygen() * @return string * @throws Exception */ function sodium_crypto_kdf_keygen() { return ParagonIE_Sodium_Compat::crypto_kdf_keygen(); } } if (!is_callable('sodium_crypto_kdf_derive_from_key')) { /** * @see ParagonIE_Sodium_Compat::crypto_kdf_derive_from_key() * @param int $subkey_len * @param int $subkey_id * @param string $context * @param string $key * @return string * @throws Exception */ function sodium_crypto_kdf_derive_from_key($subkey_len, $subkey_id, $context, $key) { return ParagonIE_Sodium_Compat::crypto_kdf_derive_from_key( $subkey_len, $subkey_id, $context, $key ); } } if (!is_callable('sodium_crypto_kx')) { /** * @see ParagonIE_Sodium_Compat::crypto_kx() * @param string $my_secret * @param string $their_public * @param string $client_public * @param string $server_public * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_kx($my_secret, $their_public, $client_public, $server_public) { return ParagonIE_Sodium_Compat::crypto_kx( $my_secret, $their_public, $client_public, $server_public ); } } if (!is_callable('sodium_crypto_kx_seed_keypair')) { /** * @param string $seed * @return string * @throws Exception */ function sodium_crypto_kx_seed_keypair($seed) { return ParagonIE_Sodium_Compat::crypto_kx_seed_keypair($seed); } } if (!is_callable('sodium_crypto_kx_keypair')) { /** * @return string * @throws Exception */ function sodium_crypto_kx_keypair() { return ParagonIE_Sodium_Compat::crypto_kx_keypair(); } } if (!is_callable('sodium_crypto_kx_client_session_keys')) { /** * @param string $keypair * @param string $serverPublicKey * @return array{0: string, 1: string} * @throws SodiumException */ function sodium_crypto_kx_client_session_keys($keypair, $serverPublicKey) { return ParagonIE_Sodium_Compat::crypto_kx_client_session_keys($keypair, $serverPublicKey); } } if (!is_callable('sodium_crypto_kx_server_session_keys')) { /** * @param string $keypair * @param string $clientPublicKey * @return array{0: string, 1: string} * @throws SodiumException */ function sodium_crypto_kx_server_session_keys($keypair, $clientPublicKey) { return ParagonIE_Sodium_Compat::crypto_kx_server_session_keys($keypair, $clientPublicKey); } } if (!is_callable('sodium_crypto_kx_secretkey')) { /** * @param string $keypair * @return string * @throws Exception */ function sodium_crypto_kx_secretkey($keypair) { return ParagonIE_Sodium_Compat::crypto_kx_secretkey($keypair); } } if (!is_callable('sodium_crypto_kx_publickey')) { /** * @param string $keypair * @return string * @throws Exception */ function sodium_crypto_kx_publickey($keypair) { return ParagonIE_Sodium_Compat::crypto_kx_publickey($keypair); } } if (!is_callable('sodium_crypto_pwhash')) { /** * @see ParagonIE_Sodium_Compat::crypto_pwhash() * @param int $outlen * @param string $passwd * @param string $salt * @param int $opslimit * @param int $memlimit * @param int|null $algo * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_pwhash($outlen, $passwd, $salt, $opslimit, $memlimit, $algo = null) { return ParagonIE_Sodium_Compat::crypto_pwhash($outlen, $passwd, $salt, $opslimit, $memlimit, $algo); } } if (!is_callable('sodium_crypto_pwhash_str')) { /** * @see ParagonIE_Sodium_Compat::crypto_pwhash_str() * @param string $passwd * @param int $opslimit * @param int $memlimit * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_pwhash_str($passwd, $opslimit, $memlimit) { return ParagonIE_Sodium_Compat::crypto_pwhash_str($passwd, $opslimit, $memlimit); } } if (!is_callable('sodium_crypto_pwhash_str_needs_rehash')) { /** * @see ParagonIE_Sodium_Compat::crypto_pwhash_str_needs_rehash() * @param string $hash * @param int $opslimit * @param int $memlimit * @return bool * * @throws SodiumException */ function sodium_crypto_pwhash_str_needs_rehash($hash, $opslimit, $memlimit) { return ParagonIE_Sodium_Compat::crypto_pwhash_str_needs_rehash($hash, $opslimit, $memlimit); } } if (!is_callable('sodium_crypto_pwhash_str_verify')) { /** * @see ParagonIE_Sodium_Compat::crypto_pwhash_str_verify() * @param string $passwd * @param string $hash * @return bool * @throws SodiumException * @throws TypeError */ function sodium_crypto_pwhash_str_verify($passwd, $hash) { return ParagonIE_Sodium_Compat::crypto_pwhash_str_verify($passwd, $hash); } } if (!is_callable('sodium_crypto_pwhash_scryptsalsa208sha256')) { /** * @see ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256() * @param int $outlen * @param string $passwd * @param string $salt * @param int $opslimit * @param int $memlimit * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_pwhash_scryptsalsa208sha256($outlen, $passwd, $salt, $opslimit, $memlimit) { return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256($outlen, $passwd, $salt, $opslimit, $memlimit); } } if (!is_callable('sodium_crypto_pwhash_scryptsalsa208sha256_str')) { /** * @see ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str() * @param string $passwd * @param int $opslimit * @param int $memlimit * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_pwhash_scryptsalsa208sha256_str($passwd, $opslimit, $memlimit) { return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str($passwd, $opslimit, $memlimit); } } if (!is_callable('sodium_crypto_pwhash_scryptsalsa208sha256_str_verify')) { /** * @see ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str_verify() * @param string $passwd * @param string $hash * @return bool * @throws SodiumException * @throws TypeError */ function sodium_crypto_pwhash_scryptsalsa208sha256_str_verify($passwd, $hash) { return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str_verify($passwd, $hash); } } if (!is_callable('sodium_crypto_scalarmult')) { /** * @see ParagonIE_Sodium_Compat::crypto_scalarmult() * @param string $n * @param string $p * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_scalarmult($n, $p) { return ParagonIE_Sodium_Compat::crypto_scalarmult($n, $p); } } if (!is_callable('sodium_crypto_scalarmult_base')) { /** * @see ParagonIE_Sodium_Compat::crypto_scalarmult_base() * @param string $n * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_scalarmult_base($n) { return ParagonIE_Sodium_Compat::crypto_scalarmult_base($n); } } if (!is_callable('sodium_crypto_secretbox')) { /** * @see ParagonIE_Sodium_Compat::crypto_secretbox() * @param string $message * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_secretbox($message, $nonce, $key) { return ParagonIE_Sodium_Compat::crypto_secretbox($message, $nonce, $key); } } if (!is_callable('sodium_crypto_secretbox_keygen')) { /** * @see ParagonIE_Sodium_Compat::crypto_secretbox_keygen() * @return string * @throws Exception */ function sodium_crypto_secretbox_keygen() { return ParagonIE_Sodium_Compat::crypto_secretbox_keygen(); } } if (!is_callable('sodium_crypto_secretbox_open')) { /** * @see ParagonIE_Sodium_Compat::crypto_secretbox_open() * @param string $message * @param string $nonce * @param string $key * @return string|bool */ function sodium_crypto_secretbox_open($message, $nonce, $key) { try { return ParagonIE_Sodium_Compat::crypto_secretbox_open($message, $nonce, $key); } catch (Error $ex) { return false; } catch (Exception $ex) { return false; } } } if (!is_callable('sodium_crypto_secretstream_xchacha20poly1305_init_push')) { /** * @param string $key * @return array<int, string> * @throws SodiumException */ function sodium_crypto_secretstream_xchacha20poly1305_init_push($key) { return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_init_push($key); } } if (!is_callable('sodium_crypto_secretstream_xchacha20poly1305_push')) { /** * @param string $state * @param string $msg * @param string $aad * @param int $tag * @return string * @throws SodiumException */ function sodium_crypto_secretstream_xchacha20poly1305_push(&$state, $msg, $aad = '', $tag = 0) { return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_push($state, $msg, $aad, $tag); } } if (!is_callable('sodium_crypto_secretstream_xchacha20poly1305_init_pull')) { /** * @param string $header * @param string $key * @return string * @throws Exception */ function sodium_crypto_secretstream_xchacha20poly1305_init_pull($header, $key) { return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_init_pull($header, $key); } } if (!is_callable('sodium_crypto_secretstream_xchacha20poly1305_pull')) { /** * @param string $state * @param string $cipher * @param string $aad * @return bool|array{0: string, 1: int} * @throws SodiumException */ function sodium_crypto_secretstream_xchacha20poly1305_pull(&$state, $cipher, $aad = '') { return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_pull($state, $cipher, $aad); } } if (!is_callable('sodium_crypto_secretstream_xchacha20poly1305_rekey')) { /** * @param string $state * @return void * @throws SodiumException */ function sodium_crypto_secretstream_xchacha20poly1305_rekey(&$state) { ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_rekey($state); } } if (!is_callable('sodium_crypto_secretstream_xchacha20poly1305_keygen')) { /** * @return string * @throws Exception */ function sodium_crypto_secretstream_xchacha20poly1305_keygen() { return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_keygen(); } } if (!is_callable('sodium_crypto_shorthash')) { /** * @see ParagonIE_Sodium_Compat::crypto_shorthash() * @param string $message * @param string $key * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_shorthash($message, $key = '') { return ParagonIE_Sodium_Compat::crypto_shorthash($message, $key); } } if (!is_callable('sodium_crypto_shorthash_keygen')) { /** * @see ParagonIE_Sodium_Compat::crypto_shorthash_keygen() * @return string * @throws Exception */ function sodium_crypto_shorthash_keygen() { return ParagonIE_Sodium_Compat::crypto_shorthash_keygen(); } } if (!is_callable('sodium_crypto_sign')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign() * @param string $message * @param string $sk * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_sign($message, $sk) { return ParagonIE_Sodium_Compat::crypto_sign($message, $sk); } } if (!is_callable('sodium_crypto_sign_detached')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign_detached() * @param string $message * @param string $sk * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_sign_detached($message, $sk) { return ParagonIE_Sodium_Compat::crypto_sign_detached($message, $sk); } } if (!is_callable('sodium_crypto_sign_keypair_from_secretkey_and_publickey')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign_keypair_from_secretkey_and_publickey() * @param string $sk * @param string $pk * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_sign_keypair_from_secretkey_and_publickey($sk, $pk) { return ParagonIE_Sodium_Compat::crypto_sign_keypair_from_secretkey_and_publickey($sk, $pk); } } if (!is_callable('sodium_crypto_sign_keypair')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign_keypair() * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_sign_keypair() { return ParagonIE_Sodium_Compat::crypto_sign_keypair(); } } if (!is_callable('sodium_crypto_sign_open')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign_open() * @param string $signedMessage * @param string $pk * @return string|bool */ function sodium_crypto_sign_open($signedMessage, $pk) { try { return ParagonIE_Sodium_Compat::crypto_sign_open($signedMessage, $pk); } catch (Error $ex) { return false; } catch (Exception $ex) { return false; } } } if (!is_callable('sodium_crypto_sign_publickey')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign_publickey() * @param string $keypair * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_sign_publickey($keypair) { return ParagonIE_Sodium_Compat::crypto_sign_publickey($keypair); } } if (!is_callable('sodium_crypto_sign_publickey_from_secretkey')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign_publickey_from_secretkey() * @param string $sk * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_sign_publickey_from_secretkey($sk) { return ParagonIE_Sodium_Compat::crypto_sign_publickey_from_secretkey($sk); } } if (!is_callable('sodium_crypto_sign_secretkey')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign_secretkey() * @param string $keypair * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_sign_secretkey($keypair) { return ParagonIE_Sodium_Compat::crypto_sign_secretkey($keypair); } } if (!is_callable('sodium_crypto_sign_seed_keypair')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign_seed_keypair() * @param string $seed * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_sign_seed_keypair($seed) { return ParagonIE_Sodium_Compat::crypto_sign_seed_keypair($seed); } } if (!is_callable('sodium_crypto_sign_verify_detached')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign_verify_detached() * @param string $signature * @param string $message * @param string $pk * @return bool * @throws SodiumException * @throws TypeError */ function sodium_crypto_sign_verify_detached($signature, $message, $pk) { return ParagonIE_Sodium_Compat::crypto_sign_verify_detached($signature, $message, $pk); } } if (!is_callable('sodium_crypto_sign_ed25519_pk_to_curve25519')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign_ed25519_pk_to_curve25519() * @param string $pk * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_sign_ed25519_pk_to_curve25519($pk) { return ParagonIE_Sodium_Compat::crypto_sign_ed25519_pk_to_curve25519($pk); } } if (!is_callable('sodium_crypto_sign_ed25519_sk_to_curve25519')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign_ed25519_sk_to_curve25519() * @param string $sk * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_sign_ed25519_sk_to_curve25519($sk) { return ParagonIE_Sodium_Compat::crypto_sign_ed25519_sk_to_curve25519($sk); } } if (!is_callable('sodium_crypto_stream')) { /** * @see ParagonIE_Sodium_Compat::crypto_stream() * @param int $len * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_stream($len, $nonce, $key) { return ParagonIE_Sodium_Compat::crypto_stream($len, $nonce, $key); } } if (!is_callable('sodium_crypto_stream_keygen')) { /** * @see ParagonIE_Sodium_Compat::crypto_stream_keygen() * @return string * @throws Exception */ function sodium_crypto_stream_keygen() { return ParagonIE_Sodium_Compat::crypto_stream_keygen(); } } if (!is_callable('sodium_crypto_stream_xor')) { /** * @see ParagonIE_Sodium_Compat::crypto_stream_xor() * @param string $message * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_stream_xor($message, $nonce, $key) { return ParagonIE_Sodium_Compat::crypto_stream_xor($message, $nonce, $key); } } if (!is_callable('sodium_hex2bin')) { /** * @see ParagonIE_Sodium_Compat::hex2bin() * @param string $string * @return string * @throws SodiumException * @throws TypeError */ function sodium_hex2bin($string) { return ParagonIE_Sodium_Compat::hex2bin($string); } } if (!is_callable('sodium_increment')) { /** * @see ParagonIE_Sodium_Compat::increment() * @param string $string * @return void * @throws SodiumException * @throws TypeError */ function sodium_increment(&$string) { ParagonIE_Sodium_Compat::increment($string); } } if (!is_callable('sodium_library_version_major')) { /** * @see ParagonIE_Sodium_Compat::library_version_major() * @return int */ function sodium_library_version_major() { return ParagonIE_Sodium_Compat::library_version_major(); } } if (!is_callable('sodium_library_version_minor')) { /** * @see ParagonIE_Sodium_Compat::library_version_minor() * @return int */ function sodium_library_version_minor() { return ParagonIE_Sodium_Compat::library_version_minor(); } } if (!is_callable('sodium_version_string')) { /** * @see ParagonIE_Sodium_Compat::version_string() * @return string */ function sodium_version_string() { return ParagonIE_Sodium_Compat::version_string(); } } if (!is_callable('sodium_memcmp')) { /** * @see ParagonIE_Sodium_Compat::memcmp() * @param string $a * @param string $b * @return int * @throws SodiumException * @throws TypeError */ function sodium_memcmp($a, $b) { return ParagonIE_Sodium_Compat::memcmp($a, $b); } } if (!is_callable('sodium_memzero')) { /** * @see ParagonIE_Sodium_Compat::memzero() * @param string $str * @return void * @throws SodiumException * @throws TypeError */ function sodium_memzero(&$str) { ParagonIE_Sodium_Compat::memzero($str); } } if (!is_callable('sodium_pad')) { /** * @see ParagonIE_Sodium_Compat::pad() * @param string $unpadded * @param int $blockSize * @return int * @throws SodiumException * @throws TypeError */ function sodium_pad($unpadded, $blockSize) { return ParagonIE_Sodium_Compat::pad($unpadded, $blockSize, true); } } if (!is_callable('sodium_unpad')) { /** * @see ParagonIE_Sodium_Compat::pad() * @param string $padded * @param int $blockSize * @return int * @throws SodiumException * @throws TypeError */ function sodium_unpad($padded, $blockSize) { return ParagonIE_Sodium_Compat::unpad($padded, $blockSize, true); } } if (!is_callable('sodium_randombytes_buf')) { /** * @see ParagonIE_Sodium_Compat::randombytes_buf() * @param int $amount * @return string * @throws Exception */ function sodium_randombytes_buf($amount) { return ParagonIE_Sodium_Compat::randombytes_buf($amount); } } if (!is_callable('sodium_randombytes_uniform')) { /** * @see ParagonIE_Sodium_Compat::randombytes_uniform() * @param int $upperLimit * @return int * @throws Exception */ function sodium_randombytes_uniform($upperLimit) { return ParagonIE_Sodium_Compat::randombytes_uniform($upperLimit); } } if (!is_callable('sodium_randombytes_random16')) { /** * @see ParagonIE_Sodium_Compat::randombytes_random16() * @return int * @throws Exception */ function sodium_randombytes_random16() { return ParagonIE_Sodium_Compat::randombytes_random16(); } } pusher/vendor/paragonie/sodium_compat/lib/php72compat_const.php 0000644 00000010613 15117231254 0021012 0 ustar 00 <?php const SODIUM_LIBRARY_MAJOR_VERSION = 9; const SODIUM_LIBRARY_MINOR_VERSION = 1; const SODIUM_LIBRARY_VERSION = '1.0.8'; const SODIUM_BASE64_VARIANT_ORIGINAL = 1; const SODIUM_BASE64_VARIANT_ORIGINAL_NO_PADDING = 3; const SODIUM_BASE64_VARIANT_URLSAFE = 5; const SODIUM_BASE64_VARIANT_URLSAFE_NO_PADDING = 7; const SODIUM_CRYPTO_AEAD_AES256GCM_KEYBYTES = 32; const SODIUM_CRYPTO_AEAD_AES256GCM_NSECBYTES = 0; const SODIUM_CRYPTO_AEAD_AES256GCM_NPUBBYTES = 12; const SODIUM_CRYPTO_AEAD_AES256GCM_ABYTES = 16; const SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES = 32; const SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_NSECBYTES = 0; const SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES = 8; const SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_ABYTES = 16; const SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_IETF_KEYBYTES = 32; const SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_IETF_NSECBYTES = 0; const SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES = 12; const SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_IETF_ABYTES = 16; const SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES = 32; const SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NSECBYTES = 0; const SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES = 24; const SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_ABYTES = 16; const SODIUM_CRYPTO_AUTH_BYTES = 32; const SODIUM_CRYPTO_AUTH_KEYBYTES = 32; const SODIUM_CRYPTO_BOX_SEALBYTES = 16; const SODIUM_CRYPTO_BOX_SECRETKEYBYTES = 32; const SODIUM_CRYPTO_BOX_PUBLICKEYBYTES = 32; const SODIUM_CRYPTO_BOX_KEYPAIRBYTES = 64; const SODIUM_CRYPTO_BOX_MACBYTES = 16; const SODIUM_CRYPTO_BOX_NONCEBYTES = 24; const SODIUM_CRYPTO_BOX_SEEDBYTES = 32; const SODIUM_CRYPTO_KDF_BYTES_MIN = 16; const SODIUM_CRYPTO_KDF_BYTES_MAX = 64; const SODIUM_CRYPTO_KDF_CONTEXTBYTES = 8; const SODIUM_CRYPTO_KDF_KEYBYTES = 32; const SODIUM_CRYPTO_KX_BYTES = 32; const SODIUM_CRYPTO_KX_PRIMITIVE = 'x25519blake2b'; const SODIUM_CRYPTO_KX_SEEDBYTES = 32; const SODIUM_CRYPTO_KX_KEYPAIRBYTES = 64; const SODIUM_CRYPTO_KX_PUBLICKEYBYTES = 32; const SODIUM_CRYPTO_KX_SECRETKEYBYTES = 32; const SODIUM_CRYPTO_KX_SESSIONKEYBYTES = 32; const SODIUM_CRYPTO_GENERICHASH_BYTES = 32; const SODIUM_CRYPTO_GENERICHASH_BYTES_MIN = 16; const SODIUM_CRYPTO_GENERICHASH_BYTES_MAX = 64; const SODIUM_CRYPTO_GENERICHASH_KEYBYTES = 32; const SODIUM_CRYPTO_GENERICHASH_KEYBYTES_MIN = 16; const SODIUM_CRYPTO_GENERICHASH_KEYBYTES_MAX = 64; const SODIUM_CRYPTO_PWHASH_SALTBYTES = 16; const SODIUM_CRYPTO_PWHASH_STRPREFIX = '$argon2id$'; const SODIUM_CRYPTO_PWHASH_ALG_ARGON2I13 = 1; const SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13 = 2; const SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE = 33554432; const SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE = 4; const SODIUM_CRYPTO_PWHASH_MEMLIMIT_MODERATE = 134217728; const SODIUM_CRYPTO_PWHASH_OPSLIMIT_MODERATE = 6; const SODIUM_CRYPTO_PWHASH_MEMLIMIT_SENSITIVE = 536870912; const SODIUM_CRYPTO_PWHASH_OPSLIMIT_SENSITIVE = 8; const SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_SALTBYTES = 32; const SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_STRPREFIX = '$7$'; const SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_OPSLIMIT_INTERACTIVE = 534288; const SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_MEMLIMIT_INTERACTIVE = 16777216; const SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_OPSLIMIT_SENSITIVE = 33554432; const SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_MEMLIMIT_SENSITIVE = 1073741824; const SODIUM_CRYPTO_SCALARMULT_BYTES = 32; const SODIUM_CRYPTO_SCALARMULT_SCALARBYTES = 32; const SODIUM_CRYPTO_SHORTHASH_BYTES = 8; const SODIUM_CRYPTO_SHORTHASH_KEYBYTES = 16; const SODIUM_CRYPTO_SECRETBOX_KEYBYTES = 32; const SODIUM_CRYPTO_SECRETBOX_MACBYTES = 16; const SODIUM_CRYPTO_SECRETBOX_NONCEBYTES = 24; const SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_ABYTES = 17; const SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES = 24; const SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_KEYBYTES = 32; const SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PUSH = 0; const SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_PULL = 1; const SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY = 2; const SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_FINAL = 3; const SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_MESSAGEBYTES_MAX = 0x3fffffff80; const SODIUM_CRYPTO_SIGN_BYTES = 64; const SODIUM_CRYPTO_SIGN_SEEDBYTES = 32; const SODIUM_CRYPTO_SIGN_PUBLICKEYBYTES = 32; const SODIUM_CRYPTO_SIGN_SECRETKEYBYTES = 64; const SODIUM_CRYPTO_SIGN_KEYPAIRBYTES = 96; const SODIUM_CRYPTO_STREAM_KEYBYTES = 32; const SODIUM_CRYPTO_STREAM_NONCEBYTES = 24; pusher/vendor/paragonie/sodium_compat/lib/sodium_compat.php 0000644 00000057706 15117231254 0020321 0 ustar 00 <?php namespace Sodium; require_once dirname(dirname(__FILE__)) . '/autoload.php'; use ParagonIE_Sodium_Compat; /** * This file will monkey patch the pure-PHP implementation in place of the * PECL functions, but only if they do not already exist. * * Thus, the functions just proxy to the appropriate ParagonIE_Sodium_Compat * method. */ if (!is_callable('\\Sodium\\bin2hex')) { /** * @see ParagonIE_Sodium_Compat::bin2hex() * @param string $string * @return string * @throws \SodiumException * @throws \TypeError */ function bin2hex($string) { return ParagonIE_Sodium_Compat::bin2hex($string); } } if (!is_callable('\\Sodium\\compare')) { /** * @see ParagonIE_Sodium_Compat::compare() * @param string $a * @param string $b * @return int * @throws \SodiumException * @throws \TypeError */ function compare($a, $b) { return ParagonIE_Sodium_Compat::compare($a, $b); } } if (!is_callable('\\Sodium\\crypto_aead_aes256gcm_decrypt')) { /** * @see ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_decrypt() * @param string $message * @param string $assocData * @param string $nonce * @param string $key * @return string|bool */ function crypto_aead_aes256gcm_decrypt($message, $assocData, $nonce, $key) { try { return ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_decrypt($message, $assocData, $nonce, $key); } catch (\TypeError $ex) { return false; } catch (\SodiumException $ex) { return false; } } } if (!is_callable('\\Sodium\\crypto_aead_aes256gcm_encrypt')) { /** * @see ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_encrypt() * @param string $message * @param string $assocData * @param string $nonce * @param string $key * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_aead_aes256gcm_encrypt($message, $assocData, $nonce, $key) { return ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_encrypt($message, $assocData, $nonce, $key); } } if (!is_callable('\\Sodium\\crypto_aead_aes256gcm_is_available')) { /** * @see ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_is_available() * @return bool */ function crypto_aead_aes256gcm_is_available() { return ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_is_available(); } } if (!is_callable('\\Sodium\\crypto_aead_chacha20poly1305_decrypt')) { /** * @see ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_decrypt() * @param string $message * @param string $assocData * @param string $nonce * @param string $key * @return string|bool */ function crypto_aead_chacha20poly1305_decrypt($message, $assocData, $nonce, $key) { try { return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_decrypt($message, $assocData, $nonce, $key); } catch (\TypeError $ex) { return false; } catch (\SodiumException $ex) { return false; } } } if (!is_callable('\\Sodium\\crypto_aead_chacha20poly1305_encrypt')) { /** * @see ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_encrypt() * @param string $message * @param string $assocData * @param string $nonce * @param string $key * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_aead_chacha20poly1305_encrypt($message, $assocData, $nonce, $key) { return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_encrypt($message, $assocData, $nonce, $key); } } if (!is_callable('\\Sodium\\crypto_aead_chacha20poly1305_ietf_decrypt')) { /** * @see ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_decrypt() * @param string $message * @param string $assocData * @param string $nonce * @param string $key * @return string|bool */ function crypto_aead_chacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key) { try { return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key); } catch (\TypeError $ex) { return false; } catch (\SodiumException $ex) { return false; } } } if (!is_callable('\\Sodium\\crypto_aead_chacha20poly1305_ietf_encrypt')) { /** * @see ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_encrypt() * @param string $message * @param string $assocData * @param string $nonce * @param string $key * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_aead_chacha20poly1305_ietf_encrypt($message, $assocData, $nonce, $key) { return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_encrypt($message, $assocData, $nonce, $key); } } if (!is_callable('\\Sodium\\crypto_auth')) { /** * @see ParagonIE_Sodium_Compat::crypto_auth() * @param string $message * @param string $key * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_auth($message, $key) { return ParagonIE_Sodium_Compat::crypto_auth($message, $key); } } if (!is_callable('\\Sodium\\crypto_auth_verify')) { /** * @see ParagonIE_Sodium_Compat::crypto_auth_verify() * @param string $mac * @param string $message * @param string $key * @return bool * @throws \SodiumException * @throws \TypeError */ function crypto_auth_verify($mac, $message, $key) { return ParagonIE_Sodium_Compat::crypto_auth_verify($mac, $message, $key); } } if (!is_callable('\\Sodium\\crypto_box')) { /** * @see ParagonIE_Sodium_Compat::crypto_box() * @param string $message * @param string $nonce * @param string $kp * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_box($message, $nonce, $kp) { return ParagonIE_Sodium_Compat::crypto_box($message, $nonce, $kp); } } if (!is_callable('\\Sodium\\crypto_box_keypair')) { /** * @see ParagonIE_Sodium_Compat::crypto_box_keypair() * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_box_keypair() { return ParagonIE_Sodium_Compat::crypto_box_keypair(); } } if (!is_callable('\\Sodium\\crypto_box_keypair_from_secretkey_and_publickey')) { /** * @see ParagonIE_Sodium_Compat::crypto_box_keypair_from_secretkey_and_publickey() * @param string $sk * @param string $pk * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_box_keypair_from_secretkey_and_publickey($sk, $pk) { return ParagonIE_Sodium_Compat::crypto_box_keypair_from_secretkey_and_publickey($sk, $pk); } } if (!is_callable('\\Sodium\\crypto_box_open')) { /** * @see ParagonIE_Sodium_Compat::crypto_box_open() * @param string $message * @param string $nonce * @param string $kp * @return string|bool */ function crypto_box_open($message, $nonce, $kp) { try { return ParagonIE_Sodium_Compat::crypto_box_open($message, $nonce, $kp); } catch (\TypeError $ex) { return false; } catch (\SodiumException $ex) { return false; } } } if (!is_callable('\\Sodium\\crypto_box_publickey')) { /** * @see ParagonIE_Sodium_Compat::crypto_box_publickey() * @param string $keypair * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_box_publickey($keypair) { return ParagonIE_Sodium_Compat::crypto_box_publickey($keypair); } } if (!is_callable('\\Sodium\\crypto_box_publickey_from_secretkey')) { /** * @see ParagonIE_Sodium_Compat::crypto_box_publickey_from_secretkey() * @param string $sk * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_box_publickey_from_secretkey($sk) { return ParagonIE_Sodium_Compat::crypto_box_publickey_from_secretkey($sk); } } if (!is_callable('\\Sodium\\crypto_box_seal')) { /** * @see ParagonIE_Sodium_Compat::crypto_box_seal_open() * @param string $message * @param string $publicKey * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_box_seal($message, $publicKey) { return ParagonIE_Sodium_Compat::crypto_box_seal($message, $publicKey); } } if (!is_callable('\\Sodium\\crypto_box_seal_open')) { /** * @see ParagonIE_Sodium_Compat::crypto_box_seal_open() * @param string $message * @param string $kp * @return string|bool */ function crypto_box_seal_open($message, $kp) { try { return ParagonIE_Sodium_Compat::crypto_box_seal_open($message, $kp); } catch (\TypeError $ex) { return false; } catch (\SodiumException $ex) { return false; } } } if (!is_callable('\\Sodium\\crypto_box_secretkey')) { /** * @see ParagonIE_Sodium_Compat::crypto_box_secretkey() * @param string $keypair * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_box_secretkey($keypair) { return ParagonIE_Sodium_Compat::crypto_box_secretkey($keypair); } } if (!is_callable('\\Sodium\\crypto_generichash')) { /** * @see ParagonIE_Sodium_Compat::crypto_generichash() * @param string $message * @param string|null $key * @param int $outLen * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_generichash($message, $key = null, $outLen = 32) { return ParagonIE_Sodium_Compat::crypto_generichash($message, $key, $outLen); } } if (!is_callable('\\Sodium\\crypto_generichash_final')) { /** * @see ParagonIE_Sodium_Compat::crypto_generichash_final() * @param string|null $ctx * @param int $outputLength * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_generichash_final(&$ctx, $outputLength = 32) { return ParagonIE_Sodium_Compat::crypto_generichash_final($ctx, $outputLength); } } if (!is_callable('\\Sodium\\crypto_generichash_init')) { /** * @see ParagonIE_Sodium_Compat::crypto_generichash_init() * @param string|null $key * @param int $outLen * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_generichash_init($key = null, $outLen = 32) { return ParagonIE_Sodium_Compat::crypto_generichash_init($key, $outLen); } } if (!is_callable('\\Sodium\\crypto_generichash_update')) { /** * @see ParagonIE_Sodium_Compat::crypto_generichash_update() * @param string|null $ctx * @param string $message * @return void * @throws \SodiumException * @throws \TypeError */ function crypto_generichash_update(&$ctx, $message = '') { ParagonIE_Sodium_Compat::crypto_generichash_update($ctx, $message); } } if (!is_callable('\\Sodium\\crypto_kx')) { /** * @see ParagonIE_Sodium_Compat::crypto_kx() * @param string $my_secret * @param string $their_public * @param string $client_public * @param string $server_public * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_kx($my_secret, $their_public, $client_public, $server_public) { return ParagonIE_Sodium_Compat::crypto_kx( $my_secret, $their_public, $client_public, $server_public ); } } if (!is_callable('\\Sodium\\crypto_pwhash')) { /** * @see ParagonIE_Sodium_Compat::crypto_pwhash() * @param int $outlen * @param string $passwd * @param string $salt * @param int $opslimit * @param int $memlimit * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_pwhash($outlen, $passwd, $salt, $opslimit, $memlimit) { return ParagonIE_Sodium_Compat::crypto_pwhash($outlen, $passwd, $salt, $opslimit, $memlimit); } } if (!is_callable('\\Sodium\\crypto_pwhash_str')) { /** * @see ParagonIE_Sodium_Compat::crypto_pwhash_str() * @param string $passwd * @param int $opslimit * @param int $memlimit * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_pwhash_str($passwd, $opslimit, $memlimit) { return ParagonIE_Sodium_Compat::crypto_pwhash_str($passwd, $opslimit, $memlimit); } } if (!is_callable('\\Sodium\\crypto_pwhash_str_verify')) { /** * @see ParagonIE_Sodium_Compat::crypto_pwhash_str_verify() * @param string $passwd * @param string $hash * @return bool * @throws \SodiumException * @throws \TypeError */ function crypto_pwhash_str_verify($passwd, $hash) { return ParagonIE_Sodium_Compat::crypto_pwhash_str_verify($passwd, $hash); } } if (!is_callable('\\Sodium\\crypto_pwhash_scryptsalsa208sha256')) { /** * @see ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256() * @param int $outlen * @param string $passwd * @param string $salt * @param int $opslimit * @param int $memlimit * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_pwhash_scryptsalsa208sha256($outlen, $passwd, $salt, $opslimit, $memlimit) { return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256($outlen, $passwd, $salt, $opslimit, $memlimit); } } if (!is_callable('\\Sodium\\crypto_pwhash_scryptsalsa208sha256_str')) { /** * @see ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str() * @param string $passwd * @param int $opslimit * @param int $memlimit * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_pwhash_scryptsalsa208sha256_str($passwd, $opslimit, $memlimit) { return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str($passwd, $opslimit, $memlimit); } } if (!is_callable('\\Sodium\\crypto_pwhash_scryptsalsa208sha256_str_verify')) { /** * @see ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str_verify() * @param string $passwd * @param string $hash * @return bool * @throws \SodiumException * @throws \TypeError */ function crypto_pwhash_scryptsalsa208sha256_str_verify($passwd, $hash) { return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str_verify($passwd, $hash); } } if (!is_callable('\\Sodium\\crypto_scalarmult')) { /** * @see ParagonIE_Sodium_Compat::crypto_scalarmult() * @param string $n * @param string $p * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_scalarmult($n, $p) { return ParagonIE_Sodium_Compat::crypto_scalarmult($n, $p); } } if (!is_callable('\\Sodium\\crypto_scalarmult_base')) { /** * @see ParagonIE_Sodium_Compat::crypto_scalarmult_base() * @param string $n * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_scalarmult_base($n) { return ParagonIE_Sodium_Compat::crypto_scalarmult_base($n); } } if (!is_callable('\\Sodium\\crypto_secretbox')) { /** * @see ParagonIE_Sodium_Compat::crypto_secretbox() * @param string $message * @param string $nonce * @param string $key * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_secretbox($message, $nonce, $key) { return ParagonIE_Sodium_Compat::crypto_secretbox($message, $nonce, $key); } } if (!is_callable('\\Sodium\\crypto_secretbox_open')) { /** * @see ParagonIE_Sodium_Compat::crypto_secretbox_open() * @param string $message * @param string $nonce * @param string $key * @return string|bool */ function crypto_secretbox_open($message, $nonce, $key) { try { return ParagonIE_Sodium_Compat::crypto_secretbox_open($message, $nonce, $key); } catch (\TypeError $ex) { return false; } catch (\SodiumException $ex) { return false; } } } if (!is_callable('\\Sodium\\crypto_shorthash')) { /** * @see ParagonIE_Sodium_Compat::crypto_shorthash() * @param string $message * @param string $key * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_shorthash($message, $key = '') { return ParagonIE_Sodium_Compat::crypto_shorthash($message, $key); } } if (!is_callable('\\Sodium\\crypto_sign')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign() * @param string $message * @param string $sk * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_sign($message, $sk) { return ParagonIE_Sodium_Compat::crypto_sign($message, $sk); } } if (!is_callable('\\Sodium\\crypto_sign_detached')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign_detached() * @param string $message * @param string $sk * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_sign_detached($message, $sk) { return ParagonIE_Sodium_Compat::crypto_sign_detached($message, $sk); } } if (!is_callable('\\Sodium\\crypto_sign_keypair')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign_keypair() * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_sign_keypair() { return ParagonIE_Sodium_Compat::crypto_sign_keypair(); } } if (!is_callable('\\Sodium\\crypto_sign_open')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign_open() * @param string $signedMessage * @param string $pk * @return string|bool */ function crypto_sign_open($signedMessage, $pk) { try { return ParagonIE_Sodium_Compat::crypto_sign_open($signedMessage, $pk); } catch (\TypeError $ex) { return false; } catch (\SodiumException $ex) { return false; } } } if (!is_callable('\\Sodium\\crypto_sign_publickey')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign_publickey() * @param string $keypair * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_sign_publickey($keypair) { return ParagonIE_Sodium_Compat::crypto_sign_publickey($keypair); } } if (!is_callable('\\Sodium\\crypto_sign_publickey_from_secretkey')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign_publickey_from_secretkey() * @param string $sk * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_sign_publickey_from_secretkey($sk) { return ParagonIE_Sodium_Compat::crypto_sign_publickey_from_secretkey($sk); } } if (!is_callable('\\Sodium\\crypto_sign_secretkey')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign_secretkey() * @param string $keypair * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_sign_secretkey($keypair) { return ParagonIE_Sodium_Compat::crypto_sign_secretkey($keypair); } } if (!is_callable('\\Sodium\\crypto_sign_seed_keypair')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign_seed_keypair() * @param string $seed * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_sign_seed_keypair($seed) { return ParagonIE_Sodium_Compat::crypto_sign_seed_keypair($seed); } } if (!is_callable('\\Sodium\\crypto_sign_verify_detached')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign_verify_detached() * @param string $signature * @param string $message * @param string $pk * @return bool * @throws \SodiumException * @throws \TypeError */ function crypto_sign_verify_detached($signature, $message, $pk) { return ParagonIE_Sodium_Compat::crypto_sign_verify_detached($signature, $message, $pk); } } if (!is_callable('\\Sodium\\crypto_sign_ed25519_pk_to_curve25519')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign_ed25519_pk_to_curve25519() * @param string $pk * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_sign_ed25519_pk_to_curve25519($pk) { return ParagonIE_Sodium_Compat::crypto_sign_ed25519_pk_to_curve25519($pk); } } if (!is_callable('\\Sodium\\crypto_sign_ed25519_sk_to_curve25519')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign_ed25519_sk_to_curve25519() * @param string $sk * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_sign_ed25519_sk_to_curve25519($sk) { return ParagonIE_Sodium_Compat::crypto_sign_ed25519_sk_to_curve25519($sk); } } if (!is_callable('\\Sodium\\crypto_stream')) { /** * @see ParagonIE_Sodium_Compat::crypto_stream() * @param int $len * @param string $nonce * @param string $key * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_stream($len, $nonce, $key) { return ParagonIE_Sodium_Compat::crypto_stream($len, $nonce, $key); } } if (!is_callable('\\Sodium\\crypto_stream_xor')) { /** * @see ParagonIE_Sodium_Compat::crypto_stream_xor() * @param string $message * @param string $nonce * @param string $key * @return string * @throws \SodiumException * @throws \TypeError */ function crypto_stream_xor($message, $nonce, $key) { return ParagonIE_Sodium_Compat::crypto_stream_xor($message, $nonce, $key); } } if (!is_callable('\\Sodium\\hex2bin')) { /** * @see ParagonIE_Sodium_Compat::hex2bin() * @param string $string * @return string * @throws \SodiumException * @throws \TypeError */ function hex2bin($string) { return ParagonIE_Sodium_Compat::hex2bin($string); } } if (!is_callable('\\Sodium\\memcmp')) { /** * @see ParagonIE_Sodium_Compat::memcmp() * @param string $a * @param string $b * @return int * @throws \SodiumException * @throws \TypeError */ function memcmp($a, $b) { return ParagonIE_Sodium_Compat::memcmp($a, $b); } } if (!is_callable('\\Sodium\\memzero')) { /** * @see ParagonIE_Sodium_Compat::memzero() * @param string $str * @return void * @throws \SodiumException * @throws \TypeError */ function memzero(&$str) { ParagonIE_Sodium_Compat::memzero($str); } } if (!is_callable('\\Sodium\\randombytes_buf')) { /** * @see ParagonIE_Sodium_Compat::randombytes_buf() * @param int $amount * @return string * @throws \TypeError */ function randombytes_buf($amount) { return ParagonIE_Sodium_Compat::randombytes_buf($amount); } } if (!is_callable('\\Sodium\\randombytes_uniform')) { /** * @see ParagonIE_Sodium_Compat::randombytes_uniform() * @param int $upperLimit * @return int * @throws \SodiumException * @throws \Error */ function randombytes_uniform($upperLimit) { return ParagonIE_Sodium_Compat::randombytes_uniform($upperLimit); } } if (!is_callable('\\Sodium\\randombytes_random16')) { /** * @see ParagonIE_Sodium_Compat::randombytes_random16() * @return int */ function randombytes_random16() { return ParagonIE_Sodium_Compat::randombytes_random16(); } } if (!defined('\\Sodium\\CRYPTO_AUTH_BYTES')) { require_once dirname(__FILE__) . '/constants.php'; } pusher/vendor/paragonie/sodium_compat/LICENSE 0000644 00000001626 15117231254 0015172 0 ustar 00 /* * ISC License * * Copyright (c) 2016-2019 * Paragon Initiative Enterprises <security at paragonie dot com> * * Copyright (c) 2013-2019 * Frank Denis <j at pureftpd dot org> * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ pusher/vendor/paragonie/sodium_compat/namespaced/Compat.php 0000644 00000000126 15117231254 0020213 0 ustar 00 <?php namespace ParagonIE\Sodium; class Compat extends \ParagonIE_Sodium_Compat { } pusher/vendor/paragonie/sodium_compat/namespaced/Core/BLAKE2b.php 0000644 00000000142 15117231254 0020720 0 ustar 00 <?php namespace ParagonIE\Sodium\Core; class BLAKE2b extends \ParagonIE_Sodium_Core_BLAKE2b { } pusher/vendor/paragonie/sodium_compat/namespaced/Core/ChaCha20/Ctx.php 0000644 00000000154 15117231254 0021670 0 ustar 00 <?php namespace ParagonIE\Sodium\Core\ChaCha20; class Ctx extends \ParagonIE_Sodium_Core_ChaCha20_Ctx { } pusher/vendor/paragonie/sodium_compat/namespaced/Core/ChaCha20/IetfCtx.php 0000644 00000000164 15117231254 0022501 0 ustar 00 <?php namespace ParagonIE\Sodium\Core\ChaCha20; class IetfCtx extends \ParagonIE_Sodium_Core_ChaCha20_IetfCtx { } pusher/vendor/paragonie/sodium_compat/namespaced/Core/ChaCha20.php 0000644 00000000144 15117231254 0021131 0 ustar 00 <?php namespace ParagonIE\Sodium\Core; class ChaCha20 extends \ParagonIE_Sodium_Core_ChaCha20 { } pusher/vendor/paragonie/sodium_compat/namespaced/Core/Curve25519/Fe.php 0000644 00000000156 15117231254 0021707 0 ustar 00 <?php namespace ParagonIE\Sodium\Core\Curve25519; class Fe extends \ParagonIE_Sodium_Core_Curve25519_Fe { } pusher/vendor/paragonie/sodium_compat/namespaced/Core/Curve25519/Ge/Cached.php 0000644 00000000174 15117231254 0023057 0 ustar 00 <?php namespace ParagonIE\Sodium\Core\Curve25519\Ge; class Cached extends \ParagonIE_Sodium_Core_Curve25519_Ge_Cached { } pusher/vendor/paragonie/sodium_compat/namespaced/Core/Curve25519/Ge/P1p1.php 0000644 00000000170 15117231254 0022425 0 ustar 00 <?php namespace ParagonIE\Sodium\Core\Curve25519\Ge; class P1p1 extends \ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 { } pusher/vendor/paragonie/sodium_compat/namespaced/Core/Curve25519/Ge/P2.php 0000644 00000000164 15117231254 0022170 0 ustar 00 <?php namespace ParagonIE\Sodium\Core\Curve25519\Ge; class P2 extends \ParagonIE_Sodium_Core_Curve25519_Ge_P2 { } pusher/vendor/paragonie/sodium_compat/namespaced/Core/Curve25519/Ge/P3.php 0000644 00000000164 15117231254 0022171 0 ustar 00 <?php namespace ParagonIE\Sodium\Core\Curve25519\Ge; class P3 extends \ParagonIE_Sodium_Core_Curve25519_Ge_P3 { } pusher/vendor/paragonie/sodium_compat/namespaced/Core/Curve25519/Ge/Precomp.php 0000644 00000000176 15117231254 0023317 0 ustar 00 <?php namespace ParagonIE\Sodium\Core\Curve25519\Ge; class Precomp extends \ParagonIE_Sodium_Core_Curve25519_Ge_Precomp { } pusher/vendor/paragonie/sodium_compat/namespaced/Core/Curve25519/H.php 0000644 00000000154 15117231254 0021542 0 ustar 00 <?php namespace ParagonIE\Sodium\Core\Curve25519; class H extends \ParagonIE_Sodium_Core_Curve25519_H { } pusher/vendor/paragonie/sodium_compat/namespaced/Core/Curve25519.php 0000644 00000000150 15117231254 0021347 0 ustar 00 <?php namespace ParagonIE\Sodium\Core; class Curve25519 extends \ParagonIE_Sodium_Core_Curve25519 { } pusher/vendor/paragonie/sodium_compat/namespaced/Core/Ed25519.php 0000644 00000000142 15117231254 0020614 0 ustar 00 <?php namespace ParagonIE\Sodium\Core; class Ed25519 extends \ParagonIE_Sodium_Core_Ed25519 { } pusher/vendor/paragonie/sodium_compat/namespaced/Core/HChaCha20.php 0000644 00000000146 15117231254 0021243 0 ustar 00 <?php namespace ParagonIE\Sodium\Core; class HChaCha20 extends \ParagonIE_Sodium_Core_HChaCha20 { } pusher/vendor/paragonie/sodium_compat/namespaced/Core/HSalsa20.php 0000644 00000000144 15117231254 0021175 0 ustar 00 <?php namespace ParagonIE\Sodium\Core; class HSalsa20 extends \ParagonIE_Sodium_Core_HSalsa20 { } pusher/vendor/paragonie/sodium_compat/namespaced/Core/Poly1305/State.php 0000644 00000000160 15117231254 0022172 0 ustar 00 <?php namespace ParagonIE\Sodium\Core\Poly1305; class State extends \ParagonIE_Sodium_Core_Poly1305_State { } pusher/vendor/paragonie/sodium_compat/namespaced/Core/Poly1305.php 0000644 00000000144 15117231254 0021114 0 ustar 00 <?php namespace ParagonIE\Sodium\Core; class Poly1305 extends \ParagonIE_Sodium_Core_Poly1305 { } pusher/vendor/paragonie/sodium_compat/namespaced/Core/Salsa20.php 0000644 00000000142 15117231254 0021063 0 ustar 00 <?php namespace ParagonIE\Sodium\Core; class Salsa20 extends \ParagonIE_Sodium_Core_Salsa20 { } pusher/vendor/paragonie/sodium_compat/namespaced/Core/SipHash.php 0000644 00000000142 15117231254 0021215 0 ustar 00 <?php namespace ParagonIE\Sodium\Core; class SipHash extends \ParagonIE_Sodium_Core_SipHash { } pusher/vendor/paragonie/sodium_compat/namespaced/Core/Util.php 0000644 00000000134 15117231254 0020574 0 ustar 00 <?php namespace ParagonIE\Sodium\Core; class Util extends \ParagonIE_Sodium_Core_Util { } pusher/vendor/paragonie/sodium_compat/namespaced/Core/X25519.php 0000644 00000000140 15117231254 0020471 0 ustar 00 <?php namespace ParagonIE\Sodium\Core; class X25519 extends \ParagonIE_Sodium_Core_X25519 { } pusher/vendor/paragonie/sodium_compat/namespaced/Core/XChaCha20.php 0000644 00000000146 15117231254 0021263 0 ustar 00 <?php namespace ParagonIE\Sodium\Core; class XChaCha20 extends \ParagonIE_Sodium_Core_XChaCha20 { } pusher/vendor/paragonie/sodium_compat/namespaced/Core/Xsalsa20.php 0000644 00000000144 15117231254 0021255 0 ustar 00 <?php namespace ParagonIE\Sodium\Core; class Xsalsa20 extends \ParagonIE_Sodium_Core_XSalsa20 { } pusher/vendor/paragonie/sodium_compat/namespaced/Crypto.php 0000644 00000000126 15117231254 0020250 0 ustar 00 <?php namespace ParagonIE\Sodium; class Crypto extends \ParagonIE_Sodium_Crypto { } pusher/vendor/paragonie/sodium_compat/namespaced/File.php 0000644 00000000122 15117231254 0017643 0 ustar 00 <?php namespace ParagonIE\Sodium; class File extends \ParagonIE_Sodium_File { } pusher/vendor/paragonie/sodium_compat/phpunit.xml.dist 0000644 00000001507 15117231254 0017336 0 ustar 00 <?xml version="1.0" encoding="UTF-8"?> <phpunit backupGlobals="true" backupStaticAttributes="false" bootstrap="autoload-phpunit.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnError="false" stopOnFailure="false" > <testsuites> <testsuite name="Unit Tests"> <directory suffix="Test.php">./tests/unit</directory> </testsuite> <testsuite name="Libsodium Compatibility Tests"> <directory suffix="Test.php">./tests/compat</directory> </testsuite> </testsuites> <filter> <whitelist processUncoveredFilesFromWhitelist="true"> <directory suffix=".php">./src</directory> </whitelist> </filter> </phpunit>