mirror of
https://github.com/jedisct1/libsodium.git
synced 2024-12-23 20:15:19 -07:00
Add sodium_init(), sodium_reinit() and sodium_shutdown()
This commit is contained in:
parent
232702ca83
commit
02cea61336
@ -73,6 +73,19 @@ A convenience header includes everything you need to use the library:
|
|||||||
|
|
||||||
#include <sodium.h>
|
#include <sodium.h>
|
||||||
|
|
||||||
|
Before doing anything else with the library, call:
|
||||||
|
|
||||||
|
sodium_init(NULL);
|
||||||
|
|
||||||
|
And if you need to release memory and other resources possibly
|
||||||
|
allocated by the library, call:
|
||||||
|
|
||||||
|
sodium_shutdown();
|
||||||
|
|
||||||
|
After fork()ing, call:
|
||||||
|
|
||||||
|
sodium_reinit();
|
||||||
|
|
||||||
Sodium also provides helper functions to generate random numbers,
|
Sodium also provides helper functions to generate random numbers,
|
||||||
leveraging `/dev/urandom` or `/dev/random` on *nix and the cryptographic
|
leveraging `/dev/urandom` or `/dev/random` on *nix and the cryptographic
|
||||||
service provider on Windows. The interface is similar to
|
service provider on Windows. The interface is similar to
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
SODIUM_EXPORT = \
|
SODIUM_EXPORT = \
|
||||||
sodium.h \
|
sodium.h \
|
||||||
|
sodium/core.h \
|
||||||
sodium/crypto_auth.h \
|
sodium/crypto_auth.h \
|
||||||
sodium/crypto_auth_hmacsha256.h \
|
sodium/crypto_auth_hmacsha256.h \
|
||||||
sodium/crypto_auth_hmacsha512256.h \
|
sodium/crypto_auth_hmacsha512256.h \
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
|
|
||||||
#ifndef sodium_H
|
#ifndef __SODIUM_H__
|
||||||
#define sodium_H
|
#define __SODIUM_H__
|
||||||
|
|
||||||
|
#include <sodium/core.h>
|
||||||
#include <sodium/crypto_auth.h>
|
#include <sodium/crypto_auth.h>
|
||||||
#include <sodium/crypto_auth_hmacsha256.h>
|
#include <sodium/crypto_auth_hmacsha256.h>
|
||||||
#include <sodium/crypto_auth_hmacsha512256.h>
|
#include <sodium/crypto_auth_hmacsha512256.h>
|
||||||
|
Loading…
Reference in New Issue
Block a user