2022-06-15 08:11:48 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Appwrite\Utopia\Response\Model;
|
|
|
|
|
|
|
|
|
|
use Appwrite\Utopia\Response;
|
|
|
|
|
use Appwrite\Utopia\Response\Model;
|
|
|
|
|
|
|
|
|
|
class AlgoScrypt extends Model
|
|
|
|
|
{
|
|
|
|
|
public function __construct()
|
|
|
|
|
{
|
|
|
|
|
$this
|
2022-10-10 23:27:03 +00:00
|
|
|
->addRule('type', [
|
|
|
|
|
'type' => self::TYPE_STRING,
|
|
|
|
|
'description' => 'Algo type.',
|
|
|
|
|
'default' => 'scrypt',
|
|
|
|
|
'example' => 'scrypt',
|
|
|
|
|
])
|
2022-06-16 09:21:35 +00:00
|
|
|
->addRule('costCpu', [
|
2022-06-15 08:11:48 +00:00
|
|
|
'type' => self::TYPE_INTEGER,
|
|
|
|
|
'description' => 'CPU complexity of computed hash.',
|
2022-09-29 03:54:01 +00:00
|
|
|
'default' => 8,
|
2022-06-15 08:11:48 +00:00
|
|
|
'example' => 8,
|
|
|
|
|
])
|
2022-06-16 09:21:35 +00:00
|
|
|
->addRule('costMemory', [
|
2022-06-15 08:11:48 +00:00
|
|
|
'type' => self::TYPE_INTEGER,
|
|
|
|
|
'description' => 'Memory complexity of computed hash.',
|
2022-09-29 03:54:01 +00:00
|
|
|
'default' => 14,
|
2022-06-15 08:11:48 +00:00
|
|
|
'example' => 14,
|
|
|
|
|
])
|
2022-06-16 09:21:35 +00:00
|
|
|
->addRule('costParallel', [
|
2022-06-15 08:11:48 +00:00
|
|
|
'type' => self::TYPE_INTEGER,
|
|
|
|
|
'description' => 'Parallelization of computed hash.',
|
2022-09-29 03:54:01 +00:00
|
|
|
'default' => 1,
|
2022-06-15 08:11:48 +00:00
|
|
|
'example' => 1,
|
|
|
|
|
])
|
|
|
|
|
->addRule('length', [
|
|
|
|
|
'type' => self::TYPE_INTEGER,
|
|
|
|
|
'description' => 'Length used to compute hash.',
|
2022-09-29 03:54:01 +00:00
|
|
|
'default' => 64,
|
|
|
|
|
'example' => 64,
|
2022-06-15 08:11:48 +00:00
|
|
|
])
|
|
|
|
|
;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get Name
|
|
|
|
|
*
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
|
|
|
|
public function getName(): string
|
|
|
|
|
{
|
2022-06-17 09:25:28 +00:00
|
|
|
return 'AlgoScrypt';
|
2022-06-15 08:11:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get Type
|
|
|
|
|
*
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
|
|
|
|
public function getType(): string
|
|
|
|
|
{
|
|
|
|
|
return Response::MODEL_ALGO_SCRYPT;
|
|
|
|
|
}
|
|
|
|
|
}
|