1

(2 replies, posted in wolfCrypt)

Thanks Eric,

Will do.

ACV

2

(2 replies, posted in wolfCrypt)

I've been using wolfCrypt v 4.3.0 on a custom MIPS core for several years now. I had a few issues with RSA to start but they were due to a malformatted private key. Once that was resolved, everything worked great. Now we have developed a RISC-V core (specifically rv32im/ilp32 -- this is a 32-bit, 32-register core with integer multiply / divide). RISC-V and MIPS are very close in architecture. I figured that these two cores are close enough that I could reuse the configuration file. That appears to not be the case. When I run my RSA tests both the encryption and decryption fail.

On RSA encryption, I am encrypting a 16-byte plain-text block to a 128-byte cipher-text block. The encryption seems to work identically to the MIPS but the block cannot be decrypted.

On RSA decryption, I am decrypting the encrypted 128-byte block. The decryption function fails with either "mp_exptmod error state" or "RSA buffer error, output too small or input too big".

I have the same code running in an MINGW64_NT-10.0-19042 / Unity Test / gcc (10.3.0) and in this test environment, everything works as expected. I can encrypt and decrypt without issue. Note this code emulates an internal random number generator, malloc/free, key structure, etc. It emulates the target environment as much as possible. They keys and the RNG have been verified to be correct.

I've attempted to move forward to use 4.8.1, but that doesn't work either. The one difference is that it fails in the Unity Test environment and the target environment.

I've gone over the manual and the configuration several times to try to work out what may be happening with no luck.

I've attached the code I'm running and sample output.

If the library is built using WOLFCRYPT_ONLY do I need to execute wolfSSL_Init() before I make any wc_* calls?
I don't think I do, but there may be a parallel wc_Init() call(?)

We are developing a RISC-V rv32im / ilp32 core. Eventually it will support the atomic and compressed instructions. However at this point it does not. For reasons beyond this discussion, that means that the autoconf build isn't going to work for me right now. This leaves me with the second build option WOLF_USER_SETTINGS. I am able to build the library using this method.

I looked at the .../IDE/RISCV settings. This directory should be called .../IDE/SIFIVE-RISCV. The defines in the HIFIVE directory are specific to the the E310 (rv32imac). Unfortunately this won't work for my project. Ideally I would be able to select the RISCV core configuration and wouldn't be tied to a specific vendor / chip.

I looked at the examples/configs. The closest thing is the stm32. However there is quite a bit of STM32Fxxx / Cube specifics. Ideally there would be a 32-bit / little endian / hardware multiplier / XMALLOC example that I could build on.

Is there a generic 32-bit / little endian / hardware multiplier / XMALLOC example that doesn't have any processor specifics in it?

Is there a "configuration guide" that goes through the settings and describes what they do and why I might need them?

I am working on a deeply embedded application using a RISC-V core (specifically rv32im/ilp32 -- this is a 32-bit, 32-register core with integer multiply / divide). I don't need SSL, I just need wolfCrypt.

I looked through wolfSSL User Manual / August 2019 / Version 4.1.0, which I believe to be the latest version and didn't see anything  specific about building wolfCrypt.

I probably missed it, but if you could hint me in the right direction, that would be most appreciated.

ACV

6

(9 replies, posted in wolfSSL (formerly CyaSSL))

Eric,

Thanks for letting me know.

ACV

7

(9 replies, posted in wolfSSL (formerly CyaSSL))

No spaces in the path. And the path is very short too. It's c:\dev\wolfss-4.8.1.

8

(9 replies, posted in wolfSSL (formerly CyaSSL))

Akk. Forgot the most important thing.

I have attached it to the previous post.

The error appears to be the same.

9

(9 replies, posted in wolfSSL (formerly CyaSSL))

Eric,

I started with a clean version of wolfssl-4.8.1.
Here are the commands I ran:

.configure
make check > make_check.log 2>&1

The attached zip file contains make_check.log and test-suite.log.

ACV

10

(9 replies, posted in wolfSSL (formerly CyaSSL))

I'm following the instructions in section 2.2 of the wolfSSL User Manual / August 2019 / Version 4.1.0 (latest?) to build and test wolfSSL. Here are the commands I execute:

./configure
make
./testsuite/testsuite.test

There are two failures in the test log (see attached). The first is:

can't open ./certs/client-key.der, Please run from wolfSSL home dir error = -40

I am following the instructions and am running the test suite as noted in the documentation: from the wolfSSL home directory.

System: MINGW64_NT-10.0-19042 -- this is a very recent build of msys2.
Compiler: gcc.exe (Rev5, Built by MSYS2 project) 10.3.0

Any idea why this is happening?