Streamline sealed boxes

This commit is contained in:
Jesper Louis Andersen
2020-02-04 12:44:47 +01:00
parent c791f602e9
commit 71832cce4c
4 changed files with 11 additions and 10 deletions
+2 -2
View File
@@ -431,7 +431,7 @@ prop_seal_box_failure_integrity() ->
begin
case v_iodata(Msg) andalso keypair_valid(PK1, SK1) of
true ->
CT = enacl:box_seal(Msg, PK1),
{ok, CT} = enacl:box_seal(Msg, PK1),
Err = enacl:box_seal_open([<<"x">>, CT], PK1, SK1),
equals(Err, {error, failed_verification});
false ->
@@ -450,7 +450,7 @@ prop_seal_box_correct() ->
begin
case v_iodata(Msg) andalso keypair_valid(PK1, SK1) of
true ->
SealedCipherText = enacl:box_seal(Msg, PK1),
{ok, SealedCipherText} = enacl:box_seal(Msg, PK1),
{ok, DecodedMsg} = enacl:box_seal_open(SealedCipherText, PK1, SK1),
equals(iolist_to_binary(Msg), DecodedMsg);
false ->