sync code with last fixes and improvements from OpenBSD

This commit is contained in:
purplerain 2023-06-07 21:20:56 +00:00
parent 4b78db449c
commit bf0676207f
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
2406 changed files with 6353 additions and 434004 deletions

View file

@ -1,4 +1,4 @@
/* $OpenBSD: crypto_internal.h,v 1.4 2023/05/17 06:37:14 jsing Exp $ */
/* $OpenBSD: crypto_internal.h,v 1.6 2023/05/27 09:18:17 jsing Exp $ */
/*
* Copyright (c) 2023 Joel Sing <jsing@openbsd.org>
*
@ -32,7 +32,7 @@
*/
#ifndef HAVE_CRYPTO_LOAD_BE32TOH
static inline uint32_t
crypto_load_be32toh(const void *src)
crypto_load_be32toh(const uint8_t *src)
{
uint32_t v;
@ -49,7 +49,7 @@ crypto_load_be32toh(const void *src)
*/
#ifndef HAVE_CRYPTO_STORE_HTOBE32
static inline void
crypto_store_htobe32(void *dst, uint32_t v)
crypto_store_htobe32(uint8_t *dst, uint32_t v)
{
v = htobe32(v);
memcpy(dst, &v, sizeof(v));
@ -63,7 +63,7 @@ crypto_store_htobe32(void *dst, uint32_t v)
*/
#ifndef HAVE_CRYPTO_LOAD_BE64TOH
static inline uint64_t
crypto_load_be64toh(const void *src)
crypto_load_be64toh(const uint8_t *src)
{
uint64_t v;
@ -80,7 +80,7 @@ crypto_load_be64toh(const void *src)
*/
#ifndef HAVE_CRYPTO_STORE_HTOBE64
static inline void
crypto_store_htobe64(void *dst, uint64_t v)
crypto_store_htobe64(uint8_t *dst, uint64_t v)
{
v = htobe64(v);
memcpy(dst, &v, sizeof(v));