Bring in compatibility glue for libsodium

The idea is untouched upstream sources live in sys/contrib/libsodium.

sys/crypto/libsodium are support routines or compatibility headers to allow
building unmodified upstream code.

This is not yet integrated into the build system, so no functional change.
This commit is contained in:
Conrad Meyer 2018-08-17 00:27:56 +00:00
parent 0ac341f145
commit f36e41e20b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=337938
8 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,3 @@
/* This file is in the public domain */
/* $FreeBSD$ */
#include <sys/limits.h>

View File

@ -0,0 +1,13 @@
/* This file is in the public domain. */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/libkern.h>
#include <sodium/randombytes.h>
void
randombytes_buf(void *buf, size_t size)
{
arc4random_buf(buf, size);
}

View File

@ -0,0 +1,3 @@
/* This file is in the public domain */
/* $FreeBSD$ */
#include <sys/types.h>

View File

@ -0,0 +1,3 @@
/* This file is in the public domain */
/* $FreeBSD$ */
#include <sys/stdint.h>

View File

@ -0,0 +1,2 @@
/* This file is in the public domain */
/* $FreeBSD$ */

View File

@ -0,0 +1,2 @@
/* This file is in the public domain */
/* $FreeBSD$ */

View File

@ -0,0 +1,2 @@
/* This file is in the public domain */
/* $FreeBSD$ */

View File

@ -0,0 +1,14 @@
/* This file is in the public domain. */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/systm.h>
#include <sodium/utils.h>
void
sodium_memzero(void *b, size_t n)
{
explicit_bzero(b, n);
}