Update code to v1.0.14 (10)

This commit is contained in:
Caten
2024-02-29 19:35:00 +08:00
parent c2ee3b694c
commit a956d26f6d
3188 changed files with 2317293 additions and 146 deletions

View File

@@ -0,0 +1,75 @@
void _mon_putc(char c);
#define BAUD_GEN(sysclk, baud) ((sysclk / (16 * baud)) - 1)
#ifdef MICROCHIP_PIC32
#if defined (__32MZ2048ECH144__) || defined(__32MZ2048ECM144__) || defined(__32MZ2048EFM144__)
/* Code generated from Harmony example then exported using Window -> PIC32 Memory View -> Configuration Bits into system_config.h */
#define SYS_CLK_FREQ 200000000ul
#define SYS_CLK_BUS_PERIPHERAL_2 100000000ul
// DEVCFG3
#pragma config FMIIEN = ON // Ethernet RMII/MII Enable (MII Enabled)
#pragma config FETHIO = ON // Ethernet I/O Pin Select (Default Ethernet I/O)
#pragma config PGL1WAY = ON // Permission Group Lock One Way Configuration (Allow only one reconfiguration)
#pragma config PMDL1WAY = ON // Peripheral Module Disable Configuration (Allow only one reconfiguration)
#pragma config IOL1WAY = ON // Peripheral Pin Select Configuration (Allow only one reconfiguration)
#pragma config FUSBIDIO = ON // USB USBID Selection (Controlled by the USB Module)
// DEVCFG2
#pragma config FPLLIDIV = DIV_1 // System PLL Input Divider (1x Divider)
#pragma config FPLLRNG = RANGE_5_10_MHZ // System PLL Input Range (5-10 MHz Input)
#pragma config FPLLICLK = PLL_FRC // System PLL Input Clock Selection (FRC is input to the System PLL)
#pragma config FPLLMULT = MUL_50 // System PLL Multiplier (PLL Multiply by 50)
#pragma config FPLLODIV = DIV_2 // System PLL Output Clock Divider (2x Divider)
#pragma config UPLLFSEL = FREQ_24MHZ // USB PLL Input Frequency Selection (USB PLL input is 24 MHz)
// DEVCFG1
#pragma config FNOSC = SPLL // Oscillator Selection Bits (System PLL)
#pragma config DMTINTV = WIN_127_128 // DMT Count Window Interval (Window/Interval value is 127/128 counter value)
#pragma config FSOSCEN = OFF // Secondary Oscillator Enable (Disable SOSC)
#pragma config IESO = OFF // Internal/External Switch Over (Disabled)
#pragma config POSCMOD = OFF // Primary Oscillator Configuration (Primary osc disabled)
#pragma config OSCIOFNC = OFF // CLKO Output Signal Active on the OSCO Pin (Disabled)
#pragma config FCKSM = CSECME // Clock Switching and Monitor Selection (Clock Switch Enabled, FSCM Enabled)
#pragma config WDTPS = PS1048576 // Watchdog Timer Postscaler (1:1048576)
#pragma config WDTSPGM = STOP // Watchdog Timer Stop During Flash Programming (WDT stops during Flash programming)
#pragma config WINDIS = NORMAL // Watchdog Timer Window Mode (Watchdog Timer is in non-Window mode)
#pragma config FWDTEN = OFF // Watchdog Timer Enable (WDT Disabled)
#pragma config FWDTWINSZ = WINSZ_25 // Watchdog Timer Window Size (Window size is 25%)
#pragma config DMTCNT = DMT31 // Deadman Timer Count Selection (2^31 (2147483648))
#pragma config FDMTEN = OFF // Deadman Timer Enable (Deadman Timer is disabled)
// DEVCFG0
#pragma config ICESEL = ICS_PGx2 // ICE/ICD Comm Channel Select (Communicate on PGEC2/PGED2)
// DEVCP0
#pragma config CP = OFF // Code Protect (Protection Disabled)
#include <xc.h>
#endif
#endif
static void init_serial(unsigned int sysClk) {
#ifdef MICROCHIP_PIC32
#if defined (__32MZ2048ECH144__) || defined(__32MZ2048ECM144__) || defined(__32MZ2048EFM144__)
/* This is for pin B14 which is connected to the USB to UART connector J11 located under Ethernet connector */
/* Setup UART2 */
#ifdef SYS_CLK_BUS_PERIPHERAL_2
U2BRG = BAUD_GEN(SYS_CLK_BUS_PERIPHERAL_2, 115200);
#else
if (sysClk > 100000000)
sysClk /= 2;
U2BRG = BAUD_GEN(sysClk, 115200);
#endif
ANSELBCLR = 0x4000;
ANSELGCLR = 0x0040;
RPB14R = 0x02;
U2RXR = 0x01;
U2MODE = 0x8000;
U2STA = 0x400;
#endif
#endif
(void)sysClk;
}

79
android/extern/wolfssl/mcapi/README vendored Normal file
View File

@@ -0,0 +1,79 @@
WolfSSL MPLAB X Project Files
This directory contains project files for the Microchip MPLAB X IDE. These
projects have been set up to use the Microchip PIC32 Ethernet Starter Kit
and the Microchip XC32 compiler, and have been created specifically to test
the Microchip-specific WolfCrypt API with compression support. For MPLAB X
projects that don't use compression and are generic to the WolfCrypt API,
please see the <wolfssl_root>/mplabx directory.
In order to generate the necessary auto-generated MPLAB X files, make sure
to import the cyassl.X and zlib.X projects into your MPLAB X workspace before
trying to build either the WolfCrypt test or benchmark applications. This will
correctly set up the respective project's Makefiles.
Included Project Files
-----------------------
1. wolfSSL library (wolfssl.X)
This project builds a static wolfSSL library. Prior to building this
project, uncomment the MICROCHIP_PIC32 define located in:
<wolfssl_root>/wolfssl/wolfcrypt/settings.h
After this project has been built, the compiled library will be located
at:
<wolfssl_root>/mplabx/wolfssl.X/dist/default/production/wolfssl.X.a
Note that this project includes the zlib header location in the project's
include paths. This is because this project has been set up to be compiled
with zlib support to enable compression and decompression features.
2. wolfCrypt Test App (wolfcrypt_test.X)
This project tests the wolfCrypt cryptography modules. It is generally
a good idea to run this first on an embedded system after compiling
wolfSSL in order to verify all underlying crypto is working correctly.
3. wolfCrypt Benchmark App (wolfcrypt_benchmark.X)
This project builds the wolfCrypt benchmark application. If the wolfSSL
project (wolfssl.X) has been compiled with libz support and is being
used to build this project, the zlib.X project will need to added to
the "Libraries" folder under the wolfcrypt_benchmark.X project before
it will compile successfully.
4. wolfCrypt MCAPI Test App (wolfcrypt_mcapi.X)
This project tests the Microchip crypto API layer. The Microchip crypto
layer is located under the <wolfssl_root>/mcapi directory.
5. zlib library (zlib.X)
This project builds the zlib library for use in the wolfcrypt_test.X
and wolfcrypt_mcapi.X projects. This project expects the zlib sources
to be located under the wolfSSL root directory. It is set up to work
with the latest zlib, and looks for sources under:
<wolfssl_root>/zlib
PIC32MX/PIC32MZ
---------------
The projects are set for PIC32MX by default. For PIC32MZ, change project
properties->Devices and add "WOLFSSL_MICROCHIP_PIC32M" to
XC32-gcc->Preprocessing and messages-> Preprocessor macros.
MIPS16 and MIPS32 Support
-------------------------
These projects support both MIPS16 and MIPS32 instruction sets. Switching
between these two instruction sets can be done in each project's properties
settings by checking the "Generate 16-bit code" checkbox.
Support
-------
Please send questions or comments to support@wolfssl.com

800
android/extern/wolfssl/mcapi/crypto.c vendored Normal file
View File

