Commit Graph

17 Commits

Author SHA1 Message Date
codedust ee1ab5f0c7 Improve readability of handle_request() in crypto_core.c
Moving 'return -1;' directly below the conditions improves readability
and also better represents the coding style of other functions in
crypt_core.c (and everywhere else).
2015-06-06 16:44:29 +02:00
irungentoo b4fc0809a7 The only secure compare function currently needed is one to compare 2 public keys. 2015-04-18 13:13:29 -04:00
irungentoo abff19fdcc Increase thread safety.
randombytes() doesn't seem to have any real speed disadvantage.

Also makes people who think nonces need to be random happy.
2015-03-29 13:14:13 -04:00
irungentoo 93a998d15a Code cleanups.
Moved some functions to onion.c.

Fixed possible portability issues.
2015-01-01 21:30:42 -05:00
Luke Drummond bf6fe08d0b fixes #1210 2014-12-31 04:03:40 +00:00
cgar 2bb2bc4163 spelling corrections 2014-09-09 20:31:37 -04:00
irungentoo 6408c406b2 Added more input validation to add_friend functions. 2014-06-16 19:31:39 -04:00
irungentoo 0b4640a508 Fixed typo.
This typo doesn't seem to cause any issue because according to the
code in vanilla NaCl the first crypto_box_ZEROBYTES (for encryption)
and crypto_box_BOXZEROBYTES (for decryption) of the array passed to
the crypto_box*() functions don't need to be zero for it to work.

The documentation however clearly states that they need to be zero
which means they need to be zero.
2014-06-13 15:05:05 -04:00
irungentoo 07936960df Astyle and fixes. 2014-06-10 18:35:55 -04:00
Marc Schütz 55d986270b Const correctness in toxcore/crypto_core.c 2014-06-10 18:38:43 +02:00
irungentoo deb8bfc350 Random number functions belong in crypto_core. 2014-05-01 19:42:44 -04:00
irungentoo 47aa53a384 Protocol implementation is starting to look ok.
Still need to decide exactly how data packets will work though.
2014-05-01 19:20:28 -04:00
irungentoo 19a4b1e443 Improved the crypto_cmp function.
It now uses the NaCl functions when the length is appropriate.

Moved crypto defines to crypto_core.h
2014-05-01 08:06:24 -04:00
irungentoo b9370d519f Added some functions to create/handle middle level protocol packets. 2014-04-28 20:14:07 -04:00
irungentoo 384750af8c Major cleanups.
Fixed circular dependency between DHT and net_crypto: DHT no longer
depends on net_crypto.

Moved the crypto request packets functions to crypto core and DHT.

Cleaned up/added some defines that can be used to get the true maximum
length of things like the friends request message.

MAX_DATA_SIZE has been replaced in most places by more appropriate defines.
2014-04-23 11:35:40 -04:00
irungentoo 1bfe15ee88 Decided pretty much how the handshake would work.
Started writing the code.

Astyled some files.
2014-04-22 20:28:40 -04:00
irungentoo 9c6a8432ce Crypto related cleanups.
Moved Bunch of functions from net_crypto to crypto_core.

decrypt_data_fast and decrypt_data_symmetric were the same thing
therefore, removed decrypt_data_fast.

Replaced all the crypto_secretbox_* defines with the equivalent
crypto_box_* one.

New define: crypto_box_KEYBYTES that is equal to
crypto_box_BEFORENMBYTES.
2014-04-21 16:51:36 -04:00