You are here

public static function ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256 in Automatic Updates 8

Same name and namespace in other branches
  1. 7 vendor/paragonie/sodium_compat/src/Compat.php \ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256()

Parameters

int $outlen:

string $passwd:

string $salt:

int $opslimit:

int $memlimit:

Return value

string

Throws

SodiumException

TypeError

2 calls to ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256()
php72compat.php in vendor/paragonie/sodium_compat/lib/php72compat.php
sodium_compat.php in vendor/paragonie/sodium_compat/lib/sodium_compat.php

File

vendor/paragonie/sodium_compat/src/Compat.php, line 2043

Class

ParagonIE_Sodium_Compat

Code

public static function crypto_pwhash_scryptsalsa208sha256($outlen, $passwd, $salt, $opslimit, $memlimit) {
  ParagonIE_Sodium_Core_Util::declareScalarType($outlen, 'int', 1);
  ParagonIE_Sodium_Core_Util::declareScalarType($passwd, 'string', 2);
  ParagonIE_Sodium_Core_Util::declareScalarType($salt, 'string', 3);
  ParagonIE_Sodium_Core_Util::declareScalarType($opslimit, 'int', 4);
  ParagonIE_Sodium_Core_Util::declareScalarType($memlimit, 'int', 5);
  if (self::useNewSodiumAPI()) {
    return (string) sodium_crypto_pwhash_scryptsalsa208sha256((int) $outlen, (string) $passwd, (string) $salt, (int) $opslimit, (int) $memlimit);
  }
  if (self::use_fallback('crypto_pwhash_scryptsalsa208sha256')) {
    return (string) call_user_func('\\Sodium\\crypto_pwhash_scryptsalsa208sha256', (int) $outlen, (string) $passwd, (string) $salt, (int) $opslimit, (int) $memlimit);
  }

  // This is the best we can do.
  throw new SodiumException('This is not implemented, as it is not possible to implement Scrypt with acceptable performance in pure-PHP');
}