Edit File by line
/home/barbar84/www/wp-inclu.../sodium_c.../lib
File: sodium_compat.php
<?php
[0] Fix | Delete
namespace Sodium;
[1] Fix | Delete
[2] Fix | Delete
require_once dirname(dirname(__FILE__)) . '/autoload.php';
[3] Fix | Delete
[4] Fix | Delete
use ParagonIE_Sodium_Compat;
[5] Fix | Delete
[6] Fix | Delete
/**
[7] Fix | Delete
* This file will monkey patch the pure-PHP implementation in place of the
[8] Fix | Delete
* PECL functions, but only if they do not already exist.
[9] Fix | Delete
*
[10] Fix | Delete
* Thus, the functions just proxy to the appropriate ParagonIE_Sodium_Compat
[11] Fix | Delete
* method.
[12] Fix | Delete
*/
[13] Fix | Delete
if (!is_callable('\\Sodium\\bin2hex')) {
[14] Fix | Delete
/**
[15] Fix | Delete
* @see ParagonIE_Sodium_Compat::bin2hex()
[16] Fix | Delete
* @param string $string
[17] Fix | Delete
* @return string
[18] Fix | Delete
* @throws \SodiumException
[19] Fix | Delete
* @throws \TypeError
[20] Fix | Delete
*/
[21] Fix | Delete
function bin2hex($string)
[22] Fix | Delete
{
[23] Fix | Delete
return ParagonIE_Sodium_Compat::bin2hex($string);
[24] Fix | Delete
}
[25] Fix | Delete
}
[26] Fix | Delete
if (!is_callable('\\Sodium\\compare')) {
[27] Fix | Delete
/**
[28] Fix | Delete
* @see ParagonIE_Sodium_Compat::compare()
[29] Fix | Delete
* @param string $a
[30] Fix | Delete
* @param string $b
[31] Fix | Delete
* @return int
[32] Fix | Delete
* @throws \SodiumException
[33] Fix | Delete
* @throws \TypeError
[34] Fix | Delete
*/
[35] Fix | Delete
function compare($a, $b)
[36] Fix | Delete
{
[37] Fix | Delete
return ParagonIE_Sodium_Compat::compare($a, $b);
[38] Fix | Delete
}
[39] Fix | Delete
}
[40] Fix | Delete
if (!is_callable('\\Sodium\\crypto_aead_aes256gcm_decrypt')) {
[41] Fix | Delete
/**
[42] Fix | Delete
* @see ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_decrypt()
[43] Fix | Delete
* @param string $message
[44] Fix | Delete
* @param string $assocData
[45] Fix | Delete
* @param string $nonce
[46] Fix | Delete
* @param string $key
[47] Fix | Delete
* @return string|bool
[48] Fix | Delete
*/
[49] Fix | Delete
function crypto_aead_aes256gcm_decrypt($message, $assocData, $nonce, $key)
[50] Fix | Delete
{
[51] Fix | Delete
try {
[52] Fix | Delete
return ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_decrypt($message, $assocData, $nonce, $key);
[53] Fix | Delete
} catch (\TypeError $ex) {
[54] Fix | Delete
return false;
[55] Fix | Delete
} catch (\SodiumException $ex) {
[56] Fix | Delete
return false;
[57] Fix | Delete
}
[58] Fix | Delete
}
[59] Fix | Delete
}
[60] Fix | Delete
if (!is_callable('\\Sodium\\crypto_aead_aes256gcm_encrypt')) {
[61] Fix | Delete
/**
[62] Fix | Delete
* @see ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_encrypt()
[63] Fix | Delete
* @param string $message
[64] Fix | Delete
* @param string $assocData
[65] Fix | Delete
* @param string $nonce
[66] Fix | Delete
* @param string $key
[67] Fix | Delete
* @return string
[68] Fix | Delete
* @throws \SodiumException
[69] Fix | Delete
* @throws \TypeError
[70] Fix | Delete
*/
[71] Fix | Delete
function crypto_aead_aes256gcm_encrypt($message, $assocData, $nonce, $key)
[72] Fix | Delete
{
[73] Fix | Delete
return ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_encrypt($message, $assocData, $nonce, $key);
[74] Fix | Delete
}
[75] Fix | Delete
}
[76] Fix | Delete
if (!is_callable('\\Sodium\\crypto_aead_aes256gcm_is_available')) {
[77] Fix | Delete
/**
[78] Fix | Delete
* @see ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_is_available()
[79] Fix | Delete
* @return bool
[80] Fix | Delete
*/
[81] Fix | Delete
function crypto_aead_aes256gcm_is_available()
[82] Fix | Delete
{
[83] Fix | Delete
return ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_is_available();
[84] Fix | Delete
}
[85] Fix | Delete
}
[86] Fix | Delete
if (!is_callable('\\Sodium\\crypto_aead_chacha20poly1305_decrypt')) {
[87] Fix | Delete
/**
[88] Fix | Delete
* @see ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_decrypt()
[89] Fix | Delete
* @param string $message
[90] Fix | Delete
* @param string $assocData
[91] Fix | Delete
* @param string $nonce
[92] Fix | Delete
* @param string $key
[93] Fix | Delete
* @return string|bool
[94] Fix | Delete
*/
[95] Fix | Delete
function crypto_aead_chacha20poly1305_decrypt($message, $assocData, $nonce, $key)
[96] Fix | Delete
{
[97] Fix | Delete
try {
[98] Fix | Delete
return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_decrypt($message, $assocData, $nonce, $key);
[99] Fix | Delete
} catch (\TypeError $ex) {
[100] Fix | Delete
return false;
[101] Fix | Delete
} catch (\SodiumException $ex) {
[102] Fix | Delete
return false;
[103] Fix | Delete
}
[104] Fix | Delete
}
[105] Fix | Delete
}
[106] Fix | Delete
if (!is_callable('\\Sodium\\crypto_aead_chacha20poly1305_encrypt')) {
[107] Fix | Delete
/**
[108] Fix | Delete
* @see ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_encrypt()
[109] Fix | Delete
* @param string $message
[110] Fix | Delete
* @param string $assocData
[111] Fix | Delete
* @param string $nonce
[112] Fix | Delete
* @param string $key
[113] Fix | Delete
* @return string
[114] Fix | Delete
* @throws \SodiumException
[115] Fix | Delete
* @throws \TypeError
[116] Fix | Delete
*/
[117] Fix | Delete
function crypto_aead_chacha20poly1305_encrypt($message, $assocData, $nonce, $key)
[118] Fix | Delete
{
[119] Fix | Delete
return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_encrypt($message, $assocData, $nonce, $key);
[120] Fix | Delete
}
[121] Fix | Delete
}
[122] Fix | Delete
if (!is_callable('\\Sodium\\crypto_aead_chacha20poly1305_ietf_decrypt')) {
[123] Fix | Delete
/**
[124] Fix | Delete
* @see ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_decrypt()
[125] Fix | Delete
* @param string $message
[126] Fix | Delete
* @param string $assocData
[127] Fix | Delete
* @param string $nonce
[128] Fix | Delete
* @param string $key
[129] Fix | Delete
* @return string|bool
[130] Fix | Delete
*/
[131] Fix | Delete
function crypto_aead_chacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key)
[132] Fix | Delete
{
[133] Fix | Delete
try {
[134] Fix | Delete
return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key);
[135] Fix | Delete
} catch (\TypeError $ex) {
[136] Fix | Delete
return false;
[137] Fix | Delete
} catch (\SodiumException $ex) {
[138] Fix | Delete
return false;
[139] Fix | Delete
}
[140] Fix | Delete
}
[141] Fix | Delete
}
[142] Fix | Delete
if (!is_callable('\\Sodium\\crypto_aead_chacha20poly1305_ietf_encrypt')) {
[143] Fix | Delete
/**
[144] Fix | Delete
* @see ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_encrypt()
[145] Fix | Delete
* @param string $message
[146] Fix | Delete
* @param string $assocData
[147] Fix | Delete
* @param string $nonce
[148] Fix | Delete
* @param string $key
[149] Fix | Delete
* @return string
[150] Fix | Delete
* @throws \SodiumException
[151] Fix | Delete
* @throws \TypeError
[152] Fix | Delete
*/
[153] Fix | Delete
function crypto_aead_chacha20poly1305_ietf_encrypt($message, $assocData, $nonce, $key)
[154] Fix | Delete
{
[155] Fix | Delete
return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_encrypt($message, $assocData, $nonce, $key);
[156] Fix | Delete
}
[157] Fix | Delete
}
[158] Fix | Delete
if (!is_callable('\\Sodium\\crypto_auth')) {
[159] Fix | Delete
/**
[160] Fix | Delete
* @see ParagonIE_Sodium_Compat::crypto_auth()
[161] Fix | Delete
* @param string $message
[162] Fix | Delete
* @param string $key
[163] Fix | Delete
* @return string
[164] Fix | Delete
* @throws \SodiumException
[165] Fix | Delete
* @throws \TypeError
[166] Fix | Delete
*/
[167] Fix | Delete
function crypto_auth($message, $key)
[168] Fix | Delete
{
[169] Fix | Delete
return ParagonIE_Sodium_Compat::crypto_auth($message, $key);
[170] Fix | Delete
}
[171] Fix | Delete
}
[172] Fix | Delete
if (!is_callable('\\Sodium\\crypto_auth_verify')) {
[173] Fix | Delete
/**
[174] Fix | Delete
* @see ParagonIE_Sodium_Compat::crypto_auth_verify()
[175] Fix | Delete
* @param string $mac
[176] Fix | Delete
* @param string $message
[177] Fix | Delete
* @param string $key
[178] Fix | Delete
* @return bool
[179] Fix | Delete
* @throws \SodiumException
[180] Fix | Delete
* @throws \TypeError
[181] Fix | Delete
*/
[182] Fix | Delete
function crypto_auth_verify($mac, $message, $key)
[183] Fix | Delete
{
[184] Fix | Delete
return ParagonIE_Sodium_Compat::crypto_auth_verify($mac, $message, $key);
[185] Fix | Delete
}
[186] Fix | Delete
}
[187] Fix | Delete
if (!is_callable('\\Sodium\\crypto_box')) {
[188] Fix | Delete
/**
[189] Fix | Delete
* @see ParagonIE_Sodium_Compat::crypto_box()
[190] Fix | Delete
* @param string $message
[191] Fix | Delete
* @param string $nonce
[192] Fix | Delete
* @param string $kp
[193] Fix | Delete
* @return string
[194] Fix | Delete
* @throws \SodiumException
[195] Fix | Delete
* @throws \TypeError
[196] Fix | Delete
*/
[197] Fix | Delete
function crypto_box($message, $nonce, $kp)
[198] Fix | Delete
{
[199] Fix | Delete
return ParagonIE_Sodium_Compat::crypto_box($message, $nonce, $kp);
[200] Fix | Delete
}
[201] Fix | Delete
}
[202] Fix | Delete
if (!is_callable('\\Sodium\\crypto_box_keypair')) {
[203] Fix | Delete
/**
[204] Fix | Delete
* @see ParagonIE_Sodium_Compat::crypto_box_keypair()
[205] Fix | Delete
* @return string
[206] Fix | Delete
* @throws \SodiumException
[207] Fix | Delete
* @throws \TypeError
[208] Fix | Delete
*/
[209] Fix | Delete
function crypto_box_keypair()
[210] Fix | Delete
{
[211] Fix | Delete
return ParagonIE_Sodium_Compat::crypto_box_keypair();
[212] Fix | Delete
}
[213] Fix | Delete
}
[214] Fix | Delete
if (!is_callable('\\Sodium\\crypto_box_keypair_from_secretkey_and_publickey')) {
[215] Fix | Delete
/**
[216] Fix | Delete
* @see ParagonIE_Sodium_Compat::crypto_box_keypair_from_secretkey_and_publickey()
[217] Fix | Delete
* @param string $sk
[218] Fix | Delete
* @param string $pk
[219] Fix | Delete
* @return string
[220] Fix | Delete
* @throws \SodiumException
[221] Fix | Delete
* @throws \TypeError
[222] Fix | Delete
*/
[223] Fix | Delete
function crypto_box_keypair_from_secretkey_and_publickey($sk, $pk)
[224] Fix | Delete
{
[225] Fix | Delete
return ParagonIE_Sodium_Compat::crypto_box_keypair_from_secretkey_and_publickey($sk, $pk);
[226] Fix | Delete
}
[227] Fix | Delete
}
[228] Fix | Delete
if (!is_callable('\\Sodium\\crypto_box_open')) {
[229] Fix | Delete
/**
[230] Fix | Delete
* @see ParagonIE_Sodium_Compat::crypto_box_open()
[231] Fix | Delete
* @param string $message
[232] Fix | Delete
* @param string $nonce
[233] Fix | Delete
* @param string $kp
[234] Fix | Delete
* @return string|bool
[235] Fix | Delete
*/
[236] Fix | Delete
function crypto_box_open($message, $nonce, $kp)
[237] Fix | Delete
{
[238] Fix | Delete
try {
[239] Fix | Delete
return ParagonIE_Sodium_Compat::crypto_box_open($message, $nonce, $kp);
[240] Fix | Delete
} catch (\TypeError $ex) {
[241] Fix | Delete
return false;
[242] Fix | Delete
} catch (\SodiumException $ex) {
[243] Fix | Delete
return false;
[244] Fix | Delete
}
[245] Fix | Delete
}
[246] Fix | Delete
}
[247] Fix | Delete
if (!is_callable('\\Sodium\\crypto_box_publickey')) {
[248] Fix | Delete
/**
[249] Fix | Delete
* @see ParagonIE_Sodium_Compat::crypto_box_publickey()
[250] Fix | Delete
* @param string $keypair
[251] Fix | Delete
* @return string
[252] Fix | Delete
* @throws \SodiumException
[253] Fix | Delete
* @throws \TypeError
[254] Fix | Delete
*/
[255] Fix | Delete
function crypto_box_publickey($keypair)
[256] Fix | Delete
{
[257] Fix | Delete
return ParagonIE_Sodium_Compat::crypto_box_publickey($keypair);
[258] Fix | Delete
}
[259] Fix | Delete
}
[260] Fix | Delete
if (!is_callable('\\Sodium\\crypto_box_publickey_from_secretkey')) {
[261] Fix | Delete
/**
[262] Fix | Delete
* @see ParagonIE_Sodium_Compat::crypto_box_publickey_from_secretkey()
[263] Fix | Delete
* @param string $sk
[264] Fix | Delete
* @return string
[265] Fix | Delete
* @throws \SodiumException
[266] Fix | Delete
* @throws \TypeError
[267] Fix | Delete
*/
[268] Fix | Delete
function crypto_box_publickey_from_secretkey($sk)
[269] Fix | Delete
{
[270] Fix | Delete
return ParagonIE_Sodium_Compat::crypto_box_publickey_from_secretkey($sk);
[271] Fix | Delete
}
[272] Fix | Delete
}
[273] Fix | Delete
if (!is_callable('\\Sodium\\crypto_box_seal')) {
[274] Fix | Delete
/**
[275] Fix | Delete
* @see ParagonIE_Sodium_Compat::crypto_box_seal_open()
[276] Fix | Delete
* @param string $message
[277] Fix | Delete
* @param string $publicKey
[278] Fix | Delete
* @return string
[279] Fix | Delete
* @throws \SodiumException
[280] Fix | Delete
* @throws \TypeError
[281] Fix | Delete
*/
[282] Fix | Delete
function crypto_box_seal($message, $publicKey)
[283] Fix | Delete
{
[284] Fix | Delete
return ParagonIE_Sodium_Compat::crypto_box_seal($message, $publicKey);
[285] Fix | Delete
}
[286] Fix | Delete
}
[287] Fix | Delete
if (!is_callable('\\Sodium\\crypto_box_seal_open')) {
[288] Fix | Delete
/**
[289] Fix | Delete
* @see ParagonIE_Sodium_Compat::crypto_box_seal_open()
[290] Fix | Delete
* @param string $message
[291] Fix | Delete
* @param string $kp
[292] Fix | Delete
* @return string|bool
[293] Fix | Delete
*/
[294] Fix | Delete
function crypto_box_seal_open($message, $kp)
[295] Fix | Delete
{
[296] Fix | Delete
try {
[297] Fix | Delete
return ParagonIE_Sodium_Compat::crypto_box_seal_open($message, $kp);
[298] Fix | Delete
} catch (\TypeError $ex) {
[299] Fix | Delete
return false;
[300] Fix | Delete
} catch (\SodiumException $ex) {
[301] Fix | Delete
return false;
[302] Fix | Delete
}
[303] Fix | Delete
}
[304] Fix | Delete
}
[305] Fix | Delete
if (!is_callable('\\Sodium\\crypto_box_secretkey')) {
[306] Fix | Delete
/**
[307] Fix | Delete
* @see ParagonIE_Sodium_Compat::crypto_box_secretkey()
[308] Fix | Delete
* @param string $keypair
[309] Fix | Delete
* @return string
[310] Fix | Delete
* @throws \SodiumException
[311] Fix | Delete
* @throws \TypeError
[312] Fix | Delete
*/
[313] Fix | Delete
function crypto_box_secretkey($keypair)
[314] Fix | Delete
{
[315] Fix | Delete
return ParagonIE_Sodium_Compat::crypto_box_secretkey($keypair);
[316] Fix | Delete
}
[317] Fix | Delete
}
[318] Fix | Delete
if (!is_callable('\\Sodium\\crypto_generichash')) {
[319] Fix | Delete
/**
[320] Fix | Delete
* @see ParagonIE_Sodium_Compat::crypto_generichash()
[321] Fix | Delete
* @param string $message
[322] Fix | Delete
* @param string|null $key
[323] Fix | Delete
* @param int $outLen
[324] Fix | Delete
* @return string
[325] Fix | Delete
* @throws \SodiumException
[326] Fix | Delete
* @throws \TypeError
[327] Fix | Delete
*/
[328] Fix | Delete
function crypto_generichash($message, $key = null, $outLen = 32)
[329] Fix | Delete
{
[330] Fix | Delete
return ParagonIE_Sodium_Compat::crypto_generichash($message, $key, $outLen);
[331] Fix | Delete
}
[332] Fix | Delete
}
[333] Fix | Delete
if (!is_callable('\\Sodium\\crypto_generichash_final')) {
[334] Fix | Delete
/**
[335] Fix | Delete
* @see ParagonIE_Sodium_Compat::crypto_generichash_final()
[336] Fix | Delete
* @param string|null $ctx
[337] Fix | Delete
* @param int $outputLength
[338] Fix | Delete
* @return string
[339] Fix | Delete
* @throws \SodiumException
[340] Fix | Delete
* @throws \TypeError
[341] Fix | Delete
*/
[342] Fix | Delete
function crypto_generichash_final(&$ctx, $outputLength = 32)
[343] Fix | Delete
{
[344] Fix | Delete
return ParagonIE_Sodium_Compat::crypto_generichash_final($ctx, $outputLength);
[345] Fix | Delete
}
[346] Fix | Delete
}
[347] Fix | Delete
if (!is_callable('\\Sodium\\crypto_generichash_init')) {
[348] Fix | Delete
/**
[349] Fix | Delete
* @see ParagonIE_Sodium_Compat::crypto_generichash_init()
[350] Fix | Delete
* @param string|null $key
[351] Fix | Delete
* @param int $outLen
[352] Fix | Delete
* @return string
[353] Fix | Delete
* @throws \SodiumException
[354] Fix | Delete
* @throws \TypeError
[355] Fix | Delete
*/
[356] Fix | Delete
function crypto_generichash_init($key = null, $outLen = 32)
[357] Fix | Delete
{
[358] Fix | Delete
return ParagonIE_Sodium_Compat::crypto_generichash_init($key, $outLen);
[359] Fix | Delete
}
[360] Fix | Delete
}
[361] Fix | Delete
if (!is_callable('\\Sodium\\crypto_generichash_update')) {
[362] Fix | Delete
/**
[363] Fix | Delete
* @see ParagonIE_Sodium_Compat::crypto_generichash_update()
[364] Fix | Delete
* @param string|null $ctx
[365] Fix | Delete
* @param string $message
[366] Fix | Delete
* @return void
[367] Fix | Delete
* @throws \SodiumException
[368] Fix | Delete
* @throws \TypeError
[369] Fix | Delete
*/
[370] Fix | Delete
function crypto_generichash_update(&$ctx, $message = '')
[371] Fix | Delete
{
[372] Fix | Delete
ParagonIE_Sodium_Compat::crypto_generichash_update($ctx, $message);
[373] Fix | Delete
}
[374] Fix | Delete
}
[375] Fix | Delete
if (!is_callable('\\Sodium\\crypto_kx')) {
[376] Fix | Delete
/**
[377] Fix | Delete
* @see ParagonIE_Sodium_Compat::crypto_kx()
[378] Fix | Delete
* @param string $my_secret
[379] Fix | Delete
* @param string $their_public
[380] Fix | Delete
* @param string $client_public
[381] Fix | Delete
* @param string $server_public
[382] Fix | Delete
* @return string
[383] Fix | Delete
* @throws \SodiumException
[384] Fix | Delete
* @throws \TypeError
[385] Fix | Delete
*/
[386] Fix | Delete
function crypto_kx($my_secret, $their_public, $client_public, $server_public)
[387] Fix | Delete
{
[388] Fix | Delete
return ParagonIE_Sodium_Compat::crypto_kx(
[389] Fix | Delete
$my_secret,
[390] Fix | Delete
$their_public,
[391] Fix | Delete
$client_public,
[392] Fix | Delete
$server_public,
[393] Fix | Delete
true
[394] Fix | Delete
);
[395] Fix | Delete
}
[396] Fix | Delete
}
[397] Fix | Delete
if (!is_callable('\\Sodium\\crypto_pwhash')) {
[398] Fix | Delete
/**
[399] Fix | Delete
* @see ParagonIE_Sodium_Compat::crypto_pwhash()
[400] Fix | Delete
* @param int $outlen
[401] Fix | Delete
* @param string $passwd
[402] Fix | Delete
* @param string $salt
[403] Fix | Delete
* @param int $opslimit
[404] Fix | Delete
* @param int $memlimit
[405] Fix | Delete
* @return string
[406] Fix | Delete
* @throws \SodiumException
[407] Fix | Delete
* @throws \TypeError
[408] Fix | Delete
*/
[409] Fix | Delete
function crypto_pwhash($outlen, $passwd, $salt, $opslimit, $memlimit)
[410] Fix | Delete
{
[411] Fix | Delete
return ParagonIE_Sodium_Compat::crypto_pwhash($outlen, $passwd, $salt, $opslimit, $memlimit);
[412] Fix | Delete
}
[413] Fix | Delete
}
[414] Fix | Delete
if (!is_callable('\\Sodium\\crypto_pwhash_str')) {
[415] Fix | Delete
/**
[416] Fix | Delete
* @see ParagonIE_Sodium_Compat::crypto_pwhash_str()
[417] Fix | Delete
* @param string $passwd
[418] Fix | Delete
* @param int $opslimit
[419] Fix | Delete
* @param int $memlimit
[420] Fix | Delete
* @return string
[421] Fix | Delete
* @throws \SodiumException
[422] Fix | Delete
* @throws \TypeError
[423] Fix | Delete
*/
[424] Fix | Delete
function crypto_pwhash_str($passwd, $opslimit, $memlimit)
[425] Fix | Delete
{
[426] Fix | Delete
return ParagonIE_Sodium_Compat::crypto_pwhash_str($passwd, $opslimit, $memlimit);
[427] Fix | Delete
}
[428] Fix | Delete
}
[429] Fix | Delete
if (!is_callable('\\Sodium\\crypto_pwhash_str_verify')) {
[430] Fix | Delete
/**
[431] Fix | Delete
* @see ParagonIE_Sodium_Compat::crypto_pwhash_str_verify()
[432] Fix | Delete
* @param string $passwd
[433] Fix | Delete
* @param string $hash
[434] Fix | Delete
* @return bool
[435] Fix | Delete
* @throws \SodiumException
[436] Fix | Delete
* @throws \TypeError
[437] Fix | Delete
*/
[438] Fix | Delete
function crypto_pwhash_str_verify($passwd, $hash)
[439] Fix | Delete
{
[440] Fix | Delete
return ParagonIE_Sodium_Compat::crypto_pwhash_str_verify($passwd, $hash);
[441] Fix | Delete
}
[442] Fix | Delete
}
[443] Fix | Delete
if (!is_callable('\\Sodium\\crypto_pwhash_scryptsalsa208sha256')) {
[444] Fix | Delete
/**
[445] Fix | Delete
* @see ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256()
[446] Fix | Delete
* @param int $outlen
[447] Fix | Delete
* @param string $passwd
[448] Fix | Delete
* @param string $salt
[449] Fix | Delete
* @param int $opslimit
[450] Fix | Delete
* @param int $memlimit
[451] Fix | Delete
* @return string
[452] Fix | Delete
* @throws \SodiumException
[453] Fix | Delete
* @throws \TypeError
[454] Fix | Delete
*/
[455] Fix | Delete
function crypto_pwhash_scryptsalsa208sha256($outlen, $passwd, $salt, $opslimit, $memlimit)
[456] Fix | Delete
{
[457] Fix | Delete
return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256($outlen, $passwd, $salt, $opslimit, $memlimit);
[458] Fix | Delete
}
[459] Fix | Delete
}
[460] Fix | Delete
if (!is_callable('\\Sodium\\crypto_pwhash_scryptsalsa208sha256_str')) {
[461] Fix | Delete
/**
[462] Fix | Delete
* @see ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str()
[463] Fix | Delete
* @param string $passwd
[464] Fix | Delete
* @param int $opslimit
[465] Fix | Delete
* @param int $memlimit
[466] Fix | Delete
* @return string
[467] Fix | Delete
* @throws \SodiumException
[468] Fix | Delete
* @throws \TypeError
[469] Fix | Delete
*/
[470] Fix | Delete
function crypto_pwhash_scryptsalsa208sha256_str($passwd, $opslimit, $memlimit)
[471] Fix | Delete
{
[472] Fix | Delete
return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str($passwd, $opslimit, $memlimit);
[473] Fix | Delete
}
[474] Fix | Delete
}
[475] Fix | Delete
if (!is_callable('\\Sodium\\crypto_pwhash_scryptsalsa208sha256_str_verify')) {
[476] Fix | Delete
/**
[477] Fix | Delete
* @see ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str_verify()
[478] Fix | Delete
* @param string $passwd
[479] Fix | Delete
* @param string $hash
[480] Fix | Delete
* @return bool
[481] Fix | Delete
* @throws \SodiumException
[482] Fix | Delete
* @throws \TypeError
[483] Fix | Delete
*/
[484] Fix | Delete
function crypto_pwhash_scryptsalsa208sha256_str_verify($passwd, $hash)
[485] Fix | Delete
{
[486] Fix | Delete
return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str_verify($passwd, $hash);
[487] Fix | Delete
}
[488] Fix | Delete
}
[489] Fix | Delete
if (!is_callable('\\Sodium\\crypto_scalarmult')) {
[490] Fix | Delete
/**
[491] Fix | Delete
* @see ParagonIE_Sodium_Compat::crypto_scalarmult()
[492] Fix | Delete
* @param string $n
[493] Fix | Delete
* @param string $p
[494] Fix | Delete
* @return string
[495] Fix | Delete
* @throws \SodiumException
[496] Fix | Delete
* @throws \TypeError
[497] Fix | Delete
*/
[498] Fix | Delete
function crypto_scalarmult($n, $p)
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function