@@ -0,0 +1,800 @@
/* crypto.c
*
* Copyright (C) 2006-2022 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
/* Implements Microchip CRYPTO API layer */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <wolfssl/wolfcrypt/settings.h>
#ifdef MICROCHIP_MPLAB_HARMONY
#include "system_config.h"
#include "crypto/crypto.h"
#else
#include "crypto.h"
#endif
#include <wolfssl/wolfcrypt/md5.h>
#include <wolfssl/wolfcrypt/sha.h>
#include <wolfssl/wolfcrypt/sha256.h>
#include <wolfssl/wolfcrypt/sha512.h>
#include <wolfssl/wolfcrypt/hmac.h>
#include <wolfssl/wolfcrypt/compress.h>
#include <wolfssl/wolfcrypt/random.h>
#include <wolfssl/wolfcrypt/des3.h>
#include <wolfssl/wolfcrypt/aes.h>
#include <wolfssl/wolfcrypt/rsa.h>
#include <wolfssl/wolfcrypt/ecc.h>
#include <wolfssl/wolfcrypt/error-crypt.h>
#ifndef NO_MD5
/* Initialize MD5 */
int CRYPT_MD5_Initialize(CRYPT_MD5_CTX* md5)
{
typedef char md5_test[sizeof(CRYPT_MD5_CTX) >= sizeof(Md5) ? 1 : -1];
(void)sizeof(md5_test);
if (md5 == NULL)
return BAD_FUNC_ARG;
return wc_InitMd5((Md5*)md5);
}
int CRYPT_MD5_DataSizeSet(CRYPT_MD5_CTX* md5, unsigned int sz)
{
if (md5 == NULL)
return BAD_FUNC_ARG;
#ifdef WOLFSSL_PIC32MZ_HASH
wc_Md5SizeSet((Md5*)md5, sz);
#else
(void)sz;
#endif
return 0;
}
/* Add data to MD5 */
int CRYPT_MD5_DataAdd(CRYPT_MD5_CTX* md5, const unsigned char* input,
unsigned int sz)
{
if (md5 == NULL || input == NULL)
return BAD_FUNC_ARG;
return wc_Md5Update((Md5*)md5, input, sz);
}
/* Get MD5 Final into digest */
int CRYPT_MD5_Finalize(CRYPT_MD5_CTX* md5, unsigned char* digest)
{
if (md5 == NULL || digest == NULL)
return BAD_FUNC_ARG;
return wc_Md5Final((Md5*)md5, digest);
}
#endif
#ifndef NO_SHA
/* Initialize SHA */
int CRYPT_SHA_Initialize(CRYPT_SHA_CTX* sha)
{
typedef char sha_test[sizeof(CRYPT_SHA_CTX) >= sizeof(Sha) ? 1 : -1];
(void)sizeof(sha_test);
if (sha == NULL)
return BAD_FUNC_ARG;
return wc_InitSha((wc_Sha*)sha);
}
int CRYPT_SHA_DataSizeSet(CRYPT_SHA_CTX* sha, unsigned int sz)
{
if (sha == NULL)
return BAD_FUNC_ARG;
#ifdef WOLFSSL_PIC32MZ_HASH
wc_ShaSizeSet((wc_Sha*)sha, sz);
#else
(void)sz;
#endif
return 0;
}
/* Add data to SHA */
int CRYPT_SHA_DataAdd(CRYPT_SHA_CTX* sha, const unsigned char* input,
unsigned int sz)
{
if (sha == NULL || input == NULL)
return BAD_FUNC_ARG;
return wc_ShaUpdate((wc_Sha*)sha, input, sz);
}
/* Get SHA Final into digest */
int CRYPT_SHA_Finalize(CRYPT_SHA_CTX* sha, unsigned char* digest)
{
if (sha == NULL || digest == NULL)
return BAD_FUNC_ARG;
return wc_ShaFinal((wc_Sha*)sha, digest);
}
#endif
#ifndef NO_SHA256
/* Initialize SHA-256 */
int CRYPT_SHA256_Initialize(CRYPT_SHA256_CTX* sha256)
{
typedef char sha_test[sizeof(CRYPT_SHA256_CTX) >= sizeof(wc_Sha256) ? 1 : -1];
(void)sizeof(sha_test);
if (sha256 == NULL)
return BAD_FUNC_ARG;
return wc_InitSha256((wc_Sha256*)sha256);
}
int CRYPT_SHA256_DataSizeSet(CRYPT_SHA256_CTX* sha256, unsigned int sz)
{
if (sha256 == NULL)
return BAD_FUNC_ARG;
#ifdef WOLFSSL_PIC32MZ_HASH
wc_Sha256SizeSet((wc_Sha256*)sha256, sz);
#else
(void)sz;
#endif
return 0;
}
/* Add data to SHA-256 */
int CRYPT_SHA256_DataAdd(CRYPT_SHA256_CTX* sha256, const unsigned char* input,
unsigned int sz)
{
if (sha256 == NULL || input == NULL)
return BAD_FUNC_ARG;
return wc_Sha256Update((wc_Sha256*)sha256, input, sz);
}
/* Get SHA-256 Final into digest */
int CRYPT_SHA256_Finalize(CRYPT_SHA256_CTX* sha256, unsigned char* digest)
{
if (sha256 == NULL || digest == NULL)
return BAD_FUNC_ARG;
return wc_Sha256Final((wc_Sha256*)sha256, digest);
}
#endif
#ifdef WOLFSSL_SHA512
#ifdef WOLFSSL_SHA384
/* Initialize SHA-384 */
int CRYPT_SHA384_Initialize(CRYPT_SHA384_CTX* sha384)
{
typedef char sha_test[sizeof(CRYPT_SHA384_CTX) >= sizeof(wc_Sha384) ? 1 : -1];
(void)sizeof(sha_test);
if (sha384 == NULL)
return BAD_FUNC_ARG;
return wc_InitSha384((wc_Sha384*)sha384);
}
/* Add data to SHA-384 */
int CRYPT_SHA384_DataAdd(CRYPT_SHA384_CTX* sha384, const unsigned char* input,
unsigned int sz)
{
if (sha384 == NULL || input == NULL)
return BAD_FUNC_ARG;
return wc_Sha384Update((wc_Sha384*)sha384, input, sz);
}
/* Get SHA-384 Final into digest */
int CRYPT_SHA384_Finalize(CRYPT_SHA384_CTX* sha384, unsigned char* digest)
{
if (sha384 == NULL || digest == NULL)
return BAD_FUNC_ARG;
return wc_Sha384Final((wc_Sha384*)sha384, digest);
}
#endif
/* Initialize SHA-512 */
int CRYPT_SHA512_Initialize(CRYPT_SHA512_CTX* sha512)
{
typedef char sha_test[sizeof(CRYPT_SHA512_CTX) >= sizeof(wc_Sha512) ? 1 : -1];
(void)sizeof(sha_test);
if (sha512 == NULL)
return BAD_FUNC_ARG;
return wc_InitSha512((wc_Sha512*)sha512);
}
/* Add data to SHA-512 */
int CRYPT_SHA512_DataAdd(CRYPT_SHA512_CTX* sha512, const unsigned char* input,
unsigned int sz)
{
if (sha512 == NULL || input == NULL)
return BAD_FUNC_ARG;
return wc_Sha512Update((wc_Sha512*)sha512, input, sz);
}
/* Get SHA-512 Final into digest */
int CRYPT_SHA512_Finalize(CRYPT_SHA512_CTX* sha512, unsigned char* digest)
{
if (sha512 == NULL || digest == NULL)
return BAD_FUNC_ARG;
return wc_Sha512Final((wc_Sha512*)sha512, digest);
}
#endif
#ifndef NO_HMAC
/* Set HMAC key with type */
int CRYPT_HMAC_SetKey(CRYPT_HMAC_CTX* hmac, int type, const unsigned char* key,
unsigned int sz)
{
/* compile-time check to verify CRYPT_HMAC_CTX is large enough to hold Hmac */
typedef char hmac_test[sizeof(CRYPT_HMAC_CTX) >= sizeof(Hmac) ? 1 : -1];
(void)sizeof(hmac_test);
if (hmac == NULL || key == NULL)
return BAD_FUNC_ARG;
if (type != CRYPT_HMAC_SHA && type != CRYPT_HMAC_SHA256 &&
type != CRYPT_HMAC_SHA384 && type != CRYPT_HMAC_SHA512) {
return BAD_FUNC_ARG; /* bad hmac type */
}
return wc_HmacSetKey((Hmac*)hmac, type, key, sz);
}
int CRYPT_HMAC_DataAdd(CRYPT_HMAC_CTX* hmac, const unsigned char* input,
unsigned int sz)
{
if (hmac == NULL || input == NULL)
return BAD_FUNC_ARG;
return wc_HmacUpdate((Hmac*)hmac, input, sz);
}
/* Get HMAC Final into digest */
int CRYPT_HMAC_Finalize(CRYPT_HMAC_CTX* hmac, unsigned char* digest)
{
if (hmac == NULL || digest == NULL)
return BAD_FUNC_ARG;
return wc_HmacFinal((Hmac*)hmac, digest);
}
#endif
#ifdef HAVE_LIBZ
/* Huffman Compression, set flag to do static, otherwise dynamic */
/* return compressed size, otherwise < 0 for error */
int CRYPT_HUFFMAN_Compress(unsigned char* out, unsigned int outSz,
const unsigned char* in, unsigned int inSz,
unsigned int flags)
{
if (out == NULL || in == NULL)
return BAD_FUNC_ARG;
return wc_Compress(out, outSz, in, inSz, flags);
}
/* Huffman DeCompression, self determines type */
/* return decompressed size, otherwise < 0 for error */
int CRYPT_HUFFMAN_DeCompress(unsigned char* out, unsigned int outSz,
const unsigned char* in, unsigned int inSz)
{
if (out == NULL || in == NULL)
return BAD_FUNC_ARG;
return wc_DeCompress(out, outSz, in, inSz);
}
#endif
#ifndef NO_RNG
/* RNG Initialize, < 0 on error */
int CRYPT_RNG_Initialize(CRYPT_RNG_CTX* rng)
{
typedef char rng_test[sizeof(CRYPT_RNG_CTX) >= sizeof(WC_RNG) ? 1 : -1];
(void)sizeof(rng_test);
if (rng == NULL)
return BAD_FUNC_ARG;
return wc_InitRng((WC_RNG*)rng);
}
/* RNG Get single bytes, < 0 on error */
int CRYPT_RNG_Get(CRYPT_RNG_CTX* rng, unsigned char* b)
{
if (rng == NULL || b == NULL)
return BAD_FUNC_ARG;
return wc_RNG_GenerateByte((WC_RNG*)rng, (byte*)b);
}
/* RNG Block Generation of sz bytes, < 0 on error */
int CRYPT_RNG_BlockGenerate(CRYPT_RNG_CTX* rng, unsigned char* b,
unsigned int sz)
{
if (rng == NULL || b == NULL)
return BAD_FUNC_ARG;
return wc_RNG_GenerateBlock((WC_RNG*)rng, b, sz);
}
#endif
#ifndef NO_DES3
/* Triple DES Key Set, may have iv, will have direction */
int CRYPT_TDES_KeySet(CRYPT_TDES_CTX* tdes, const unsigned char* key,
const unsigned char* iv, int dir)
{
typedef char tdes_test[sizeof(CRYPT_TDES_CTX) >= sizeof(Des3) ? 1 : -1];
(void)sizeof(tdes_test);
if (tdes == NULL || key == NULL)
return BAD_FUNC_ARG;
return wc_Des3_SetKey((Des3*)tdes, key, iv, dir);
}
/* Triple DES Iv Set, sometimes added later */
int CRYPT_TDES_IvSet(CRYPT_TDES_CTX* tdes, const unsigned char* iv)
{
if (tdes == NULL || iv == NULL)
return BAD_FUNC_ARG;
return wc_Des3_SetIV((Des3*)tdes, iv);
}
/* Triple DES CBC Encrypt */
int CRYPT_TDES_CBC_Encrypt(CRYPT_TDES_CTX* tdes, unsigned char* out,
const unsigned char* in, unsigned int inSz)
{
if (tdes == NULL || out == NULL || in == NULL)
return BAD_FUNC_ARG;
return wc_Des3_CbcEncrypt((Des3*)tdes, out, in, inSz);
}
/* Triple DES CBC Decrypt */
int CRYPT_TDES_CBC_Decrypt(CRYPT_TDES_CTX* tdes, unsigned char* out,
const unsigned char* in, unsigned int inSz)
{
if (tdes == NULL || out == NULL || in == NULL)
return BAD_FUNC_ARG;
return wc_Des3_CbcDecrypt((Des3*)tdes, out, in, inSz);
}
#endif
#ifndef NO_AES
/* AES Key Set, may have iv, will have direction */
int CRYPT_AES_KeySet(CRYPT_AES_CTX* aes, const unsigned char* key,
unsigned int keyLen, const unsigned char* iv, int dir)
{
typedef char aes_test[sizeof(CRYPT_AES_CTX) >= sizeof(Aes) ? 1 : -1];
(void)sizeof(aes_test);
if (aes == NULL || key == NULL)
return BAD_FUNC_ARG;
return wc_AesSetKey((Aes*)aes, key, keyLen, iv, dir);
}
/* AES Iv Set, sometimes added later */
int CRYPT_AES_IvSet(CRYPT_AES_CTX* aes, const unsigned char* iv)
{
if (aes == NULL || iv == NULL)
return BAD_FUNC_ARG;
return wc_AesSetIV((Aes*)aes, iv);
}
/* AES CBC Encrypt */
int CRYPT_AES_CBC_Encrypt(CRYPT_AES_CTX* aes, unsigned char* out,
const unsigned char* in, unsigned int inSz)
{
if (aes == NULL || out == NULL || in == NULL)
return BAD_FUNC_ARG;
return wc_AesCbcEncrypt((Aes*)aes, out, in, inSz);
}
/* AES CBC Decrypt */
int CRYPT_AES_CBC_Decrypt(CRYPT_AES_CTX* aes, unsigned char* out,
const unsigned char* in, unsigned int inSz)
{
if (aes == NULL || out == NULL || in == NULL)
return BAD_FUNC_ARG;
return wc_AesCbcDecrypt((Aes*)aes, out, in, inSz);
}
#endif
#ifdef WOLFSSL_AES_COUNTER
/* AES CTR Encrypt (used for decrypt too, with ENCRYPT key setup) */
int CRYPT_AES_CTR_Encrypt(CRYPT_AES_CTX* aes, unsigned char* out,
const unsigned char* in, unsigned int inSz)
{
if (aes == NULL || out == NULL || in == NULL)
return BAD_FUNC_ARG;
return wc_AesCtrEncrypt((Aes*)aes, out, in, inSz);
}
#endif
#ifdef WOLFSSL_AES_DIRECT
/* AES Direct mode encrypt, one block at a time */
int CRYPT_AES_DIRECT_Encrypt(CRYPT_AES_CTX* aes, unsigned char* out,
const unsigned char* in)
{
if (aes == NULL || out == NULL || in == NULL)
return BAD_FUNC_ARG;
wc_AesEncryptDirect((Aes*)aes, out, in);
return 0;
}
/* AES Direct mode decrypt, one block at a time */
int CRYPT_AES_DIRECT_Decrypt(CRYPT_AES_CTX* aes, unsigned char* out,
const unsigned char* in)
{
if (aes == NULL || out == NULL || in == NULL)
return BAD_FUNC_ARG;
wc_AesDecryptDirect((Aes*)aes, out, in);
return 0;
}
#endif
#ifndef NO_RSA
/* RSA Initialize */
int CRYPT_RSA_Initialize(CRYPT_RSA_CTX* rsa)
{
if (rsa == NULL)
return BAD_FUNC_ARG;
rsa->holder = (RsaKey*)XMALLOC(sizeof(RsaKey), NULL, DYNAMIC_TYPE_RSA);
if (rsa->holder == NULL)
return -1;
return wc_InitRsaKey((RsaKey*)rsa->holder, NULL);
}
/* RSA Free resources */
int CRYPT_RSA_Free(CRYPT_RSA_CTX* rsa)
{
if (rsa == NULL)
return BAD_FUNC_ARG;
wc_FreeRsaKey((RsaKey*)rsa->holder);
XFREE(rsa->holder, NULL, DYNAMIC_TYPE_RSA);
rsa->holder = NULL;
return 0;
}
/* RSA Public key decode ASN.1 */
int CRYPT_RSA_PublicKeyDecode(CRYPT_RSA_CTX* rsa, const unsigned char* in,
unsigned int inSz)
{
unsigned int idx = 0;
(void)idx;
if (rsa == NULL || in == NULL)
return BAD_FUNC_ARG;
return wc_RsaPublicKeyDecode(in, &idx, (RsaKey*)rsa->holder, inSz);
}
/* RSA Private key decode ASN.1 */
int CRYPT_RSA_PrivateKeyDecode(CRYPT_RSA_CTX* rsa, const unsigned char* in,
unsigned int inSz)
{
unsigned int idx = 0;
(void)idx;
if (rsa == NULL || in == NULL)
return BAD_FUNC_ARG;
return wc_RsaPrivateKeyDecode(in, &idx, (RsaKey*)rsa->holder, inSz);
}
/* RSA Public Encrypt */
int CRYPT_RSA_PublicEncrypt(CRYPT_RSA_CTX* rsa, unsigned char* out,
unsigned int outSz, const unsigned char* in,
unsigned int inSz, CRYPT_RNG_CTX* rng)
{
if (rsa == NULL || in == NULL || out == NULL || rng == NULL)
return BAD_FUNC_ARG;
return wc_RsaPublicEncrypt(in, inSz, out, outSz, (RsaKey*)rsa->holder,
(WC_RNG*)rng);
}
/* RSA Private Decrypt */
int CRYPT_RSA_PrivateDecrypt(CRYPT_RSA_CTX* rsa, unsigned char* out,
unsigned int outSz, const unsigned char* in,
unsigned int inSz)
{
if (rsa == NULL || in == NULL || out == NULL)
return BAD_FUNC_ARG;
return wc_RsaPrivateDecrypt(in, inSz, out, outSz, (RsaKey*)rsa->holder);
}
/* RSA Get Encrypt size helper */
int CRYPT_RSA_EncryptSizeGet(CRYPT_RSA_CTX* rsa)
{
if (rsa == NULL)
return BAD_FUNC_ARG;
return wc_RsaEncryptSize((RsaKey*)rsa->holder);
}
int CRYPT_RSA_SetRng(CRYPT_RSA_CTX* rsa, CRYPT_RNG_CTX* rng)
{
if (rsa == NULL)
return BAD_FUNC_ARG;
#ifdef WC_RSA_BLINDING
return wc_RsaSetRNG((RsaKey*)rsa->holder, (WC_RNG*)rng);
#else
(void)rng;
return 0;
#endif
}
#endif
#ifdef HAVE_ECC
/* ECC init */
int CRYPT_ECC_Initialize(CRYPT_ECC_CTX* ecc)
{
if (ecc == NULL)
return BAD_FUNC_ARG;
ecc->holder = (ecc_key*)XMALLOC(sizeof(ecc_key), NULL, DYNAMIC_TYPE_ECC);
if (ecc->holder == NULL)
return -1;
wc_ecc_init((ecc_key*)ecc->holder);
return 0;
}
/* ECC free resources */
int CRYPT_ECC_Free(CRYPT_ECC_CTX* ecc)
{
if (ecc == NULL)
return BAD_FUNC_ARG;
wc_ecc_free((ecc_key*)ecc->holder);
XFREE(ecc->holder, NULL, DYNAMIC_TYPE_ECC);
ecc->holder = NULL;
return 0;
}
/* ECC Public x963 Export */
int CRYPT_ECC_PublicExport(CRYPT_ECC_CTX* ecc, unsigned char* out,
unsigned int outSz, unsigned int* usedSz)
{
int ret;
unsigned int inOut = outSz;
if (ecc == NULL || out == NULL)
return BAD_FUNC_ARG;
ret = wc_ecc_export_x963((ecc_key*)ecc->holder, out, &inOut);
*usedSz = inOut;
return ret;
}
/* ECC Public x963 Import */
int CRYPT_ECC_PublicImport(CRYPT_ECC_CTX* ecc, const unsigned char* in,
unsigned int inSz)
{
if (ecc == NULL || in == NULL)
return BAD_FUNC_ARG;
return wc_ecc_import_x963(in, inSz, (ecc_key*)ecc->holder);
}
/* ECC Private x963 Import */
int CRYPT_ECC_PrivateImport(CRYPT_ECC_CTX* ecc, const unsigned char* priv,
unsigned int privSz, const unsigned char* pub, unsigned int pubSz)
{
if (ecc == NULL || priv == NULL || pub == NULL)
return BAD_FUNC_ARG;
return wc_ecc_import_private_key(priv, privSz, pub, pubSz,
(ecc_key*)ecc->holder);
}
/* ECC DHE Make key */
int CRYPT_ECC_DHE_KeyMake(CRYPT_ECC_CTX* ecc, CRYPT_RNG_CTX* rng, int keySz)
{
if (ecc == NULL || rng == NULL)
return BAD_FUNC_ARG;
return wc_ecc_make_key((WC_RNG*)rng, keySz, (ecc_key*)ecc->holder);
}
/* ECC DHE Make shared secret with our private and peer public */
int CRYPT_ECC_DHE_SharedSecretMake(CRYPT_ECC_CTX* priv, CRYPT_ECC_CTX* pub,
unsigned char* out, unsigned int outSz, unsigned int* usedSz)
{
int ret;
unsigned int inOut = outSz;
#if defined(ECC_TIMING_RESISTANT)
WC_RNG rng;
#endif
if (priv == NULL || pub == NULL || out == NULL || usedSz == NULL)
return BAD_FUNC_ARG;
#if defined(ECC_TIMING_RESISTANT)
ret = wc_InitRng(&rng);
if (ret != 0)
return ret;
ret = wc_ecc_set_rng((ecc_key*)priv->holder, &rng);
if (ret != 0) {
wc_FreeRng(&rng);
return ret;
}
#endif
ret = wc_ecc_shared_secret((ecc_key*)priv->holder, (ecc_key*)pub->holder,
out, &inOut);
*usedSz = inOut;
#if defined(ECC_TIMING_RESISTANT)
wc_FreeRng(&rng);
#endif
return ret;
}
/* ECC DSA Hash Sign */
int CRYPT_ECC_DSA_HashSign(CRYPT_ECC_CTX* ecc, CRYPT_RNG_CTX* rng,
unsigned char* sig, unsigned int sigSz,
unsigned int* usedSz, const unsigned char* in,
unsigned int inSz)
{
int ret;
unsigned int inOut = sigSz;
if (ecc == NULL || rng == NULL || sig == NULL || usedSz == NULL ||
in == NULL)
return BAD_FUNC_ARG;
ret = wc_ecc_sign_hash(in, inSz, sig, &inOut, (WC_RNG*)rng,
(ecc_key*)ecc->holder);
*usedSz = inOut;
return ret;
}
/* ECC DSA Hash Verify */
int CRYPT_ECC_DSA_HashVerify(CRYPT_ECC_CTX* ecc, const unsigned char* sig,
unsigned int sigSz, unsigned char* hash,
unsigned int hashSz, int* status)
{
if (ecc == NULL || sig == NULL || hash == NULL || status == NULL)
return BAD_FUNC_ARG;
return wc_ecc_verify_hash(sig, sigSz, hash, hashSz, status,
(ecc_key*)ecc->holder);
}
/* ECC get key size helper */
int CRYPT_ECC_KeySizeGet(CRYPT_ECC_CTX* ecc)
{
if (ecc == NULL)
return BAD_FUNC_ARG;
return wc_ecc_size((ecc_key*)ecc->holder);
}
/* ECC get signature size helper */
int CRYPT_ECC_SignatureSizeGet(CRYPT_ECC_CTX* ecc)
{
if (ecc == NULL)
return BAD_FUNC_ARG;
return wc_ecc_sig_size((ecc_key*)ecc->holder);
}
#endif
/* Save error string from err to str which needs to be >= 80 chars */
int CRYPT_ERROR_StringGet(int err, char* str)
{
if (str == NULL)
return BAD_FUNC_ARG;
wc_ErrorString(err, str);
return 0;
}

