Doc #76290 [Ver->Csd]: Wrong info in argon2i memory_cost
| From: | cmb@php.net | Date: | Mon, 30 Apr 2018 17:13:30 +0000 |
| Subject: | Doc #76290 [Ver->Csd]: Wrong info in argon2i memory_cost | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-15635@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76290&edit=1
ID: 76290
Updated by: cmb@php.net
Reported by: redir1 at npn dot fi
Summary: Wrong info in argon2i memory_cost
-Status: Verified
+Status: Closed
Type: Documentation Problem
Package: *Encryption and hash functions
Operating System: N/A
PHP Version: 7.2.5
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation better.
Previous Comments:
------------------------------------------------------------------------
[2018-04-30 17:12:28] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=344889
Log: Fix #76290: Wrong info in argon2i memory_cost
------------------------------------------------------------------------
[2018-04-30 15:48:54] redir1 at npn dot fi
Expected and actual results got mixed up, but the info remains the same.
------------------------------------------------------------------------
[2018-04-30 15:45:43] redir1 at npn dot fi
Description:
------------
---
From manual page: http://www.php.net/function.password-hash
---
The manual page says:
"memory_cost (integer) - Maximum memory (in bytes) that may be used to compute the Argon2 hash.
Defaults to PASSWORD_ARGON2_DEFAULT_MEMORY_COST."
The memory in reality is in kilobytes, not bytes. Confirmed by testing the memory usage, execution
speed and also by reading the source code.
Test script:
---------------
password_hash('passu', PASSWORD_ARGON2I, [
'memory_cost' => 1024 * 1024, // According to documentation, should be 1MB
'time_cost' => 4,
'threads' => 2,
]);
Expected result:
----------------
Check the memory usage of the script. It's 1GB.
Actual result:
--------------
Memory usage should not be a lot more than 1MB.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76290&edit=1