Extend pwhashing with limits
In the EQC tests, we generate limits at random and verify things work.
This commit is contained in:
parent
dea9ce62ed
commit
1cb2c3a2a2
@ -13,10 +13,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|||||||
- sign
|
- sign
|
||||||
|
|
||||||
- Implement missing EQC tests
|
- Implement missing EQC tests
|
||||||
- Generichash
|
|
||||||
- Multi-part generic hash
|
|
||||||
- pwhash
|
|
||||||
- Extend with limit for ops and memory as well.
|
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
@ -762,12 +762,14 @@ pwhash_str_verify(PasswdHash, Passwd) ->
|
|||||||
end.
|
end.
|
||||||
|
|
||||||
prop_pwhash_str_verify() ->
|
prop_pwhash_str_verify() ->
|
||||||
?FORALL({Passwd},
|
?FORALL({Passwd, OLimit, MLimit},
|
||||||
{?FAULT_RATE(1, 40, g_iodata())},
|
{?FAULT_RATE(1, 40, g_iodata()),
|
||||||
|
elements([interactive, moderate, sensitive]),
|
||||||
|
elements([interactive, moderate, sensitive])},
|
||||||
begin
|
begin
|
||||||
case v_iodata(Passwd) of
|
case v_iodata(Passwd) of
|
||||||
true ->
|
true ->
|
||||||
Ascii = enacl:pwhash_str(Passwd),
|
Ascii = enacl:pwhash_str(Passwd, OLimit, MLimit),
|
||||||
S = enacl:pwhash_str_verify(Ascii, Passwd),
|
S = enacl:pwhash_str_verify(Ascii, Passwd),
|
||||||
equals(S, true);
|
equals(S, true);
|
||||||
false ->
|
false ->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user