Merge branch 'pic32mz' of https://github.com/kojo1/wolfssl into kojo-pic32

This commit is contained in:
toddouska
2015-02-19 17:58:21 -08:00
57 changed files with 1426 additions and 840 deletions

24
.gitignore vendored
View File

@ -119,20 +119,20 @@ IDE\MDK-ARM\LPC43xx\LPC43xx/
*.gcov
# MPLAB Generated Files (OS X)
mcapi/ctaocrypt_mcapi.X/nbproject/Makefile-*
mcapi/ctaocrypt_mcapi.X/nbproject/Package-default.bash
mcapi/ctaocrypt_test.X/nbproject/Makefile-*
mcapi/ctaocrypt_test.X/nbproject/Package-default.bash
mcapi/cyassl.X/nbproject/Makefile-*
mcapi/cyassl.X/nbproject/Package-default.bash
mcapi/wolfcrypt_mcapi.X/nbproject/Makefile-*
mcapi/wolfcrypt_mcapi.X/nbproject/Package-default.bash
mcapi/wolfcrypt_test.X/nbproject/Makefile-*
mcapi/wolfcrypt_test.X/nbproject/Package-default.bash
mcapi/wolfssl.X/nbproject/Makefile-*
mcapi/wolfssl.X/nbproject/Package-default.bash
mcapi/zlib.X/nbproject/Makefile-*
mcapi/zlib.X/nbproject/Package-default.bash
mplabx/ctaocrypt_benchmark.X/nbproject/Makefile-*
mplabx/ctaocrypt_benchmark.X/nbproject/Package-default.bash
mplabx/ctaocrypt_test.X/nbproject/Makefile-*
mplabx/ctaocrypt_test.X/nbproject/Package-default.bash
mplabx/cyassl.X/nbproject/Makefile-*
mplabx/cyassl.X/nbproject/Package-default.bash
mplabx/wolfcrypt_benchmark.X/nbproject/Makefile-*
mplabx/wolfcrypt_benchmark.X/nbproject/Package-default.bash
mplabx/wolfcrypt_test.X/nbproject/Makefile-*
mplabx/wolfcrypt_test.X/nbproject/Package-default.bash
mplabx/wolfssl.X/nbproject/Makefile-*
mplabx/wolfssl.X/nbproject/Package-default.bash
# Vagrant folder
.vagrant/

View File

@ -86,13 +86,13 @@ include mqx/cyassl/include.am
#include mqx/cyassl_client/Sources/include.am
include mqx/util_lib/Sources/include.am
include mplabx/include.am
include mplabx/ctaocrypt_benchmark.X/nbproject/include.am
include mplabx/ctaocrypt_test.X/nbproject/include.am
include mplabx/cyassl.X/nbproject/include.am
include mplabx/wolfcrypt_benchmark.X/nbproject/include.am
include mplabx/wolfcrypt_test.X/nbproject/include.am
include mplabx/wolfssl.X/nbproject/include.am
include mcapi/include.am
include mcapi/ctaocrypt_mcapi.X/nbproject/include.am
include mcapi/ctaocrypt_test.X/nbproject/include.am
include mcapi/cyassl.X/nbproject/include.am
include mcapi/wolfcrypt_mcapi.X/nbproject/include.am
include mcapi/wolfcrypt_test.X/nbproject/include.am
include mcapi/wolfssl.X/nbproject/include.am
include mcapi/zlib.X/nbproject/include.am
include tirtos/include.am

View File

@ -1,69 +1,69 @@
CyaSSL MPLAB X Project Files
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 CTaoCrypt API with compression support. For MPLAB X
projects that don't use compression and are generic to the CTaoCrypt API,
please see the <cyassl_root>/mplabx directory.
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 CTaoCrypt test or benchmark applications. This will
trying to build either the WolfCrypt test or benchmark applications. This will
correctly set up the respective project's Makefiles.
Included Project Files
-----------------------
1. CyaSSL library (cyassl.X)
1. wolfSSL library (wolfssl.X)
This project builds a static CyaSSL library. Prior to building this
This project builds a static wolfSSL library. Prior to building this
project, uncomment the MICROCHIP_PIC32 define located in:
<cyassl_root>/cyassl/ctaocrypt/settings.h
<wolfssl_root>/wolfssl/wolfcrypt/settings.h
After this project has been built, the compiled library will be located
at:
<cyassl_root>/mplabx/cyassl.X/dist/default/production/cyassl.X.a
<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. CTaoCrypt Test App (ctaocrypt_test.X)
2. wolfCrypt Test App (wolfcrypt_test.X)
This project tests the CTaoCrypt cryptography modules. It is generally
This project tests the wolfCrypt cryptography modules. It is generally
a good idea to run this first on an embedded system after compiling
CyaSSL in order to verify all underlying crypto is working correctly.
wolfSSL in order to verify all underlying crypto is working correctly.
3. CTaoCrypt Benchmark App (ctaocrypt_benchmark.X)
3. wolfCrypt Benchmark App (wolfcrypt_benchmark.X)
This project builds the CTaoCrypt benchmark application. If the CyaSSL
project (cyassl.X) has been compiled with libz support and is being
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 ctaocrypt_benchmark.X project before
the "Libraries" folder under the wolfcrypt_benchmark.X project before
it will compile successfully.
4. CTaoCrypt MCAPI Test App (ctaocrypt_mcapi.X)
4. wolfCrypt MCAPI Test App (wolfcrypt_mcapi.X)
This project tests the Microchip crytpo API layer. The Microchip crypto
layer is located under the <cyassl_root>/mcapi directory.
layer is located under the <wolfssl_root>/mcapi directory.
5. zlib library (zlib.X)
This project builds the zlib library for use in the ctaocrypt_test.X
and ctaocrypt_mcapi.X projects. This project expects the zlib sources
to be located under the CyaSSL root directory. Currently it is set up
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. Currently it is set up
to work with zlib 1.2.8, and looks for sources under:
<cyassl_root>/zlib-1.2.8
<wolfssl_root>/zlib-1.2.8
PIC32MX/PIC32MZ
---------------
The projects are set for PIC32MX by default. For PIC32MZ, change project
properties->Devices and add "CYASSL_MICROCHIP_PIC32M" to
properties->Devices and add "WOLFSSL_MICROCHIP_PIC32M" to
XC32-gcc->Preprocessing and messages-> Preprocessor macros.
MIPS16 and MIPS32 Support

View File

