Commit Graph

243 Commits

Author SHA1 Message Date
Jesper Louis Andersen e67619a403 Update the naming scheme of AEAD xchacha20...
Since this AEAD construction variant is an IETF variant, reflect
this in the names of the functions.

This streamlines the API with the libsodium API.
2020-01-22 19:41:58 +01:00
Jesper Louis Andersen 7f857115bb Add aead IETF constructions
Since the chacha20poly1305 constructions were the IETF variants,
we renamed those so they follow the official library better. While
here, we also fixed the argument order of the files.
2020-01-21 14:16:24 +01:00
Jesper Louis Andersen bdb4719f6d Fix AEAD parameter order / naming.
The order of parameters were in the wrong order. Make them equal
to the official order of libsodium.

While here, rename NONCEBYTES to NPUBBYTES so it reflects the
underlying names as well.
2020-01-21 13:57:39 +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 fec24995d1 Clean up aead construction, plug mem-leak 2020-01-21 13:39:08 +01:00
Jesper Louis Andersen 899fbeefd3 Plug memory leaks in kx_ functions
If we, for some reason, fail to the error-path, then binaries allocated
are not being released properly back to the erlang runtime. Fix this
in the usual fashion by using a stack of undo-operations, and thread
them via goto.
2020-01-21 13:01:48 +01:00
Jesper Louis Andersen d850b16d1b Fix multi-part signatures
Remove the signstate wrapper as it is not needed anyore.
2020-01-20 15:52:38 +01:00
Jesper Louis Andersen a5e66ff204 Reap a #define 2020-01-20 15:38:42 +01:00
Jesper Louis Andersen bf6fb6cf7b Split the remaining operations 2020-01-20 15:31:44 +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 460c5bddfd Rudimentary test of pwhash 2020-01-20 14:45:52 +01:00
Jesper Louis Andersen d3c033c4e6 Split off password hashing 2020-01-20 14:38:20 +01:00
Jesper Louis Andersen fddbefeabd Simple AEAD unit tests 2020-01-20 14:38:09 +01:00
Jesper Louis Andersen 2ea36a7352 Start an "Upcoming changes" list
We want to fix a number of problems in the library. So we write down
what we are going to do in order to make it clearer to people.
2020-01-20 14:37:47 +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
Jesper Louis Andersen 4eaef57a76 Rename AEAD routines from enif_* to enacl_* 2020-01-19 13:32:15 +01:00
Jesper Louis Andersen 3ee5a94caf Split off AEAD functions to a separate file 2020-01-19 13:29:32 +01:00
Jesper Louis Andersen 0047af286f Provide a test suite for Generichash 2020-01-19 12:08:17 +01:00
Jesper Louis Andersen 61345d0b6e Fix argument handling in generichash_final
If supplying 1 argument, it is in argv[0], not argv[1]
2020-01-19 12:08:05 +01:00
Jesper Louis Andersen 0f39bae64c Fix name of C function
The name of the generichash function was wrong, so it was not possible to find it when
loading the NIF.
2020-01-19 12:07:18 +01:00
Jesper Louis Andersen d7e83dd569 Track outlen inside the generichash wrapper 2020-01-17 16:24:51 +01:00
Jesper Louis Andersen df1b134f73 Track liveness stateReject updates to finalized generichash states. 2020-01-17 16:07:01 +01:00
Jesper Louis Andersen f5918c0156 Fix compilation 2020-01-17 16:03:30 +01:00
Jesper Louis Andersen 463cae05d5 Bump for first additions 2020-01-17 16:03:16 +01:00
Jesper Louis Andersen 6e057cbd48 The sodium MIN/MAX values are incusive 2020-01-17 15:47:51 +01:00
Jesper Louis Andersen d5bb24e671 Start splitting the library into its parts 2020-01-17 15:46:38 +01:00
Jesper Louis Andersen a25b9a2684 Bump CHANGELOG 2020-01-16 15:55:59 +01:00
Jesper Louis Andersen b7533d3b9c Release resources under failure
sign and generichash failed to release their resources under failure.

This can lead to subtle memory leaks in the very unlikely event
we can't initialize.
2020-01-16 15:45:42 +01:00
Jesper Louis Andersen f43a730758 Merge branch 'multi-part-signatures' of github.com:hazy/enacl 2020-01-16 15:38:48 +01:00
Jesper Louis Andersen 0cfa88be32 Update changelog 2020-01-16 15:22:43 +01:00
Jesper Louis Andersen 3f284be0cb Merge branch 'sign-seed-keypair' of github.com:termoose/enacl 2020-01-16 15:21:50 +01:00
Jesper Louis Andersen 03bf3b30a1 Update changelog 2020-01-16 13:48:35 +01:00
Jesper Louis Andersen 6032b5839d Provide documentation 2020-01-16 13:47:41 +01:00
Jesper Louis Andersen e6cb85fb24 Merge branch 'master' of github.com:syfgkjasdkn/enacl 2020-01-16 13:45:31 +01:00
Jesper Louis Andersen 288d51ace7 Bump changelog 2020-01-16 13:42:19 +01:00
Jesper Louis Andersen 25d411aa7d Merge branch 'fix-constant-and-more-tests' of github.com:aeternity/enacl 2020-01-16 13:27:58 +01:00
Jesper Louis Andersen 7f8e0a0e07 Merge branch 'xchacha20' of github.com:ECrownofFire/enacl 2020-01-16 13:15:54 +01:00
Jesper Louis Andersen aaa5827613 Maintain CHANGELOG a bit 2020-01-15 16:17:44 +01:00
Jesper Louis Andersen bb703d0c35 Bump CONTRIBUTORS 2020-01-15 16:17:00 +01:00
Jesper Louis Andersen 600020620b Merge branch 'master' of github.com:ECrownofFire/enacl 2020-01-15 16:11:30 +01:00
Jesper Louis Andersen 97ee4bbdcf Use randombytes_uint32
Better name. Says what you are getting.
2020-01-15 14:05:25 +01:00
Jesper Louis Andersen 3c8d54d87b Merge branch 'master' of github.com:jlouis/enacl 2020-01-15 14:01:32 +01:00
Jesper Louis Andersen f9d6034e84 Implement missing random functions* enacl:randombytes_int32/0* enacl:randombytes_uniform/1 2020-01-15 13:56:00 +01:00
Jesper Louis Andersen bc1af327e5 Bump .gitignore 2020-01-15 13:23:08 +01:00
Jesper Louis Andersen 6a30dc2825 Dump in some vscode helpers/settings 2020-01-15 13:23:01 +01:00
Jesper Louis Andersen e66855c029 Use LLVM style C-formattting 2020-01-15 13:21:51 +01:00
Jesper Louis Andersen 745ff9ff75 Merge pull request #40 from tolbrino/tb-rebar3-win32
Add win32 support
2020-01-14 13:21:09 +01:00
Jesper Louis Andersen 885bc16374 Drop in a nix shell for easier handling. 2020-01-14 13:08:56 +01:00