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
|
||||
|
||||
- Implement missing EQC tests
|
||||
- Generichash
|
||||
- Multi-part generic hash
|
||||
- pwhash
|
||||
- Extend with limit for ops and memory as well.
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
|
@ -762,12 +762,14 @@ pwhash_str_verify(PasswdHash, Passwd) ->
|
||||
end.
|
||||
|
||||
prop_pwhash_str_verify() ->
|
||||
?FORALL({Passwd},
|
||||
{?FAULT_RATE(1, 40, g_iodata())},
|
||||
?FORALL({Passwd, OLimit, MLimit},
|
||||
{?FAULT_RATE(1, 40, g_iodata()),
|
||||
elements([interactive, moderate, sensitive]),
|
||||
elements([interactive, moderate, sensitive])},
|
||||
begin
|
||||
case v_iodata(Passwd) of
|
||||
true ->
|
||||
Ascii = enacl:pwhash_str(Passwd),
|
||||
Ascii = enacl:pwhash_str(Passwd, OLimit, MLimit),
|
||||
S = enacl:pwhash_str_verify(Ascii, Passwd),
|
||||
equals(S, true);
|
||||
false ->
|
||||
|
Loading…
x
Reference in New Issue
Block a user