282
android/extern/wolfssl/mcapi/crypto.h vendored Normal file
View File

@@ -0,0 +1,282 @@
/* crypto.h
*
* Copyright (C) 2006-2022 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
/* Defines Microchip CRYPTO API layer */
#ifndef MC_CRYPTO_API_H
#define MC_CRYPTO_API_H
#ifdef __cplusplus
extern "C" {
#endif
/* MD5 */
typedef struct CRYPT_MD5_CTX {
int holder[28]; /* big enough to hold internal, but check on init */
} CRYPT_MD5_CTX;
int CRYPT_MD5_Initialize(CRYPT_MD5_CTX*);
int CRYPT_MD5_DataAdd(CRYPT_MD5_CTX*, const unsigned char*, unsigned int);
int CRYPT_MD5_Finalize(CRYPT_MD5_CTX*, unsigned char*);
int CRYPT_MD5_DataSizeSet(CRYPT_MD5_CTX* md5, unsigned int sz);
enum {
CRYPT_MD5_DIGEST_SIZE = 16
};
/* SHA */
typedef struct CRYPT_SHA_CTX {
int holder[29]; /* big enough to hold internal, but check on init */
} CRYPT_SHA_CTX;
int CRYPT_SHA_Initialize(CRYPT_SHA_CTX*);
int CRYPT_SHA_DataAdd(CRYPT_SHA_CTX*, const unsigned char*, unsigned int);
int CRYPT_SHA_Finalize(CRYPT_SHA_CTX*, unsigned char*);
int CRYPT_SHA_DataSizeSet(CRYPT_SHA_CTX* sha, unsigned int sz);
enum {
CRYPT_SHA_DIGEST_SIZE = 20
};
/* SHA-256 */
typedef struct CRYPT_SHA256_CTX {
int holder[32]; /* big enough to hold internal, but check on init */
} CRYPT_SHA256_CTX;
int CRYPT_SHA256_Initialize(CRYPT_SHA256_CTX*);
int CRYPT_SHA256_DataAdd(CRYPT_SHA256_CTX*, const unsigned char*, unsigned int);
int CRYPT_SHA256_Finalize(CRYPT_SHA256_CTX*, unsigned char*);
int CRYPT_SHA256_DataSizeSet(CRYPT_SHA256_CTX* sha256, unsigned int sz);
enum {
CRYPT_SHA256_DIGEST_SIZE = 32
};
/* SHA-384 */
typedef struct CRYPT_SHA384_CTX {
long long holder[36]; /* big enough to hold internal, but check on init */
} CRYPT_SHA384_CTX;
int CRYPT_SHA384_Initialize(CRYPT_SHA384_CTX*);
int CRYPT_SHA384_DataAdd(CRYPT_SHA384_CTX*, const unsigned char*, unsigned int);
int CRYPT_SHA384_Finalize(CRYPT_SHA384_CTX*, unsigned char*);
enum {
CRYPT_SHA384_DIGEST_SIZE = 48
};
/* SHA-512 */
typedef struct CRYPT_SHA512_CTX {
long long holder[36]; /* big enough to hold internal, but check on init */
} CRYPT_SHA512_CTX;
int CRYPT_SHA512_Initialize(CRYPT_SHA512_CTX*);
int CRYPT_SHA512_DataAdd(CRYPT_SHA512_CTX*, const unsigned char*, unsigned int);
int CRYPT_SHA512_Finalize(CRYPT_SHA512_CTX*, unsigned char*);
enum {
CRYPT_SHA512_DIGEST_SIZE = 64
};
/* HMAC */
typedef struct CRYPT_HMAC_CTX {
/* big enough to hold internal, but check on init */
#ifdef WOLF_PRIVATE_KEY_ID
long long holder[108];
#else
long long holder[98];
#endif
} CRYPT_HMAC_CTX;
int CRYPT_HMAC_SetKey(CRYPT_HMAC_CTX*, int, const unsigned char*, unsigned int);
int CRYPT_HMAC_DataAdd(CRYPT_HMAC_CTX*, const unsigned char*, unsigned int);
int CRYPT_HMAC_Finalize(CRYPT_HMAC_CTX*, unsigned char*);
/* HMAC types */
enum {
CRYPT_HMAC_SHA = 4,
CRYPT_HMAC_SHA256 = 6,
CRYPT_HMAC_SHA384 = 7,
CRYPT_HMAC_SHA512 = 8
};
/* Huffman */
int CRYPT_HUFFMAN_Compress(unsigned char*, unsigned int, const unsigned char*,
unsigned int, unsigned int);
int CRYPT_HUFFMAN_DeCompress(unsigned char*, unsigned int, const unsigned char*,
unsigned int);
/* flag to use static huffman */
enum {
CRYPT_HUFFMAN_COMPRESS_STATIC = 1
};
/* RNG */
typedef struct CRYPT_RNG_CTX {
int holder[66]; /* big enough to hold internal, but check on init */
} CRYPT_RNG_CTX;
int CRYPT_RNG_Initialize(CRYPT_RNG_CTX*);
int CRYPT_RNG_Get(CRYPT_RNG_CTX*, unsigned char*);
int CRYPT_RNG_BlockGenerate(CRYPT_RNG_CTX*, unsigned char*, unsigned int);
/* TDES */
typedef struct CRYPT_TDES_CTX {
int holder[104]; /* big enough to hold internal, but check on init */
} CRYPT_TDES_CTX;
int CRYPT_TDES_KeySet(CRYPT_TDES_CTX*, const unsigned char*,
const unsigned char*, int);
int CRYPT_TDES_IvSet(CRYPT_TDES_CTX*, const unsigned char*);
int CRYPT_TDES_CBC_Encrypt(CRYPT_TDES_CTX*, unsigned char*,
const unsigned char*, unsigned int);
int CRYPT_TDES_CBC_Decrypt(CRYPT_TDES_CTX*, unsigned char*,
const unsigned char*, unsigned int);
/* key direction flags for setup */
enum {
CRYPT_TDES_ENCRYPTION = 0,
CRYPT_TDES_DECRYPTION = 1
};
/* AES */
typedef struct CRYPT_AES_CTX {
/* big enough to hold internal, but check on init */
#ifdef WOLF_PRIVATE_KEY_ID
int holder[108];
#else
int holder[90];
#endif
} CRYPT_AES_CTX;
/* key */
int CRYPT_AES_KeySet(CRYPT_AES_CTX*, const unsigned char*, unsigned int,
const unsigned char*, int);
int CRYPT_AES_IvSet(CRYPT_AES_CTX*, const unsigned char*);
/* cbc */
int CRYPT_AES_CBC_Encrypt(CRYPT_AES_CTX*, unsigned char*,
const unsigned char*, unsigned int);
int CRYPT_AES_CBC_Decrypt(CRYPT_AES_CTX*, unsigned char*,
const unsigned char*, unsigned int);
/* ctr (counter), use Encrypt both ways with ENCRYPT key setup */
int CRYPT_AES_CTR_Encrypt(CRYPT_AES_CTX*, unsigned char*,
const unsigned char*, unsigned int);
/* direct, one block at a time */
int CRYPT_AES_DIRECT_Encrypt(CRYPT_AES_CTX*, unsigned char*,
const unsigned char*);
int CRYPT_AES_DIRECT_Decrypt(CRYPT_AES_CTX*, unsigned char*,
const unsigned char*);
/* key direction flags for setup, ctr always uses ENCRYPT flag */
enum {
CRYPT_AES_ENCRYPTION = 0,
CRYPT_AES_DECRYPTION = 1,
CRYPT_AES_BLOCK_SIZE = 16
};
/* RSA */
typedef struct CRYPT_RSA_CTX {
void* holder;
} CRYPT_RSA_CTX;
/* init/free */
int CRYPT_RSA_Initialize(CRYPT_RSA_CTX*);
int CRYPT_RSA_Free(CRYPT_RSA_CTX*);
/* key decode */
int CRYPT_RSA_PublicKeyDecode(CRYPT_RSA_CTX*, const unsigned char*,
unsigned int);
int CRYPT_RSA_PrivateKeyDecode(CRYPT_RSA_CTX*, const unsigned char*,
unsigned int);
/* encrypt/decrypt */
int CRYPT_RSA_PublicEncrypt(CRYPT_RSA_CTX*, unsigned char*,
unsigned int, const unsigned char*, unsigned int,
CRYPT_RNG_CTX*);
int CRYPT_RSA_PrivateDecrypt(CRYPT_RSA_CTX*, unsigned char*,
unsigned int, const unsigned char*, unsigned int);
/* helpers */
int CRYPT_RSA_EncryptSizeGet(CRYPT_RSA_CTX*);
int CRYPT_RSA_SetRng(CRYPT_RSA_CTX*, CRYPT_RNG_CTX*);
/* ECC */
typedef struct CRYPT_ECC_CTX {
void* holder;
} CRYPT_ECC_CTX;
/* init/free */
int CRYPT_ECC_Initialize(CRYPT_ECC_CTX*);
int CRYPT_ECC_Free(CRYPT_ECC_CTX*);
/* key coders */
int CRYPT_ECC_PublicExport(CRYPT_ECC_CTX*, unsigned char*, unsigned int,
unsigned int*);
int CRYPT_ECC_PublicImport(CRYPT_ECC_CTX*, const unsigned char*, unsigned int);
int CRYPT_ECC_PrivateImport(CRYPT_ECC_CTX*, const unsigned char*, unsigned int,
const unsigned char*, unsigned int);
/* dhe */
int CRYPT_ECC_DHE_KeyMake(CRYPT_ECC_CTX*, CRYPT_RNG_CTX*, int);
int CRYPT_ECC_DHE_SharedSecretMake(CRYPT_ECC_CTX*, CRYPT_ECC_CTX*,
unsigned char*, unsigned int, unsigned int*);
/* dsa */
int CRYPT_ECC_DSA_HashSign(CRYPT_ECC_CTX*, CRYPT_RNG_CTX*, unsigned char*,
unsigned int, unsigned int*, const unsigned char*, unsigned int);
int CRYPT_ECC_DSA_HashVerify(CRYPT_ECC_CTX*, const unsigned char*,
unsigned int, unsigned char*, unsigned int, int*);
/* helpers */
int CRYPT_ECC_KeySizeGet(CRYPT_ECC_CTX*);
int CRYPT_ECC_SignatureSizeGet(CRYPT_ECC_CTX*);
/* Error string helper, string needs to be >= 80 chars */
int CRYPT_ERROR_StringGet(int, char*);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MC_CRYPTO_API_H */

19
android/extern/wolfssl/mcapi/include.am vendored Normal file
View File

@@ -0,0 +1,19 @@
# vim:ft=automake
# included from Top Level Makefile.am
# All paths should be given relative to the root
if BUILD_MCAPI
check_PROGRAMS += mcapi/test
noinst_PROGRAMS += mcapi/test
mcapi_test_SOURCES = mcapi/crypto.c \
mcapi/mcapi_test.c
mcapi_test_LDADD = src/libwolfssl.la
mcapi_test_DEPENDENCIES = src/libwolfssl.la
endif
noinst_HEADERS += mcapi/crypto.h
EXTRA_DIST += \
mcapi/README \
mcapi/PIC32MZ-serial.h \
mcapi/user_settings.h

1512
android/extern/wolfssl/mcapi/mcapi_test.c vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,380 @@
/* Example custom user settings for wolfSSL */
#ifndef WOLFSSL_USER_SETTINGS_H
#define WOLFSSL_USER_SETTINGS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stddef.h> /* for size_t */
/* ------------------------------------------------------------------------- */
/* Platform */
/* ------------------------------------------------------------------------- */
#undef WOLFSSL_GENERAL_ALIGNMENT
#define WOLFSSL_GENERAL_ALIGNMENT 4
#undef SINGLE_THREADED
#define SINGLE_THREADED
#undef WOLFSSL_SMALL_STACK
#define WOLFSSL_SMALL_STACK
#undef MICROCHIP_PIC32
#define MICROCHIP_PIC32
#undef WOLFSSL_MICROCHIP_PIC32MZ
#define WOLFSSL_MICROCHIP_PIC32MZ
/* ------------------------------------------------------------------------- */
/* Math Configuration */
/* ------------------------------------------------------------------------- */
#undef USE_FAST_MATH
#define USE_FAST_MATH
#ifdef USE_FAST_MATH
#undef TFM_TIMING_RESISTANT
#define TFM_TIMING_RESISTANT
/* Optimizations */
//#define TFM_MIPS
#endif
/* ------------------------------------------------------------------------- */
/* Crypto */
/* ------------------------------------------------------------------------- */
/* ECC */
#if 1
#undef HAVE_ECC
#define HAVE_ECC
/* Manually define enabled curves */
#undef ECC_USER_CURVES
#define ECC_USER_CURVES
//#define HAVE_ECC192
//#define HAVE_ECC224
#undef NO_ECC256
//#define HAVE_ECC384
//#define HAVE_ECC521
/* Fixed point cache (speeds repeated operations against same private key) */
#undef FP_ECC
//#define FP_ECC
#ifdef FP_ECC
/* Bits / Entries */
#undef FP_ENTRIES
#define FP_ENTRIES 2
#undef FP_LUT
#define FP_LUT 4
#endif
/* Optional ECC calculation method */
/* Note: doubles heap usage, but slightly faster */
#undef ECC_SHAMIR
#define ECC_SHAMIR
/* Reduces heap usage, but slower */
#undef ECC_TIMING_RESISTANT
#define ECC_TIMING_RESISTANT
#ifdef USE_FAST_MATH
/* use reduced size math buffers for ecc points */
#undef ALT_ECC_SIZE
#define ALT_ECC_SIZE
/* Enable TFM optimizations for ECC */
#if defined(HAVE_ECC192) || defined(HAVE_ALL_CURVES)
#define TFM_ECC192
#endif
#if defined(HAVE_ECC224) || defined(HAVE_ALL_CURVES)
#define TFM_ECC224
#endif
#if !defined(NO_ECC256) || defined(HAVE_ALL_CURVES)
#define TFM_ECC256
#endif
#if defined(HAVE_ECC384) || defined(HAVE_ALL_CURVES)
#define TFM_ECC384
#endif
#if defined(HAVE_ECC521) || defined(HAVE_ALL_CURVES)
#define TFM_ECC521
#endif
#endif
#endif
/* RSA */
#undef NO_RSA
#if 1
#ifdef USE_FAST_MATH
/* Maximum math bits (Max RSA key bits * 2) */
#undef FP_MAX_BITS
#define FP_MAX_BITS 4096
#endif
/* half as much memory but twice as slow */
#undef RSA_LOW_MEM
//#define RSA_LOW_MEM
/* timing resistance */
#undef WC_RSA_BLINDING
#define WC_RSA_BLINDING
#else
#define NO_RSA
#endif
/* AES */
#undef NO_AES
#if 1
#undef HAVE_AES_DECRYPT
#define HAVE_AES_DECRYPT
#undef HAVE_AESGCM
#define HAVE_AESGCM
/* GCM Method: GCM_SMALL, GCM_WORD32 or GCM_TABLE */
#undef GCM_SMALL
#define GCM_SMALL
#undef HAVE_AESCCM
#define HAVE_AESCCM
#undef WOLFSSL_AES_COUNTER
#define WOLFSSL_AES_COUNTER
#undef WOLFSSL_AES_DIRECT
#define WOLFSSL_AES_DIRECT
#else
#define NO_AES
#endif
/* DES3 */
#undef NO_DES3
#if 1
#undef WOLFSSL_DES_ECB
#define WOLFSSL_DES_ECB
#else
#define NO_DES3
#endif
/* ChaCha20 / Poly1305 */
#undef HAVE_CHACHA
#undef HAVE_POLY1305
#if 0
#define HAVE_CHACHA
#define HAVE_POLY1305
/* Needed for Poly1305 */
#undef HAVE_ONE_TIME_AUTH
#define HAVE_ONE_TIME_AUTH
#endif
/* Ed25519 / Curve25519 */
#undef HAVE_CURVE25519
#undef HAVE_ED25519
#if 0
#define HAVE_CURVE25519
#define HAVE_ED25519
/* Optionally use small math (less flash usage, but much slower) */
#if 0
#define CURVED25519_SMALL
#endif
#endif
/* ------------------------------------------------------------------------- */
/* Hashing */
/* ------------------------------------------------------------------------- */
/* Sha */
#undef NO_SHA
#if 1
/* 1k smaller, but 25% slower */
//#define USE_SLOW_SHA
#else
#define NO_SHA
#endif
/* Sha256 */
#undef NO_SHA256
#if 1
#else
#define NO_SHA256
#endif
/* Sha512 */
#undef WOLFSSL_SHA512
#if 1
#define WOLFSSL_SHA512
/* Sha384 */
#undef WOLFSSL_SHA384
#if 1
#define WOLFSSL_SHA384
#endif
/* over twice as small, but 50% slower */
//#define USE_SLOW_SHA2
#endif
/* MD5 */
#undef NO_MD5
#if 1
#else
#define NO_MD5
#endif
/* ------------------------------------------------------------------------- */
/* Benchmark / Test */
/* ------------------------------------------------------------------------- */
/* Use reduced benchmark / test sizes */
#undef BENCH_EMBEDDED
#define BENCH_EMBEDDED
#undef USE_CERT_BUFFERS_2048
#define USE_CERT_BUFFERS_2048
#undef USE_CERT_BUFFERS_1024
//#define USE_CERT_BUFFERS_1024
#undef USE_CERT_BUFFERS_256
#define USE_CERT_BUFFERS_256
/* ------------------------------------------------------------------------- */
/* Time */
/* ------------------------------------------------------------------------- */
#if 0
/* Override Current Time */
/* Allows custom "custom_time()" function to be used for benchmark */
#define WOLFSSL_USER_CURRTIME
#define USER_TICKS
extern unsigned long custom_time(unsigned long* timer);
#define XTIME custom_time
#else
#warning Time/RTC disabled
#undef NO_ASN_TIME
#define NO_ASN_TIME
#endif
/* ------------------------------------------------------------------------- */
/* Debugging */
/* ------------------------------------------------------------------------- */
#undef DEBUG_WOLFSSL
#define DEBUG_WOLFSSL
#ifdef DEBUG_WOLFSSL
/* Use this to measure / print heap usage */
#if 0
#undef USE_WOLFSSL_MEMORY
#define USE_WOLFSSL_MEMORY
#undef WOLFSSL_TRACK_MEMORY
#define WOLFSSL_TRACK_MEMORY
#endif
#else
#undef NO_WOLFSSL_MEMORY
#define NO_WOLFSSL_MEMORY
#undef NO_ERROR_STRINGS
//#define NO_ERROR_STRINGS
#endif
/* ------------------------------------------------------------------------- */
/* Enable Features */
/* ------------------------------------------------------------------------- */
#undef KEEP_PEER_CERT
//#define KEEP_PEER_CERT
#undef HAVE_COMP_KEY
//#define HAVE_COMP_KEY
#undef HAVE_TLS_EXTENSIONS
//#define HAVE_TLS_EXTENSIONS
#undef HAVE_SUPPORTED_CURVES
//#define HAVE_SUPPORTED_CURVES
#undef WOLFSSL_BASE64_ENCODE
//#define WOLFSSL_BASE64_ENCODE
/* TLS Session Cache */
#if 0
#define SMALL_SESSION_CACHE
#else
#define NO_SESSION_CACHE
#endif
/* ------------------------------------------------------------------------- */
/* Disable Features */
/* ------------------------------------------------------------------------- */
#undef NO_WOLFSSL_SERVER
//#define NO_WOLFSSL_SERVER
#undef NO_WOLFSSL_CLIENT
//#define NO_WOLFSSL_CLIENT
#undef NO_CRYPT_TEST
//#define NO_CRYPT_TEST
#undef NO_CRYPT_BENCHMARK
//#define NO_CRYPT_BENCHMARK
/* In-lining of misc.c functions */
/* If defined, must include wolfcrypt/src/misc.c in build */
/* Slower, but about 1k smaller */
#undef NO_INLINE
//#define NO_INLINE
#undef NO_FILESYSTEM
#define NO_FILESYSTEM
#undef NO_WRITEV
#define NO_WRITEV
#undef NO_MAIN_DRIVER
#define NO_MAIN_DRIVER
#undef NO_DEV_RANDOM
#define NO_DEV_RANDOM
#undef NO_DSA
#define NO_DSA
#undef NO_DH
#define NO_DH
#undef NO_RC4
#define NO_RC4
#undef NO_OLD_TLS
#define NO_OLD_TLS
#undef NO_PSK
#define NO_PSK
#undef NO_MD4
#define NO_MD4
#undef NO_PWDBASED
#define NO_PWDBASED
#undef NO_CODING
//#define NO_CODING
/* Suppress array-bounds */
#pragma GCC diagnostic ignored "-Warray-bounds"
#ifdef __cplusplus
}
#endif
#endif /* WOLFSSL_USER_SETTINGS_H */

