mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Make private functions in core/net_crypto.c static
This commit is contained in:
parent
b9f387b3b7
commit
8680cf76bf
|
@ -126,7 +126,7 @@ int decrypt_data(uint8_t *public_key, uint8_t *secret_key, uint8_t *nonce,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* increment the given nonce by 1 */
|
/* increment the given nonce by 1 */
|
||||||
void increment_nonce(uint8_t *nonce)
|
static void increment_nonce(uint8_t *nonce)
|
||||||
{
|
{
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
for (i = 0; i < crypto_box_NONCEBYTES; ++i) {
|
for (i = 0; i < crypto_box_NONCEBYTES; ++i) {
|
||||||
|
@ -243,7 +243,7 @@ int handle_request(uint8_t *public_key, uint8_t *data, uint8_t *packet, uint16_t
|
||||||
/* Send a crypto handshake packet containing an encrypted secret nonce and session public key
|
/* Send a crypto handshake packet containing an encrypted secret nonce and session public key
|
||||||
to peer with connection_id and public_key
|
to peer with connection_id and public_key
|
||||||
the packet is encrypted with a random nonce which is sent in plain text with the packet */
|
the packet is encrypted with a random nonce which is sent in plain text with the packet */
|
||||||
int send_cryptohandshake(int connection_id, uint8_t *public_key, uint8_t *secret_nonce, uint8_t *session_key)
|
static int send_cryptohandshake(int connection_id, uint8_t *public_key, uint8_t *secret_nonce, uint8_t *session_key)
|
||||||
{
|
{
|
||||||
uint8_t temp_data[MAX_DATA_SIZE];
|
uint8_t temp_data[MAX_DATA_SIZE];
|
||||||
uint8_t temp[crypto_box_NONCEBYTES + crypto_box_PUBLICKEYBYTES];
|
uint8_t temp[crypto_box_NONCEBYTES + crypto_box_PUBLICKEYBYTES];
|
||||||
|
@ -266,7 +266,7 @@ int send_cryptohandshake(int connection_id, uint8_t *public_key, uint8_t *secret
|
||||||
/* Extract secret nonce, session public key and public_key from a packet(data) with length length
|
/* Extract secret nonce, session public key and public_key from a packet(data) with length length
|
||||||
return 1 if successful
|
return 1 if successful
|
||||||
return 0 if failure */
|
return 0 if failure */
|
||||||
int handle_cryptohandshake(uint8_t *public_key, uint8_t *secret_nonce,
|
static int handle_cryptohandshake(uint8_t *public_key, uint8_t *secret_nonce,
|
||||||
uint8_t *session_key, uint8_t *data, uint16_t length)
|
uint8_t *session_key, uint8_t *data, uint16_t length)
|
||||||
{
|
{
|
||||||
int pad = (- crypto_box_BOXZEROBYTES + crypto_box_ZEROBYTES);
|
int pad = (- crypto_box_BOXZEROBYTES + crypto_box_ZEROBYTES);
|
||||||
|
@ -295,7 +295,7 @@ int handle_cryptohandshake(uint8_t *public_key, uint8_t *secret_nonce,
|
||||||
/* get crypto connection id from public key of peer
|
/* get crypto connection id from public key of peer
|
||||||
return -1 if there are no connections like we are looking for
|
return -1 if there are no connections like we are looking for
|
||||||
return id if it found it */
|
return id if it found it */
|
||||||
int getcryptconnection_id(uint8_t *public_key)
|
static int getcryptconnection_id(uint8_t *public_key)
|
||||||
{
|
{
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
for (i = 0; i < MAX_CRYPTO_CONNECTIONS; ++i) {
|
for (i = 0; i < MAX_CRYPTO_CONNECTIONS; ++i) {
|
||||||
|
@ -465,7 +465,7 @@ void load_keys(uint8_t *keys)
|
||||||
adds an incoming connection to the incoming_connection list.
|
adds an incoming connection to the incoming_connection list.
|
||||||
returns 0 if successful
|
returns 0 if successful
|
||||||
returns 1 if failure */
|
returns 1 if failure */
|
||||||
int new_incoming(int id)
|
static int new_incoming(int id)
|
||||||
{
|
{
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
for (i = 0; i < MAX_INCOMING; ++i) {
|
for (i = 0; i < MAX_INCOMING; ++i) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user