Squashed 'external/toxcore/c-toxcore/' changes from 640e6cace..e58eb27a8
e58eb27a8 fix(toxav): remove extra copy of video frame on encode Tested and works, but there might be alignment issues and other stuff. 206ea3530 refactor: Explicitly pass dependencies to constructors. 7cefa93cf fix(toxencryptsave): Wipe salt and passkey after usage. 7c3be2342 refactor: Add file/line to tox-bootstrapd logging. f84e8cdce refactor: Move loglogdata out of network.c. 390f7db06 refactor: Move random and memory OS-specifics to `os_*` files. REVERT: 640e6cace fix(toxav): remove extra copy of video frame on encode Tested and works, but there might be alignment issues and other stuff. git-subtree-dir: external/toxcore/c-toxcore git-subtree-split: e58eb27a84f9fa0cd996868e079f39e90a5c04b6
This commit is contained in:
@@ -8,12 +8,13 @@
|
||||
|
||||
#include "crypto_core.h"
|
||||
#include "test_util.hh"
|
||||
#include "tox_random_impl.h"
|
||||
|
||||
struct Random_Class {
|
||||
static Random_Funcs const vtable;
|
||||
Random const self;
|
||||
static Tox_Random_Funcs const vtable;
|
||||
Tox_Random const self;
|
||||
|
||||
operator Random const *() const { return &self; }
|
||||
operator Tox_Random const *() const { return &self; }
|
||||
|
||||
Random_Class(Random_Class const &) = default;
|
||||
Random_Class()
|
||||
@@ -22,8 +23,8 @@ struct Random_Class {
|
||||
}
|
||||
|
||||
virtual ~Random_Class();
|
||||
virtual crypto_random_bytes_cb random_bytes = 0;
|
||||
virtual crypto_random_uniform_cb random_uniform = 0;
|
||||
virtual tox_random_bytes_cb random_bytes = 0;
|
||||
virtual tox_random_uniform_cb random_uniform = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -35,7 +36,7 @@ struct Random_Class {
|
||||
class Test_Random : public Random_Class {
|
||||
std::minstd_rand lcg;
|
||||
|
||||
void random_bytes(void *obj, uint8_t *bytes, size_t length) override;
|
||||
void random_bytes(void *obj, uint8_t *bytes, uint32_t length) override;
|
||||
uint32_t random_uniform(void *obj, uint32_t upper_bound) override;
|
||||
};
|
||||
|
||||
@@ -83,6 +84,6 @@ inline bool operator==(PublicKey::Base const &pk1, PublicKey const &pk2)
|
||||
|
||||
std::ostream &operator<<(std::ostream &out, PublicKey const &pk);
|
||||
|
||||
PublicKey random_pk(const Random *rng);
|
||||
PublicKey random_pk(const Tox_Random *rng);
|
||||
|
||||
#endif // C_TOXCORE_TOXCORE_CRYPTO_CORE_TEST_UTIL_H
|
||||
|
||||
Reference in New Issue
Block a user