View File

@@ -0,0 +1,196 @@
<?xml version="1.0" encoding="UTF-8"?>
<configurationDescriptor version="62">
<logicalFolder name="root" displayName="root" projectFiles="true">
<logicalFolder name="HeaderFiles"
displayName="Header Files"
projectFiles="true">
<itemPath>../user_settings.h</itemPath>
</logicalFolder>
<logicalFolder name="LinkerScript"
displayName="Linker Files"
projectFiles="true">
</logicalFolder>
<logicalFolder name="SourceFiles"
displayName="Source Files"
projectFiles="true">
<itemPath>../mcapi_test.c</itemPath>
<itemPath>../crypto.c</itemPath>
</logicalFolder>
<logicalFolder name="ExternalFiles"
displayName="Important Files"
projectFiles="false">
<itemPath>Makefile</itemPath>
</logicalFolder>
</logicalFolder>
<sourceRootList>
<Elem>..</Elem>
</sourceRootList>
<projectmakefile>Makefile</projectmakefile>
<confs>
<conf name="default" type="2">
<toolsSet>
<developmentServer>localhost</developmentServer>
<targetDevice>PIC32MX795F512L</targetDevice>
<targetHeader></targetHeader>
<targetPluginBoard></targetPluginBoard>
<platformTool>SKDEPIC32PlatformTool</platformTool>
<languageToolchain>XC32</languageToolchain>
<languageToolchainVersion>1.34</languageToolchainVersion>
<platform>4</platform>
</toolsSet>
<compileType>
<linkerTool>
<linkerLibItems>
<linkerLibProjectItem>
<makeArtifact PL="../wolfssl.X"
CT="3"
CN="default"
AC="true"
BL="true"
WD="../wolfssl.X"
BC="${MAKE} -f Makefile CONF=default"
DBC="${MAKE} -f Makefile CONF=default TYPE_IMAGE=DEBUG_RUN"
CC="rm -rf &quot;build/default&quot; &quot;dist/default&quot;"
OP="dist/default/production/wolfssl.X.a"
DOP="dist/default/debug/wolfssl.X.a"
FL="dist/default/production/wolfssl.X.a"
PD="dist/default/production/wolfssl.X."
DD="dist/default/debug/wolfssl.X.">
</makeArtifact>
</linkerLibProjectItem>
<linkerLibProjectItem>
<makeArtifact PL="../zlib.X"
CT="3"
CN="default"
AC="true"
BL="true"
WD="../zlib.X"
BC="${MAKE} -f Makefile CONF=default"
DBC="${MAKE} -f Makefile CONF=default TYPE_IMAGE=DEBUG_RUN"
CC="rm -rf &quot;build/default&quot; &quot;dist/default&quot;"
OP="dist/default/production/zlib.X.a"
DOP="dist/default/debug/zlib.X.a"
FL="dist/default/production/zlib.X.a"
PD="dist/default/production/zlib.X."
DD="dist/default/debug/zlib.X.">
</makeArtifact>
</linkerLibProjectItem>
</linkerLibItems>
</linkerTool>
<archiverTool>
</archiverTool>
<loading>
<useAlternateLoadableFile>false</useAlternateLoadableFile>
<parseOnProdLoad>false</parseOnProdLoad>
<alternateLoadableFile></alternateLoadableFile>
</loading>
</compileType>
<makeCustomizationType>
<makeCustomizationPreStepEnabled>false</makeCustomizationPreStepEnabled>
<makeCustomizationPreStep></makeCustomizationPreStep>
<makeCustomizationPostStepEnabled>false</makeCustomizationPostStepEnabled>
<makeCustomizationPostStep></makeCustomizationPostStep>
<makeCustomizationPutChecksumInUserID>false</makeCustomizationPutChecksumInUserID>
<makeCustomizationEnableLongLines>false</makeCustomizationEnableLongLines>
<makeCustomizationNormalizeHexFile>false</makeCustomizationNormalizeHexFile>
</makeCustomizationType>
<C32>
<property key="additional-warnings" value="false"/>
<property key="enable-app-io" value="false"/>
<property key="enable-omit-frame-pointer" value="false"/>
<property key="enable-symbols" value="true"/>
<property key="enable-unroll-loops" value="false"/>
<property key="exclude-floating-point" value="false"/>
<property key="extra-include-directories"
value="../../;../../mcapi;../../zlib-1.2.8"/>
<property key="generate-16-bit-code" value="false"/>
<property key="generate-micro-compressed-code" value="false"/>
<property key="isolate-each-function" value="false"/>
<property key="make-warnings-into-errors" value="false"/>
<property key="optimization-level" value=""/>
<property key="place-data-into-section" value="false"/>
<property key="post-instruction-scheduling" value="default"/>
<property key="pre-instruction-scheduling" value="default"/>
<property key="preprocessor-macros" value="WOLFSSL_USER_SETTINGS;HAVE_LIBZ;HAVE_MCAPI"/>
<property key="strict-ansi" value="false"/>
<property key="support-ansi" value="false"/>
<property key="use-cci" value="false"/>
<property key="use-iar" value="false"/>
<property key="use-indirect-calls" value="false"/>
</C32>
<C32-AR>
<property key="additional-options-chop-files" value="false"/>
</C32-AR>
<C32-AS>
</C32-AS>
<C32-LD>
<property key="additional-options-use-response-files" value="false"/>
<property key="enable-check-sections" value="false"/>
<property key="exclude-floating-point-library" value="false"/>
<property key="exclude-standard-libraries" value="false"/>
<property key="extra-lib-directories" value=""/>
<property key="fill-flash-options-addr" value=""/>
<property key="fill-flash-options-const" value=""/>
<property key="fill-flash-options-how" value="0"/>
<property key="fill-flash-options-inc-const" value="1"/>
<property key="fill-flash-options-increment" value=""/>
<property key="fill-flash-options-seq" value=""/>
<property key="fill-flash-options-what" value="0"/>
<property key="generate-16-bit-code" value="false"/>
<property key="generate-cross-reference-file" value="false"/>
<property key="generate-micro-compressed-code" value="false"/>
<property key="heap-size" value="32768"/>
<property key="input-libraries" value=""/>
<property key="linker-symbols" value=""/>
<property key="map-file" value=""/>
<property key="no-startup-files" value="false"/>
<property key="oXC32ld-extra-opts" value=""/>
<property key="optimization-level" value=""/>
<property key="preprocessor-macros" value=""/>
<property key="remove-unused-sections" value="false"/>
<property key="report-memory-usage" value="false"/>
<property key="stack-size" value="20480"/>
<property key="symbol-stripping" value=""/>
<property key="trace-symbols" value=""/>
<property key="warn-section-align" value="false"/>
</C32-LD>
<C32CPP>
<property key="additional-warnings" value="false"/>
<property key="check-new" value="false"/>
<property key="eh-specs" value="true"/>
<property key="enable-app-io" value="false"/>
<property key="enable-omit-frame-pointer" value="false"/>
<property key="enable-symbols" value="true"/>
<property key="enable-unroll-loops" value="false"/>
<property key="exceptions" value="true"/>
<property key="exclude-floating-point" value="false"/>
<property key="extra-include-directories" value=""/>
<property key="generate-16-bit-code" value="false"/>
<property key="generate-micro-compressed-code" value="false"/>
<property key="isolate-each-function" value="false"/>
<property key="make-warnings-into-errors" value="false"/>
<property key="optimization-level" value=""/>
<property key="place-data-into-section" value="false"/>
<property key="post-instruction-scheduling" value="default"/>
<property key="pre-instruction-scheduling" value="default"/>
<property key="preprocessor-macros" value=""/>
<property key="rtti" value="true"/>
<property key="strict-ansi" value="false"/>
<property key="use-cci" value="false"/>
<property key="use-iar" value="false"/>
<property key="use-indirect-calls" value="false"/>
</C32CPP>
<C32Global>
<property key="common-include-directories" value=""/>
<property key="gp-relative-option" value=""/>
<property key="legacy-libc" value="false"/>
<property key="relaxed-math" value="false"/>
<property key="save-temps" value="false"/>
<property key="wpo-lto" value="false"/>
</C32Global>
<SKDEPIC32PlatformTool>
<property key="whatToProgram" value="all"/>
</SKDEPIC32PlatformTool>
</conf>
</confs>
</configurationDescriptor>

