From 30e8dda6cbea86bdee6d5dfe48514385d3b9f81b Mon Sep 17 00:00:00 2001 From: vnugent Date: Tue, 23 Apr 2024 14:48:05 -0400 Subject: refactor: Crypto dep redesign working on Windows --- src/internal/impl/openssl.c | 47 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/internal/impl/openssl.c (limited to 'src/internal/impl/openssl.c') diff --git a/src/internal/impl/openssl.c b/src/internal/impl/openssl.c new file mode 100644 index 0000000..d0cdb8c --- /dev/null +++ b/src/internal/impl/openssl.c @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2024 Vaughn Nugent +* +* Package: noscrypt +* File: impl/openssl.c +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public License +* as published by the Free Software Foundation; either version 2.1 +* of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public License +* along with noscrypt. If not, see http://www.gnu.org/licenses/. +*/ + + +/* Setup openssl */ + +#ifdef OPENSSL_CRYPTO_LIB + +#include + +#include "../../platform.h" +#include "../nc-util.h" + +/* +* EXPORT SUPPORTED FUNCTIONS AS MACROS +*/ +#define _IMPL_CHACHA20_CRYPT _mbed_chacha20_encrypt +#define _IMPL_CRYPTO_SHA256_HMAC _mbed_sha256_hmac +#define _IMPL_CRYPTO_SHA256_DIGEST _ossl_sha256_digest +#define _IMPL_CRYPTO_FIXED_TIME_COMPARE _mbed_fixed_time_compare +#define _IMPL_CRYPTO_SHA256_HKDF_EXPAND _mbed_sha256_hkdf_expand +#define _IMPL_CRYPTO_SHA256_HKDF_EXTRACT _mbed_sha256_hkdf_extract + +_IMPLSTB int _ossl_sha256_digest(const uint8_t* data, uint8_t* digest) +{ + +} + + +#endif /*!OPENSSL_CRYPTO_LIB */ \ No newline at end of file -- cgit