Zvksh Proof of Concept
The sm3-test.c file contains a set of functions verifying and
showcasing usage of instructions implementing SM3 algorithm (see [1])
defined by the Zvksh extension (see [2]).
Pre-requisites:
- riscv64-linux-gnu toolchain available in PATH.
- Zvksh-enabled binutils-gdb available in PATH overriding the above
toolchain.
- Zvksh-enabled Spike available in PATH.
- RISC-V Proxy kernel (riscv-pk) compiled and available in
~/RISC-V/riscv64-linux-gnu/bin/pk (can be overridden with PK make
variable).
The default make target will compile all examples and run them in Spike
simulator.
Example make invocation:
# Build and run Zvksh tests with default parameters
make run-sm3
# Override riscv-pk location
make run-sm3 PK=/opt/prefix/riscv64-linux-gnu/bin/pk
# Override target triplet and riscv-pk location
make run-sm3 TARGET=riscv64-unknown-linux-gnu \
PK=/opt/prefix/riscv64-linux-gnu/bin/pk
Make targets:
- sm3-test - compiles the PoC code.
- run-sm3 - Executes the compiled binary in Spike.
- clean - Cleans the build artifacts.
Make variables:
- TARGET - Target triplet to use. By default riscv64-linux-gnu.
- PK - Location of the riscv-pk binary. By default it's
~/RISC-V/$(TARGET)/bin/pk
See Makefile for more details.
[1] https://datatracker.ietf.org/doc/html/draft-oscca-cfrg-sm3-00
[2] https://github.com/riscv/riscv-crypto/releases
Signed-off-by:
Eric Gouriou <ego@rivosinc.com>
Signed-off-by:
Albert Jakieła <aja@semihalf.com>
Signed-off-by:
Kornel Duleba <mindal@semihalf.com>
Signed-off-by:
Eric Gouriou <ego@rivosinc.com>
parent
585b90f1
Please register or sign in to comment