Sha256: ed3d7022b06b5a5d54ab950d4af154ad2ede2a1ba5d9e16dc4021ce8b3fa48da

Contents?: true

Size: 456 Bytes

Versions: 6

Compression:

Stored size: 456 Bytes

Contents

#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;
}

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rbnacl-libsodium-1.0.5 vendor/libsodium/src/libsodium/sodium/core.c
rbnacl-libsodium-1.0.4 vendor/libsodium/src/libsodium/sodium/core.c
rbnacl-libsodium-1.0.3 vendor/libsodium/src/libsodium/sodium/core.c
rbnacl-libsodium-1.0.2 vendor/libsodium/src/libsodium/sodium/core.c
rbnacl-libsodium-1.0.1 vendor/libsodium/src/libsodium/sodium/core.c
rbnacl-libsodium-1.0.0 vendor/libsodium/src/libsodium/sodium/core.c