179 Commits

Author SHA1 Message Date
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
daveed-al
d4a2a14bc9 adding test for pwhash_str_verify 2018-02-01 00:54:20 +08:00
daveed-al
cd183efd34 pwhash_str_verify respects specs second param as iodata() 2018-01-31 18:41:31 +08:00
daveed-al
97ad7a5452 pwhash_str doc update 2018-01-31 18:25:13 +08:00
Jesper Louis Andersen
c8403ab198
Merge pull request #19 from technion/indents
Fix mixed tabs and spaces. Fixes #12.
2018-01-02 17:07:00 +01:00
Jesper Louis Andersen
dd793a86b4
Merge pull request #18 from technion/hashspec
Changed -spec on generichash/2 and generichash/3.
2018-01-02 17:05:33 +01:00
Technion
9d2f90a5c5 Fix mixed tabs and spaces. Fixes #12. 2017-12-31 05:02:18 +00:00
Technion
c6de481b2e Changed -spec on generichash/2 and generichash/3.
Fixes #17.
2017-12-31 02:40:22 +00:00
Jesper Louis Andersen
5a48c66b07 Merge pull request #16 from xaptum/fix_mips32_warnings_QC
Fix mips32 warnings and add support for compiling enacl_eqc with EQC mini
2017-08-27 13:06:38 +02:00
Irina Guberman
bd80d1d79d Add make eqc_mini_run and eqc_run instructions to README 2017-08-17 23:50:01 -05:00
Irina Guberman
43835abafe fix EQC fault calls 2017-08-16 23:52:31 -05:00
Irina Guberman
cfd654c275 Add eqc_mini_run and eqc_run directives to Makefile 2017-08-16 23:40:51 -05:00
Irina Guberman
fd796440db replace xrouter_clientd with xrouter_procd 2017-08-16 18:42:30 -05:00
Zane Beckwith
207ec85f8c Modify QuickCheck tests to be runnable to eqc-mini.
This involves:
- Removing calls to conjunction function
- Modifying fault* functions to _always_ return "Good" generator
- Commenting-out the eqc_parallelize parse_transform
2017-08-16 21:17:28 +00:00
Irina Guberman
05420f8a6b replace xrouter_clientd with xrouter_procd 2017-08-15 13:52:00 -05:00
Irina Guberman
b9f2895b4d configure for QC testing on http://quickcheck-ci.com 2017-08-15 13:47:46 -05:00
Irina Guberman
0e7ee5c6f0 configure for QC testing on http://quickcheck-ci.com 2017-08-15 13:40:45 -05:00
Zane Beckwith
bf4d61680c Change size_t variables to unsigned int's.
These variables are being initialized via calls to `enif_get_uint`,
so it's safer to declare them as unsigned int's rather than size_t's.
Their being used in calls to `enif_alloc_binary`, which takes a size_t
as its size.
However, the resulting ErlNifBinary keeps its size as an unsigned int,
so asking for a size that's an unsigned int should be safe.

This would be problematic in the case where sizeof(size_t) <
sizeof(unsigned), which would mean we're getting fewer bytes allocated
than expected.
Perhaps an explicit check for, for example, `hashSize > MAX_SIZE` would
be good here?
2017-08-14 17:01:50 +00:00
Irina Guberman
e524c2d5c8 Fix 32-bit arch warnings: replace enif_get_uint64 with enif_get_uint 2017-08-12 16:46:47 -05:00
Venkatakumar Srinivasan
ba640b0659 Added generic hash NIF 2017-08-11 13:32:04 -05:00
Venkatakumar Srinivasan
36eedc6751 Pulled in latest version of enacl. Added nif's for password hashing functions 2017-08-11 13:32:04 -05:00
Venkatakumar Srinivasan
c938d3c6e8 Fix to pwhash_str_verify() to accept only binary arguments 2017-08-11 13:32:04 -05:00
Venkatakumar Srinivasan
ee0d800a9a Implemented nif for crypto_pwhash_str(), crypto_pwhash_str_verify() 2017-08-11 13:32:04 -05:00
Venkatakumar Srinivasan
43cae7c7ea Implemented nif for crypto_pwhash() 2017-08-11 13:32:04 -05:00
Venkatakumar Srinivasan
f395f65389 Removed experimental feature flag ERL_NIF_DIRTY_JOB_CPU_BOUND 2017-08-11 13:32:04 -05:00
Jesper Louis Andersen
61be95caad Bump version to 0.16.0 0.16.0 2017-03-25 23:25:25 +01:00
Jesper Louis Andersen
fffe07e965 Reindent everything.
Indentation follows the standard emacs mode for Erlang code.
2017-03-19 19:28:39 +01:00
Jesper Louis Andersen
ec60a63874 Update README.md with the new stuff which has been added since 0.15.0 2017-03-19 19:14:10 +01:00
Jesper Louis Andersen
2b8052a09a Reindent file to 80 columns. New random section.
From now, use the `rand` module of Erlang for all your random needs.
It is good enough now it uses an XORshift variant.
2017-03-19 19:06:25 +01:00