blob: 367f2751918d20a9e9f8b69d3ff4e4f82a6f86b8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#include "core.h"
#include "crypto_onetimeauth.h"
#include "randombytes.h"
#include "runtime.h"
#include "utils.h"
static int initialized;
int
sodium_init(void)
{
if (initialized != 0) {
return 1;
}
sodium_runtime_get_cpu_features();
if (crypto_onetimeauth_pick_best_implementation() == NULL) {
return -1; /* LCOV_EXCL_LINE */
}
randombytes_stir();
_sodium_alloc_init();
initialized = 1;
return 0;
}
|