wolfssl icon indicating copy to clipboard operation
wolfssl copied to clipboard

Riscv Qemu

Open shirinebadi opened this issue 1 year ago • 3 comments

Version

latest

Description

Hi.

I want to cross compile WolfSSL to Risc-v on Qemu. I use x64 architecture. I want to know if it is possible to do that and if there is any tutorials for it?

shirinebadi avatar Sep 04 '24 19:09 shirinebadi

Hi @shirinebadi ,

Thanks for your interest in using wolfSSL. Have you seen our new --enable-riscv-asm speedup option? It provides significant speedups for symmetric algorithms like AES/SHA on RISC-V. You can see some of the recent pull requests here: https://github.com/wolfSSL/wolfssl/pulls?q=is%3Apr+is%3Aclosed+RISC-V Can you tell us more about your project?

@SparkiDev will you share some of your tips for testing RISC-V on QEMU?

Thanks, David Garske, wolfSSL

dgarske avatar Sep 04 '24 20:09 dgarske

This command should work? ./configure --enable-riscv-asm --enable-all Since I'm cross compling, do I need to set any other flags?

I'm trying to integrate SSL with Keystone

shirinebadi avatar Sep 04 '24 20:09 shirinebadi

Hi @shirinebadi,

I use the gcc cross-compiler. To install on Ubuntu:

sudo apt install gcc-riscv64-linux-gnu

If the CPU you want to emulate has just the base standard and no extensions, the QEMU you have will work. Otherwise, you will need to get the very latest.

The configuration and make lines:

autogen.sh
./configure --disable-shared --enable-all LDFLAGS=--static --host=riscv64 CC=riscv64-linux-gnu-gcc --enable-riscv-asm
make

Note this will build a static application that has all the QEMU code built-in.

To run testing:

./wolfcrypt/test/testwolfcrypt

To run benchmarking:

./wolfcrypt/benchmark/benchmark

Give it a go and let know how it goes.

Sean

SparkiDev avatar Sep 04 '24 22:09 SparkiDev

Hi @shirinebadi,

Have you had any success cross-compiling for RISC-V?

Thanks, Sean

SparkiDev avatar Oct 31 '24 00:10 SparkiDev

Hi @SparkiDev. Thanks for your complete explanation. My research requirements changed and we decided to use BoringSSL. Thanks.

shirinebadi avatar Oct 31 '24 20:10 shirinebadi