Frank Denis
3822caf6c7
Micro-optimization
2015-06-22 15:56:35 +02:00
Frank Denis
e2fca8cac5
Add sodium_increment()
2015-06-22 15:44:58 +02:00
Frank Denis
5f74196b0f
scrypt extra parameters checks
2015-06-19 18:55:41 +02:00
Frank Denis
facb3c4343
Implicit conversions
2015-06-16 22:42:13 +02:00
Frank Denis
d35b364f31
Blake2b: fix flags on architectures with < 32-bit int
2015-06-13 17:31:49 +02:00
Deirdre Connolly
f2afab4b1b
If browser crypto is not available, try msCrypto before assuming a
...
Node environment
2015-06-08 18:25:51 -04:00
Frank Denis
f46439c1e2
Ensure that PBKDF2_SHA256() is not used to output more than 128 Go.
2015-06-06 12:46:22 +02:00
Frank Denis
86d92bc11d
SHA512: just use memcpy() to initialize the state
2015-06-06 12:33:11 +02:00
Frank Denis
ba1cd6a128
SHA256: use uint64_t for the counter instead of two uint32_t
2015-06-06 12:32:23 +02:00
Frank Denis
21fc07e6f4
Leverage randombytes_salsa20_random_rekey()
2015-06-01 12:45:45 +02:00
Frank Denis
3c3635e53a
salsa20_random(): just abort(3) if the pid changes and _stir() wasn't called
2015-06-01 12:40:58 +02:00
Frank Denis
315029188e
Suggest randombytes_stir()
2015-06-01 10:22:01 +02:00
Frank Denis
e326ef9030
Do not use timeval. The structure is not defined on Windows RT.
2015-05-29 17:40:37 +02:00
Frank Denis
3bd6b8d074
Further simplify WINAPI_DESKTOP
2015-05-29 17:40:37 +02:00
Frank Denis
ada287ad56
Disable guarded memory on WinRT
2015-05-29 17:40:32 +02:00
Frank Denis
7821009bff
Do not assume that _MSC_VER being defined implied x86 or x64
2015-05-29 17:40:25 +02:00
Frank Denis
94255bee36
bin2hex(): abort(3) if the length doesn't include the final \0
2015-05-15 09:23:59 +02:00
Frank Denis
bf920dc717
Add IETF-compatible version of chacha20poly1305
2015-05-09 16:12:03 +02:00
Frank Denis
63dd05419e
crypto_box_keypair() cannot fail - Add lcov exclusion.
2015-05-09 15:56:52 +02:00
Frank Denis
fe02b1db1b
Also zero the public key and nonce after encryption in crypto_box_seal()
2015-05-09 12:40:25 +02:00
Frank Denis
a593e37983
Rename arguments for consistency
2015-05-09 12:37:27 +02:00
Frank Denis
95983d4471
Don't downcast size_t to int
2015-05-02 10:56:03 +02:00
Frank Denis
3117ccf358
Use memcpy() instead of ugly casts. No changes to compiled code.
2015-04-24 13:52:56 +02:00
Frank Denis
957a29c469
salsa20_random_buf(): mix the output size with the key
2015-04-23 00:09:17 +02:00
Frank Denis
70487753ee
JS target: window.crypto is not defined in webworkers; use self.crypto instead.
2015-04-20 14:26:27 +02:00
Frank Denis
575ce93058
+ crypto_box_seal()
2015-04-17 01:01:32 +02:00
Frank Denis
f740cb5968
Better separation between crypto_auth[_verify] and the NIST-like API.
2015-04-05 20:14:21 +02:00
Frank Denis
dbcca2a501
Don't divide by zero if sodium_allocarray() is called with count=0
2015-03-23 21:43:27 +01:00
Frank Denis
9d5c067ad2
Use getrandom(2) on Linux, if available.
2015-03-09 17:22:34 +01:00
Frank Denis
ceb72f25d8
Indentation
2015-03-09 15:09:27 +01:00
Frank Denis
ef4290b71c
Indentation
2015-02-21 16:15:35 +01:00
Frank Denis
ef7d825f1f
__declspec() / __attribute__(()) shouldn't come before "typedef"
2015-02-17 17:38:54 +01:00
Frank Denis
a2a72d3472
Compare size_t values with ULL
2015-02-16 09:01:36 +01:00
Frank Denis
90447b0283
scrypt: keep r as a size_t value
2015-02-15 22:37:59 +01:00
Frank Denis
663fe8229e
scrypt: corrected pointer alias issues causing scrypt to fail on MIPS64
...
by jfoug <jfoug at cox.net> via JtR issue #1032
2015-02-15 22:31:04 +01:00
Frank Denis
788d8d0178
Make bin2hex() code consistent with hex2bin()
2015-02-10 19:34:11 +01:00
Frank Denis
f8af1790dd
Constant-time hex2bin.
2015-02-10 17:01:51 +01:00
Frank Denis
2fb83ade4c
crypto_sign_detached(): no need to store a copy of the public key on the stack
2015-02-10 13:40:12 +01:00
Frank Denis
a1b3da7dd9
Add crypto_stream_xsalsa20_ic()
2015-02-02 21:27:19 +01:00
Frank Denis
f61e179d8e
(p1 - p2 == 0) => (p1 == p2)
...
No binary changes on supported platforms except on gcc/armv7l where
the control flow remains identical but permutative statements get switched.
2015-01-31 12:18:51 +01:00
Frank Denis
5db61c617b
Add statebytes for crypto_hmac_*
2015-01-23 23:08:49 +01:00
Frank Denis
d0e9b8f69c
Suggest crypto_generichash_statebytes() instead of sizeof()
2015-01-23 22:54:27 +01:00
Frank Denis
b5deb4d070
+ crypto_hash_sha(256|512)_statebytes
2015-01-23 11:17:40 +01:00
Frank Denis
9e538624f4
+ crypto_generichash_statebytes()
2015-01-23 11:00:57 +01:00
Frank Denis
c9ba75a48f
Add crypto_generichash_statebytes()
...
sizeof() is not always an option when accessing the library from
other languages.
2015-01-23 10:56:01 +01:00
Frank Denis
e2a24e69ec
Invert #if[n]def __EMSCRIPTEN__ logic, put more common case first
2015-01-18 10:20:12 +01:00
Frank Denis
feaba594db
|| -> | spotted by Ahmad
2015-01-18 10:17:53 +01:00
Frank Denis
5b3d8a4bf9
Mention what is optional and what is required for a randombytes implementation
2015-01-18 10:12:27 +01:00
Frank Denis
0b4fb379d4
Factorize randombytes_uniform()
...
Don't require randombytes implementations to reimplement this.
NULL can be passed instead of a function pointer to use the default
implementation.
Allow NULL for randombytes_stir() and randombytes_close() as well.
2015-01-18 10:08:36 +01:00
Frank Denis
add0fcede4
randombytes_random() is 32 bits, even in JS.
2015-01-18 09:50:17 +01:00