12 Commits

Author SHA1 Message Date
Hans Svensson
4eb7ec7008
Fix C-warnings (#10)
* .envrc is not for git

* Fix c code - avoid warnings

* Bump Erlang versions in Github workflows
2024-03-19 13:23:23 +01:00
Jesper Louis Andersen
d6bd999c82 sign_verify_detached: guard against size
The code didn't properly do a size check on a detached signature. Now it
does.

While here, fix a problem with EQC tests, for the same piece of code.
2021-06-15 13:05:48 +02:00
Jesper Louis Andersen
fd87b9da39 Fix a bug in sign_init/0
The code path was wrong in a lot
of cases in sign_init/0 so even if it
succeeded it would return a failure.

Fixed by cleaning up the code.
2020-02-06 13:57:49 +01:00
Jesper Louis Andersen
f580f6525b Streamline _open style calls
Those now return {ok, Msg} or
{error, term()} so you are kind of
forced to match on them. This is
likely to help with correctnes.
2020-02-06 11:48:57 +01:00
Jesper Louis Andersen
7999d08e9d Streamlining of secret and _verify
The secret key API is now streamlined.

Also, all verify-type functions are
now returning boolean() values.
This makes the API consistent.
2020-02-06 11:12:32 +01:00
Jesper Louis Andersen
4939f7bb23 Protect the signature ctx with a mutex
This is the same game as with the
generichash construction. We want
to protect it with a mutex so
different processes can safely do
work on the same resource.

While here, also move the _update
function onto the dirty scheduler.
It is by far the most expensive
operation, and why it wasn't there
in the first place is odd. This should
unblock the scheduler on long
sign-checks. It also move the
possible mutex block onto the
dirty scheduler thread, away from
the core schedulers, improving
latency in the system as a result.
2020-01-24 15:18:04 +01:00
Jesper Louis Andersen
018bf0f6fc Plug a large set of memory leaks in signing
If you fail, there are cases where binaries are not properly released.
This patch fixes them all in signing.
2020-01-22 22:22:29 +01:00
Jesper Louis Andersen
ab40d5bbf8 Rename fixups 2020-01-21 13:56:17 +01:00
Jesper Louis Andersen
92b91bd806 Rename "nacl_error_tuple" -> "enacl_error_tuple"
The new name is consistent where the old name was not.
2020-01-21 13:40:35 +01:00
Jesper Louis Andersen
fe478ea253 Header file fixupUse <erl_nif.h> since it is a system header.Also rearrange headers to be consistent. 2020-01-20 14:57:42 +01:00
Jesper Louis Andersen
0427fa42ee Rename enif_crypto_ to enacl_crypto_
This is a better name which spits stuff appropriately.

We don't pollute the enif_ namespace.
2020-01-19 17:56:31 +01:00
Jesper Louis Andersen
f5b8a8eb3b Pull signing out to its own module 2020-01-19 17:38:42 +01:00