Commit a59e983d authored by Jesper Louis Andersen's avatar Jesper Louis Andersen
Browse files

Fix large detached signature verification.

parent 1562eed9
...@@ -396,13 +396,7 @@ sign_detached(M, SK) -> ...@@ -396,13 +396,7 @@ sign_detached(M, SK) ->
M :: iodata(), M :: iodata(),
PK :: binary(). PK :: binary().
sign_verify_detached(SIG, M, PK) -> sign_verify_detached(SIG, M, PK) ->
SignRes = case iolist_size(M) of case enacl_nif:crypto_sign_verify_detached(SIG, M, PK) of
K when K =< ?SIGN_SIZE ->
bump(enacl_nif:crypto_sign_verify_detached_b(SIG, M, PK), ?SIGN_REDUCTIONS, ?SIGN_SIZE, K);
_ ->
enacl_nif:crypto_sign_detached(SIG, M, PK)
end,
case SignRes of
true -> {ok, M}; true -> {ok, M};
false -> {error, failed_verification} false -> {error, failed_verification}
end. end.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment