diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-10-23 08:22:44 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-10-25 08:38:45 +0200 |
commit | b3169c2a6a01cc0555181f61b5254dd2c1f1c310 (patch) | |
tree | f84d67c9d17b2625481513fa6dc85929fdb08442 /freebsd/sys/crypto | |
parent | Update rtems_waf (diff) | |
download | rtems-libbsd-b3169c2a6a01cc0555181f61b5254dd2c1f1c310.tar.bz2 |
Update to FreeBSD head 2018-10-23
Git mirror commit 59f44d20be3f99d181ca742e636d45fc39ec982b.
This commit updates OpenSSL to version 1.1.1. This required an update
of racoon which uses some internal stuff from OpenSSL and seems to be
mostly unmaintained, e.g. there is update in the FreeBSD ports to cope
with OpenSSL 1.1.1.
Update #3472.
Diffstat (limited to 'freebsd/sys/crypto')
-rw-r--r-- | freebsd/sys/crypto/chacha20/_chacha.h | 15 | ||||
-rw-r--r-- | freebsd/sys/crypto/chacha20/chacha.c | 2 | ||||
-rw-r--r-- | freebsd/sys/crypto/chacha20/chacha.h | 11 |
3 files changed, 21 insertions, 7 deletions
diff --git a/freebsd/sys/crypto/chacha20/_chacha.h b/freebsd/sys/crypto/chacha20/_chacha.h new file mode 100644 index 00000000..20f8bb9a --- /dev/null +++ b/freebsd/sys/crypto/chacha20/_chacha.h @@ -0,0 +1,15 @@ +/* $FreeBSD$ */ +/* + * Public domain. + */ + +#ifndef _CHACHA_H +#define _CHACHA_H + +#include <sys/types.h> + +struct chacha_ctx { + u_int input[16]; +}; + +#endif diff --git a/freebsd/sys/crypto/chacha20/chacha.c b/freebsd/sys/crypto/chacha20/chacha.c index 3ce5310a..154726c2 100644 --- a/freebsd/sys/crypto/chacha20/chacha.c +++ b/freebsd/sys/crypto/chacha20/chacha.c @@ -130,8 +130,10 @@ chacha_encrypt_bytes(chacha_ctx *x,const u8 *m,u8 *c,u_int bytes) for (;;) { if (bytes < 64) { +#ifndef KEYSTREAM_ONLY for (i = 0;i < bytes;++i) tmp[i] = m[i]; m = tmp; +#endif ctarget = c; c = tmp; } diff --git a/freebsd/sys/crypto/chacha20/chacha.h b/freebsd/sys/crypto/chacha20/chacha.h index e67cc812..73548331 100644 --- a/freebsd/sys/crypto/chacha20/chacha.h +++ b/freebsd/sys/crypto/chacha20/chacha.h @@ -12,10 +12,7 @@ Public domain. #define CHACHA_H #include <sys/types.h> - -struct chacha_ctx { - u_int input[16]; -}; +#include <crypto/chacha20/_chacha.h> #define CHACHA_MINKEYLEN 16 #define CHACHA_NONCELEN 8 @@ -23,10 +20,10 @@ struct chacha_ctx { #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); |