Add sodium_init(), sodium_reinit() and sodium_shutdown()

This commit is contained in:
Frank Denis
2013-04-21 17:32:03 -07:00
parent 232702ca83
commit 02cea61336
3 changed files with 17 additions and 2 deletions
+13
View File
@@ -73,6 +73,19 @@ A convenience header includes everything you need to use the library:
#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,
leveraging `/dev/urandom` or `/dev/random` on *nix and the cryptographic
service provider on Windows. The interface is similar to
+1
View File
@@ -1,6 +1,7 @@
SODIUM_EXPORT = \
sodium.h \
sodium/core.h \
sodium/crypto_auth.h \
sodium/crypto_auth_hmacsha256.h \
sodium/crypto_auth_hmacsha512256.h \
+3 -2
View File
@@ -1,7 +1,8 @@
#ifndef sodium_H
#define sodium_H
#ifndef __SODIUM_H__
#define __SODIUM_H__
#include <sodium/core.h>
#include <sodium/crypto_auth.h>
#include <sodium/crypto_auth_hmacsha256.h>
#include <sodium/crypto_auth_hmacsha512256.h>