@ -51,7 +51,7 @@ int CRYPT_MD5_Initialize(CRYPT_MD5_CTX* md5)
if (md5 == NULL)
return BAD_FUNC_ARG;
InitMd5((Md5*)md5);
wc_InitMd5((Md5*)md5);
return 0;
}
@ -64,7 +64,7 @@ int CRYPT_MD5_DataAdd(CRYPT_MD5_CTX* md5, const unsigned char* input,
if (md5 == NULL || input == NULL)
return BAD_FUNC_ARG;
Md5Update((Md5*)md5, input, sz);
wc_Md5Update((Md5*)md5, input, sz);
return 0;
}
@ -76,7 +76,7 @@ int CRYPT_MD5_Finalize(CRYPT_MD5_CTX* md5, unsigned char* digest)
if (md5 == NULL || digest == NULL)
return BAD_FUNC_ARG;
Md5Final((Md5*)md5, digest);
wc_Md5Final((Md5*)md5, digest);
return 0;
}
@ -91,7 +91,7 @@ int CRYPT_SHA_Initialize(CRYPT_SHA_CTX* sha)
if (sha == NULL)
return BAD_FUNC_ARG;
return InitSha((Sha*)sha);
return wc_InitSha((Sha*)sha);
}
@ -102,7 +102,7 @@ int CRYPT_SHA_DataAdd(CRYPT_SHA_CTX* sha, const unsigned char* input,
if (sha == NULL || input == NULL)
return BAD_FUNC_ARG;
return ShaUpdate((Sha*)sha, input, sz);
return wc_ShaUpdate((Sha*)sha, input, sz);
}
@ -112,7 +112,7 @@ int CRYPT_SHA_Finalize(CRYPT_SHA_CTX* sha, unsigned char* digest)
if (sha == NULL || digest == NULL)
return BAD_FUNC_ARG;
return ShaFinal((Sha*)sha, digest);
return wc_ShaFinal((Sha*)sha, digest);
}
@ -125,7 +125,7 @@ int CRYPT_SHA256_Initialize(CRYPT_SHA256_CTX* sha256)
if (sha256 == NULL)
return BAD_FUNC_ARG;
return InitSha256((Sha256*)sha256);
return wc_InitSha256((Sha256*)sha256);
}
@ -136,7 +136,7 @@ int CRYPT_SHA256_DataAdd(CRYPT_SHA256_CTX* sha256, const unsigned char* input,
if (sha256 == NULL || input == NULL)
return BAD_FUNC_ARG;
return Sha256Update((Sha256*)sha256, input, sz);
return wc_Sha256Update((Sha256*)sha256, input, sz);
}
@ -146,7 +146,7 @@ int CRYPT_SHA256_Finalize(CRYPT_SHA256_CTX* sha256, unsigned char* digest)
if (sha256 == NULL || digest == NULL)
return BAD_FUNC_ARG;
return Sha256Final((Sha256*)sha256, digest);
return wc_Sha256Final((Sha256*)sha256, digest);
}
@ -159,7 +159,7 @@ int CRYPT_SHA384_Initialize(CRYPT_SHA384_CTX* sha384)
if (sha384 == NULL)
return BAD_FUNC_ARG;
return InitSha384((Sha384*)sha384);
return wc_InitSha384((Sha384*)sha384);
}
@ -170,7 +170,7 @@ int CRYPT_SHA384_DataAdd(CRYPT_SHA384_CTX* sha384, const unsigned char* input,
if (sha384 == NULL || input == NULL)
return BAD_FUNC_ARG;
return Sha384Update((Sha384*)sha384, input, sz);
return wc_Sha384Update((Sha384*)sha384, input, sz);
}
@ -180,7 +180,7 @@ int CRYPT_SHA384_Finalize(CRYPT_SHA384_CTX* sha384, unsigned char* digest)
if (sha384 == NULL || digest == NULL)
return BAD_FUNC_ARG;
return Sha384Final((Sha384*)sha384, digest);
return wc_Sha384Final((Sha384*)sha384, digest);
}
@ -193,7 +193,7 @@ int CRYPT_SHA512_Initialize(CRYPT_SHA512_CTX* sha512)
if (sha512 == NULL)
return BAD_FUNC_ARG;
return InitSha512((Sha512*)sha512);
return wc_InitSha512((Sha512*)sha512);
}
@ -204,7 +204,7 @@ int CRYPT_SHA512_DataAdd(CRYPT_SHA512_CTX* sha512, const unsigned char* input,
if (sha512 == NULL || input == NULL)
return BAD_FUNC_ARG;
return Sha512Update((Sha512*)sha512, input, sz);
return wc_Sha512Update((Sha512*)sha512, input, sz);
}
@ -214,7 +214,7 @@ int CRYPT_SHA512_Finalize(CRYPT_SHA512_CTX* sha512, unsigned char* digest)
if (sha512 == NULL || digest == NULL)
return BAD_FUNC_ARG;
return Sha512Final((Sha512*)sha512, digest);
return wc_Sha512Final((Sha512*)sha512, digest);
}
@ -233,7 +233,7 @@ int CRYPT_HMAC_SetKey(CRYPT_HMAC_CTX* hmac, int type, const unsigned char* key,
return BAD_FUNC_ARG; /* bad hmac type */
}
return HmacSetKey((Hmac*)hmac, type, key, sz);
return wc_HmacSetKey((Hmac*)hmac, type, key, sz);
}
@ -243,7 +243,7 @@ int CRYPT_HMAC_DataAdd(CRYPT_HMAC_CTX* hmac, const unsigned char* input,
if (hmac == NULL || input == NULL)
return BAD_FUNC_ARG;
return HmacUpdate((Hmac*)hmac, input, sz);
return wc_HmacUpdate((Hmac*)hmac, input, sz);
}
@ -253,7 +253,7 @@ int CRYPT_HMAC_Finalize(CRYPT_HMAC_CTX* hmac, unsigned char* digest)
if (hmac == NULL || digest == NULL)
return BAD_FUNC_ARG;
return HmacFinal((Hmac*)hmac, digest);
return wc_HmacFinal((Hmac*)hmac, digest);
}
@ -336,7 +336,7 @@ int CRYPT_TDES_IvSet(CRYPT_TDES_CTX* tdes, const unsigned char* iv)
if (tdes == NULL || iv == NULL)
return BAD_FUNC_ARG;
return Des3_SetIV((Des3*)tdes, iv);
return wc_Des3_SetIV((Des3*)tdes, iv);
}
@ -347,7 +347,7 @@ int CRYPT_TDES_CBC_Encrypt(CRYPT_TDES_CTX* tdes, unsigned char* out,
if (tdes == NULL || out == NULL || in == NULL)
return BAD_FUNC_ARG;
return Des3_CbcEncrypt((Des3*)tdes, out, in, inSz);
return wc_Des3_CbcEncrypt((Des3*)tdes, out, in, inSz);
}
@ -372,7 +372,7 @@ int CRYPT_AES_KeySet(CRYPT_AES_CTX* aes, const unsigned char* key,
if (aes == NULL || key == NULL)
return BAD_FUNC_ARG;
return AesSetKey((Aes*)aes, key, keyLen, iv, dir);
return wc_AesSetKey((Aes*)aes, key, keyLen, iv, dir);
}
@ -382,7 +382,7 @@ int CRYPT_AES_IvSet(CRYPT_AES_CTX* aes, const unsigned char* iv)
if (aes == NULL || iv == NULL)
return BAD_FUNC_ARG;
return AesSetIV((Aes*)aes, iv);
return wc_AesSetIV((Aes*)aes, iv);
}
@ -393,7 +393,7 @@ int CRYPT_AES_CBC_Encrypt(CRYPT_AES_CTX* aes, unsigned char* out,
if (aes == NULL || out == NULL || in == NULL)
return BAD_FUNC_ARG;
return AesCbcEncrypt((Aes*)aes, out, in, inSz);
return wc_AesCbcEncrypt((Aes*)aes, out, in, inSz);
}
@ -415,7 +415,7 @@ int CRYPT_AES_CTR_Encrypt(CRYPT_AES_CTX* aes, unsigned char* out,
if (aes == NULL || out == NULL || in == NULL)
return BAD_FUNC_ARG;
AesCtrEncrypt((Aes*)aes, out, in, inSz);
wc_AesCtrEncrypt((Aes*)aes, out, in, inSz);
return 0;
}
@ -428,7 +428,7 @@ int CRYPT_AES_DIRECT_Encrypt(CRYPT_AES_CTX* aes, unsigned char* out,
if (aes == NULL || out == NULL || in == NULL)
return BAD_FUNC_ARG;
AesEncryptDirect((Aes*)aes, out, in);
wc_AesEncryptDirect((Aes*)aes, out, in);
return 0;
}
@ -441,7 +441,7 @@ int CRYPT_AES_DIRECT_Decrypt(CRYPT_AES_CTX* aes, unsigned char* out,
if (aes == NULL || out == NULL || in == NULL)
return BAD_FUNC_ARG;
AesDecryptDirect((Aes*)aes, out, in);
wc_AesDecryptDirect((Aes*)aes, out, in);
return 0;
}
@ -548,7 +548,7 @@ int CRYPT_ECC_Initialize(CRYPT_ECC_CTX* ecc)
if (ecc->holder == NULL)
return -1;
ecc_init((ecc_key*)ecc->holder);
wc_ecc_init((ecc_key*)ecc->holder);
return 0;
}
@ -560,7 +560,7 @@ int CRYPT_ECC_Free(CRYPT_ECC_CTX* ecc)
if (ecc == NULL)
return BAD_FUNC_ARG;
ecc_free((ecc_key*)ecc->holder);
wc_ecc_free((ecc_key*)ecc->holder);
XFREE(ecc->holder, NULL, DYNAMIC_TYPE_ECC);
ecc->holder = NULL;
@ -578,7 +578,7 @@ int CRYPT_ECC_PublicExport(CRYPT_ECC_CTX* ecc, unsigned char* out,
if (ecc == NULL || out == NULL)
return BAD_FUNC_ARG;
ret = ecc_export_x963((ecc_key*)ecc->holder, out, &inOut);
ret = wc_ecc_export_x963((ecc_key*)ecc->holder, out, &inOut);
*usedSz = inOut;
return ret;
@ -592,7 +592,7 @@ int CRYPT_ECC_PublicImport(CRYPT_ECC_CTX* ecc, const unsigned char* in,
if (ecc == NULL || in == NULL)
return BAD_FUNC_ARG;
return ecc_import_x963(in, inSz, (ecc_key*)ecc->holder);
return wc_ecc_import_x963(in, inSz, (ecc_key*)ecc->holder);
}
@ -603,7 +603,7 @@ int CRYPT_ECC_PrivateImport(CRYPT_ECC_CTX* ecc, const unsigned char* priv,
if (ecc == NULL || priv == NULL || pub == NULL)
return BAD_FUNC_ARG;
return ecc_import_private_key(priv, privSz, pub, pubSz,
return wc_ecc_import_private_key(priv, privSz, pub, pubSz,
(ecc_key*)ecc->holder);
}
@ -614,7 +614,7 @@ 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 ecc_make_key((RNG*)rng, keySz, (ecc_key*)ecc->holder);
return wc_ecc_make_key((RNG*)rng, keySz, (ecc_key*)ecc->holder);
}
@ -628,7 +628,7 @@ int CRYPT_ECC_DHE_SharedSecretMake(CRYPT_ECC_CTX* priv, CRYPT_ECC_CTX* pub,
if (priv == NULL || pub == NULL || out == NULL || usedSz == NULL)
return BAD_FUNC_ARG;
ret = ecc_shared_secret((ecc_key*)priv->holder, (ecc_key*)pub->holder,
ret = wc_ecc_shared_secret((ecc_key*)priv->holder, (ecc_key*)pub->holder,
out, &inOut);
*usedSz = inOut;
@ -649,7 +649,7 @@ int CRYPT_ECC_DSA_HashSign(CRYPT_ECC_CTX* ecc, CRYPT_RNG_CTX* rng,
in == NULL)
return BAD_FUNC_ARG;
ret = ecc_sign_hash(in, inSz, sig, &inOut, (RNG*)rng,
ret = wc_ecc_sign_hash(in, inSz, sig, &inOut, (RNG*)rng,
(ecc_key*)ecc->holder);
*usedSz = inOut;
@ -665,7 +665,7 @@ int CRYPT_ECC_DSA_HashVerify(CRYPT_ECC_CTX* ecc, const unsigned char* sig,
if (ecc == NULL || sig == NULL || hash == NULL || status == NULL)
return BAD_FUNC_ARG;
return ecc_verify_hash(sig, sigSz, hash, hashSz, status,
return wc_ecc_verify_hash(sig, sigSz, hash, hashSz, status,
(ecc_key*)ecc->holder);
}
@ -676,7 +676,7 @@ int CRYPT_ECC_KeySizeGet(CRYPT_ECC_CTX* ecc)
if (ecc == NULL)
return BAD_FUNC_ARG;
return ecc_size((ecc_key*)ecc->holder);
return wc_ecc_size((ecc_key*)ecc->holder);
}
@ -686,7 +686,7 @@ int CRYPT_ECC_SignatureSizeGet(CRYPT_ECC_CTX* ecc)
if (ecc == NULL)
return BAD_FUNC_ARG;
return ecc_sig_size((ecc_key*)ecc->holder);
return wc_ecc_sig_size((ecc_key*)ecc->holder);
}

View File

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

View File

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

View File

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

View File

@ -27,24 +27,24 @@
/* mc api header */
#include "crypto.h"
#include <cyassl/ctaocrypt/settings.h>
#include <wolfssl/wolfcrypt/settings.h>
/* sanity test against our default implementation, cyassl headers */
#include <cyassl/ctaocrypt/md5.h>
#include <cyassl/ctaocrypt/sha.h>
#include <cyassl/ctaocrypt/sha256.h>
#include <cyassl/ctaocrypt/sha512.h>
#include <cyassl/ctaocrypt/hmac.h>
#include <cyassl/ctaocrypt/compress.h>
#include <cyassl/ctaocrypt/random.h>
#include <cyassl/ctaocrypt/des3.h>
#include <cyassl/ctaocrypt/aes.h>
#include <cyassl/ctaocrypt/ecc.h>
#include <cyassl/ctaocrypt/rsa.h>
/* sanity test against our default implementation, wolfssl headers */
#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/ecc.h>
#include <wolfssl/wolfcrypt/rsa.h>
#define USE_CERT_BUFFERS_1024
#include <cyassl/certs_test.h>
#include <wolfssl/certs_test.h>
#if defined(CYASSL_MICROCHIP_PIC32MZ)
#if defined(WOLFSSL_MICROCHIP_PIC32MZ)
#define MICROCHIP_PIC32
#include <xc.h>
#pragma config ICESEL = ICS_PGx2
@ -217,13 +217,13 @@ static int check_md5(void)
byte defDigest[MD5_DIGEST_SIZE];
CRYPT_MD5_Initialize(&mcMd5);
InitMd5(&defMd5);
wc_InitMd5(&defMd5);
CRYPT_MD5_DataAdd(&mcMd5, ourData, OUR_DATA_SIZE);
Md5Update(&defMd5, ourData, OUR_DATA_SIZE);
wc_Md5Update(&defMd5, ourData, OUR_DATA_SIZE);
CRYPT_MD5_Finalize(&mcMd5, mcDigest);
Md5Final(&defMd5, defDigest);
wc_Md5Final(&defMd5, defDigest);
if (memcmp(mcDigest, defDigest, CRYPT_MD5_DIGEST_SIZE) != 0) {
printf("md5 final memcmp fialed\n");
@ -245,17 +245,17 @@ static int check_sha(void)
byte defDigest[SHA_DIGEST_SIZE];
CRYPT_SHA_Initialize(&mcSha);
ret = InitSha(&defSha);
ret = wc_InitSha(&defSha);
if (ret != 0) {
printf("sha init default failed\n");
return -1;
}
CRYPT_SHA_DataAdd(&mcSha, ourData, OUR_DATA_SIZE);
ShaUpdate(&defSha, ourData, OUR_DATA_SIZE);
wc_ShaUpdate(&defSha, ourData, OUR_DATA_SIZE);
CRYPT_SHA_Finalize(&mcSha, mcDigest);
ShaFinal(&defSha, defDigest);
wc_ShaFinal(&defSha, defDigest);
if (memcmp(mcDigest, defDigest, CRYPT_SHA_DIGEST_SIZE) != 0) {
printf("sha final memcmp failed\n");
@ -277,21 +277,21 @@ static int check_sha256(void)
byte defDigest[SHA256_DIGEST_SIZE];
CRYPT_SHA256_Initialize(&mcSha256);
ret = InitSha256(&defSha256);
ret = wc_InitSha256(&defSha256);
if (ret != 0) {
printf("sha256 init default failed\n");
return -1;
}
CRYPT_SHA256_DataAdd(&mcSha256, ourData, OUR_DATA_SIZE);
ret = Sha256Update(&defSha256, ourData, OUR_DATA_SIZE);
ret = wc_Sha256Update(&defSha256, ourData, OUR_DATA_SIZE);
if (ret != 0) {
printf("sha256 update default failed\n");
return -1;
}
CRYPT_SHA256_Finalize(&mcSha256, mcDigest);
ret = Sha256Final(&defSha256, defDigest);
ret = wc_Sha256Final(&defSha256, defDigest);
if (ret != 0) {
printf("sha256 final default failed\n");
return -1;
@ -317,21 +317,21 @@ static int check_sha384(void)
byte defDigest[SHA384_DIGEST_SIZE];
CRYPT_SHA384_Initialize(&mcSha384);
ret = InitSha384(&defSha384);
ret = wc_InitSha384(&defSha384);
if (ret != 0) {
printf("sha384 init default failed\n");
return -1;
}
CRYPT_SHA384_DataAdd(&mcSha384, ourData, OUR_DATA_SIZE);
ret = Sha384Update(&defSha384, ourData, OUR_DATA_SIZE);
ret = wc_Sha384Update(&defSha384, ourData, OUR_DATA_SIZE);
if (ret != 0) {
printf("sha384 update default failed\n");
return -1;
}
CRYPT_SHA384_Finalize(&mcSha384, mcDigest);
ret = Sha384Final(&defSha384, defDigest);
ret = wc_Sha384Final(&defSha384, defDigest);
if (ret != 0) {
printf("sha384 final default failed\n");
return -1;
@ -357,21 +357,21 @@ static int check_sha512(void)
byte defDigest[SHA512_DIGEST_SIZE];
CRYPT_SHA512_Initialize(&mcSha512);
ret = InitSha512(&defSha512);
ret = wc_InitSha512(&defSha512);
if (ret != 0) {
printf("sha512 init default failed\n");
return -1;
}
CRYPT_SHA512_DataAdd(&mcSha512, ourData, OUR_DATA_SIZE);
ret = Sha512Update(&defSha512, ourData, OUR_DATA_SIZE);
ret = wc_Sha512Update(&defSha512, ourData, OUR_DATA_SIZE);
if (ret != 0) {
printf("sha512 update default failed\n");
return -1;
}
CRYPT_SHA512_Finalize(&mcSha512, mcDigest);
ret = Sha512Final(&defSha512, defDigest);
ret = wc_Sha512Final(&defSha512, defDigest);
if (ret != 0) {
printf("sha512 final default failed\n");
return -1;
@ -400,21 +400,21 @@ static int check_hmac(void)
/* SHA1 */
CRYPT_HMAC_SetKey(&mcHmac, CRYPT_HMAC_SHA, key, 4);
ret = HmacSetKey(&defHmac, SHA, key, 4);
ret = wc_HmacSetKey(&defHmac, SHA, key, 4);
if (ret != 0) {
printf("hmac sha setkey default failed\n");
return -1;
}
CRYPT_HMAC_DataAdd(&mcHmac, ourData, OUR_DATA_SIZE);
ret = HmacUpdate(&defHmac, ourData, OUR_DATA_SIZE);
ret = wc_HmacUpdate(&defHmac, ourData, OUR_DATA_SIZE);
if (ret != 0) {
printf("hmac sha update default failed\n");
return -1;
}
CRYPT_HMAC_Finalize(&mcHmac, mcDigest);
ret = HmacFinal(&defHmac, defDigest);
ret = wc_HmacFinal(&defHmac, defDigest);
if (ret != 0) {
printf("hmac sha final default failed\n");
return -1;
@ -428,21 +428,21 @@ static int check_hmac(void)
/* SHA-256 */
CRYPT_HMAC_SetKey(&mcHmac, CRYPT_HMAC_SHA256, key, 4);
ret = HmacSetKey(&defHmac, SHA256, key, 4);
ret = wc_HmacSetKey(&defHmac, SHA256, key, 4);
if (ret != 0) {
printf("hmac sha256 setkey default failed\n");
return -1;
}
CRYPT_HMAC_DataAdd(&mcHmac, ourData, OUR_DATA_SIZE);
ret = HmacUpdate(&defHmac, ourData, OUR_DATA_SIZE);
ret = wc_HmacUpdate(&defHmac, ourData, OUR_DATA_SIZE);
if (ret != 0) {
printf("hmac sha256 update default failed\n");
return -1;
}
CRYPT_HMAC_Finalize(&mcHmac, mcDigest);
ret = HmacFinal(&defHmac, defDigest);
ret = wc_HmacFinal(&defHmac, defDigest);
if (ret != 0) {
printf("hmac sha256 final default failed\n");
return -1;
@ -456,21 +456,21 @@ static int check_hmac(void)
/* SHA-384 */
CRYPT_HMAC_SetKey(&mcHmac, CRYPT_HMAC_SHA384, key, 4);
ret = HmacSetKey(&defHmac, SHA384, key, 4);
ret = wc_HmacSetKey(&defHmac, SHA384, key, 4);
if (ret != 0) {
printf("hmac sha384 setkey default failed\n");
return -1;
}
CRYPT_HMAC_DataAdd(&mcHmac, ourData, OUR_DATA_SIZE);
ret = HmacUpdate(&defHmac, ourData, OUR_DATA_SIZE);
ret = wc_HmacUpdate(&defHmac, ourData, OUR_DATA_SIZE);
if (ret != 0) {
printf("hmac sha384 update default failed\n");
return -1;
}
CRYPT_HMAC_Finalize(&mcHmac, mcDigest);
ret = HmacFinal(&defHmac, defDigest);
ret = wc_HmacFinal(&defHmac, defDigest);
if (ret != 0) {
printf("hmac sha384 final default failed\n");
return -1;
@ -484,21 +484,21 @@ static int check_hmac(void)
/* SHA-512 */
CRYPT_HMAC_SetKey(&mcHmac, CRYPT_HMAC_SHA512, key, 4);
ret = HmacSetKey(&defHmac, SHA512, key, 4);
ret = wc_HmacSetKey(&defHmac, SHA512, key, 4);
if (ret != 0) {
printf("hmac sha512 setkey default failed\n");
return -1;
}
CRYPT_HMAC_DataAdd(&mcHmac, ourData, OUR_DATA_SIZE);
ret = HmacUpdate(&defHmac, ourData, OUR_DATA_SIZE);
ret = wc_HmacUpdate(&defHmac, ourData, OUR_DATA_SIZE);
if (ret != 0) {
printf("hmac sha512 update default failed\n");
return -1;
}
CRYPT_HMAC_Finalize(&mcHmac, mcDigest);
ret = HmacFinal(&defHmac, defDigest);
ret = wc_HmacFinal(&defHmac, defDigest);
if (ret != 0) {
printf("hmac sha512 final default failed\n");
return -1;
@ -543,7 +543,7 @@ static int check_compress(void)
/* dynamic */
ret1 = CRYPT_HUFFMAN_Compress(cBuffer, sizeof(cBuffer), text, inSz, 0);
ret2 = Compress(dBuffer, sizeof(dBuffer), text, inSz, 0);
ret2 = wc_Compress(dBuffer, sizeof(dBuffer), text, inSz, 0);
if (ret1 != ret2 || ret1 < 0) {
printf("compress dynamic ret failed\n");
@ -566,7 +566,7 @@ static int check_compress(void)
memset(dBuffer, 0, sizeof(dBuffer));
ret1 = DeCompress(dBuffer, sizeof(dBuffer), cBuffer, outSz);
ret1 = wc_DeCompress(dBuffer, sizeof(dBuffer), cBuffer, outSz);
if (memcmp(dBuffer, text, inSz) != 0) {
printf("decompress dynamic cmp failed\n");
@ -578,7 +578,7 @@ static int check_compress(void)
/* static */
ret1 = CRYPT_HUFFMAN_Compress(cBuffer, sizeof(cBuffer), text, inSz, 1);
ret2 = Compress(dBuffer, sizeof(dBuffer), text, inSz, 1);
ret2 = wc_Compress(dBuffer, sizeof(dBuffer), text, inSz, 1);
if (ret1 != ret2 || ret1 < 0) {
printf("compress static ret failed\n");
@ -601,7 +601,7 @@ static int check_compress(void)
memset(dBuffer, 0, sizeof(dBuffer));
ret1 = DeCompress(dBuffer, sizeof(dBuffer), cBuffer, outSz);
ret1 = wc_DeCompress(dBuffer, sizeof(dBuffer), cBuffer, outSz);
if (memcmp(dBuffer, text, inSz) != 0) {
printf("decompress static cmp failed\n");
@ -630,7 +630,7 @@ static int check_rng(void)
for (i = 0; i < RANDOM_BYTE_SZ; i++)
out[i] = (byte)i;
ret = InitRng(&defRng);
ret = wc_InitRng(&defRng);
if (ret != 0) {
printf("default rng init failed\n");
return -1;
@ -685,7 +685,7 @@ static int check_des3(void)
printf("mcapi tdes key set failed\n");
return -1;
}
ret = Des3_SetKey(&defDes3, key, iv, DES_ENCRYPTION);
ret = wc_Des3_SetKey(&defDes3, key, iv, DES_ENCRYPTION);
if (ret != 0) {
printf("default des3 key set failed\n");
return -1;
@ -696,7 +696,7 @@ static int check_des3(void)
printf("mcapi tdes cbc encrypt failed\n");
return -1;
}
ret = Des3_CbcEncrypt(&defDes3, out2, ourData, TDES_TEST_SIZE);
ret = wc_Des3_CbcEncrypt(&defDes3, out2, ourData, TDES_TEST_SIZE);
if (ret != 0) {
printf("mcapi default tdes cbc encrypt failed\n");
return -1;
@ -713,7 +713,7 @@ static int check_des3(void)
printf("mcapi tdes key set failed\n");
return -1;
}
ret = Des3_SetKey(&defDes3, key, iv, DES_DECRYPTION);
ret = wc_Des3_SetKey(&defDes3, key, iv, DES_DECRYPTION);
if (ret != 0) {
printf("default des3 key set failed\n");
return -1;
@ -724,7 +724,7 @@ static int check_des3(void)
printf("mcapi tdes cbc decrypt failed\n");
return -1;
}
ret = Des3_CbcDecrypt(&defDes3, out1, out1, TDES_TEST_SIZE);
ret = wc_Des3_CbcDecrypt(&defDes3, out1, out1, TDES_TEST_SIZE);
if (ret != 0) {
printf("mcapi default tdes cbc decrypt failed\n");
return -1;
@ -766,7 +766,7 @@ static int check_aescbc(void)
printf("mcapi aes-128 key set failed\n");
return -1;
}
ret = AesSetKey(&defAes, key, 16, iv, AES_ENCRYPTION);
ret = wc_AesSetKey(&defAes, key, 16, iv, AES_ENCRYPTION);
if (ret != 0) {
printf("default aes-128 key set failed\n");
return -1;
@ -777,7 +777,7 @@ static int check_aescbc(void)
printf("mcapi aes-128 cbc encrypt failed\n");
return -1;
}
AesCbcEncrypt(&defAes, out2, ourData, AES_TEST_SIZE);
wc_AesCbcEncrypt(&defAes, out2, ourData, AES_TEST_SIZE);
if (memcmp(out1, out2, AES_TEST_SIZE) != 0) {
printf("mcapi aes-128 cbc encrypt cmp failed\n");
@ -790,7 +790,7 @@ static int check_aescbc(void)
printf("mcapi aes-128 key set failed\n");
return -1;
}
ret = AesSetKey(&defAes, key, 16, iv, DES_DECRYPTION);
ret = wc_AesSetKey(&defAes, key, 16, iv, DES_DECRYPTION);
if (ret != 0) {
printf("default aes-128 key set failed\n");
return -1;
@ -801,7 +801,7 @@ static int check_aescbc(void)
printf("mcapi aes-128 cbc decrypt failed\n");
return -1;
}
AesCbcDecrypt(&defAes, out1, out1, AES_TEST_SIZE);
wc_AesCbcDecrypt(&defAes, out1, out1, AES_TEST_SIZE);
if (memcmp(out1, out2, AES_TEST_SIZE) != 0) {
printf("mcapi aes-128 cbc decrypt cmp failed\n");
@ -819,7 +819,7 @@ static int check_aescbc(void)
printf("mcapi aes-192 key set failed\n");
return -1;
}
ret = AesSetKey(&defAes, key, 24, iv, AES_ENCRYPTION);
ret = wc_AesSetKey(&defAes, key, 24, iv, AES_ENCRYPTION);
if (ret != 0) {
printf("default aes-192 key set failed\n");
return -1;
@ -830,7 +830,7 @@ static int check_aescbc(void)
printf("mcapi aes-192 cbc encrypt failed\n");
return -1;
}
AesCbcEncrypt(&defAes, out2, ourData, AES_TEST_SIZE);
wc_AesCbcEncrypt(&defAes, out2, ourData, AES_TEST_SIZE);
if (memcmp(out1, out2, AES_TEST_SIZE) != 0) {
printf("mcapi aes-192 cbc encrypt cmp failed\n");
@ -843,7 +843,7 @@ static int check_aescbc(void)
printf("mcapi aes-192 key set failed\n");
return -1;
}
ret = AesSetKey(&defAes, key, 24, iv, AES_DECRYPTION);
ret = wc_AesSetKey(&defAes, key, 24, iv, AES_DECRYPTION);
if (ret != 0) {
printf("default aes-192 key set failed\n");
return -1;
@ -854,7 +854,7 @@ static int check_aescbc(void)
printf("mcapi aes-192 cbc decrypt failed\n");
return -1;
}
AesCbcDecrypt(&defAes, out1, out1, AES_TEST_SIZE);
wc_AesCbcDecrypt(&defAes, out1, out1, AES_TEST_SIZE);
if (memcmp(out1, out2, AES_TEST_SIZE) != 0) {
printf("mcapi aes-192 cbc decrypt cmp failed\n");
@ -872,7 +872,7 @@ static int check_aescbc(void)
printf("mcapi aes-256 key set failed\n");
return -1;
}
ret = AesSetKey(&defAes, key, 32, iv, AES_ENCRYPTION);
ret = wc_AesSetKey(&defAes, key, 32, iv, AES_ENCRYPTION);
if (ret != 0) {
printf("default aes-256 key set failed\n");
return -1;
@ -883,7 +883,7 @@ static int check_aescbc(void)
printf("mcapi aes-256 cbc encrypt failed\n");
return -1;
}
AesCbcEncrypt(&defAes, out2, ourData, AES_TEST_SIZE);
wc_AesCbcEncrypt(&defAes, out2, ourData, AES_TEST_SIZE);
if (memcmp(out1, out2, AES_TEST_SIZE) != 0) {
printf("mcapi aes-256 cbc encrypt cmp failed\n");
@ -896,7 +896,7 @@ static int check_aescbc(void)
printf("mcapi aes-256 key set failed\n");
return -1;
}
ret = AesSetKey(&defAes, key, 32, iv, AES_DECRYPTION);
ret = wc_AesSetKey(&defAes, key, 32, iv, AES_DECRYPTION);
if (ret != 0) {
printf("default aes-256 key set failed\n");
return -1;
@ -907,7 +907,7 @@ static int check_aescbc(void)
printf("mcapi aes-256 cbc decrypt failed\n");
return -1;
}
AesCbcDecrypt(&defAes, out1, out1, AES_TEST_SIZE);
wc_AesCbcDecrypt(&defAes, out1, out1, AES_TEST_SIZE);
if (memcmp(out1, out2, AES_TEST_SIZE) != 0) {
printf("mcapi aes-256 cbc decrypt cmp failed\n");
@ -943,7 +943,7 @@ static int check_aesctr(void)
printf("mcapi aes-128 key set failed\n");
return -1;
}
ret = AesSetKey(&defAes, key, 16, iv, AES_ENCRYPTION);
ret = wc_AesSetKey(&defAes, key, 16, iv, AES_ENCRYPTION);
if (ret != 0) {
printf("default aes-128 key set failed\n");
return -1;
@ -954,7 +954,7 @@ static int check_aesctr(void)
printf("mcapi aes-128 ctr encrypt failed\n");
return -1;
}
AesCtrEncrypt(&defAes, out2, ourData, AES_TEST_SIZE);
wc_AesCtrEncrypt(&defAes, out2, ourData, AES_TEST_SIZE);
if (memcmp(out1, out2, AES_TEST_SIZE) != 0) {
printf("mcapi aes-128 ctr encrypt cmp failed\n");
@ -967,7 +967,7 @@ static int check_aesctr(void)
printf("mcapi aes-128 key set failed\n");
return -1;
}
ret = AesSetKey(&defAes, key, 16, iv, AES_ENCRYPTION);
ret = wc_AesSetKey(&defAes, key, 16, iv, AES_ENCRYPTION);
if (ret != 0) {
printf("default aes-128 key set failed\n");
return -1;
@ -990,7 +990,7 @@ static int check_aesctr(void)
printf("mcapi aes-192 key set failed\n");
return -1;
}
ret = AesSetKey(&defAes, key, 24, iv, AES_ENCRYPTION);
ret = wc_AesSetKey(&defAes, key, 24, iv, AES_ENCRYPTION);
if (ret != 0) {
printf("default aes-192 key set failed\n");
return -1;
@ -1001,7 +1001,7 @@ static int check_aesctr(void)
printf("mcapi aes-192 ctr encrypt failed\n");
return -1;
}
AesCtrEncrypt(&defAes, out2, ourData, AES_TEST_SIZE);
wc_AesCtrEncrypt(&defAes, out2, ourData, AES_TEST_SIZE);
if (memcmp(out1, out2, AES_TEST_SIZE) != 0) {
printf("mcapi aes-192 ctr encrypt cmp failed\n");
@ -1014,7 +1014,7 @@ static int check_aesctr(void)
printf("mcapi aes-192 key set failed\n");
return -1;
}
ret = AesSetKey(&defAes, key, 24, iv, AES_DECRYPTION);
ret = wc_AesSetKey(&defAes, key, 24, iv, AES_DECRYPTION);
if (ret != 0) {
printf("default aes-192 key set failed\n");
return -1;
@ -1037,7 +1037,7 @@ static int check_aesctr(void)
printf("mcapi aes-256 key set failed\n");
return -1;
}
ret = AesSetKey(&defAes, key, 32, iv, AES_ENCRYPTION);
ret = wc_AesSetKey(&defAes, key, 32, iv, AES_ENCRYPTION);
if (ret != 0) {
printf("default aes-256 key set failed\n");
return -1;
@ -1048,7 +1048,7 @@ static int check_aesctr(void)
printf("mcapi aes-256 ctr encrypt failed\n");
return -1;
}
AesCtrEncrypt(&defAes, out2, ourData, AES_TEST_SIZE);
wc_AesCtrEncrypt(&defAes, out2, ourData, AES_TEST_SIZE);
if (memcmp(out1, out2, AES_TEST_SIZE) != 0) {
printf("mcapi aes-256 ctr encrypt cmp failed\n");
@ -1061,7 +1061,7 @@ static int check_aesctr(void)
printf("mcapi aes-256 key set failed\n");
return -1;
}
ret = AesSetKey(&defAes, key, 32, iv, AES_ENCRYPTION);
ret = wc_AesSetKey(&defAes, key, 32, iv, AES_ENCRYPTION);
if (ret != 0) {
printf("default aes-256 key set failed\n");
return -1;
@ -1102,7 +1102,7 @@ static int check_aesdirect(void)
printf("mcapi aes-128 key set failed\n");
return -1;
}
ret = AesSetKey(&defAes, key, 16, iv, AES_ENCRYPTION);
ret = wc_AesSetKey(&defAes, key, 16, iv, AES_ENCRYPTION);
if (ret != 0) {
printf("default aes-128 key set failed\n");
return -1;
@ -1113,7 +1113,7 @@ static int check_aesdirect(void)
printf("mcapi aes-128 direct encrypt failed\n");
return -1;
}
AesEncryptDirect(&defAes, out2, ourData);
wc_AesEncryptDirect(&defAes, out2, ourData);
if (memcmp(out1, out2, CRYPT_AES_BLOCK_SIZE) != 0) {
printf("mcapi aes-128 direct encrypt cmp failed\n");
@ -1126,7 +1126,7 @@ static int check_aesdirect(void)
printf("mcapi aes-128 key set failed\n");
return -1;
}
ret = AesSetKey(&defAes, key, 16, iv, DES_DECRYPTION);
ret = wc_AesSetKey(&defAes, key, 16, iv, DES_DECRYPTION);
if (ret != 0) {
printf("default aes-128 key set failed\n");
return -1;
@ -1137,7 +1137,7 @@ static int check_aesdirect(void)
printf("mcapi aes-128 direct decrypt failed\n");
return -1;
}
AesDecryptDirect(&defAes, out1, out1);
wc_AesDecryptDirect(&defAes, out1, out1);
if (memcmp(out1, out2, CRYPT_AES_BLOCK_SIZE) != 0) {
printf("mcapi aes-128 direct decrypt cmp failed\n");
@ -1155,7 +1155,7 @@ static int check_aesdirect(void)
printf("mcapi aes-192 key set failed\n");
return -1;
}
ret = AesSetKey(&defAes, key, 24, iv, AES_ENCRYPTION);
ret = wc_AesSetKey(&defAes, key, 24, iv, AES_ENCRYPTION);
if (ret != 0) {
printf("default aes-192 key set failed\n");
return -1;
@ -1166,7 +1166,7 @@ static int check_aesdirect(void)
printf("mcapi aes-192 direct encrypt failed\n");
return -1;
}
AesEncryptDirect(&defAes, out2, ourData);
wc_AesEncryptDirect(&defAes, out2, ourData);
if (memcmp(out1, out2, CRYPT_AES_BLOCK_SIZE) != 0) {
printf("mcapi aes-192 direct encrypt cmp failed\n");
@ -1179,7 +1179,7 @@ static int check_aesdirect(void)
printf("mcapi aes-192 key set failed\n");
return -1;
}
ret = AesSetKey(&defAes, key, 24, iv, AES_DECRYPTION);
ret = wc_AesSetKey(&defAes, key, 24, iv, AES_DECRYPTION);
if (ret != 0) {
printf("default aes-192 key set failed\n");
return -1;
@ -1190,7 +1190,7 @@ static int check_aesdirect(void)
printf("mcapi aes-192 direct decrypt failed\n");
return -1;
}
AesDecryptDirect(&defAes, out1, out1);
wc_AesDecryptDirect(&defAes, out1, out1);
if (memcmp(out1, out2, CRYPT_AES_BLOCK_SIZE) != 0) {
printf("mcapi aes-192 direct decrypt cmp failed\n");
@ -1208,7 +1208,7 @@ static int check_aesdirect(void)
printf("mcapi aes-256 key set failed\n");
return -1;
}
ret = AesSetKey(&defAes, key, 32, iv, AES_ENCRYPTION);
ret = wc_AesSetKey(&defAes, key, 32, iv, AES_ENCRYPTION);
if (ret != 0) {
printf("default aes-256 key set failed\n");
return -1;
@ -1219,7 +1219,7 @@ static int check_aesdirect(void)
printf("mcapi aes-256 direct encrypt failed\n");
return -1;
}
AesEncryptDirect(&defAes, out2, ourData);
wc_AesEncryptDirect(&defAes, out2, ourData);
if (memcmp(out1, out2, CRYPT_AES_BLOCK_SIZE) != 0) {
printf("mcapi aes-256 direct encrypt cmp failed\n");
@ -1232,7 +1232,7 @@ static int check_aesdirect(void)
printf("mcapi aes-256 key set failed\n");
return -1;
}
ret = AesSetKey(&defAes, key, 32, iv, AES_DECRYPTION);
ret = wc_AesSetKey(&defAes, key, 32, iv, AES_DECRYPTION);
if (ret != 0) {
printf("default aes-256 key set failed\n");
return -1;
@ -1243,7 +1243,7 @@ static int check_aesdirect(void)
printf("mcapi aes-256 direct decrypt failed\n");
return -1;
}
AesDecryptDirect(&defAes, out1, out1);
wc_AesDecryptDirect(&defAes, out1, out1);
if (memcmp(out1, out2, CRYPT_AES_BLOCK_SIZE) != 0) {
printf("mcapi aes-256 direct decrypt cmp failed\n");
@ -1275,7 +1275,7 @@ static int check_rsa(void)
byte out1[256];
byte out2[256];
ret = InitRsaKey(&defRsa, NULL);
ret = wc_InitRsaKey(&defRsa, NULL);
if (ret == 0)
ret = CRYPT_RSA_Initialize(&mcRsa);
if (ret != 0) {
@ -1289,7 +1289,7 @@ static int check_rsa(void)
return -1;
}
ret = RsaPrivateKeyDecode(client_key_der_1024, &idx, &defRsa, keySz);
ret = wc_RsaPrivateKeyDecode(client_key_der_1024, &idx, &defRsa, keySz);
if (ret != 0) {
printf("default rsa private key decode failed\n");
return -1;
@ -1302,7 +1302,7 @@ static int check_rsa(void)
return -1;
}
ret2 = RsaPublicEncrypt(ourData, RSA_TEST_SIZE, out2, sizeof(out2),
ret2 = wc_RsaPublicEncrypt(ourData, RSA_TEST_SIZE, out2, sizeof(out2),
&defRsa, &defRng);
if (ret2 < 0) {
printf("default rsa public encrypt failed\n");
@ -1335,7 +1335,7 @@ static int check_rsa(void)
return -1;
}
FreeRsaKey(&defRsa);
wc_FreeRsaKey(&defRsa);
ret = CRYPT_RSA_Free(&mcRsa);
if (ret != 0) {
printf("mcapi rsa free failed\n");

View File

@ -13,6 +13,7 @@
displayName="Source Files"
projectFiles="true">
<itemPath>../mcapi_test.c</itemPath>
<itemPath>../crypto.c</itemPath>
</logicalFolder>
<logicalFolder name="ExternalFiles"
displayName="Important Files"
@ -33,27 +34,27 @@
<targetPluginBoard></targetPluginBoard>
<platformTool>SKDEPIC32PlatformTool</platformTool>
<languageToolchain>XC32</languageToolchain>
<languageToolchainVersion>1.30</languageToolchainVersion>
<platform>3</platform>
<languageToolchainVersion>1.34</languageToolchainVersion>
<platform>4</platform>
</toolsSet>
<compileType>
<linkerTool>
<linkerLibItems>
<linkerLibProjectItem>
<makeArtifact PL="../cyassl.X"
<makeArtifact PL="../wolfssl.X"
CT="3"
CN="default"
AC="true"
BL="true"
WD="../cyassl.X"
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/cyassl.X.a"
DOP="dist/default/debug/cyassl.X.a"
FL="dist/default/production/cyassl.X.a"
PD="dist/default/production/cyassl.X."
DD="dist/default/debug/cyassl.X.">
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>
@ -75,8 +76,11 @@
</linkerLibProjectItem>
</linkerLibItems>
</linkerTool>
<archiverTool>
</archiverTool>
<loading>
<useAlternateLoadableFile>false</useAlternateLoadableFile>
<parseOnProdLoad>false</parseOnProdLoad>
<alternateLoadableFile></alternateLoadableFile>
</loading>
</compileType>
@ -97,21 +101,26 @@
<property key="enable-unroll-loops" value="false"/>
<property key="exclude-floating-point" value="false"/>
<property key="extra-include-directories"
value="../../;../../mcapi;../../zlib-1.2.7"/>
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="CYASSL_SHA384;CYASSL_SHA512"/>
<property key="preprocessor-macros"
value="WOLFSSL_SHA384;WOLFSSL_SHA512;HAVE_ECC;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>
@ -120,8 +129,16 @@
<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=""/>
@ -149,6 +166,7 @@
<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=""/>
@ -163,7 +181,10 @@
<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>

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

@ -1,17 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://www.netbeans.org/ns/project/1">
<?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>ctaocrypt_mcapi</name>
<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-project>../cyassl.X</make-dep-project>
</make-dep-projects>
</data>
</configuration>

View File

@ -4,7 +4,6 @@
<logicalFolder name="HeaderFiles"
displayName="Header Files"
projectFiles="true">
<itemPath>../../ctaocrypt/test/test.h</itemPath>
</logicalFolder>
<logicalFolder name="LinkerScript"
displayName="Linker Files"
@ -13,8 +12,8 @@
<logicalFolder name="SourceFiles"
displayName="Source Files"
projectFiles="true">
<itemPath>../../ctaocrypt/test/test.c</itemPath>
<itemPath>../../mplabx/test_main.c</itemPath>
<itemPath>../../wolfcrypt/test/test.c</itemPath>
</logicalFolder>
<logicalFolder name="ExternalFiles"
displayName="Important Files"
@ -24,6 +23,7 @@
</logicalFolder>
<sourceRootList>
<Elem>../../mplabx</Elem>
<Elem>../../wolfcrypt/test</Elem>
</sourceRootList>
<projectmakefile>Makefile</projectmakefile>
<confs>
@ -35,27 +35,27 @@
<targetPluginBoard></targetPluginBoard>
<platformTool>SKDEPIC32PlatformTool</platformTool>
<languageToolchain>XC32</languageToolchain>
<languageToolchainVersion>1.30</languageToolchainVersion>
<platform>3</platform>
<languageToolchainVersion>1.34</languageToolchainVersion>
<platform>4</platform>
</toolsSet>
<compileType>
<linkerTool>
<linkerLibItems>
<linkerLibProjectItem>
<makeArtifact PL="../cyassl.X"
<makeArtifact PL="../wolfssl.X"
CT="3"
CN="default"
AC="true"
BL="true"
WD="../cyassl.X"
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/cyassl.X.a"
DOP="dist/default/debug/cyassl.X.a"
FL="dist/default/production/cyassl.X.a"
PD="dist/default/production/cyassl.X."
DD="dist/default/debug/cyassl.X.">
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>
@ -77,8 +77,11 @@
</linkerLibProjectItem>
</linkerLibItems>
</linkerTool>
<archiverTool>
</archiverTool>
<loading>
<useAlternateLoadableFile>false</useAlternateLoadableFile>
<parseOnProdLoad>false</parseOnProdLoad>
<alternateLoadableFile></alternateLoadableFile>
</loading>
</compileType>
@ -100,6 +103,7 @@
<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"/>
@ -107,13 +111,16 @@
<property key="post-instruction-scheduling" value="default"/>
<property key="pre-instruction-scheduling" value="default"/>
<property key="preprocessor-macros"
value="NO_MAIN_DRIVER;USE_CERT_BUFFERS_1024;CYASSL_SHA384;CYASSL_SHA512;HAVE_ECC;HAVE_LIBZ;HAVE_MCAPI"/>
value="NO_MAIN_DRIVER;USE_CERT_BUFFERS_1024;WOLFSSL_SHA384;WOLFSSL_SHA512;HAVE_ECC;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"/>
@ -138,8 +145,16 @@
<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=""/>
@ -167,6 +182,7 @@
<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=""/>
@ -177,10 +193,14 @@
<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>

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

@ -1,17 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://www.netbeans.org/ns/project/1">
<?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>ctaocrypt_test</name>
<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>h</header-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-project>../cyassl.X</make-dep-project>
</make-dep-projects>
</data>
</configuration>

View File

@ -12,47 +12,56 @@
<logicalFolder name="SourceFiles"
displayName="Source Files"
projectFiles="true">
<itemPath>../../src/crl.c</itemPath>
<itemPath>../../src/internal.c</itemPath>
<itemPath>../../src/io.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>../../ctaocrypt/src/aes.c</itemPath>
<itemPath>../../ctaocrypt/src/arc4.c</itemPath>
<itemPath>../../ctaocrypt/src/asm.c</itemPath>
<itemPath>../../ctaocrypt/src/asn.c</itemPath>
<itemPath>../../ctaocrypt/src/coding.c</itemPath>
<itemPath>../../ctaocrypt/src/des3.c</itemPath>
<itemPath>../../ctaocrypt/src/dh.c</itemPath>
<itemPath>../../ctaocrypt/src/dsa.c</itemPath>
<itemPath>../../ctaocrypt/src/ecc.c</itemPath>
<itemPath>../../ctaocrypt/src/ecc_fp.c</itemPath>
<itemPath>../../ctaocrypt/src/error.c</itemPath>
<itemPath>../../ctaocrypt/src/hc128.c</itemPath>
<itemPath>../../ctaocrypt/src/hmac.c</itemPath>
<itemPath>../../ctaocrypt/src/integer.c</itemPath>
<itemPath>../../ctaocrypt/src/logging.c</itemPath>
<itemPath>../../ctaocrypt/src/md2.c</itemPath>
<itemPath>../../ctaocrypt/src/md4.c</itemPath>
<itemPath>../../ctaocrypt/src/md5.c</itemPath>
<itemPath>../../ctaocrypt/src/memory.c</itemPath>
<itemPath>../../ctaocrypt/src/misc.c</itemPath>
<itemPath>../../ctaocrypt/src/pwdbased.c</itemPath>
<itemPath>../../ctaocrypt/src/rabbit.c</itemPath>
<itemPath>../../ctaocrypt/src/random.c</itemPath>
<itemPath>../../ctaocrypt/src/ripemd.c</itemPath>
<itemPath>../../ctaocrypt/src/rsa.c</itemPath>
<itemPath>../../ctaocrypt/src/sha.c</itemPath>
<itemPath>../../ctaocrypt/src/sha256.c</itemPath>
<itemPath>../../ctaocrypt/src/sha512.c</itemPath>
<itemPath>../../ctaocrypt/src/tfm.c</itemPath>
<itemPath>../../mcapi/crypto.c</itemPath>
<itemPath>../../ctaocrypt/src/compress.c</itemPath>
<itemPath>../../ctaocrypt/src/camellia.c</itemPath>
<itemPath>../../ctaocrypt/src/wc_port.c</itemPath>
<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/hc128.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/pic32mz-hash.c</itemPath>
<itemPath>../../wolfcrypt/src/pkcs7.c</itemPath>
<itemPath>../../wolfcrypt/src/poly1305.c</itemPath>
<itemPath>../../wolfcrypt/src/pw.c</itemPath>
<itemPath>../../wolfcrypt/src/pwdbased.c</itemPath>
<itemPath>../../wolfcrypt/src/rabbit.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>
</logicalFolder>
<logicalFolder name="src" displayName="wolfssl" projectFiles="true">
<itemPath>../../src/crl.c</itemPath>
<itemPath>../../src/internal.c</itemPath>
<itemPath>../../src/io.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>
</logicalFolder>
</logicalFolder>
<logicalFolder name="ExternalFiles"
displayName="Important Files"
@ -63,6 +72,8 @@
<sourceRootList>
<Elem>..</Elem>
<Elem>../../ctaocrypt/src</Elem>
<Elem>../../src</Elem>
<Elem>../../wolfcrypt</Elem>
</sourceRootList>
<projectmakefile>Makefile</projectmakefile>
<confs>
@ -74,12 +85,21 @@
<targetPluginBoard></targetPluginBoard>
<platformTool>SKDEPIC32PlatformTool</platformTool>
<languageToolchain>XC32</languageToolchain>
<languageToolchainVersion>1.30</languageToolchainVersion>
<platform>3</platform>
<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>
@ -98,8 +118,9 @@
<property key="enable-unroll-loops" value="false"/>
<property key="exclude-floating-point" value="false"/>
<property key="extra-include-directories"
value="../../;../../mcapi;../../zlib-1.2.7;/Users/chrisc/yaSSL/products/cyassl/git/cyassl57/zlib-1.2.7"/>
value="../../;../../mcapi;../../zlib-1.2.8;/Users/chrisc/yaSSL/products/cyassl/git/cyassl57/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"/>
@ -107,13 +128,16 @@
<property key="post-instruction-scheduling" value="default"/>
<property key="pre-instruction-scheduling" value="default"/>
<property key="preprocessor-macros"
value="CYASSL_SHA512;CYASSL_SHA384;CYASSL_AES_COUNTER;CYASSL_AES_DIRECT;HAVE_ECC;HAVE_LIBZ;HAVE_MCAPI"/>
value="WOLFSSL_SHA512;WOLFSSL_SHA384;WOLFSSL_AES_COUNTER;WOLFSSL_AES_DIRECT;HAVE_ECC;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"/>
@ -138,8 +162,16 @@
<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=""/>
@ -167,6 +199,7 @@
<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=""/>
@ -177,10 +210,14 @@
<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>

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

@ -3,7 +3,7 @@
<type>com.microchip.mplab.nbide.embedded.makeproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/make-project/1">
<name>cyassl</name>
<name>wolfssl</name>
<creation-uuid>93bbfc3a-a0fa-4d48-bbc8-6cd47a2bd05b</creation-uuid>
<make-project-type>0</make-project-type>
<c-extensions>c</c-extensions>

View File

@ -42,14 +42,23 @@
<targetDevice>PIC32MX795F512L</targetDevice>
<targetHeader></targetHeader>
<targetPluginBoard></targetPluginBoard>
<platformTool>SKDEPIC32PlatformTool</platformTool>
<platformTool>PKOBSKDEPlatformTool</platformTool>
<languageToolchain>XC32</languageToolchain>
<languageToolchainVersion>1.10</languageToolchainVersion>
<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>
@ -69,6 +78,7 @@
<property key="exclude-floating-point" value="false"/>
<property key="extra-include-directories" value="../../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"/>
@ -80,8 +90,12 @@
<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"/>
@ -106,13 +120,22 @@
<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"/>
@ -134,6 +157,7 @@
<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=""/>
@ -144,14 +168,43 @@
<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>
<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

@ -8,4 +8,3 @@ EXTRA_DIST += \
EXTRA_DIST += \
mcapi/zlib.X/nbproject/configurations.xml \
mcapi/zlib.X/nbproject/project.xml

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://www.netbeans.org/ns/project/1">
<?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">
@ -9,6 +10,7 @@
<cpp-extensions/>
<header-extensions/>
<sourceEncoding>ISO-8859-1</sourceEncoding>
<asminc-extensions/>
<make-dep-projects/>
</data>
</configuration>

View File

@ -1,11 +0,0 @@
/* Config bits for PI32MZ, Starter Kit */
#pragma config FPLLIDIV = DIV_1 // System PLL Input Divider (1x Divider)
#pragma config FPLLRNG = RANGE_5_10_MHZ
#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
// DEVCFG1
#pragma config FNOSC = SPLL // Oscillator Selection (System PLL)
#pragma config ICESEL = ICS_PGx2
/* ICE/ICD Comm Channel Select (Communicate on PGEC2/PGED2) */

View File

@ -1,40 +1,40 @@
CyaSSL MPLAB X Project Files
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.
In order to generate the necessary auto-generated MPLAB X files, make sure
to import the cyassl.X project into your MPLAB X workspace before trying to
build either the CTaoCrypt test or benchmark applications. This will
to import the wolfssl.X project 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. CyaSSL library (cyassl.X)
1. wolfSSL library (wolfssl.X)
This project builds a static CyaSSL library. Prior to building this
This project builds a static wolfSSL library. Prior to building this
project, uncomment the MICROCHIP_PIC32 define located in:
<cyassl_root>/cyassl/ctaocrypt/settings.h
<wolfssl_root>/wolfssl/wolfcrypt/settings.h
After this project has been built, the compiled library will be located
at:
<cyassl_root>/mplabx/cyassl.X/dist/default/production/cyassl.X.a
<wolfssl_root>/mplabx/wolfssl.X/dist/default/production/wolfssl.X.a
2. CTaoCrypt Test App (ctaocrypt_test.X)
2. wolfCrypt Test App (wolfcrypt_test.X)
This project tests the CTaoCrypt cryptography modules. It is generally
This project tests the wolfCrypt cryptography modules. It is generally
a good idea to run this first on an embedded system after compiling
CyaSSL in order to verify all underlying crypto is working correctly.
wolfSSL in order to verify all underlying crypto is working correctly.
3. CTaoCrypt Benchmark App (ctaocrypt_benchmark.X)
3. wolfCrypt Benchmark App (wolfcrypt_benchmark.X)
This project builds the CTaoCrypt benchmark application.
This project builds the wolfCrypt benchmark application.
For the benchmark timer, adjust CLOCK value under
"#elif defined MICROCHIP_PIC32" in ctaocrypt/benchmark/benchmark.c
"#elif defined MICROCHIP_PIC32" in wolfcrypt/benchmark/benchmark.c
PIC32MX/PIC32MZ
---------------

View File

@ -22,16 +22,17 @@
#include <config.h>
#endif
#include <cyassl/ctaocrypt/settings.h>
#include <wolfssl/wolfcrypt/settings.h>
#if defined(CYASSL_MICROCHIP_PIC32MZ)
#if defined(WOLFSSL_MICROCHIP_PIC32MZ)
#define MICROCHIP_PIC32
#include <xc.h>
#include "MZ-configBits.h"
#pragma config ICESEL = ICS_PGx2
/* ICE/ICD Comm Channel Select (Communicate on PGEC2/PGED2) */
#include <stdio.h>
#include <stdlib.h>
#include "PIC32MZ-serial.h"
#define SYSTEMConfigPerformance /* void out SYSTEMConfigPerformance(); */
#define SYSTEMConfigPerformance /* void out SYSTEMConfigPerformance(); */
#else
#define PIC32_STARTER_KIT
#include <p32xxxx.h>
@ -62,7 +63,7 @@ void bench_eccKeyAgree(void);
#endif
/*
* Main driver for CTaoCrypt benchmarks.
* Main driver for wolfCrypt benchmarks.
*/
int main(int argc, char** argv) {
volatile int i ;
@ -74,11 +75,6 @@ int main(int argc, char** argv) {
init_serial() ; /* initialize PIC32MZ serial I/O */
SYSTEMConfigPerformance(80000000);
DBINIT();
for(j=0; j<100; j++) {
for(i=0; i<10000000; i++);
printf("time=%f\n", current_time(0)) ;
}
printf("wolfCrypt Benchmark:\n");
#ifndef NO_AES
@ -110,7 +106,7 @@ int main(int argc, char** argv) {
#ifndef NO_SHA256
bench_sha256();
#endif
#ifdef CYASSL_SHA512
#ifdef WOLFSSL_SHA512
bench_sha512();
#endif
#ifdef CYASSL_RIPEMD
@ -127,7 +123,7 @@ int main(int argc, char** argv) {
bench_dh();
#endif
#if defined(CYASSL_KEY_GEN) && !defined(NO_RSA)
#if defined(WOLFSSL_KEY_GEN) && !defined(NO_RSA)
bench_rsaKeyGen();
#endif

View File

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

View File

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

View File

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

View File

@ -1,52 +0,0 @@
/* ssl-dummy.c
*
* Copyright (C) 2006-2015 wolfSSL Inc.
*
* This file is part of wolfSSL. (formerly known as CyaSSL)
*
* 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-1301, USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <cyassl/ssl.h>
#include <cyassl/internal.h>
Signer* GetCA(void* vp, byte* hash)
{
return NULL ;
}
int CyaSSL_dtls(CYASSL* ssl)
{
return NULL ;
}
int CyaSSL_get_using_nonblock(CYASSL* ssl)
{
return NULL ;
}
Signer* GetCAByName(void* vp, byte* hash)
{
return NULL ;
}
int CyaSSL_PemCertToDer(const char* fileName, unsigned char* derBuf, int derSz)
{
return NULL ;
}

View File

@ -23,12 +23,12 @@
#include <config.h>
#endif
#include <cyassl/ctaocrypt/settings.h>
#include <wolfssl/wolfcrypt/settings.h>
#if defined(CYASSL_MICROCHIP_PIC32MZ)
#if defined(WOLFSSL_MICROCHIP_PIC32MZ)
#define MICROCHIP_PIC32
#include <xc.h>
#pragma config ICESEL = ICS_PGx2
#pragma config ICESEL = ICS_PGx2
/* ICE/ICD Comm Channel Select (Communicate on PGEC2/PGED2) */
#include <stdio.h>
#include <stdlib.h>
@ -52,7 +52,7 @@ typedef struct func_args {
} func_args;
/*
* Main driver for CTaoCrypt tests.
* Main driver for WolfCrypt tests.
*/
int main(int argc, char** argv) {
int i ;
@ -60,13 +60,13 @@ int main(int argc, char** argv) {
init_serial() ; /* initialize PIC32MZ serial I/O */
SYSTEMConfigPerformance(80000000);
DBINIT();
printf("CTaoCrypt Test:\n");
printf("WolfCrypt Test:\n");
func_args args;
args.argc = argc;
args.argv = argv;
ctaocrypt_test(&args);
wolfcrypt_test(&args);
if (args.return_code == 0) {
printf("All tests passed!\n");

View File

@ -1,108 +1,108 @@
#
# There exist several targets which are by default empty and which can be
# used for execution of your targets. These targets are usually executed
# before and after some main targets. They are:
#
# .build-pre: called before 'build' target
# .build-post: called after 'build' target
# .clean-pre: called before 'clean' target
# .clean-post: called after 'clean' target
# .clobber-pre: called before 'clobber' target
# .clobber-post: called after 'clobber' target
# .all-pre: called before 'all' target
# .all-post: called after 'all' target
# .help-pre: called before 'help' target
# .help-post: called after 'help' target
#
# Targets beginning with '.' are not intended to be called on their own.
#
# Main targets can be executed directly, and they are:
#
# build build a specific configuration
# clean remove built files from a configuration
# clobber remove all built files
# all build all configurations
# help print help mesage
#
# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
# .help-impl are implemented in nbproject/makefile-impl.mk.
#
# Available make variables:
#
# CND_BASEDIR base directory for relative paths
# CND_DISTDIR default top distribution directory (build artifacts)
# CND_BUILDDIR default top build directory (object files, ...)
# CONF name of current configuration
# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration)
# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration)
# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration)
# CND_PACKAGE_DIR_${CONF} directory of package (current configuration)
# CND_PACKAGE_NAME_${CONF} name of package (current configuration)
# CND_PACKAGE_PATH_${CONF} path to package (current configuration)
#
# NOCDDL
# Environment
MKDIR=mkdir
CP=cp
CCADMIN=CCadmin
RANLIB=ranlib
# build
build: .build-post
.build-pre:
# Add your pre 'build' code here...
.build-post: .build-impl
# Add your post 'build' code here...
# clean
clean: .clean-post
.clean-pre:
# Add your pre 'clean' code here...
.clean-post: .clean-impl
# Add your post 'clean' code here...
# clobber
clobber: .clobber-post
.clobber-pre:
# Add your pre 'clobber' code here...
.clobber-post: .clobber-impl
# Add your post 'clobber' code here...
# all
all: .all-post
.all-pre:
# Add your pre 'all' code here...
.all-post: .all-impl
# Add your post 'all' code here...
# help
help: .help-post
.help-pre:
# Add your pre 'help' code here...
.help-post: .help-impl
# Add your post 'help' code here...
# include project implementation makefile
include nbproject/Makefile-impl.mk
# include project make variables
include nbproject/Makefile-variables.mk
#
# There exist several targets which are by default empty and which can be
# used for execution of your targets. These targets are usually executed
# before and after some main targets. They are:
#
# .build-pre: called before 'build' target
# .build-post: called after 'build' target
# .clean-pre: called before 'clean' target
# .clean-post: called after 'clean' target
# .clobber-pre: called before 'clobber' target
# .clobber-post: called after 'clobber' target
# .all-pre: called before 'all' target
# .all-post: called after 'all' target
# .help-pre: called before 'help' target
# .help-post: called after 'help' target
#
# Targets beginning with '.' are not intended to be called on their own.
#
# Main targets can be executed directly, and they are:
#
# build build a specific configuration
# clean remove built files from a configuration
# clobber remove all built files
# all build all configurations
# help print help mesage
#
# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
# .help-impl are implemented in nbproject/makefile-impl.mk.
#
# Available make variables:
#
# CND_BASEDIR base directory for relative paths
# CND_DISTDIR default top distribution directory (build artifacts)
# CND_BUILDDIR default top build directory (object files, ...)
# CONF name of current configuration
# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration)
# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration)
# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration)
# CND_PACKAGE_DIR_${CONF} directory of package (current configuration)
# CND_PACKAGE_NAME_${CONF} name of package (current configuration)
# CND_PACKAGE_PATH_${CONF} path to package (current configuration)
#
# NOCDDL
# Environment
MKDIR=mkdir
CP=cp
CCADMIN=CCadmin
RANLIB=ranlib
# build
build: .build-post
.build-pre:
# Add your pre 'build' code here...
.build-post: .build-impl
# Add your post 'build' code here...
# clean
clean: .clean-post
.clean-pre:
# Add your pre 'clean' code here...
.clean-post: .clean-impl
# Add your post 'clean' code here...
# clobber
clobber: .clobber-post
.clobber-pre:
# Add your pre 'clobber' code here...
.clobber-post: .clobber-impl
# Add your post 'clobber' code here...
# all
all: .all-post
.all-pre:
# Add your pre 'all' code here...
.all-post: .all-impl
# Add your post 'all' code here...
# help
help: .help-post
.help-pre:
# Add your pre 'help' code here...
.help-post: .help-impl
# Add your post 'help' code here...
# include project implementation makefile
include nbproject/Makefile-impl.mk
# include project make variables
include nbproject/Makefile-variables.mk

View File

@ -12,7 +12,7 @@
<logicalFolder name="SourceFiles"
displayName="Source Files"
projectFiles="true">
<itemPath>../../ctaocrypt/benchmark/benchmark.c</itemPath>
<itemPath>../../wolfcrypt/benchmark/benchmark.c</itemPath>
<itemPath>../benchmark_main.c</itemPath>
</logicalFolder>
<logicalFolder name="ExternalFiles"
@ -23,6 +23,7 @@
</logicalFolder>
<sourceRootList>
<Elem>..</Elem>
<Elem>../../wolfcrypt/benchmark</Elem>
</sourceRootList>
<projectmakefile>Makefile</projectmakefile>
<confs>
@ -34,33 +35,36 @@
<targetPluginBoard></targetPluginBoard>
<platformTool>PKOBSKDEPlatformTool</platformTool>
<languageToolchain>XC32</languageToolchain>
<languageToolchainVersion>1.10</languageToolchainVersion>
<platform>3</platform>
<languageToolchainVersion></languageToolchainVersion>
<platform>4</platform>
</toolsSet>
<compileType>
<linkerTool>
<linkerLibItems>
<linkerLibProjectItem>
<makeArtifact PL="../cyassl.X"
<makeArtifact PL="../wolfssl.X"
CT="3"
CN="default"
AC="true"
BL="true"
WD="../cyassl.X"
BC="${MAKE} MAKE_OPTIONS=&quot;&quot; -f Makefile CONF=default"
DBC="${MAKE} MAKE_OPTIONS=&quot;&quot; -f Makefile CONF=default TYPE_IMAGE=DEBUG_RUN"
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/cyassl.X.a"
DOP="dist/default/debug/cyassl.X.a"
FL="dist/default/production/cyassl.X.a"
PD="dist/default/production/cyassl.X."
DD="dist/default/debug/cyassl.X.">
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>
</linkerLibItems>
</linkerTool>
<archiverTool>
</archiverTool>
<loading>
<useAlternateLoadableFile>false</useAlternateLoadableFile>
<parseOnProdLoad>false</parseOnProdLoad>
<alternateLoadableFile></alternateLoadableFile>
</loading>
</compileType>
@ -82,6 +86,7 @@
<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="-O1"/>
@ -89,13 +94,16 @@
<property key="post-instruction-scheduling" value="default"/>
<property key="pre-instruction-scheduling" value="default"/>
<property key="preprocessor-macros"
value="NO_MAIN_DRIVER;USE_CERT_BUFFERS_1024;BENCH_EMBEDDED;HAVE_ECC;CYASSL_SHA512"/>
value="NO_MAIN_DRIVER;USE_CERT_BUFFERS_1024;BENCH_EMBEDDED;HAVE_ECC;WOLFSSL_SHA512"/>
<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"/>
@ -120,8 +128,16 @@
<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="20480"/>
<property key="input-libraries" value=""/>
<property key="linker-symbols" value=""/>
@ -149,6 +165,7 @@
<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=""/>
@ -159,10 +176,14 @@
<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>
@ -173,13 +194,17 @@
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"/>

View File

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

View File

@ -3,7 +3,7 @@
<type>com.microchip.mplab.nbide.embedded.makeproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/make-project/1">
<name>ctaocrypt_benchmark</name>
<name>wolfcrypt_benchmark</name>
<creation-uuid>22e4138b-5f20-4957-ac0a-c181b94d3342</creation-uuid>
<make-project-type>0</make-project-type>
<c-extensions>c</c-extensions>
@ -12,7 +12,7 @@
<sourceEncoding>ISO-8859-1</sourceEncoding>
<asminc-extensions/>
<make-dep-projects>
<make-dep-project>../cyassl.X</make-dep-project>
<make-dep-project>../wolfssl.X</make-dep-project>
</make-dep-projects>
</data>
</configuration>

View File

@ -1,108 +1,108 @@
#
# There exist several targets which are by default empty and which can be
# used for execution of your targets. These targets are usually executed
# before and after some main targets. They are:
#
# .build-pre: called before 'build' target
# .build-post: called after 'build' target
# .clean-pre: called before 'clean' target
# .clean-post: called after 'clean' target
# .clobber-pre: called before 'clobber' target
# .clobber-post: called after 'clobber' target
# .all-pre: called before 'all' target
# .all-post: called after 'all' target
# .help-pre: called before 'help' target
# .help-post: called after 'help' target
#
# Targets beginning with '.' are not intended to be called on their own.
#
# Main targets can be executed directly, and they are:
#
# build build a specific configuration
# clean remove built files from a configuration
# clobber remove all built files
# all build all configurations
# help print help mesage
#
# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
# .help-impl are implemented in nbproject/makefile-impl.mk.
#
# Available make variables:
#
# CND_BASEDIR base directory for relative paths
# CND_DISTDIR default top distribution directory (build artifacts)
# CND_BUILDDIR default top build directory (object files, ...)
# CONF name of current configuration
# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration)
# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration)
# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration)
# CND_PACKAGE_DIR_${CONF} directory of package (current configuration)
# CND_PACKAGE_NAME_${CONF} name of package (current configuration)
# CND_PACKAGE_PATH_${CONF} path to package (current configuration)
#
# NOCDDL
# Environment
MKDIR=mkdir
CP=cp
CCADMIN=CCadmin
RANLIB=ranlib
# build
build: .build-post
.build-pre:
# Add your pre 'build' code here...
.build-post: .build-impl
# Add your post 'build' code here...
# clean
clean: .clean-post
.clean-pre:
# Add your pre 'clean' code here...
.clean-post: .clean-impl
# Add your post 'clean' code here...
# clobber
clobber: .clobber-post
.clobber-pre:
# Add your pre 'clobber' code here...
.clobber-post: .clobber-impl
# Add your post 'clobber' code here...
# all
all: .all-post
.all-pre:
# Add your pre 'all' code here...
.all-post: .all-impl
# Add your post 'all' code here...
# help
help: .help-post
.help-pre:
# Add your pre 'help' code here...
.help-post: .help-impl
# Add your post 'help' code here...
# include project implementation makefile
include nbproject/Makefile-impl.mk
# include project make variables
include nbproject/Makefile-variables.mk
#
# There exist several targets which are by default empty and which can be
# used for execution of your targets. These targets are usually executed
# before and after some main targets. They are:
#
# .build-pre: called before 'build' target
# .build-post: called after 'build' target
# .clean-pre: called before 'clean' target
# .clean-post: called after 'clean' target
# .clobber-pre: called before 'clobber' target
# .clobber-post: called after 'clobber' target
# .all-pre: called before 'all' target
# .all-post: called after 'all' target
# .help-pre: called before 'help' target
# .help-post: called after 'help' target
#
# Targets beginning with '.' are not intended to be called on their own.
#
# Main targets can be executed directly, and they are:
#
# build build a specific configuration
# clean remove built files from a configuration
# clobber remove all built files
# all build all configurations
# help print help mesage
#
# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
# .help-impl are implemented in nbproject/makefile-impl.mk.
#
# Available make variables:
#
# CND_BASEDIR base directory for relative paths
# CND_DISTDIR default top distribution directory (build artifacts)
# CND_BUILDDIR default top build directory (object files, ...)
# CONF name of current configuration
# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration)
# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration)
# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration)
# CND_PACKAGE_DIR_${CONF} directory of package (current configuration)
# CND_PACKAGE_NAME_${CONF} name of package (current configuration)
# CND_PACKAGE_PATH_${CONF} path to package (current configuration)
#
# NOCDDL
# Environment
MKDIR=mkdir
CP=cp
CCADMIN=CCadmin
RANLIB=ranlib
# build
build: .build-post
.build-pre:
# Add your pre 'build' code here...
.build-post: .build-impl
# Add your post 'build' code here...
# clean
clean: .clean-post
.clean-pre:
# Add your pre 'clean' code here...
.clean-post: .clean-impl
# Add your post 'clean' code here...
# clobber
clobber: .clobber-post
.clobber-pre:
# Add your pre 'clobber' code here...
.clobber-post: .clobber-impl
# Add your post 'clobber' code here...
# all
all: .all-post
.all-pre:
# Add your pre 'all' code here...
.all-post: .all-impl
# Add your post 'all' code here...
# help
help: .help-post
.help-pre:
# Add your pre 'help' code here...
.help-post: .help-impl
# Add your post 'help' code here...
# include project implementation makefile
include nbproject/Makefile-impl.mk
# include project make variables
include nbproject/Makefile-variables.mk

View File

@ -4,7 +4,6 @@
<logicalFolder name="HeaderFiles"
displayName="Header Files"
projectFiles="true">
<itemPath>../../ctaocrypt/test/test.h</itemPath>
</logicalFolder>
<logicalFolder name="LinkerScript"
displayName="Linker Files"
@ -13,8 +12,8 @@
<logicalFolder name="SourceFiles"
displayName="Source Files"
projectFiles="true">
<itemPath>../../ctaocrypt/test/test.c</itemPath>
<itemPath>../test_main.c</itemPath>
<itemPath>../../wolfcrypt/test/test.c</itemPath>
</logicalFolder>
<logicalFolder name="ExternalFiles"
displayName="Important Files"
@ -24,6 +23,7 @@
</logicalFolder>
<sourceRootList>
<Elem>..</Elem>
<Elem>../../wolfcrypt/test</Elem>
</sourceRootList>
<projectmakefile>Makefile</projectmakefile>
<confs>
@ -35,33 +35,36 @@
<targetPluginBoard></targetPluginBoard>
<platformTool>PKOBSKDEPlatformTool</platformTool>
<languageToolchain>XC32</languageToolchain>
<languageToolchainVersion>1.10</languageToolchainVersion>
<platform>3</platform>
<languageToolchainVersion></languageToolchainVersion>
<platform>4</platform>
</toolsSet>
<compileType>
<linkerTool>
<linkerLibItems>
<linkerLibProjectItem>
<makeArtifact PL="../cyassl.X"
<makeArtifact PL="../wolfssl.X"
CT="3"
CN="default"
AC="true"
BL="true"
WD="../cyassl.X"
BC="${MAKE} MAKE_OPTIONS=&quot;&quot; -f Makefile CONF=default"
DBC="${MAKE} MAKE_OPTIONS=&quot;&quot; -f Makefile CONF=default TYPE_IMAGE=DEBUG_RUN"
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/cyassl.X.a"
DOP="dist/default/debug/cyassl.X.a"
FL="dist/default/production/cyassl.X.a"
PD="dist/default/production/cyassl.X."
DD="dist/default/debug/cyassl.X.">
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>
</linkerLibItems>
</linkerTool>
<archiverTool>
</archiverTool>
<loading>
<useAlternateLoadableFile>false</useAlternateLoadableFile>
<parseOnProdLoad>false</parseOnProdLoad>
<alternateLoadableFile></alternateLoadableFile>
</loading>
</compileType>
@ -83,6 +86,7 @@
<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="-O3"/>
@ -90,13 +94,16 @@
<property key="post-instruction-scheduling" value="default"/>
<property key="pre-instruction-scheduling" value="default"/>
<property key="preprocessor-macros"
value="NO_MAIN_DRIVER;USE_CERT_BUFFERS_1024;CYASSL_SHA384;CYASSL_SHA512;HAVE_ECC"/>
value="NO_MAIN_DRIVER;USE_CERT_BUFFERS_1024;WOLFSSL_SHA384;WOLFSSL_SHA512;HAVE_ECC"/>
<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"/>
@ -121,8 +128,16 @@
<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="20480"/>
<property key="input-libraries" value=""/>
<property key="linker-symbols" value=""/>
@ -150,6 +165,7 @@
<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=""/>
@ -160,10 +176,14 @@
<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>
@ -174,13 +194,17 @@
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"/>

View File

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

View File

@ -3,16 +3,16 @@
<type>com.microchip.mplab.nbide.embedded.makeproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/make-project/1">
<name>ctaocrypt_test</name>
<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>h</header-extensions>
<header-extensions/>
<sourceEncoding>ISO-8859-1</sourceEncoding>
<asminc-extensions/>
<make-dep-projects>
<make-dep-project>../cyassl.X</make-dep-project>
<make-dep-project>../wolfssl.X</make-dep-project>
</make-dep-projects>
</data>
</configuration>

216
mplabx/cyassl.X/Makefile → mplabx/wolfssl.X/Makefile Normal file → Executable file
View File

@ -1,108 +1,108 @@
#
# There exist several targets which are by default empty and which can be
# used for execution of your targets. These targets are usually executed
# before and after some main targets. They are:
#
# .build-pre: called before 'build' target
# .build-post: called after 'build' target
# .clean-pre: called before 'clean' target
# .clean-post: called after 'clean' target
# .clobber-pre: called before 'clobber' target
# .clobber-post: called after 'clobber' target
# .all-pre: called before 'all' target
# .all-post: called after 'all' target
# .help-pre: called before 'help' target
# .help-post: called after 'help' target
#
# Targets beginning with '.' are not intended to be called on their own.
#
# Main targets can be executed directly, and they are:
#
# build build a specific configuration
# clean remove built files from a configuration
# clobber remove all built files
# all build all configurations
# help print help mesage
#
# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
# .help-impl are implemented in nbproject/makefile-impl.mk.
#
# Available make variables:
#
# CND_BASEDIR base directory for relative paths
# CND_DISTDIR default top distribution directory (build artifacts)
# CND_BUILDDIR default top build directory (object files, ...)
# CONF name of current configuration
# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration)
# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration)
# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration)
# CND_PACKAGE_DIR_${CONF} directory of package (current configuration)
# CND_PACKAGE_NAME_${CONF} name of package (current configuration)
# CND_PACKAGE_PATH_${CONF} path to package (current configuration)
#
# NOCDDL
# Environment
MKDIR=mkdir
CP=cp
CCADMIN=CCadmin
RANLIB=ranlib
# build
build: .build-post
.build-pre:
# Add your pre 'build' code here...
.build-post: .build-impl
# Add your post 'build' code here...
# clean
clean: .clean-post
.clean-pre:
# Add your pre 'clean' code here...
.clean-post: .clean-impl
# Add your post 'clean' code here...
# clobber
clobber: .clobber-post
.clobber-pre:
# Add your pre 'clobber' code here...
.clobber-post: .clobber-impl
# Add your post 'clobber' code here...
# all
all: .all-post
.all-pre:
# Add your pre 'all' code here...
.all-post: .all-impl
# Add your post 'all' code here...
# help
help: .help-post
.help-pre:
# Add your pre 'help' code here...
.help-post: .help-impl
# Add your post 'help' code here...
# include project implementation makefile
include nbproject/Makefile-impl.mk
# include project make variables
include nbproject/Makefile-variables.mk
#
# There exist several targets which are by default empty and which can be
# used for execution of your targets. These targets are usually executed
# before and after some main targets. They are:
#
# .build-pre: called before 'build' target
# .build-post: called after 'build' target
# .clean-pre: called before 'clean' target
# .clean-post: called after 'clean' target
# .clobber-pre: called before 'clobber' target
# .clobber-post: called after 'clobber' target
# .all-pre: called before 'all' target
# .all-post: called after 'all' target
# .help-pre: called before 'help' target
# .help-post: called after 'help' target
#
# Targets beginning with '.' are not intended to be called on their own.
#
# Main targets can be executed directly, and they are:
#
# build build a specific configuration
# clean remove built files from a configuration
# clobber remove all built files
# all build all configurations
# help print help mesage
#
# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
# .help-impl are implemented in nbproject/makefile-impl.mk.
#
# Available make variables:
#
# CND_BASEDIR base directory for relative paths
# CND_DISTDIR default top distribution directory (build artifacts)
# CND_BUILDDIR default top build directory (object files, ...)
# CONF name of current configuration
# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration)
# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration)
# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration)
# CND_PACKAGE_DIR_${CONF} directory of package (current configuration)
# CND_PACKAGE_NAME_${CONF} name of package (current configuration)
# CND_PACKAGE_PATH_${CONF} path to package (current configuration)
#
# NOCDDL
# Environment
MKDIR=mkdir
CP=cp
CCADMIN=CCadmin
RANLIB=ranlib
# build
build: .build-post
.build-pre:
# Add your pre 'build' code here...
.build-post: .build-impl
# Add your post 'build' code here...
# clean
clean: .clean-post
.clean-pre:
# Add your pre 'clean' code here...
.clean-post: .clean-impl
# Add your post 'clean' code here...
# clobber
clobber: .clobber-post
.clobber-pre:
# Add your pre 'clobber' code here...
.clobber-post: .clobber-impl
# Add your post 'clobber' code here...
# all
all: .all-post
.all-pre:
# Add your pre 'all' code here...
.all-post: .all-impl
# Add your post 'all' code here...
# help
help: .help-post
.help-pre:
# Add your pre 'help' code here...
.help-post: .help-impl
# Add your post 'help' code here...
# include project implementation makefile
include nbproject/Makefile-impl.mk
# include project make variables
include nbproject/Makefile-variables.mk

View File

@ -12,44 +12,55 @@
<logicalFolder name="SourceFiles"
displayName="Source Files"
projectFiles="true">
<itemPath>../../src/crl.c</itemPath>
<itemPath>../../src/internal.c</itemPath>
<itemPath>../../src/io.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>../../ctaocrypt/src/aes.c</itemPath>
<itemPath>../../ctaocrypt/src/arc4.c</itemPath>
<itemPath>../../ctaocrypt/src/asm.c</itemPath>
<itemPath>../../ctaocrypt/src/asn.c</itemPath>
<itemPath>../../ctaocrypt/src/coding.c</itemPath>
<itemPath>../../ctaocrypt/src/des3.c</itemPath>
<itemPath>../../ctaocrypt/src/dh.c</itemPath>
<itemPath>../../ctaocrypt/src/dsa.c</itemPath>
<itemPath>../../ctaocrypt/src/ecc.c</itemPath>
<itemPath>../../ctaocrypt/src/ecc_fp.c</itemPath>
<itemPath>../../ctaocrypt/src/error.c</itemPath>
<itemPath>../../ctaocrypt/src/hc128.c</itemPath>
<itemPath>../../ctaocrypt/src/hmac.c</itemPath>
<itemPath>../../ctaocrypt/src/integer.c</itemPath>
<itemPath>../../ctaocrypt/src/logging.c</itemPath>
<itemPath>../../ctaocrypt/src/md2.c</itemPath>
<itemPath>../../ctaocrypt/src/md4.c</itemPath>
<itemPath>../../ctaocrypt/src/md5.c</itemPath>
<itemPath>../../ctaocrypt/src/memory.c</itemPath>
<itemPath>../../ctaocrypt/src/misc.c</itemPath>
<itemPath>../../ctaocrypt/src/pwdbased.c</itemPath>
<itemPath>../../ctaocrypt/src/rabbit.c</itemPath>
<itemPath>../../ctaocrypt/src/random.c</itemPath>
<itemPath>../../ctaocrypt/src/ripemd.c</itemPath>
<itemPath>../../ctaocrypt/src/rsa.c</itemPath>
<itemPath>../../ctaocrypt/src/sha.c</itemPath>
<itemPath>../../ctaocrypt/src/sha256.c</itemPath>
<itemPath>../../ctaocrypt/src/sha512.c</itemPath>
<itemPath>../../ctaocrypt/src/tfm.c</itemPath>
<itemPath>../../ctaocrypt/src/wc_port.c</itemPath>
<logicalFolder name="f2" 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/hc128.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/rabbit.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>
</logicalFolder>
<logicalFolder name="f1" displayName="wolfssl" projectFiles="true">
<itemPath>../../src/crl.c</itemPath>
<itemPath>../../src/internal.c</itemPath>
<itemPath>../../src/io.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>
</logicalFolder>
</logicalFolder>
<logicalFolder name="ExternalFiles"
displayName="Important Files"
@ -61,6 +72,8 @@
<Elem>..</Elem>
<Elem>../../cyassl/ctaocrypt</Elem>
<Elem>../../ctaocrypt/src</Elem>
<Elem>../../src</Elem>
<Elem>../../wolfcrypt/src</Elem>
</sourceRootList>
<projectmakefile>Makefile</projectmakefile>
<confs>
@ -72,12 +85,21 @@
<targetPluginBoard></targetPluginBoard>
<platformTool>PKOBSKDEPlatformTool</platformTool>
<languageToolchain>XC32</languageToolchain>
<languageToolchainVersion>1.10</languageToolchainVersion>
<platform>3</platform>
<languageToolchainVersion></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>
@ -97,6 +119,7 @@
<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="-O3"/>
@ -104,13 +127,16 @@
<property key="post-instruction-scheduling" value="default"/>
<property key="pre-instruction-scheduling" value="default"/>
<property key="preprocessor-macros"
value="CYASSL_SHA512;CYASSL_SHA384;HAVE_ECC"/>
value="WOLFSSL_SHA512;WOLFSSL_SHA384;HAVE_ECC"/>
<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"/>
@ -135,8 +161,16 @@
<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=""/>
@ -164,6 +198,7 @@
<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=""/>
@ -174,10 +209,14 @@
<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>
@ -188,13 +227,17 @@
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"/>

View File

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

View File

@ -1,14 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://www.netbeans.org/ns/project/1">
<?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>cyassl</name>
<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>

View File

@ -19,8 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/* Name change compatibility layer */
#include <cyassl/ssl.h>
/* Name change compatibility layer no longer needs included here */
#ifdef HAVE_CONFIG_H
#include <config.h>

View File

@ -19,8 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/* Name change compatibility layer */
#include <cyassl/ssl.h>
/* Name change compatibility layer no longer needs to be included here */
#ifdef HAVE_CONFIG_H
#include <config.h>

View File

@ -19,8 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/* Name change compatibility layer */
#include <cyassl/ssl.h>
/* Name change compatibility layer no longer needs to be included here */
#ifdef HAVE_CONFIG_H
#include <config.h>

View File

@ -1,7 +1,6 @@
/* unit.c unit tests driver */
/* Name change compatibility layer */
#include <cyassl/ssl.h>
/* Name change compatibility layer no longer need to be included here */
#ifdef HAVE_CONFIG_H
#include <config.h>

View File

@ -807,7 +807,7 @@ int wc_Des3_SetKey(Des3* des3, const byte* key, const byte* iv, int dir)
#elif defined(WOLFSSL_PIC32MZ_CRYPT)
#include "wolfssl/ctaocrypt/port/pic32/pic32mz-crypt.h"
#include "wolfssl/wolfcrypt/port/pic32/pic32mz-crypt.h"
void wc_Des_SetIV(Des* des, const byte* iv);
int wc_Des3_SetIV(Des3* des, const byte* iv);

View File

@ -29,9 +29,9 @@
#if !defined(NO_MD5)
#ifdef WOLFSSL_PIC32MZ_HASH
#define wc_InitMd5 InitMd5_sw
#define wc_Md5Update Md5Update_sw
#define wc_Md5Final Md5Final_sw
#define wc_InitMd5 wc_InitMd5_sw
#define wc_Md5Update wc_Md5Update_sw
#define wc_Md5Final wc_Md5Final_sw
#endif
#include <wolfssl/wolfcrypt/md5.h>

View File

@ -0,0 +1,371 @@
/* pic32mz-hash.c
*
* Copyright (C) 2006-2015 wolfSSL Inc.
*
* This file is part of wolfSSL. (formerly known as CyaSSL)
*
* 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-1301, USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
#ifdef WOLFSSL_PIC32MZ_HASH
#include <wolfssl/wolfcrypt/logging.h>
#include <wolfssl/wolfcrypt/md5.h>
#include <wolfssl/wolfcrypt/sha.h>
#include <wolfssl/wolfcrypt/sha256.h>
#include <wolfssl/wolfcrypt/port/pic32/pic32mz-crypt.h>
#if !defined(NO_MD5) && !defined(NO_SHA) && !defined(NO_SHA256)
static uint8_t dataBuffer[PIC32MZ_MAX_BD][PIC32_BLOCK_SIZE] __attribute__((aligned (4), coherent));
static void reset_engine(pic32mz_desc *desc, int algo)
{
int i;
pic32mz_desc* uc_desc = KVA0_TO_KVA1(desc);
CECON = 1 << 6;
while (CECON);
/* Make sure everything is clear first before we make settings. */
XMEMSET((void *)&uc_desc->sa, 0, sizeof(uc_desc->sa));
/* Set up the security association */
uc_desc->sa.SA_CTRL.ALGO = algo ;
uc_desc->sa.SA_CTRL.LNC = 1;
uc_desc->sa.SA_CTRL.FB = 1;
uc_desc->sa.SA_CTRL.ENCTYPE = 1;
uc_desc->sa.SA_CTRL.LOADIV = 1;
/* Set up the buffer descriptor */
uc_desc->err = 0 ;
for (i = 0; i < PIC32MZ_MAX_BD; i++)
{
XMEMSET((void *)&uc_desc->bd[i], 0, sizeof(uc_desc->bd[i]));
uc_desc->bd[i].BD_CTRL.LAST_BD = 1;
uc_desc->bd[i].BD_CTRL.LIFM = 1;
uc_desc->bd[i].BD_CTRL.PKT_INT_EN = 1;
uc_desc->bd[i].SA_ADDR = KVA_TO_PA(&uc_desc->sa);
uc_desc->bd[i].SRCADDR = KVA_TO_PA(&dataBuffer[i]);
if (PIC32MZ_MAX_BD > i+1)
uc_desc->bd[i].NXTPTR = KVA_TO_PA(&uc_desc->bd[i+1]);
else
uc_desc->bd[i].NXTPTR = KVA_TO_PA(&uc_desc->bd[0]);
XMEMSET((void *)&dataBuffer[i], 0, PIC32_BLOCK_SIZE);
}
uc_desc->bd[0].BD_CTRL.SA_FETCH_EN = 1; // Fetch the security association on the first BD
desc->dbPtr = 0;
desc->currBd = 0;
desc->msgSize = 0;
desc->processed = 0;
CEBDPADDR = KVA_TO_PA(&(desc->bd[0]));
CEPOLLCON = 10;
CECON = 0x27;
}
#define PIC32MZ_IF_RAM(addr) (KVA_TO_PA(addr) < 0x80000)
static void update_data_size(pic32mz_desc *desc, word32 msgSize)
{
desc->msgSize = msgSize;
}
static void update_engine(pic32mz_desc *desc, const char *input, word32 len,
word32 *hash)
{
int total ;
pic32mz_desc *uc_desc = KVA0_TO_KVA1(desc);
uc_desc->bd[desc->currBd].UPDPTR = KVA_TO_PA(hash);
// Add the data to the current buffer. If the buffer fills, start processing it
// and fill the next one.
while (len)
{
// If the engine is processing the current BD, spin.
// if (uc_desc->bd[desc->currBd].BD_CTRL.DESC_EN)
// continue;
if (desc->msgSize)
{
// If we've been given the message size, we can process along the
// way.
// Enable the current buffer descriptor if it is full.
if (desc->dbPtr >= PIC32_BLOCK_SIZE)
{
// Wrap up the buffer descriptor and enable it so the engine can process
uc_desc->bd[desc->currBd].MSGLEN = desc->msgSize;
uc_desc->bd[desc->currBd].BD_CTRL.BUFLEN = desc->dbPtr;
uc_desc->bd[desc->currBd].BD_CTRL.LAST_BD = 0;
uc_desc->bd[desc->currBd].BD_CTRL.LIFM = 0;
//SYS_DEVCON_DataCacheClean((word32)desc, sizeof(pic32mz_desc));
uc_desc->bd[desc->currBd].BD_CTRL.DESC_EN = 1;
// Move to the next buffer descriptor, or wrap around.
desc->currBd++;
if (desc->currBd >= PIC32MZ_MAX_BD)
desc->currBd = 0;
// Wait until the engine has processed the new BD.
while (uc_desc->bd[desc->currBd].BD_CTRL.DESC_EN);
uc_desc->bd[desc->currBd].UPDPTR = KVA_TO_PA(hash);
desc->dbPtr = 0;
}
if (!PIC32MZ_IF_RAM(input)) // If we're inputting from flash, let the BD have the address and max the buffer size
{
uc_desc->bd[desc->currBd].SRCADDR = KVA_TO_PA(input);
total = (len > PIC32MZ_MAX_BLOCK ? PIC32MZ_MAX_BLOCK : len);
desc->dbPtr = total;
len -= total;
input += total;
}
else
{
if (len > PIC32_BLOCK_SIZE - desc->dbPtr)
{
// We have more data than can be put in the buffer. Fill what we can.
total = PIC32_BLOCK_SIZE - desc->dbPtr;
XMEMCPY(&dataBuffer[desc->currBd][desc->dbPtr], input, total);
len -= total;
desc->dbPtr = PIC32_BLOCK_SIZE;
input += total;
}
else
{
// Fill up what we have, but don't turn on the engine.
XMEMCPY(&dataBuffer[desc->currBd][desc->dbPtr], input, len);
desc->dbPtr += len;
len = 0;
}
}
}
else
{
// We have to buffer everything and keep track of how much has been
// added in order to get a total size. If the buffer fills, we move
// to the next one. If we try to add more when the last buffer is
// full, we error out.
if (desc->dbPtr == PIC32_BLOCK_SIZE)
{
// We filled the last BD buffer, so move on to the next one
uc_desc->bd[desc->currBd].BD_CTRL.LAST_BD = 0;
uc_desc->bd[desc->currBd].BD_CTRL.LIFM = 0;
uc_desc->bd[desc->currBd].BD_CTRL.BUFLEN = PIC32_BLOCK_SIZE;
desc->currBd++;
uc_desc->bd[desc->currBd].UPDPTR = KVA_TO_PA(hash);
desc->dbPtr = 0;
if (desc->currBd >= PIC32MZ_MAX_BD)
{
desc->err = 1;
}
}
if (len > PIC32_BLOCK_SIZE - desc->dbPtr)
{
// We have more data than can be put in the buffer. Fill what we can.
total = PIC32_BLOCK_SIZE - desc->dbPtr;
XMEMCPY(&dataBuffer[desc->currBd][desc->dbPtr], input, total);
len -= total;
desc->processed += total;
desc->dbPtr = PIC32_BLOCK_SIZE;
input += total;
}
else
{
// Fill up what we have
XMEMCPY(&dataBuffer[desc->currBd][desc->dbPtr], input, len);
desc->dbPtr += len;
desc->processed += len;
len = 0;
}
}
}
}
static void start_engine(pic32mz_desc *desc) {
// Wrap up the last buffer descriptor and enable it
int i ;
int bufferLen ;
pic32mz_desc *uc_desc = KVA0_TO_KVA1(desc);
bufferLen = desc->dbPtr;
if (bufferLen % 4)
bufferLen = (bufferLen + 4) - (bufferLen % 4);
uc_desc->bd[desc->currBd].BD_CTRL.BUFLEN = bufferLen;
uc_desc->bd[desc->currBd].BD_CTRL.LAST_BD = 1;
uc_desc->bd[desc->currBd].BD_CTRL.LIFM = 1;
if (desc->msgSize == 0)
{
// We were not given the size, so now we have to go through every BD
// and give it what will be processed, and enable them.
for (i = desc->currBd; i >= 0; i--)
{
uc_desc->bd[i].MSGLEN = desc->processed;
uc_desc->bd[i].BD_CTRL.DESC_EN = 1;
}
}
else
{
uc_desc->bd[desc->currBd].BD_CTRL.DESC_EN = 1;
}
}
void wait_engine(pic32mz_desc *desc, char *hash, int hash_sz) {
unsigned int i;
unsigned int *intptr;
pic32mz_desc *uc_desc = KVA0_TO_KVA1(desc);
enum {true = 1, false = 0} engineRunning = true;
while (engineRunning)
{
engineRunning = false;
for (i = 0; i < PIC32MZ_MAX_BD; i++)
engineRunning = engineRunning || uc_desc->bd[i].BD_CTRL.DESC_EN;
}
XMEMCPY(hash, KVA0_TO_KVA1(hash), hash_sz) ;
#ifdef DEBUG_CYASSL
print_mem(KVA0_TO_KVA1(hash), hash_sz) ;
print_mem( hash , hash_sz) ;
#endif
for (i = 0, intptr = (unsigned int *)hash; i < hash_sz/sizeof(unsigned int);
i++, intptr++)
{
*intptr = ntohl(*intptr);
}
}
static int fillBuff(char *buff, int *bufflen, const char *data, int len, int blocksz)
{
int room, copysz ;
room = blocksz - *bufflen ;
copysz = (len <= room) ? len : room ;
XMEMCPY(buff, data, copysz) ;
*bufflen += copysz ;
return (*bufflen == blocksz) ? 1 : 0 ;
}
#endif
#ifndef NO_MD5
void wc_InitMd5(Md5* md5)
{
WOLFSSL_ENTER("InitMd5\n") ;
XMEMSET((void *)md5, 0xcc, sizeof(Md5)) ;
XMEMSET((void *)KVA0_TO_KVA1(md5), 0xcc, sizeof(Md5)) ;
reset_engine(&(md5->desc), PIC32_ALGO_MD5) ;
}
void wc_Md5Update(Md5* md5, const byte* data, word32 len)
{
WOLFSSL_ENTER("Md5Update\n") ;
update_engine(&(md5->desc), data, len, md5->digest) ;
}
void wc_Md5Final(Md5* md5, byte* hash)
{
WOLFSSL_ENTER("Md5Final\n") ;
start_engine(&(md5->desc)) ;
wait_engine(&(md5->desc), (char *)md5->digest, MD5_HASH_SIZE) ;
XMEMCPY(hash, md5->digest, MD5_HASH_SIZE) ;
wc_InitMd5(md5); /* reset state */
}
void Md5SizeSet(Md5* md5, word32 len)
{
WOLFSSL_ENTER("Md5SizeSet\n");
md5->desc.msgSize = len;
}
#endif
#ifndef NO_SHA
int wc_InitSha(Sha* sha)
{
WOLFSSL_ENTER("InitSha\n") ;
XMEMSET((void *)sha, 0xcc, sizeof(Sha)) ;
XMEMSET((void *)KVA0_TO_KVA1(sha), 0xcc, sizeof(Sha)) ;
reset_engine(&(sha->desc), PIC32_ALGO_SHA1) ;
return 0;
}
int wc_ShaUpdate(Sha* sha, const byte* data, word32 len)
{
WOLFSSL_ENTER("ShaUpdate\n") ;
update_engine(&(sha->desc), data, len, sha->digest) ;
return 0;
}
int wc_ShaFinal(Sha* sha, byte* hash)
{
WOLFSSL_ENTER("ShaFinal\n") ;
start_engine(&(sha->desc)) ;
wait_engine(&(sha->desc), (char *)sha->digest, SHA1_HASH_SIZE) ;
XMEMCPY(hash, sha->digest, SHA1_HASH_SIZE) ;
wc_InitSha(sha); /* reset state */
return 0;
}
void ShaSizeSet(Sha* sha, word32 len)
{
sha->desc.msgSize = len;
}
#endif /* NO_SHA */
#ifndef NO_SHA256
int wc_InitSha256(Sha256* sha256)
{
WOLFSSL_ENTER("InitSha256\n") ;
XMEMSET((void *)sha256, 0xcc, sizeof(Sha256)) ;
XMEMSET((void *)KVA0_TO_KVA1(sha256), 0xcc, sizeof(Sha256)) ;
reset_engine(&(sha256->desc), PIC32_ALGO_SHA256) ;
return 0;
}
int wc_Sha256Update(Sha256* sha256, const byte* data, word32 len)
{
WOLFSSL_ENTER("Sha256Update\n") ;
update_engine(&(sha256->desc), data, len, sha256->digest) ;
return 0;
}
int wc_Sha256Final(Sha256* sha256, byte* hash)
{
WOLFSSL_ENTER("Sha256Final\n") ;
start_engine(&(sha256->desc)) ;
wait_engine(&(sha256->desc), (char *)sha256->digest, SHA256_HASH_SIZE) ;
XMEMCPY(hash, sha256->digest, SHA256_HASH_SIZE) ;
wc_InitSha256(sha256); /* reset state */
return 0;
}
void Sha256SizeSet(Sha256* sha256, word32 len)
{
WOLFSSL_ENTER("Sha256SizeSet\n");
sha256->desc.msgSize = len;
}
#endif /* NO_SHA256 */
#endif

View File

@ -29,17 +29,17 @@
#ifdef WOLFSSL_PIC32MZ_HASH
#define wc_InitMd5 InitMd5_sw
#define wc_Md5Update Md5Update_sw
#define wc_Md5Final Md5Final_sw
#define wc_InitMd5 wc_InitMd5_sw
#define wc_Md5Update wc_Md5Update_sw
#define wc_Md5Final wc_Md5Final_sw
#define wc_InitSha InitSha_sw
#define wc_ShaUpdate ShaUpdate_sw
#define wc_ShaFinal ShaFinal_sw
#define wc_InitSha wc_InitSha_sw
#define wc_ShaUpdate wc_ShaUpdate_sw
#define wc_ShaFinal wc_ShaFinal_sw
#define wc_InitSha256 InitSha256_sw
#define wc_Sha256Update Sha256Update_sw
#define wc_Sha256Final Sha256Final_sw
#define wc_InitSha256 wc_InitSha256_sw
#define wc_Sha256Update wc_Sha256Update_sw
#define wc_Sha256Final wc_Sha256Final_sw
#endif

View File

@ -64,6 +64,13 @@
#else /* else build without fips */
#ifdef WOLFSSL_PIC32MZ_HASH
#define wc_InitSha wc_InitSha_sw
#define wc_ShaUpdate wc_ShaUpdate_sw
#define wc_ShaFinal wc_ShaFinal_sw
#endif
#ifdef FREESCALE_MMCAU
#include "cau_api.h"
#define XTRANSFORM(S,B) cau_sha1_hash_n((B), 1, ((S))->digest)

View File

@ -56,9 +56,9 @@ int wc_Sha256Hash(const byte* data, word32 len, byte* out)
}
#else /* else build without fips */
#ifdef WOLFSSL_PIC32MZ_HASH
#define wc_InitSha256 InitSha256_sw
#define wc_Sha256Update Sha256Update_sw
#define wc_Sha256Final Sha256Final_sw
#define wc_InitSha256 wc_InitSha256_sw
#define wc_Sha256Update wc_Sha256Update_sw
#define wc_Sha256Final wc_Sha256Final_sw
#endif
#ifdef HAVE_FIPS

0
wolfcrypt/src/sha512.c Normal file → Executable file
View File

View File

@ -49,7 +49,7 @@ enum {
MD5_PAD_SIZE = 56
};
#if defined(CYASSL_PIC32MZ_HASH) || defined(WOLFSSL_PIC32MZ_HASH)
#if defined(WOLFSSL_PIC32MZ_HASH)
#include "port/pic32/pic32mz-crypt.h"
#endif
@ -59,7 +59,7 @@ typedef struct Md5 {
word32 loLen; /* length in bytes */
word32 hiLen; /* length in bytes */
word32 buffer[MD5_BLOCK_SIZE / sizeof(word32)];
#if !defined(CYASSL_PIC32MZ_HASH) || !defined(WOLFSSL_PIC32MZ_HASH)
#if !defined(WOLFSSL_PIC32MZ_HASH)
word32 digest[MD5_DIGEST_SIZE / sizeof(word32)];
#else
word32 digest[PIC32_HASH_SIZE / sizeof(word32)];

View File

@ -22,13 +22,63 @@
#ifndef PIC32MZ_CRYPT_H
#define PIC32MZ_CRYPT_H
#if defined(CYASSL_PIC32MZ_CRYPT) || defined(WOLFSSL_PIC32MZ_CRYPT)
#ifdef WOLFSSL_MICROCHIP_PIC32MZ
#define MICROCHIP_PIC32
#include <xc.h>
#include <sys/endian.h>
#include <sys/kmem.h>
#include "../../../../mplabx/crypto.h"
typedef struct saCtrl {
unsigned int CRYPTOALGO : 4;
unsigned int MULTITASK : 3;
unsigned int KEYSIZE : 2;
unsigned int ENCTYPE : 1;
unsigned int ALGO : 7;
unsigned int : 3;
unsigned int FLAGS : 1;
unsigned int FB : 1;
unsigned int LOADIV : 1;
unsigned int LNC : 1;
unsigned int IRFLAG : 1;
unsigned int ICVONLY : 1;
unsigned int OR_EN : 1;
unsigned int NO_RX : 1;
unsigned int : 1;
unsigned int VERIFY : 1;
unsigned int : 2;
} saCtrl;
typedef struct securityAssociation {
saCtrl SA_CTRL;
unsigned int SA_AUTHKEY[8];
unsigned int SA_ENCKEY[8];
unsigned int SA_AUTHIV[8];
unsigned int SA_ENCIV[4];
} securityAssociation;
typedef struct bdCtrl {
unsigned int BUFLEN : 16;
unsigned int CBD_INT_EN : 1;
unsigned int PKT_INT_EN : 1;
unsigned int LIFM : 1;
unsigned int LAST_BD: 1;
unsigned int : 2;
unsigned int SA_FETCH_EN : 1;
unsigned int : 8;
unsigned int DESC_EN : 1;
} bdCtrl;
typedef struct bufferDescriptor {
bdCtrl BD_CTRL;
unsigned int SA_ADDR;
unsigned int SRCADDR;
unsigned int DSTADDR;
unsigned int NXTPTR;
unsigned int UPDPTR;
unsigned int MSGLEN;
unsigned int ENCOFF;
} bufferDescriptor;
#define PIC32_ENCRYPTION 0b1
@ -74,7 +124,7 @@ typedef struct { /* Crypt Engine descripter */
#define WAIT_ENGINE \
{ volatile int v ; while (CESTATbits.ACTIVE) ; for(v=0; v<100; v++) ; }
#if defined(DEBUG_CYASSL) || defined(DEBUG_WOLFSSL)
#ifdef DEBUG_CYASSL
static void print_mem(const unsigned char *p, int size) {
for(; size>0; size--, p++) {
if(size%4 == 0)printf(" ") ;

View File

@ -165,6 +165,7 @@
#define NO_FILESYSTEM
#define USE_FAST_MATH
#define TFM_TIMING_RESISTANT
#define NEED_AES_TABLES
#endif
#ifdef WOLFSSL_MICROCHIP_PIC32MZ
@ -176,7 +177,6 @@
#define WOLFSSL_AES_COUNTER
#define HAVE_AESGCM
#define NO_BIG_INT
#endif
#ifdef MICROCHIP_TCPIP_V5