225 Commits

Author SHA1 Message Date
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
Garry Hill
279c2c32c8
Add support for multi-part signatures 2019-11-20 12:11:21 +00:00
Ole Andre Birkedal
6f4a0c2521 Added bindings for crypto_sign_seed_keypair in libsodium 2019-06-15 14:29:15 +02:00
Tino Breddin
26180f42c0 Add win32 support
Replace Make-based compilation of the nif to using rebar's port
compiler.
2018-11-29 11:29:40 +01:00
ECrownofFire
2b183e1974
Add support for aead_xchacha20poly1305 2018-11-25 11:30:34 -05:00
alsdiufgoaiwuegflweuvflasjkdhvlajhsdfg666272727asfgfdsagdlsafg
3442655c5b add crypto_sign_ed25519_sk_to_pk 2018-11-22 13:04:24 +00:00
Jesper Louis Andersen
885662c069
Merge pull request #36 from aeternity/generichash_segfault
Generic hash state needs to be 64-byte aligned
2018-11-08 11:36:38 +01:00
Hans Svensson
1121321573 Generic hash state needs to be 64-byte aligned
At least according to:
  https://libsodium.gitbook.io/doc/hashing/generic_hashing

We noticed crashes when it was not 16-byte aligned - probably is
architecture dependent. This makes the safe choice and always 64-byte
align it.
2018-11-08 10:44:02 +01:00
ECrownofFire
4afa6fc093
Add checks for ops/mem limit sizes 2018-10-27 23:25:23 -04:00
ECrownofFire
26f4a40eb4
Mark pwhash functions as CPU bound 2018-10-27 23:25:16 -04:00
ECrownofFire
07bcd87294
Add choice of ops and mem limits to pwhash 2018-10-27 23:23:16 -04:00
ECrownofFire
d779071285
Add choice of ops and mem limits to pwhash_str
It natively checks atoms, which is kinda messy, but it avoids having to
export the libsodium pwhash constants, which is nice.
2018-10-27 23:22:55 -04:00
Thomas Arts
b3bbb2a910 Add tests for scalarmult
There appeared to be no tests for this function. The typical property for it is that scalarmultiplication is commutitative.
2018-06-13 07:04:01 +02:00
Thomas Arts
40fde1807b Variable is assigned but never used
This is just a warning, but elliminating warnings makes the code go cleanly through clang static code analyzer.
2018-06-13 07:03:04 +02:00
Thomas Arts
04b8fa3ecb Dangerous use of constant 2018-06-12 14:26:14 +02:00
Jesper Louis Andersen
f650c72b02 version bump 0.17.2 2018-05-21 17:52:25 +02:00
Jesper Louis Andersen
5210099e53 Update the changelog with the new stuff 0.17.1 2018-05-21 17:41:12 +02:00
Jesper Louis Andersen
bb4014286f version bump 2018-05-21 17:38:39 +02:00
Jesper Louis Andersen
edd95498d1 Fix pwhash_str* functions.
The API for pwhash_str returns a cstring in the output buffer. These
are null terminated. However, we return the full buffer as a binary
back to Erlang. This means that we have a buffer with 0'es in the end.

The tests take this buffer and passes it back in as is. Hence all the
tests pass. However, it is conceivable that if we write said buffer to
disk somewhere, we are not going to write those 0's out.

When we then load the ASCII-armored Argon2 string into memory again,
it is not 0-terminated as a cstring should be, and this produces
errors all over the place.

The fix is twofold:

* Return the full buffer to Erlang, but use binary:split/2 to create a
  subbinary with the relevant part.
* Add a 0 in the end of ASCII Argon2 string before passing it to
  libsodium

Since we are looking at pwhashing, and Argon2, we expect the
computational problem to be memory bound. Thus, spending a bit more
work in memory is not going to have any considerable impact on the
speed of this system.
2018-05-21 15:21:09 +02:00