Can I just build the wolfcrypt/ctaocrypt subset of the WolfSSL library on TIRTOS?
Thereby avoiding the NDK dependency. If so how?
You are not logged in. Please login or register.
Please post questions or comments you have about wolfSSL products here. It is helpful to be as descriptive as possible when asking your questions.
ReferenceswolfSSL - Embedded SSL Library → Posts by JeffWhite
Pages 1
Can I just build the wolfcrypt/ctaocrypt subset of the WolfSSL library on TIRTOS?
Thereby avoiding the NDK dependency. If so how?
Hi
I'm trying to use CyaSSL to sign and verify data payload on MSP430 and have got small example (sort of!) working on TivaC evaluation board but porting to MSP430F6779 I have found a dependency on the TI NDK which is only supported on a limited number of TI boards e.g. TMS320C6000 family and ARM processors.
Code from "C:/cyassl/cyassl/ctaocrypt/settings.h" below:
#ifdef CYASSL_TIRTOS
#define SIZEOF_LONG_LONG 8
#define NO_WRITEV
#define NO_CYASSL_DIR
#define USE_FAST_MATH
#define TFM_TIMING_RESISTANT
#define NO_DEV_RANDOM
#define NO_FILESYSTEM
#define USE_CERT_BUFFERS_2048
#define NO_ERROR_STRINGS
#define USER_TIME
#ifdef __IAR_SYSTEMS_ICC__
#pragma diag_suppress=Pa089
#elif !defined(__GNUC__)
/* Suppress the sslpro warning */
#pragma diag_suppress=11
#endif
#include <ti/ndk/nettools/mytime/mytime.h>
#endif
This seems to suggest that CyaSSL can only be used on TMS320C6000 and TivaC devices???
Isn't this a little limiting?
What's the alternative to users of MSP430 devices?? PolarSSL ??
Regards
Jeff White
Hi Chris
The public key was exported from the TLS certificate associated with the private key.
The extraction was done on a Windows C# program using Bouncy Castle.
Regards
Jeff White
Hi
I am trying to verify a data payload supplied with a RSA signature generated from the SHA256 hash of the data.
The WolfSSL example code seems to work if using the private key but it fails with the following error when using the public key.
MP_EXPTMOD_E -112 mp_exptmod error state
Can anyone explain what this error code means?
Code shown here...
##############################################
// Create a hash of the payload
InitSha256(&sha);
Sha256Update(&sha, payload, sizeof(payload));
Sha256Final(&sha, hash);
//ret = CyaSSL_KeyPemToDer(privateKeyPem, sizeof(privateKeyPem), privateKeyDerFromPem,
// sizeof(privateKeyDerFromPem), NULL);
InitRsaKey(&prikey, NULL); // not using heap hint. No custom memory
ret = RsaPrivateKeyDecode(privateKeyDer, &idx, &prikey, sizeof(privateKeyDer));
if( ret != 0 )
{
// error parsing private key
}
idx = 0 ;
InitRsaKey(&pubkey, NULL); // not using heap hint. No custom memory
ret = RsaPublicKeyDecode(publicKeyDer, &idx, &pubkey, sizeof(publicKeyDer));
if( ret != 0 )
{
// error parsing public key
}
// Sign with private key
ret = RsaSSL_Sign(hash, sizeof(hash), out, sizeof(out), &prikey, &rng);
if (ret < 0) {
return -1;
}
// Verify with private key
memset(plain, 0, sizeof(plain));
ret = RsaSSL_Verify(out, ret, plain, sizeof(plain), &prikey);
if (ret < 0) {
return -1;
}
memset(plain, 0, sizeof(plain));
ret = RsaSSL_Verify(out, ret, plain, sizeof(plain), &pubkey);
if (ret < 0) {
return -1;
}
##############################################
Regards
Jeff White
Pages 1
wolfSSL - Embedded SSL Library → Posts by JeffWhite
Powered by PunBB, supported by Informer Technologies, Inc.
Generated in 0.017 seconds (95% PHP - 5% DB) with 5 queries