Squashed 'external/toxcore/c-toxcore/' changes from f1df709b87..8f0d505f9a
8f0d505f9a feat: add ngc events 9b8216e70c refactor: Make event dispatch ordered by receive time. 814c12a6f4 cleanup: Add dynamically derived array sizes to the API. 226b23be12 cleanup: Add explicit array sizes to toxencryptsave. ef33cb4de0 cleanup: Add Toxav alias for ToxAV. 1da723b34d cleanup: Make Tox_Options a typedef. b148a2afff chore: Simplify msvc build using vcpkg. 5cac6d7eb1 cleanup: Move `tox_get_system` out of the public API. c9ca4007e3 refactor: Align group message sending with other send functions. 6c6c0b1b1b cleanup: Make setters take non-const `Tox *`. a76f758d70 cleanup: Mark arrays in the tox API as `[]` instead of `*`. baf6d1f6cf cleanup: Make array params in toxav `[]` instead of `*`. 79f55bd06a cleanup: Put the size of fixed arrays into the API types. 1e73698db2 cleanup: Add typedefs for public API int identifiers. cac074c57f chore: Add fetch-sha256 script to update bootstrap node hash. 32576656bb Make the comment capitalization uniform aff4dda17c Spellcheck tox-bootstrapd 40b5fbbe9d chore: Remove settings.yml in favour of hs-github-tools. ebafd51be7 chore: Use GPL license with https. 0e42752f0f cleanup: Move all vptr-to-ptr casts to the beginning of a function. 5407384211 cleanup: Use github actions matrix to simplify CI. 82d8265688 fix: Use QueryPerformanceCounter on windows for monotonic time. 1224e656e3 chore: Add `net_(new|kill)_strerror` to cppcheck's allocators. 6a90ddfe4e cleanup: Run clang-tidy on headers, as well. bd930cc80a cleanup: Make TCP connection failures a warning instead of error. fad6e4e173 cleanup: Make all .c files include the headers they need. ef4897a898 cleanup: Upgrade to clang-tidy-17 and fix some warnings. REVERT: f1df709b87 feat: add ngc events REVERT: 1b6c907235 refactor: Make event dispatch ordered by receive time. git-subtree-dir: external/toxcore/c-toxcore git-subtree-split: 8f0d505f9a598cc41c682178e1589bcc01efe9cb
This commit is contained in:
@ -186,8 +186,8 @@ typedef enum Tox_Err_Decryption {
|
||||
*
|
||||
* @return true on success.
|
||||
*/
|
||||
bool tox_pass_encrypt(const uint8_t *plaintext, size_t plaintext_len, const uint8_t *passphrase, size_t passphrase_len,
|
||||
uint8_t *ciphertext, Tox_Err_Encryption *error);
|
||||
bool tox_pass_encrypt(const uint8_t plaintext[], size_t plaintext_len, const uint8_t passphrase[], size_t passphrase_len,
|
||||
uint8_t ciphertext[/*! plaintext_len + TOX_PASS_ENCRYPTION_EXTRA_LENGTH */], Tox_Err_Encryption *error);
|
||||
|
||||
/**
|
||||
* Decrypts the given data with the given passphrase.
|
||||
@ -203,8 +203,8 @@ bool tox_pass_encrypt(const uint8_t *plaintext, size_t plaintext_len, const uint
|
||||
*
|
||||
* @return true on success.
|
||||
*/
|
||||
bool tox_pass_decrypt(const uint8_t *ciphertext, size_t ciphertext_len, const uint8_t *passphrase,
|
||||
size_t passphrase_len, uint8_t *plaintext, Tox_Err_Decryption *error);
|
||||
bool tox_pass_decrypt(const uint8_t ciphertext[], size_t ciphertext_len, const uint8_t passphrase[],
|
||||
size_t passphrase_len, uint8_t plaintext[/*! ciphertext_len - TOX_PASS_ENCRYPTION_EXTRA_LENGTH */], Tox_Err_Decryption *error);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
@ -255,7 +255,8 @@ void tox_pass_key_free(Tox_Pass_Key *key);
|
||||
*
|
||||
* @return new symmetric key on success, NULL on failure.
|
||||
*/
|
||||
Tox_Pass_Key *tox_pass_key_derive(const uint8_t *passphrase, size_t passphrase_len,
|
||||
Tox_Pass_Key *tox_pass_key_derive(
|
||||
const uint8_t passphrase[], size_t passphrase_len,
|
||||
Tox_Err_Key_Derivation *error);
|
||||
|
||||
/**
|
||||
@ -267,8 +268,9 @@ Tox_Pass_Key *tox_pass_key_derive(const uint8_t *passphrase, size_t passphrase_l
|
||||
*
|
||||
* @return new symmetric key on success, NULL on failure.
|
||||
*/
|
||||
Tox_Pass_Key *tox_pass_key_derive_with_salt(const uint8_t *passphrase, size_t passphrase_len,
|
||||
const uint8_t *salt, Tox_Err_Key_Derivation *error);
|
||||
Tox_Pass_Key *tox_pass_key_derive_with_salt(
|
||||
const uint8_t passphrase[], size_t passphrase_len,
|
||||
const uint8_t salt[TOX_PASS_SALT_LENGTH], Tox_Err_Key_Derivation *error);
|
||||
|
||||
/**
|
||||
* Encrypt a plain text with a key produced by tox_pass_key_derive or tox_pass_key_derive_with_salt.
|
||||
@ -282,8 +284,8 @@ Tox_Pass_Key *tox_pass_key_derive_with_salt(const uint8_t *passphrase, size_t pa
|
||||
*
|
||||
* @return true on success.
|
||||
*/
|
||||
bool tox_pass_key_encrypt(const Tox_Pass_Key *key, const uint8_t *plaintext, size_t plaintext_len,
|
||||
uint8_t *ciphertext, Tox_Err_Encryption *error);
|
||||
bool tox_pass_key_encrypt(const Tox_Pass_Key *key, const uint8_t plaintext[], size_t plaintext_len,
|
||||
uint8_t ciphertext[/*! plaintext_len + TOX_PASS_ENCRYPTION_EXTRA_LENGTH */], Tox_Err_Encryption *error);
|
||||
|
||||
/**
|
||||
* This is the inverse of tox_pass_key_encrypt, also using only keys produced by
|
||||
@ -295,8 +297,8 @@ bool tox_pass_key_encrypt(const Tox_Pass_Key *key, const uint8_t *plaintext, siz
|
||||
*
|
||||
* @return true on success.
|
||||
*/
|
||||
bool tox_pass_key_decrypt(const Tox_Pass_Key *key, const uint8_t *ciphertext, size_t ciphertext_len,
|
||||
uint8_t *plaintext, Tox_Err_Decryption *error);
|
||||
bool tox_pass_key_decrypt(const Tox_Pass_Key *key, const uint8_t ciphertext[], size_t ciphertext_len,
|
||||
uint8_t plaintext[/*! ciphertext_len - TOX_PASS_ENCRYPTION_EXTRA_LENGTH */], Tox_Err_Decryption *error);
|
||||
|
||||
typedef enum Tox_Err_Get_Salt {
|
||||
|
||||
@ -338,7 +340,9 @@ typedef enum Tox_Err_Get_Salt {
|
||||
*
|
||||
* @return true on success.
|
||||
*/
|
||||
bool tox_get_salt(const uint8_t *ciphertext, uint8_t *salt, Tox_Err_Get_Salt *error);
|
||||
bool tox_get_salt(
|
||||
const uint8_t ciphertext[TOX_PASS_ENCRYPTION_EXTRA_LENGTH],
|
||||
uint8_t salt[TOX_PASS_SALT_LENGTH], Tox_Err_Get_Salt *error);
|
||||
|
||||
/**
|
||||
* Determines whether or not the given data is encrypted by this module.
|
||||
@ -354,7 +358,7 @@ bool tox_get_salt(const uint8_t *ciphertext, uint8_t *salt, Tox_Err_Get_Salt *er
|
||||
*
|
||||
* @return true if the data is encrypted by this module.
|
||||
*/
|
||||
bool tox_is_data_encrypted(const uint8_t *data);
|
||||
bool tox_is_data_encrypted(const uint8_t data[TOX_PASS_ENCRYPTION_EXTRA_LENGTH]);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
Reference in New Issue
Block a user