View File

@@ -0,0 +1,11 @@
# vim:ft=automake
# All paths should be given relative to the root
#
EXTRA_DIST += \
mcapi/wolfcrypt_mcapi.X/Makefile
EXTRA_DIST += \
mcapi/wolfcrypt_mcapi.X/nbproject/configurations.xml \
mcapi/wolfcrypt_mcapi.X/nbproject/project.xml

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>com.microchip.mplab.nbide.embedded.makeproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/make-project/1">
<name>wolfcrypt_mcapi</name>
<creation-uuid>2ca6ab9b-e225-4ad3-b48e-9ea7b47a4ca4</creation-uuid>
<make-project-type>0</make-project-type>
<c-extensions>c</c-extensions>
<cpp-extensions/>
<header-extensions/>
<sourceEncoding>ISO-8859-1</sourceEncoding>
<asminc-extensions/>
<make-dep-projects>
<make-dep-project>../wolfssl.X</make-dep-project>
<make-dep-project>../zlib.X</make-dep-project>
</make-dep-projects>
</data>
</configuration>
</project>

View File

@@ -0,0 +1,212 @@
<?xml version="1.0" encoding="UTF-8"?>
<configurationDescriptor version="62">
<logicalFolder name="root" displayName="root" projectFiles="true">
<logicalFolder name="HeaderFiles"
displayName="Header Files"
projectFiles="true">
<itemPath>../user_settings.h</itemPath>
</logicalFolder>
<logicalFolder name="LinkerScript"
displayName="Linker Files"
projectFiles="true">
</logicalFolder>
<logicalFolder name="SourceFiles"
displayName="Source Files"
projectFiles="true">
<itemPath>../../mplabx/test_main.c</itemPath>
<itemPath>../../wolfcrypt/test/test.c</itemPath>
</logicalFolder>
<logicalFolder name="ExternalFiles"
displayName="Important Files"
projectFiles="false">
<itemPath>Makefile</itemPath>
</logicalFolder>
</logicalFolder>
<sourceRootList>
<Elem>../../mplabx</Elem>
<Elem>../../wolfcrypt/test</Elem>
</sourceRootList>
<projectmakefile>Makefile</projectmakefile>
<confs>
<conf name="default" type="2">
<toolsSet>
<developmentServer>localhost</developmentServer>
<targetDevice>PIC32MX795F512L</targetDevice>
<targetHeader></targetHeader>
<targetPluginBoard></targetPluginBoard>
<platformTool>SKDEPIC32PlatformTool</platformTool>
<languageToolchain>XC32</languageToolchain>
<languageToolchainVersion>1.34</languageToolchainVersion>
<platform>4</platform>
</toolsSet>
<compileType>
<linkerTool>
<linkerLibItems>
<linkerLibProjectItem>
<makeArtifact PL="../wolfssl.X"
CT="3"
CN="default"
AC="true"
BL="true"
WD="../wolfssl.X"
BC="${MAKE} -f Makefile CONF=default"
DBC="${MAKE} -f Makefile CONF=default TYPE_IMAGE=DEBUG_RUN"
CC="rm -rf &quot;build/default&quot; &quot;dist/default&quot;"
OP="dist/default/production/wolfssl.X.a"
DOP="dist/default/debug/wolfssl.X.a"
FL="dist/default/production/wolfssl.X.a"
PD="dist/default/production/wolfssl.X."
DD="dist/default/debug/wolfssl.X.">
</makeArtifact>
</linkerLibProjectItem>
<linkerLibProjectItem>
<makeArtifact PL="../zlib.X"
CT="3"
CN="default"
AC="true"
BL="true"
WD="../zlib.X"
BC="${MAKE} -f Makefile CONF=default"
DBC="${MAKE} -f Makefile CONF=default TYPE_IMAGE=DEBUG_RUN"
CC="rm -rf &quot;build/default&quot; &quot;dist/default&quot;"
OP="dist/default/production/zlib.X.a"
DOP="dist/default/debug/zlib.X.a"
FL="dist/default/production/zlib.X.a"
PD="dist/default/production/zlib.X."
DD="dist/default/debug/zlib.X.">
</makeArtifact>
</linkerLibProjectItem>
</linkerLibItems>
</linkerTool>
<archiverTool>
</archiverTool>
<loading>
<useAlternateLoadableFile>false</useAlternateLoadableFile>
<parseOnProdLoad>false</parseOnProdLoad>
<alternateLoadableFile></alternateLoadableFile>
</loading>
</compileType>
<makeCustomizationType>
<makeCustomizationPreStepEnabled>false</makeCustomizationPreStepEnabled>
<makeCustomizationPreStep></makeCustomizationPreStep>
<makeCustomizationPostStepEnabled>false</makeCustomizationPostStepEnabled>
<makeCustomizationPostStep></makeCustomizationPostStep>
<makeCustomizationPutChecksumInUserID>false</makeCustomizationPutChecksumInUserID>
<makeCustomizationEnableLongLines>false</makeCustomizationEnableLongLines>
<makeCustomizationNormalizeHexFile>false</makeCustomizationNormalizeHexFile>
</makeCustomizationType>
<C32>
<property key="additional-warnings" value="false"/>
<property key="enable-app-io" value="false"/>
<property key="enable-omit-frame-pointer" value="false"/>
<property key="enable-symbols" value="false"/>
<property key="enable-unroll-loops" value="false"/>
<property key="exclude-floating-point" value="false"/>
<property key="extra-include-directories" value="../../;../../zlib-1.2.7"/>
<property key="generate-16-bit-code" value="false"/>
<property key="generate-micro-compressed-code" value="false"/>
<property key="isolate-each-function" value="false"/>
<property key="make-warnings-into-errors" value="false"/>
<property key="optimization-level" value="-Os"/>
<property key="place-data-into-section" value="false"/>
<property key="post-instruction-scheduling" value="default"/>
<property key="pre-instruction-scheduling" value="default"/>
<property key="preprocessor-macros" value="WOLFSSL_USER_SETTINGS;HAVE_LIBZ;HAVE_MCAPI"/>
<property key="strict-ansi" value="false"/>
<property key="support-ansi" value="false"/>
<property key="use-cci" value="false"/>
<property key="use-iar" value="false"/>
<property key="use-indirect-calls" value="false"/>
</C32>
<C32-AR>
<property key="additional-options-chop-files" value="false"/>
</C32-AR>
<C32-AS>
<property key="assembler-symbols" value=""/>
<property key="enable-symbols" value="true"/>
<property key="exclude-floating-point-library" value="false"/>
<property key="expand-macros" value="false"/>
<property key="extra-include-directories-for-assembler" value=""/>
<property key="extra-include-directories-for-preprocessor" value=""/>
<property key="false-conditionals" value="false"/>
<property key="keep-locals" value="false"/>
<property key="list-assembly" value="false"/>
<property key="list-source" value="false"/>
<property key="list-symbols" value="false"/>
<property key="oXC32asm-list-to-file" value="false"/>
<property key="omit-debug-dirs" value="false"/>
<property key="omit-forms" value="false"/>
<property key="preprocessor-macros" value=""/>
<property key="warning-level" value=""/>
</C32-AS>
<C32-LD>
<property key="additional-options-use-response-files" value="false"/>
<property key="enable-check-sections" value="false"/>
<property key="exclude-floating-point-library" value="false"/>
<property key="exclude-standard-libraries" value="false"/>
<property key="extra-lib-directories" value=""/>
<property key="fill-flash-options-addr" value=""/>
<property key="fill-flash-options-const" value=""/>
<property key="fill-flash-options-how" value="0"/>
<property key="fill-flash-options-inc-const" value="1"/>
<property key="fill-flash-options-increment" value=""/>
<property key="fill-flash-options-seq" value=""/>
<property key="fill-flash-options-what" value="0"/>
<property key="generate-16-bit-code" value="false"/>
<property key="generate-cross-reference-file" value="false"/>
<property key="generate-micro-compressed-code" value="false"/>
<property key="heap-size" value="32768"/>
<property key="input-libraries" value=""/>
<property key="linker-symbols" value=""/>
<property key="map-file" value=""/>
<property key="no-startup-files" value="false"/>
<property key="oXC32ld-extra-opts" value=""/>
<property key="optimization-level" value="-Os"/>
<property key="preprocessor-macros" value=""/>
<property key="remove-unused-sections" value="true"/>
<property key="report-memory-usage" value="false"/>
<property key="stack-size" value="1024"/>
<property key="symbol-stripping" value=""/>
<property key="trace-symbols" value=""/>
<property key="warn-section-align" value="false"/>
</C32-LD>
<C32CPP>
<property key="additional-warnings" value="false"/>
<property key="check-new" value="false"/>
<property key="eh-specs" value="true"/>
<property key="enable-app-io" value="false"/>
<property key="enable-omit-frame-pointer" value="false"/>
<property key="enable-symbols" value="true"/>
<property key="enable-unroll-loops" value="false"/>
<property key="exceptions" value="true"/>
<property key="exclude-floating-point" value="false"/>
<property key="extra-include-directories" value=""/>
<property key="generate-16-bit-code" value="false"/>
<property key="generate-micro-compressed-code" value="false"/>
<property key="isolate-each-function" value="false"/>
<property key="make-warnings-into-errors" value="false"/>
<property key="optimization-level" value=""/>
<property key="place-data-into-section" value="false"/>
<property key="post-instruction-scheduling" value="default"/>
<property key="pre-instruction-scheduling" value="default"/>
<property key="preprocessor-macros" value=""/>
<property key="rtti" value="true"/>
<property key="strict-ansi" value="false"/>
<property key="use-cci" value="false"/>
<property key="use-iar" value="false"/>
<property key="use-indirect-calls" value="false"/>
</C32CPP>
<C32Global>
<property key="common-include-directories" value=""/>
<property key="gp-relative-option" value=""/>
<property key="legacy-libc" value="false"/>
<property key="relaxed-math" value="false"/>
<property key="save-temps" value="false"/>
<property key="wpo-lto" value="false"/>
</C32Global>
<SKDEPIC32PlatformTool>
<property key="whatToProgram" value="all"/>
</SKDEPIC32PlatformTool>
</conf>
</confs>
</configurationDescriptor>

