mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
crypto: Refactor (P)RNG functionality into new crypto_rand module.
* ADD new /src/common/crypto_rand.[ch] module. * ADD new /src/common/crypto_util.[ch] module (contains the memwipe() function, since all crypto_* modules need this). * FIXES part of #24658: https://bugs.torproject.org/24658
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
/* Tor: Instead of calling OpenSSL's CSPRNG directly, call the wrapper. */
|
||||
#include "crypto.h"
|
||||
#include "crypto_rand.h"
|
||||
|
||||
static void
|
||||
ED25519_FN(ed25519_randombytes_unsafe) (void *p, size_t len)
|
||||
|
||||
@@ -40,6 +40,8 @@
|
||||
#include "ed25519-randombytes.h"
|
||||
#include "ed25519-hash.h"
|
||||
|
||||
#include "crypto_util.h"
|
||||
|
||||
typedef unsigned char ed25519_signature[64];
|
||||
typedef unsigned char ed25519_public_key[32];
|
||||
typedef unsigned char ed25519_secret_key[32];
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include "ed25519_ref10.h"
|
||||
|
||||
#include <string.h>
|
||||
#include "crypto.h"
|
||||
#include "crypto_util.h"
|
||||
|
||||
static void
|
||||
ed25519_ref10_gettweak(unsigned char *out, const unsigned char *param)
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
#include "crypto_hash_sha512.h"
|
||||
#include "ge.h"
|
||||
|
||||
#include "crypto_rand.h"
|
||||
#include "crypto_util.h"
|
||||
|
||||
int
|
||||
crypto_sign_seckey(unsigned char *sk)
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "keccak-tiny.h"
|
||||
|
||||
#include <string.h>
|
||||
#include "crypto.h"
|
||||
#include "crypto_util.h"
|
||||
#include "byteorder.h"
|
||||
|
||||
/******** Endianness conversion helpers ********/
|
||||
|
||||
Reference in New Issue
Block a user