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

Fix large detached signature verification.

parent 1562eed9
......@@ -396,13 +396,7 @@ sign_detached(M, SK) ->
M :: iodata(),
PK :: binary().
sign_verify_detached(SIG, M, PK) ->
SignRes = case iolist_size(M) 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
case enacl_nif:crypto_sign_verify_detached(SIG, M, PK) of
true -> {ok, M};
false -> {error, failed_verification}
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