Skip to content

Commit 9e5b8e3

Browse files
authored
Bug fix - Changing variable from "MemoryCost" to "cpuMemCost" in standard_scrypt method (#643)
* Changing 'memoryCost' to CpuMemCost RELEASE NOTE: Fixed an incorrect key used to set MemoryCost config in standard_scrypt() API * Update Test for standard_scrypt * Update _user_import.py
1 parent 336dbef commit 9e5b8e3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

firebase_admin/_user_import.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ def standard_scrypt(cls, memory_cost, parallelization, block_size, derived_key_l
454454
"""Creates a new standard Scrypt algorithm instance.
455455
456456
Args:
457-
memory_cost: Memory cost as a non-negaive integer.
457+
memory_cost: CPU Memory cost as a non-negative integer.
458458
parallelization: Parallelization as a non-negative integer.
459459
block_size: Block size as a non-negative integer.
460460
derived_key_length: Derived key length as a non-negative integer.
@@ -463,7 +463,7 @@ def standard_scrypt(cls, memory_cost, parallelization, block_size, derived_key_l
463463
UserImportHash: A new ``UserImportHash``.
464464
"""
465465
data = {
466-
'memoryCost': _auth_utils.validate_int(memory_cost, 'memory_cost', low=0),
466+
'cpuMemCost': _auth_utils.validate_int(memory_cost, 'memory_cost', low=0),
467467
'parallelization': _auth_utils.validate_int(parallelization, 'parallelization', low=0),
468468
'blockSize': _auth_utils.validate_int(block_size, 'block_size', low=0),
469469
'dkLen': _auth_utils.validate_int(derived_key_length, 'derived_key_length', low=0),

tests/test_user_mgt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1212,7 +1212,7 @@ def test_standard_scrypt(self):
12121212
memory_cost=14, parallelization=2, block_size=10, derived_key_length=128)
12131213
expected = {
12141214
'hashAlgorithm': 'STANDARD_SCRYPT',
1215-
'memoryCost': 14,
1215+
'cpuMemCost': 14,
12161216
'parallelization': 2,
12171217
'blockSize': 10,
12181218
'dkLen': 128,

0 commit comments

Comments
 (0)