summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/api_encryption.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-04-10 12:01:55 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-04-10 12:01:55 +0000
commit78f97fe198286a120370f6c56921205191f986b0 (patch)
tree96629174df34f22697c5eaad7cfe102f8f7fd5eb /protocols/Tox/src/api_encryption.cpp
parentbff791f9bd1828c66e1462a4a3f86a800b58ad13 (diff)
Tox:
- switched to new api - updated tox core git-svn-id: http://svn.miranda-ng.org/main/trunk@12726 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/api_encryption.cpp')
-rw-r--r--protocols/Tox/src/api_encryption.cpp82
1 files changed, 6 insertions, 76 deletions
diff --git a/protocols/Tox/src/api_encryption.cpp b/protocols/Tox/src/api_encryption.cpp
index 7125743096..f5fd2634e3 100644
--- a/protocols/Tox/src/api_encryption.cpp
+++ b/protocols/Tox/src/api_encryption.cpp
@@ -2,87 +2,17 @@
/* ENCRYPTION FUNCTIONS */
-int tox_pass_encryption_extra_length()
+bool tox_pass_decrypt(const uint8_t *data, size_t length, uint8_t *passphrase, size_t pplength, uint8_t *out, TOX_ERR_DECRYPTION *error)
{
- return CreateFunction<int(*)()>(__FUNCTION__)();
+ return CreateFunction<bool(*)(const uint8_t *, size_t, uint8_t*, size_t, uint8_t*, TOX_ERR_DECRYPTION*)>(__FUNCTION__)(data, length, passphrase, pplength, out, error);
}
-int tox_pass_key_length()
+bool tox_pass_encrypt(const uint8_t *data, size_t data_len, uint8_t *passphrase, size_t pplength, uint8_t *out, TOX_ERR_ENCRYPTION *error)
{
- return CreateFunction<int(*)()>(__FUNCTION__)();
+ return CreateFunction<bool(*)(const uint8_t *, size_t, uint8_t*, size_t, uint8_t*, TOX_ERR_ENCRYPTION*)>(__FUNCTION__)(data, data_len, passphrase, pplength, out, error);
}
-int tox_pass_salt_length()
+bool tox_is_data_encrypted(const uint8_t *data)
{
- return CreateFunction<int(*)()>(__FUNCTION__)();
-}
-
-uint32_t tox_encrypted_size(const Tox *tox)
-{
- return CreateFunction<int(*)(const Tox*)>(__FUNCTION__)(tox);
-}
-
-int tox_pass_encrypt(const uint8_t *data, uint32_t data_len, uint8_t *passphrase, uint32_t pplength, uint8_t *out)
-{
- return CreateFunction<int(*)(const uint8_t*, uint32_t, uint8_t*, uint32_t, uint8_t*)>(__FUNCTION__)(data, data_len, passphrase, pplength, out);
-}
-
-int tox_encrypted_save(const Tox *tox, uint8_t *data, uint8_t *passphrase, uint32_t pplength)
-{
- return CreateFunction<int(*)(const Tox*, uint8_t*, uint8_t*, uint32_t)>(__FUNCTION__)(tox, data, passphrase, pplength);
-}
-
-int tox_pass_decrypt(const uint8_t *data, uint32_t length, uint8_t *passphrase, uint32_t pplength, uint8_t *out)
-{
- return CreateFunction<int(*)(const uint8_t*, uint32_t, uint8_t*, uint32_t, uint8_t*)>(__FUNCTION__)(data, length, passphrase, pplength, out);
-}
-
-int tox_encrypted_load(Tox *tox, const uint8_t *data, uint32_t length, uint8_t *passphrase, uint32_t pplength)
-{
- return CreateFunction<int(*)(Tox*, const uint8_t*, uint32_t, uint8_t*, uint32_t)>(__FUNCTION__)(tox, data, length, passphrase, pplength);
-}
-
-int tox_derive_key_from_pass(uint8_t *passphrase, uint32_t pplength, uint8_t *out_key)
-{
- return CreateFunction<int(*)(uint8_t*, uint32_t, uint8_t*)>(__FUNCTION__)(passphrase, pplength, out_key);
-}
-
-int tox_derive_key_with_salt(uint8_t *passphrase, uint32_t pplength, uint8_t *salt, uint8_t *out_key)
-{
- return CreateFunction<int(*)(uint8_t*, uint32_t, uint8_t*, uint8_t*)>(__FUNCTION__)(passphrase, pplength, salt, out_key);
-}
-
-int tox_get_salt(uint8_t *data, uint8_t *salt)
-{
- return CreateFunction<int(*)(uint8_t*, uint8_t*)>(__FUNCTION__)(data, salt);
-}
-
-int tox_pass_key_encrypt(const uint8_t *data, uint32_t data_len, const uint8_t *key, uint8_t *out)
-{
- return CreateFunction<int(*)(const uint8_t*, uint32_t, const uint8_t*, uint8_t*)>(__FUNCTION__)(data, data_len, key, out);
-}
-
-int tox_encrypted_key_save(const Tox *tox, uint8_t *data, uint8_t *key)
-{
- return CreateFunction<int(*)(const Tox*, uint8_t*, uint8_t*)>(__FUNCTION__)(tox, data, key);
-}
-
-int tox_pass_key_decrypt(const uint8_t *data, uint32_t length, const uint8_t *key, uint8_t *out)
-{
- return CreateFunction<int(*)(const uint8_t*, uint32_t, const uint8_t*, uint8_t*)>(__FUNCTION__)(data, length, key, out);
-}
-
-int tox_encrypted_key_load(Tox *tox, const uint8_t *data, uint32_t length, uint8_t *key)
-{
- return CreateFunction<int(*)(Tox*, const uint8_t*, uint32_t, uint8_t*)>(__FUNCTION__)(tox, data, length, key);
-}
-
-int tox_is_data_encrypted(const uint8_t *data)
-{
- return CreateFunction<int(*)(const uint8_t*)>(__FUNCTION__)(data);
-}
-
-int tox_is_save_encrypted(const uint8_t *data)
-{
- return CreateFunction<int(*)(const uint8_t*)>(__FUNCTION__)(data);
+ return CreateFunction<bool(*)(const uint8_t*)>(__FUNCTION__)(data);
} \ No newline at end of file