Embedded chacha: Distinguish via dedicated macro

Set embedding expectations via CHACHA_EMBED macro rather than _KERNEL
definition.

No functional change.

Sponsored by:	Dell EMC Isilon
This commit is contained in:
Conrad Meyer 2018-10-20 22:14:29 +00:00
parent addfc6364f
commit 243e09430a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=339499
2 changed files with 4 additions and 3 deletions

View File

@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
#include "libc_private.h"
#include "un-namespace.h"
#define CHACHA_EMBED
#define KEYSTREAM_ONLY
#include "chacha.c"

View File

@ -20,10 +20,10 @@ Public domain.
#define CHACHA_STATELEN (CHACHA_NONCELEN+CHACHA_CTRLEN)
#define CHACHA_BLOCKLEN 64
#ifdef _KERNEL
#define LOCAL
#else
#ifdef CHACHA_EMBED
#define LOCAL static
#else
#define LOCAL
#endif
LOCAL void chacha_keysetup(struct chacha_ctx *x, const u_char *k, u_int kbits);