101 Commits

Author SHA1 Message Date
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
d7e83dd569 Track outlen inside the generichash wrapper 2020-01-17 16:24:51 +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
3f284be0cb Merge branch 'sign-seed-keypair' of github.com:termoose/enacl 2020-01-16 15:21:50 +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
7f8e0a0e07 Merge branch 'xchacha20' of github.com:ECrownofFire/enacl 2020-01-16 13:15:54 +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
f9d6034e84 Implement missing random functions* enacl:randombytes_int32/0* enacl:randombytes_uniform/1 2020-01-15 13:56:00 +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
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
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
Jesper Louis Andersen
f650c72b02 version bump 2018-05-21 17:52:25 +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
d737552b2a Hello 0.17.0 2018-05-21 13:46:17 +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
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
Hans Svensson
2f50ba6289 Also expose crypto_curve25519_scalarmult_base 2018-03-05 15:33:17 +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
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
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
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
43cae7c7ea Implemented nif for crypto_pwhash() 2017-08-11 13:32:04 -05:00
Jesper Louis Andersen
61be95caad Bump version to 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
Alexander Malaev
2da2ba138f Add kx_* functions from libsodium 1.0.12 2017-03-19 18:24:06 +03:00
Doug Huff
3f4b50dbe1 Squash some dialyzer warnings for constants. 2015-10-29 20:35:44 +00:00
Doug Huff
9849e7310a Add unsafe_memzero/1 2015-10-28 21:54:08 +00:00
Doug Huff
4d5524db61 Add chacha stream function access. 2015-10-28 21:53:42 +00:00
Doug Huff
ca005d32f9 Add access to siphash-2-4 (no dirty scheduler necessary). 2015-10-28 21:52:25 +00:00
Jesper Louis Andersen
01526484f2 Update the README file with version 0.15.0 2015-08-29 22:17:13 +02:00
Jesper Louis Andersen
b1c3e69fb5 Change randombytes/1 so it always executes on a DS
Investigation shows erratic behaviour of the CSPRNG. It may block at times
because it needs to go to the kernel and obtain more random information in
the system. Once this happens, you are blocked for quite a long time, but
we don't generally know when this happens. So just execute these directly
on the dirty scheduler.
2015-08-29 22:09:51 +02:00
Jesper Louis Andersen
2cad66ac2a Handle the ED25519 to Curve25519 conversion routines.
Make sure these either execute on the Dirty Scheduler or execute with bumping
reductions.
2015-08-29 22:08:34 +02:00
Jesper Louis Andersen
2e5163a934 Clean up things which are not needed anymore. 2015-08-29 21:50:16 +02:00
Jesper Louis Andersen
a59e983d9e Fix large detached signature verification. 2015-08-29 21:34:08 +02:00
Jesper Louis Andersen
1562eed9a3 Use DS-variants whenever it doesn't make sense.
Some operations are simply too expensive. Always run these on the dirty
scheduler.
2015-08-29 21:33:22 +02:00
Jesper Louis Andersen
66cf275152 Introduce a scalarmult variant which is safe from arguments swaps. 2015-08-29 21:32:48 +02:00
Jesper Louis Andersen
6bfa191f6b Do not create a new set of 0-bytes all the time.
Rather than creating a set of <<0,…,0>> every time and then throwing it away,
we now reuse a constant. They are small enough they are still small-binaries, but a
process can keep them around and use them whenever it needs to go to the
low-level area.
2015-08-29 20:54:37 +02:00
Jesper Louis Andersen
310bb3cc77 Remove the mention of the timing module.
We have a better way to handle this. So we are going to handle it in a better way, by
simply making the direct solution: Fix the crap by using DTrace.
2015-08-29 20:53:43 +02:00
Jesper Louis Andersen
a135bce9d3 Simplify the code base, first round:
* Introduce enacl:verify/0 to verify the integrity of the library.
* Always run keypair functions on the dirty schedulers.
* Do not call NIFs when creating zerobytes. Avoid constructing new binary data, but reuse a constant.
* The box/box_open and box_seal/box_seal_open API is so expensive to call there is little overhead in
  running it on the DS always.
2015-08-23 21:44:28 +02:00