View File

@@ -0,0 +1,11 @@
# vim:ft=automake
# All paths should be given relative to the root
#
EXTRA_DIST += \
mcapi/wolfcrypt_test.X/Makefile
EXTRA_DIST += \
mcapi/wolfcrypt_test.X/nbproject/configurations.xml \
mcapi/wolfcrypt_test.X/nbproject/project.xml

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>com.microchip.mplab.nbide.embedded.makeproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/make-project/1">
<name>wolfcrypt_test</name>
<creation-uuid>b34c4937-7042-4352-88b1-7717bcdf8aeb</creation-uuid>
<make-project-type>0</make-project-type>
<c-extensions>c</c-extensions>
<cpp-extensions/>
<header-extensions/>
<sourceEncoding>ISO-8859-1</sourceEncoding>
<asminc-extensions/>
<make-dep-projects>
<make-dep-project>../wolfssl.X</make-dep-project>
<make-dep-project>../zlib.X</make-dep-project>
</make-dep-projects>
</data>
</configuration>
</project>

View File

@@ -0,0 +1,241 @@
<?xml version="1.0" encoding="UTF-8"?>
<configurationDescriptor version="62">
<logicalFolder name="root" displayName="root" projectFiles="true">
<logicalFolder name="HeaderFiles"
displayName="Header Files"
projectFiles="true">
<itemPath>../user_settings.h</itemPath>
</logicalFolder>
<logicalFolder name="LinkerScript"
displayName="Linker Files"
projectFiles="true">
</logicalFolder>
<logicalFolder name="SourceFiles"
displayName="Source Files"
projectFiles="true">
<logicalFolder name="wolfcrypt" displayName="wolfcrypt" projectFiles="true">
<itemPath>../../wolfcrypt/src/aes.c</itemPath>
<itemPath>../../wolfcrypt/src/arc4.c</itemPath>
<itemPath>../../wolfcrypt/src/asm.c</itemPath>
<itemPath>../../wolfcrypt/src/asn.c</itemPath>
<itemPath>../../wolfcrypt/src/blake2b.c</itemPath>
<itemPath>../../wolfcrypt/src/camellia.c</itemPath>
<itemPath>../../wolfcrypt/src/chacha.c</itemPath>
<itemPath>../../wolfcrypt/src/coding.c</itemPath>
<itemPath>../../wolfcrypt/src/compress.c</itemPath>
<itemPath>../../wolfcrypt/src/des3.c</itemPath>
<itemPath>../../wolfcrypt/src/dh.c</itemPath>
<itemPath>../../wolfcrypt/src/dsa.c</itemPath>
<itemPath>../../wolfcrypt/src/ecc.c</itemPath>
<itemPath>../../wolfcrypt/src/ecc_fp.c</itemPath>
<itemPath>../../wolfcrypt/src/error.c</itemPath>
<itemPath>../../wolfcrypt/src/hmac.c</itemPath>
<itemPath>../../wolfcrypt/src/integer.c</itemPath>
<itemPath>../../wolfcrypt/src/logging.c</itemPath>
<itemPath>../../wolfcrypt/src/md2.c</itemPath>
<itemPath>../../wolfcrypt/src/md4.c</itemPath>
<itemPath>../../wolfcrypt/src/md5.c</itemPath>
<itemPath>../../wolfcrypt/src/memory.c</itemPath>
<itemPath>../../wolfcrypt/src/misc.c</itemPath>
<itemPath>../../wolfcrypt/src/pkcs7.c</itemPath>
<itemPath>../../wolfcrypt/src/poly1305.c</itemPath>
<itemPath>../../wolfcrypt/src/pwdbased.c</itemPath>
<itemPath>../../wolfcrypt/src/random.c</itemPath>
<itemPath>../../wolfcrypt/src/ripemd.c</itemPath>
<itemPath>../../wolfcrypt/src/rsa.c</itemPath>
<itemPath>../../wolfcrypt/src/sha.c</itemPath>
<itemPath>../../wolfcrypt/src/sha256.c</itemPath>
<itemPath>../../wolfcrypt/src/sha512.c</itemPath>
<itemPath>../../wolfcrypt/src/tfm.c</itemPath>
<itemPath>../../wolfcrypt/src/wc_port.c</itemPath>
<itemPath>../../wolfcrypt/src/port/pic32/pic32mz-hash.c</itemPath>
<itemPath>../../wolfcrypt/src/port/pic32/pic32mz-crypt.c</itemPath>
<itemPath>../../wolfcrypt/src/hash.c</itemPath>
<itemPath>../../wolfcrypt/src/chacha20_poly1305.c</itemPath>
<itemPath>../../wolfcrypt/src/curve25519.c</itemPath>
<itemPath>../../wolfcrypt/src/ed25519.c</itemPath>
<itemPath>../../wolfcrypt/src/fe_low_mem.c</itemPath>
<itemPath>../../wolfcrypt/src/fe_operations.c</itemPath>
<itemPath>../../wolfcrypt/src/ge_low_mem.c</itemPath>
<itemPath>../../wolfcrypt/src/ge_operations.c</itemPath>
<itemPath>../../wolfcrypt/src/wc_encrypt.c</itemPath>
<itemPath>../../wolfcrypt/src/pkcs12.c</itemPath>
<itemPath>../../wolfcrypt/src/signature.c</itemPath>
<itemPath>../../wolfcrypt/src/wolfevent.c</itemPath>
<itemPath>../../wolfcrypt/src/wolfmath.c</itemPath>
</logicalFolder>
<logicalFolder name="src" displayName="wolfssl" projectFiles="true">
<itemPath>../../src/crl.c</itemPath>
<itemPath>../../src/internal.c</itemPath>
<itemPath>../../src/wolfio.c</itemPath>
<itemPath>../../src/keys.c</itemPath>
<itemPath>../../src/ocsp.c</itemPath>
<itemPath>../../src/sniffer.c</itemPath>
<itemPath>../../src/ssl.c</itemPath>
<itemPath>../../src/tls.c</itemPath>
<itemPath>../../src/tls13.c</itemPath>
</logicalFolder>
</logicalFolder>
<logicalFolder name="ExternalFiles"
displayName="Important Files"
projectFiles="false">
<itemPath>Makefile</itemPath>
</logicalFolder>
</logicalFolder>
<sourceRootList>
<Elem>..</Elem>
<Elem>../../ctaocrypt/src</Elem>
<Elem>../../src</Elem>
<Elem>../../wolfcrypt</Elem>
</sourceRootList>
<projectmakefile>Makefile</projectmakefile>
<confs>
<conf name="default" type="3">
<toolsSet>
<developmentServer>localhost</developmentServer>
<targetDevice>PIC32MX795F512L</targetDevice>
<targetHeader></targetHeader>
<targetPluginBoard></targetPluginBoard>
<platformTool>SKDEPIC32PlatformTool</platformTool>
<languageToolchain>XC32</languageToolchain>
<languageToolchainVersion>1.34</languageToolchainVersion>
<platform>4</platform>
</toolsSet>
<compileType>
<linkerTool>
<linkerLibItems>
</linkerLibItems>
</linkerTool>
<archiverTool>
</archiverTool>
<loading>
<useAlternateLoadableFile>false</useAlternateLoadableFile>
<parseOnProdLoad>false</parseOnProdLoad>
<alternateLoadableFile></alternateLoadableFile>
</loading>
</compileType>
<makeCustomizationType>
<makeCustomizationPreStepEnabled>false</makeCustomizationPreStepEnabled>
<makeCustomizationPreStep></makeCustomizationPreStep>
<makeCustomizationPostStepEnabled>false</makeCustomizationPostStepEnabled>
<makeCustomizationPostStep></makeCustomizationPostStep>
<makeCustomizationPutChecksumInUserID>false</makeCustomizationPutChecksumInUserID>
<makeCustomizationEnableLongLines>false</makeCustomizationEnableLongLines>
<makeCustomizationNormalizeHexFile>false</makeCustomizationNormalizeHexFile>
</makeCustomizationType>
<C32>
<property key="additional-warnings" value="false"/>
<property key="enable-app-io" value="false"/>
<property key="enable-omit-frame-pointer" value="false"/>
<property key="enable-symbols" value="false"/>
<property key="enable-unroll-loops" value="false"/>
<property key="exclude-floating-point" value="false"/>
<property key="extra-include-directories"
value="../../;../../mcapi;../../mplabx;../../zlib-1.2.8"/>
<property key="generate-16-bit-code" value="false"/>
<property key="generate-micro-compressed-code" value="false"/>
<property key="isolate-each-function" value="false"/>
<property key="make-warnings-into-errors" value="false"/>
<property key="optimization-level" value="-Os"/>
<property key="place-data-into-section" value="false"/>
<property key="post-instruction-scheduling" value="default"/>
<property key="pre-instruction-scheduling" value="default"/>
<property key="preprocessor-macros" value="WOLFSSL_USER_SETTINGS;HAVE_LIBZ;HAVE_MCAPI"/>
<property key="strict-ansi" value="false"/>
<property key="support-ansi" value="false"/>
<property key="use-cci" value="false"/>
<property key="use-iar" value="false"/>
<property key="use-indirect-calls" value="false"/>
</C32>
<C32-AR>
<property key="additional-options-chop-files" value="false"/>
</C32-AR>
<C32-AS>
<property key="assembler-symbols" value=""/>
<property key="enable-symbols" value="false"/>
<property key="exclude-floating-point-library" value="false"/>
<property key="expand-macros" value="false"/>
<property key="extra-include-directories-for-assembler" value="../../"/>
<property key="extra-include-directories-for-preprocessor" value="../../"/>
<property key="false-conditionals" value="false"/>
<property key="keep-locals" value="false"/>
<property key="list-assembly" value="false"/>
<property key="list-source" value="false"/>
<property key="list-symbols" value="false"/>
<property key="oXC32asm-list-to-file" value="false"/>
<property key="omit-debug-dirs" value="false"/>
<property key="omit-forms" value="false"/>
<property key="preprocessor-macros" value=""/>
<property key="warning-level" value=""/>
</C32-AS>
<C32-LD>
<property key="additional-options-use-response-files" value="false"/>
<property key="enable-check-sections" value="false"/>
<property key="exclude-floating-point-library" value="false"/>
<property key="exclude-standard-libraries" value="false"/>
<property key="extra-lib-directories" value=""/>
<property key="fill-flash-options-addr" value=""/>
<property key="fill-flash-options-const" value=""/>
<property key="fill-flash-options-how" value="0"/>
<property key="fill-flash-options-inc-const" value="1"/>
<property key="fill-flash-options-increment" value=""/>
<property key="fill-flash-options-seq" value=""/>
<property key="fill-flash-options-what" value="0"/>
<property key="generate-16-bit-code" value="false"/>
<property key="generate-cross-reference-file" value="false"/>
<property key="generate-micro-compressed-code" value="false"/>
<property key="heap-size" value=""/>
<property key="input-libraries" value=""/>
<property key="linker-symbols" value=""/>
<property key="map-file" value=""/>
<property key="no-startup-files" value="false"/>
<property key="oXC32ld-extra-opts" value=""/>
<property key="optimization-level" value="-Os"/>
<property key="preprocessor-macros" value=""/>
<property key="remove-unused-sections" value="true"/>
<property key="report-memory-usage" value="false"/>
<property key="stack-size" value=""/>
<property key="symbol-stripping" value="-s"/>
<property key="trace-symbols" value=""/>
<property key="warn-section-align" value="false"/>
</C32-LD>
<C32CPP>
<property key="additional-warnings" value="false"/>
<property key="check-new" value="false"/>
<property key="eh-specs" value="false"/>
<property key="enable-app-io" value="false"/>
<property key="enable-omit-frame-pointer" value="false"/>
<property key="enable-symbols" value="true"/>
<property key="enable-unroll-loops" value="false"/>
<property key="exceptions" value="false"/>
<property key="exclude-floating-point" value="false"/>
<property key="extra-include-directories" value=""/>
<property key="generate-16-bit-code" value="false"/>
<property key="generate-micro-compressed-code" value="false"/>
<property key="isolate-each-function" value="false"/>
<property key="make-warnings-into-errors" value="false"/>
<property key="optimization-level" value=""/>
<property key="place-data-into-section" value="false"/>
<property key="post-instruction-scheduling" value="default"/>
<property key="pre-instruction-scheduling" value="default"/>
<property key="preprocessor-macros" value=""/>
<property key="rtti" value="false"/>
<property key="strict-ansi" value="false"/>
<property key="use-cci" value="false"/>
<property key="use-iar" value="false"/>
<property key="use-indirect-calls" value="false"/>
</C32CPP>
<C32Global>
<property key="common-include-directories" value=""/>
<property key="gp-relative-option" value=""/>
<property key="legacy-libc" value="false"/>
<property key="relaxed-math" value="false"/>
<property key="save-temps" value="false"/>
<property key="wpo-lto" value="false"/>
</C32Global>
<SKDEPIC32PlatformTool>
<property key="whatToProgram" value="all"/>
</SKDEPIC32PlatformTool>
</conf>
</confs>
</configurationDescriptor>

