From 02cea6133600770c1d6978ec31675e40d21e6c8a Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 18 Apr 2013 14:27:20 +0200 Subject: [PATCH] Add sodium_init(), sodium_reinit() and sodium_shutdown() --- README.markdown | 13 +++++++++++++ src/libsodium/include/Makefile.am | 1 + src/libsodium/include/sodium.h | 5 +++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/README.markdown b/README.markdown index bd532f21..08230298 100644 --- a/README.markdown +++ b/README.markdown @@ -73,6 +73,19 @@ A convenience header includes everything you need to use the library: #include +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 diff --git a/src/libsodium/include/Makefile.am b/src/libsodium/include/Makefile.am index ab888c28..1536b4c5 100644 --- a/src/libsodium/include/Makefile.am +++ b/src/libsodium/include/Makefile.am @@ -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 \ diff --git a/src/libsodium/include/sodium.h b/src/libsodium/include/sodium.h index 1a0333d2..d0a93e87 100644 --- a/src/libsodium/include/sodium.h +++ b/src/libsodium/include/sodium.h @@ -1,7 +1,8 @@ -#ifndef sodium_H -#define sodium_H +#ifndef __SODIUM_H__ +#define __SODIUM_H__ +#include #include #include #include