Hash HMAC algo
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
|
||||
namespace OCA\UserSQL\Crypto;
|
||||
|
||||
use OCA\UserSQL\Crypto\Param\IntParam;
|
||||
use OCP\IL10N;
|
||||
|
||||
/**
|
||||
@@ -92,7 +93,7 @@ class CryptArgon2id extends AbstractAlgorithm
|
||||
public function getPasswordHash($password, $salt = null)
|
||||
{
|
||||
return password_hash(
|
||||
$password, PASSWORD_ARGON2ID, [
|
||||
$password, PASSWORD_ARGON2ID, [
|
||||
"memory_cost" => $this->memoryCost,
|
||||
"time_cost" => $this->timeCost,
|
||||
"threads" => $this->threads
|
||||
@@ -106,14 +107,14 @@ class CryptArgon2id extends AbstractAlgorithm
|
||||
public function configuration()
|
||||
{
|
||||
return [
|
||||
new CryptoParam(
|
||||
new IntParam(
|
||||
"Memory cost (KiB)", PASSWORD_ARGON2_DEFAULT_MEMORY_COST, 1,
|
||||
1048576
|
||||
),
|
||||
new CryptoParam(
|
||||
new IntParam(
|
||||
"Time cost", PASSWORD_ARGON2_DEFAULT_TIME_COST, 1, 1024
|
||||
),
|
||||
new CryptoParam("Threads", PASSWORD_ARGON2_DEFAULT_THREADS, 1, 1024)
|
||||
new IntParam("Threads", PASSWORD_ARGON2_DEFAULT_THREADS, 1, 1024)
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user