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
Alexander Malaev
2da2ba138f
Add kx_* functions from libsodium 1.0.12
2017-03-19 18:24:06 +03:00
Jesper Louis Andersen
a708d0b11e
Merge pull request #9 from jrmithdobbs/expose_more_libsodium_functions
...
Expose more libsodium functions
2016-06-23 22:04:21 +02:00
Jesper Louis Andersen
2ee171bcbf
The test macro for dirty schedulers are gone in 19.x Erlang/OTP
...
Remove it from the code, making the code able to compile.
2016-05-16 19:20:47 +02:00
Konrad Zemek
1789c6d3c8
Force remove artifacts in clean target.
2016-03-08 12:27:14 +01: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
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
a49c5a816c
Introduce SunOS/Illumos support into the mix.
2015-08-29 21:31:44 +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
Jesper Louis Andersen
f444d1e4ac
Fix box_seal/2 and box_seal_open/3.
...
* Call the functions `box_seal` and `box_seal_open` to match the libsodium names in module `enacl`.
* Fix a bug in the C NIF: We should fail if the input is `<` SEALBYTES but not on `<=` SEALBYTES. The latter made it impossible to encode empty messages.
* Add variants which run directly on the interpreter scheduler for small messages.
Also:
* Provide full EQC functions for the testing purposes. This generated around 13000 random test cases in a 5 minute run, all passing.# Please enter the commit message for your changes. Lines starting
2015-08-14 22:03:33 +02:00
Jesper Louis Andersen
92109eb354
Improve and verify sign_*_detached functions.
...
Provide non-dirty-scheduler variants for small strings, accurately bump
reductions for these strings.
While here, provide EQC test cases for the two functions.
2015-08-12 23:11:41 +02:00
Amir Ghassemi Nasr
64c03a1425
added bindings for crypto_box_seal_open\' functions
2015-08-07 00:24:50 +04:30
Parnell Springmeyer
35515e465a
Improvements re: suggestions from @jlouis.
2015-07-26 13:49:15 -05:00
Joel Stanley
7e7ac67fb3
Add bindings to the libsodium DSA operations 'crypto_sign_detached' and 'crypto_sign_verify_detached'
2015-07-26 08:00:48 -05:00
Jesper Louis Andersen
bec29dfbe1
Mark internal functions as static functions.
...
This quells a number of warnings in the library when compiling.
2015-05-11 17:25:11 +02:00
arpunk
7bf9f24259
Add missing include and lib directories
2015-05-06 02:50:41 -05:00
Alexander Færøy
de0ce86473
Add Ed 25519 Utility API.
2015-04-02 18:43:58 +02:00
Alexander Færøy
b544a37a72
Fix warning: missing declaration for memcpy().
2015-04-02 18:43:58 +02:00
Alexander Færøy
d61d363426
Zero out temporary secret key memory.
2015-02-22 13:26:11 +01:00
Alexander Færøy
4e66fc3b94
Add curve25519_keypair/0 and curve25519_shared/2.
2015-02-21 22:49:44 +01:00
Alexander Færøy
6de936899c
Use rebar3 for compilation.
2015-02-21 22:47:20 +01:00
Jesper Louis Andersen
238907e2a7
Fix bug in box_open_afternm + Improve readability of C code.
...
If we write
EXP != 0
and EXP is a very large term, it is hard to see what it gets checked against, so we rewrite it as
0 != EXP
so we instanly see what we check against. While here, teset against 0 != crypto_box_afternm(…)
2014-12-17 16:15:29 +01:00
Jesper Louis Andersen
e456f4ea9b
Introduce blocking variants.
2014-12-17 15:50:02 +01:00
Jesper Louis Andersen
e594146f67
Implement the beforenm/afternm calls at the NIF layer.
2014-12-17 12:46:54 +01:00
Jesper Louis Andersen
e10b7c8cfe
Fail compilation if the Erlang/OTP system has no dirty scheduler support.
2014-12-16 15:12:52 +01:00
Jesper Louis Andersen
5fec48c091
EQC Test improvements
...
* Generalize binary generation because it is used again and again.
* Use generalized binary generation in the hash functions since they are much faster as generators.
2014-12-13 02:00:52 +01:00
Jesper Louis Andersen
fd9f421621
Introduce enacl:randombytes/1
.
2014-12-09 00:33:55 +01:00
Jesper Louis Andersen
33a47e4fd4
Do not accept iolist data when binary data is what is forced by the input code.
2014-11-29 17:14:53 +01:00
Jesper Louis Andersen
90509026ce
reduction handling, iodata() conversion.
2014-11-29 16:45:58 +01:00
Jesper Louis Andersen
281c3e8fbf
Provide (scheduler) blocking variants of all the expensive calls.
2014-11-28 14:53:18 +01:00
Jesper Louis Andersen
2d39e2535e
Properly initialize libsodium.
2014-11-28 14:41:20 +01:00
Jesper Louis Andersen
57bb93683b
Introduce tests for authentication verification and provide basis for signatures.
2014-11-26 20:05:59 +01:00
Jesper Louis Andersen
7c8272baa8
Keypair generation cannot fail.
...
Do not return an `ok` style tuple if key generation cannot fail.
2014-11-25 15:43:15 +01:00
Jesper Louis Andersen
c33225cb77
Implement the low-level functions for signing.
2014-11-25 13:48:51 +01:00
Jesper Louis Andersen
30cb016078
Introduce low-level functions for handling string comparison.
2014-11-25 13:23:14 +01:00
Jesper Louis Andersen
265d8c7636
Handle signing keypair generation.
2014-11-24 19:30:04 +01:00
Jesper Louis Andersen
2324b73534
Implement the low-level codes for onetime authentication.
2014-11-24 15:17:02 +01:00
Jesper Louis Andersen
08297bb9c9
Rid ourselves of excess whitespace.
2014-11-24 15:16:54 +01:00
Jesper Louis Andersen
772a97d3db
Implement low level code for the authenticators.
2014-11-24 14:39:19 +01:00
Jesper Louis Andersen
101c16e34a
Add low-level support for crypto_stream and crypto_stream_xor.
2014-11-24 14:24:03 +01:00