Hash HMAC algo

This commit is contained in:
Marcin Łojewski
2020-04-13 14:10:27 +02:00
parent 7e9af00145
commit d7735280a0
18 changed files with 330 additions and 48 deletions

View File

@@ -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)
];
}