Commit Graph

187 Commits

Author SHA1 Message Date
Christophe Diederichs
56416de1d5 throw if crypto_aead cannot validate, fix typo in crypto_verify 2020-06-17 14:44:35 +02:00
Christophe Diederichs
e35adc6823 catch syntax error 2020-06-17 13:31:54 +02:00
Christophe Diederichs
ec9cac17d0 added: sodium_is_zero 2020-06-17 13:19:05 +02:00
Christophe Diederichs
b7a0d1f2e5 sodium_memcmp returns boolean 2020-06-17 13:13:05 +02:00
Christophe Diederichs
9b78e675e4 export crypto_verify module 2020-06-17 13:10:21 +02:00
Christophe Diederichs
2214a59711 export sodium_memcmp 2020-06-17 13:07:28 +02:00
Christophe Diederichs
0b37ca03ec added: sodium_memcmp 2020-06-17 13:06:30 +02:00
Christophe Diederichs
6a0e8e7236 add null check on ad param 2020-06-17 13:00:52 +02:00
Christophe Diederichs
68bd4b4a68 chacha: readUint32Le generalised for uint8array; aead: standard fix 2020-06-17 12:50:27 +02:00
Christophe Diederichs
272ac68f6b add assertions 2020-06-17 11:12:20 +02:00
Christophe Diederichs
e423d00ebc listen to linter 2020-06-17 01:29:42 +02:00
Christophe Diederichs
caa8390691 added: crypto_aead_chacha20poly1305_ietf methods 2020-06-17 00:56:59 +02:00
Christophe Diederichs
04bebb09c9 tidy: remove legacy functions 2020-06-16 16:58:58 +02:00
Christophe Diederichs
e69a73279a update sodium_memzero function to arr.fill(0) 2020-06-16 16:57:58 +02:00
Christophe Diederichs
79273d499e rename memzero -> sodium-memzero 2020-06-16 16:54:51 +02:00
Christophe Diederichs
e589c6a5d6 declare constants about exports 2020-06-16 16:52:57 +02:00
Christophe Diederichs
96266128af removed duplicate module.exports declaraion 2020-06-16 16:03:27 +02:00
Christophe Diederichs
84bf4229e4 add: crypto_box_seed_keypair 2020-06-16 16:02:42 +02:00
Christophe Diederichs
7d7249ddc2 export _9 constant field element 2020-06-16 15:55:26 +02:00
Christophe Diederichs
f969d1f707 correction: crypto_kx is not actually an alias of crypto_box 2020-06-16 15:54:44 +02:00
Christophe Diederichs
67a4ba77cb scalarmult: import curve methods; be standard 2020-06-16 15:53:27 +02:00
Christophe Diederichs
8aae7efea2 add: crypto_box_seed_keypair; alias crypto_kx methods to crypto_box 2020-06-16 14:18:32 +02:00
Christophe Diederichs
d57736bf8b be standard 2020-06-16 14:17:31 +02:00
Christophe Diederichs
7141f00ff0 fix bugs in crypto_sign 2020-06-16 14:16:50 +02:00
Christophe Diederichs
7e5ea3b5ed update sha512 to wasm module 2020-06-16 14:15:33 +02:00
Christophe Diederichs
30b8e83417 add chacha20; align API with PR#21 2020-06-12 17:06:31 +02:00
Christophe Diederichs
311905883a update: crypto_hash 2020-05-23 13:37:54 +02:00
Christophe Diederichs
895d4312af require ed25519.js 2020-05-04 21:17:27 +02:00
Christophe Diederichs
d1aaacd3a7 tidy up 2020-05-04 21:13:24 +02:00
Christophe Diederichs
6a9696c86f module: crypto_box 2020-05-04 21:12:44 +02:00
Christophe Diederichs
5dd22a0957 module: crypto_onetimeauth 2020-05-04 21:11:30 +02:00
Christophe Diederichs
a4cab9dfd4 leftover crypto_stream functions 2020-05-04 21:10:22 +02:00
Christophe Diederichs
00d47225ff move verify functions to crypto_verify module 2020-05-04 21:08:29 +02:00
Christophe Diederichs
1e447c23d6 module: crypto_secretbox 2020-05-04 21:04:41 +02:00
Christophe Diederichs
6428fb8222 module: crypto_sign 2020-05-04 20:58:36 +02:00
Christophe Diederichs
b30cf7348e module: crypto_hash 2020-05-04 20:52:17 +02:00
Christophe Diederichs
ff28f5a888 module: crypto_scalarmult 2020-05-04 20:49:21 +02:00
Christophe Diederichs
03fb607709 module: poly1305 2020-05-04 20:44:56 +02:00
Christophe Diederichs
d7ca21cbf1 move ed25519 arithmetic to separate module 2020-05-04 18:59:59 +02:00
Christophe Diederichs
942c2a6db0 crypto_stream: signature change needed to modularise 2020-05-04 18:47:52 +02:00
Mathias Buus
51f8fbc2d3 0.5.6 2020-03-04 14:52:37 +01:00
Mathias Buus
f790621e60 add sodium_malloc 2020-03-04 14:50:09 +01:00
Fedor Indutny
4e42b942a5 crypto_box: fix keypair, implement seal/seal_open
Secret Key is a random nonce, and public key is a point on elliptic
curve.

`crypto_box_seal`/`crypto_box_seal_open` are implemented using existing
primitives and newly exported `core_hsalsa20` in `xsalsa20`
2019-11-14 09:27:36 +01:00
Daniel Regeci
49587c3d7f crypto_box_keypair - rename arguments to pk,sk 2018-03-19 18:07:17 +00:00
Daniel Regeci
92aee452df crypto_box_keypair 2018-03-19 18:07:17 +00:00
Mathias Buus
e1ca83f1bd 0.5.5 2018-03-19 19:03:43 +01:00
Peter van Hardenberg
c81ef709d1 react-native doesn't want crypto set to an empty module (#14)
React-Native is sort of like a browser, sort of a native environment. On react-native we don't have the browser's crypto implementation, so we need to require react-native-crypto. We can rewrite the module requirement to do that using the extraNodeModules feature in rn-cli.config.js, but the metro packager assumes that if there's a "browser" field in package.json that it's relevant to react-native libraries unless there's also a "react-native" field. Hurray.

Anyway, this silly little patch tells metro not to replace crypto with an empty module but actually to use whatever you currently have crypto set to (which is not solved here, so you'll still have to do that.)
2018-03-19 18:58:24 +01:00
Jim Pick
4e1c69ba13 Change crypto_kdf_KEYBYTES to be 32 and use subarray instead of slice
Thanks to Emil Bayes for the advice.
2018-03-03 17:24:12 +00:00
Jim Pick
5159d68fa9 In kdf, truncate key before passing to blake to match sodium-native behaviour
Currently, sodium-native and sodium-javascript are returning different
hashes. The code in hyperdrive passes a 64 byte secret key to the kdf,
but only 32 bytes are used by the native version, but all 64 bytes are
used in the javascript version. As a result, hyperdrive secret keys
can't be imported/exported across the two sodium implementations.

https://gist.github.com/jimpick/3e869522eddaad77ac1bc9e64f36e1a7
2018-03-03 17:24:12 +00:00
Mathias Buus
5ccdcdee17 0.5.4 2017-11-19 13:16:51 +01:00