View File

@@ -0,0 +1,11 @@
# vim:ft=automake
# All paths should be given relative to the root
#
EXTRA_DIST += \
mcapi/wolfssl.X/Makefile
EXTRA_DIST += \
mcapi/wolfssl.X/nbproject/configurations.xml \
mcapi/wolfssl.X/nbproject/project.xml

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>com.microchip.mplab.nbide.embedded.makeproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/make-project/1">
<name>wolfssl</name>
<creation-uuid>93bbfc3a-a0fa-4d48-bbc8-6cd47a2bd05b</creation-uuid>
<make-project-type>0</make-project-type>
<c-extensions>c</c-extensions>
<cpp-extensions/>
<header-extensions/>
<sourceEncoding>ISO-8859-1</sourceEncoding>
<asminc-extensions/>
<make-dep-projects/>
</data>
</configuration>
</project>

View File

@@ -0,0 +1,210 @@
<?xml version="1.0" encoding="UTF-8"?>
<configurationDescriptor version="62">
<logicalFolder name="root" displayName="root" projectFiles="true">
<logicalFolder name="HeaderFiles"
displayName="Header Files"
projectFiles="true">
</logicalFolder>
<logicalFolder name="LinkerScript"
displayName="Linker Files"
projectFiles="true">
</logicalFolder>
<logicalFolder name="SourceFiles"
displayName="Source Files"
projectFiles="true">
<itemPath>../../zlib/adler32.c</itemPath>
<itemPath>../../zlib/compress.c</itemPath>
<itemPath>../../zlib/crc32.c</itemPath>
<itemPath>../../zlib/deflate.c</itemPath>
<itemPath>../../zlib/gzclose.c</itemPath>
<itemPath>../../zlib/gzlib.c</itemPath>
<itemPath>../../zlib/gzread.c</itemPath>
<itemPath>../../zlib/gzwrite.c</itemPath>
<itemPath>../../zlib/infback.c</itemPath>
<itemPath>../../zlib/inffast.c</itemPath>
<itemPath>../../zlib/inflate.c</itemPath>
<itemPath>../../zlib/inftrees.c</itemPath>
<itemPath>../../zlib/trees.c</itemPath>
<itemPath>../../zlib/uncompr.c</itemPath>
<itemPath>../../zlib/zutil.c</itemPath>
</logicalFolder>
<logicalFolder name="ExternalFiles"
displayName="Important Files"
projectFiles="false">
<itemPath>Makefile</itemPath>
</logicalFolder>
</logicalFolder>
<projectmakefile>Makefile</projectmakefile>
<confs>
<conf name="default" type="3">
<toolsSet>
<developmentServer>localhost</developmentServer>
<targetDevice>PIC32MX795F512L</targetDevice>
<targetHeader></targetHeader>
<targetPluginBoard></targetPluginBoard>
<platformTool>PKOBSKDEPlatformTool</platformTool>
<languageToolchain>XC32</languageToolchain>
<languageToolchainVersion>1.34</languageToolchainVersion>
<platform>4</platform>
</toolsSet>
<compileType>
<linkerTool>
<linkerLibItems>
</linkerLibItems>
</linkerTool>
<archiverTool>
</archiverTool>
<loading>
<useAlternateLoadableFile>false</useAlternateLoadableFile>
<parseOnProdLoad>false</parseOnProdLoad>
<alternateLoadableFile></alternateLoadableFile>
</loading>
</compileType>
<makeCustomizationType>
<makeCustomizationPreStepEnabled>false</makeCustomizationPreStepEnabled>
<makeCustomizationPreStep></makeCustomizationPreStep>
<makeCustomizationPostStepEnabled>false</makeCustomizationPostStepEnabled>
<makeCustomizationPostStep></makeCustomizationPostStep>
<makeCustomizationPutChecksumInUserID>false</makeCustomizationPutChecksumInUserID>
<makeCustomizationEnableLongLines>false</makeCustomizationEnableLongLines>
<makeCustomizationNormalizeHexFile>false</makeCustomizationNormalizeHexFile>
</makeCustomizationType>
<C32>
<property key="additional-warnings" value="false"/>
<property key="enable-app-io" value="false"/>
<property key="enable-omit-frame-pointer" value="false"/>
<property key="enable-symbols" value="true"/>
<property key="enable-unroll-loops" value="false"/>
<property key="exclude-floating-point" value="false"/>
<property key="extra-include-directories" value="../../zlib"/>
<property key="generate-16-bit-code" value="false"/>
<property key="generate-micro-compressed-code" value="false"/>
<property key="isolate-each-function" value="false"/>
<property key="make-warnings-into-errors" value="false"/>
<property key="optimization-level" value="-Os"/>
<property key="place-data-into-section" value="false"/>
<property key="post-instruction-scheduling" value="default"/>
<property key="pre-instruction-scheduling" value="default"/>
<property key="preprocessor-macros"
value="HAVE_HIDDEN;MAX_MEM_LEVEL=1;MAX_WBITS=11"/>
<property key="strict-ansi" value="false"/>
<property key="support-ansi" value="false"/>
<property key="use-cci" value="false"/>
<property key="use-iar" value="false"/>
<property key="use-indirect-calls" value="false"/>
</C32>
<C32-AR>
<property key="additional-options-chop-files" value="false"/>
</C32-AR>
<C32-AS>
<property key="assembler-symbols" value=""/>
<property key="enable-symbols" value="true"/>
<property key="exclude-floating-point-library" value="false"/>
<property key="expand-macros" value="false"/>
<property key="extra-include-directories-for-assembler" value=""/>
<property key="extra-include-directories-for-preprocessor" value=""/>
<property key="false-conditionals" value="false"/>
<property key="keep-locals" value="false"/>
<property key="list-assembly" value="false"/>
<property key="list-source" value="false"/>
<property key="list-symbols" value="false"/>
<property key="oXC32asm-list-to-file" value="false"/>
<property key="omit-debug-dirs" value="false"/>
<property key="omit-forms" value="false"/>
<property key="preprocessor-macros" value=""/>
<property key="warning-level" value=""/>
</C32-AS>
<C32-LD>
<property key="additional-options-use-response-files" value="false"/>
<property key="enable-check-sections" value="false"/>
<property key="exclude-floating-point-library" value="false"/>
<property key="exclude-standard-libraries" value="false"/>
<property key="extra-lib-directories" value=""/>
<property key="fill-flash-options-addr" value=""/>
<property key="fill-flash-options-const" value=""/>
<property key="fill-flash-options-how" value="0"/>
<property key="fill-flash-options-inc-const" value="1"/>
<property key="fill-flash-options-increment" value=""/>
<property key="fill-flash-options-seq" value=""/>
<property key="fill-flash-options-what" value="0"/>
<property key="generate-16-bit-code" value="false"/>
<property key="generate-cross-reference-file" value="false"/>
<property key="generate-micro-compressed-code" value="false"/>
<property key="heap-size" value=""/>
<property key="input-libraries" value=""/>
<property key="linker-symbols" value=""/>
<property key="map-file" value=""/>
<property key="no-startup-files" value="false"/>
<property key="oXC32ld-extra-opts" value=""/>
<property key="optimization-level" value=""/>
<property key="preprocessor-macros" value=""/>
<property key="remove-unused-sections" value="false"/>
<property key="report-memory-usage" value="false"/>
<property key="stack-size" value=""/>
<property key="symbol-stripping" value=""/>
<property key="trace-symbols" value=""/>
<property key="warn-section-align" value="false"/>
</C32-LD>
<C32CPP>
<property key="additional-warnings" value="false"/>
<property key="check-new" value="false"/>
<property key="eh-specs" value="true"/>
<property key="enable-app-io" value="false"/>
<property key="enable-omit-frame-pointer" value="false"/>
<property key="enable-symbols" value="true"/>
<property key="enable-unroll-loops" value="false"/>
<property key="exceptions" value="true"/>
<property key="exclude-floating-point" value="false"/>
<property key="extra-include-directories" value=""/>
<property key="generate-16-bit-code" value="false"/>
<property key="generate-micro-compressed-code" value="false"/>
<property key="isolate-each-function" value="false"/>
<property key="make-warnings-into-errors" value="false"/>
<property key="optimization-level" value=""/>
<property key="place-data-into-section" value="false"/>
<property key="post-instruction-scheduling" value="default"/>
<property key="pre-instruction-scheduling" value="default"/>
<property key="preprocessor-macros" value=""/>
<property key="rtti" value="true"/>
<property key="strict-ansi" value="false"/>
<property key="use-cci" value="false"/>
<property key="use-iar" value="false"/>
<property key="use-indirect-calls" value="false"/>
</C32CPP>
<C32Global>
<property key="common-include-directories" value=""/>
<property key="gp-relative-option" value=""/>
<property key="legacy-libc" value="false"/>
<property key="relaxed-math" value="false"/>
<property key="save-temps" value="false"/>
<property key="wpo-lto" value="false"/>
</C32Global>
<PKOBSKDEPlatformTool>
<property key="AutoSelectMemRanges" value="auto"/>
<property key="SecureSegment.SegmentProgramming" value="FullChipProgramming"/>
<property key="ToolFirmwareFilePath"
value="Press to browse for a specific firmware version"/>
<property key="ToolFirmwareOption.UseLatestFirmware" value="true"/>
<property key="memories.configurationmemory" value="true"/>
<property key="memories.dataflash" value="true"/>
<property key="memories.eeprom" value="true"/>
<property key="memories.id" value="true"/>
<property key="memories.programmemory" value="true"/>
<property key="memories.programmemory.end" value="0x1d07ffff"/>
<property key="memories.programmemory.start" value="0x1d000000"/>
<property key="memories.userotp" value="true"/>
<property key="poweroptions.powerenable" value="false"/>
<property key="programoptions.donoteraseauxmem" value="false"/>
<property key="programoptions.eraseb4program" value="true"/>
<property key="programoptions.preservedataflash" value="false"/>
<property key="programoptions.preserveeeprom" value="false"/>
<property key="programoptions.preserveprogramrange" value="false"/>
<property key="programoptions.preserveprogramrange.end" value="0x1d0001ff"/>
<property key="programoptions.preserveprogramrange.start" value="0x1d000000"/>
<property key="programoptions.usehighvoltageonmclr" value="false"/>
<property key="programoptions.uselvpprogramming" value="false"/>
<property key="voltagevalue" value="3.25"/>
</PKOBSKDEPlatformTool>
</conf>
</confs>
</configurationDescriptor>

View File

@@ -0,0 +1,10 @@
# vim:ft=automake
# All paths should be given relative to the root
#
EXTRA_DIST += \
mcapi/zlib.X/Makefile
EXTRA_DIST += \
mcapi/zlib.X/nbproject/configurations.xml \
mcapi/zlib.X/nbproject/project.xml

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>com.microchip.mplab.nbide.embedded.makeproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/make-project/1">
<name>zlib</name>
<creation-uuid>8eef651d-e634-46ae-9183-39443c98e390</creation-uuid>
<make-project-type>0</make-project-type>
<c-extensions>c</c-extensions>
<cpp-extensions/>
<header-extensions/>
<sourceEncoding>ISO-8859-1</sourceEncoding>
<asminc-extensions/>
<make-dep-projects/>
</data>
</configuration>
</project>