207 Commits

Author SHA1 Message Date
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
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
Jesper Louis Andersen
e77aca8ecb Improve the description 2018-05-21 13:51:32 +02:00
Jesper Louis Andersen
9c25038034 Ready for hex.pm publication. 2018-05-21 13:50:55 +02:00
Jesper Louis Andersen
d737552b2a Hello 0.17.0 0.17.0 2018-05-21 13:46:17 +02:00
Jesper Louis Andersen
2f1e1fa7b6 Provide a proper changelog 2018-05-21 13:45:59 +02:00
Jesper Louis Andersen
3b9bc848e9 Move functions around. Mark untested functionality.
A lot of people who pushed functions they missed have not pushed any
kind of test cases for them. To make sure we have test coverage, I've
marked the functions we have under test and the functions we are still
missing tests for.
2018-05-21 12:27:24 +02:00
Jesper Louis Andersen
75042a24ba Compile helper for development 2018-05-21 12:09:32 +02:00
Jesper Louis Andersen
b9b6f7db11 Correct link in README. Closes #30. 2018-05-21 12:08:52 +02:00
Jesper Louis Andersen
8b8ceff4ef Fix rebar3 edoc compilation 2018-05-20 20:25:33 +02:00
Jesper Louis Andersen
fb7de2cbb4
Merge pull request #21 from aeternity/add_aead_chacha20poly1305
Add AEAD chacha20poly1305
2018-05-20 19:38:14 +02:00
Jesper Louis Andersen
0c5acd2fba Fix test cases for the pwhash_str_* calls 2018-05-20 19:36:31 +02:00
Jesper Louis Andersen
3407433443 Remove a sed script that is not needed anymore when compiling 2018-05-20 19:36:15 +02:00
Jesper Louis Andersen
405045bf5c
Merge pull request #20 from chronic-labs/pwhash
Params pwhash_str_verify/2 as iodata() and adding test
2018-05-20 19:19:10 +02:00
Hans Svensson
2f50ba6289 Also expose crypto_curve25519_scalarmult_base 2018-03-05 15:33:17 +01:00
Hans Svensson
7181600cb4 Simple QuickCheck properties for ChaCha20Poly1305 2018-03-05 09:53:08 +01:00
Hans Svensson
9dfbe8cc90 Expose AEAD ChaCha20 Poly1305 functionality
Note: We expose the modern IETF version but still name it plain
aead_chacha20poly1305.
2018-03-05 09:52:39 +01:00
Hans Svensson
a5dab7acf0 Whitespace 2018-03-01 08:41:53 +01:00
daveed-al
fb5985da27 pwhash_str_verify test update 2018-02-01 18:25:16 +08:00
daveed-al
b2efb45126 pwhash_str_verify 2018-02-01 18:23:23 +08:00